refractor blogpost and cdn chall
This commit is contained in:
1 parent
2d51b73a1e
commit
bb3f6e74aa
47 files changed
-544
No files matched your search
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
mkdir -p /app/uploads
|
||||
chmod 755 /app/uploads
|
||||
|
||||
python - <<'PY'
|
||||
import os
|
||||
import app as m
|
||||
with m.app.app_context():
|
||||
m.init_db()
|
||||
m.generate_flag_at_boot()
|
||||
print("DB & flag initialized.")
|
||||
PY
|
||||
|
||||
FLAG_PATH="${FLAG_PATH:-/app/flag.txt}"
|
||||
|
||||
if [ -d "$FLAG_PATH" ]; then
|
||||
if [ -f "$FLAG_PATH/flag.txt" ]; then
|
||||
chown root:root "$FLAG_PATH/flag.txt" || true
|
||||
chmod 444 "$FLAG_PATH/flag.txt" || true
|
||||
fi
|
||||
else
|
||||
if [ -f "$FLAG_PATH" ]; then
|
||||
chown root:root "$FLAG_PATH" || true
|
||||
chmod 444 "$FLAG_PATH" || true
|
||||
fi
|
||||
fi
|
||||
|
||||
exec python app.py
|
||||
Reference in new issue
Block a user