Add secret key

This commit is contained in:
James Wang 2015-12-21 16:08:50 -05:00
parent 56d12cd74b
commit 229441ee32
3 changed files with 17 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
.vagrant
.secret_key
# Object files
*.o

View file

@ -1,7 +1,9 @@
from flask import Flask
import sys
import config
app = Flask(__name__)
app.secret_key = config.SECRET
#Home Page
@app.route("/")

14
server/config.py Normal file
View file

@ -0,0 +1,14 @@
import os
with open(".secret_key", "a+") as secret:
if not secret.read():
secret.seek(0)
key = os.urandom(128)
secret.write(key)
secret.flush()
else:
key = secret.read()
SECRET = key
CTF_BEGIN = 0 # To be used later
CTF_END = 0 # To be used later