Skip to content

itk-dev-rpa/OpenPostbud

Repository files navigation

OpenPostbud

Introduction

OpenPostbud is a web application that makes it possible to do mail merge and mass shipment of Digital Post using Service Platformen.

OpenPostbud is split into two logical parts: The web app and the task workers. The web app is the frontend presented to the user. The workers run in separate processes performing any queued up shipment or registration tasks.

Installation

OpenPostbud needs Python (>=3.11), pip and setuptools installed to be installed.

To install OpenPostbud navigate to the main folder where pyproject.toml is located and call

pip install .

This will build and install OpenPostbud into the active environment. It will also install any dependencies from pip.

Libre Office

OpenPostbud uses Libre Office to convert docx files to pdf. It does so by calling the Libre Office executable in the command line.

Environment variables

OpenPostbud app

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

Workers

The shipment and registration 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
path_to_libreoffice The absolute path to the Libre Office executable Path string

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

Commandline interface (CLI)

OpenPostbud adds a command line executable called OpenPostbud. Use OpenPostbud -h to see help information about the CLI.

OpenPostbud app

To run the app execute the following command:

OpenPostbud run

This will start a Uvicorn server which listens on port 8000.

Workers

To run the workers:

OpenPostbud registration_worker
OpenPostbud shipment_worker

These workers will run in an infinite loop where they check the database for tasks. If there are no tasks the workers will sleep for a set amount of time.

Database

OpenPostbud uses SQLite and it creates an SQLite database in the current working directory called database.db.

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 the Microsoft Entra.

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •