Standard config (personal config will not be commited)

This commit is contained in:
Emily 2019-02-25 10:59:09 +01:00
parent 484d94426a
commit 78c79fdbf5
4 changed files with 23 additions and 10 deletions

2
.gitignore vendored
View File

@ -94,3 +94,5 @@ ENV/
# Rope project settings
.ropeproject
# Ignore self config
config.json

View File

@ -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
View 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"
}
}

View File

@ -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)