|
| 1 | +# Debian Packaging for SQLPage |
| 2 | + |
| 3 | +This directory contains the source files for building Debian packages of SQLPage. |
| 4 | + |
| 5 | +## Files |
| 6 | + |
| 7 | +- `control` - Package metadata and dependencies |
| 8 | +- `changelog` - Version history for debian packaging |
| 9 | +- `copyright` - License and copyright information |
| 10 | +- `rules` - Build instructions |
| 11 | +- `install` - Files to install and their destinations |
| 12 | +- `postinst` - Post-installation script |
| 13 | +- `postrm` - Post-removal script |
| 14 | +- `sqlpage.service` - systemd service file for package installations |
| 15 | + |
| 16 | +## systemd Service Files |
| 17 | + |
| 18 | +There are **two** systemd service files in this repository: |
| 19 | + |
| 20 | +1. **`/sqlpage.service`** (repository root) |
| 21 | + - For manual/source installations |
| 22 | + - Uses `/usr/local/bin/sqlpage.bin` |
| 23 | + - Includes `RUST_LOG` and `LISTEN_ON` environment variables |
| 24 | + - Includes `AmbientCapabilities=CAP_NET_BIND_SERVICE` for port 80 binding |
| 25 | + |
| 26 | +2. **`/debian/sqlpage.service`** (this directory) |
| 27 | + - For Debian/Ubuntu package installations |
| 28 | + - Uses `/usr/bin/sqlpage` (FHS standard location) |
| 29 | + - Includes `SQLPAGE_CONFIGURATION_DIRECTORY` and `SQLPAGE_WEB_ROOT` variables |
| 30 | + - Does not bind to privileged ports by default |
| 31 | + |
| 32 | +Both files share the same security hardening settings but are customized for their respective installation methods. |
| 33 | + |
| 34 | +## Building |
| 35 | + |
| 36 | +To build the Debian package: |
| 37 | + |
| 38 | +```bash |
| 39 | +dpkg-buildpackage -us -uc |
| 40 | +``` |
| 41 | + |
| 42 | +The built `.deb` file will be placed in the parent directory. |
| 43 | + |
| 44 | +## Testing |
| 45 | + |
| 46 | +After building, you can test the package installation: |
| 47 | + |
| 48 | +```bash |
| 49 | +sudo dpkg -i ../sqlpage_*.deb |
| 50 | +``` |
| 51 | + |
0 commit comments