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
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ Environment variables can override sensitive values:
- `PORT` - OAuth server port
- `CLIENT_SECRET_ANILIST` - AniList client secret
- `CLIENT_SECRET_MYANIMELIST` - MyAnimeList client secret
- `TOKEN_FILE_PATH` - Token file path for persistent authentication

## Key Dependencies

Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -ldflags="-w -s"
FROM alpine:3.19

RUN apk --no-cache add ca-certificates tzdata && \
mkdir -p /etc/anilist-mal-sync
mkdir -p /etc/anilist-mal-sync && \
adduser -D -u 10001 appuser && \
mkdir -p /home/appuser/.config/anilist-mal-sync && \
chown -R appuser:appuser /home/appuser

WORKDIR /app
COPY --from=builder /build/main ./main
COPY --from=builder /etc/passwd /etc/passwd

USER appuser

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ Override sensitive values:
- `PORT` - OAuth server port (default: 18080)
- `CLIENT_SECRET_ANILIST` - AniList client secret
- `CLIENT_SECRET_MYANIMELIST` - MyAnimeList client secret
- `TOKEN_FILE_PATH` - Token file path (default: `~/.config/anilist-mal-sync/token.json`)

## Advanced

Expand Down
4 changes: 4 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ func loadConfigFromFile(filename string) (Config, error) {
cfg.MyAnimeList.ClientSecret = clientSecret
}

if tokenFilePath := os.Getenv("TOKEN_FILE_PATH"); tokenFilePath != "" {
cfg.TokenFilePath = tokenFilePath
}

if cfg.TokenFilePath == "" {
cfg.TokenFilePath = os.ExpandEnv("$HOME/.config/anilist-mal-sync/token.json")
}
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3"
services:
sync:
image: ghcr.io/bigspawn/anilist-mal-sync:latest
command: ["watch"]
volumes:
- ./config.yaml:/etc/anilist-mal-sync/config.yaml:ro
- ./tokens:/home/appuser/.config/anilist-mal-sync
restart: unless-stopped
Loading