[Unit]
Description=BincioActivity Strava sync
Documentation=https://github.com/bincio/bincio-activity
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
User=root
WorkingDirectory=/opt/bincio

# Secrets: BINCIO_SYNC_SECRET (must match --sync-secret passed to bincio serve)
# Copy /opt/bincio/deploy/systemd/sync.env.example → /etc/bincio/sync.env and fill it in.
EnvironmentFile=/etc/bincio/sync.env

ExecStart=/root/.local/bin/uv run --project /opt/bincio bincio sync-strava \
    --data-dir /var/bincio/data \
    --rebuild-url http://localhost:4041/api/internal/rebuild

StandardOutput=journal
StandardError=journal
SyslogIdentifier=bincio-sync

# Don't restart on failure — the timer will retry in 3 hours.
Restart=no
