diff --git a/database.py b/database.py index d10ae5c..e998b36 100644 --- a/database.py +++ b/database.py @@ -419,9 +419,12 @@ def abouttoshutdown(): @dbserver.post("/newrule") def newrule(): keys = FormsDict.decode(request.forms) - addEntry("rules/webmade.tsv",[k for k in keys]) - global db_rulestate - db_rulestate = False + apikey = keys.pop("key",None) + if (checkAPIkey(apikey)): + addEntry("rules/webmade.tsv",[k for k in keys]) + global db_rulestate + db_rulestate = False + @dbserver.route("/issues") def issues(): @@ -516,14 +519,16 @@ def issues(): @dbserver.post("/rebuild") def rebuild(): - global db_rulestate - db_rulestate = False - sync() - os.system("python3 fixexisting.py") - global cla, coa - cla = CleanerAgent() - coa = CollectorAgent() - build_db() + apikey = keys.pop("key",None) + if (checkAPIkey(apikey)): + global db_rulestate + db_rulestate = False + sync() + os.system("python3 fixexisting.py") + global cla, coa + cla = CleanerAgent() + coa = CollectorAgent() + build_db() diff --git a/website/issues.html b/website/issues.html index 028fa96..6bd1236 100644 --- a/website/issues.html +++ b/website/issues.html @@ -16,7 +16,8 @@ with your library

KEY_ISSUES Issues

-

Maloja can identify possible problems with consistency or redundancy in your library. After making any changes, you should rebuild your library.

+

Maloja can identify possible problems with consistency or redundancy in your library. After making any changes, you should rebuild your library.
+ Your API key is required to make any changes to the server:

@@ -26,26 +27,76 @@ diff --git a/website/issues.py b/website/issues.py index 0ae1614..0f996be 100644 --- a/website/issues.py +++ b/website/issues.py @@ -1,6 +1,6 @@ import urllib import json -from utilities import artistLink +from htmlgenerators import artistLink def replacedict(keys,dbport):