Blame

34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
1
# Configuration
2
4c6b41 Ralph Thesen 2023-12-04 13:05:43
Added link to the installaton guide.
3
The [[Installation Guide|Installation]] can be found [[here|Installation]].
4
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
5
An Otter Wiki is configured in the application via the <i class="fas fa-cogs"></i>
5819b3 Ralph Thesen 2024-09-03 23:00:52
added documentation about the priorities of the settings sources This was discussed in https://github.com/redimp/otterwiki/issues/135
6
**Settings** interface as admin user. Alternatively you configure the variables via the
7
`settings.cfg` or via environment variables.
8
9
*Please note:* What is set in the config file `settings.cfg` will be overwritten first
10
by the environment variables if they are set and second by the settings configured
11
via the settings interface, which are stored in the database. In brief: `Settings Interface > Environment Variables > settings.cfg`.
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
12
40563c Ivan Novohatski 2026-02-03 12:09:51
added missing vars, updated structure
13
### Application Preferences
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
14
40563c Ivan Novohatski 2026-02-03 12:09:51
added missing vars, updated structure
15
| Variable | Example | Description |
16
|--------------------|-----------------|----------------------------------------------|
17
| `SITE_NAME` | `'Otterwiki'` | The `SITE_NAME` displayed on every page and email |
7eb36f Ralph Thesen 2026-02-22 19:01:28
added SERVER_NAME
18
| `SERVER_NAME` | `'wiki.domain.tld'` | Set this to the domain running the wiki. In general it's advisable to be set, behind a well configured reverse proxy this is optional. Used for generating external URLs. |
40563c Ivan Novohatski 2026-02-03 12:09:51
added missing vars, updated structure
19
| `SITE_LOGO` | `'/Home/a/logo.png'` | Customize navbar logo url (can be a page attachment) |
7eb36f Ralph Thesen 2026-02-22 19:01:28
added SERVER_NAME
20
| `SITE_DESCRIPTION` | <code>'A minimalistic wiki powered by<br/> python, markdown and git.'</code> | The default description used in `<meta>` tags |
40563c Ivan Novohatski 2026-02-03 12:09:51
added missing vars, updated structure
21
| `SITE_ICON` | `'/Home/a/favicon-32x32.png'` | Configure via an url to the image that is displayed as favicon (tab icon, URL icon, bookmark icon). This can be an attachment |
22
| `SITE_LANG` | `'en'` | Configures the lang attribute of the `<html>` lang used in the wiki |
23
| `ROBOTS_TXT` | `'allow'` | Configures how the wiki indicates to visiting robots whether they are allowed to crawl the content, could be `allow` or `disallow` |
24
| `HOME_PAGE` | `'My/Page'` | Configures which page is displayed when visiting the root URL (`/`), leave empty for default (`Home`) or define any page path, including special pages that start with `/-/` |
25
| `HIDE_LOGO` | `False` | Hides or shows An Otter Wiki logo in the sidebar |
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
26
7eb36f Ralph Thesen 2026-02-22 19:01:28
added SERVER_NAME
27
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
28
### Permission configuration
29
30
| Variable | Example | Description |
31
|------------------|-----------------|----------------------------------------------|
32
| `READ_ACCESS` | `'ANONYMOUS'` | Read access to wiki pages and attachments |
33
| `WRITE_ACCESS` | `'REGISTERED'` | Write access to wiki pages |
34
| `ATTACHMENT_ACCESS` | `'APPROVED'` | Write acccess to attachments |
f02b8f Ralph Thesen 2024-03-23 17:44:24
Updated configuration: added DISABLE_REGISTRATION, SIDEBAR_MENUTREE_*, AUTH_METHOD, COMMIT_MESSAGE, RETAIN_PAGE_NAME_CASE, GIT_WEB_SERVER
35
| `DISABLE_REGISTRATION` | `False` | With `DISABLE_REGISTRATION=True` new users can not sign-up for a new account |
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
36
| `AUTO_APPROVAL` | `False` | With `AUTO_APPROVAL=True` users are approved on registration |
37
| `EMAIL_NEEDS_CONFIRMATION` | `True` | With `EMAIL_NEEDS_CONFIRMATION=True` users have to confirm their email address |
38
| `NOTIFY_ADMINS_ON_REGISTER` | `True` | Notify admins if a new user is registered |
39
40
There are four types of users in the Otterwiki: `ANONYMOUS` are non logged in users.
41
Users that registered via email and are logged in are `REGISTERED`, users approved via
42
the settings menu by an admin are `APPROVED`. In addition to the `APPROVED` flag the `ADMIN`
43
flag can be set. Users with the `ADMIN` flag can edit (and approve) other users. The first registered user is flagged as admin.
44
f02b8f Ralph Thesen 2024-03-23 17:44:24
Updated configuration: added DISABLE_REGISTRATION, SIDEBAR_MENUTREE_*, AUTH_METHOD, COMMIT_MESSAGE, RETAIN_PAGE_NAME_CASE, GIT_WEB_SERVER
45
46
### Sidebar Preferences
47
48
| Variable | Example | Description |
49
| ----------------------- | ---------- | -------------- |
50
| `SIDEBAR_MENUTREE_MODE` | `'SORTED'` | Mode of the sidebar, see below. |
51
| `SIDEBAR_MENUTREE_MAXDEPTH` | `unlimited` | Limit the depth of the pages displayed by any number. |
52
53
For `SIDEBAR_MENUTREE_MODE` pick one of
54
55
- `NONE` (or empty) no sidebar displayed
56
- `SORTED` Directories and pages, sorted
57
- `DIRECTORIES_GROUPED` Directories and pages, with directories grouped first
58
- `DIRECTORIES_ONLY`List directories only.
59
60
### Content and Editing Preferences
61
62
| Variable | Example | Description |
63
| ----------------------- | ---------- | -------------- |
40563c Ivan Novohatski 2026-02-03 12:09:51
added missing vars, updated structure
64
| `COMMIT_MESSAGE` | `'REQUIRED'` | Set to `'OPTIONAL'` if commit messages should be optional |
65
| `RETAIN_PAGE_NAME_CASE` | `False` | Set to `True` to retain case of the page name in the filename used for storing the page |
66
| `TREAT_UNDERSCORE_AS_SPACE_FOR_TITLES` | `False` | Set to `True` to replace underscores (`_`) with spaces in page titles, breadcrumbs, and page index |
67
| `WIKILINK_STYLE` | `'LINKTITLE'` | Set to `'LINKTITLE'` for `[[WikiPage|Text to display]]` format, leave empty for `[[Text to display|WikiPage]]` format (default) |
0d1f0f Ralph Thesen 2025-03-07 22:51:28
fixed typo
68
| `MAX_FORM_MEMORY_SIZE` | `1000000` | The the maximum size of a submitted form, see the [Flask documentation](https://flask.palletsprojects.com/en/stable/config/#MAX_FORM_MEMORY_SIZE). Increase this if you have really large pages to edit and save. |
f02b8f Ralph Thesen 2024-03-23 17:44:24
Updated configuration: added DISABLE_REGISTRATION, SIDEBAR_MENUTREE_*, AUTH_METHOD, COMMIT_MESSAGE, RETAIN_PAGE_NAME_CASE, GIT_WEB_SERVER
69
40563c Ivan Novohatski 2026-02-03 12:09:51
added missing vars, updated structure
70
### Repository Management
71
e8f97a Ivan Novohatski 2026-02-03 17:26:45
added link to a new repomgmt guide
72
For a detailed guide on **Repository Management** settings, please follow this link: [[Repository Management|Configuration/Repository Management]]
73
40563c Ivan Novohatski 2026-02-03 12:09:51
added missing vars, updated structure
74
| Variable | Example | Description |
75
| ---------------- | ---------- | -------------- |
76
| `GIT_WEB_SERVER` | `False` | Set to to `True` to allow cloning the wiki via git+http(s) |
77
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
78
### Mail configuration
79
beb69b Ralph Thesen 2026-01-28 22:08:09
updated link to Flask-Mail
80
An Otter Wiki is using [Flask-Mail](https://flask-mail.readthedocs.io/en/latest/).
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
81
82
| Variable | Example | Description |
83
|------------------|-----------------|----------------------------------------------|
84
| `MAIL_DEFAULT_SENDER` | `'otterwiki@example.com'` | The sender address of all mails |
85
| `MAIL_SERVER` | `'smtp.googlemail.com'` | The smtp server address |
86
| `MAIL_PORT` | `465` | The smtp server port |
87
| `MAIL_USERNAME` | `'USERNAME'` | Username for the mail account |
88
| `MAIL_PASSWORD` | `'PASSWORD'` | Password for the mail account |
89
| `MAIL_USE_TLS` | `False` | Use TLS encrytion |
90
| `MAIL_USE_SSL` | `True` | Use SSL encryption |
91
f02b8f Ralph Thesen 2024-03-23 17:44:24
Updated configuration: added DISABLE_REGISTRATION, SIDEBAR_MENUTREE_*, AUTH_METHOD, COMMIT_MESSAGE, RETAIN_PAGE_NAME_CASE, GIT_WEB_SERVER
92
### Authentication configuration
93
94
| Variable | Example | Description |
95
|------------------|-----------------|----------------------------------------------|
96
| `AUTH_METHOD` | `'SIMPLE'` | See below. |
97
98
Per default an Otter Wiki uses a local database for storing authentication information.
99
100
#### Authentication with `PROXY_HEADER`s
101
102
With `AUTH_METHOD='PROXY_HEADER'` an Otter Wiki expects the headers
103
104
- `x-otterwiki-name`
105
- `x-otterwiki-email`
106
- `x-otterwiki-permissions`
107
108
to be set by the proxy service using forward authentication.
109
110
The headers `x-otterwiki-name`and `x-otterwiki-email` are used for receiving author information and `x-otterwiki-permissions` a comma seperated list of permissions `READ`, `WRITE`, `UPLOAD` and `ADMIN`.
111
112
A simplified proof of concept can be found on github: [otterwiki/docs/auth_examples/header-auth](https://github.com/redimp/otterwiki/tree/main/docs/auth_examples/header-auth).
113
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
114
### Advanced configuration
115
116
This applies only when you create the `settings.cfg` manually. Create your
117
`settings.cfg` based upon the `settings.cfg.skeleton` and set the
118
variables fitting to your environment.
119
120
| Variable | Example | Description |
121
|------------------|-----------------|----------------------------------------------|
122
| `SECRET_KEY` | `'CHANGE ME'` | Choose a random string that is used to encrypt user session data |
123
| `REPOSITORY` | `'/path/to/the/repository/root'` | The absolute path to the repository storing the wiki pages |
124
| `SQLALCHEMY_DATABASE_URI` | `'sqlite:////path/to/the/sqlite/file'` | The absolute path to the database storing the user credentials |
b1f52e Ralph Thesen 2025-06-04 21:10:11
added LOG_LEVEL
125
| `LOG_LEVEL`. | `'DEBUG'` | Set the log level to one of `'DEBUG'`, `'INFO'`, `'WARNING'`, `'ERROR'`. |
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
126
127
For the `SQLALCHEMY_DATABASE_URI` see <https://flask-sqlalchemy.palletsprojects.com/en/2.x/config/#connection-uri-format>.
128
421730 Ralph Thesen 2025-06-26 08:48:51
How to configure the user/UID running the docker process
129
#### User UID running docker process
130
131
Per default in both the default and the `-slim` image the process running An Otter Wiki (and accessing the files in repository) is running with `uid=33`.
132
133
##### UID in the default image
134
135
To change this when using the default image, please configure the environment variables `PUID` and `PGID`. For example to run as user with `uid=1000 gid=1000` use this `compose.yaml`:
136
137
```yaml
138
services:
139
otterwiki:
140
image: redimp/otterwiki:2
141
restart: unless-stopped
be1525 valankar 2025-08-06 08:32:11
Update configuration.md When using env, I get: validating /home/valankar/otterwiki/docker-compose.yaml: services.otterwiki additional properties 'env' not allowed Change to environment.
142
environment:
421730 Ralph Thesen 2025-06-26 08:48:51
How to configure the user/UID running the docker process
143
PUID: 1000
905b1a valankar 2025-08-06 08:39:35
Update configuration.md Update correct environment variable for GID.
144
PGID: 1000
421730 Ralph Thesen 2025-06-26 08:48:51
How to configure the user/UID running the docker process
145
ports:
146
- 8080:80
147
volumes:
148
- ./app-data:/app-data
149
```
150
151
##### USER in the `-slim` image
152
153
The `-slim` image is running as unpriviliged user must therefore be configured differently: In the way docker intended, with configuring the [user](https://docs.docker.com/reference/compose-file/services/#user). For example to run as user with `uid=1000 gid=1000` use this `compose.yaml`:
154
155
```yaml
156
services:
157
otterwiki:
158
image: redimp/otterwiki:2-slim
159
restart: unless-stopped
160
user: 1000:1000
161
ports:
162
- 8080:8080
163
volumes:
164
- ./app-data:/app-data
165
```
166
167
Make sure that the configured `uid:gid` has read- and write permissions to volume mounted as `/app-data`.
168
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
169
### Reverse Proxy and IPs
170
33bd57 deseven 2025-12-23 16:17:54
added headers to all reverse proxy configs, updated configuration section
171
Running the docker container behind a reverse proxy will show only the IP of the reverse proxy in the log files. With setting `REAL_IP_FROM` to the ip address or network of the reverse proxy, the IPs of the connection clients will be logged.
34401d Ralph Thesen 2023-11-18 14:40:43
Added documentation for configuring An Otter Wiki
172
33bd57 deseven 2025-12-23 16:17:54
added headers to all reverse proxy configs, updated configuration section
173
| Variable | Example | Description |
174
|------------------|-------------------|----------------------------------------------|
175
| `REAL_IP_FROM` | `'172.20.0.0/24'` | Configure wiki to respect `X-Real-IP` header in the requests coming from this IP or network. |