[Unit]
Description=Gokapi self-hosted file share
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User={{ gokapi_sys_user }}
Group={{ gokapi_sys_group }}
WorkingDirectory={{ gokapi_data_dir }}
Environment=GOKAPI_CONFIG_DIR={{ gokapi_config_dir }}
Environment=GOKAPI_DATA_DIR={{ gokapi_data_dir }}/data
Environment=GOKAPI_PORT={{ gokapi_port }}
Environment=GOKAPI_USE_CLOUDFLARE=true
Environment=GOKAPI_TRUSTED_PROXIES=127.0.0.1
ExecStart={{ gokapi_install_path }}/gokapi
Restart=on-failure
RestartSec=10s
NoNewPrivileges=true
PrivateDevices=true
PrivateTmp=true
ProtectSystem=strict
ProtectControlGroups=true
ProtectHome=true
ProtectKernelTunables=true
ProtectKernelModules=true
ReadWritePaths={{ gokapi_data_dir }}
UMask=0027

[Install]
WantedBy=multi-user.target
