Skip to content

Building

Germán Luis Aracil Boned edited this page Apr 6, 2026 · 1 revision

Building

Requirements

  • GCC or Clang (C11)
  • GNU Make
  • Linux (2.6.32+ for epoll)

Optional Dependencies

Library For Package (Debian/Ubuntu)
libsqlite3-dev SQLite storage backend apt install libsqlite3-dev
libpq-dev PostgreSQL storage backend apt install libpq-dev
liblzma-dev XZ compression apt install liblzma-dev
zlib1g-dev Gzip compression apt install zlib1g-dev
libssh-dev SSH server module apt install libssh-dev
libldap2-dev LDAP authentication apt install libldap2-dev
lua5.4 Lua scripting engine apt install liblua5.4-dev
python3 Python scripting engine apt install python3
fpc Pascal scripting engine apt install fpc

Compile

./configure          # detects available libraries
make                 # builds core + all modules
make clean           # remove build artifacts

Configure Output

Portal build configuration:
  Core:       yes
  SQLite:     yes (found libsqlite3)
  PostgreSQL: yes (found libpq)
  SSH:        yes (found libssh)
  LDAP:       no  (libldap not found, mod_ldap disabled)
  Lua:        yes (found lua5.4)
  XZ:         yes (found liblzma)
  Gzip:       yes (found zlib)

Modules with missing dependencies are simply not compiled — the core always builds.

Install

# Copy binary
cp portal /usr/local/bin/

# Copy modules
cp modules/*/*.so /usr/local/lib/portal/modules/

# Copy config
cp portal.conf /etc/portal/
cp users.conf /etc/portal/

# Systemd service
cp etc/portal.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable portal
systemctl start portal

Directory Structure

/usr/local/bin/portal                    # binary
/usr/local/lib/portal/modules/*.so       # modules
/etc/portal/portal.conf                  # main config
/etc/portal/users.conf                   # user database
/var/lib/portal/                         # data directory
/var/lib/portal/config.db                # SQLite database
/var/lib/portal/files/                   # mod_file base dir
/var/lib/portal/apps/                    # scripting apps
/var/log/portal/                         # log files

Running

# Foreground with config
./portal -c portal.conf

# Foreground with verbose logging
./portal -c portal.conf -v

# Connect to running instance
./portal -r

# Show version
./portal --version

Tests

# Run all tests
./tests/run_all.sh

# Unit tests only
make test

# Integration tests
./tests/integration/test_complete.py

# Security tests
./tests/security/test_security.sh

# Stress tests
./tests/stress/test_stress.sh

Clone this wiki locally