diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..da7e5b5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,52 @@ +name: "Bug report" +description: Bug report +labels: [bug] +body: + - type: markdown + attributes: + value: | + 感谢你花时间填写此错误报告,请 **务必确认你的issue不是重复的且不是因为你的操作或版本问题** 。 + + - type: checkboxes + attributes: + label: 请确认以下内容 + description: | + 你必须勾选以下所有内容,否则你的issue可能会被直接关闭。或者你可以去 [讨论区](https://github.com/vscodev/kikoeru/discussions) 。 + options: + - label: | + 我确定使用的是 `Kikoeru` 的最新版本。 + - label: | + 我确定没有重复的issue或讨论。 + - label: | + 我确定是程序本身的问题,而不是其他原因(例如 `网络` ,`依赖` 或 `操作` )。 + + - type: input + id: version + attributes: + label: Kikoeru 版本 + description: | + 你使用的是哪个版本的软件?你可以在 `仪表盘` -> `系统信息` -> `程序版本` 中找到。 + placeholder: "0.1.0" + validations: + required: true + - type: input + id: driver + attributes: + label: 使用的存储驱动 + description: | + 你使用的是哪个存储驱动? + placeholder: "OneDrive" + validations: + required: true + - type: textarea + id: bug-description + attributes: + label: 问题描述 + validations: + required: true + - type: textarea + id: logs + attributes: + label: 日志 + description: | + 请复制粘贴错误日志,或者截图。 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..7d284c8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Questions & Discussions + url: https://github.com/vscodev/kikoeru/discussions + about: Use GitHub discussions for message-board style questions and discussions. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..86731c4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,34 @@ +name: "Feature request" +description: Feature request +labels: [enhancement] +body: + - type: checkboxes + attributes: + label: 请确认以下所有内容 + description: | + 你必须勾选以下所有内容,否则你的issue可能会被直接关闭。或者你可以去 [讨论区](https://github.com/vscodev/kikoeru/discussions) 。 + options: + - label: | + 我确定使用的是 `Kikoeru` 的最新版本。 + - label: | + 我确定没有重复的issue或讨论。 + - label: | + 我确定这是一个受众需求而不是单纯出于个人意愿,并且当前没有被实现。 + - type: textarea + id: feature-description + attributes: + label: 需求描述 + validations: + required: true + - type: textarea + id: suggested-solution + attributes: + label: 实现思路 + description: | + 实现此需求的解决思路。 + - type: textarea + id: additional-context + attributes: + label: 附件 + description: | + 相关的任何其他上下文或截图,或者你觉得有帮助的信息。 diff --git a/.github/workflows/docker-image-dev.yml b/.github/workflows/docker-image-dev.yml new file mode 100644 index 0000000..dd8842c --- /dev/null +++ b/.github/workflows/docker-image-dev.yml @@ -0,0 +1,60 @@ +name: Publish Docker dev image + +on: + workflow_dispatch: + +jobs: + docker: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ secrets.GH_REPO }} + token: ${{ secrets.GH_PAT }} + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: 'web/package.json' + check-latest: true + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Build frontend + run: | + pnpm install + pnpm build + cp -a dist/spa/. $GITHUB_WORKSPACE/public/dist/ + working-directory: ./web + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: dev.Dockerfile + platforms: linux/amd64 + push: true + tags: ghcr.io/vscodev/kikoeru:dev diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..750e6a2 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,59 @@ +name: Publish Docker image + +on: + workflow_dispatch: + +jobs: + docker: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ secrets.GH_REPO }} + token: ${{ secrets.GH_PAT }} + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: 'web/package.json' + check-latest: true + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Build frontend + run: | + pnpm install + pnpm build + cp -a dist/spa/. $GITHUB_WORKSPACE/public/dist/ + working-directory: ./web + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x + push: true + tags: ghcr.io/vscodev/kikoeru:latest diff --git a/.github/workflows/linux-release.yml b/.github/workflows/linux-release.yml new file mode 100644 index 0000000..8027782 --- /dev/null +++ b/.github/workflows/linux-release.yml @@ -0,0 +1,89 @@ +name: Linux Release + +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + release: + name: Release + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + toolchain: x86_64-linux-musl-cross + cc: x86_64-linux-musl-gcc + - arch: arm64 + toolchain: aarch64-linux-musl-cross + cc: aarch64-linux-musl-gcc + + steps: + - name: Install toolchains + run: | + curl -L -o "${{matrix.toolchain}}.tgz" "https://musl.cc/${{matrix.toolchain}}.tgz" + sudo tar xf "${{matrix.toolchain}}.tgz" --strip-components 1 -C /usr/local + + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ secrets.GH_REPO }} + token: ${{ secrets.GH_PAT }} + fetch-depth: 0 + + - name: Get latest release version + run: | + echo "APP_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + check-latest: true + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: 'web/package.json' + check-latest: true + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Build frontend + run: | + pnpm install + pnpm build + cp -a dist/spa/. $GITHUB_WORKSPACE/public/dist/ + working-directory: ./web + + - name: Build + run: | + go mod download + export GOARCH=${{ matrix.arch }} + export CC=${{ matrix.cc }} + bash build.sh + + - name: Package + run: | + dist="kikoeru-linux-${{ matrix.arch }}" + mkdir -p "$dist" + cp kikoeru scripts/start.sh "$dist/" + tar zcf "$dist.tar.gz" "$dist/" + + - name: Publish + uses: softprops/action-gh-release@v2 + with: + name: ${{ env.APP_VERSION }} + tag_name: ${{ env.APP_VERSION }} + draft: true + body: | + - 本更新包括稳定性提升和错误修复。 + files: | + kikoeru-*.* diff --git a/.github/workflows/macos-release.yml b/.github/workflows/macos-release.yml new file mode 100644 index 0000000..7cdef9e --- /dev/null +++ b/.github/workflows/macos-release.yml @@ -0,0 +1,79 @@ +name: macOS Release + +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + release: + name: Release + runs-on: macos-latest + + strategy: + fail-fast: false + matrix: + arch: + - amd64 + - arm64 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ secrets.GH_REPO }} + token: ${{ secrets.GH_PAT }} + fetch-depth: 0 + + - name: Get latest release version + run: | + echo "APP_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + check-latest: true + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: 'web/package.json' + check-latest: true + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Build frontend + run: | + pnpm install + pnpm build + cp -a dist/spa/. $GITHUB_WORKSPACE/public/dist/ + working-directory: ./web + + - name: Build + run: | + go mod download + export GOARCH=${{ matrix.arch }} + bash build.sh + + - name: Package + run: | + dist="kikoeru-macos-${{ matrix.arch }}" + mkdir -p "$dist" + cp kikoeru scripts/start.sh "$dist/" + tar zcf "$dist.tar.gz" "$dist/" + + - name: Publish + uses: softprops/action-gh-release@v2 + with: + name: ${{ env.APP_VERSION }} + tag_name: ${{ env.APP_VERSION }} + draft: true + body: | + - 本更新包括稳定性提升和错误修复。 + files: | + kikoeru-*.* diff --git a/.github/workflows/prune-untagged-images.yml b/.github/workflows/prune-untagged-images.yml new file mode 100644 index 0000000..53e426e --- /dev/null +++ b/.github/workflows/prune-untagged-images.yml @@ -0,0 +1,28 @@ +name: Prune untagged images + +on: + workflow_dispatch: + + workflow_run: + workflows: + - Publish Docker image + - Publish Docker dev image + types: + - completed + +jobs: + prune-untagged-images: + runs-on: ubuntu-latest + + permissions: + packages: write + + steps: + - name: Prune untagged images + uses: dataaxiom/ghcr-cleanup-action@v1 + with: + package: 'kikoeru' + delete-untagged: true + delete-ghost-images: true + delete-partial-images: true + delete-orphaned-images: true diff --git a/.github/workflows/windows-release.yml b/.github/workflows/windows-release.yml new file mode 100644 index 0000000..6c470fb --- /dev/null +++ b/.github/workflows/windows-release.yml @@ -0,0 +1,82 @@ +name: Windows Release + +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + release: + name: Release + runs-on: windows-latest + + strategy: + fail-fast: false + matrix: + arch: + - amd64 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ secrets.GH_REPO }} + token: ${{ secrets.GH_PAT }} + fetch-depth: 0 + + - name: Get latest release version + shell: bash + run: | + echo "APP_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + check-latest: true + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: 'web/package.json' + check-latest: true + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Build frontend + shell: bash + run: | + pnpm install + pnpm build + cp -a dist/spa/. $GITHUB_WORKSPACE/public/dist/ + working-directory: ./web + + - name: Build + shell: bash + run: | + go mod download + export GOARCH=${{ matrix.arch }} + bash build.sh + + - name: Package + shell: bash + run: | + dist="kikoeru-windows-${{ matrix.arch }}" + mkdir -p "$dist" + cp kikoeru.exe scripts/start.bat "$dist/" + 7z a "$dist.zip" "$dist/" + + - name: Publish + uses: softprops/action-gh-release@v2 + with: + name: ${{ env.APP_VERSION }} + tag_name: ${{ env.APP_VERSION }} + draft: true + body: | + - 本更新包括稳定性提升和错误修复。 + files: | + kikoeru-*.* diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e029ed3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +# Created by .ignore support plugin (hsz.mobi) +### Go template +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# 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/ +public/dist/* +!public/dist/README.md + +# JetBrains +.idea/ + +# MacOS +.DS_Store +.AppleDouble +.LSOverride + +# Kikoeru +kikoeru +kikoeru.log diff --git a/README.md b/README.md new file mode 100644 index 0000000..971561d --- /dev/null +++ b/README.md @@ -0,0 +1,99 @@ +# Kikoeru + +一个自托管的DLsite音声作品整理和媒体播放软件,为你提供极致的音声视听体验。 + +![screenshot](screenshot.png) + +## 功能 + +- 自动从DLsite爬取作品元数据,支持所有作品类型(RJ/BJ/VJ),包括已下架的作品。 +- 支持多种存储,你可以通过本地、网盘、WebDAV甚至AList导入作品资源。 +- 强大的个性化搜索功能,支持多关键字、多标签检索,支持对搜索结果二级筛选过滤。 +- 支持多种格式的字幕显示,`.lrc` 、`.srt` 、`.vtt` 以及 `.ass` ,支持字幕偏移。 + +## 安装 + +创建一个工作目录,例如 `kikoeru` 。 + +```sh +mkdir kikoeru +cd kikoeru +``` + +拉取Kikoeru镜像,创建容器并运行。 + +```sh +docker run -d --name kikoeru -p 2333:2333 -v $PWD/data:/opt/kikoeru/data -e TZ=Asia/Shanghai -e PUID=$(id -u) -e PGID=$(id -g) -e UMASK=022 --restart unless-stopped ghcr.io/vscodev/kikoeru:latest +``` + +首次运行Kikoeru会自动创建管理员帐号,你可通过 `docker logs` 命令查看。 + +```sh +docker logs kikoeru +``` + +忘记密码可通过 `kikoeru admin` 命令重置。 + +```sh +docker exec -it kikoeru ./kikoeru admin +``` + +> [!NOTE] +> 升级新版本可能会出现不兼容的情况,如果遇到错误你需要清除应用数据(删除 `data` 目录)重新安装。 + +## 导入作品 + +Kikoeru支持从以下存储驱动导入作品资源,配置填写可参考 [AList](https://alist.nn.ci/zh/guide/) 。 + +- [x] 本机存储 +- [x] [阿里云盘](https://www.alipan.com) +- [x] [百度网盘](https://pan.baidu.com) +- [x] [OneDrive](https://onedrive.live.com) +- [x] WebDAV +- [x] [AList](https://github.com/AlistGo/alist) + +> [!TIP] +> WebDAV驱动仅建议在上游原生支持WebDAV协议的情况下使用,AList用户请直接使用AList驱动。 + +每个作品对应一个目录,且文件夹名称必须包含一个有效的作品ID,示例: + +``` +RJ334212 +[みやぢ屋][RJ334212]ガチ恋不可避の耳リフレ2~ぼくっこ店員ゆずるの出張サービス~ +``` + +> [!CAUTION] +> 不要包含重复的作品,否则会被覆盖,而且顺序是不确定的。 + +## 反向代理 + +你需要在NGINX网站配置文件的 `server` 字段中添加 + +``` +location / { + proxy_pass http://127.0.0.1:2333; + proxy_http_version 1.1; + proxy_cache_bypass $http_upgrade; + + # Proxy SSL + proxy_ssl_server_name on; + + # Proxy headers + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Forwarded $proxy_add_forwarded; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Port $server_port; + proxy_set_header Range $http_range; + proxy_set_header If-Range $http_if_range; + + # Proxy timeouts + proxy_connect_timeout 60s; + proxy_send_timeout 60s; + proxy_read_timeout 60s; +} +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ab82756 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +version: "3.6" + +services: + kikoeru: + image: ghcr.io/vscodev/kikoeru:latest + container_name: kikoeru + ports: + - "2333:2333" + volumes: + - "./data/:/opt/kikoeru/data/" + environment: + - TZ=Asia/Shanghai + - PUID=0 + - PGID=0 + - UMASK=022 + restart: unless-stopped diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..39fcc6f Binary files /dev/null and b/screenshot.png differ