Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ uploads
bin

# Other files
todo.md
todo.md
build-docker.sh
18 changes: 14 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
FROM golang:1.24 AS builder
FROM golang:1.26 AS builder

WORKDIR /app

COPY go.mod go.sum ./
# No additional dependencies, no go.sum
# COPY go.mod go.sum ./
COPY go.mod ./
RUN go mod download

COPY . .
COPY static/ ./static/
COPY templates/ ./templates/
COPY *.go ./

RUN CGO_ENABLED=0 GOOS=linux go build -o curier .

FROM scratch

WORKDIR /

ENV CURIER_HOST="0.0.0.0"
ENV CURIER_PORT="39800"
ENV CURIER_STORAGE_PATH="/uploads/"

COPY --from=builder /app/curier /curier

EXPOSE 8080
EXPOSE 39800

ENTRYPOINT ["/curier"]
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A small Go server for sharing files across the internet.
You can download the Dockerfile and build the image yourself, or simply pull it from the repo:
```bash
docker pull ghcr.io/adipeterca/curier:latest
docker run -p 8080:8080 ghcr.io/adipeterca/curier:latest
docker run -p 39800:39800 ghcr.io/adipeterca/curier:latest
```

### Linux environment
Expand All @@ -26,6 +26,9 @@ You can download a precompiled binary from the [Release](https://github.com/adip
## Configuration

You can configure some aspects of the service via environment variables prefixed with **CURIER_**.

_If you're using Docker, either use a `.env` file or the `-e` argument from the `docker run` command._

Some information will be exposed via the `/config/` endpoint for better UX.
For default values, check [config.go](https://github.com/adipeterca/curier/blob/main/config.go).

Expand Down
10 changes: 5 additions & 5 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ var templateFiles embed.FS
// -- Private variables ---

// Where to save the uploaded files
var storagePath = "/var/lib/curier/uploads/"
var storagePath = "uploads/"

// URL base path that will prefix all download links
var urlBasePath = "http://localhost"

// Network address to bind to - default 127.0.0.1
var host = "127.0.0.1"
// Network address to bind to - default 0.0.0.0
var host = "0.0.0.0"

// Port to listen on - default 8080
var port = "8080"
// Port to listen on - default 39800
var port = "39800"

// --- Public variables ---
//
Expand Down