migrate from envars to toml config
This commit is contained in:
parent
5284b8a7cc
commit
04f7f97b62
12 changed files with 182 additions and 109 deletions
37
README.md
37
README.md
|
@ -4,29 +4,36 @@ home to your local SPACEGIRL! 💫
|
|||
|
||||
---
|
||||
|
||||
built up from the initial [static](https://git.arimelody.me/ari/arimelody.me-static) branch, this powerful, server-side rendered version comes complete with live updates, powered by a new database and super handy admin panel!
|
||||
built up from the initial [static](https://git.arimelody.me/ari/arimelody.me-static)
|
||||
branch, this powerful, server-side rendered version comes complete with live
|
||||
updates, powered by a new database and handy admin panel!
|
||||
|
||||
the admin panel currently facilitates live updating of my music discography, though i plan to expand it towards art portfolio and blog posts in the future. if all goes well, i'd like to later separate these components into their own library for others to use in their own sites. exciting stuff!
|
||||
the admin panel currently facilitates live updating of my music discography,
|
||||
though i plan to expand it towards art portfolio and blog posts in the future.
|
||||
if all goes well, i'd like to later separate these components into their own
|
||||
library for others to use in their own sites. exciting stuff!
|
||||
|
||||
## build
|
||||
|
||||
easy! just `git clone` this repo and `go build` from the root. `arimelody-web(.exe)` should be generated.
|
||||
- `git clone` this repo, and `cd` into it.
|
||||
- `go build -o arimelody-web .`
|
||||
|
||||
## running
|
||||
|
||||
the webserver depends on some environment variables (don't worry about forgetting some; it'll be sure to bug you about them):
|
||||
the server should be run once to generate a default `config.toml` file.
|
||||
configure as needed. note that a valid DB connection is required, and the admin
|
||||
panel will be disabled without valid discord app credentials (this can however
|
||||
be bypassed by running the server with `-adminBypass`).
|
||||
|
||||
- `ARIMELODY_HTTP_DOMAIN`: the domain the webserver will use for generating oauth redirect URIs (default `https://arimelody.me`)
|
||||
- `ARIMELODY_DB_HOST`: the host address of a postgres database.
|
||||
- `ARIMELODY_DB_NAME`: the name of the database.
|
||||
- `ARIMELODY_DB_USER`: the username for the database.
|
||||
- `ARIMELODY_DB_PASS`: the password for the database.
|
||||
- `DISCORD_ADMIN`[^1]: the user ID of your discord account (discord auth is intended to be temporary, and will be replaced with its own auth system later)
|
||||
- `DISCORD_CLIENT`[^1]: the client ID of your discord OAuth application.
|
||||
- `DISCORD_SECRET`[^1]: the client secret of your discord OAuth application.
|
||||
the configuration may be overridden using environment variables in the format
|
||||
`ARIMELODY_<SECTION>_<KEY>`. for example, `db.host` in the config may be
|
||||
overridden with `ARIMELODY_DB_HOST`.
|
||||
|
||||
[^1]: not required, but the admin panel will be **disabled** if these are not provided.
|
||||
the location of the configuration file can also be overridden with
|
||||
`ARIMELODY_CONFIG`.
|
||||
|
||||
the webserver requires a database to run. in this case, postgres.
|
||||
## database
|
||||
|
||||
the [docker compose script](docker-compose.yml) contains the basic requirements to get you up and running, though it does not currently initialise the schema on first run. you'll need to `docker compose exec -it arimelody.me-db-1` to access the database container while it's running, run `psql -U arimelody` to get a postgres shell, and copy/paste the contents of [schema.sql](schema.sql) to initialise the database. i'll build an automated initialisation script later ;p
|
||||
the server requires a postgres database to run. you can use the
|
||||
[schema.sql](schema.sql) provided in this repo to generate the required tables.
|
||||
automatic schema building/migration may come in a future update.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue