Source code for the Codeberg e.V. registration web service.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Gusted 4685eec9b7 Refactor + Tidy up code (#48) 4 months ago
etc move en translation 4 months ago
locales updating CZ translation 4 months ago
templates Merge 're-add post target' (#34) from jklippel into hackathon 4 months ago
.gitignore Update go modules 4 months ago
.woodpecker.yml Refactor + Tidy up code (#48) 4 months ago initial commit 4 years ago
Makefile Gofumpt the code (#46) 4 months ago add information about poswap into Readme 4 months ago
go.mod Update go modules 4 months ago
go.sum Update go modules 4 months ago
main.go Refactor + Tidy up code (#48) 4 months ago
main_test.go Refactor + Tidy up code (#48) 4 months ago


This is the registration server used for the form.


Incoming user data from forms is immediately encrypted using GnuPG Public-Key Encryption. No private key is ever stored on the server.

Encrypted registration records are sent via email to the registration accounts, from where they are fetched and processed off-line.

Files, Overview                                ## This file
main.go                                  ## Source code of the reg-server 
etc/                                     ## The config file template folder, copied to target host at deployment
etc/systemd/system/reg-server.service    ## Systemd service to launch, monitor and restart the reg-service
etc/reg-server/public-key.asc.gpg        ## The public GnuPG key used for encryption on the server
templates/                               ## content templates
locales/                                 ## Translation related files. Translations welcome.

Build+test locally

cd ./etc/reg-server

Then point your browser at http://localhost:5000/


You may want to start ssh-agent and do ssh-add before calling make deployment, to avoid typing your ssh passphrase several times. Then do:

make -C HOSTNAME_FQDN=<hostname> deployment


This tool uses gettext-compatible translation files. See the go-gettext-module documentation for further details.

Basically, it expects language files in locales/{de,en,...}/

As the .po files use for msgids message-stubs rather then the untranslated strings, you can use the English version as a base for your translation (so your poeditor can help as it should), thanks to the poswap utility. When you are done translating, you can swap the .po file back. If you already have a partially localized file, make sure to use it during the swapping. To install poswap locally, install translate-toolkit, for example like this: sudo apt install translate-toolkit. See more details about poswap here or this StackOverflow discussion.

To use (for example) the English version as a base for your translation (example given for Czech language translation):

poswap locales/en/messages.po -t locales/cs/messages.po -o locales/cs/messages.po 

After you are done translating, poswap it back:

poswap --reverse locales/en/messages.po -t locales/cs/messages.po -o locales/cs/messages.po

The .mo files can be generated from the .po files using msgfmt:

find locales -name "*.po" -execdir msgfmt "{}" ";"

Environment variables

The mail setup uses the following environment variables:

export MAIL_HOST=mail.codeberg.local
export MAIL_PORT=587


To test the functionality you can set the environment variables to match your environment.

You must add your public key (matching MAIL_FROM) to etc/reg-server/public-key.asc.gpg if you want to be able to receive the encrypted mails.


This software (excluding bundled fonts) is licensed under GNU AGPL. See the LICENSE file for details.

Logo material is by @mray and licensed under CC-BY.

Codeberg and the Codeberg Logo are trademarks of Codeberg e.V.