Repository navigation
Arena/c9a0e954 schoolerp #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
42ad863
feat(admin): fix dashboard typecheck and rebuild core modules
f2dd306
feat: migration, edge function, admin bootstrap, CI fix
ea3622d
fix(sql): reserved-keyword helper, declaration policy, docs
f793723
fix(admin): demo logins now resolve to seeded profiles
1e35496
fix(sql): three defects found by running the migrations on real Postgres
178be22
chore: make the repo-level typecheck script cover all workspaces
d117ef9
fix(admin): read SUPABASE_URL / SUPABASE_PUBLISHABLE_KEY from .env files
b0fc86b
docs(env): record why unprefixed Supabase vars need loadEnv
3e3a951
docs(status): note the loadEnv build-config row
a8a70c8
Merge origin/main into the dashboard branch
eaa531d
fix(deps): clear the glob and minimatch advisories; upgrade to eslint 10
218ed69
fix(admin): satisfy react-hooks v7 and remove the last advisories
345075b
fix(security): escape user input in printable and preview HTML
03501ca
docs(security): record which scan workflows can actually run
57f4c70
ci: run on Node 22 and move first-party actions off Node 20
8241eaa
fix(deploy): stop 404 when refreshing a client-side route
c8a34ec
docs(status): record the dependency, XSS, deploy and scanner outcomes
0377c07
ci(security): pin every action to a SHA and declare least-privilege p…
670434f
fix(auth): close the demo-account login bypass
c25c08a
fix(build): keep demo credentials out of production bundles reliably
ca6f31a
chore(lint): declare the __DEMO_MODE__ build constant
56fbe68
fix(sql): teaches_section() was always true (parameter shadowed the c…
947b3bd
fix(sql): qualify the outer student_id in the threads INSERT policy
1588784
fix(sql): qualify poll_options.poll_id in its INSERT policy
8bf3f27
docs: record the SQL shadowing fixes and the 25-assertion RLS suite
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,79 @@ | ||
| name: CI\n\non:\n push:\n branches: [main]\n pull_request:\n\njobs:\n lint-and-typecheck:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - uses: actions/setup-node@v4\n with:\n node-version: "18"\n cache: "npm"\n - run: npm ci\n - run: npm run typecheck\n - run: npm run lint\n - name: Guard against public secrets\n run: |\n if grep -r "EXPO_PUBLIC_.*\\(SECRET\\|SERVICE\\|PRIVATE\\|JWT\\|POSTGRES\\|PASSWORD\\|TOKEN\\)" apps/ 2>/dev/null | grep -v "PUBLISHABLE_KEY\\|ANON_KEY"; then\n echo "Found secret-like EXPO_PUBLIC_ var"\n exit 1\n fi\n if grep -r "VITE_.*\\(SECRET\\|SERVICE\\|PRIVATE\\|JWT\\|POSTGRES\\|PASSWORD\\|TOKEN\\)" apps/ 2>/dev/null | grep -v "PUBLISHABLE_KEY\\|ANON_KEY"; then\n echo "Found secret-like VITE_ var"\n exit 1\n fi\n - name: Warn if PROJECT_STATUS not updated\n run: |\n if git diff --name-only HEAD~1 2>/dev/null | grep -E "^(apps|supabase)/" && ! git diff --name-only HEAD~1 2>/dev/null | grep -q "PROJECT_STATUS.md"; then\n echo "::warning::Consider updating PROJECT_STATUS.md"\n fi\n | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| lint-and-typecheck: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 | ||
|
|
||
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 | ||
| with: | ||
| node-version: "22" | ||
| cache: "npm" | ||
|
|
||
| - run: npm ci | ||
|
|
||
| - run: npm run typecheck | ||
|
|
||
| - run: npm run lint | ||
|
|
||
| - name: Build admin console | ||
| run: npm run build --workspace=apps/admin | ||
|
|
||
| - name: Guard against public secrets | ||
| run: | | ||
| failed=0 | ||
|
|
||
| # A client-side variable may name a public key and nothing else. | ||
| # PUBLISHABLE_KEY / ANON_KEY are the allowed exceptions. | ||
| if grep -rIn --include='*.ts' --include='*.tsx' --include='*.js' --include='*.mjs' \ | ||
| --include='.env.example' -E '(EXPO_PUBLIC|VITE)_[A-Z_]*(SECRET|SERVICE|PRIVATE|JWT|POSTGRES|PASSWORD|TOKEN)' \ | ||
| apps/ scripts/ 2>/dev/null \ | ||
| | grep -v -E 'PUBLISHABLE_KEY|ANON_KEY' ; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Filtering whole result lines lets a secret-like variable pass whenever its source line also mentions Assessment: 🟠 Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** .github/workflows/ci.yml
**Line:** 44:44
**Comment:**
*Security: Filtering whole result lines lets a secret-like variable pass whenever its source line also mentions `PUBLISHABLE_KEY` or `ANON_KEY`.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix |
||
| echo "::error::Found a secret-like public (EXPO_PUBLIC_/VITE_) variable." | ||
| failed=1 | ||
| fi | ||
|
|
||
| # The service role / secret key must never be referenced by a web app. | ||
| if grep -rIn --include='*.ts' --include='*.tsx' --include='*.js' --include='*.mjs' \ | ||
| 'SUPABASE_SERVICE_ROLE_KEY' apps/ 2>/dev/null ; then | ||
| echo "::error::Service role key referenced inside apps/." | ||
| failed=1 | ||
| fi | ||
|
|
||
| if [ "$failed" -ne 0 ]; then | ||
| exit 1 | ||
| fi | ||
| echo "No secret-like public variables found." | ||
|
|
||
| - name: Check env var names are the Vercel ones | ||
| run: | | ||
| # The admin console is documented to read SUPABASE_URL and | ||
| # SUPABASE_PUBLISHABLE_KEY. Keep that contract visible in CI. | ||
| grep -q 'SUPABASE_PUBLISHABLE_KEY' apps/admin/.env.example || { | ||
| echo "::error::apps/admin/.env.example must document SUPABASE_PUBLISHABLE_KEY" | ||
| exit 1 | ||
| } | ||
| grep -q 'SUPABASE_URL' apps/admin/.env.example || { | ||
| echo "::error::apps/admin/.env.example must document SUPABASE_URL" | ||
| exit 1 | ||
| } | ||
|
|
||
| - name: Warn if PROJECT_STATUS not updated | ||
| run: | | ||
| changed=$(git diff --name-only "origin/${{ github.base_ref }}...HEAD" 2>/dev/null || git diff --name-only HEAD~1 2>/dev/null || true) | ||
| if echo "$changed" | grep -qE '^(apps|supabase)/' && ! echo "$changed" | grep -q 'PROJECT_STATUS.md'; then | ||
| echo "::warning::Source changed without updating PROJECT_STATUS.md" | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: The pattern omits
DATABASE, so names such asVITE_DATABASE_URLbypass this guard even though the project classifies database variables as server-side.Assessment: 🟠
Major· 🔁Occurrence: Rarely· 🏷️SecurityPrompt for AI Agent 🤖