Groundwork for reusing this codebase per-client (own VPS/DB/bot per
cafe): the operational config (bot token, DB URL, secrets, Checkbox PRRO
creds) was already .env/Setting-driven, but ~13 spots still hardcoded the
literal string "Bober BBQ" instead of reading the existing cafe_name
Setting, and the webapp's static shell (index.html title, PWA manifest)
had no templating at all since Settings only load after JS boots.
- Route the remaining hardcoded strings through Setting.get("cafe_name",
"Bober BBQ") — same pattern already used correctly in bot/handlers/
start.py. Every fallback stays "Bober BBQ", so production is byte-
identical with no cafe_name override.
- Template webapp/index.html via Vite's native %VITE_CAFE_NAME% HTML
replacement, backed by a committed webapp/.env (default "Bober BBQ",
no secrets) with a per-client override via gitignored .env.local.
- Add webapp/scripts/gen-manifest.mjs to generate manifest.json from a
new manifest.template.json the same way, since Vite doesn't process
public/ assets — wired into the build script.
- Parameterize deploy.sh's systemd unit names and the admin log-viewer's
log paths via optional SERVICE_WEB/SERVICE_BOT/LOG_FILE_WEB/
LOG_FILE_BOT env vars, defaulting to today's literal values.
- Rewrite docs/DEPLOYMENT.md into a repeatable new-client runbook (fixed
an existing /opt/bober-bbq vs /opt/bober-bbq-bot inconsistency, added
a rebranding checklist).
Verified via a smoke test that every changed string still renders
"Bober BBQ" with no overrides present (matching prod's actual .env/DB
state), and that webapp builds both with and without a VITE_CAFE_NAME
override produce the expected output — including a no-override rebuild
confirming byte-identical output to before this change.
44 lines
1.8 KiB
Text
44 lines
1.8 KiB
Text
# === Telegram ===
|
|
BOT_TOKEN=123456:AAExampleTelegramBotToken
|
|
# Telegram user id(s) of the primary owner/manager (comma separated), used as fallback if chats below are not set
|
|
OWNER_IDS=123456789
|
|
|
|
# Chats where orders are sent. Can be a group id (negative number, e.g. -1001234567890)
|
|
# or a channel id. The bot must be added as admin to these chats.
|
|
DELIVERY_CHAT_ID=-1001111111111
|
|
PICKUP_CHAT_ID=-1002222222222
|
|
|
|
# Public HTTPS URL where the webapp (Mini App) is hosted, e.g. https://bober-bbq.example.com/webapp/
|
|
WEBAPP_URL=https://example.com/webapp/
|
|
|
|
# Public base URL of this backend (Flask API), e.g. https://bober-bbq.example.com
|
|
BACKEND_PUBLIC_URL=https://example.com
|
|
|
|
# === Database ===
|
|
# Leave unset to use SQLite at instance/bober_bbq.db automatically (recommended for dev).
|
|
# For production, e.g. postgresql+psycopg2://user:pass@host:5432/bober_bbq
|
|
# If you do set a SQLite URL explicitly, use an absolute path (sqlite:///D:/full/path/bober_bbq.db) —
|
|
# relative sqlite paths resolve against the process's current working directory, not this project folder.
|
|
DATABASE_URL=
|
|
|
|
# === Flask ===
|
|
SECRET_KEY=change-me-to-a-random-secret-string
|
|
FLASK_ADMIN_USERNAME=admin
|
|
FLASK_ADMIN_PASSWORD=change-me
|
|
|
|
# === Monobank (provided by the client / FOP owner) ===
|
|
# Merchant acquiring token from https://api.monobank.ua/
|
|
MONOBANK_TOKEN=
|
|
# Webhook URL monobank will call on payment status change
|
|
MONOBANK_WEBHOOK_URL=https://example.com/api/payments/monobank/webhook
|
|
|
|
# === Misc ===
|
|
TIMEZONE=Europe/Kyiv
|
|
|
|
# === Deployment identity (only needed if this instance's systemd units/logs
|
|
# aren't named bober-bbq-web/bober-bbq-bot — e.g. a second client on the
|
|
# same codebase). Leave unset to use those defaults. ===
|
|
# SERVICE_WEB=bober-bbq-web
|
|
# SERVICE_BOT=bober-bbq-bot
|
|
# LOG_FILE_WEB=/var/log/bober-bbq-web.log
|
|
# LOG_FILE_BOT=/var/log/bober-bbq-bot.log
|