This commit is contained in:
xxwhirlpool 2025-05-15 17:08:32 -04:00
parent c3a061f987
commit 2ba65209d0
No known key found for this signature in database
3 changed files with 26 additions and 8 deletions

9
.env.example Normal file
View file

@ -0,0 +1,9 @@
# status
DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_DB}:5432/status?sslmode=disable
ASSETS_DIR=/var/www/status/assets
MANUAL_REGISTRATION=0 # set to 1 for automatic approval of users
# postgres
POSTGRES_USER=postgres # change me
POSTGRES_PASSWORD=password # change me
POSTGRES_DB=status

13
README.md Normal file
View file

@ -0,0 +1,13 @@
# docker deploy of ~m15o/status
this is just a clone of [~m15o/status](https://git.sr.ht/~m15o/status/) that adds a dockerfile and compose file for containerized deployment. i use this for my own instance of status, [synchro](https://synchro.girlonthemoon.xyz/).
## customization and administration
the following environment variables in ``.env.example`` configure administration and customization of the site. please copy the example file to ``.env`` for it to work with the compose file.
- `DATABASE_URL` - the value for this will fill in with variables that configure postgres in the same file, which you should change for security.
- `ASSETS_DIR` - the value provided should not be changed unless you wish to move the assets folder in the source code. on the host, the asset directory can contain `style2.css`, which is mounted over the `style.css` file in the container via the compose file, to allow for customization of the site's styling.
- `MANUAL_REGISTRATION` - by default this is disabled, which means all users are automatically approved upon registration and are able to post. after registering a user you will use as admin, i recommend setting this to `0` to enable manual approval of users via the `/admin` page.
in `web/handler/admin_show.go`, you must edit all instances of `m15o` to reflect your admin account's username, or else you will not be able to access the admin page and approve/deny users.

View file

@ -3,21 +3,17 @@ services:
build: . build: .
ports: ports:
- "8798:8000" - "8798:8000"
environment: env_file: .env # copy .env.example to .env for this to work
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_DB}:5432/status?sslmode=disable
- ASSETS_DIR=/var/www/status/assets
volumes: volumes:
- .:/var/www/status:rw - .:/var/www/status:rw
- ./assets/style2.css:/var/www/status/assets/style.css - ./assets/style2.css:/var/www/status/assets/style.css
restart: always
db: db:
image: postgres:13 image: postgres:13
restart: always env_file: .env # copy .env.example to .env for this to work
environment:
POSTGRES_USER: postgres # change me
POSTGRES_PASSWORD: password # change me
POSTGRES_DB: status
volumes: volumes:
- ./db:/var/lib/postgresql/data - ./db:/var/lib/postgresql/data
ports: ports:
- "5432:5432" - "5432:5432"
restart: always