main
md 69 lines 3.78 KB
Rendered Raw
1 ---
2 name: local-environment
3 description: A skill for working with the local environment for sigit.si — running the dev stack (bin/dev + local smbcloud-api), env vars, test accounts, and the gotchas that break local sign-in (missing .env, unbuilt tailwind.css, macOS 26/27 native-gem dlopen).
4 ---
5
6 > **Product map:** siGit Code (local agent) · siGit Code Cloud (hosted chat + Cloud Sessions) · siGit Code Cloud Agent (autonomous task → PR; planning). `sigit.si` is Git hosting; `code.sigit.si` is the home of siGit Code. Full taxonomy: [product-overview](../../../docs/product/product-overview.md).
7
8 ## Running the full local stack
9
10 Two processes make local sign-in work end to end (verified 2026-07-02):
11
12 1. **sigit-si**`bin/dev` (Puma on **:3000** + Tailwind watcher). Do NOT use a
13 bare `bin/rails server`: it neither builds `app/assets/builds/tailwind.css`
14 (→ `Propshaft::MissingAssetError` on every page) nor is there any other
15 process to build it. One-off alternative: `bin/rails tailwindcss:build`.
16 2. **smbcloud-api** — the local auth backend at
17 `~/Repositories/smbcloud/services/smbcloud-api`, `bin/rails server`
18 (Puma on **:8088**, from `API_SMBCLOUD_XYZ_PORT`). Required whenever
19 `SIGITSI_SMBCLOUD_ENVIRONMENT=dev`, because the smbcloud-auth gem's dev
20 environment hard-points at `http://localhost:8088`. If it isn't running,
21 sign-in fails with a network error.
22
23 ## Environment (.env)
24
25 - `.env` at the repo root is gitignored and **required**:
26 `SIGITSI_SMBCLOUD_APP_ID`, `SIGITSI_SMBCLOUD_APP_SECRET`,
27 `SIGITSI_SMBCLOUD_ENVIRONMENT` (`dev` → localhost:8088, `production`
28 api.smbcloud.xyz). Missing vars surface as the flash
29 **"Authentication service is not configured. Please contact support."**
30 (controllers rescue the `KeyError` from `ENV.fetch`).
31 - `bin/dev` (foreman) auto-loads `.env`; a bare `rails server`/`rails runner`
32 does not (`set -a && . ./.env && set +a` first if needed).
33 - **Git worktrees don't inherit `.env`** (gitignored). In a worktree, symlink
34 it: `ln -s ~/Repositories/sigit-si/.env .env`. Same story for
35 `app/assets/builds/` artifacts — rebuild them in the worktree.
36
37 ## Test accounts (local dev)
38
39 The local smbcloud-api Postgres DB (`smbpndk_api_development`) has the sigit-si
40 tenant registered as auth_app **"siGit Code & Deploy"**
41 (`880e7dea-aacb-4ca4-a059-3a649a98f86a` = `SIGITSI_SMBCLOUD_APP_ID`; users were
42 migrated here from the legacy "Rumi App Auth" app on 2026-07-02). Its
43 `auth_users` (all confirmed) include `test@test.com`, `setoelkahfi@gmail.com`,
44 `seto@smbcloud.xyz` — passwords are bcrypt-hashed, so use one you know, sign up
45 a fresh local account, or reset via the smbcloud-api console. Inspect with:
46
47 ```sh
48 psql -h localhost -d smbpndk_api_development \
49 -c "select id, email, confirmed_at is not null from auth_users
50 where auth_app_id = '880e7dea-aacb-4ca4-a059-3a649a98f86a';"
51 ```
52
53 Note: the platform-level seed accounts in smbcloud-api
54 (`db/seeds/demo_accounts.rb`, e.g. `demo@smbcloud.xyz`) are platform `users`,
55 **not** sigit-si tenant users — they will not work on the sigit-si login form.
56 The production demo account is `demo@sigit.si` (prod credential).
57
58 ## Known local-only failure modes
59
60 - **`LoadError: ... auth.bundle ... load command #4 string extends beyond end
61 of load command`** on macOS 26/27 — broken `LC_ID_DYLIB` in the
62 smbcloud-auth native extension; fix and band-aid documented in
63 [smbcloud-auth](../smbcloud-auth/SKILL.md) under "macOS 26/27".
64 - **`The asset 'tailwind.css' was not found in the load path`** — CSS never
65 built in this checkout/worktree; run `bin/dev` or `bin/rails tailwindcss:build`.
66 - **"Authentication service is not configured."**`.env` missing/not loaded
67 (see above).
68 - **Network error on sign-in with `SIGITSI_SMBCLOUD_ENVIRONMENT=dev`** — local
69 smbcloud-api not running on :8088.