2023-06-11 23:30:48 +00:00
|
|
|
# srv
|
|
|
|
scaffold one or all of the `dnim` api, database, ui on a bare debian image
|
|
|
|
|
|
|
|
re-runnable and idempotent; changes to configuration does the same work as initial setup without losing state.
|
|
|
|
|
|
|
|
## inputs
|
2023-06-12 01:40:49 +00:00
|
|
|
script input is read from `./config.yml`, an example of which can be found
|
|
|
|
at [`./config.example.yml`].
|
2023-06-11 23:30:48 +00:00
|
|
|
|
2023-06-12 01:40:49 +00:00
|
|
|
top-level keys `db`, `api`, or `ui` may be omitted or repeated.
|
2023-06-11 23:30:48 +00:00
|
|
|
|
|
|
|
## observable outputs
|
|
|
|
* linux user `db.linux_user.username` is created
|
|
|
|
* runs postgres 15.3 instance
|
|
|
|
* listens on port `db.port.local` (and `db.port.public` if nonzero)
|
|
|
|
* stores postgres data at `/home/<db.linux_user.username>/data`
|
|
|
|
* instance has a user with credentials of `db.pg_admin`
|
|
|
|
|
|
|
|
## running
|
|
|
|
copy this repository to the debian image, ex with sshfs:
|
|
|
|
```sh
|
|
|
|
> mkdir ./ext
|
|
|
|
> sshfs user@host:/mnt ./ext
|
|
|
|
> rm ./ext/*
|
|
|
|
> cp ./src/* ./ext/
|
|
|
|
```
|
|
|
|
|
|
|
|
then on the host:
|
|
|
|
```sh
|
|
|
|
> /mnt/000-entry.sh
|
|
|
|
```
|