Commit Graph
252 Commits
Author SHA1 Message Date
siujamo 040801ac3b Merge remote-tracking branch 'origin/main' 2026-09-01 16:38:18 +08:00
Siu Jam Oh 68c10979ff Merge pull request 'refactor: migrate to ahsarah-guide monorepo with auth, web, and CI updates' (#1) from develop into main
Reviewed-on: https://onixbyte.dev/onixbyte/ahsarah-guide/pulls/1
2026-08-28 10:56:57 +08:00
siujamo 704abc7389 merge: sync main into develop after monorepo migration 2026-08-28 10:56:08 +08:00
siujamo 27bba95250 chore: remove stray server files from root directory on main branch 2026-08-28 10:01:39 +08:00
siujamo 9e86447c45 chore: sync main branch with develop (monorepo rename) 2026-08-28 09:52:50 +08:00
siujamo 33a7c32b1e refactor: rename delta-force-guide to ahsarah-guide and merge into monorepo
- Merge delta-force-guide-server into server/ subdirectory
- Merge delta-force-guide-web into web/ subdirectory
- Rename Java package com.onixbyte.deltaforceguide to com.onixbyte.ahsarahguide
- Rename DeltaForceGuideApplication to AhsarahGuideApplication
- Update all config files, Dockerfiles, and CI workflows
- Update frontend display name and repo links
- Update legal documents (EULA, PrivacyPolicy)
- Create root-level CLAUDE.md, README.md, LICENCE, .gitignore, .gitattributes
- Move CI workflows to root .gitea/workflows/ with working-directory
- Delete .gitlab-ci.yml (legacy)
- Preserve git history from both original repositories
2026-08-28 09:51:36 +08:00
siujamo 8776f45684 chore: merge delta-force-guide-web into web/ (main)
git-subtree-dir: web
git-subtree-mainline: 694bebe2c8
git-subtree-split: b000336d22
2026-08-28 09:38:10 +08:00
siujamo 694bebe2c8 chore: merge delta-force-guide-server into server/ (main)
git-subtree-dir: server
git-subtree-mainline: bb08f1e4b6
git-subtree-split: bb08f1e4b6
2026-08-28 09:38:09 +08:00
siujamo a2b94dfda5 chore: merge delta-force-guide-web into web/
git-subtree-dir: web
git-subtree-mainline: 25da2564a4
git-subtree-split: e4aa5b988b
2026-08-28 09:37:58 +08:00
siujamo 25da2564a4 chore: merge delta-force-guide-server into server/
git-subtree-dir: server
git-subtree-mainline: 2a3d7fdb25
git-subtree-split: 099f138206
2026-08-28 09:37:41 +08:00
siujamo 2a3d7fdb25 chore: initialise ahsarah-guide monorepo 2026-08-28 09:37:11 +08:00
siujamo 099f138206 chore(config): turn off thymeleaf template location check 2026-08-21 10:47:05 +08:00
siujamo ffcd234221 feat(auth): bind code to the requesting user
Store the username and email alongside the code in the cached
EmailVerificationCode object, and reject registration when the
username or email no longer match the original request.
2026-08-21 09:31:37 +08:00
siujamo 812ab0ba91 docs(api): hide injected current user in OpenAPI
Annotate @CurrentUser with @Parameter(hidden = true) so the
server-injected user parameter no longer appears in the generated
API docs.
2026-08-21 09:31:34 +08:00
siujamo 3aaf7feb4f refactor(mod): page query via specifications
Unify the native JSONB query and findAllBy dual path through
JpaSpecificationExecutor:
- add ModificationSpecification for firearm and tag filters
- eagerly fetch the firearm association via entity graph
- filter by the firearm id attribute instead of a missing top-level field
2026-08-20 17:24:08 +08:00
siujamo e4df329f0f fix(auth): query credentials by composite key
Build a UserCredentialId and compare the embedded id directly, since
provider and userId are not top-level attributes of UserCredential.
2026-08-20 17:24:06 +08:00
zihluwang 00a62de5ee refactor: retrieving value with Optional 2026-08-20 15:43:03 +08:00
zihluwang 2936b6aece feat(mod): add status and creator tracking
- Introduce ModificationStatus enum with integer codes and a JPA converter
- Record the creating user on new modifications
- Rebuild the modification table with status, creator and audit columns
- Simplify user_role to a single-column primary key
2026-08-20 15:18:49 +08:00
zihluwang 4d9bf64ef4 fix(mail): add base smtp config for mail sender
- Configure a default SMTP host and username so the JavaMailSender bean is always created
- Move from-address injection from a field to a setter
2026-08-19 14:10:41 +08:00
zihluwang d9b74ae2e3 feat(auth): add email verification codes
- Add POST /auth/verification-code endpoint to email a code
- Store codes in Redis and verify them during registration
- Send verification emails asynchronously via Thymeleaf
- Replace email_verified column with code-based verification
- Group dependencies into version catalogue bundles
2026-08-19 13:39:36 +08:00
zihluwang 8f98d02044 feat(auth): add user registration endpoint
- Validate username, email and password on register
- Reject duplicate usernames and email addresses
- Create user with LOCAL credential and default USER role

Closes #3
2026-08-14 00:27:05 +08:00
zihluwang 1aeefb6733 refactor(auth): centralise cookie building
- Move cookie construction logic into CookieManager
- Remove CookieService
2026-08-11 12:48:20 +08:00
zihluwang dadd9a7221 refactor(auth): mark resolver params non-null
- Annotate resolveArgument parameters with jspecify @NonNull
2026-08-11 12:23:17 +08:00
zihluwang 17b919705e docs(config): document prod config options
- Add comments to datasource, redis, cookie and webhook sections
- Polish existing CORS and springdoc comments
- Enable secure cookie to satisfy same-site none
- Fix token secret and GitHub username typos
2026-08-11 12:07:18 +08:00
zihluwang 0a7882c5ce feat(auth): add configurable token renew threshold
- Add renew-threshold JWT config option with PT5M default
- Default valid-time to PT2H in TokenProperties
- Expand comments in the prod config example
2026-08-11 00:54:46 +08:00
zihluwang a765c705e6 fix(auth): use bare role names in annotations 2026-08-10 15:50:55 +08:00
zihluwang 3f60df9de2 feat(auth): add role-based authorization
- Load the user's role during authentication and expose it as
  a granted authority on the authenticated token
- Add @RequiresAdmin and @RequiresSuperUser method-level
  annotations for role-gated endpoints
- Introduce a shared BaseRepository with specification support
- Replace Example-based credential queries with JPA specifications
2026-08-10 15:49:49 +08:00
zihluwang 471eda5353 refactor(webhook): generalise controller routes
- Rename GitHubWebhookController to WebhookController
- Move class-level mapping from /webhooks/github to /webhooks
- Scope the GitHub endpoint to /webhooks/github via @PostMapping
2026-08-10 14:33:45 +08:00
siujamo ac877ab8f0 fix(auth): enforce single role per user
Change the user_role primary key from (user_id, role) to user_id alone, so each user holds at most one role row.
2026-08-06 17:51:38 +08:00
siujamo b131738dda refactor: replace BizException with ResponseStatusException 2026-08-06 17:20:36 +08:00
zihluwang 4aafbaeadc Merge branch 'main' into develop 2026-07-21 14:23:52 +08:00
zihluwang 581634f33a Merge pull request 'feat(auth): add user profile centre and admin role system' (#12) from feature/user-profile-and-roles into develop
Reviewed-on: https://onixbyte.dev/onixbyte/delta-force-guide-server/pulls/12
Reviewed-by: Siu Jam Oh <jamo.siu@gmail.com>
2026-07-21 14:23:02 +08:00
zihluwang c1d893db5f refactor(auth): simplify role enforcement with built-in @PreAuthorize
- remove custom RequiresRole annotation and RoleBasedAuthorizationManager
- replace @RequiresRole with @PreAuthorize("hasRole('SUPER_USER')") in AdminController
- remove requiresRoleAdvisor bean from SecurityConfig
2026-07-21 14:21:13 +08:00
zihluwang db5056e8d5 feat(auth): add user profile centre and admin role system
- add GET/PUT /user/me endpoints for profile viewing and editing
- add PUT /user/me/password endpoint for password changes
- add GET /user/me/builds skeleton endpoint for future CustomModification
- add user_role table with ROLE_USER, ROLE_ADMIN, and ROLE_SUPER_USER roles
- add @RequiresRole annotation with custom AuthorizationManager enforcement
- extend User entity with nickname, avatarUrl, emailVerified, enabled,
  createdAt, and updatedAt columns
- load user roles into SecurityContext authorities via TokenAuthenticationFilter
- add @CurrentUser annotation and argument resolver for controller injection
- add PUT/DELETE /admin/users/{id}/roles for SUPER_USER role management
- add V6 and V7 Flyway migrations for schema changes

Closes #5
Closes #8
2026-07-21 13:44:02 +08:00
siujamo 0aeaac17a4 feat: custom 401/403 error handling for unauthenticated requests
Replace default Spring Security 403 responses with custom 401 (not logged in)
and 403 (insufficient permissions) JSON error responses via exception handling
and global exception handler. Also bump API version to 1.4.0 and add Swagger
annotations for the GitHub webhook controller.
2026-06-29 09:38:12 +08:00
siujamo e4aa5b988b ci: fix release pipeline upload and deploy
- scp target restored to /tmp/: /tmp/dist.tar.gz was treated as a
  directory by scp-action, breaking the deploy tar extract
- drop forgejo-release@v1 (unreachable from runner); upload asset
  via the Gitea release assets API using curl
- replace ssh-action "cp" with scp CLI: the cp ran on the remote
  server, leaving the runner without a local file
- chain deploy on upload-release-asset: its cleanup rm must not
  race with the artifact download
- clean up stale /tmp/dist.tar.gz on the server before each build
2026-06-16 11:22:56 +08:00
zihluwang 7343f68a4e ci: use scp/ssh instead of upload-artifact for Gitea Actions compatibility
GitHub's actions/upload-artifact is not supported on Gitea Actions.
Replaced with appleboy/scp-action to upload artifact to deploy server,
then download via appleboy/ssh-action in subsequent jobs.
2026-06-16 01:34:58 +08:00
zihluwang bb08f1e4b6 Merge pull request 'v1.4.0' (#2) from release/v1.4.0 into main
Reviewed-on: https://git.onixbyte.com/onixbyte/delta-force-guide-server/pulls/2
1.4.0
2026-06-16 01:18:50 +08:00
siujamo 782974f96d ci: use node 24 in build workflow 2026-06-15 17:02:14 +08:00
siujamo 3d692ece7a Merge branch 'develop' of git.onixbyte.com:onixbyte/delta-force-guide-web into develop 2026-06-15 16:45:28 +08:00
siujamo 4dad97fcbf fix: trigger release workflow on published event
In Gitea Actions, the release event fires 'published' when a release is created via the UI, not 'created' (which only fires for drafts). Using 'created' meant the workflow never ran.
2026-06-15 16:41:56 +08:00
兴垚 范 dde712476d Merge branch 'develop' of git.onixbyte.com:onixbyte/delta-force-guide-web into develop 2026-06-15 16:24:37 +08:00
siujamo b5afa8e9f3 ci: migrate release workflow from GitHub Actions to Gitea Actions
- Move release workflow from .github/workflows/build.yml to
  .gitea/workflows/build.yml
- Replace softprops/action-gh-release with forgejo-release@v1, which
  uses the Gitea-auto-injected GITEA_TOKEN
- Add SCP upload to onixbyte.cn followed by SSH extract/chown to deploy
  the built site to /var/httpd/dfguide (caddy:caddy)
- Split into three jobs (build, upload-release-asset, deploy-to-server)
  so the release upload and server deploy run in parallel after build
- Drop .github/ entirely (Dependabot config included) since the project
  no longer uses GitHub
2026-06-15 09:28:04 +08:00
siujamo 2b099a6b2c fix: use update-container-description-action instead of raw docker-pushrm
The raw docker run with docker-pushrm keeps failing due to WORKDIR /
mount path mismatches. Replace with the official GitHub Action wrapper
from the same author, which handles the internals correctly.
1.4.0-beta.4
2026-06-08 14:56:54 +08:00
siujamo 0269683b68 fix: mount README.md to / not /data for docker-pushrm
The docker-pushrm image (busybox-based) has no WORKDIR set, defaulting
to /. FindReadmeFile() searches ./ relative to WORKDIR, so the file
must be at /README.md, not /data/ or /workspace/.
1.4.0-beta.3
2026-06-08 14:46:19 +08:00
siujamo 3f2066f8b2 fix: update docker-pushrm README mount path from /workspace to /data
docker-pushrm v2 changed the WORKDIR from /workspace to /data, causing the
README push step to fail when using the :latest tag.
1.4.0-beta.2
2026-06-08 14:14:05 +08:00
siujamo a2469c7573 docs: update application configuration example 1.4.0-beta.1 2026-06-08 13:32:16 +08:00
siujamo 62fcce3005 feat: add OCI labels and README push for Docker Hub
Add OCI standard labels to Dockerfile.ci and push README.md to
Docker Hub image page via docker-pushrm in CI workflow.
2026-06-05 10:20:15 +08:00
siujamo c18a108a2b ci: fix build error 1.4.0-dev.4 2026-06-05 09:40:12 +08:00
siujamo fb2732508a ci: fix build error 1.4.0-dev.3 2026-06-05 09:30:28 +08:00