Skip to content

Missing documentation/templates for PowerSync setup (config-powersync, sync_rules, required env vars), Android app now no longer working #156

Description

@janekkkk

After pulling the latest docker-compose.yml, I noticed it now includes services/powersync.yaml, services/postgres.yaml, and services/redis.yaml, adding a new powersync service. However, getting this actually working required a lot of trial and error, since several required pieces aren't documented anywhere I could find.
Impact: the Android/iOS app is currently unusable for me
Since this update, logging in via the official wger app shows a "Sync service unavailable" error and blocks further use of the app entirely — even though the web client works fine. There doesn't seem to be a way to dismiss this and use the app without PowerSync configured, so anyone updating their self-hosted instance loses app access until PowerSync is fully and correctly set up.

  1. No example config-powersync/powersync.yaml / sync_rules.yaml
    services/powersync.yaml mounts ./config-powersync:/config:ro, but this directory and its contents (powersync.yaml, referencing sync_rules.yaml) aren't provided as an example/template anywhere in this repo. Since the PowerSync service won't start without a valid config here, new users have no starting point.
  2. Required env vars aren't documented for this feature
    To get this working I had to reverse-engineer the following from the wger source code:

JWT_PRIVATE_KEY / JWT_PUBLIC_KEY — generated via python3 manage.py generate-jwt-keys (this part is mentioned in the Settings docs page, but not connected anywhere to the PowerSync feature)
PS_STORAGE_PG_URI — needed for python3 manage.py setup-powersync-storage, not documented at all
PS_JWKS_URL — set automatically in services/powersync.yaml, but its dependency on JWT_PUBLIC_KEY isn't obvious

  1. Postgres replication requirements not called out
    PowerSync requires logical replication (wal_level=logical) on the source Postgres instance. The updated services/postgres.yaml does set this, but if someone has an older standalone db service definition (pre-include refactor), nothing tells them they need to update it or that this is why PowerSync won't replicate.
  2. No mention of any of this in the production deployment docs
    The production/docker.html docs page in the wger docs doesn't mention PowerSync at all, and administration/powersync.html only covers maintenance (compaction), assuming a working setup already exists.
    Suggested fix:

Add a minimal working example under config-powersync/ (e.g. powersync.yaml.example, sync_rules.yaml.example) covering the tables already registered via wger.utils.powersync.PowerSyncHandler subclasses
Add a short "Setting up PowerSync" section to the production Docker docs covering the required env vars and the setup-powersync-storage command
Cross-link the JWT key generation step to the PowerSync feature, not just SimpleJWT/allauth
Consider whether the app should be able to gracefully fall back to "online only" mode instead of blocking login entirely when the sync service is unreachable

Happy to help test/verify a draft of this if useful — happy to share my own working .env/config once I get it fully running.

Version: 2.7.0a1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions