diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ddd7c5f3..16ae302c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -10,6 +10,3 @@ RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ curl tzdata ffmpeg && \ rm -rf /var/lib/apt/lists/* - -# Move tone executable to appropriate directory -COPY --from=sandreas/tone:v0.1.5 /usr/local/bin/tone /usr/local/bin/ diff --git a/.devcontainer/dev.js b/.devcontainer/dev.js index b5f6714e..054690d4 100644 --- a/.devcontainer/dev.js +++ b/.devcontainer/dev.js @@ -7,4 +7,4 @@ module.exports.config = { FFmpegPath: '/usr/bin/ffmpeg', FFProbePath: '/usr/bin/ffprobe', SkipBinariesCheck: false -} \ No newline at end of file +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..0efcc5b5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml index 7f47d710..89aec401 100644 --- a/.github/ISSUE_TEMPLATE/bug.yaml +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -1,40 +1,50 @@ name: 🐞 Bug Report -description: File a bug/issue -title: "[Bug]: " -labels: ["bug", "triage"] +description: File a bug/issue and help us improve Audiobookshelf +title: '[Bug]: ' +labels: ['bug', 'triage'] body: - type: markdown attributes: - value: "### Please first search for your issue and check the [docs](https://audiobookshelf.org/docs)." + value: 'Thank you for filing a bug report! 🐛' - type: markdown attributes: - value: "### Mobile app issues report [here](https://github.com/advplyr/audiobookshelf-app/issues/new/choose)." + value: 'Please first search for your issue and check the [docs](https://audiobookshelf.org/docs).' - type: markdown attributes: - value: "### Join the [discord server](https://discord.gg/HQgCbd6E75) for questions or if you are not sure about a bug." + value: 'Report issues with the mobile app [here](https://github.com/advplyr/audiobookshelf-app/issues/new/choose).' - type: markdown attributes: - value: "## Be as descriptive as you can. Include screenshots, error logs, browser, file types, everything you can think of that might be relevant." + value: 'Join the [discord server](https://discord.gg/HQgCbd6E75) for questions or if you are not sure about a bug.' - type: textarea id: what-happened attributes: - label: Describe the issue - description: What happened & what did you expect to happen + label: What happened? + placeholder: Tell us what you see! + validations: + required: true + - type: textarea + id: what-was-expected + attributes: + label: What did you expect to happen? + placeholder: Tell us what you expected to see! Be as descriptive as you can and include screenshots if applicable. validations: required: true - type: textarea id: steps-to-reproduce attributes: label: Steps to reproduce the issue - value: "1. " + value: '1. ' validations: required: true + - type: markdown + attributes: + value: '## Install Environment' - type: input id: version attributes: label: Audiobookshelf version description: Do not put 'Latest version', please put the actual version here - placeholder: "e.g. v1.6.60" + placeholder: 'e.g. v1.6.60' validations: required: true - type: dropdown @@ -46,6 +56,43 @@ body: - Debian/PPA - Windows Tray App - Built from source - - Other + - Other (list in "Additional Notes" box) validations: - required: true + required: true + - type: dropdown + id: server-os + attributes: + label: What OS is your Audiobookshelf server hosted from? + options: + - Windows + - macOS + - Linux + - Other (list in "Additional Notes" box) + validations: + required: true + - type: dropdown + id: desktop-browsers + attributes: + label: If the issue is being seen in the UI, what browsers are you seeing the problem on? + options: + - Chrome + - Firefox + - Safari + - Edge + - Firefox for Android + - Chrome for Android + - Safari on iOS + - Other (list in "Additional Notes" box) + - type: textarea + id: logs + attributes: + label: Logs + description: Please include any relevant logs here. This field is automatically formatted into code, so you do not need to include any backticks. + placeholder: Paste logs here + render: shell + - type: textarea + id: additional-notes + attributes: + label: Additional Notes + description: Anything else you want to add? + placeholder: 'e.g. I have tried X, Y, and Z.' diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 2c6cc191..d04ad818 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -3,6 +3,3 @@ contact_links: - name: Discord url: https://discord.gg/HQgCbd6E75 about: Ask questions, get help troubleshooting, and join the Abs community here. - - name: Matrix - url: https://matrix.to/#/#audiobookshelf:matrix.org - about: Ask questions, get help troubleshooting, and join the Abs community here. diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml index 75363c0e..76888091 100644 --- a/.github/ISSUE_TEMPLATE/feature.yml +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -1,17 +1,63 @@ name: 🚀 Feature Request description: Request a feature/enhancement -title: "[Enhancement]: " -labels: ["enhancement"] +title: '[Enhancement]: ' +labels: ['enhancement'] body: - type: markdown attributes: - value: "### Please first search in both issues & discussions for your enhancement." + value: '#### *Mobile app features should be [requested here](https://github.com/advplyr/audiobookshelf-app/issues/new/choose)*.' - type: markdown attributes: - value: "### Mobile app features should be requested [here](https://github.com/advplyr/audiobookshelf-app/issues/new/choose)." + value: '## Web/Server Feature Request Description' + - type: markdown + attributes: + value: 'Please first search in both issues & discussions for your enhancement.' + - type: dropdown + id: enhancment-type + attributes: + label: Type of Enhancement + options: + - Server Backend + - Web Interface/Frontend + - Documentation - type: textarea id: describe attributes: - label: Describe the feature/enhancement + label: Describe the Feature/Enhancement + description: Please help us understand what you want. + placeholder: What is your vision? validations: required: true + - type: textarea + id: the-why + attributes: + label: Why would this be helpful? + description: Please help us understand why this would enhance your experience. + placeholder: Explain the "why" or "use case". + validations: + required: true + - type: textarea + id: image + attributes: + label: Future Implementation (Screenshot) + description: Please help us visualize by including a doodle or screenshot. + placeholder: How could this look? + validations: + required: true + - type: markdown + attributes: + value: '## Web/Server Current Implementation' + - type: input + id: version + attributes: + label: Audiobookshelf Server Version + description: Do not put 'Latest version', please put your current version number here + placeholder: 'e.g. v1.6.60' + validations: + required: true + - type: textarea + id: current-image + attributes: + label: Current Implementation (Screenshot) + description: What page were you looking at when you thought of this enhancement? + placeholder: If an image is not applicable, please explain why. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..0cd521a5 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,33 @@ + + +## Brief summary + + + +## Which issue is fixed? + + + +## In-depth Description + + + +## How have you tested this? + + + +## Screenshots + + diff --git a/.github/workflows/apply_comments.yaml b/.github/workflows/apply_comments.yaml new file mode 100644 index 00000000..69a7ce28 --- /dev/null +++ b/.github/workflows/apply_comments.yaml @@ -0,0 +1,55 @@ +name: Add issue comments by label +on: + issues: + types: + - labeled +jobs: + help-wanted: + if: github.event.label.name == 'help wanted' + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Help wanted comment + run: gh issue comment "$NUMBER" --body "$BODY" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} + BODY: > + This issue is not able to be completed due to limited bandwidth or access to the required test hardware. + + This issue is available for anyone to work on. + + + config-issue: + if: github.event.label.name == 'config-issue' + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Config issue comment + run: gh issue close "$NUMBER" --reason "not planned" --comment "$BODY" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} + BODY: > + After reviewing this issue, this appears to be a problem with your setup and not Audiobookshelf. This issue is being closed to keep the issue tracker focused on Audiobookshelf itself. Please reach out on the Audiobookshelf Discord for community support. + + Some common search terms to help you find the solution to your problem: + - Reverse proxy + - Enabling websockets + - SSL (https vs http) + - Configuring a static IP + - `localhost` versus IP address + - hairpin NAT + - VPN + - firewall ports + - public versus private network + - bridge versus host mode + - Docker networking + - DNS (such as EAI_AGAIN errors) + + After you have followed these steps, please post the solution or steps you followed to fix the problem to help others in the future, or show that it is a problem with Audiobookshelf so we can reopen the issue. + diff --git a/.github/workflows/close-issues-on-release.yml b/.github/workflows/close-issues-on-release.yml new file mode 100644 index 00000000..9c590758 --- /dev/null +++ b/.github/workflows/close-issues-on-release.yml @@ -0,0 +1,20 @@ +name: Close fixed issues on release. +on: + release: + types: [published] + +permissions: + contents: read + issues: write + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - name: Close issues marked as fixed upon a release. + uses: gcampbell-msft/fixed-pending-release@7fa1b75a0c04bcd4b375110522878e5f6100cff5 + with: + label: 'awaiting release' + removeLabel: true + applyToAll: true + message: Fixed in [${releaseTag}](${releaseUrl}). diff --git a/.github/workflows/close_blank_issues.yaml b/.github/workflows/close_blank_issues.yaml new file mode 100644 index 00000000..7190546a --- /dev/null +++ b/.github/workflows/close_blank_issues.yaml @@ -0,0 +1,42 @@ +name: Close Issues not using a template + +on: + issues: + types: + - opened + +permissions: + issues: write + +jobs: + close_issue: + runs-on: ubuntu-latest + + steps: + - name: Check issue headings + uses: actions/github-script@v7 + with: + script: | + const issueBody = context.payload.issue.body || ""; + + // Match Markdown headings (e.g., # Heading, ## Heading) + const headingRegex = /^(#{1,6})\s.+/gm; + const headings = [...issueBody.matchAll(headingRegex)]; + + if (headings.length < 3) { + // Post a comment + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.issue.number, + body: "Thank you for opening an issue! To help us review your request efficiently, please use one of the provided issue templates. If you're seeking information or have a general question, consider opening a Discussion or joining the conversation on our Discord. Thanks!" + }); + + // Close the issue + await github.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.issue.number, + state: "closed" + }); + } diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..2e5f4bce --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,78 @@ +name: 'CodeQL' + +on: + push: + branches: ['master'] + # Only build when files in these directories have been changed + paths: + - client/** + - server/** + - test/** + - index.js + - package.json + pull_request: + # The branches below must be a subset of the branches above + branches: ['master'] + # Only build when files in these directories have been changed + paths: + - client/** + - server/** + - test/** + - index.js + - package.json + schedule: + - cron: '16 5 * * 4' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ['javascript'] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Use only 'java' to analyze code written in Java, Kotlin or both + # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: '/language:${{matrix.language}}' diff --git a/.github/workflows/component-tests.yml b/.github/workflows/component-tests.yml new file mode 100644 index 00000000..fcc2c213 --- /dev/null +++ b/.github/workflows/component-tests.yml @@ -0,0 +1,48 @@ +name: Run Component Tests + +on: + workflow_dispatch: + inputs: + ref: + description: 'Branch/Tag/SHA to test' + required: true + pull_request: + paths: + - 'client/**' + - '.github/workflows/component-tests.yml' + push: + paths: + - 'client/**' + - '.github/workflows/component-tests.yml' + +jobs: + run-component-tests: + name: Run Component Tests + runs-on: ubuntu-latest + + steps: + - name: Checkout (push/pull request) + uses: actions/checkout@v4 + if: github.event_name != 'workflow_dispatch' + + - name: Checkout (workflow_dispatch) + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + if: github.event_name == 'workflow_dispatch' + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Install dependencies + run: | + cd client + npm ci + + - name: Run tests + run: | + cd client + npm test diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index e783fce6..fdb57fbc 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,5 +1,4 @@ --- - name: Build and Push Docker Image on: @@ -11,7 +10,7 @@ on: required: true default: 'latest' push: - branches: [main,master] + branches: [main, master] tags: - 'v*.*.*' # Only build when files in these directories have been changed @@ -23,16 +22,16 @@ on: jobs: build: - if: "!contains(github.event.head_commit.message, 'skip ci')" - runs-on: ubuntu-20.04 + if: ${{ !contains(github.event.head_commit.message, 'skip ci') && github.repository == 'advplyr/audiobookshelf' }} + runs-on: ubuntu-24.04 steps: - name: Check out - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: advplyr/audiobookshelf,ghcr.io/${{ github.repository_owner }}/audiobookshelf tags: | @@ -40,13 +39,13 @@ jobs: type=semver,pattern={{version}} - name: Setup QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} @@ -54,22 +53,23 @@ jobs: ${{ runner.os }}-buildx- - name: Login to Dockerhub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Login to ghcr - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GHCR_PASSWORD }} - name: Build image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: tags: ${{ github.event.inputs.tags || steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} context: . platforms: linux/amd64,linux/arm64 push: true diff --git a/.github/workflows/i18n-integration.yml b/.github/workflows/i18n-integration.yml new file mode 100644 index 00000000..8b3a4678 --- /dev/null +++ b/.github/workflows/i18n-integration.yml @@ -0,0 +1,31 @@ +name: Verify all i18n files are alphabetized + +on: + pull_request: + paths: + - client/strings/** # Should only check if any strings changed + push: + paths: + - client/strings/** # Should only check if any strings changed + +jobs: + update_translations: + runs-on: ubuntu-latest + steps: + # Check out the repository + - name: Checkout repository + uses: actions/checkout@v4 + + # Set up node to run the javascript + - name: Set up node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + # The only argument is the `directory`, which is where the i18n files are + # stored. + - name: Run Update JSON Files action + uses: audiobookshelf/audiobookshelf-i18n-updater@v1.3.0 + with: + directory: 'client/strings/' # Adjust the directory path as needed diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index df639ef7..18c1d2da 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -4,22 +4,30 @@ on: pull_request: push: branches-ignore: - - 'dependabot/**' # Don't run dependabot branches, as they are already covered by pull requests + - 'dependabot/**' # Don't run dependabot branches, as they are already covered by pull requests + # Only build when files in these directories have been changed + paths: + - client/** + - server/** + - test/** + - index.js + - package.json jobs: build: name: build and test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: setup nade - uses: actions/setup-node@v3 + - name: setup node + uses: actions/setup-node@v4 with: node-version: 20 + cache: 'npm' - - name: install pkg - run: npm install -g pkg + - name: install pkg (using yao-pkg fork for targeting node20) + run: npm install -g @yao-pkg/pkg - name: get client dependencies working-directory: client @@ -33,7 +41,7 @@ jobs: run: npm ci --only=production - name: build binary - run: pkg -t node18-linux-x64 -o audiobookshelf . + run: pkg -t node20-linux-x64 -o audiobookshelf . - name: run audiobookshelf run: | diff --git a/.github/workflows/lint-openapi.yml b/.github/workflows/lint-openapi.yml new file mode 100644 index 00000000..ec08ecb3 --- /dev/null +++ b/.github/workflows/lint-openapi.yml @@ -0,0 +1,39 @@ +name: API linting + +# Run on pull requests or pushes when there is a change to any OpenAPI files in docs/ +on: + pull_request: + push: + paths: + - 'docs/**' + +# This action only needs read permissions +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + # Check out the repository + - name: Checkout + uses: actions/checkout@v4 + + # Set up node to run the javascript + - name: Set up node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + # Install Redocly CLI + - name: Install Redocly CLI + run: npm install -g @redocly/cli@latest + + # Perform linting for exploded spec + - name: Run linting for exploded spec + run: redocly lint docs/root.yaml --format=github-actions + + # Perform linting for bundled spec + - name: Run linting for bundled spec + run: redocly lint docs/openapi.json --format=github-actions diff --git a/.github/workflows/notify-abs-windows.yml b/.github/workflows/notify-abs-windows.yml new file mode 100644 index 00000000..9ede33b8 --- /dev/null +++ b/.github/workflows/notify-abs-windows.yml @@ -0,0 +1,17 @@ +name: Dispatch an abs-windows event + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + abs-windows-dispatch: + runs-on: ubuntu-latest + steps: + - name: Send a remote repository dispatch event + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.ABS_WINDOWS_PAT }} + repository: mikiher/audiobookshelf-windows + event-type: build-windows diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 24f6398c..91a22c71 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -11,18 +11,25 @@ on: jobs: run-unit-tests: + name: Run Unit Tests runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout (push/pull request) + uses: actions/checkout@v4 + if: github.event_name != 'workflow_dispatch' + + - name: Checkout (workflow_dispatch) uses: actions/checkout@v4 with: - ref: ${{ github.event_name != 'workflow_dispatch' && github.ref_name || inputs.ref}} + ref: ${{ inputs.ref }} + if: github.event_name == 'workflow_dispatch' - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: 20 + cache: 'npm' - name: Install dependencies run: npm ci diff --git a/.gitignore b/.gitignore index 0690f38f..d375bae0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /podcasts/ /media/ /metadata/ +/plugins/ /client/.nuxt/ /client/dist/ /dist/ @@ -15,7 +16,10 @@ /.nyc_output/ /ffmpeg* /ffprobe* +/unicode* +/libnusqlite3* sw.* .DS_STORE .idea/* +tailwind.compiled.css diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..d3d0ff99 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,17 @@ +{ + "semi": false, + "singleQuote": true, + "printWidth": 400, + "proseWrap": "never", + "trailingComma": "none", + "overrides": [ + { + "files": ["*.html"], + "options": { + "singleQuote": false, + "wrapAttributes": false, + "sortAttributes": false + } + } + ] +} \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..d2a04598 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "EditorConfig.EditorConfig", + "esbenp.prettier-vscode", + "octref.vetur" + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 397b9618..75503e6a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,5 +17,11 @@ "editor.formatOnSave": true, "editor.detectIndentation": true, "editor.tabSize": 2, - "javascript.format.semicolons": "remove" + "javascript.format.semicolons": "remove", + "[javascript][json][jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[vue]": { + "editor.defaultFormatter": "octref.vetur" + } } \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 97bb4732..4e110a61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,31 +6,50 @@ RUN npm ci && npm cache clean --force RUN npm run generate ### STAGE 1: Build server ### -FROM sandreas/tone:v0.1.5 AS tone FROM node:20-alpine ENV NODE_ENV=production RUN apk update && \ - apk add --no-cache --update \ - curl \ - tzdata \ - ffmpeg \ - make \ - python3 \ - g++ \ - tini + apk add --no-cache --update \ + curl \ + tzdata \ + ffmpeg \ + make \ + python3 \ + g++ \ + tini \ + unzip -COPY --from=tone /usr/local/bin/tone /usr/local/bin/ COPY --from=build /client/dist /client/dist COPY index.js package* / COPY server server +ARG TARGETPLATFORM + +ENV NUSQLITE3_DIR="/usr/local/lib/nusqlite3" +ENV NUSQLITE3_PATH="${NUSQLITE3_DIR}/libnusqlite3.so" + +RUN case "$TARGETPLATFORM" in \ + "linux/amd64") \ + curl -L -o /tmp/library.zip "https://github.com/mikiher/nunicode-sqlite/releases/download/v1.2/libnusqlite3-linux-musl-x64.zip" ;; \ + "linux/arm64") \ + curl -L -o /tmp/library.zip "https://github.com/mikiher/nunicode-sqlite/releases/download/v1.2/libnusqlite3-linux-musl-arm64.zip" ;; \ + *) echo "Unsupported platform: $TARGETPLATFORM" && exit 1 ;; \ + esac && \ + unzip /tmp/library.zip -d $NUSQLITE3_DIR && \ + rm /tmp/library.zip + RUN npm ci --only=production RUN apk del make python3 g++ EXPOSE 80 +ENV PORT=80 +ENV CONFIG_PATH="/config" +ENV METADATA_PATH="/metadata" +ENV SOURCE="docker" + ENTRYPOINT ["tini", "--"] CMD ["node", "index.js"] diff --git a/build/debian/DEBIAN/preinst b/build/debian/DEBIAN/preinst index f43f2683..e30bc490 100644 --- a/build/debian/DEBIAN/preinst +++ b/build/debian/DEBIAN/preinst @@ -2,7 +2,6 @@ set -e set -o pipefail -FFMPEG_INSTALL_DIR="/usr/lib/audiobookshelf-ffmpeg" DEFAULT_DATA_DIR="/usr/share/audiobookshelf" CONFIG_PATH="/etc/default/audiobookshelf" DEFAULT_PORT=13378 @@ -46,43 +45,11 @@ add_group() { fi } -install_ffmpeg() { - echo "Starting FFMPEG Install" - - WGET="wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz --output-document=ffmpeg-git-amd64-static.tar.xz" - WGET_TONE="wget https://github.com/sandreas/tone/releases/download/v0.1.5/tone-0.1.5-linux-x64.tar.gz --output-document=tone-0.1.5-linux-x64.tar.gz" - - if ! cd "$FFMPEG_INSTALL_DIR"; then - echo "Creating ffmpeg install dir at $FFMPEG_INSTALL_DIR" - mkdir "$FFMPEG_INSTALL_DIR" - chown -R 'audiobookshelf:audiobookshelf' "$FFMPEG_INSTALL_DIR" - cd "$FFMPEG_INSTALL_DIR" - fi - - $WGET - tar xvf ffmpeg-git-amd64-static.tar.xz --strip-components=1 --no-same-owner - rm ffmpeg-git-amd64-static.tar.xz - - # Temp downloading tone library to the ffmpeg dir - echo "Getting tone.." - $WGET_TONE - tar xvf tone-0.1.5-linux-x64.tar.gz --strip-components=1 --no-same-owner - rm tone-0.1.5-linux-x64.tar.gz - - echo "Good to go on Ffmpeg (& tone)... hopefully" -} - setup_config() { if [ -f "$CONFIG_PATH" ]; then echo "Existing config found." cat $CONFIG_PATH - # TONE_PATH variable added in 2.1.6, if it doesnt exist then add it - if ! grep -q "TONE_PATH" "$CONFIG_PATH"; then - echo "Adding TONE_PATH to existing config" - echo "TONE_PATH=$FFMPEG_INSTALL_DIR/tone" >> "$CONFIG_PATH" - fi - else if [ ! -d "$DEFAULT_DATA_DIR" ]; then @@ -96,9 +63,6 @@ setup_config() { config_text="METADATA_PATH=$DEFAULT_DATA_DIR/metadata CONFIG_PATH=$DEFAULT_DATA_DIR/config -FFMPEG_PATH=$FFMPEG_INSTALL_DIR/ffmpeg -FFPROBE_PATH=$FFMPEG_INSTALL_DIR/ffprobe -TONE_PATH=$FFMPEG_INSTALL_DIR/tone PORT=$DEFAULT_PORT HOST=$DEFAULT_HOST" @@ -115,5 +79,3 @@ add_group 'audiobookshelf' '' add_user 'audiobookshelf' '' 'audiobookshelf' 'audiobookshelf user-daemon' '/bin/false' setup_config - -install_ffmpeg diff --git a/build/linuxpackager b/build/linuxpackager index 5f03a2e8..52a9beba 100755 --- a/build/linuxpackager +++ b/build/linuxpackager @@ -48,7 +48,7 @@ Description: $DESCRIPTION" echo "$controlfile" > dist/debian/DEBIAN/control; # Package debian -pkg -t node18-linux-x64 -o dist/debian/usr/share/audiobookshelf/audiobookshelf . +pkg -t node20-linux-x64 -o dist/debian/usr/share/audiobookshelf/audiobookshelf . fakeroot dpkg-deb -Zxz --build dist/debian diff --git a/client/assets/app.css b/client/assets/app.css index 2e0714f9..36b3b4ba 100644 --- a/client/assets/app.css +++ b/client/assets/app.css @@ -5,7 +5,7 @@ @import './absicons.css'; :root { - --bookshelf-texture-img: url(/textures/wood_default.jpg); + --bookshelf-texture-img: url(~static/textures/wood_default.jpg); --bookshelf-divider-bg: linear-gradient(180deg, rgba(149, 119, 90, 1) 0%, rgba(103, 70, 37, 1) 17%, rgba(103, 70, 37, 1) 88%, rgba(71, 48, 25, 1) 100%); } @@ -30,8 +30,7 @@ } .bookshelf-row { - /* Sidebar width + scrollbar width */ - width: calc(100vw - 88px); + width: calc(100vw - (100vw - 100%)); } @media (max-width: 768px) { @@ -93,11 +92,10 @@ } /* Firefox */ -input[type=number] { +input[type='number'] { -moz-appearance: textfield; } - .tracksTable { border-collapse: collapse; width: 100%; @@ -178,6 +176,10 @@ input[type=number] { box-shadow: 4px 1px 8px #11111166, -4px 1px 8px #11111166, 1px -4px 8px #11111166; } +.box-shadow-progressbar { + box-shadow: 0px -1px 4px rgb(62, 50, 2, 0.5); +} + .shadow-height { height: calc(100% - 4px); } @@ -205,7 +207,6 @@ Bookshelf Label color: #fce3a6; } - .cover-bg { width: calc(100% + 40px); height: calc(100% + 40px); @@ -248,4 +249,4 @@ Bookshelf Label .abs-btn:disabled::before { background-color: rgba(0, 0, 0, 0.2); -} \ No newline at end of file +} diff --git a/client/assets/defaultStyles.css b/client/assets/defaultStyles.css index 027ccdf2..e0ca79e2 100644 --- a/client/assets/defaultStyles.css +++ b/client/assets/defaultStyles.css @@ -52,4 +52,17 @@ text-indent: 0px !important; text-align: start !important; text-align-last: start !important; -} \ No newline at end of file +} + +.default-style.less-spacing p { + margin-block-start: 0; +} + +.default-style.less-spacing ul { + margin-block-start: 0; +} + +.default-style.less-spacing ol { + margin-block-start: 0; +} + diff --git a/client/assets/fonts.css b/client/assets/fonts.css index f9acc6bf..c568ffa6 100644 --- a/client/assets/fonts.css +++ b/client/assets/fonts.css @@ -1,19 +1,12 @@ @font-face { - font-family: 'Material Icons'; + font-family: 'Material Symbols Rounded'; font-style: normal; font-weight: 400; - src: url(~static/fonts/MaterialIcons.woff2) format('woff2'); + src: url(~static/fonts/MaterialSymbolsRounded.woff2) format('woff2'); } -@font-face { - font-family: 'Material Icons Outlined'; - font-style: normal; - font-weight: 400; - src: url(~static/fonts/MaterialIconsOutlined.woff2) format('woff2'); -} - -.material-icons { - font-family: 'Material Icons'; +.material-symbols { + font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; line-height: 1; @@ -24,28 +17,12 @@ word-wrap: normal; direction: ltr; -webkit-font-smoothing: antialiased; + vertical-align: top; } -.material-icons:not([class*="text-"]) { - font-size: 1.5rem; -} - -.material-icons-outlined { - font-family: 'Material Icons Outlined'; - font-weight: normal; - font-style: normal; - line-height: 1; - letter-spacing: normal; - text-transform: none; - display: inline-block; - white-space: nowrap; - word-wrap: normal; - direction: ltr; - -webkit-font-smoothing: antialiased; -} - -.material-icons-outlined:not([class*="text-"]) { - font-size: 1.5rem; +.material-symbols.fill { + font-variation-settings: + 'FILL' 1 } /* cyrillic-ext */ @@ -316,4 +293,4 @@ font-display: swap; src: url(~static/fonts/Ubuntu_Mono/UbuntuMono-Regular.ttf) format('truetype'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; -} \ No newline at end of file +} diff --git a/client/assets/tailwind.css b/client/assets/tailwind.css index bd6213e1..7883f32f 100644 --- a/client/assets/tailwind.css +++ b/client/assets/tailwind.css @@ -1,3 +1,85 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; \ No newline at end of file +@import 'tailwindcss'; + +/* + The default border color has changed to `currentColor` in Tailwind CSS v4, + so we've added these compatibility styles to make sure everything still + looks the same as it did with Tailwind CSS v3. + + If we ever want to remove these styles, we need to add an explicit border + color utility to any element that depends on these defaults. +*/ +@layer base { + *, + ::after, + ::before, + ::backdrop, + ::file-selector-button { + border-color: var(--color-gray-200, currentColor); + } + + [role='button'], + button { + cursor: pointer; + } +} + +@theme { + --spacing-0\.5e: 0.125em; + --spacing-1e: 0.25em; + --spacing-1\.5e: 0.375em; + --spacing-2e: 0.5em; + --spacing-2\.5e: 0.625em; + --spacing-3e: 0.75em; + --spacing-3\.5e: 0.875em; + --spacing-4e: 1em; + --spacing-5e: 1.25em; + --spacing-6e: 1.5em; + --spacing-7e: 1.75em; + --spacing-8e: 2em; + --spacing-9e: 2.25em; + --spacing-10e: 2.5em; + --spacing-11e: 2.75em; + --spacing-12e: 3em; + --spacing-14e: 3.5em; + --spacing-16e: 4em; + --spacing-20e: 5em; + --spacing-24e: 6em; + --spacing-28e: 7em; + --spacing-32e: 8em; + --spacing-36e: 9em; + --spacing-40e: 10em; + --spacing-44e: 11em; + --spacing-48e: 12em; + --spacing-52e: 13em; + --spacing-56e: 14em; + --spacing-60e: 15em; + --spacing-64e: 16em; + --spacing-72e: 18em; + --spacing-80e: 20em; + --spacing-96e: 24em; + + --color-bg: #373838; + --color-primary: #232323; + --color-accent: #1ad691; + --color-error: #ff5252; + --color-info: #2196f3; + --color-success: #4caf50; + --color-warning: #fb8c00; + --color-darkgreen: rgb(34, 127, 35); + --color-black-50: #bbbbbb; + --color-black-100: #666666; + --color-black-200: #555555; + --color-black-300: #444444; + --color-black-400: #333333; + --color-black-500: #222222; + --color-black-600: #111111; + --color-black-700: #101010; + + --font-sans: 'Source Sans Pro'; + --font-mono: 'Ubuntu Mono'; + + --text-xxs: 0.625rem; + --text-1\.5xl: 1.375rem; + --text-2\.5xl: 1.6875rem; + --text-4\.5xl: 2.625rem; +} diff --git a/client/assets/trix.css b/client/assets/trix.css index 8f88c61f..7432b25f 100644 --- a/client/assets/trix.css +++ b/client/assets/trix.css @@ -446,7 +446,7 @@ trix-editor .attachment__metadata .attachment__size { } .trix-content { - line-height: 1.5; + line-height: inherit; } .trix-content * { @@ -455,6 +455,13 @@ trix-editor .attachment__metadata .attachment__size { padding: 0; } +.trix-content p { + box-sizing: border-box; + margin-top: 0; + margin-bottom: 0.5em; + padding: 0; +} + .trix-content h1 { font-size: 1.2em; line-height: 1.2; @@ -560,4 +567,4 @@ trix-editor .attachment__metadata .attachment__size { .trix-content .attachment-gallery.attachment-gallery--4 .attachment { flex-basis: 50%; max-width: 50%; -} \ No newline at end of file +} diff --git a/client/components/app/Appbar.vue b/client/components/app/Appbar.vue index c281f821..f7413404 100644 --- a/client/components/app/Appbar.vue +++ b/client/components/app/Appbar.vue @@ -1,6 +1,6 @@