Commit d189d4

2026-08-16 23:27:36 Niklas Polke: Update Installation and Update of Otterwiki
python/otterwiki installation.md ..
@@ 13,24 13,40 @@
cd otterwiki
```
+ 3. Create user for service (and create /opt/otterwiki)
+ ```bash
+ sudo adduser --system \
+ --group \
+ --home /opt/otterwiki \
+ --shell /usr/sbin/nologin \
+ otterwiki
+ sudo chmod 750 /opt/otterwiki
+ sudo chown root /opt/otterwiki
+ ```
+
3. Create and initialize the repository where the otterwiki data lives
```
- mkdir -p app-data/repository
+ sudo install -d -o otterwiki -g otterwiki -m 750 /var/lib/otterwiki
# initialize the empty repository
git init -b main app-data/repository
```
- 4. Create a minimal settings.cfg e.g. via
+ 4. Create a minimal settings.cfg e.g. via sudo -i
```bash
- echo "REPOSITORY='${PWD}/app-data/repository'" >> settings.cfg
- echo "SQLALCHEMY_DATABASE_URI='sqlite:///${PWD}/app-data/db.sqlite'" >> settings.cfg
- echo "SECRET_KEY='$(python3 -c 'import secrets; print(secrets.token_hex())')'" >> settings.cfg
+ echo "REPOSITORY=\"${PWD}/app-data/repository\"" >> settings.cfg
+ echo "SQLALCHEMY_DATABASE_URI=\"sqlite:///${PWD}/app-data/db.sqlite\"" >> settings.cfg
+ echo "SECRET_KEY=\"$(python3 -c 'import secrets; print(secrets.token_hex())')\"" >> settings.cfg
+ chgrp otterwiki settings.cfg
+ chmod 640 settings.cfg
```
- 5. Create a virtual environment and install An Otter Wiki
+ 5. Create a virtual environment and install An Otter Wiki (in /opt/otterwiki)
```bash
+ # create python virtual environment
python3 -m venv venv
+ # upgrade pip and install uwsgi
./venv/bin/pip install -U pip uwsgi
+ # install python application from current directory
./venv/bin/pip install .
```
@@ 105,3 121,18 @@
- Restart nginx via `systemctl restart nginx`
- Open http://wiki.domain.tld in your browser
- Check `journalctl -xeu nginx` and `/var/log/nginx/error.log` for errors.
+
+ ### Update Otterwiki
+ ```bash
+ cd /path/to/otterwiki
+
+ git remote update origin
+
+ LATEST_RELEASE=$(git describe --tags $(git rev-list --tags --max-count=1))
+
+ git checkout -b "$LATEST_RELEASE" "$LATEST_RELEASE"
+
+ ./venv/bin/pip install -U .
+
+ sudo systemctl restart otterwiki.service
+ ``
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9