Code Monkey home page Code Monkey logo

Comments (4)

misterunknown avatar misterunknown commented on August 16, 2024

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.

swurzinger avatar swurzinger commented on August 16, 2024

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.

misterunknown avatar misterunknown commented on August 16, 2024

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.

misterunknown avatar misterunknown commented on August 16, 2024

I added the ability to use environment variables to configure the IFM. See also this wiki page.

from ifm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.