moved config to a json, which makes adding more variables easier, but perhaps otherwise adds complexity

This commit is contained in:
Ville Rantanen
2023-07-28 13:08:54 +03:00
parent 80af9c321c
commit f1c453d3d4
18 changed files with 258 additions and 182 deletions

28
forum/change_admin_pw.sh Normal file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
SQLITE=sqlite3
PYTHON=python3
set -eu
if [[ -z "$DB" ]]; then
echo set DB env to the Sqlite database.
exit 1
fi
read -p 'Admin username: ' username
read -sp 'Admin password: ' password
password=$($PYTHON tool.py password "$password")
time=$($PYTHON -c 'import time; print(time.time_ns())')
$SQLITE "$DB" "
UPDATE users
SET password = '$password',
role = 2,
join_time = $time
WHERE
user = lower('$username')
"