Use the old static menu directory as the app's data root
That was the intent of the uncommitted edit, and it is a better location than a
second directory: the app inherits the place the menus were already served from
and only ever reads and writes its own data/ and site.env inside it.
app_root is written as /var/lib/{{ host }}, quoted, because the unquoted form is
what failed to parse. Every documented path follows, and the deployment readme
now says that emptying the old menu files means deleting those files rather than
the directory, which holds the live content.
This commit is contained in:
1 parent
65b66f712d
commit
25ef94d7af
4 files changed
+35
-24
No files matched your search
+16
-10
@@ -5,16 +5,22 @@ app's container and points the Site's web address at it. There is no older
|
||||
system to keep serving, so there is no staged rollout and nothing to retire —
|
||||
deploying an earlier tag is the rollback.
|
||||
|
||||
**The app's data root is the directory the old static menus were served from**
|
||||
(`/var/lib/menu.<site>`), on purpose, so the app inherits the location instead of
|
||||
a second one. The app only reads and writes `data/` and `site.env` inside it. If
|
||||
you later want the old menu files gone, delete those files — not the directory,
|
||||
which now holds the live content.
|
||||
|
||||
## What lives where
|
||||
|
||||
| Thing | Where |
|
||||
| -------------------------------------- | -------------------------------------------------------------------------- |
|
||||
| Name, tagline, icon, categories, menus | on the server under `/var/lib/menu-app.<site>/data` — the admin edits them |
|
||||
| Theme colours | `config/<site>.site.json` in the repo, baked into the image |
|
||||
| Admin password hash, session secret | `/var/lib/menu-app.<site>/site.env` (untracked, mode 600) |
|
||||
| Which image tag runs | `-e tag=<tag>` |
|
||||
| Which Site is deployed | the inventory entry in `hosts` |
|
||||
| The web address it serves | `host:` in `vars/<site>.yml` |
|
||||
| Thing | Where |
|
||||
| -------------------------------------- | ---------------------------------------------------------------------- |
|
||||
| Name, tagline, icon, categories, menus | on the server under `/var/lib/menu.<site>/data` — the admin edits them |
|
||||
| Theme colours | `config/<site>.site.json` in the repo, baked into the image |
|
||||
| Admin password hash, session secret | `/var/lib/menu.<site>/site.env` (untracked, mode 600) |
|
||||
| Which image tag runs | `-e tag=<tag>` |
|
||||
| Which Site is deployed | the inventory entry in `hosts` |
|
||||
| The web address it serves | `host:` in `vars/<site>.yml` |
|
||||
|
||||
## Deploying
|
||||
|
||||
@@ -60,13 +66,13 @@ publish something.
|
||||
|
||||
## The admin password
|
||||
|
||||
The app starts with the admin disabled while `/var/lib/menu-app.<site>/site.env`
|
||||
The app starts with the admin disabled while `/var/lib/menu.<site>/site.env`
|
||||
is missing, and the playbook says so rather than failing. Create it once per
|
||||
Site:
|
||||
|
||||
```sh
|
||||
scp scripts/provision-site-env.sh monoco:/tmp/
|
||||
ssh monoco bash /tmp/provision-site-env.sh /var/lib/menu-app.hopsngrains.com
|
||||
ssh monoco bash /tmp/provision-site-env.sh /var/lib/menu.hopsngrains.com
|
||||
ssh monoco docker restart menu-app.hopsngrains.com
|
||||
```
|
||||
|
||||
|
||||
@@ -13,4 +13,9 @@ docker_container: 'menu-app.{{ title }}'
|
||||
docker_network: '{{ docker_container }}_net'
|
||||
|
||||
# Everything the app writes — data/ and the untracked site.env.
|
||||
app_root: '/var/lib/menu-app.{{ title }}'
|
||||
#
|
||||
# Deliberately the directory the old static menus were served from, so the app
|
||||
# inherits the location rather than a second one. The app only ever reads and
|
||||
# writes its own data/ inside it; the old menu files can be emptied out when
|
||||
# they are no longer wanted, and the directory itself must stay.
|
||||
app_root: '/var/lib/{{ host }}'
|
||||
Reference in new issue
Block a user