Skip to content

Commit 883a649

Browse files
committed
📝 Add config documentation
1 parent 03b294f commit 883a649

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ docker pull ghcr.io/itskovacs/trip:1
5353
docker run -p 8080:8000 -v ./storage:/app/storage ghcr.io/itskovacs/trip:1
5454
```
5555

56+
If you want to configure OIDC authentication or other settings, see [config docs](https://github.com/itskovacs/trip/tree/main/docs/config.md).
57+
5658
<br>
5759

5860
## 📸 Demo <a name = "demo"></a>

docs/config.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
2+
You can modify the configuration by setting values in the `storage/config.yml` file.
3+
4+
> [!NOTE]
5+
> After a `config.yml` edit, you must restart the container for the changes to take effect.
6+
7+
8+
### Change Token duration
9+
10+
To modify the token lifespan, edit `ACCESS_TOKEN_EXPIRE_MINUTES` for the *Access Token* and `REFRESH_TOKEN_EXPIRE_MINUTES` for the *Refresh Token*.
11+
By default, the *Refresh Token* expires after `1440` minutes (24 hours), and the *Access Token* after `30` minutes.
12+
13+
```yaml
14+
ACCESS_TOKEN_EXPIRE_MINUTES=30
15+
REFRESH_TOKEN_EXPIRE_MINUTES=1440
16+
```
17+
18+
19+
### Configure OIDC Auth
20+
21+
> [!TIP]
22+
> By default, `OIDC_PROTOCOL` is `https` and `OIDC_REALM` is `master`
23+
24+
```yaml
25+
OIDC_CLIENT_ID="your-client-id"
26+
OIDC_CLIENT_SECRET="your-client-secret"
27+
OIDC_HOST="sso.yourdomain.lan"
28+
OIDC_REDIRECT_URI="your-redirect-uri"
29+
30+
# Optional,
31+
OIDC_PROTOCOL="https"
32+
OIDC_REALM="master"
33+
```
34+
35+
> [!CAUTION]
36+
> You might face a `SSLError` / `CERTIFICATE_VERIFY_FAILED` if you use `https` protocol. I invite you to check [Troubleshoot SSL Error](#tbshoot-cert) section
37+
38+
39+
### Disable registration
40+
41+
The key `REGISTER_ENABLE` can be configured to `false` if you want to disable registration.
42+
43+
**To disable**, add this in your `config.yml`:
44+
```yaml
45+
REGISTER_ENABLE=false
46+
```
47+
48+
### Modify Image default size
49+
50+
By default, images are resized to `500px` for places and `600px` for trips. You can override these default values by setting them in the `config.yml`:
51+
52+
> [!CAUTION]
53+
> Higher numbers will lead to higher disk usage.
54+
55+
```yaml
56+
PLACE_IMAGE_SIZE=500
57+
TRIP_IMAGE_SIZE=600
58+
```
59+
60+
### Troubleshoot SSL Error / Certificate <a name = "tbshoot-cert"></a>
61+
62+
One way to check if you're concerned by this is simply doing the following and checking the result:
63+
```dockerfile
64+
$ docker run --rm -it ghcr.io/itskovacs/trip:1 /bin/bash
65+
$ python3
66+
>>> import httpx
67+
>>> resp = httpx.get("https://your-keycloak-host/")
68+
```
69+
70+
In case you're facing this issue, it's likely due to the fact that the container does not trust you custom certificate.
71+
72+
To fix this, I recommend you to build your own image with the certificate, based on the latest package.
73+
74+
Pull the latest TRIP image.
75+
```bash
76+
docker pull ghcr.io/itskovacs/trip:1
77+
```
78+
79+
Create a file named `Dockerfile` in your TRIP directory to copy your CA certificate in a custom TRIP image.
80+
```
81+
# Use latest TRIP image
82+
FROM ghcr.io/itskovacs/trip:1
83+
84+
# Copy your CA certificate file in the image. Replace myCA.crt with your certificate name.
85+
COPY myCA.crt /usr/local/share/ca-certificates/
86+
RUN update-ca-certificates
87+
```
88+
89+
Then, simply build the image:
90+
```bash
91+
docker build -t trip-custom-cert .
92+
```
93+
94+
When you want to run TRIP, you just have to use your newly created image `trip-custom-cert`:
95+
```bash
96+
docker run -p 8080:8000 -v ./storage:/app/storage trip-custom-cert
97+
```
98+
99+
> [!IMPORTANT]
100+
> On TRIP update, simply re-create your custom image:
101+
> ```
102+
> docker pull ghcr.io/itskovacs/trip:1
103+
> docker build -t trip-custom-cert .
104+
> ```

0 commit comments

Comments
 (0)