30 lines
637 B
Python
Executable File
30 lines
637 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
import os
|
|
import sqlite3
|
|
|
|
clihash = os.environ.get('TLS_CLIENT_HASH', "")
|
|
qstr = os.environ.get('QUERY_STRING', "")
|
|
|
|
if clihash == "":
|
|
print("60 Please use a certificate to authenticate\r\n")
|
|
exit()
|
|
|
|
if qstr == "":
|
|
print("30 notesapp.py\r\n")
|
|
exit()
|
|
|
|
|
|
if qstr.isnumeric():
|
|
con = sqlite3.connect('notes.db')
|
|
cur = con.cursor()
|
|
try:
|
|
cur.execute("DELETE FROM Notes WHERE NoteIndex=? and Hash=?", (qstr, clihash))
|
|
con.commit()
|
|
except sqlite3.Error as e:
|
|
print("20 text/gemini; charset=utf-8\r\n")
|
|
print(e.args[0])
|
|
exit()
|
|
|
|
print("30 notesapp.py\r\n")
|