Init database with approval keys

This commit is contained in:
Miraty 2023-05-05 19:45:19 +02:00
parent 78e483d2a4
commit c5621010dd

View file

@ -3,7 +3,12 @@
# Create database
sqlite3 /srv/servnest/core/db/servnest.db < /srv/servnest/core/db/schema.sql
sqlite3 /srv/servnest/core/db/servnest.db <<< "UPDATE params SET value = '$(openssl rand -hex 16)' WHERE name = 'username_salt';"
echo "UPDATE params SET value = '$(openssl rand -hex 16)' WHERE name = 'username_salt';" | sqlite3 /srv/servnest/core/db/servnest.db
for i in $(seq 50)
do
echo "INSERT INTO 'approval-keys'(key) VALUES('$(openssl rand -hex 16)');" | sqlite3 /srv/servnest/core/db/servnest.db
done
# Create translation Machine Objects files
msgfmt /srv/servnest/core/locales/fr/C/LC_MESSAGES/messages.po -o /srv/servnest/core/locales/fr/C/LC_MESSAGES/messages.mo