You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/documentation/server-setup.md
+59-38Lines changed: 59 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,11 +19,23 @@ The server will start on `http://127.0.0.1:4433` and be accessible only from you
19
19
20
20
## Running on a Different Host
21
21
22
-
If you want to access Hister from other devices on your network or run it on a server, you need to configure two settings:
22
+
If you want to access Hister from other devices on your network or run it on a server, you need to configure two settings.
23
+
24
+
### Generate Configuration File
25
+
26
+
You can generate a default configuration file using the `create-config` command:
27
+
28
+
```bash
29
+
./hister create-config config.yml
30
+
```
31
+
32
+
If no filename is provided, it will print the default configuration to `stdout`.
33
+
34
+
> **Note**: You can also configure Hister entirely using **Environment Variables**, which is often easier for server setups. See the [Configuration via Environment Variables](#configuration-via-environment-variables) section below for details.
23
35
24
36
### Bind to All Network Interfaces
25
37
26
-
Create or edit your configuration file at`~/.config/hister/config.yml`:
38
+
Edit your configuration file (e.g.,`~/.config/hister/config.yml`):
27
39
28
40
```yaml
29
41
server:
@@ -93,9 +105,36 @@ server:
93
105
base_url: "https://hister.example.com" # Your public URL
94
106
```
95
107
108
+
## Configuration via Environment Variables
109
+
110
+
Hister can be fully configured using environment variables. This is the **recommended approach for containerized environments** (Docker, Kubernetes, etc.) as it avoids the need to manage configuration files inside the container or mounted volumes.
111
+
112
+
### Environment Variable Format
113
+
114
+
All configuration options can be set using environment variables with the prefix `HISTER__`. Nested keys are separated by double underscores (`__`).
115
+
116
+
| Variable | Description |
117
+
| --- | --- |
118
+
| `HISTER__SERVER__ADDRESS` | The address and port the server binds to (default: `127.0.0.1:4433`) |
119
+
| `HISTER__SERVER__BASE_URL` | The external URL used to access Hister (e.g., `https://hister.example.com`) |
120
+
| `HISTER__SERVER__DATABASE` | The filename of the SQLite database (default: `db.sqlite3`) |
121
+
| `HISTER__APP__DIRECTORY` | The directory where Hister stores its data (shorthand: `HISTER_DATA_DIR`) |
| `HISTER_PORT` | Shorthand to override only the port in `server.address` |
124
+
96
125
## Docker Setup
97
126
98
-
Hister provides official Docker images for both AMD64 and ARM64 architectures.
127
+
Hister provides official Docker images for both AMD64 and ARM64 architectures. Using environment variables is the preferred way to configure Hister in Docker.
128
+
129
+
> **Note on Permissions**: The `latest` image runs as a **non-root user** (UID/GID 1000) by default for better security. Ensure the mounted volume (e.g., `./data`) has the correct permissions. If you need to run as root, use the `ghcr.io/asciimoo/hister:latest-root` image.
130
+
131
+
### Generating Configuration via Docker
132
+
133
+
If you prefer using a configuration file instead of environment variables, you can generate a default one using Docker:
134
+
135
+
```bash
136
+
docker run --rm ghcr.io/asciimoo/hister:latest create-config > config.yml
137
+
```
99
138
100
139
### Basic Docker Compose
101
140
@@ -106,68 +145,50 @@ services:
106
145
hister:
107
146
image: ghcr.io/asciimoo/hister:latest
108
147
container_name: hister
148
+
user: "1000:1000"
109
149
restart: unless-stopped
110
150
volumes:
111
-
- ./config:/hister/data
151
+
- ./data:/hister/data
112
152
ports:
113
153
- 4433:4433
114
154
```
115
155
116
156
### Docker Compose with External Access
117
157
118
-
To make Hister accessible from other devices, you must create a configuration file:
119
-
120
-
**Step 1**: Create `config/config.yml`:
121
-
122
-
```yaml
123
-
server:
124
-
address: "0.0.0.0:4433"
125
-
base_url: "http://192.168.1.100:4433" # Use your actual IP/hostname
126
-
```
127
-
128
-
**Step 2**: Create `compose.yml`:
158
+
To make Hister accessible from other devices, use the `environment` section in your `compose.yml`:
129
159
130
160
```yaml
131
161
services:
132
162
hister:
133
-
image: ghcr.io/asciimoo/hister:master-root
163
+
image: ghcr.io/asciimoo/hister:latest
134
164
container_name: hister
165
+
user: "1000:1000"
135
166
restart: unless-stopped
167
+
environment:
168
+
- HISTER__SERVER__ADDRESS=0.0.0.0:4433
169
+
- HISTER__SERVER__BASE_URL=http://192.168.1.100:4433 # Use your actual IP/hostname
136
170
volumes:
137
-
- ./config:/hister/data
171
+
- ./data:/hister/data
138
172
ports:
139
173
- 4433:4433
140
174
```
141
175
142
-
**Step 3**: Start the container:
143
-
144
-
```bash
145
-
docker compose up -d
146
-
```
147
-
148
176
### Docker Compose Behind Reverse Proxy
149
177
150
-
When running behind a reverse proxy:
151
-
152
-
**config/config.yml**:
153
-
154
-
```yaml
155
-
server:
156
-
address: "0.0.0.0:4433"
157
-
base_url: "https://hister.example.com" # Your public URL
158
-
```
159
-
160
-
**compose.yml**:
178
+
When running behind a reverse proxy, set the `base_url` to your public domain:
161
179
162
180
```yaml
163
181
services:
164
182
hister:
165
-
image: ghcr.io/asciimoo/hister:master-root
183
+
image: ghcr.io/asciimoo/hister:latest
166
184
container_name: hister
185
+
user: "1000:1000"
167
186
restart: unless-stopped
187
+
environment:
188
+
- HISTER__SERVER__ADDRESS=0.0.0.0:4433
189
+
- HISTER__SERVER__BASE_URL=https://hister.example.com # Your public URL
168
190
volumes:
169
-
- ./config:/hister/data
191
+
- ./data:/hister/data
170
192
ports:
171
-
- 4433:4433 # Expose only to localhost if proxy is on same host
172
-
# Or use a Docker network and don't expose ports externally
0 commit comments