mirror of
https://github.com/Sea-Haven-Industries/forgejo.git
synced 2026-09-30 06:33:11 +00:00
fix(terraform): restore the dump app.ini with the database
INTERNAL_TOKEN, JWT_SECRET, and LFS_JWT_SECRET live in that file. A restore that keeps the generated file cannot decrypt the dumped secrets.
This commit is contained in:
parent
494b63439f
commit
dd23f08878
2 changed files with 16 additions and 0 deletions
10
README.md
10
README.md
|
|
@ -147,6 +147,11 @@ if [ ! -s /var/lib/forgejo/data/forgejo.db ]; then
|
||||||
echo "Restore did not produce /var/lib/forgejo/data/forgejo.db" >&2
|
echo "Restore did not produce /var/lib/forgejo/data/forgejo.db" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [ -f /var/lib/forgejo/.restore/app.ini ]; then
|
||||||
|
cp /var/lib/forgejo/.restore/app.ini /etc/forgejo/app.ini
|
||||||
|
chown root:forgejo /etc/forgejo/app.ini
|
||||||
|
chmod 660 /etc/forgejo/app.ini
|
||||||
|
fi
|
||||||
chown -R forgejo:forgejo /var/lib/forgejo
|
chown -R forgejo:forgejo /var/lib/forgejo
|
||||||
systemctl start forgejo
|
systemctl start forgejo
|
||||||
rm -rf /var/lib/forgejo/.restore
|
rm -rf /var/lib/forgejo/.restore
|
||||||
|
|
@ -189,6 +194,11 @@ if [ ! -s /var/lib/forgejo/data/forgejo.db ]; then
|
||||||
echo "Restore did not produce /var/lib/forgejo/data/forgejo.db" >&2
|
echo "Restore did not produce /var/lib/forgejo/data/forgejo.db" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [ -f /var/lib/forgejo/.restore/app.ini ]; then
|
||||||
|
cp /var/lib/forgejo/.restore/app.ini /etc/forgejo/app.ini
|
||||||
|
chown root:forgejo /etc/forgejo/app.ini
|
||||||
|
chmod 660 /etc/forgejo/app.ini
|
||||||
|
fi
|
||||||
chown -R forgejo:forgejo /var/lib/forgejo
|
chown -R forgejo:forgejo /var/lib/forgejo
|
||||||
systemctl start forgejo
|
systemctl start forgejo
|
||||||
rm -rf /var/lib/forgejo/.restore
|
rm -rf /var/lib/forgejo/.restore
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,12 @@ if [ ! -f /var/lib/forgejo/data/forgejo.db ]; then
|
||||||
if [ -d "$RESTORE_DIR/custom" ]; then
|
if [ -d "$RESTORE_DIR/custom" ]; then
|
||||||
cp -a "$RESTORE_DIR"/custom/. /var/lib/forgejo/custom/
|
cp -a "$RESTORE_DIR"/custom/. /var/lib/forgejo/custom/
|
||||||
fi
|
fi
|
||||||
|
# The dump's app.ini carries INTERNAL_TOKEN, JWT_SECRET, and LFS_JWT_SECRET.
|
||||||
|
if [ -f "$RESTORE_DIR/app.ini" ]; then
|
||||||
|
cp "$RESTORE_DIR/app.ini" /etc/forgejo/app.ini
|
||||||
|
chown root:forgejo /etc/forgejo/app.ini
|
||||||
|
chmod 660 /etc/forgejo/app.ini
|
||||||
|
fi
|
||||||
chown -R forgejo:forgejo /var/lib/forgejo
|
chown -R forgejo:forgejo /var/lib/forgejo
|
||||||
rm -rf "$RESTORE_DIR"
|
rm -rf "$RESTORE_DIR"
|
||||||
if [ ! -s /var/lib/forgejo/data/forgejo.db ]; then
|
if [ ! -s /var/lib/forgejo/data/forgejo.db ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue