Comments (4)
I understand your point. As you already pointed out, I don't want to look for a hard-coded config file as this would be a potential security risk. Nevertheless there are several approches which can solve this problem. Please tell me a bit more about the use case you think of.
I recently discussed the lack of a user management in #32, where I sketched out a possible wrapper for the IFM (you can find a very quick'n'dirty, unsecure, proof-of-concept here).
Depending on your actual use case, you could possibly use the libifm.php
which gets compiled into the build
directory. This is basically a complete IFM, but doesn't get started automatically. Combined with the ability to pass a custom config array in the constructor, if might be sufficient for you to do something like that:
<?php
require_once( "/any/where/libifm.php" );
$YOUR_CUSTOM_CONFIG = array(); // get the config array from anywhere
$ifm = new IFM( $YOUR_CUSTOM_CONFIG );
$ifm->run();
from ifm.
I just thought about simplifying the update process when a new version of IFM is released or a Git build should be integrated. In that case one typically wants to keep the configuration, but update the code. Ideally the code could just be copied from the release archive without any further adaptations, replacing the old file(s).
Consider it as "nice to have" feature-request.
I haven't tried your code yet, but it seems to be a nice solution as it requires to update the libifm.php only while the configuration/launcher script can stay unchanged (as long as there are no breaking changes in the configuration/initialization).
from ifm.
Well, yes, updating the IFM is not straightforward at the moment.
I just thought about reading the configuration from environment variables, if they exist. On the one side these are quite easy to set (regardless wheather you use mod_php or php-fpm) and on the other side it is secure, as you can't modify them directly using the IFM. Furthermore there is no need for a wrapper script or any other overhead.
I'll implement this in a separate branch and let you know.
from ifm.
I added the ability to use environment variables to configure the IFM. See also this wiki page.
from ifm.
Related Issues (20)
- Folder upload doesn't work HOT 1
- How to use a non-user owner:group to delete files in a folder HOT 3
- Discussion: Current state HOT 3
- Outdated release (Oct 2020) HOT 1
- Hint on where the configuration is contained HOT 2
- ZipArchive Class Not Found HOT 1
- Directory Access? HOT 2
- Corrupted picture files HOT 3
- PHP Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) HOT 1
- [up] arrow does not return to previous directory HOT 1
- Hi there - I need to get help with root_dir HOT 1
- Option to sort folders first HOT 4
- $initialWD is deprecated HOT 1
- Confirm Download Dialog ? HOT 1
- Enable logs HOT 5
- Invalid argument supplied for foreach HOT 1
- Long load time HOT 1
- Error during build Docker Image HOT 1
- Using Docker, unable to login using authentication HOT 3
- Change Last Modified Timestamp Format HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ifm.