Install with install.sh

  • For IT
  • Bugsoft Portal 4.12.14

One script sets up Bugsoft Portal on your own Linux server: packages, PHP-FPM, nginx or Apache, HTTPS, backups and checks.

In short

  1. Download the package, check it, and unpack it.
  2. Run sudo ./install.sh and answer a few questions.
  3. Store the emergency account and the keys in your password vault.

The Bugsoft Portal package contains install.sh. This script sets up your own Linux server in one go: the operating system packages, PHP-FPM, nginx or Apache, the database, HTTPS, the scheduled tasks, the backups, SELinux, the firewall and a self-test. Which systems are tested is on What the server needs.

Start the installation

  1. Download the package bugsoft-<version>.tar.gz with its .sha256 file (and .sig) from bugsoft.eu to the server.
  2. Check the package and unpack it:
    sha256sum -c bugsoft-<version>.tar.gz.sha256
    tar -xzf bugsoft-<version>.tar.gz
    cd bugsoft-<version>
  3. Run the script as root: sudo ./install.sh

Never use curl … | bash. Download first, check the SHA-256, then run the script.

What you see

The script asks its questions one by one. Press Enter to accept the suggestion between [ ]. install.sh currently asks its questions in Dutch. In this order, it asks for:

  1. the address of the portal (only the host, for example portal.klaverveld.example);
  2. the web server (nginx or Apache);
  3. the database (SQLite, MariaDB on this server, or MariaDB on another server);
  4. how HTTPS works, and for Let's Encrypt an e-mail address;
  5. sign-in: Microsoft Entra ID now, or later in Admin;
  6. the emergency account, the organisation and the licence;
  7. the name, language and time zone of the portal, and what the dashboard starts with;
  8. the backups, outgoing e-mail and the firewall;
  9. whether you accept the licence terms. Type y (yes).

Then it works through numbered steps and shows a ✓ for each check that passes, for example the PHP version, the clock (NTP), the direct connection to Microsoft and the self-test of https://portal.klaverveld.example/healthz.

At the end it asks you to store the keys. Type VERPLAATST ("moved") once they are in your password vault, or press Enter to do it later with sudo bugsoft keys.

Questions and options

Every question is also an option. In an answers file, the key has the same name in capitals with _: --db-host becomes DB_HOST=.

OptionWhat it does
--domain HOSTThe address of the portal, without https://. The portal runs on https://HOST.
--webserver nginx|apacheDefault: the web server that is already there, otherwise nginx. Other sites on the server are left alone.
--db sqlite|local|remoteSQLite (default), MariaDB on this server (the database and user are created; the password is in /etc/bugsoft/db-password), or MariaDB on another server.
--db-host, --db-port, --db-name, --db-userThe MariaDB server with remote. The database must be empty.
--db-pass-file FILEThe password of the database user, from a file.
--db-ssl-ca FILEThe CA certificate for an encrypted connection to the database.
--tls letsencrypt|certificate|proxy|selfsignedHow HTTPS works; see HTTPS, proxy and load balancer.
--acme-email ADDRESSWith Let's Encrypt: the address for messages about the certificate.
--enable-epelOn Oracle Linux, Rocky, Alma and RHEL, certbot is only in EPEL. Without this option the script asks first.
--tls-cert FILE, --tls-key FILEWith your own certificate: the full chain and the key (PEM).
--proxies LISTBehind a proxy: the IP addresses or networks of the proxy.
--listen IPBehind a proxy: the address of this server on which port 80 listens.
--sso entra|laterSet up Microsoft Entra ID now, or later in Admin › Settings › Sign-in › Connections.
--entra-tenant, --entra-clientThe tenant ID and client ID of the app registration.
--entra-secret-file FILEThe client secret, from a file. Without this option the script asks for it and does not show it.
--entra-secret-expires YYYY-MM-DDThe expiry date of the client secret. Bugsoft Portal warns you in time.
--admin-email ADDRESS, --admin-name NAMEThe emergency account: a local account for when signing in with Microsoft does not work.
--admin-password-file FILEThe password of the emergency account. Without it, Bugsoft Portal makes a strong password.
--organisation NAMEThe name of your organisation (as on the licence).
--license-file FILEA file with the licence key. Without it, the 30-day trial starts.
--name NAMEThe name of the portal (default Bugsoft Portal).
--locale nl|en|frThe default language.
--timezone ZONEThe time zone; the suggestion is the one of the server.
--starter none|SETAn empty dashboard (default) or a starter set, for example microsoft365.
--backup-path FOLDERThe folder for the backups (default /var/backups/bugsoft).
--backup-copy-path FOLDERA second place for every backup, for example a share on another system.
--backup-cert FILEEncrypt every backup for this certificate; see Backups and restoring.
--backup-time HH:MMThe time of the daily backup (default 02:30).
--backup-keep-days NHow many days backups are kept (default 14).
--mail-host, --mail-port, --mail-encryption, --mail-userOutgoing e-mail (optional); see Set up e-mail.
--mail-pass-file FILEThe password of the mail user, from a file.
--mail-from ADDRESS, --mail-from-name NAMEThe sender of the e-mail.
--firewall yes|noOpen ports 80 and 443 in firewalld, or in ufw if that is on (default yes).
--samlAlso install php-xml, for sign-in with SAML.
--accept-termsAccept the licence terms. Required; without this option the script asks.
--init systemd|noneDefault systemd. none (automatic when there is no systemd, as in a container) starts the services itself and uses /etc/cron.d.

How the script runs

  • --yes: ask nothing. A required value that is missing is an error.
  • --answers FILE: read the answers from a file (KEY=VALUE). Only known keys; the file is never executed.
  • --write-answers FILE: write the answers to a file, without secrets. Useful to keep a test environment and production the same; see A test environment and production.
  • --dry-run: change nothing. Every command is shown, and every file as a diff -u.
  • --package FILE: check and unpack a package instead of using the folder of the script.
  • --allow-unsigned: accept a test package without a signature, or a signature that cannot be checked (there is no release key). Never for production.
  • --latest: only with sudo bugsoft update: download the newest version that the licence check names, and install it; see Update Bugsoft Portal.
  • --purge: only with sudo bugsoft uninstall; see Stop using Bugsoft Portal.

You can safely run the script again. Each step first checks whether there is anything to do. If Bugsoft Portal is already installed, it only updates the settings. A second run with --dry-run should show nothing.

What the script does

  1. Checks first: root, the operating system, at least 1 GB of memory and 2 GB of free disk, the clock (NTP), ports 80 and 443, and whether the server can reach Microsoft directly.
  2. Packages from the sources of the operating system; no third-party sources. On Oracle Linux, Rocky and Alma, the module streams for PHP, nginx and MariaDB.
  3. PHP-FPM: its own pool that runs as the user bugsoft.
  4. Install Bugsoft Portal: database, keys, emergency account. Every secret goes through a file, never through the command line.
  5. Bugsoft Portal checks: the Bugsoft Connect key, the connection to Microsoft, the licence.
  6. The site for nginx or Apache, only after the installation, tested with nginx -t or apachectl configtest. If that fails, the previous version comes back.
  7. Scheduled tasks: bugsoft cron:run every minute, and a backup every night.
  8. SELinux (Oracle Linux, Rocky, Alma, RHEL) and the firewall.
  9. Self-test: /healthz, no secret files readable through the website, http redirects to https, and production:check.

Everything is written to the log /var/log/bugsoft-install.log, without secrets.

Where everything is

WhatWhere
The code (read-only)/opt/bugsoft/releases/<version>; the active version through /opt/bugsoft/current
Settings and keys/etc/bugsoft/bugsoft.env
The answers of install.sh/etc/bugsoft/install.conf
Data/var/lib/bugsoft
Backups/var/backups/bugsoft
Admin command/usr/local/sbin/bugsoft; see The bugsoft command

After the installation

At the end, the emergency account is in /root/bugsoft-noodaccount.txt and the keys are in /root/bugsoft-sleutels.env. Put both in your password vault. Then continue with First steps after the installation.

Without the keys from /root/bugsoft-sleutels.env, the saved passwords and the authenticator keys are lost, even if you have a backup. The keys are deliberately not in the backups.

Stuck? See Questions and problems or contact Bugsoft at ugurs156@gmail.com.