# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 7
# self = https://watcher.sour.is/conv/e2hjhua
I wrote this little thing

doas -u _postgresql psql --dbname=maddy --host=localhost --username=maddy "UPDATE passwords SET value = '$(maddy hash --password "$1")' WHERE key = '$2' AND value = '$(maddy hash --password "$3")'"


First argument is the new password (hashed of course), the second being the username, the third being the old (current) password. I haven't yet tried this but I might now.


doas -u _postgresql psql --dbname=maddy --host=localhost --username=maddy -c "UPDATE passwords SET value = '$(maddy hash --password "$1")' WHERE key = '$2'"

take 2, without the 3rd argument
this is lovely I'm not gonna lie
https://git.kyoko-project.wer.ee/koizumi.aoi/maddy-psql
@akoizumi I smell an SQL injection.
I also use doas btw
@akoizumi Your linked shell script won't do what one expects, I reckon. The functions use $2 and $3, but there is no $1. Invoking a function will give you "renumbered" $n variables inside the function body. They are just the function arguments and therefore are different from the command line arguments outside the functions.