mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
fix: justfile shebang recipes indentation (spaces → tabs)
This commit is contained in:
2
TODO.md
2
TODO.md
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## Completed
|
## Completed
|
||||||
|
|
||||||
|
- [x] Fix `just serve` — justfile shebang recipes (`deploy-env`, `reencrypt-password`) used space indentation instead of tabs, causing "extra leading whitespace" parse error
|
||||||
|
|
||||||
- [x] PDF 100 MB limit + bentopdf mention
|
- [x] PDF 100 MB limit + bentopdf mention
|
||||||
- [x] `ThesisCreateController`: `MAX_PDF_SIZE = 100 MB`; PDFs checked against it, other files still 500 MB
|
- [x] `ThesisCreateController`: `MAX_PDF_SIZE = 100 MB`; PDFs checked against it, other files still 500 MB
|
||||||
- [x] `ThesisEditController`: same per-PDF limit applied
|
- [x] `ThesisEditController`: same per-PDF limit applied
|
||||||
|
|||||||
60
justfile
60
justfile
@@ -68,39 +68,39 @@ deploy:
|
|||||||
|
|
||||||
[group('deploy')]
|
[group('deploy')]
|
||||||
deploy-env:
|
deploy-env:
|
||||||
# Upload app/.env only if it exists locally; never overwrites a remote .env that already has APP_KEY.
|
#!/usr/bin/env bash
|
||||||
#!/usr/bin/env bash
|
set -euo pipefail
|
||||||
set -euo pipefail
|
# Upload app/.env only if it exists locally; never overwrites a remote .env that already has APP_KEY.
|
||||||
if [ ! -f app/.env ]; then
|
if [ ! -f app/.env ]; then
|
||||||
echo "WARNING: app/.env not found locally — skipping."
|
echo "WARNING: app/.env not found locally — skipping."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if ssh xamxam '[ -f /var/www/xamxam/.env ]'; then
|
if ssh xamxam '[ -f /var/www/xamxam/.env ]'; then
|
||||||
echo "Remote .env already exists — skipping to avoid overwriting key."
|
echo "Remote .env already exists — skipping to avoid overwriting key."
|
||||||
echo "Run 'just reencrypt-password' if you rotated APP_KEY."
|
echo "Run 'just reencrypt-password' if you rotated APP_KEY."
|
||||||
else
|
else
|
||||||
rsync -v --progress app/.env xamxam:/var/www/xamxam/.env
|
rsync -v --progress app/.env xamxam:/var/www/xamxam/.env
|
||||||
ssh xamxam "chmod 640 /var/www/xamxam/.env && chown www-data:xamxam /var/www/xamxam/.env"
|
ssh xamxam "chmod 640 /var/www/xamxam/.env && chown www-data:xamxam /var/www/xamxam/.env"
|
||||||
echo ".env uploaded."
|
echo ".env uploaded."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[group('deploy')]
|
[group('deploy')]
|
||||||
reencrypt-password new_key_b64="":
|
reencrypt-password new_key_b64="":
|
||||||
# Re-encrypt the SMTP password in the remote DB after rotating APP_KEY.
|
#!/usr/bin/env bash
|
||||||
# Usage:
|
set -euo pipefail
|
||||||
# 1. Generate a new key: php -r "echo base64_encode(random_bytes(32));"
|
# Re-encrypt the SMTP password in the remote DB after rotating APP_KEY.
|
||||||
# 2. Run: just reencrypt-password <new_base64_key>
|
# Usage:
|
||||||
# 3. Update app/.env locally with the new key, then run: just deploy-env
|
# 1. Generate a new key: php -r "echo base64_encode(random_bytes(32));"
|
||||||
#!/usr/bin/env bash
|
# 2. Run: just reencrypt-password <new_base64_key>
|
||||||
set -euo pipefail
|
# 3. Update app/.env locally with the new key, then run: just deploy-env
|
||||||
if [ -z "{{new_key_b64}}" ]; then
|
if [ -z "{{new_key_b64}}" ]; then
|
||||||
echo "Usage: just reencrypt-password <new_base64_key>"
|
echo "Usage: just reencrypt-password <new_base64_key>"
|
||||||
echo "Generate a key: php -r \"echo base64_encode(random_bytes(32));\""
|
echo "Generate a key: php -r \"echo base64_encode(random_bytes(32));\""
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Run the re-encryption script on the server using the current key (from remote .env)
|
# Run the re-encryption script on the server using the current key (from remote .env)
|
||||||
# and the supplied new key.
|
# and the supplied new key.
|
||||||
ssh xamxam "php /var/www/xamxam/scripts/reencrypt-smtp-password.php '{{new_key_b64}}' /var/www/xamxam/storage/xamxam.db"
|
ssh xamxam "php /var/www/xamxam/scripts/reencrypt-smtp-password.php '{{new_key_b64}}' /var/www/xamxam/storage/xamxam.db"
|
||||||
|
|
||||||
[group('deploy')]
|
[group('deploy')]
|
||||||
deploy-db:
|
deploy-db:
|
||||||
|
|||||||
Reference in New Issue
Block a user