...
 
Commits (2)
.idea/
conf.json
sever_conf.json
histories/
__pycache__/
......
......@@ -8,9 +8,22 @@ import telegram_notificator
key = Fernet.generate_key()
f = Fernet(key)
telegram_api_key = "token"
application_website = "https://www."
try:
script_path = os.path.dirname(os.path.realpath(__file__))
server_config_path = os.path.join(script_path, "server_conf.json")
with open(server_config_path) as fo:
server_conf = json.load(fo)
telegram_api_key = server_conf["telegram_api_key"]
application_website = server_conf["application_website"]
except:
print("Necessary settings could not be found")
exit(1)
if telegram_api_key is None or application_website is None:
prin("Please configure the server_conf.json")
exit(1)
app = Flask(__name__)
......@@ -55,5 +68,7 @@ def send_link():
if __name__ == "__main__ ":
# Command to create your certificates:
# openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
# To run the server:
# flask run --cert=cert.pem --key=key.pem
app.run(ssl_context=('cert.pem', 'key.pem'))
\ No newline at end of file
{
"application_website": null,
"telegram_api_key": null
}