``` ├── .air.toml ├── .github/ ├── FUNDING.yml ├── ISSUE_TEMPLATE/ ├── bug_report.yml ├── config.yml ├── feature_request.yml ├── config.yml ├── stale.yml ├── workflows/ ├── auto_lang.yml ├── beta_release.yml ├── build.yml ├── changelog.yml ├── issue_close_question.yml ├── issue_close_stale.yml ├── issue_duplicate.yml ├── issue_invalid.yml ├── issue_on_close.yml ├── issue_question.yml ├── issue_similarity.yml ├── issue_translate.yml ├── issue_wontfix.yml ├── release.yml ├── release_android.yml ├── release_docker.yml ├── release_freebsd.yml ├── release_linux_musl.yml ├── release_linux_musl_arm.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── Dockerfile.ci ├── LICENSE ├── README.md ├── README_cn.md ├── README_ja.md ├── build.sh ├── cmd/ ├── admin.go ├── cancel2FA.go ├── common.go ├── flags/ ├── config.go ├── kill.go ├── lang.go ├── restart.go ├── root.go ├── server.go ├── start.go ├── stop_default.go ├── stop_windows.go ├── storage.go ├── user.go ├── version.go ├── docker-compose.yml ├── drivers/ ├── 115/ ├── appver.go ├── driver.go ├── meta.go ├── types.go ├── util.go ├── 115_open/ ├── driver.go ├── meta.go ├── types.go ├── upload.go ├── util.go ├── 115_share/ ├── driver.go ├── meta.go ├── utils.go ├── 123/ ├── driver.go ├── meta.go ├── types.go ├── upload.go ├── util.go ├── 123_link/ ├── driver.go ├── meta.go ├── parse.go ├── types.go ├── util.go ├── 123_share/ ├── driver.go ├── meta.go ├── types.go ├── util.go ├── 139/ ├── driver.go ``` ## /.air.toml ```toml path="/.air.toml" root = "." testdata_dir = "testdata" tmp_dir = "tmp" [build] args_bin = ["server"] bin = "./tmp/main" cmd = "go build -o ./tmp/main ." delay = 0 exclude_dir = ["assets", "tmp", "vendor", "testdata"] exclude_file = [] exclude_regex = ["_test.go"] exclude_unchanged = false follow_symlink = false full_bin = "" include_dir = [] include_ext = ["go", "tpl", "tmpl", "html"] include_file = [] kill_delay = "0s" log = "build-errors.log" poll = false poll_interval = 0 rerun = false rerun_delay = 500 send_interrupt = false stop_on_error = false [color] app = "" build = "yellow" main = "magenta" runner = "green" watcher = "cyan" [log] main_only = false time = false [misc] clean_on_exit = false [screen] clear_on_rebuild = false keep_scroll = true ``` ## /.github/FUNDING.yml ```yml path="/.github/FUNDING.yml" # These are supported funding model platforms github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: xhofe # Replace with a single Ko-fi username tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry custom: ['https://alist.nn.ci/guide/sponsor.html'] ``` ## /.github/ISSUE_TEMPLATE/bug_report.yml ```yml path="/.github/ISSUE_TEMPLATE/bug_report.yml" name: "Bug report" description: Bug report labels: [bug] body: - type: markdown attributes: value: | Thanks for taking the time to fill out this bug report, please **confirm that your issue is not a duplicate issue and not because of your operation or version issues** 感谢您花时间填写此错误报告,请**务必确认您的issue不是重复的且不是因为您的操作或版本问题** - type: checkboxes attributes: label: Please make sure of the following things description: | You must check all the following, otherwise your issue may be closed directly. Or you can go to the [discussions](https://github.com/alist-org/alist/discussions) 您必须勾选以下所有内容,否则您的issue可能会被直接关闭。或者您可以去[讨论区](https://github.com/alist-org/alist/discussions) options: - label: | I have read the [documentation](https://alist.nn.ci). 我已经阅读了[文档](https://alist.nn.ci)。 - label: | I'm sure there are no duplicate issues or discussions. 我确定没有重复的issue或讨论。 - label: | I'm sure it's due to `AList` and not something else(such as [Network](https://alist.nn.ci/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host) ,`Dependencies` or `Operational`). 我确定是`AList`的问题,而不是其他原因(例如[网络](https://alist.nn.ci/zh/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host),`依赖`或`操作`)。 - label: | I'm sure this issue is not fixed in the latest version. 我确定这个问题在最新版本中没有被修复。 - type: input id: version attributes: label: AList Version / AList 版本 description: | What version of our software are you running? Do not use `latest` or `master` as an answer. 您使用的是哪个版本的软件?请不要使用`latest`或`master`作为答案。 placeholder: v3.xx.xx validations: required: true - type: input id: driver attributes: label: Driver used / 使用的存储驱动 description: | What storage driver are you using? 您使用的是哪个存储驱动? placeholder: "for example: Onedrive" validations: required: true - type: textarea id: bug-description attributes: label: Describe the bug / 问题描述 validations: required: true - type: textarea id: reproduction attributes: label: Reproduction / 复现链接 description: | Please provide a link to a repo that can reproduce the problem you ran into. Please be aware that your issue may be closed directly if you don't provide it. 请提供能复现此问题的链接,请知悉如果不提供它你的issue可能会被直接关闭。 validations: required: true - type: textarea id: config attributes: label: Config / 配置 description: | Please provide the configuration file of your `AList` application and take a screenshot of the relevant storage configuration. (hide privacy field) 请提供您的`AList`应用的配置文件,并截图相关存储配置。(隐藏隐私字段) validations: required: true - type: textarea id: logs attributes: label: Logs / 日志 description: | Please copy and paste any relevant log output. 请复制粘贴错误日志,或者截图 ``` ## /.github/ISSUE_TEMPLATE/config.yml ```yml path="/.github/ISSUE_TEMPLATE/config.yml" blank_issues_enabled: false contact_links: - name: Questions & Discussions url: https://github.com/alist-org/alist/discussions about: Use GitHub discussions for message-board style questions and discussions. ``` ## /.github/ISSUE_TEMPLATE/feature_request.yml ```yml path="/.github/ISSUE_TEMPLATE/feature_request.yml" name: "Feature request" description: Feature request labels: [enhancement] body: - type: checkboxes attributes: label: Please make sure of the following things description: You may select more than one, even select all. options: - label: I have read the [documentation](https://alist.nn.ci). - label: I'm sure there are no duplicate issues or discussions. - label: I'm sure this feature is not implemented. - label: I'm sure it's a reasonable and popular requirement. - type: textarea id: feature-description attributes: label: Description of the feature / 需求描述 validations: required: true - type: textarea id: suggested-solution attributes: label: Suggested solution / 实现思路 description: | Solutions to achieve this requirement. 实现此需求的解决思路。 - type: textarea id: additional-context attributes: label: Additional context / 附件 description: | Any other context or screenshots about the feature request here, or information you find helpful. 相关的任何其他上下文或截图,或者你觉得有帮助的信息 ``` ## /.github/config.yml ```yml path="/.github/config.yml" # Configuration for welcome - https://github.com/behaviorbot/welcome # Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome # Comment to be posted to on first time issues newIssueWelcomeComment: > Thanks for opening your first issue here! Be sure to follow the issue template! # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome # Comment to be posted to on PRs from first time contributors in your repository newPRWelcomeComment: > Thanks for opening this pull request! Please check out our contributing guidelines. # Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge # Comment to be posted to on pull requests merged by a first time user firstPRMergeComment: > Congrats on merging your first pull request! We here at behavior bot are proud of you! # It is recommend to include as many gifs and emojis as possible ``` ## /.github/stale.yml ```yml path="/.github/stale.yml" # Number of days of inactivity before an issue becomes stale daysUntilStale: 44 # Number of days of inactivity before a stale issue is closed daysUntilClose: 20 # Issues with these labels will never be considered stale exemptLabels: - accepted - security - working - pr-welcome # Label to use when marking an issue as stale staleLabel: stale # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. # Comment to post when closing a stale issue. Set to `false` to disable closeComment: > This issue was closed due to inactive more than 52 days. You can reopen or recreate it if you think it should continue. Thank you for your contributions again. ``` ## /.github/workflows/auto_lang.yml ```yml path="/.github/workflows/auto_lang.yml" name: auto_lang on: push: branches: - 'main' paths: - 'drivers/**' - 'internal/bootstrap/data/setting.go' - 'internal/conf/const.go' - 'cmd/lang.go' workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: auto_lang: strategy: matrix: platform: [ ubuntu-latest ] go-version: [ '1.21' ] name: auto generate lang.json runs-on: ${{ matrix.platform }} steps: - name: Setup go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Checkout alist uses: actions/checkout@v4 with: path: alist - name: Checkout alist-web uses: actions/checkout@v4 with: repository: 'alist-org/alist-web' ref: main persist-credentials: false fetch-depth: 0 path: alist-web - name: Generate lang run: | cd alist go run ./main.go lang cd .. - name: Copy lang file run: | cp -f ./alist/lang/*.json ./alist-web/src/lang/en/ 2>/dev/null || : - name: Commit git run: | cd alist-web git add . git config --local user.email "bot@nn.ci" git config --local user.name "IlaBot" git commit -m "chore: auto update i18n file" -a 2>/dev/null || : cd .. - name: Push lang files uses: ad-m/github-push-action@master with: github_token: ${{ secrets.MY_TOKEN }} branch: main directory: alist-web repository: alist-org/alist-web ``` ## /.github/workflows/beta_release.yml ```yml path="/.github/workflows/beta_release.yml" name: beta release on: push: branches: [ 'main' ] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true permissions: contents: write jobs: changelog: strategy: matrix: platform: [ ubuntu-latest ] go-version: [ '1.21' ] name: Beta Release Changelog runs-on: ${{ matrix.platform }} steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Create or update ref id: create-or-update-ref uses: ovsds/create-or-update-ref-action@v1 with: ref: tags/beta sha: ${{ github.sha }} - name: Delete beta tag run: git tag -d beta continue-on-error: true - name: changelog # or changelogithub@0.12 if ensure the stable result id: changelog run: | git tag -l npx changelogithub --output CHANGELOG.md # npx changelogen@latest --output CHANGELOG.md - name: Upload assets uses: softprops/action-gh-release@v2 with: body_path: CHANGELOG.md files: CHANGELOG.md prerelease: true tag_name: beta release: needs: - changelog strategy: matrix: include: - target: '!(*musl*|*windows-arm64*|*android*|*freebsd*)' # xgo hash: "md5" - target: 'linux-!(arm*)-musl*' #musl-not-arm hash: "md5-linux-musl" - target: 'linux-arm*-musl*' #musl-arm hash: "md5-linux-musl-arm" - target: 'windows-arm64' #win-arm64 hash: "md5-windows-arm64" - target: 'android-*' #android hash: "md5-android" - target: 'freebsd-*' #freebsd hash: "md5-freebsd" name: Beta Release runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Go uses: actions/setup-go@v5 with: go-version: '1.22' - name: Setup web run: bash build.sh dev web - name: Build uses: go-cross/cgo-actions@v1 with: targets: ${{ matrix.target }} musl-target-format: $os-$musl-$arch out-dir: build x-flags: | github.com/alist-org/alist/v3/internal/conf.BuiltAt=$built_at github.com/alist-org/alist/v3/internal/conf.GitAuthor=Xhofe github.com/alist-org/alist/v3/internal/conf.GitCommit=$git_commit github.com/alist-org/alist/v3/internal/conf.Version=$tag github.com/alist-org/alist/v3/internal/conf.WebVersion=dev - name: Compress run: | bash build.sh zip ${{ matrix.hash }} - name: Upload assets uses: softprops/action-gh-release@v2 with: files: build/compress/* prerelease: true tag_name: beta desktop: needs: - release name: Beta Release Desktop runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v4 with: repository: alist-org/desktop-release ref: main persist-credentials: false fetch-depth: 0 - name: Commit run: | git config --local user.email "bot@nn.ci" git config --local user.name "IlaBot" git commit --allow-empty -m "Trigger build for ${{ github.sha }}" - name: Push commit uses: ad-m/github-push-action@master with: github_token: ${{ secrets.MY_TOKEN }} branch: main repository: alist-org/desktop-release ``` ## /.github/workflows/build.yml ```yml path="/.github/workflows/build.yml" name: build on: push: branches: [ 'main' ] pull_request: branches: [ 'main' ] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: build: strategy: matrix: platform: [ubuntu-latest] target: - darwin-amd64 - darwin-arm64 - windows-amd64 - linux-arm64-musl - linux-amd64-musl - windows-arm64 - android-arm64 name: Build runs-on: ${{ matrix.platform }} steps: - name: Checkout uses: actions/checkout@v4 - uses: benjlevesque/short-sha@v3.0 id: short-sha - name: Setup Go uses: actions/setup-go@v5 with: go-version: '1.22' - name: Setup web run: bash build.sh dev web - name: Build uses: go-cross/cgo-actions@v1 with: targets: ${{ matrix.target }} musl-target-format: $os-$musl-$arch out-dir: build x-flags: | github.com/alist-org/alist/v3/internal/conf.BuiltAt=$built_at github.com/alist-org/alist/v3/internal/conf.GitAuthor=Xhofe github.com/alist-org/alist/v3/internal/conf.GitCommit=$git_commit github.com/alist-org/alist/v3/internal/conf.Version=$tag github.com/alist-org/alist/v3/internal/conf.WebVersion=dev - name: Upload artifact uses: actions/upload-artifact@v4 with: name: alist_${{ env.SHA }}_${{ matrix.target }} path: build/* ``` ## /.github/workflows/changelog.yml ```yml path="/.github/workflows/changelog.yml" name: auto changelog on: push: tags: - 'v*' jobs: changelog: name: Create Release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - name: Delete beta tag run: git tag -d beta continue-on-error: true - run: npx changelogithub # or changelogithub@0.12 if ensure the stable result env: GITHUB_TOKEN: ${{secrets.MY_TOKEN}} ``` ## /.github/workflows/issue_close_question.yml ```yml path="/.github/workflows/issue_close_question.yml" name: Close need info on: schedule: - cron: "0 0 */1 * *" workflow_dispatch: jobs: close-need-info: runs-on: ubuntu-latest steps: - name: close-issues uses: actions-cool/issues-helper@v3 with: actions: 'close-issues' token: ${{ secrets.GITHUB_TOKEN }} labels: 'question' inactive-day: 3 close-reason: 'not_planned' body: | Hello @${{ github.event.issue.user.login }}, this issue was closed due to no activities in 3 days. 你好 @${{ github.event.issue.user.login }},此issue因超过3天未回复被关闭。 ``` ## /.github/workflows/issue_close_stale.yml ```yml path="/.github/workflows/issue_close_stale.yml" name: Close inactive on: schedule: - cron: "0 0 */7 * *" workflow_dispatch: jobs: close-inactive: runs-on: ubuntu-latest steps: - name: close-issues uses: actions-cool/issues-helper@v3 with: actions: 'close-issues' token: ${{ secrets.GITHUB_TOKEN }} labels: 'stale' inactive-day: 8 close-reason: 'not_planned' body: | Hello @${{ github.event.issue.user.login }}, this issue was closed due to inactive more than 52 days. You can reopen or recreate it if you think it should continue. Thank you for your contributions again. ``` ## /.github/workflows/issue_duplicate.yml ```yml path="/.github/workflows/issue_duplicate.yml" name: Issue Duplicate on: issues: types: [labeled] jobs: create-comment: runs-on: ubuntu-latest if: github.event.label.name == 'duplicate' steps: - name: Create comment uses: actions-cool/issues-helper@v3 with: actions: 'create-comment' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}, your issue is a duplicate and will be closed. 你好 @${{ github.event.issue.user.login }},你的issue是重复的,将被关闭。 - name: Close issue uses: actions-cool/issues-helper@v3 with: actions: 'close-issue' token: ${{ secrets.GITHUB_TOKEN }} ``` ## /.github/workflows/issue_invalid.yml ```yml path="/.github/workflows/issue_invalid.yml" name: Issue Invalid on: issues: types: [labeled] jobs: create-comment: runs-on: ubuntu-latest if: github.event.label.name == 'invalid' steps: - name: Create comment uses: actions-cool/issues-helper@v3 with: actions: 'create-comment' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}, your issue is invalid and will be closed. 你好 @${{ github.event.issue.user.login }},你的issue无效,将被关闭。 - name: Close issue uses: actions-cool/issues-helper@v3 with: actions: 'close-issue' token: ${{ secrets.GITHUB_TOKEN }} ``` ## /.github/workflows/issue_on_close.yml ```yml path="/.github/workflows/issue_on_close.yml" name: Remove working label when issue closed on: issues: types: [closed] jobs: rm-working: runs-on: ubuntu-latest steps: - name: Remove working label uses: actions-cool/issues-helper@v3 with: actions: 'remove-labels' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} labels: 'working,pr-welcome' ``` ## /.github/workflows/issue_question.yml ```yml path="/.github/workflows/issue_question.yml" name: Issue Question on: issues: types: [labeled] jobs: create-comment: runs-on: ubuntu-latest if: github.event.label.name == 'question' steps: - name: Create comment uses: actions-cool/issues-helper@v3.6.0 with: actions: 'create-comment' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}, please input issue by template and add detail. Issues labeled by `question` will be closed if no activities in 3 days. 你好 @${{ github.event.issue.user.login }},请按照issue模板填写, 并详细说明问题/日志记录/复现步骤/复现链接/实现思路或提供更多信息等, 3天内未回复issue自动关闭。 ``` ## /.github/workflows/issue_similarity.yml ```yml path="/.github/workflows/issue_similarity.yml" name: Issues Similarity Analysis on: issues: types: [opened, edited] jobs: similarity-analysis: runs-on: ubuntu-latest steps: - name: analysis uses: actions-cool/issues-similarity-analysis@v1 with: filter-threshold: 0.5 comment-title: '### See' comment-body: '${index}. ${similarity} #${number}' show-footer: false show-mentioned: true since-days: 730 ``` ## /.github/workflows/issue_translate.yml ```yml path="/.github/workflows/issue_translate.yml" name: Translation Helper on: pull_request_target: types: [opened] issues: types: [opened] jobs: translate: runs-on: ubuntu-latest steps: - uses: actions-cool/translation-helper@v1.2.0 ``` ## /.github/workflows/issue_wontfix.yml ```yml path="/.github/workflows/issue_wontfix.yml" name: Issue Wontfix on: issues: types: [labeled] jobs: lock-issue: runs-on: ubuntu-latest if: github.event.label.name == 'wontfix' steps: - name: Create comment uses: actions-cool/issues-helper@v3 with: actions: 'create-comment' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}, this issue will not be worked on and will be closed. 你好 @${{ github.event.issue.user.login }},这不会被处理,将被关闭。 - name: Close issue uses: actions-cool/issues-helper@v3 with: actions: 'close-issue' token: ${{ secrets.GITHUB_TOKEN }} ``` ## /.github/workflows/release.yml ```yml path="/.github/workflows/release.yml" name: release on: release: types: [ published ] jobs: release: strategy: matrix: platform: [ ubuntu-latest ] go-version: [ '1.21' ] name: Release runs-on: ${{ matrix.platform }} steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main with: # this might remove tools that are actually needed, # if set to "true" but frees about 6 GB tool-cache: false # all of these default to true, but feel free to set to # "false" if necessary for your workflow android: true dotnet: true haskell: true large-packages: true docker-images: true swap-storage: true - name: Prerelease uses: irongut/EditRelease@v1.2.0 with: token: ${{ secrets.MY_TOKEN }} id: ${{ github.event.release.id }} prerelease: true - name: Setup Go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install dependencies run: | sudo snap install zig --classic --beta docker pull crazymax/xgo:latest go install github.com/crazy-max/xgo@latest sudo apt install upx - name: Build run: | bash build.sh release - name: Upload assets uses: softprops/action-gh-release@v2 with: files: build/compress/* prerelease: false release_desktop: needs: release name: Release desktop runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v4 with: repository: alist-org/desktop-release ref: main persist-credentials: false fetch-depth: 0 - name: Add tag run: | git config --local user.email "bot@nn.ci" git config --local user.name "IlaBot" version=$(wget -qO- -t1 -T2 "https://api.github.com/repos/alist-org/alist/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g') git tag -a $version -m "release $version" - name: Push tags uses: ad-m/github-push-action@master with: github_token: ${{ secrets.MY_TOKEN }} branch: main repository: alist-org/desktop-release ``` ## /.github/workflows/release_android.yml ```yml path="/.github/workflows/release_android.yml" name: release_android on: release: types: [ published ] jobs: release_android: strategy: matrix: platform: [ ubuntu-latest ] go-version: [ '1.21' ] name: Release runs-on: ${{ matrix.platform }} steps: - name: Setup Go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Build run: | bash build.sh release android - name: Upload assets uses: softprops/action-gh-release@v2 with: files: build/compress/* ``` ## /.github/workflows/release_docker.yml ```yml path="/.github/workflows/release_docker.yml" name: release_docker on: push: tags: - 'v*' branches: - main pull_request: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: REGISTRY: 'xhofe/alist' REGISTRY_USERNAME: 'xhofe' REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} ARTIFACT_NAME: 'binaries_docker_release' RELEASE_PLATFORMS: 'linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x,linux/ppc64le,linux/riscv64' IMAGE_PUSH: ${{ github.event_name == 'push' }} IMAGE_IS_PROD: ${{ github.ref_type == 'tag' }} IMAGE_TAGS_BETA: | type=schedule type=ref,event=branch type=ref,event=tag type=ref,event=pr type=raw,value=beta,enable={{is_default_branch}} jobs: build_binary: name: Build Binaries for Docker Release runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: 'stable' - name: Cache Musl id: cache-musl uses: actions/cache@v4 with: path: build/musl-libs key: docker-musl-libs-v2 - name: Download Musl Library if: steps.cache-musl.outputs.cache-hit != 'true' run: bash build.sh prepare docker-multiplatform - name: Build go binary (beta) if: env.IMAGE_IS_PROD != 'true' run: bash build.sh beta docker-multiplatform - name: Build go binary (release) if: env.IMAGE_IS_PROD == 'true' run: bash build.sh release docker-multiplatform - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: ${{ env.ARTIFACT_NAME }} overwrite: true path: | build/ !build/*.tgz !build/musl-libs/** release_docker: needs: build_binary name: Release Docker image runs-on: ubuntu-latest strategy: matrix: image: ["latest", "ffmpeg", "aria2", "aio"] include: - image: "latest" build_arg: "" tag_favor: "" - image: "ffmpeg" build_arg: INSTALL_FFMPEG=true tag_favor: "suffix=-ffmpeg,onlatest=true" - image: "aria2" build_arg: INSTALL_ARIA2=true tag_favor: "suffix=-aria2,onlatest=true" - image: "aio" build_arg: | INSTALL_FFMPEG=true INSTALL_ARIA2=true tag_favor: "suffix=-aio,onlatest=true" steps: - name: Checkout uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: name: ${{ env.ARTIFACT_NAME }} path: 'build/' - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to DockerHub if: env.IMAGE_PUSH == 'true' uses: docker/login-action@v3 with: logout: true username: ${{ env.REGISTRY_USERNAME }} password: ${{ env.REGISTRY_PASSWORD }} - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }} tags: ${{ env.IMAGE_IS_PROD == 'true' && '' || env.IMAGE_TAGS_BETA }} flavor: | ${{ env.IMAGE_IS_PROD == 'true' && 'latest=true' || '' }} ${{ matrix.tag_favor }} - name: Build and push id: docker_build uses: docker/build-push-action@v6 with: context: . file: Dockerfile.ci push: ${{ env.IMAGE_PUSH == 'true' }} build-args: ${{ matrix.build_arg }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: ${{ env.RELEASE_PLATFORMS }} ``` ## /.github/workflows/release_freebsd.yml ```yml path="/.github/workflows/release_freebsd.yml" name: release_freebsd on: release: types: [ published ] jobs: release_freebsd: strategy: matrix: platform: [ ubuntu-latest ] go-version: [ '1.21' ] name: Release runs-on: ${{ matrix.platform }} steps: - name: Setup Go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Build run: | bash build.sh release freebsd - name: Upload assets uses: softprops/action-gh-release@v2 with: files: build/compress/* ``` ## /.github/workflows/release_linux_musl.yml ```yml path="/.github/workflows/release_linux_musl.yml" name: release_linux_musl on: release: types: [ published ] jobs: release_linux_musl: strategy: matrix: platform: [ ubuntu-latest ] go-version: [ '1.21' ] name: Release runs-on: ${{ matrix.platform }} steps: - name: Setup Go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Build run: | bash build.sh release linux_musl - name: Upload assets uses: softprops/action-gh-release@v2 with: files: build/compress/* ``` ## /.github/workflows/release_linux_musl_arm.yml ```yml path="/.github/workflows/release_linux_musl_arm.yml" name: release_linux_musl_arm on: release: types: [ published ] jobs: release_linux_musl_arm: strategy: matrix: platform: [ ubuntu-latest ] go-version: [ '1.21' ] name: Release runs-on: ${{ matrix.platform }} steps: - name: Setup Go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Build run: | bash build.sh release linux_musl_arm - name: Upload assets uses: softprops/action-gh-release@v2 with: files: build/compress/* ``` ## /.gitignore ```gitignore path="/.gitignore" .idea/ .DS_Store output/ /dist/ # Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib *.db *.bin # Test binary, built with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out # Dependency directories (remove the comment below to include it) # vendor/ /bin/* *.json /build /data/ /tmp/ /log/ /lang/ /daemon/ /public/dist/* /!public/dist/README.md .VSCodeCounter ``` ## /CODE_OF_CONDUCT.md # Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards Examples of behavior that contributes to a positive environment for our community include: * Demonstrating empathy and kindness toward other people * Being respectful of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience * Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: * The use of sexualized language or imagery, and sexual attention or advances of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or email address, without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at i@nn.ci. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact**: A violation through a single incident or series of actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. ## /CONTRIBUTING.md # Contributing ## Setup your machine `alist` is written in [Go](https://golang.org/) and [React](https://reactjs.org/). Prerequisites: - [git](https://git-scm.com) - [Go 1.20+](https://golang.org/doc/install) - [gcc](https://gcc.gnu.org/) - [nodejs](https://nodejs.org/) Clone `alist` and `alist-web` anywhere: ```shell $ git clone https://github.com/alist-org/alist.git $ git clone --recurse-submodules https://github.com/alist-org/alist-web.git ``` You should switch to the `main` branch for development. ## Preview your change ### backend ```shell $ go run main.go ``` ### frontend ```shell $ pnpm dev ``` ## Add a new driver Copy `drivers/template` folder and rename it, and follow the comments in it. ## Create a commit Commit messages should be well formatted, and to make that "standardized". ### Commit Message Format Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**: ``` ():