Skip to content

refactor: clean repository, split profiles, add Flyway and harden upload flowFeat/security flyway upload tests#1

Merged
YIMO691 merged 12 commits into
mainfrom
feat/security-flyway-upload-tests
Apr 9, 2026
Merged

refactor: clean repository, split profiles, add Flyway and harden upload flowFeat/security flyway upload tests#1
YIMO691 merged 12 commits into
mainfrom
feat/security-flyway-upload-tests

Conversation

@YIMO691

@YIMO691 YIMO691 commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Summary

This PR completes a repository cleanup and engineering hardening pass for the blog system.

What changed

  • cleaned repository structure

    • removed IDE/workspace artifacts from version control
    • removed runtime upload files from Git, kept uploads/.gitkeep
    • narrowed .gitignore rules to avoid blocking future SQL migrations
  • split configuration by environment

    • application.yml now contains shared settings only
    • application-dev.yml for local development
    • application-prod.yml for environment-variable-based production config
  • introduced Flyway

    • enabled migration-based schema management
    • aligned JPA usage with validation-oriented startup
  • hardened upload flow

    • moved upload logic into UploadService
    • added file size, extension and MIME validation
    • normalized file paths and isolated runtime upload directory
    • returned proper image content types
  • tightened admin authorization

    • restricted editor, upload and delete endpoints to admin
    • added controller-side admin guard for delete operation
  • improved testability and CI

    • added H2-backed test profile for CI
    • isolated tests from local MySQL
    • updated workflow to run tests and package build with test profile
  • synchronized documentation

    • README now matches profiles, Flyway, upload service and startup flow

Validation

  • local mvn test passed
  • local mvn -DskipTests package passed
  • CI workflow runs with SPRING_PROFILES_ACTIVE=test

Notes

  • image access remains public at /articles/image/**
  • development still uses local settings from application-dev.yml

@YIMO691

YIMO691 commented Apr 9, 2026

Copy link
Copy Markdown
Owner Author

refactor: clean repo, split profiles, add Flyway, and harden upload flow

@YIMO691 YIMO691 merged commit de8789e into main Apr 9, 2026
2 checks passed
@YIMO691 YIMO691 deleted the feat/security-flyway-upload-tests branch April 9, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant