How dominic-kk/halo-plugin-picbed works
Picbed is a Halo attachment-storage plugin that stores uploaded files in GitHub and serves public links through a configurable custom domain. Its main workflow is Halo policy configuration → attachment upload → generated repository object key → GitHub API write → Halo attachment metadata; deletion uses the upload-time repository, branch, and object key. The excerpts show the handler’s GitHub operations and filename generation, while README documents configuration, Secret-backed tokens, size limits, and Cloudflare-compatible links. Handler details are partial, so uncertain internal call wiring is omitted.
Main entry points: GitHubAttachmentHandler.java Attachment handler · setting-picbed.yaml Storage policy · PolicyConfigWatcher.java Policy watcher · PicbedPlugin.java Plugin lifecycle
Components 11
Policy and lifecycle
- Plugin lifecycle
src/main/java/top/dominickk/picbed/PicbedPlugin.java - Policy watcher
src/main/java/top/dominickk/picbed/PolicyConfigWatcher.java - Storage policy
src/main/resources/extensions/setting-picbed.yaml
Attachment workflow
- Attachment handler
src/main/java/top/dominickk/picbed/provider/GitHubAttachmentHandler.java - Object-key generator
src/main/java/top/dominickk/picbed/tools/FileNameGenerator.java - Halo attachment
src/main/java/top/dominickk/picbed/provider/GitHubAttachmentHandler.java
GitHub storage
- Halo token Secret
src/main/java/top/dominickk/picbed/provider/GitHubAttachmentHandler.java - GitHub REST API
- GitHub repository
- Custom public domain
Other components
- Halo administrator
Connections 11
- Plugin lifecycle → Policy watcher: disposes
- Halo administrator → Storage policy: configures
- Policy watcher → Storage policy: watches changes
- Halo administrator → Attachment handler: uploads or deletes
- Attachment handler → Storage policy: reads settings
- Attachment handler → Object-key generator: generates object key
- Attachment handler → Halo token Secret: reads token
- Attachment handler → GitHub REST API: sends upload/delete requests
- GitHub REST API → GitHub repository: writes or deletes files
- Attachment handler → Halo attachment: creates metadata
- Halo attachment → Custom public domain: builds public link