Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Making config.php less dynamic

We're trying to use a Vanilla forum on a site that uses Amazon Elastic Beanstalk. Basically, this is a loadbalanced setup where you upload a "packaged" copy of a site, and it deploys it across many instances.

This works fine from a users-and-messages perspective-- the database is on a seperate server-- but Vanilla stores an unusual amount of data in conf/config.php, and rewrites it when the admin changes something. This obviously makes trouble with Elastic Beanstalk, because if we upload a new site "package", it wipes out the old conf/config.php and all the settings it contained. There is also likely to be instance variability.

Most other packages I've seen will store only "permanent" stuff-- paths, database credentials-- in the config file, and anything remotely dynamic is in the database.

Are there any extensions for Vanilla that move more config data into the database? I could see modifying the code that generates config.php to write the code out to a storage table the database, and then replacing the "real" config.php with just the database connection code and some logic that fetched the code from the database and executed it

Comments

  • peregrineperegrine MVP
    edited December 2013

    WebOp said:
    Are there any extensions for Vanilla that move more config data into the database?

    no.

    you would probably need to modify the core class.configuration.php to read from database. and functions.general.php at the very least.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • The config file is used to store configuration data. When the configuration changes, the file is rewritten.

    The good news is you can overwrite the C(), SaveToConfig(), and RemoveFromConfig() functions by defining them in your bootstrap before file. The original versions of these functions are found in /library/core/functions.general.php. Have them load up your own version of the Gdn_Configuration and Gdn_ConfigurationModel classes.

    Seems like a fools errand to me.

    I would move the config file to a writeable path and update your bootstrap.before.php file to define the PATH_CONF and PATH_LOCAL_CONF definitions and call it a day.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Most of the cloud solutions have a way to deal with these situation, I suspect the answer is in their dehumanisation.

    other people have succeed in implementing on similar services.

    grep is your friend.

Sign In or Register to comment.