shotshare icon indicating copy to clipboard operation
shotshare copied to clipboard

[Enhancement] Store config in a configuration file instead of relying on environment variables

Open EmberHeartshine opened this issue 1 year ago • 2 comments

Title. I'm trying to hack together a bare metal install (instead of using docker) and while I totally can define environment variables at runtime (or in my php.ini file, or through nginx directives), I'd really rather not mess with root-owned files as much as possible. For Docker installs, it would more or less replace the .env file with some PHP variable definitions in a file named, say, config.php. I would personally model it after Nextcloud's configuration:

<?php
     $CONFIG = array (
          'HOST' => ':80`,
          'REQUIRE_HTTPS' => 'true',
     );

and so on. If you really want to keep using environment variables, the default config could probably look like this:

<?php
     $CONFIG = array (
          'HOST' => getenv( 'HOST' ),
          'REQUIRE_HTTPS' => getenv( 'REQUIRE_HTTPS' ),
     );

and so on.

EmberHeartshine avatar Jan 22 '24 14:01 EmberHeartshine

Hey @EmberHeartshine, circling back here. I am not sure I see a huge value here, Docker should allow you to natively do an env file, if you don’t want to use compose or inline env cars. Let me know if I am missing something here.

mdshack avatar Mar 09 '24 15:03 mdshack

This is for installs not using Docker.

EmberHeartshine avatar Mar 09 '24 15:03 EmberHeartshine

Going to go ahead and close this one - since the application itself relies environment variables there are a number of ways to set these for the PHP environment (outside of .env) that could vary from runtime to runtime, thus I think the primary supported method of deployment will by Docker for now, and other installation methods should be community supported (keeping the maintenance burden lower for myself/any other contributors).

mdshack avatar Aug 09 '24 18:08 mdshack