mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-06 08:58:05 +00:00
32a7d53b2b
* feat: add RBAC viewer accounts, atomic deployments, and fleet-wide backups (Pro) Introduces three Pro-tier features: - RBAC: Multi-user system with admin/viewer roles, user management UI, automatic migration from single-admin credentials, viewer restrictions across the entire UI (read-only editor, hidden action buttons) - Atomic Deployments: Pre-deploy file backup to .sencho-backup/, automatic rollback on health probe failure, manual rollback button, health probes added to stack updates, webhook-triggered deploys use atomic rollback - Fleet-Wide Backups: Point-in-time snapshots of compose files across all nodes (local + remote), stored centrally in SQLite, per-stack restore with optional redeploy, graceful handling of offline nodes * fix(settings): use correct ProGate prop name in UsersSection * fix(settings): remove unused isPro prop from UsersSection * fix(auth): fetch user info after login and setup so isAdmin is set correctly * feat(pricing): revise pricing strategy and enforce variant-based seat limits Raise Personal Pro from $49/yr to $69/yr with 3 viewer seats (up from 1). Add $15/mo billing option for Team Pro. Mark lifetime pricing as a 90-day early-adopter offer. Store Lemon Squeezy variant_name on activation/validation and enforce seat limits server-side per variant. * feat(licensing): add Lemon Squeezy checkout, webhook, and billing portal integration Server-side checkout URL generation (POST /api/checkout) with admin email pre-fill and instance_id custom data. HMAC-SHA256 verified webhook endpoint (POST /api/webhooks/lemonsqueezy) handling order, subscription, and payment lifecycle events for automatic license activation. Customer billing portal link stored from webhook events and exposed via GET /api/billing/portal. In-app checkout buttons in Settings with manual license key fallback. * fix(licensing): exempt Lemon Squeezy webhook from auth middleware The catch-all auth middleware on /api/* was blocking the public webhook endpoint. Added /webhooks/lemonsqueezy to the exemption list alongside /auth/* and /webhooks/:id/trigger. * feat(pricing): update pricing to final live rates Personal Pro: $7.99/month, $69.99/year, $249 lifetime. Team Pro: $49.99/month, $499.99/year, $1,499 lifetime. Added personal_monthly checkout variant across backend, frontend, and website. * refactor(licensing): remove server-side checkout/webhook for self-hosted model Sencho is self-hosted — each user runs their own instance, so there is no central server to receive webhooks or hold the store API key. Replaced in-app checkout buttons with a "View Pricing" redirect to sencho.io and kept manual license key activation as the primary flow. - Delete LemonSqueezyService (checkout, webhook, HMAC verification) - Remove POST /api/checkout, GET /api/billing/portal, POST /api/webhooks/lemonsqueezy - Remove raw body parser and auth exemption for webhook route - Remove all LEMONSQUEEZY_* env vars from .env.example - Replace checkout buttons in SettingsModal with single "View Pricing" button - Simplify LicenseContext checkout to open sencho.io pricing page - Update licensing docs to reflect website-based purchase flow * chore: normalize em-dashes to hyphens across codebase (linter) * chore: remove accidentally tracked directories from index
164 lines
5.3 KiB
Plaintext
164 lines
5.3 KiB
Plaintext
---
|
|
title: Troubleshooting
|
|
description: Solutions to the most common Sencho setup and runtime problems.
|
|
---
|
|
|
|
## Containers won't start after deploy
|
|
|
|
**Symptom:** You click Deploy and containers immediately exit or never appear.
|
|
|
|
**Check:** Open the [Host Console](/features/host-console) and run:
|
|
|
|
```bash
|
|
docker compose -f /path/to/your/stack/compose.yaml logs
|
|
```
|
|
|
|
The most common causes:
|
|
|
|
- **Missing environment variable** - a required variable in your `.env` file is empty or has the wrong name.
|
|
- **Port already in use** - another container or host process is bound to the same port. Change the host port in the compose file.
|
|
- **Volume path does not exist** - a bind-mount path on the host doesn't exist yet. Create the directory manually.
|
|
|
|
---
|
|
|
|
## The 1:1 path rule - volumes resolve to wrong paths
|
|
|
|
**Symptom:** Stacks deploy but relative volume paths (e.g. `./config:/config`) point to the wrong location inside the container, or `docker compose` exits with a path error.
|
|
|
|
**Cause:** Your `COMPOSE_DIR` is mounted at a different path inside the Sencho container than it has on the host.
|
|
|
|
**Fix:** Your compose volume mount and `COMPOSE_DIR` environment variable must use the **same absolute path** on both sides:
|
|
|
|
```yaml
|
|
# docker-compose.yml for Sencho itself
|
|
volumes:
|
|
- /opt/docker:/opt/docker # same path inside and outside
|
|
environment:
|
|
- COMPOSE_DIR=/opt/docker
|
|
```
|
|
|
|
See [Configuration - the 1:1 path rule](/getting-started/configuration#compose-directory-the-11-path-rule) for a full explanation.
|
|
|
|
---
|
|
|
|
## "Permission denied" on the Docker socket
|
|
|
|
**Symptom:** Sencho starts but shows errors accessing Docker, or the stack list is empty even though containers exist.
|
|
|
|
**Cause:** The Sencho container cannot read `/var/run/docker.sock`.
|
|
|
|
**Fix:** Ensure the socket is mounted:
|
|
|
|
```yaml
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
```
|
|
|
|
On Linux, the Docker socket is owned by the `docker` group. The Sencho entrypoint detects the socket's GID automatically and adds the internal `sencho` user to the matching group. If you see permission errors despite a correct mount, check that the socket file is readable:
|
|
|
|
```bash
|
|
ls -la /var/run/docker.sock
|
|
# Expected: srw-rw---- 1 root docker ...
|
|
```
|
|
|
|
If the group is not `docker`, the auto-detection still works - Sencho reads the GID from the socket file at startup.
|
|
|
|
---
|
|
|
|
## Login page shows "Something went wrong"
|
|
|
|
**Symptom:** You enter credentials and get a generic error instead of being logged in.
|
|
|
|
**Possible causes and fixes:**
|
|
|
|
| Cause | Fix |
|
|
|-------|-----|
|
|
| `JWT_SECRET` is not set or is empty | Set a non-empty value for `JWT_SECRET` in your environment |
|
|
| Container restarted and session cookie is stale | Clear browser cookies for the Sencho domain and try again |
|
|
| Rate limit triggered (5 failed attempts in 15 min) | Wait 15 minutes, or restart the container to reset the limiter |
|
|
|
|
---
|
|
|
|
## WebSocket connections fail (logs/console not streaming)
|
|
|
|
**Symptom:** The log viewer or host console shows a spinner that never resolves, or you see "Disconnected" immediately after connecting.
|
|
|
|
**Cause:** A reverse proxy is not forwarding WebSocket upgrade headers.
|
|
|
|
**Fix:** Add WebSocket support to your proxy config:
|
|
|
|
```nginx
|
|
# Nginx
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_read_timeout 3600s;
|
|
```
|
|
|
|
Traefik handles WebSocket upgrades automatically for HTTP/1.1 backends - no extra config needed.
|
|
|
|
---
|
|
|
|
## Remote node shows "Offline" or "Unknown"
|
|
|
|
**Symptom:** A node you added shows a red or gray status dot.
|
|
|
|
**Checks in order:**
|
|
|
|
1. **Is the remote Sencho instance running?** SSH to that machine and verify.
|
|
2. **Is the API URL correct?** It must include the protocol and port (e.g. `http://192.168.1.20:3001`). Open it in a browser - you should see a JSON response from `/api/health`.
|
|
3. **Is the token correct?** Tokens are long JWT strings. Even one missing character will cause auth to fail. Regenerate the token on the remote instance and update the node config.
|
|
4. **Is there a firewall blocking the port?** The primary Sencho host must be able to reach the remote host's Sencho port.
|
|
|
|
Click the **wifi icon** on the node row to re-test connectivity after making changes.
|
|
|
|
---
|
|
|
|
## Forgotten admin password
|
|
|
|
Sencho has no password recovery flow. To reset the password:
|
|
|
|
1. Stop the Sencho container
|
|
2. Connect to the SQLite database directly:
|
|
|
|
```bash
|
|
sqlite3 /path/to/data/sencho.db
|
|
```
|
|
|
|
3. Delete the existing credentials so Sencho re-enters first-boot setup mode:
|
|
|
|
```sql
|
|
DELETE FROM global_settings WHERE key IN ('auth_username', 'auth_password_hash', 'auth_jwt_secret');
|
|
```
|
|
|
|
4. Restart the container - the setup screen will appear on next visit.
|
|
|
|
<Warning>
|
|
This resets authentication entirely. All active sessions become invalid. Your stacks, nodes, and alert rules are not affected.
|
|
</Warning>
|
|
|
|
---
|
|
|
|
## Checking the health endpoint
|
|
|
|
Sencho exposes a health endpoint for monitoring and container health checks:
|
|
|
|
```bash
|
|
curl http://localhost:3000/api/health
|
|
# {"status":"ok","uptime":12345.67}
|
|
```
|
|
|
|
A `200` response confirms the backend is running. Use this endpoint in your uptime monitor or load balancer health check.
|
|
|
|
---
|
|
|
|
## Getting logs from the Sencho container itself
|
|
|
|
```bash
|
|
docker logs sencho
|
|
# or, to follow:
|
|
docker logs -f sencho
|
|
```
|
|
|
|
The backend logs all route errors and service failures to stdout. This is the first place to look when the UI shows an error with no useful message.
|