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
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: build

on:
push:
branches:
- "main"
paths-ignore:
- "*.js"
- "*.md"
pull_request:
branches:
- "main"
paths-ignore:
- "*.js"
- "*.md"

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: ci_build
path: |
dist/*.tar.gz
dist/*.zip
dist/*.txt
44 changes: 0 additions & 44 deletions .github/workflows/build_docker.yml

This file was deleted.

38 changes: 23 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
name: release
name: goreleaser

on:
push:
tags:
- '*'
- "v*"

permissions:
contents: write
packages: write

jobs:
goreleaser:
release:
name: Release
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
go-version: 1.17
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
go-version: stable
- uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --rm-dist
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 0 additions & 42 deletions .github/workflows/release_docker.yml

This file was deleted.

30 changes: 26 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
openlist-proxy

# Test binary, build with `go test -c`
# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
# Code coverage profiles and other test artifacts
*.out
.idea
alist-proxy
coverage.*
*.coverprofile
profile.cov

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
go.work.sum

# env file
.env

# Editor/IDE
.idea/
.vscode/

# Added by goreleaser init:
dist/
87 changes: 87 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

project_name: openlist-proxy

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
- freebsd
goarch:
- "386"
- amd64
- arm
- arm64
- loong64
- mips
- mips64
- mips64le
- mipsle
- ppc64
- ppc64le
- riscv64
- s390x
goarm:
- "6"
- "7"
ldflags:
- -s -w
- -X main.version={{ .Version }}
flags:
- -trimpath

archives:
- formats: [tar.gz]
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
formats: [zip]

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

kos:
- base_image: alpine
repositories:
- "ghcr.io/openlistteam/openlist-proxy"
tags:
- "{{.Version}}"
- "{{ if .IsSnapshot }}{{ .ShortCommit }}{{ else }}latest{{ end }}"
sbom: none
bare: true
preserve_import_paths: false
platforms:
- linux/amd64
- linux/386
- linux/arm64
- linux/arm/v7
- linux/arm/v6
- linux/s390x
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM alpine:edge as builder
FROM golang:alpine as builder
LABEL stage=go-builder
WORKDIR /app/
COPY ./ ./
RUN apk add --no-cache bash curl gcc git go musl-dev; \
go build -o /app/bin/alist-proxy -ldflags="-w -s" .
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
RUN go build -v -o /app/bin/openlist-proxy -ldflags="-w -s" .

FROM alpine:edge
LABEL MAINTAINER="i@nn.ci"
FROM alpine:3
LABEL MAINTAINER="OpenList"
WORKDIR /app/
COPY --from=builder /app/bin/alist-proxy ./
COPY --from=builder /app/bin/openlist-proxy ./
EXPOSE 5243
CMD [ "./alist-proxy" ]
CMD [ "./openlist-proxy" ]
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
# alist-proxy
# OpenList-Proxy

- [x] cloudflare workers
- [x] golang
Use another machine to proxy OpenList's traffic.

- [x] Cloudflare Workers
- [x] Golang

## Usage

```shell
Usage of OpenList-Proxy:
-address string
openlist address
-cert string
cert file (default "server.crt")
-help
show help
-https
use https protocol.
-key string
key file (default "server.key")
-port int
the proxy port. (default 5243)
-token string
openlist token
-version
show version and exit
```
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/Xhofe/alist-proxy
module github.com/OpenListTeam/OpenList-Proxy

go 1.19
go 1.24.4

require github.com/alist-org/alist/v3 v3.0.0-beta.0 // indirect
require github.com/OpenListTeam/OpenList/v4 v4.0.7
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/alist-org/alist/v3 v3.0.0-beta.0 h1:tTosXvDttekbbkORzVMCzpw6xa6TaclzLEZ0mzzu8qw=
github.com/alist-org/alist/v3 v3.0.0-beta.0/go.mod h1:1TfFPURtBFLrW6mOV28P/4gdbSiAT1f3dp2bGR4o/cM=
github.com/OpenListTeam/OpenList/v4 v4.0.7 h1:/QtuO8VmwlBxNXraPa+hfqPN3F589pSN9hugQHywgNk=
github.com/OpenListTeam/OpenList/v4 v4.0.7/go.mod h1:9tzs5NAkgYbYIb0TmuBfas/yLcukJDq3CjTZo2BGy2M=
Loading