Skip to content

Commit ebe5e27

Browse files
dgarciabrisenoDaniel Garcia Briseno
andauthored
Use settings from settings from env (#457)
Co-authored-by: Daniel Garcia Briseno <daniel.garciabriseno@nasa.gov>
1 parent 4fe88e0 commit ebe5e27

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

settings/Private.Example.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22
/**
33
* Database Information
44
*/
5-
define("HV_DB_HOST", "localhost");
6-
define("HV_DB_NAME", "helioviewer");
7-
define("HV_DB_USER", "helioviewer");
8-
define("HV_DB_PASS", "helioviewer");
5+
define("HV_DB_HOST", $_ENV['HV_DB_HOST'] ?? "localhost");
6+
define("HV_DB_NAME", $_ENV['HV_DB_NAME'] ?? "helioviewer");
7+
define("HV_DB_USER", $_ENV['HV_DB_USER'] ?? "helioviewer");
8+
define("HV_DB_PASS", $_ENV['HV_DB_PASS'] ?? "helioviewer");
99

1010
/**
1111
* Redis Database Information
1212
* Used for rate-limiting
1313
*/
14-
define("HV_REDIS_HOST","127.0.0.1");
15-
define("HV_REDIS_PORT",6379);
14+
define("HV_REDIS_HOST", $_ENV['HV_REDIS_HOST'] ?? "127.0.0.1");
15+
define("HV_REDIS_PORT", $_ENV['HV_REDIS_PORT'] ?? 6379);
1616

1717
/**
1818
* In order to enable users to submit videos to YouTube, you must register for
1919
* a developer key which is included with each request. For more information
2020
* and to request a key, see:
2121
* http://code.google.com/apis/youtube/overview.html
2222
*/
23-
define("HV_YOUTUBE_DEVELOPER_KEY", "");
24-
define("HV_GOOGLE_OAUTH2_CLIENT_ID", "");
25-
define("HV_GOOGLE_OAUTH2_CLIENT_SECRET", "");
23+
define("HV_YOUTUBE_DEVELOPER_KEY", $_ENV['HV_YOUTUBE_DEVELOPER_KEY'] ?? "");
24+
define("HV_GOOGLE_OAUTH2_CLIENT_ID", $_ENV['HV_GOOGLE_OAUTH2_CLIENT_ID'] ?? "");
25+
define("HV_GOOGLE_OAUTH2_CLIENT_SECRET", $_ENV['HV_GOOGLE_OAUTH2_CLIENT_SECRET'] ?? "");
2626

2727
/**
2828
* Password to use when generating unique movie IDs. This can be any random
2929
* string, e.g. "8sHNa4ju". It is used during hashing to create public
3030
* video id's that can be used for sharing.
3131
*/
32-
define("HV_MOVIE_ID_PASS", "");
32+
define("HV_MOVIE_ID_PASS", $_ENV['HV_MOVIE_ID_PASS'] ?? "");
3333

3434
/**
3535
* bit.ly API user and key
@@ -38,16 +38,16 @@
3838
* Twitter etc. For more information and to register for a free API key, see:
3939
* http://code.google.com/p/bitly-api/wiki/ApiDocumentation
4040
*/
41-
define("HV_BITLY_USER", "");
42-
define("HV_BITLY_ALLOWED_DOMAIN", ""); // string to validate correct domain name when using AJAX
43-
define("HV_BITLY_API_KEY", "");
44-
define("HV_SHORTENER_REDIS_DB", 10);
41+
define("HV_BITLY_USER", $_ENV['HV_BITLY_USER'] ?? "");
42+
define("HV_BITLY_ALLOWED_DOMAIN", $_ENV['HV_BITLY_ALLOWED_DOMAIN'] ?? ""); // string to validate correct domain name when using AJAX
43+
define("HV_BITLY_API_KEY", $_ENV['HV_BITLY_API_KEY'] ?? "");
44+
define("HV_SHORTENER_REDIS_DB", $_ENV['HV_SHORTENER_REDIS_DB'] ?? 10);
4545

4646
/**
4747
* Proxy Settings
4848
*/
49-
define("HV_PROXY_HOST", "");
50-
define("HV_PROXY_USER_PASSWORD", ""); // must be a string in username:password format, leave it empty if proxy do not use authorization
49+
define("HV_PROXY_HOST", $_ENV['HV_PROXY_HOST'] ?? "");
50+
define("HV_PROXY_USER_PASSWORD", $_ENV['HV_PROXY_USER_PASSWORD'] ?? ""); // must be a string in username:password format, leave it empty if proxy do not use authorization
5151

5252
/**
5353
* Terminal commands that need to be checked for running
@@ -59,5 +59,5 @@
5959
* TODO:
6060
* PHP 7 support arrays inside constants.
6161
*/
62-
define("TERMINAL_COMMANDS", serialize(array()));
62+
define("TERMINAL_COMMANDS", $_ENV['TERMINAL_COMMANDS'] ?? serialize(array()));
6363
?>

0 commit comments

Comments
 (0)