Deploy and Upgrade APK Ref Injector
Service layout
Section titled “Service layout”The installer uses these locations by default:
/etc/apk-ref-injector/config.yaml/var/lib/apk-ref-injector/The service runs as a dedicated user. Only installation and lifecycle commands need root.
Put HTTPS in front
Section titled “Put HTTPS in front”Run the service on a local port and publish it through your reverse proxy. Example Nginx configuration:
server { listen 443 ssl http2; server_name apk.example.com;
location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }}Forward the original host and protocol so Console login works correctly behind the proxy.
For HTTPS, enable secure cookies in the configuration:
console: secure_cookie: trueDo not enable this option on plain HTTP, or the browser will not send the session cookie.
Back up
Section titled “Back up”Back up the configuration and the data directory:
sudo tar czf apk-ref-injector-backup.tgz \ /etc/apk-ref-injector \ /var/lib/apk-ref-injectorKeep the backup outside the host. The data directory contains the database, uploaded APKs, and icons.
Upgrade
Section titled “Upgrade”- Back up the configuration and data.
- Replace the executable with the new version.
- Restart the service.
- Check the Console and a test download.
The installed executable is normally /opt/apk-ref-injector/apk-ref-injector:
sudo install -m 0755 ./apk-ref-injector /opt/apk-ref-injector/apk-ref-injectorsudo apk-ref-injector restartsudo apk-ref-injector statusUpgrades do not overwrite existing configuration or data. If startup fails, check the service logs and restore the previous executable.
Uninstall
Section titled “Uninstall”sudo apk-ref-injector stopsudo apk-ref-injector uninstallData is kept by default. Remove it only after a backup if you no longer need the installation.