secure-77 / Perlite

A web-based markdown viewer optimized for Obsidian
https://perlite.secure77.de/
MIT License
968 stars 81 forks source link

Move config to separate file (eg config.php) #119

Open russell-phillips opened 4 months ago

russell-phillips commented 4 months ago

Is your feature request related to a problem? Please describe. I have a couple of perlite sites, configured by editing helper.php

When updating perlite, I have to make a copy of helper.php, then re-add my configuration.

Describe the solution you'd like I'd like a separate file named something like 'config.php' that can hold any custom configuration. Ideally, it wouldn't be included in releases, so that I could update perlite without overwriting my configuration.

Describe alternatives you've considered It might be simpler/better to have the default configuration in one file (eg config.php) and any overriding local configuration in another file (eg config_local.php)

Additional context This is a setup I've seen used to good effect in other server software such as Kanboard and Dokuwiki.

secure-77 commented 4 months ago

Hey @russell-phillips.

For adjusting the variables, you can also use your php-fpm config files, of course if you have more then one instance running you need more configurations (pools) but this way you don't need to adjust the php files.

But I already thought about to separate some "more likely changed by user" code to another file, can you tell me if there is anything else besides the env variables you have adjusted?

russell-phillips commented 4 months ago

I've added a bit of CSS to helper.php to make the sidebar always visible (to work around #120)