Appearance
Installation Guide
SafeCall is a comprehensive location tracking and safety system for enterprises. This guide covers installation, configuration, and management.
Overview
SafeCall consists of:
- Server: Core application handling tracking, web interface, and API
- Database: SQLite-based storage for beacons, users, and tracking data
- Web Interface: Modern web application for management and monitoring
- Supporting Services: Optional nginx (SSL), monit (monitoring), and cron (auto-updates)
Installation Architecture
The installer uses a two-phase design:
Phase 1 — install Phase 2 — setup
──────────────── ──────────────────
Download binary Guided wizard (6 prompts)
Copy scripts Configure service
Write default config Optional: nginx, cron
Print next steps Run selftestThis separation means Phase 1 is safe to re-run (it only drops files) and Phase 2 can be re-run independently to reconfigure.
Prerequisites
- OS: Linux (Ubuntu/Debian recommended)
- Architecture: x86_64 or ARM64
- Memory: 512MB+ RAM
- Storage: 500MB free
- Network: Internet connection for downloads
- Root access: Required for installation
Quick Start
One-liner (install + setup with defaults)
bash
curl -fsSL https://updates.wantok.cz/download/safecall/installer | sudo bash -s -- --setupThis performs both phases automatically using sensible defaults. The service will be running when it completes.
Two-step (recommended for production)
bash
# Phase 1: Download files
curl -fsSL https://updates.wantok.cz/download/safecall/installer | sudo bash -s --
# Phase 2: Configure with guided wizard
cd /opt/safecall
sudo ./util.sh setupThe wizard asks 6 questions (service name, features, port, systemd, nginx, cron) — press Enter to accept each default.
Two-step with all defaults
bash
curl -fsSL https://updates.wantok.cz/download/safecall/installer | sudo bash -s --
cd /opt/safecall
sudo ./util.sh setup --defaultsTwo-Phase Installation
Phase 1: install
Downloads the binary, scripts, and writes a default main.config.json. Does not start any services.
bash
# Default directory (/opt/safecall)
curl -fsSL https://updates.wantok.cz/download/safecall/installer | sudo bash -s --
# Custom directory
curl -fsSL https://updates.wantok.cz/download/safecall/installer | sudo bash -s -- --dir /custom/pathFiles created by Phase 1:
| File | Purpose |
|---|---|
safecall | Main binary |
util.ts | Bundled TypeScript CLI |
util.sh | Bash wrapper for CLI |
main.config.json | Default configuration |
version.txt | Installed version |
db/ | Database directory |
Phase 2: setup
Configures the service with a guided wizard or --defaults.
bash
cd /opt/safecall
sudo ./util.sh setup # interactive wizard
sudo ./util.sh setup --defaults # accept all defaultsWizard prompts (6 max):
| # | Prompt | Default |
|---|---|---|
| 1 | Service name | safecall |
| 2 | Features | bridge + safecall |
| 3 | HTTP port | 8088 |
| 4 | Register systemd service? | Yes |
| 5 | Setup nginx with SSL? | No |
| 6 | Setup automatic updates? | No |
What setup does:
- Writes
main.config.jsonwith your choices - Persists
.service_name - Creates and starts systemd service (if yes)
- Sets up nginx with self-signed SSL (if yes)
- Installs daily update cron job (if yes)
- Runs
selftestto verify everything works
Commands Reference
All commands require root (sudo). If the CLI symlink is installed, use safecall <command>. Otherwise, use ./util.sh <command> from the install directory.
| Command | Description |
|---|---|
install --dir <dir> | Phase 1: download binary + scripts + default config |
setup [--defaults] | Phase 2: guided wizard to configure service |
config | Show current configuration (pretty-printed) |
config edit | Open config in $EDITOR (or nano), restart service |
config set <key> <value> | Set a single config key, restart service |
config reset | Reset config to defaults, restart service |
update | Update binary to latest version |
repair --dir <dir> | Re-download binary and scripts, recreate service |
uninstall | Completely remove SafeCall (stops service, removes files) |
selftest | Run deployment health checks |
test [--selftest|--full|--clean] | Run tests (selftest, full VM suite, or cleanup) |
status | Show service, monit, cron, and CLI status |
service --user <user> | Create/recreate systemd service |
nginx --ip <ip> | Setup nginx with SSL |
cron | Setup daily update cron job |
user --create | Create a new user (interactive) |
user --delete | Delete a user by email |
user --reset-password | Reset default admin password |
monit | Install and configure monit monitoring |
generate --util-sh | Regenerate util.sh wrapper |
Configuration
Viewing Configuration
bash
# Pretty-printed summary grouped by section
sudo safecall config
# Raw JSON
cat /opt/safecall/main.config.jsonEditing Configuration
bash
# Open in editor (restarts service after save)
sudo safecall config edit
# Set a single value (restarts service)
sudo safecall config set server_http_port 9090
sudo safecall config set server_features '["safecall"]'
# Reset to defaults (restarts service)
sudo safecall config resetConfiguration Reference
The main.config.json file is organized into sections. See the Configuration page for full details.
Service Management
Systemd
bash
sudo systemctl status safecall
sudo systemctl start safecall
sudo systemctl stop safecall
sudo systemctl restart safecallHealth Checks
bash
# Quick selftest (checks files, config, DB, HTTP, service, disk)
sudo safecall selftest
# Full status overview
sudo safecall statusUpdates
bash
# Manual update
sudo safecall update
# Automatic daily updates (via cron)
sudo safecall cronUser Management
bash
sudo safecall user --create # interactive
sudo safecall user --delete # by email
sudo safecall user --reset-password # reset admin passwordTroubleshooting
Service Won't Start
bash
sudo journalctl -u safecall -f
sudo safecall selftest
sudo safecall configPort Conflicts
bash
ss -tlnp | grep :8088
sudo safecall config set server_http_port 9090Permission Issues
bash
sudo chown -R root /opt/safecall
sudo safecall service --user rootRepair Installation
The repair command re-downloads the binary and scripts while preserving your config and database:
bash
sudo safecall repair --dir /opt/safecallIf the CLI itself is broken, re-run Phase 1 and then setup:
bash
curl -fsSL https://updates.wantok.cz/download/safecall/installer | sudo bash -s --
cd /opt/safecall
sudo ./util.sh setup --defaultsComplete Reinstall
bash
# Uninstall
sudo safecall uninstall
# Fresh install
curl -fsSL https://updates.wantok.cz/download/safecall/installer | sudo bash -s -- --setupAdvanced Usage
Custom Service User
bash
sudo useradd -r -s /bin/false safecall
sudo safecall service --user safecallNginx with Custom IP
bash
sudo safecall nginx --ip 192.168.1.100Firewall
bash
sudo ufw allow 8088/tcp # HTTP
sudo ufw allow 443/tcp # HTTPS (with nginx)File Locations
| File | Location | Purpose |
|---|---|---|
| Binary | /opt/safecall/safecall | Main application |
| Config | /opt/safecall/main.config.json | Configuration |
| Database | /opt/safecall/db/safecall.db | Data storage |
| Service | /etc/systemd/system/safecall.service | Systemd unit |
| CLI | /usr/local/bin/safecall | Symlink to util.sh |
| Service name | /opt/safecall/.service_name | Persisted service name |
| Version | /opt/safecall/version.txt | Installed version |