Commit Graph
94 Commits
Author SHA1 Message Date
Hermes Agent f22802658e feat: add conditional bootstrap login + 23 admin login tests
- Add hash_password/verify_password to app/auth.py using bcrypt
- Fix /login to reject bootstrap creds (403) when admin users exist
- Add normal password-based login path for existing admin users
- Eagerly load User.roles to avoid lazy-load outside async session
- Fix test_user_models.py VARCHAR assertion (SQLAlchemy 2.0 uses 'string')
- Use shared-cache SQLite in conftest for endpoint-level tests
- Add 23 tests covering all 3 required scenarios plus edge cases:
  1. Bootstrap login with hardcoded creds when no admins → PASS (200)
  2. Bootstrap login with hardcoded creds when admins exist → FAIL (403)
  3. Password login for existing admin with hashed password → PASS (200)
- All 130 tests pass (107 existing + 23 new)
2026-07-30 06:35:52 +00:00
Hermes Agent 0eca079f28 feat: add role-based admin support for multiple admin users
- Add Role model and user_roles association table (many-to-many)
- Add password_hash column to User model (nullable, for future bcrypt)
- Keep is_admin boolean for backward compatibility
- Add is_admin_effective property: true if legacy is_admin OR 'admin' role
- Update auth dependency (get_current_admin_user) to use is_admin_effective
- Update bootstrap login to auto-create 'admin' role and assign on login
- Update Google OAuth login to use is_admin_effective for token creation
- Add migrate_roles.py: idempotent migration script to backfill roles
- Add unit tests for Role, User, association table, and is_admin_effective
2026-07-30 04:54:30 +00:00
kfj001 a36fd92ad4 Merge pull request 'feat: add test framework, unit tests, and GitLab CI pipeline' (#1) from feature/tests-and-ci into main
CI Pipeline / backend-test (push) Successful in 12s
CI Pipeline / frontend-test (push) Successful in 26s
CI Pipeline / backend-lint (push) Successful in 8s
CI Pipeline / quality-gate (push) Successful in 2s
Reviewed-on: http://192.168.1.74:30008/kfj001/kmtnflower/pulls/1
Reviewed-by: kfj001 <kfj001@gmail.com>
2026-07-29 15:40:30 -07:00
robot 4e7ba7adea fix(tests): mock os.path.exists for GeoLite2 tests so reader initialization succeeds
CI Pipeline / backend-test (push) Successful in 12s
CI Pipeline / frontend-test (push) Successful in 27s
CI Pipeline / backend-lint (push) Successful in 9s
CI Pipeline / backend-test (pull_request) Successful in 12s
CI Pipeline / frontend-test (pull_request) Successful in 26s
CI Pipeline / backend-lint (pull_request) Successful in 8s
CI Pipeline / quality-gate (push) Successful in 2s
CI Pipeline / quality-gate (pull_request) Successful in 2s
2026-07-29 22:17:09 +00:00
robot da3cd5b2ed fix: address PR review feedback
CI Pipeline / backend-test (push) Failing after 12s
CI Pipeline / frontend-test (push) Successful in 34s
CI Pipeline / backend-lint (push) Successful in 9s
CI Pipeline / backend-test (pull_request) Failing after 14s
CI Pipeline / frontend-test (pull_request) Successful in 27s
CI Pipeline / backend-lint (pull_request) Successful in 8s
CI Pipeline / quality-gate (push) Successful in 2s
CI Pipeline / quality-gate (pull_request) Successful in 2s
- Remove .gitlab-ci.yml (duplicative with Gitea Actions workflow)
- Add lookup_geo() unit tests with mocked MaxMind reader (4 tests)
- Expand README.md Testing section with backend/frontend/CI docs
- Add CLAUDE.md with test framework documentation
2026-07-29 20:22:41 +00:00
robot 80181cf4ed fix(ci): remove duplicate .gitlab-ci.yml — project uses Gitea Actions, not GitLab CI 2026-07-29 20:11:25 +00:00
CI Bot d7075b163a fix(ci): remove upload-artifact@v4 step incompatible with Gitea Actions
CI Pipeline / backend-test (push) Successful in 12s
CI Pipeline / quality-gate (push) Successful in 2s
CI Pipeline / quality-gate (pull_request) Successful in 2s
CI Pipeline / frontend-test (push) Successful in 27s
CI Pipeline / backend-lint (push) Successful in 8s
CI Pipeline / backend-test (pull_request) Successful in 12s
CI Pipeline / frontend-test (pull_request) Successful in 27s
CI Pipeline / backend-lint (pull_request) Successful in 8s
The actions/upload-artifact@v4 step fails on Gitea with:
  GHESNotSupportedError: @actions/artifact v2.0.0+ not supported on GHES.

Coverage is already enforced via --cov-fail-under=10 in the test step,
so the artifact upload was redundant anyway.
2026-07-29 18:32:52 +00:00
robot 0771a07478 ci: add Gitea Actions workflow for CI pipeline
CI Pipeline / backend-test (push) Failing after 3m18s
CI Pipeline / frontend-test (push) Successful in 2m29s
CI Pipeline / backend-lint (push) Successful in 11s
CI Pipeline / backend-test (pull_request) Failing after 15s
CI Pipeline / frontend-test (pull_request) Successful in 27s
CI Pipeline / backend-lint (pull_request) Successful in 10s
CI Pipeline / quality-gate (push) Successful in 3s
CI Pipeline / quality-gate (pull_request) Successful in 3s
2026-07-29 15:51:18 +00:00
kfj001 96e6742676 feat: initialize frontend unit test framework with Vitest
- Add vitest ^4.0.8, jsdom, @vitest/coverage-v8 to devDependencies
- Configure vitest.config.ts for jsdom environment with src/**/*.spec.ts pattern
- Simplify test-setup.ts (no TestBed needed for standalone unit tests)
- Add example spec file src/app/app.spec.ts (5 tests) covering App component logic
- Add npm scripts: test:unit, test:unit:watch, test:unit:coverage
- Verified: 5/5 frontend tests pass, 86/86 backend pytest tests still pass
2026-07-29 11:17:27 +00:00
kfj001 eae0bffc89 ci: add branch trigger rules and improve quality gate
- Add rules to trigger pipeline on push to main/develop branches
- Separate stages: test, lint, build, gate
- Quality gate explicitly depends on backend-test passing
- Remove hardcoded DB credentials from CI variables
- Fix frontend-test before_script (remove hardcoded CI_PROJECT_PATH)
2026-07-29 11:16:16 +00:00
Hermes Agent 501df79e5c feat: add test framework, unit tests, and GitLab CI pipeline
- Add pytest config in backend/pyproject.toml with asyncio mode and coverage
- Add backend/requirements-test.txt with pytest, pytest-cov, pytest-asyncio, aiosqlite
- Write 86 backend unit tests covering auth (JWT tokens), schemas (Pydantic
  models), config (Settings env overrides), log_parser (log parsing, IP
  resolution, geo data), models (SQLAlchemy table definitions + column
  defaults), and theme export
- Add Vitest config for Angular frontend (vitest.config.ts, src/test-setup.ts)
- Add .gitlab-ci.yml with stages: backend-test, frontend-test, backend-lint,
  docker-build, and quality-gate
- CI enforces 10% minimum coverage threshold for backend
2026-07-29 08:34:42 +00:00
kfj001 8d233b17a5 Updated media player filter. Updated larger hero image size. 2026-07-20 19:14:33 -07:00
kfj001 39b3e633a6 Fixes security issue: potential remote Path Traversal via File Upload 2026-07-19 05:55:58 +00:00
kfj001 4a65c7562f Removes dated plans from the source tree 2026-07-18 01:34:40 +00:00
kfj001 19eb0aee07 documentation updates 2026-07-17 16:27:06 -07:00
kfj001 465e7cb9fb new deployablility enhancements 2026-07-17 16:09:25 -07:00
kfj001 222561c0b7 Fixes media player's problem with apostrophes. 2026-07-13 22:27:08 -07:00
kfj001 c02c0cdde9 Refactors admin page design to move each 'facet' of admin into its own component. 2026-07-10 01:14:30 -07:00
kfj001 a4093e86b1 fixes generated image download 2026-07-08 23:18:07 -07:00
kfj001 57198cd671 Fixes build results console log screen 2026-07-08 20:32:00 -07:00
Your Name bd6ad6009a adjusts resource limits 2026-07-08 22:22:09 +00:00
kfj001 2c66a802c0 incorporates and implements mobile build service functionality. 2026-07-08 15:02:22 -07:00
kfj001 7869574fe2 updated gitignore 2026-07-07 12:52:12 -07:00
Your Name d264bbe374 adds new builder machine plan 2026-07-07 19:38:26 +00:00
Your Name 9e3ee75bd4 fixes for double nginx forward scenarios 2026-07-07 09:17:34 +00:00
Your Name 8cd54459ec Adds website theme serialization system 2026-07-06 06:52:18 +00:00
kfj001 b932d65658 Adds future plan for SEO 2026-07-04 21:24:05 +00:00
kfj001 ba99e88303 updates service api endpoints to allow for nginx forwarding with ssh 2026-07-04 21:10:36 +00:00
kfj001 97044bd854 additional config changes for double proxy. 2026-07-04 20:37:21 +00:00
kfj001 4b8b5b6b2b More double proxy fixes 2026-07-04 19:49:42 +00:00
kfj001 8a3f8984f9 Alters nginx config for backend proxying to prevent caching in double-proxied environs 2026-07-04 19:45:02 +00:00
kfj001 562c28b6cb additional files 2026-07-04 18:40:40 +00:00
kfj001 7a04fa7c84 sets default admin creds in docker compose. first pass remote builder feature 2026-07-04 18:40:29 +00:00
kfj001 78dde4fd0a Updates primary compose to use sockets database access 2026-07-01 08:28:06 +00:00
kfj001 d2ab2240d5 transforms landing, about and schedule page content to data driven 2026-07-01 03:24:30 +00:00
kfj001 2ba6204c3d minor adjustment to media player fixing its width in desktop view 2026-06-30 23:58:30 +00:00
kfj001 fd7b1f2861 Updated geodatabase info 2026-06-30 21:51:09 +00:00
kfj001 e6c5ca1ee3 Updated gitignore - adds 'city' geodata (really country) 2026-06-30 21:48:48 +00:00
kfj001 6db3bf9853 fixes db init for production 2026-06-30 21:37:55 +00:00
kfj001 9b8d4c0f01 layout changes with media player and negative spacing at top of screen. updated sqlalchemy init for postgres deployment 2026-06-30 21:06:35 +00:00
kfj001 87c9b0b8ab better color control 2026-06-30 03:52:00 +00:00
kfj001 f62f8188bf additional colors under admin control 2026-06-29 22:31:37 +00:00
kfj001 ee79662e5d adds color themeing support to the site 2026-06-29 21:23:51 +00:00
kfj001 bfd6c5bb9e sets the site title based on the configured name 2026-06-28 22:40:49 +00:00
kfj001 8ef1ac12c7 bug fixes for local deployment model 2026-06-28 14:37:24 -07:00
kfj001 621e8bd7b6 buildable docker compose 2026-06-28 13:23:00 -07:00
kfj001 de70005b39 dockerfile fixed to include geo db 2026-06-28 12:14:25 +00:00
kfj001 6403e9c332 adds new logs mount to test env deploy 2026-06-28 11:54:04 +00:00
kfj001 ea7025d911 Fixes bugs in map loading on admin/stats screen 2026-06-28 11:32:42 +00:00
kfj001 f3ba0bf5ba fixes initial loading of stats page 2026-06-28 11:23:34 +00:00