A Go service that synchronizes settings between Redis and a TOML configuration file.
Part of the Librescoot open-source platform.
The service monitors Redis for changes and maintains settings in /data/settings.toml with the following structure:
[scooter]
speed_limit = "25"
mode = "eco"
[cellular]
apn = "internet.provider.com"Settings must be prefixed with their section name:
# Set scooter settings
HSET settings scooter.speed_limit "25"
PUBLISH settings scooter.speed_limit
HSET settings scooter.mode "eco"
PUBLISH settings scooter.mode
# Set cellular settings
HSET settings cellular.apn "internet.lebara.de"
PUBLISH settings cellular.apn- APN Management: When
cellular.apnis updated, the service automatically updates/etc/NetworkManager/system-connections/wwan.nmconnectionif it exists - Startup Sync: On startup, the service reads
/data/settings.tomland populates Redis after flushing existing settings - Empty Config Handling: If the TOML file doesn't exist or has an empty
[scooter]section, Redis settings are flushed - WireGuard Management: On startup, the service:
- Deletes all existing WireGuard connections from NetworkManager
- Waits 120 seconds
- Imports all
*.conffiles from/data/wireguard/as new WireGuard connections
REDIS_ADDR: Redis server address (default:localhost:6379)
make build # Build for ARM7
make build-amd64 # Build for AMD64This project is dual-licensed. The source code is available under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. The maintainers reserve the right to grant separate licenses for commercial distribution; please contact the maintainers to discuss commercial licensing.
Contributions are welcome! Please feel free to submit a Pull Request.
Made with ❤️ by the Librescoot community
