Skip to content

Commit c27dfac

Browse files
committed
chore: enhance host configuration
1 parent 80e0a6b commit c27dfac

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

.changeset/witty-camels-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@quassel/backend": patch
3+
---
4+
5+
Enhance host configuration

apps/backend/src/config/configuration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export const configuration = () => ({
2+
host: process.env.HOST || "0.0.0.0",
23
port: parseInt(process.env.PORT || "") || 3000,
34
cors: {
45
origin: process.env.CORS_ORIGIN || "http://localhost:3001",

apps/backend/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ async function bootstrap() {
3434

3535
SwaggerModule.setup("api", app, document);
3636

37-
await app.listen({ host: "0.0.0.0", port: configService.get("port") });
37+
await app.listen({ host: configService.get("host"), port: configService.get("port") });
3838
}
3939
bootstrap();

docs/setup.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,14 @@ The following sources were used:
106106
sed -i "s/example.com/example.com/g" docker-compose.yaml
107107
```
108108

109-
1. Set environment variables in `docker-compose.yaml`:
110-
- `SESSION_SECRET` to a 32byte random hex string with `openssl rand -hex 32`
111-
- `SESSION_SALT` to a 8byte random hex string with `openssl rand -hex 8`
112-
- `DATABASE_PASSWORD` set a more secure password for the database
113109
1. Change contact email for SSL certificates in `traefik.yaml`
114110
1. Configure the following environment variables in `docker-compose.yaml`:
115-
- **todo**
111+
- **backend**:
112+
- `SESSION_SECRET` to a 32byte random hex string with `openssl rand -hex 32`
113+
- `SESSION_SALT` to a 8byte random hex string with `openssl rand -hex 8`
114+
- `DATABASE_PASSWORD` set a more secure password for the database
115+
- **frontend**:
116+
- `API_URL` set to a escaped URL so it works with sed (e.g. "https:\\/\\/api.test.example.com")
116117
1. Run application system
117118

118119
```bash
@@ -139,7 +140,22 @@ The following sources were used:
139140

140141
1. Migrate database
141142

143+
```bash
144+
docker exec -it $(docker ps -f name=backend -q) npx mikro-orm migration:up
145+
```
146+
147+
1. Seed database
148+
149+
```bash
150+
docker exec -it $(docker ps -f name=backend -q) npx mikro-orm seeder:run
151+
```
152+
142153
### Maintain application system
143154

144155
- Create a database backup
156+
157+
```bash
158+
docker exec -it $(docker ps -f name=database -q) pg_dumpall -c -U postgres > quassel_dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
159+
```
160+
145161
- Archive storage

0 commit comments

Comments
 (0)