mirror of
https://github.com/benbusby/whoogle-search.git
synced 2025-06-03 13:44:17 -04:00
Add ability to set custom dotenv path (#1183)
* add ability to set custom dotenv path * add `WHOOGLE_DOTENV_PATH` to environment variables table
This commit is contained in:
parent
223f00c3c0
commit
c54f4a79a6
@ -241,6 +241,8 @@ Description=Whoogle
|
|||||||
#Environment=WHOOGLE_ALT_SO=farside.link/anonymousoverflow
|
#Environment=WHOOGLE_ALT_SO=farside.link/anonymousoverflow
|
||||||
# Load values from dotenv only
|
# Load values from dotenv only
|
||||||
#Environment=WHOOGLE_DOTENV=1
|
#Environment=WHOOGLE_DOTENV=1
|
||||||
|
# specify dotenv location if not in default location
|
||||||
|
#Environment=WHOOGLE_DOTENV_PATH=<path/to>/whoogle.env
|
||||||
Type=simple
|
Type=simple
|
||||||
User=<username>
|
User=<username>
|
||||||
# If installed as a package, add:
|
# If installed as a package, add:
|
||||||
@ -411,6 +413,7 @@ There are a few optional environment variables available for customizing a Whoog
|
|||||||
| -------------------- | ----------------------------------------------------------------------------------------- |
|
| -------------------- | ----------------------------------------------------------------------------------------- |
|
||||||
| WHOOGLE_URL_PREFIX | The URL prefix to use for the whoogle instance (i.e. "/whoogle") |
|
| WHOOGLE_URL_PREFIX | The URL prefix to use for the whoogle instance (i.e. "/whoogle") |
|
||||||
| WHOOGLE_DOTENV | Load environment variables in `whoogle.env` |
|
| WHOOGLE_DOTENV | Load environment variables in `whoogle.env` |
|
||||||
|
| WHOOGLE_DOTENV_PATH | The path to `whoogle.env` if not in default location |
|
||||||
| WHOOGLE_USER | The username for basic auth. WHOOGLE_PASS must also be set if used. |
|
| WHOOGLE_USER | The username for basic auth. WHOOGLE_PASS must also be set if used. |
|
||||||
| WHOOGLE_PASS | The password for basic auth. WHOOGLE_USER must also be set if used. |
|
| WHOOGLE_PASS | The password for basic auth. WHOOGLE_USER must also be set if used. |
|
||||||
| WHOOGLE_PROXY_USER | The username of the proxy server. |
|
| WHOOGLE_PROXY_USER | The username of the proxy server. |
|
||||||
|
@ -25,9 +25,10 @@ app = Flask(__name__, static_folder=os.path.dirname(
|
|||||||
|
|
||||||
app.wsgi_app = ProxyFix(app.wsgi_app)
|
app.wsgi_app = ProxyFix(app.wsgi_app)
|
||||||
|
|
||||||
dot_env_path = (
|
# look for WHOOGLE_ENV, else look in parent directory
|
||||||
os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
dot_env_path = os.getenv(
|
||||||
'../whoogle.env'))
|
"WHOOGLE_DOTENV_PATH",
|
||||||
|
os.path.join(os.path.dirname(os.path.abspath(__file__)), "../whoogle.env"))
|
||||||
|
|
||||||
# Load .env file if enabled
|
# Load .env file if enabled
|
||||||
if os.path.exists(dot_env_path):
|
if os.path.exists(dot_env_path):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user