diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 16ae302c..968e97c4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster -ARG VARIANT=20 +ARG VARIANT=16 FROM mcr.microsoft.com/devcontainers/javascript-node:0-${VARIANT} as base # Setup the node environment @@ -10,3 +10,6 @@ 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 054690d4..0d113a3e 100644 --- a/.devcontainer/dev.js +++ b/.devcontainer/dev.js @@ -5,6 +5,5 @@ module.exports.config = { ConfigPath: Path.resolve('config'), MetadataPath: Path.resolve('metadata'), FFmpegPath: '/usr/bin/ffmpeg', - FFProbePath: '/usr/bin/ffprobe', - SkipBinariesCheck: false -} + FFProbePath: '/usr/bin/ffprobe' +} \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0213d517..1341b2c8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,7 +8,7 @@ // Append -bullseye or -buster to pin to an OS version. // Use -bullseye variants on local arm64/Apple Silicon. "args": { - "VARIANT": "20" + "VARIANT": "16" } }, "mounts": [ diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 0efcc5b5..00000000 --- a/.editorconfig +++ /dev/null @@ -1,8 +0,0 @@ -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 89aec401..1d422810 100644 --- a/.github/ISSUE_TEMPLATE/bug.yaml +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -1,50 +1,40 @@ name: 🐞 Bug Report -description: File a bug/issue and help us improve Audiobookshelf -title: '[Bug]: ' -labels: ['bug', 'triage'] +description: File a bug/issue +title: "[Bug]: " +labels: ["bug", "triage"] body: - type: markdown attributes: - value: 'Thank you for filing a bug report! 🐛' + value: "### Please first search for your issue and check the [docs](https://audiobookshelf.org/docs)." - type: markdown attributes: - value: 'Please first search for your issue and check the [docs](https://audiobookshelf.org/docs).' + value: "### Mobile app issues report [here](https://github.com/advplyr/audiobookshelf-app/issues/new/choose)." - type: markdown attributes: - value: 'Report issues with the mobile app [here](https://github.com/advplyr/audiobookshelf-app/issues/new/choose).' + value: "### Join the [discord server](https://discord.gg/pJsjuNCKRq) for questions or if you are not sure about a bug." - type: markdown attributes: - value: 'Join the [discord server](https://discord.gg/HQgCbd6E75) for questions or if you are not sure about a bug.' + value: "## Be as descriptive as you can. Include screenshots, error logs, browser, file types, everything you can think of that might be relevant." - type: textarea id: what-happened attributes: - 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. + label: Describe the issue + description: What happened & what did you expect to happen 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 @@ -54,45 +44,7 @@ body: options: - Docker - Debian/PPA - - Windows Tray App - Built from source - - Other (list in "Additional Notes" box) + - Other validations: - 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.' + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index d04ad818..63cb8805 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,8 @@ blank_issues_enabled: false contact_links: - name: Discord - url: https://discord.gg/HQgCbd6E75 + url: https://discord.gg/pJsjuNCKRq + 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 76888091..75363c0e 100644 --- a/.github/ISSUE_TEMPLATE/feature.yml +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -1,63 +1,17 @@ name: 🚀 Feature Request description: Request a feature/enhancement -title: '[Enhancement]: ' -labels: ['enhancement'] +title: "[Enhancement]: " +labels: ["enhancement"] body: - type: markdown attributes: - value: '#### *Mobile app features should be [requested here](https://github.com/advplyr/audiobookshelf-app/issues/new/choose)*.' + value: "### Please first search in both issues & discussions for your enhancement." - type: markdown attributes: - 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 + value: "### Mobile app features should be requested [here](https://github.com/advplyr/audiobookshelf-app/issues/new/choose)." - type: textarea id: describe attributes: - label: Describe the Feature/Enhancement - description: Please help us understand what you want. - placeholder: What is your vision? + label: Describe the feature/enhancement 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 deleted file mode 100644 index 0cd521a5..00000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,33 +0,0 @@ - - -## 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 deleted file mode 100644 index 69a7ce28..00000000 --- a/.github/workflows/apply_comments.yaml +++ /dev/null @@ -1,55 +0,0 @@ -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 deleted file mode 100644 index 9c590758..00000000 --- a/.github/workflows/close-issues-on-release.yml +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 7190546a..00000000 --- a/.github/workflows/close_blank_issues.yaml +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100644 index 2e5f4bce..00000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100644 index fcc2c213..00000000 --- a/.github/workflows/component-tests.yml +++ /dev/null @@ -1,48 +0,0 @@ -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 fdb57fbc..80439648 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,4 +1,5 @@ --- + name: Build and Push Docker Image on: @@ -10,7 +11,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 @@ -22,16 +23,16 @@ on: jobs: build: - if: ${{ !contains(github.event.head_commit.message, 'skip ci') && github.repository == 'advplyr/audiobookshelf' }} - runs-on: ubuntu-24.04 + if: "!contains(github.event.head_commit.message, 'skip ci')" + runs-on: ubuntu-20.04 steps: - name: Check out - uses: actions/checkout@v4 + uses: actions/checkout@v3 - name: Docker meta id: meta - uses: docker/metadata-action@v5 + uses: docker/metadata-action@v4 with: images: advplyr/audiobookshelf,ghcr.io/${{ github.repository_owner }}/audiobookshelf tags: | @@ -39,13 +40,13 @@ jobs: type=semver,pattern={{version}} - name: Setup QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v2 - name: Cache Docker layers - uses: actions/cache@v4 + uses: actions/cache@v3 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} @@ -53,25 +54,24 @@ jobs: ${{ runner.os }}-buildx- - name: Login to Dockerhub - uses: docker/login-action@v3 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Login to ghcr - uses: docker/login-action@v3 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GHCR_PASSWORD }} - name: Build image - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v3 with: tags: ${{ github.event.inputs.tags || steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} context: . - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max diff --git a/.github/workflows/i18n-integration.yml b/.github/workflows/i18n-integration.yml deleted file mode 100644 index 8b3a4678..00000000 --- a/.github/workflows/i18n-integration.yml +++ /dev/null @@ -1,31 +0,0 @@ -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 18c1d2da..f88db2ed 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -4,30 +4,22 @@ on: pull_request: push: branches-ignore: - - '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 + - 'dependabot/**' # Don't run dependabot branches, as they are already covered by pull requests jobs: build: name: build and test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - - name: setup node - uses: actions/setup-node@v4 + - name: setup nade + uses: actions/setup-node@v3 with: - node-version: 20 - cache: 'npm' + node-version: 16 - - name: install pkg (using yao-pkg fork for targeting node20) - run: npm install -g @yao-pkg/pkg + - name: install pkg + run: npm install -g pkg - name: get client dependencies working-directory: client @@ -41,7 +33,7 @@ jobs: run: npm ci --only=production - name: build binary - run: pkg -t node20-linux-x64 -o audiobookshelf . + run: pkg -t node18-linux-x64 -o audiobookshelf . - name: run audiobookshelf run: | diff --git a/.github/workflows/lint-openapi.yml b/.github/workflows/lint-openapi.yml deleted file mode 100644 index ec08ecb3..00000000 --- a/.github/workflows/lint-openapi.yml +++ /dev/null @@ -1,39 +0,0 @@ -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 deleted file mode 100644 index 9ede33b8..00000000 --- a/.github/workflows/notify-abs-windows.yml +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 91a22c71..00000000 --- a/.github/workflows/unit-tests.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Run Unit Tests - -on: - workflow_dispatch: - inputs: - ref: - description: 'Branch/Tag/SHA to test' - required: true - pull_request: - push: - -jobs: - run-unit-tests: - name: Run Unit 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: npm ci - - - name: Run tests - run: npm test diff --git a/.gitignore b/.gitignore index d375bae0..6f47029b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,19 +7,12 @@ /podcasts/ /media/ /metadata/ -/plugins/ +test/ /client/.nuxt/ /client/dist/ /dist/ /deploy/ -/coverage/ -/.nyc_output/ -/ffmpeg* -/ffprobe* -/unicode* -/libnusqlite3* sw.* .DS_STORE .idea/* -tailwind.compiled.css diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index d3d0ff99..00000000 --- a/.prettierrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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 deleted file mode 100644 index d2a04598..00000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "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 75503e6a..2fb8b48f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,12 +16,5 @@ }, "editor.formatOnSave": true, "editor.detectIndentation": true, - "editor.tabSize": 2, - "javascript.format.semicolons": "remove", - "[javascript][json][jsonc]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[vue]": { - "editor.defaultFormatter": "octref.vetur" - } + "editor.tabSize": 2 } \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 4e110a61..25472000 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,55 +1,34 @@ ### STAGE 0: Build client ### -FROM node:20-alpine AS build +FROM node:16-alpine AS build WORKDIR /client COPY /client /client RUN npm ci && npm cache clean --force RUN npm run generate ### STAGE 1: Build server ### -FROM node:20-alpine +FROM sandreas/tone:v0.1.5 AS tone +FROM node:16-alpine ENV NODE_ENV=production RUN apk update && \ - apk add --no-cache --update \ - curl \ - tzdata \ - ffmpeg \ - make \ - python3 \ - g++ \ - tini \ - unzip + apk add --no-cache --update \ + curl \ + tzdata \ + ffmpeg \ + make \ + python3 \ + g++ +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 e30bc490..f43f2683 100644 --- a/build/debian/DEBIAN/preinst +++ b/build/debian/DEBIAN/preinst @@ -2,6 +2,7 @@ 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 @@ -45,11 +46,43 @@ 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 @@ -63,6 +96,9 @@ 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" @@ -79,3 +115,5 @@ 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 52a9beba..903ee74f 100755 --- a/build/linuxpackager +++ b/build/linuxpackager @@ -48,10 +48,11 @@ Description: $DESCRIPTION" echo "$controlfile" > dist/debian/DEBIAN/control; # Package debian -pkg -t node20-linux-x64 -o dist/debian/usr/share/audiobookshelf/audiobookshelf . +pkg -t node16-linux-x64 -o dist/debian/usr/share/audiobookshelf/audiobookshelf . -fakeroot dpkg-deb -Zxz --build dist/debian +fakeroot dpkg-deb --build dist/debian mv dist/debian.deb "dist/$OUTPUT_FILE" +chmod +x "dist/$OUTPUT_FILE" echo "Finished! Filename: $OUTPUT_FILE" diff --git a/client/assets/app.css b/client/assets/app.css index 36b3b4ba..b7b8499d 100644 --- a/client/assets/app.css +++ b/client/assets/app.css @@ -5,7 +5,7 @@ @import './absicons.css'; :root { - --bookshelf-texture-img: url(~static/textures/wood_default.jpg); + --bookshelf-texture-img: url(/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,7 +30,8 @@ } .bookshelf-row { - width: calc(100vw - (100vw - 100%)); + /* Sidebar width + scrollbar width */ + width: calc(100vw - 88px); } @media (max-width: 768px) { @@ -92,10 +93,11 @@ } /* Firefox */ -input[type='number'] { +input[type=number] { -moz-appearance: textfield; } + .tracksTable { border-collapse: collapse; width: 100%; @@ -176,10 +178,6 @@ 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); } @@ -207,6 +205,7 @@ Bookshelf Label color: #fce3a6; } + .cover-bg { width: calc(100% + 40px); height: calc(100% + 40px); @@ -218,6 +217,36 @@ Bookshelf Label filter: blur(20px); } + +.episode-subtitle { + word-break: break-word; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + line-height: 16px; + /* fallback */ + max-height: 32px; + /* fallback */ + -webkit-line-clamp: 2; + /* number of lines to show */ + -webkit-box-orient: vertical; +} + +.episode-subtitle-long { + word-break: break-word; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + line-height: 16px; + /* fallback */ + max-height: 72px; + /* fallback */ + -webkit-line-clamp: 6; + /* number of lines to show */ + -webkit-box-orient: vertical; +} + + /* Padding for toastification toasts in the top right to not cover appbar/toolbar */ .app-bar-and-toolbar .Vue-Toastification__container.top-right { padding-top: 104px; @@ -229,24 +258,4 @@ Bookshelf Label .no-bars .Vue-Toastification__container.top-right { padding-top: 8px; -} - -.abs-btn::before { - content: ''; - position: absolute; - border-radius: 6px; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(255, 255, 255, 0); - transition: all 0.1s ease-in-out; -} - -.abs-btn:hover:not(:disabled)::before { - background-color: rgba(255, 255, 255, 0.1); -} - -.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 e0ca79e2..027ccdf2 100644 --- a/client/assets/defaultStyles.css +++ b/client/assets/defaultStyles.css @@ -52,17 +52,4 @@ text-indent: 0px !important; text-align: start !important; text-align-last: start !important; -} - -.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; -} - +} \ No newline at end of file diff --git a/client/assets/fonts.css b/client/assets/fonts.css index c568ffa6..f9acc6bf 100644 --- a/client/assets/fonts.css +++ b/client/assets/fonts.css @@ -1,12 +1,19 @@ @font-face { - font-family: 'Material Symbols Rounded'; + font-family: 'Material Icons'; font-style: normal; font-weight: 400; - src: url(~static/fonts/MaterialSymbolsRounded.woff2) format('woff2'); + src: url(~static/fonts/MaterialIcons.woff2) format('woff2'); } -.material-symbols { - font-family: 'Material Symbols Rounded'; +@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'; font-weight: normal; font-style: normal; line-height: 1; @@ -17,12 +24,28 @@ word-wrap: normal; direction: ltr; -webkit-font-smoothing: antialiased; - vertical-align: top; } -.material-symbols.fill { - font-variation-settings: - 'FILL' 1 +.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; } /* cyrillic-ext */ @@ -293,4 +316,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 deleted file mode 100644 index 7883f32f..00000000 --- a/client/assets/tailwind.css +++ /dev/null @@ -1,85 +0,0 @@ -@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 7432b25f..8f88c61f 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: inherit; + line-height: 1.5; } .trix-content * { @@ -455,13 +455,6 @@ 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; @@ -567,4 +560,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 f7413404..879d50a3 100644 --- a/client/components/app/Appbar.vue +++ b/client/components/app/Appbar.vue @@ -1,6 +1,6 @@