kevinanielsen/go-fast-cdn
소개
A fast and easy-to-use CDN, built with Go.
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -2
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalGo-Fast CDN
"The PocketBase of CDNs" - Me
A fast and easy-to-use CDN, built with Go.
Utilizing an SQLite database with GORM and the Gin web framework. UI built with Vite + React and wouter.
How to use
See our documentation at kevinanielsen.github.io/go-fast-cdn/
Community
Join the discord to talk to fellow users and contributors!
Development
Clone the Repository
git clone [email protected]:kevinanielsen/go-fast-cdn
or git clone https://github.com/kevinanielsen/go-fast-cdn
Add env variables
This project uses dotenv and I recommend that you do the same.
Read more about the usage on their page.
If you do not wish to use this, you can just rename .example.env to .env and fill in the fields.
Building the binary
- Run
make prep - Run
make clean - Run
make test - Run
make build
Your binary should now be tested, built, and you can run it with bin/go-fast-cdn-linux or bin/go-fast-cdn-windows or bin/go-fast-cdn-darwin
Quick start with Docker
git clone [email protected]:kevinanielsen/go-fast-cdn
or git clone https://github.com/kevinanielsen/go-fast-cdn
docker-compose up -d
Docker Hub
The easiest way to get started without cloning the repo is to pull the image directly from Docker Hub:
docker pull kevinanielsen/go-fast-cdn
Or pin to a specific version:
docker pull kevinanielsen/go-fast-cdn:0.1.6
Run it with persistent storage:
docker run -d \
-p 8080:8080 \
-v go_fast_db:/app/db_data \
-v go_fast_uploads:/app/uploads \
kevinanielsen/go-fast-cdn
Subdomain Separation (Optional)
For production deployments, you can separate admin UI from public CDN serving using subdomains.
Nginx: See nginx/example.conf for a basic configuration.
Nginx Proxy Manager:
- Create proxy host for
admin.cdn.example.com→http://your-cdn:8080(full access) - Create proxy host for
cdn.example.com→http://your-cdn:8080 - Edit the
cdn.example.comproxy host → Custom Locations tab → Add:- Location:
/api/cdn/download/images/→ Forward tohttp://your-cdn:8080 - Location:
/api/cdn/download/docs/→ Forward tohttp://your-cdn:8080
- Location:
- Click the gear icon ⚙️ (top-right) → In Custom Nginx Configuration, add:
location / { return 403; } - Save. This blocks admin UI access on
cdn.example.com
Releasing
This project uses goreleaser-cross v1.27.0 to support CGO cross-compilation, which is required for WEBP image processing across all platforms.
Note: We use v1.27.0 which provides stable cross-compilation support with updated repositories. Earlier versions (v1.21.5) had outdated Ubuntu repositories that caused package installation failures.
Prerequisites for Releases
- Docker installed and running
- GitHub token with appropriate permissions
- Push access to the repository
Release Commands
# Test the release configuration
make test-release
# Dry run (test without publishing)
make release-dry-run
# Create and publish a release (requires GITHUB_TOKEN)
export GITHUB_TOKEN=your_github_token
make release
Why goreleaser-cross?
This project requires CGO for WEBP support via:
github.com/chai2010/webp(WEBP encoding)golang.org/x/image/webp(WEBP decoding)
Standard Go cross-compilation with CGO_ENABLED=0 would disable WEBP functionality. goreleaser-cross provides the necessary cross-compilation toolchains to build CGO-enabled binaries for all supported platforms while maintaining WEBP support.
Supported Release Platforms
- Linux: amd64, arm64, armv7
- macOS: amd64 (Intel), arm64 (M1/M2) - Universal binary
- Windows: amd64
All platforms include full WEBP support through CGO compilation using goreleaser-cross v1.27.0.
Package Formats
In addition to binary archives, Linux platforms also provide:
- Debian: .deb packages
- RedHat: .rpm packages
- Alpine: .apk packages
관련 프로젝트 살펴보기
불러오는 중…