Skip to content

Deploy and Upgrade APK Ref Injector

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.

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: true

Do not enable this option on plain HTTP, or the browser will not send the session cookie.

Back up the configuration and the data directory:

Terminal window
sudo tar czf apk-ref-injector-backup.tgz \
/etc/apk-ref-injector \
/var/lib/apk-ref-injector

Keep the backup outside the host. The data directory contains the database, uploaded APKs, and icons.

  1. Back up the configuration and data.
  2. Replace the executable with the new version.
  3. Restart the service.
  4. Check the Console and a test download.

The installed executable is normally /opt/apk-ref-injector/apk-ref-injector:

Terminal window
sudo install -m 0755 ./apk-ref-injector /opt/apk-ref-injector/apk-ref-injector
sudo apk-ref-injector restart
sudo apk-ref-injector status

Upgrades do not overwrite existing configuration or data. If startup fails, check the service logs and restore the previous executable.

Terminal window
sudo apk-ref-injector stop
sudo apk-ref-injector uninstall

Data is kept by default. Remove it only after a backup if you no longer need the installation.