forked from rDrama/rDrama
move site_settings.json out of the repo
parent
684a804e6e
commit
68c07b77bb
|
@ -72,6 +72,10 @@ cache = Cache(app)
|
|||
Compress(app)
|
||||
mail = Mail(app)
|
||||
|
||||
if not path.isfile(f'/site_settings.json'):
|
||||
with open('/site_settings.json', 'w', encoding='utf_8') as f:
|
||||
f.write('{"Bots": true, "Fart mode": false, "Read-only mode": false, "Signups": true}')
|
||||
|
||||
@app.before_request
|
||||
def before_request():
|
||||
|
||||
|
@ -80,7 +84,7 @@ def before_request():
|
|||
|
||||
ua = g.agent.lower()
|
||||
|
||||
with open('site_settings.json', 'r', encoding='utf_8') as f:
|
||||
with open('/site_settings.json', 'r', encoding='utf_8') as f:
|
||||
app.config['SETTINGS'] = json.load(f)
|
||||
|
||||
if SITE != app.config["SERVER_NAME"]: return {"error":"Unauthorized host provided."}, 401
|
||||
|
|
|
@ -914,7 +914,7 @@ if not SITE_NAME in ['PCM', 'LGBDropTheT']:
|
|||
if SITE_NAME == 'Deuxrama': snappy_name = 'rDrama'
|
||||
else: snappy_name = SITE_NAME
|
||||
|
||||
if path.exists(f'snappy_{snappy_name}.txt'):
|
||||
if path.isfile(f'snappy_{snappy_name}.txt'):
|
||||
with open(f'snappy_{snappy_name}.txt', "r", encoding="utf-8") as f:
|
||||
SNAPPY_QUOTES += f.read().split("\n{[para]}\n")
|
||||
|
||||
|
|
|
@ -444,7 +444,7 @@ def admin_git_head():
|
|||
def change_settings(v, setting):
|
||||
site_settings = app.config['SETTINGS']
|
||||
site_settings[setting] = not site_settings[setting]
|
||||
with open("site_settings.json", "w", encoding='utf_8') as f:
|
||||
with open("/site_settings.json", "w", encoding='utf_8') as f:
|
||||
json.dump(site_settings, f)
|
||||
|
||||
if site_settings[setting]: word = 'enable'
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{"Bots": true, "Fart mode": true, "Read-only mode": false, "Signups": true}
|
Loading…
Reference in New Issue