OmniPressix

Installation, start and command-line options

Requirements#

  • Go 1.21 or later
  • Internet access the first time, so that go mod tidy can fetch the libraries
  • A current browser (Chrome, Edge, Firefox, Safari)

Libraries used:

LibraryPurpose
github.com/go-pdf/fpdfCreate PDFs
github.com/boombuler/barcodeCalculate barcodes, DataMatrix and PDF417
github.com/piglig/go-qrCalculate QR codes (with character-set information for umlauts)
github.com/go-ldap/ldap/v3Sign-in in server mode
github.com/esimov/pigoFace detection for passport photos
golang.org/x/imageRead and convert OpenType fonts
github.com/chromedp/chromedpOnly for the user-interface tests (drives a browser), not part of the program

Installation and start#

In the project folder (where go.mod and main.go are):

cd omnipressix
go mod tidy
go run .

The editor opens automatically in the browser at http://127.0.0.1:8080. Quit with Ctrl+C in the terminal.

Build as a single program file (the user interface is embedded in it):

go build -o omnipressix .

Compile for Windows#

  1. Install Go: Download the Windows installer (.msi) from https://go.dev/dl/ and run it. Then open a new terminal and check with go version that Go is found.
  2. Open the folder: In Windows Explorer, go to the omnipressix folder, type cmd or powershell in the address bar and press Enter.
  3. Build: `` go mod tidy go build -ldflags "-s -w" -o omnipressix.exe . ` go mod tidy fetches the libraries the first time and needs the internet for that. -s -w` makes the file smaller.
  4. Start: Double-click omnipressix.exe. A terminal window and the editor in the browser open. Close the terminal window to quit.

It is easier with the supplied file build-windows.bat. A double-click runs the two commands and creates omnipressix.exe.

Notes:

  • The .exe is self-contained. It includes the user interface (index.html) and needs no further files and no Go installation. You can copy it to other Windows computers.
  • On first start Windows (“SmartScreen”) may warn about an unknown app because the file is not signed. Start it with “More info” and “Run anyway”.
  • The program only listens on 127.0.0.1. The Windows firewall therefore normally does not ask. If it does, “Cancel” is enough; no network access is needed.
  • The terminal window shows messages such as the PDF-Anfrage lines. If you want to hide the window, you can build with -ldflags "-H=windowsgui". The program can then only be stopped via the Task Manager, so this is not recommended.

Building for Windows from another system: The program needs no C and can therefore be built for Windows directly under Linux or macOS:

GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o omnipressix.exe .

For Windows on ARM (e.g. Surface Pro X) use GOARCH=arm64.

Build for all systems (Linux)#

The script build-all.sh builds the program for all important systems in one go and packs the results. It runs under Linux (and macOS) and only needs Go.

bash build-all.sh

(Alternatively run chmod +x build-all.sh once and then ./build-all.sh.)

The finished files are then in the dist/ folder:

FileSystem
omnipressix-windows-amd64Windows 10/11, 64-bit (Intel/AMD)
omnipressix-windows-arm64Windows on ARM (e.g. Surface Pro X)
omnipressix-linux-amd64Linux, 64-bit (Intel/AMD)
omnipressix-linux-arm64Linux ARM 64-bit (Raspberry Pi 4/5 with a 64-bit system, ARM servers)
omnipressix-linux-armv7Linux ARM 32-bit (Raspberry Pi with a 32-bit system)
omnipressix-macos-intelmacOS with an Intel processor
omnipressix-macos-apple-siliconmacOS with Apple Silicon (M1 and later)
omnipressix-freebsd-amd64FreeBSD, 64-bit

For each system there is a folder with the program, the README and the documentation (docs/), plus an archive (.zip for Windows and macOS, .tar.gz for Linux and FreeBSD). The file SHA256SUMS.txt with the checksums of the archives is added.

Other calls:

CallEffect
bash build-all.sh windowsbuild Windows only
bash build-all.sh linux macosseveral systems (windows, linux, macos, freebsd)
bash build-all.sh --no-archiveonly build, do not pack
bash build-all.sh --listshow all targets
bash build-all.sh --cleandelete the dist/ folder

You add further targets as a new line in the TARGETS list at the top of the script. go tool dist list shows which combinations Go knows. If a target fails, the script names it at the end and exits with an error code. The other targets are built anyway. To pack .zip files the script needs the zip program. If it is missing, Windows and macOS are packed as .tar.gz.

Notes on starting on the target systems:

  • Linux, macOS, FreeBSD: After unpacking, run chmod +x omnipressix once and then start ./omnipressix. The browser opens automatically.
  • macOS: The file is not signed by Apple. On first start macOS may therefore block it (“developer cannot be verified”). Right-click the file, “Open” and confirm, or run xattr -d com.apple.quarantine omnipressix in the terminal.
  • Windows: Double-click omnipressix.exe. For the SmartScreen warning see Compile for Windows.
  • Raspberry Pi: uname -m shows which variant fits: aarch64 means linux-arm64, armv7l means linux-armv7.

Command-line options#

OptionDefaultMeaning
-addr127.0.0.1:8080Address and port of the editor
-no-browseroffDo not open the browser automatically
-app-fensteronOpen the editor in a standalone window without address bar/tabs, see Start as a standalone window
-auto-beendenonQuit the program automatically a few seconds after the editor window was closed. Off with -auto-beenden=false
-auto-beenden-nach2mFallback waiting time for -auto-beenden if closing itself is not detected, e.g. 90s or 5m (at least 30s)
-templates-dirtemplatesFolder for saved templates, see Template management
-vorlagen-staende20How many earlier versions are kept per template (0 = none), see Earlier versions
-fotos-dirfotosFolder for uploaded photos (OMNIPRESSIX_PHOTOS_DIR), see Image fields
-druckprotokolldruckprotokoll.jsonlFile for the print log (OMNIPRESSIX_PRINT_LOG), aus switches it off
-druckprotokoll-mb20Size in MB above which the print log is set aside and a new one started (OMNIPRESSIX_PRINT_LOG_MAX_MB), 0 = never
-serveroffServer mode for several users (default address then 0.0.0.0:8080, no browser, no automatic quit), see Server mode
-anmeldung–ldap or keine; required in server mode
-sitzung12hMaximum duration of a sign-in
-proxyoffBehind a reverse proxy: trust X-Forwarded-For/-Proto
-tls-cert, -tls-key–HTTPS directly in the program (PEM files)
-healthcheck–Checks whether a running OmniPressix answers (for Docker) and exits
-walletoffOffer a digital ID (wallet pass)
-wallet-apple-cert, -wallet-apple-key, -wallet-apple-wwdr–Apple Pass Type ID certificate with key and the Apple WWDR intermediate certificate (PEM files); without them the Apple pass stays unsigned
-wallet-apple-team, -wallet-apple-type, -wallet-apple-org–Apple Team Identifier, Pass Type Identifier and organisation name
-wallet-google-sa–Path to the JSON file of a Google Cloud service account (Google Wallet API); without it Google Wallet stays off
-wallet-google-issuer, -wallet-google-class–Google Wallet issuer ID and class

The options of server mode can also be set through environment variables (see Settings).

Example: go run . -addr 127.0.0.1:9000 -no-browser

The program only listens on your own computer (127.0.0.1). Customer data does not leave it.

Quit automatically when the window is closed#

By default (-auto-beenden) OmniPressix quits by itself as soon as no editor window is open any more – normally a few seconds after closing:

  • When closing, reloading or leaving the page, the editor briefly notifies the program. If it was a real close and not a simple reload (F5), the program waits only a few seconds and then quits.
  • A reload of the page cannot technically be told apart from a close, which is why the program waits this short time: if the page reloads in that time, it reports back immediately and the quit is cancelled.
  • If you have several tabs or windows with the editor open at the same time, the program only quits when none of them is open any more.
  • -auto-beenden-nach (default 2 minutes) is only the fallback for cases in which closing itself is not detected, e.g. when the browser crashes or the computer goes to sleep.

If the program should keep running in the background even without an open window (e.g. on a server that several people use at different times), start it with -auto-beenden=false. You can still quit at any time with the “Quit program” button in the editor or with Ctrl+C.

Start as a standalone window#

By default (-app-fenster is on) OmniPressix looks for Chrome, Edge, Chromium or Brave at start. If it finds one, the editor opens without address bar and without tabs – like a standalone program, not like a browser tab. Technically it is still the same browser, just in the so-called “app mode” (--app=…) that Chromium-based browsers provide.

  • If none of these browsers is installed, the default browser opens normally with an address bar instead, e.g. Firefox or Safari – they do not know this app mode. The editor works just the same there, it only looks less like a standalone app.
  • With -app-fenster=false you always get the normal browser view with an address bar.
  • The local version is not installed as an app (PWA) of the browser: it only runs while the program runs, and has its own app window above for that. For a start-menu icon, create a shortcut to the program (or use the KDE client). Installation as an app is available in server mode, see below.

Installation as an app (PWA, server mode only)#

In server mode (-server, see Server mode) the editor can be installed as an app in Chrome, Edge and other Chromium browsers: it gets its own icon in the start menu or dock and opens in its own window without an address bar. To do so, click the “arrow into tray” icon (“File”) at the top of the editor and there “Install OmniPressix as an app”. The button only appears if the browser offers it (so not in Firefox or Safari, and not if the app is already installed). Alternatively use the browser menu (“Install app” or “Install this site as an app”).

The app is only the user interface: the program (the server) still has to be running to work. If it is not running, the app shows a notice page (“The OmniPressix program is not running”) that loads the editor by itself as soon as the program has started. The installation applies to the address under which it was made – with a different port (-addr) it has to be done again.