queen/README.md

53 lines
959 B
Markdown
Raw Normal View History

2024-03-11 02:34:41 +00:00
# Queen
## Setting up dev environment
Copy the `.env.example` to `.env` then fill in missing variables:
```sh
cp .env.example .env
```
Use `sqlx-cli` (install using `cargo install sqlx-cli`) to create and migrate the database:
```sh
sqlx db create ; sqlx migrate run
```
## Development
Run the server for development:
```
2024-03-12 01:21:11 +00:00
cargo run -- -e .env
2024-03-11 02:34:41 +00:00
```
2024-03-12 01:21:11 +00:00
The `-e` (or `--env`) option tells Queenie where to find its environment configuration file; the
default is `/etc/forgejo/queenie.env`.
2024-03-11 02:34:41 +00:00
The assets used in Queen come from forgejo,
so you can use a local Caddyfile to serve both forgejo and `queen`
(assuming that forgejo is running on localhost:3000):
```
{
http_port 9000
}
localhost:9000 {
reverse_proxy /signup* localhost:4008
reverse_proxy /payment_success* localhost:4008
reverse_proxy localhost:3000
}
```
Run caddy with:
```
caddy run --config Caddyfile
```
2024-03-12 01:21:11 +00:00
## Use in production
There's a sample systemd unit file, `queenie.service`.