Skip to content

feat(profile): add avatar upload flow - #9

Merged
c1trua merged 3 commits into
developfrom
feature/avatar-upload
Apr 29, 2026
Merged

feat(profile): add avatar upload flow#9
c1trua merged 3 commits into
developfrom
feature/avatar-upload

Conversation

@c1trua

@c1trua c1trua commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Background

Users need a direct-upload flow for replacing their profile avatar, aligned with the existing OSS-backed publish upload design.

Main Changes

  • Added avatar upload session APIs under /v1/me/avatar-upload-sessions.
  • Added single-image OSS presign support for avatar uploads.
  • Added avatar completion logic with OSS object, size, ETag, and dimension validation.
  • Updated user_profiles.current_avatar_asset_id after successful completion.
  • Reused existing square_small image style for returned avatar URLs.
  • Made completed avatar upload sessions safe to retry.

Impact

  • Adds new authenticated profile avatar upload endpoints.
  • Updates profile avatar state through user_profiles.current_avatar_asset_id.
  • Does not delete old avatar assets or OSS objects.
  • No breaking changes to existing publish upload APIs.

Verification

  • go test ./internal/modules/profile/... ./tests/integration ./internal/app/api ./internal/transport/http/v1 passed.

@c1trua
c1trua merged commit 981c240 into develop Apr 29, 2026
1 check passed
@c1trua
c1trua deleted the feature/avatar-upload branch April 29, 2026 15:53
c1trua added a commit that referenced this pull request Jun 17, 2026
* docs(contributing): update CONTRIBUTING.md

* feat(cicd): add github actions workflow

* fix(workflow): update golanglint version

* fix(workflow): update golanglint version

* fix(lint): linter passed

* feat(oss): support cross-account assume role credentials

* ci(deploy): add manual test ECS deployment

* ci(deploy): add manual test ECS deployment (#4)

* fix(openapi): add rate_limited to error code enum (#7)

* fix(deploy): deploy test ECS by uploading images over SSH (#8)

* fix(deploy): upload images to ECS instead of pulling from Docker Hub

* fix(deploy): allow container to read test config

* fix(deploy): verify api health after test deployment

* fix(deploy): verify api stability after test deployment

* fix(deploy): clean stale compose state before test deployment

* fix(deploy): log api deployment status explicitly

* fix(deploy): prevent migrate step from consuming ssh input

* ci(deploy): auto deploy test ECS on develop push

* ci(ops): add test ECS ops workflow

* ci(ops): add test ops workflow and reduce healthcheck noise

* ci(ops): add OSS presign diagnostics

* feat(profile): add avatar upload flow (#9)

* feat: add avatar upload flow

* fix(profile): stabilize avatar upload integration tests

* feat: add https support

* fmt: reformat

* fix: autocert gateway permission error

* fix: autocert error

* fix: autocert error

* fix(gateway): fallback SNI for autocert

* Revert "Merge pull request #14 from Muxi-X/fix/gateway-sni-fallback"

This reverts commit 74bd0e0, reversing
changes made to 52e2f0d.

* Revert "Merge pull request #13 from Muxi-X/feat/https"

This reverts commit 52e2f0d, reversing
changes made to 0faebb0.

* Revert "Merge pull request #12 from Muxi-X/feat/https"

This reverts commit 0faebb0, reversing
changes made to ad6bc82.

* Revert "Merge pull request #11 from Muxi-X/feat/https"

This reverts commit ad6bc82, reversing
changes made to 7770d94.

* Revert "Merge pull request #10 from Muxi-X/feat/https"

This reverts commit 7770d94, reversing
changes made to 981c240.

* build(deploy): add nginx + certbot for https

Expose API via Nginx on 80/443 with automatic Let's Encrypt issuance/renewal while keeping a localhost debug port.

* chore: update test domain

* refactor: remove nginx config (#17)

* refactor: remove nginx config

* chore(ci): disable auto-deploy on push to develop during PR merge

* feat: add custom keyword upload endpoints (#18)

* feat(oss): migrate from Alibaba Cloud OSS to Qiniu Kodo (#19)

* feat(oss): migrate from Alibaba Cloud OSS to Qiniu Kodo

* perf(deploy): skip unchanged dependency images in test deploy

* ci(deploy-test): switch from SCP zip transfer to Alibaba Cloud ACR

- Push cixing-api image + 5 base images to ACR (Hangzhou registry)
- ECS pulls images from ACR via docker compose pull instead of gzip load
- Remove docker save/gzip/scp image transfer steps
- Remove /opt/cixing/images/ tarball cleanup
- Update docker-compose.prod.yml to reference ACR image paths
- Add ACR_USERNAME / ACR_PASSWORD to required secrets validation

* ci(deploy-test): fix docker login host error

* ci(deploy-test): push cixing-api image to Alibaba Cloud ACR

- Push image to registry.cn-hangzhou.aliyuncs.com/muxi/memento:<sha>
- Remove docker save/gzip/scp image transfer steps
- ECS pulls cixing-api from ACR, base images from Docker Hub
- Add ACR_USERNAME / ACR_PASSWORD to required secrets validation
- Note: CONFIG must also fix postgres DSN from 127.0.0.1 to postgres

* fix(deploy-test): pass ACR credentials via SSH environment

* ci(deploy-test): pull only cixing-api from ACR

* fix(oss): remove duplicate https:// prefix in qiniu upload host

* fix(oss): remove null

* fix(oss): use SrcUpHosts (upload domain) instead of GetIoHost (IO domain) for presign upload URL

* fix(oss): presign returns FormData token field instead of Authorization header for Qiniu Kodo

- storage.go: PresignPut uses FormFields { token: upToken } instead of Authorization header
- object_storage.go: PresignResult gains FormFields map
- OpenAPI spec: UploadPresignedTarget gains form_fields field, method enum adds POST
- Handlers: map FormFields through to API response
- Qiniu form upload requires multipart/form-data with token in the form body

* fix(ci): remove duplicate Configure SSH block and nginx references

* fix(oss): gofmt client.go struct field alignment

* chore(test): remove tests that reference removed OSS config fields

* fix(oss): remove unused functions and fix errcheck lint warning

* fix: remove unused functions, fix integration test for Qiniu URL style

* fix(ci): resolve lint errors and integration test failures after Qiniu migration

* fix(ci): remove dead Mirror step that references undefined ACR_REGISTRY (#20)

* ci(deploy): add prod deploy workflow, parameterize compose config (#21)

* docs: update README for v0.1.0 release
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