- Add complete debian/ packaging structure for .deb creation - Support BIND_ADDR environment variable (defaults to 0.0.0.0) - Create /etc/default/naas config file (defaults to localhost binding) - Systemd service reads from /etc/default/naas - Package installs but does not auto-enable service - Upgrades restart service only if already enabled - Proper user creation and cleanup on install/remove Key files: - debian/control: Package metadata with rustup build dependency support - debian/naas.default: Configuration template for /etc/default/naas - debian/naas.service: Updated systemd service with EnvironmentFile - debian/postinst: Creates naas user, restarts on upgrade if enabled - debian/prerm: Stops service on removal - debian/postrm: Cleans up user on purge - src/main.rs: Added BIND_ADDR support for configurable binding 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
No EOL
533 B
Desktop File
34 lines
No EOL
533 B
Desktop File
[Unit]
|
|
Description=No as a Service (NaaS)
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
Restart=always
|
|
RestartSec=10
|
|
TimeoutStopSec=30
|
|
|
|
# User configuration
|
|
User=naas
|
|
Group=naas
|
|
|
|
# Load configuration from /etc/default/naas
|
|
EnvironmentFile=-/etc/default/naas
|
|
|
|
# Binary execution
|
|
ExecStart=/usr/bin/naas
|
|
|
|
# Security settings
|
|
NoNewPrivileges=true
|
|
PrivateTmp=true
|
|
ProtectSystem=strict
|
|
ProtectHome=true
|
|
ReadWritePaths=
|
|
|
|
# Resource limits
|
|
MemoryLimit=256M
|
|
CPUQuota=50%
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target |