Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
3051cb5
Added env variable for auto reload
ghbm-itk Nov 17, 2025
6330ef0
Added cascade deletion of letters when shipment is deleted
ghbm-itk Nov 17, 2025
051ea79
Added automatic deletion of old shipments
ghbm-itk Nov 17, 2025
d84d86b
Fixed minutes to days
ghbm-itk Nov 17, 2025
924bcd4
Added automated deletion of old registration jobs
ghbm-itk Nov 17, 2025
972bff7
Added proper errors when invalid shipment or registration jobs are re…
ghbm-itk Nov 17, 2025
435a7d5
Bumped nicegui to 3.3
ghbm-itk Nov 17, 2025
b318a45
Changed custom html to ui.seperator
ghbm-itk Nov 18, 2025
2ec8d97
Changed base url redirect
ghbm-itk Nov 18, 2025
2a928c6
Added uv.lock
ghbm-itk Nov 18, 2025
0b0fd5c
Removed status from shipment api response
ghbm-itk Nov 21, 2025
bcfd1f9
Set cleanup loop to 24 hours
ghbm-itk Nov 21, 2025
197115f
Fixed errors after nicegui 3 bump
ghbm-itk Nov 21, 2025
43b6552
Lint
ghbm-itk Nov 21, 2025
b70e17d
Added deletion date to shipments
ghbm-itk Nov 27, 2025
c17d499
Added deletion date to registration jobs
ghbm-itk Nov 27, 2025
670db66
Fixed docstring
ghbm-itk Nov 27, 2025
21a344a
Fixed docstring
ghbm-itk Nov 27, 2025
2e59c3f
Prettier app_reload from env
ghbm-itk Dec 2, 2025
d61597d
Changed sleep logs to debug level
ghbm-itk Dec 3, 2025
a8d0125
Added abort letters db function
ghbm-itk Dec 3, 2025
9b6124b
Added abort shipment button
ghbm-itk Dec 3, 2025
616f956
Added popup before aborting shipment
ghbm-itk Dec 3, 2025
826180e
Added message to letters about user who aborted shipment
ghbm-itk Dec 3, 2025
5672a34
Added shipment delay
ghbm-itk Dec 3, 2025
f4b01a8
Replaced cleanup loop with CLI command
ghbm-itk Jan 5, 2026
31d516e
Lint
ghbm-itk Jan 5, 2026
7257a86
Merge remote-tracking branch 'origin/feature/auto-deletion' into feat…
ghbm-itk Jan 15, 2026
2f7dc39
Added nemsms endpoints
ghbm-itk Jan 16, 2026
50c4cee
Refactored getting logged in user
ghbm-itk Jan 16, 2026
2d5bdb3
Added MultilineLabel class
ghbm-itk Jan 16, 2026
014716f
Fixed shipment pages layout
ghbm-itk Jan 16, 2026
e187fba
Moved db_util
ghbm-itk Jan 16, 2026
0d152e9
NemSMS pages finished
ghbm-itk Jan 16, 2026
3409b01
Cleaned up imports
ghbm-itk Jan 16, 2026
97e3a46
Implemented nemsms worker
ghbm-itk Jan 16, 2026
2a3ea21
Added create_database cli command
ghbm-itk Jan 16, 2026
3835440
Fixed create_database cli
ghbm-itk Jan 16, 2026
d08a62f
Fixed nemsms worker error
ghbm-itk Jan 16, 2026
4368a0c
Added nemsms worker to docker-compose
ghbm-itk Jan 16, 2026
97a3c06
Added nemsms worker to docker-compose.server
ghbm-itk Jan 16, 2026
96bd70e
Updated readme
ghbm-itk Jan 16, 2026
e6d2832
Removed unused constants
ghbm-itk Jan 19, 2026
55bbf77
Added check for duplicate nemsms receivers
ghbm-itk Jan 19, 2026
d01d464
Added auto-import of database modules
ghbm-itk Jan 19, 2026
bd7082b
Lint
ghbm-itk Jan 19, 2026
1728679
Added registration_job_lifetime_days to readme
ghbm-itk Jan 27, 2026
05d9039
Removed deletion date from registration tasks
ghbm-itk Jan 27, 2026
58d320e
Removed deletion date from shipments
ghbm-itk Jan 27, 2026
3901f26
Added PRAGMA magic
ghbm-itk Jan 27, 2026
f63ed43
Changed reload watched directory
ghbm-itk Feb 19, 2026
7a70a82
Merge pull request #19 from itk-dev-rpa/feature/auto-deletion
ghbm-itk Feb 19, 2026
00de764
Merge branch 'develop' into feature/postpone
ghbm-itk Feb 19, 2026
84e0baa
Lint
ghbm-itk Feb 19, 2026
b14d803
Merge pull request #21 from itk-dev-rpa/feature/postpone
ghbm-itk Feb 20, 2026
209a510
Fixed log messages
ghbm-itk Feb 27, 2026
c56313e
Added auto import to database package
ghbm-itk Feb 27, 2026
7dc4c76
Changed uvicorn reload dirs
ghbm-itk Mar 2, 2026
53b5793
Merge remote-tracking branch 'origin/develop' into feature/nemsms
ghbm-itk Mar 2, 2026
c4459f4
Removed duplicate argument
ghbm-itk Mar 2, 2026
14635ee
Changed status table to nicegui table
ghbm-itk Mar 2, 2026
2dcfbdb
Added abort function to nemsms
ghbm-itk Mar 2, 2026
32f3962
Added shipment delay to nemsms
ghbm-itk Mar 2, 2026
906b65d
Added abort button to nemsms shipment page
ghbm-itk Mar 2, 2026
ac22ddb
Changed page header
ghbm-itk Mar 2, 2026
768a10e
Changed page header
ghbm-itk Mar 2, 2026
4df7ae1
Changed Digital post urls
ghbm-itk Mar 2, 2026
ad8dfb5
Changed digital post urls
ghbm-itk Mar 2, 2026
bb1744c
Changed nemsms table to search table
ghbm-itk Mar 2, 2026
319a0f8
Changed frontpage
ghbm-itk Mar 2, 2026
d9c55e8
Merged LetterStatus and MessageStatus enums to one. Added nemsms to m…
ghbm-itk Mar 2, 2026
c6e2bd4
Lint
ghbm-itk Mar 2, 2026
92d61a4
Added pdf to test data
ghbm-itk Mar 3, 2026
2f1da30
Moved get_template function to db_util to allow caching
ghbm-itk Mar 3, 2026
d04d806
Changed digital post to allow pdf letters
ghbm-itk Mar 3, 2026
58a4739
Removed all stupid "letter"
ghbm-itk Mar 3, 2026
9093034
Removed description from shipment dict
ghbm-itk Mar 3, 2026
8fc6d31
Fixed docstring
ghbm-itk Mar 3, 2026
154cf2a
Merge branch 'feature/nemsms' into feature/pdf-letters
ghbm-itk Mar 3, 2026
a6e29ec
Merge pull request #22 from itk-dev-rpa/feature/nemsms
ghbm-itk Mar 3, 2026
44cdfb6
Shipment worker error handling
ghbm-itk Mar 3, 2026
1cb31c8
Fixed import
ghbm-itk Mar 3, 2026
c01af76
Shipment error handling on nemsms
ghbm-itk Mar 3, 2026
72fb8a3
Removed silly log
ghbm-itk Mar 3, 2026
eae59a2
Moved get_template_by_shipment to templates.py
ghbm-itk Mar 3, 2026
cd379ac
Merge pull request #23 from itk-dev-rpa/feature/pdf-letters
ghbm-itk Mar 4, 2026
0ac97d4
Added nonce to oidc login flow
ghbm-itk Mar 4, 2026
cca5006
Merge pull request #24 from itk-dev-rpa/feature/oidc_nonce
ghbm-itk Mar 6, 2026
9e72087
Implemented document storage
ghbm-itk Mar 6, 2026
f7eb4f2
Added delete shipment docs to cli
ghbm-itk Mar 6, 2026
a7b3d32
Moved database path to constant
ghbm-itk Mar 9, 2026
40c071e
Made get_connection engine public
ghbm-itk Mar 9, 2026
953778f
Created schema_util
ghbm-itk Mar 9, 2026
2dc1535
Added migration command
ghbm-itk Mar 9, 2026
c860cd9
Added initial sql migration step
ghbm-itk Mar 9, 2026
dd24bf1
Added database migration to docker compose
ghbm-itk Mar 9, 2026
9771fe9
Updated readme
ghbm-itk Mar 9, 2026
72e5592
Added return type
ghbm-itk Mar 9, 2026
e8d4a6d
Lint
ghbm-itk Mar 9, 2026
3b62aab
Refactor
ghbm-itk Mar 9, 2026
b74d634
Merge branch 'feature/letter-storage' into feature/migrations
ghbm-itk Mar 9, 2026
208f32f
Merge pull request #25 from itk-dev-rpa/feature/letter-storage
ghbm-itk Mar 10, 2026
e1130b8
Removed mailmerge
ghbm-itk Mar 10, 2026
b0b22ab
Added docx util
ghbm-itk Mar 10, 2026
2b67701
Moved docx functionality to docx_util
ghbm-itk Mar 10, 2026
551b364
Moved docx functionality to docx_util
ghbm-itk Mar 10, 2026
de08959
Added docstring
ghbm-itk Mar 10, 2026
3fb4fd9
Updated test template to new jinja format
ghbm-itk Mar 10, 2026
7e9950b
Lint
ghbm-itk Mar 10, 2026
9183614
Merge pull request #26 from itk-dev-rpa/feature/migrations
ghbm-itk Mar 10, 2026
dd6bb9d
Merge branch 'develop' into feature/jinja-templates
ghbm-itk Mar 10, 2026
fc763dd
Added encoding to allow utf8-bom files on upload
ghbm-itk Mar 10, 2026
7862111
Added BOM encoded files to test data
ghbm-itk Mar 10, 2026
32d8234
Add backup db to gitignore
jekuaitk Mar 10, 2026
265eab2
Merge pull request #28 from itk-dev-rpa/feature/gitignore-backup-db
ghbm-itk Mar 12, 2026
59fe284
Merge pull request #27 from itk-dev-rpa/feature/jinja-templates
ghbm-itk Mar 13, 2026
6dbf98c
Updated Nicegui
ghbm-itk Apr 17, 2026
e865557
Added API token lifetime to config
ghbm-itk Apr 17, 2026
10f0252
Changed api key endpoint to return user object
ghbm-itk Apr 17, 2026
ee9f7a3
Added ShipmentModel class
ghbm-itk Apr 17, 2026
a88e38a
Added api token endpoint
ghbm-itk Apr 17, 2026
834a324
Changed api to use session tokens instead of api keys
ghbm-itk Apr 17, 2026
82e9c2a
Router dance
ghbm-itk Apr 17, 2026
36d0c8a
renamed lint workflow
ghbm-itk Apr 17, 2026
cda3f12
Added changelog check workflow
ghbm-itk Apr 17, 2026
89134cf
Added version check workflow
ghbm-itk Apr 17, 2026
ed01846
Added changelog
ghbm-itk Apr 17, 2026
93b6cd5
Added version number to ui
ghbm-itk Apr 17, 2026
68dba6d
Fixed changelog
ghbm-itk May 18, 2026
5901b65
Fixed changelog
ghbm-itk May 18, 2026
b614c99
Fixed version
ghbm-itk May 18, 2026
645d6a6
Limited workflows to main
ghbm-itk May 18, 2026
d39d4cd
Merge pull request #30 from itk-dev-rpa/github-workflows
ghbm-itk May 18, 2026
4511159
Updated version
ghbm-itk May 18, 2026
18bb6e5
Added CVR functionality to letters
ghbm-itk May 19, 2026
d991015
Added CVR to test data
ghbm-itk May 19, 2026
f3a22f6
Renamed obscure table function
ghbm-itk May 19, 2026
cd33865
Updated table id obfuscation logic
ghbm-itk May 19, 2026
5218cf1
Updated changelog
ghbm-itk May 19, 2026
87736da
Merge branch 'develop' into feature/api-session
ghbm-itk May 19, 2026
50bf650
Updated changelog
ghbm-itk May 19, 2026
b08a57e
Lint
ghbm-itk May 19, 2026
390c00c
Merge pull request #31 from itk-dev-rpa/feature/cvr
ghbm-itk May 19, 2026
4c548de
Added api jwt secret
ghbm-itk May 20, 2026
1c3ff4d
Merge pull request #32 from itk-dev-rpa/feature/api-session
ghbm-itk May 20, 2026
d806803
refactored send_post page
ghbm-itk May 20, 2026
afb4699
Updated changelog
ghbm-itk May 20, 2026
b658ca2
Merge branch 'develop' into refactor/send-post
ghbm-itk May 20, 2026
d521e28
Updated docker to properly use uv + bump to python 3.12
ghbm-itk May 21, 2026
2148641
Bumped dependency verison
ghbm-itk May 21, 2026
f5a36cd
Loosened upper bound on dependncies
ghbm-itk May 21, 2026
1fca6ac
Updated dependencies
ghbm-itk May 21, 2026
0c36cd4
Updated changelog
ghbm-itk May 21, 2026
07e6330
Updated linting workflow
ghbm-itk May 21, 2026
fd759cf
Updated changelog
ghbm-itk May 21, 2026
ce63fe5
Set default scale of shipment workers to 5 in server
ghbm-itk May 21, 2026
f36857e
Removed outdated readme lines
ghbm-itk May 21, 2026
5a5f191
Fixed validation message flow and added check for no csv data
ghbm-itk May 27, 2026
1b67b3e
Merge pull request #33 from itk-dev-rpa/refactor/send-post
ghbm-itk May 27, 2026
85c7d98
Merge branch 'develop' of https://github.com/ghbm-itk/OpenPostbud int…
ghbm-itk May 28, 2026
fee2e80
Bumped checkout action
ghbm-itk May 28, 2026
9e7e653
Merge pull request #34 from itk-dev-rpa/hotfix/docker-uv
ghbm-itk Jun 2, 2026
1d1166e
Merge branch 'develop' of https://github.com/ghbm-itk/OpenPostbud int…
ghbm-itk Jun 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 25 additions & 15 deletions .docker/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
# pull pyhton
FROM python:3.11-bookworm
# syntax=docker/dockerfile:1.7

# Update PIP
RUN apt update && \
pip install --no-cache-dir --upgrade pip
FROM python:3.12-slim-bookworm

# Pull the uv binary from the official image (pin to a release for reproducibility).
COPY --from=ghcr.io/astral-sh/uv:0.5.11 /uv /uvx /usr/local/bin/

# Place the project venv outside /app so the docker-compose bind-mount of ./:/app
# does not shadow it at runtime.
ENV UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
UV_PYTHON_DOWNLOADS=never \
UV_PROJECT_ENVIRONMENT=/opt/venv \
PATH="/opt/venv/bin:$PATH"

WORKDIR /app

# Install project and dependencies
RUN pip install uv
COPY pyproject.toml /app/pyproject.toml
RUN uv pip install --system -r /app/pyproject.toml
# Install dependencies first (without the project) for better layer caching.
COPY pyproject.toml uv.lock /app/
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-install-project --no-dev

# Copy the project source and install the project itself.
COPY src /app/src
RUN uv pip install --system -e .
COPY README.md /app/README.md
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev

COPY .env /app/.env

# Add deploy use to match server.
# Add deploy user to match server.
RUN addgroup --gid 1042 deploy \
&& useradd --gid 1042 --uid 1042 --home-dir /home/deploy --create-home --shell /bin/bash deploy

# Ensure app is owned by deploy
RUN chown deploy:deploy /app
&& useradd --gid 1042 --uid 1042 --home-dir /home/deploy --create-home --shell /bin/bash deploy \
&& chown -R deploy:deploy /app /opt/venv

USER deploy

Expand Down
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ nicegui_storage_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # String used for s
database_storage_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # Generate using https://cryptography.io/en/latest/fernet/#cryptography.fernet.Fernet.generate_key

auth_lifetime_seconds=43200
shipment_lifetime_days=30
registration_job_lifetime_days=14

# API
api_jwt_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # String used for jwt signing. Can be anything.
api_token_lifetime_seconds=3600

# Worker seetings
cvr=xxxxxxxx
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/Changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Changelog

on: pull_request

jobs:
changelog:
runs-on: ubuntu-latest
name: Changelog should be updated
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Git fetch
run: git fetch

- name: Check that changelog has been updated.
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0
39 changes: 39 additions & 0 deletions .github/workflows/Version_Check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check pyproject.toml Version Change

on:
pull_request:
branches:
- 'main'

jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Get current version in PR branch
id: get-pr-version
run: |
PR_VERSION=$(sed -n -e 's/^version = "\(.*\)"/\1/p' pyproject.toml)
echo "PR_VERSION=$PR_VERSION" >> $GITHUB_ENV

- name: Get version in base branch
id: get-base-version
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
git checkout FETCH_HEAD
BASE_VERSION=$(sed -n -e 's/^version = "\(.*\)"/\1/p' pyproject.toml)
echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_ENV

- name: Compare versions
run: |
echo "PR version: ${{ env.PR_VERSION }}"
echo "Base branch version: ${{ env.BASE_VERSION }}"

if [ "${{ env.PR_VERSION }}" == "${{ env.BASE_VERSION }}" ]; then
echo "Version number has not been changed."
exit 1
else
echo "Version number has changed."
fi
28 changes: 12 additions & 16 deletions .github/workflows/pr.yml → .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,27 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.11"]
python-version: ["3.12"]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install flake8
pip install .
pip install .[dev]
- name: Install project and dev dependencies
run: uv sync --frozen --extra dev

- name: Analyzing the code with pylint
run: |
pylint $(git ls-files '*.py')
run: uv run pylint $(git ls-files '*.py')

- name: Analyzing the code with flake8
run: |
flake8 --extend-ignore=E501,E251 $(git ls-files '*.py')
run: uv run flake8 --extend-ignore=E501,E251 $(git ls-files '*.py')

markdown-coding-standards:
name: Markdown coding standards
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.db
*.backup
.certs/
OpenPostbud_document_storage/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0]

### Added

- Changelog!
- PR workflows.
- Version number in UI.
- Letters can now be sent to CVR-numbers.

### Fixed

- Refactored send_post.py and fixed minor issues.

### Changed

- Changed API auth flow to JWT based auth.
- Updated docker file to use uv.lock.
- Bumped dependencies.

## [0.0.1]

- Initial release

[Unreleased]: https://github.com/itk-dev-rpa/OpenPostbud/compare/0.1.0...HEAD
[0.1.0]: https://github.com/itk-dev-rpa/OpenPostbud/releases/tag/0.1.0
[0.0.1]: https://github.com/itk-dev-rpa/OpenPostbud/releases/tag/0.0.1
78 changes: 45 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,43 +28,41 @@ This is automatically installed by Docker.

OpenPostbud needs the following environment variables set:

| Name | description | Type |
|-------------------------|-----------------------------------------------------|-------------------------|
| nicegui_storage_secret | The secret used to store user session tokens | String |
| database_storage_secret | The encryption key used to encrypt database columns | A valid 128-bit AES key |
| auth_lifetime_seconds | The number of seconds to keep a user logged in | Integer |
| client_id | OIDC client id | String |
| client_secret | OIDC client secret | String |
| discovery_url | OIDC discovery url | URL |
| redirect_url | OIDC redirect url | URL |
| ui_port | Port the application listens on | Integer |
| ui_host | Host IP to listen on | string |
| ui_reload | Reload application when changes are detected | boolean |
| auth_lifetime_seconds | | integer |
| Name | description | Type | Default |
| ------------------------------ | -------------------------------------------------------------------------- | ----------------------- | ------- |
| nicegui_storage_secret | The secret used to store user session tokens | String | |
| database_storage_secret | The encryption key used to encrypt database columns | A valid 128-bit AES key | |
| client_id | OIDC client id | String | |
| client_secret | OIDC client secret | String | |
| discovery_url | OIDC discovery url | URL | |
| redirect_url | OIDC redirect url | URL | |
| auth_lifetime_seconds | How long a user session is valid | integer | |
| shipment_lifetime_days | How long a shipment should be kept in the database after creation | integer | |
| registration_job_lifetime_days | How long a registration task should be kept in the database after creation | integer | |
| app_reload | Whether the app should reload on code changes | boolean | False |

### Workers

The shipment, registration and message broker workers need the following environment variables set:

| Name | description | Type |
| -------------------------------- | ------------------------------------------------------------------------- | ----------- |
| cvr | The CVR number of the organisation | String |
| kombit_cert_path | The absolute path to the certificate file used for Service Platformen | Path string |
| Kombit_test_env | Whether to use the test environment of Service Platformen | boolean |
| registration_worker_sleep_time | The number of seconds for the registration worker to idle | Integer |
| shipment_worker_sleep_time | The number of seconds for the shipment worker to idle | Integer |
| sender_label | The label to set on the sender of Digital Post | String |
| message_broker_queue_id | The UUID of the message broker queue. Get this from the Kombit admin page | UUID |
| message_broker_worker_sleep_time | The number of seconds for the message broker worker to idle | Integer |

### Development

Under development it's possible to set some environment variables to help with testing.

| Name | Description | Type |
| ------------ | ----------------------------------- | ----------- |
| ssl_certfile | Path to self signed ssl certificate | Path String |
| ssl_keyfile | Path to certificate key file | Path String |
| Name | description | Type | Default |
| -------------------------------- | ------------------------------------------------------------------------- | ----------- | ------- |
| cvr | The CVR number of the organisation | String | |
| kombit_cert_path | The absolute path to the certificate file used for Service Platformen | Path string | |
| Kombit_test_env | Whether to use the test environment of Service Platformen | boolean | |
| registration_worker_sleep_time | The number of seconds for the registration worker to idle | Integer | |
| shipment_worker_sleep_time | The number of seconds for the shipment worker to idle | Integer | |
| shipment_worker_delay | The number of seconds to wait before a new shipment is processed | Integer | 300 |
| sender_label | The label to set on the sender of Digital Post | String | |
| message_broker_queue_id | The UUID of the message broker queue. Get this from the Kombit admin page | UUID | |
| message_broker_worker_sleep_time | The number of seconds for the message broker worker to idle | Integer | |

### API

| Name | description | Type | Default |
| -------------------------- | ------------------------------------------------------ | ------- | ------- |
| api_jwt_secret | Secret for signing JWT auth tokens | String | |
| api_token_lifetime_seconds | The number of seconds for a JWT auth token to be valid | Integer | 3600 |

## Commandline interface (CLI)

Expand All @@ -79,6 +77,20 @@ Some sensitive columns in the database are encrypted using AES.

## Authentication

The OpenPostbud web app uses Microsoft OIDC to authenticate users. This needs to be set up in Microsoft Entra.
The OpenPostbud web app uses OIDC to authenticate users.

Admins can use the CLI command `OpenPostbud admin_access` to get a single-use login URL.

## Development

### Database migrations

If you need to alter the database schema when developing a new feature you need to add a migration step to the automatic
migration tool. Migration files are located in `src\OpenPostbud\database\migrations\sql`. Please name your new migration
file `XXX_Descriptive_name.sql` where 'XXX' is replaced by the next number in the sequence.
The migration file should only contain valid sql statements. Multiple statements are separated by two blank lines.

Please don't change existing migration files as this will break existing server setups. The migration tool keeps
a checksum of every migration file to avoid database drift.

Migrations are automatically applied when the Docker compose file is run.
37 changes: 36 additions & 1 deletion docker-compose.server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,27 @@ services:
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_SERVER_DOMAIN}`)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"

database_migration:
build:
context: .
dockerfile: .docker/app/Dockerfile
command: "OpenPostbud migrate_database"
volumes:
- ./:/app
environment:
TZ: Europe/Copenhagen

app:
build:
context: .
dockerfile: .docker/app/Dockerfile
command: "python src/OpenPostbud/main.py"
restart: unless-stopped
depends_on:
- gotenberg
gotenberg:
condition: service_started
database_migration:
condition: service_completed_successfully
networks:
- app
volumes:
Expand All @@ -67,6 +80,26 @@ services:
- ./certs:/app/certs:ro
environment:
TZ: Europe/Copenhagen
deploy:
replicas: 5

nemsms_worker:
build:
context: .
dockerfile: .docker/app/Dockerfile
command: "python src/OpenPostbud/workers/nemsms_worker.py"
restart: unless-stopped
depends_on:
- app
networks:
- app
volumes:
- ./:/app
- ./certs:/app/certs:ro
environment:
TZ: Europe/Copenhagen
deploy:
replicas: 5

registration_worker:
build:
Expand Down Expand Up @@ -107,3 +140,5 @@ services:
- app
environment:
TZ: Europe/Copenhagen
deploy:
replicas: 5
Loading
Loading