From 2ba65209d086d7127ce8b388806016643332f27b Mon Sep 17 00:00:00 2001 From: xxwhirlpool Date: Thu, 15 May 2025 17:08:32 -0400 Subject: [PATCH] updates --- .env.example | 9 +++++++++ README.md | 13 +++++++++++++ docker-compose.yml | 12 ++++-------- 3 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 .env.example create mode 100644 README.md diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..a1d35be --- /dev/null +++ b/.env.example @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..358c183 --- /dev/null +++ b/README.md @@ -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. diff --git a/docker-compose.yml b/docker-compose.yml index f8aab96..4f19029 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,21 +3,17 @@ services: build: . ports: - "8798:8000" - environment: - - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_DB}:5432/status?sslmode=disable - - ASSETS_DIR=/var/www/status/assets + env_file: .env # copy .env.example to .env for this to work volumes: - .:/var/www/status:rw - ./assets/style2.css:/var/www/status/assets/style.css + restart: always db: image: postgres:13 - restart: always - environment: - POSTGRES_USER: postgres # change me - POSTGRES_PASSWORD: password # change me - POSTGRES_DB: status + env_file: .env # copy .env.example to .env for this to work volumes: - ./db:/var/lib/postgresql/data ports: - "5432:5432" + restart: always