Skip to content
Private alpha
Documentation — Web publishing

Documentation

Web publishing

An application whose Web target is checked becomes a server: its windows become pages, rendered by the server and displayed by any browser. To put it on the Internet, you place it behind an HTTPS proxy (Caddy, nginx or Apache), which holds the domain's certificate. Khnoum provides these configurations ready to use.

Setting up publishing

In the Project tab, the Web publishing card asks for:

SettingExamplePurpose
Domainmanage.example.comthe site's address
Path/ or /managethe site root, or a sub-path if the domain hosts something else
Local port8080the port the server listens on, on the machine itself

The card shows the resulting public address, for example https://manage.example.com/manage/.

What the export produces

The web export (see Export) produces:

  • the application's server, for each chosen system and processor;

  • its system service: systemd on Linux, OpenRC on Alpine. The service restarts on error, runs under a dedicated account and keeps its data in /var/lib/<name>;

  • a publication folder with the configuration of each proxy and its instructions:

    • Caddyfile;
    • nginx.conf;
    • apache.conf;
    • LISEZMOI.md.

    Linux packages also install it in /usr/share/doc/<name>/proxy/.

Choosing a proxy

ProxyHTTPS certificate
Caddyobtained and renewed automatically (Let's Encrypt): the simplest
nginxto be obtained with certbot (certbot --nginx -d <domain>), at the locations expected by the configuration
Apachesame (certbot --apache -d <domain>), with the ssl, proxy, proxy_http, headers and rewrite modules

Copy the configuration into the proxy's folder and reload it: the site answers on its domain over HTTPS.

Server variables

The service is already set up from the Web publishing card; these variables let you change it without exporting again:

VariableDefaultPurpose
ADRESSE127.0.0.1listening address (local: only the proxy connects to it)
PORT8080listening port
KHNOUM_CHEMIN/publishing path (/manage)
KHNOUM_HTTPSinferred from the proxy1 forces secure cookies
KHNOUM_DONNEES/var/lib/<name>folder for local data (SQLite, files)

Database passwords are given to the service through their variables (see Data), never in the project.

Security and monitoring

The web application protects every form against cross-site request forgery (CSRF). Behind an HTTPS proxy, its cookies are marked Secure and restricted to its path. The /k/sante address answers "ok" as long as the server is running: a monitoring tool can watch it. Stopping the service lets the requests in progress finish.