Standard config (personal config will not be commited)
This commit is contained in:
parent
484d94426a
commit
78c79fdbf5
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -94,3 +94,5 @@ ENV/
|
|||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# Ignore self config
|
||||
config.json
|
||||
|
|
10
config.json
10
config.json
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"web": {
|
||||
"debug": true,
|
||||
"use_reloader": true,
|
||||
"threaded": true,
|
||||
"host": "0.0.0.0",
|
||||
"port": 80
|
||||
},
|
||||
"disable-static-cache": true
|
||||
}
|
15
default_config.json
Normal file
15
default_config.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"disable-static-cache": true,
|
||||
"web": {
|
||||
"debug": true,
|
||||
"use_reloader": true,
|
||||
"threaded": true,
|
||||
"host": "0.0.0.0",
|
||||
"port": 7001
|
||||
},
|
||||
"git": {
|
||||
"auto_pull_and_restart": false,
|
||||
"webhook_endpoint": "/api/git_commit",
|
||||
"secret": "iOnlyHavePullAccess"
|
||||
}
|
||||
}
|
|
@ -1,4 +1,6 @@
|
|||
import os
|
||||
import json
|
||||
import shutil
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Global variables that is None by default and gets overwritten in other modules
|
||||
|
@ -8,5 +10,9 @@ app = None # main.py -> Flask App
|
|||
# ------------------------------------------------------------------------------
|
||||
# Global variables that initializes on first load of module
|
||||
|
||||
if not os.path.isfile("config.json"):
|
||||
print("`config.json` were not found! Copying default_config and continuing...")
|
||||
shutil.copy("default_config.json", "config.json")
|
||||
|
||||
with open("config.json", "r") as f:
|
||||
config = json.load(f)
|
Loading…
Reference in New Issue
Block a user