From e5a671f9bcf254c2ed7211a27ca81d41e6302f26 Mon Sep 17 00:00:00 2001 From: Ilmari Marttila Date: Sun, 24 Mar 2024 23:18:38 +0200 Subject: [PATCH] Remove clearly useless files because eg. duplication. --- scripts/generate_passwords.py | 58 ----------------------------------- web/.project | 23 -------------- web/media/IE-7-SPECIFIC.css | 28 ----------------- web/templates/tupa/base.html | 9 ------ 4 files changed, 118 deletions(-) delete mode 100644 scripts/generate_passwords.py delete mode 100644 web/.project delete mode 100644 web/media/IE-7-SPECIFIC.css diff --git a/scripts/generate_passwords.py b/scripts/generate_passwords.py deleted file mode 100644 index ea65f738..00000000 --- a/scripts/generate_passwords.py +++ /dev/null @@ -1,58 +0,0 @@ -from shutil import copyfile -import string, random, crypt -import MySQLdb - -def find_check_ids_by_name(checks, cursor): - # execute SQL query using execute() method. - cursor.execute("SELECT id FROM kipa_tehtava WHERE sarja_id IN (26, 27, 28, 29, 30) AND nimi IN ('%s')" % "', '".join(checks)) - data = cursor.fetchall() - - res = [] - for row in data: - for val in row: - res.append(str(val)) - - return res - -prefix = 'llhk19-' -baseurl = '/kipa/Leon_lenkki_ja_Hilkan_kilpa_2019/' -accounts = { - "actionfactory": ["Action_Factory"], - "yo": ["Tehtavan 1 nimi", "Tehtavan 2 nimi"] -} -templatefile = '/srv/django/kipa/passwords-llhk19' -path = '/srv/django/kipa/auth_files/llhk19/' -letters = string.ascii_letters - -access_config = '' - -db = MySQLdb.connect(user="USER", passwd="PASSWORD", host="localhost", db="DATABASE") -cursor = db.cursor() - -print(accounts) -for name, checks in accounts.items(): - username = prefix + name - pwdfile = path + name - password = ''.join(random.choice(letters) for i in range(10)) - pwhash = crypt.crypt(password) - copyfile(templatefile, pwdfile) - f = open(pwdfile, 'a') - print(username + ':' + pwhash, file=f) - print(username + ';' + password) - - ids = find_check_ids_by_name(checks, cursor) - for id in ids: - access_config = access_config + """ - location {baseurl}syota/tehtava/{id} {{ - auth_basic "Vain {name}-rastin tulosten syottajille"; - auth_basic_user_file "{pwdfile}"; - include uwsgi_params; - uwsgi_pass unix:/run/uwsgi/kipa.sock; - }} - - """.format(baseurl=baseurl, name=name.capitalize(), id=id, pwdfile=pwdfile) - -c = open(path + 'access.conf', 'w') -print(access_config, file=c) - -db.close() diff --git a/web/.project b/web/.project deleted file mode 100644 index 18122106..00000000 --- a/web/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - web - - - - - - org.python.pydev.PyDevBuilder - - - - - com.aptana.ide.core.unifiedBuilder - - - - - - com.aptana.projects.webnature - org.python.pydev.pythonNature - - diff --git a/web/media/IE-7-SPECIFIC.css b/web/media/IE-7-SPECIFIC.css deleted file mode 100644 index 6f1c9562..00000000 --- a/web/media/IE-7-SPECIFIC.css +++ /dev/null @@ -1,28 +0,0 @@ -/* IE7-specific CSS */ - -html { - width:900px; -} - -#breadcrumbs { - height:22px; -} - -#left { - display:none; - width:0; -} - -#right { - margin:0; - width:900px; -} - -#footer { - display:none; - height:0; -} - -h1 { - font-size:18px; -} \ No newline at end of file diff --git a/web/templates/tupa/base.html b/web/templates/tupa/base.html index baad352a..cc1fcf43 100644 --- a/web/templates/tupa/base.html +++ b/web/templates/tupa/base.html @@ -5,15 +5,6 @@ - - -