@@ -59,16 +59,12 @@ try:
|
||||
os.system("chown -R root:root " + configFilePath)
|
||||
configFilePath = configFilePath + "config.json"
|
||||
# Will find the location where the config should be located.
|
||||
location = __file__[: __file__.rindex("/python/restart.py") + 1] + "html"
|
||||
location = __file__[: __file__.rindex("/python/restart.py") + 1] + "html/"
|
||||
# Creates config with the enviromental variables
|
||||
developmentMachine = os.getenv("WEBSITE_DEVELOPER", "false") == "true"
|
||||
# This stores a list for the default config
|
||||
envConfiguration = [
|
||||
[["passwordOptions", "cost"], int(os.getenv("PASSWORD_ROUNDS", "10"))],
|
||||
[["mail", "server"], os.getenv("MAIL_SMTP_SERVER", "smtp.sendgrid.net")],
|
||||
[["mail", "username"], os.getenv("MAIL_USERNAME", "apikey")],
|
||||
[["mail", "password"], os.getenv("MAIL_PASSWORD", "none")],
|
||||
[["mail", "port"], int(os.getenv("MAIL_SMTP_PORT", "587"))],
|
||||
[["database", "username"], os.getenv("DATABASE_USERNAME", "admin")],
|
||||
[["database", "name"], os.getenv("DATABASE_NAME", "website")],
|
||||
[["database", "password"], os.getenv("DATABASE_PASSWORD", "password")],
|
||||
@@ -280,16 +276,6 @@ try:
|
||||
f"DELETE FROM cookieClicker WHERE lastUpdate<{(time.time()-86400*30)*1000}"
|
||||
) # Removes cookie clicker data that has not been touched for a month
|
||||
writeLog("Server maintenance ran succesfully.", 12)
|
||||
# Makes sure that the vendor folder is blocked
|
||||
try:
|
||||
os.remove(location + "vendor/.htaccess")
|
||||
except:
|
||||
1
|
||||
with open(location + "vendor/.htaccess", "w") as f:
|
||||
f.write(
|
||||
"""Order allow,deny
|
||||
Deny from all"""
|
||||
)
|
||||
|
||||
# Waits until the database is ready
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user