Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
clean: false

- name: Pnpm Setup
uses: pnpm/action-setup@903f9c1a6ebcba6cf41d87230be49611ac97822e # v6.0.3
Expand Down Expand Up @@ -96,6 +97,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
clean: false

- name: Pnpm Setup
uses: pnpm/action-setup@903f9c1a6ebcba6cf41d87230be49611ac97822e # v6.0.3
Expand Down Expand Up @@ -139,6 +141,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
clean: false

- name: Pnpm Setup
uses: pnpm/action-setup@903f9c1a6ebcba6cf41d87230be49611ac97822e # v6.0.3
Expand Down Expand Up @@ -187,6 +190,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
clean: false

- name: Commit timestamp
id: ts
Expand Down Expand Up @@ -235,6 +239,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
clean: false

- name: Commit timestamp
id: ts
Expand Down Expand Up @@ -374,6 +379,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
clean: false

- name: Log in to GitHub Container Registry on seerr.home
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
clean: false

- name: Initialize CodeQL
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
clean: false

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
with:
path: packaging/snap

- uses: snapcore/action-publish@9334eecb267cfd97a0ce3c8654215d095927252f # v1
- uses: snapcore/action-publish@214b86e5ca036ead1668c79afb81e550e6c54d40 # v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
with:
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
dist/
config/
cache/config.json
.bookshelf-migration-lab
.bookshelf-migration-lab/**
pnpm-lock.yaml
cypress/config/settings.cypress.json
.github
Expand Down
4 changes: 1 addition & 3 deletions cypress/e2e/discover.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@ describe('Discover', () => {
cy.contains('.slider-header', 'Recent Requests')
.next('[data-testid=media-slider]')
.contains('[data-testid=request-card]', 'Failed Card Album')
.find(
'a[href="/music/56565656-5656-5656-5656-565656565656?manage=1"]'
)
.find('a[href="/music/56565656-5656-5656-5656-565656565656?manage=1"]')
.should('contain', 'Failed');
});

Expand Down
36 changes: 27 additions & 9 deletions deploy/bookshelf-hardcover-migration.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,23 @@ const normalizePathComparable = (value) => {
return normalized.replace(/\/+$/, '');
};

const normalizeReadarrRootFolderPath = (value) => {
const normalized = normalizeText(value).replace(/\\/g, '/');
const pathPattern = /^\/[A-Za-z0-9._~:/@()+, -]+$/;

if (!pathPattern.test(normalized)) {
throw new Error(`Invalid Readarr root folder path: ${value}`);
}

const normalizedPath = path.posix.normalize(normalized);

if (normalizedPath === '.' || normalizedPath.includes('/../')) {
throw new Error(`Invalid Readarr root folder path: ${value}`);
}

return normalizedPath;
};

const deriveRootFolderPath = ({ book, author, rootFolders }) => {
const direct = normalizeText(
firstValue(book, [
Expand Down Expand Up @@ -2503,6 +2520,9 @@ const applyRebuildPayload = async ({ migrationDir, jobs }) => {
};

const resolveTargetIds = async (item, job, targetConfig) => {
const rootFolderPath = normalizeReadarrRootFolderPath(
item.addBook.rootFolderPath
);
const qualityProfile = item.source.qualityProfileName
? targetConfig.qualityProfiles.find(
(profile) =>
Expand All @@ -2527,7 +2547,7 @@ const applyRebuildPayload = async ({ migrationDir, jobs }) => {
let rootFolder = targetConfig.rootFolders.find(
(folder) =>
normalizePathComparable(folder.path ?? folder.Path) ===
normalizePathComparable(item.addBook.rootFolderPath)
normalizePathComparable(rootFolderPath)
);
const missing = [];

Expand All @@ -2549,10 +2569,8 @@ const applyRebuildPayload = async ({ migrationDir, jobs }) => {
apiKey: job.apiKey,
endpoint: '/rootfolder',
body: {
path: item.addBook.rootFolderPath,
name:
item.addBook.rootFolderPath.split('/').filter(Boolean).pop() ??
'Books',
path: rootFolderPath,
name: rootFolderPath.split('/').filter(Boolean).pop() ?? 'Books',
defaultQualityProfileId: Number(
qualityProfile.id ?? qualityProfile.Id
),
Expand All @@ -2567,7 +2585,6 @@ const applyRebuildPayload = async ({ migrationDir, jobs }) => {
},
});
targetConfig.rootFolders.push(createdRootFolder);
rootFolder = createdRootFolder;
}

if (missing.length) {
Expand All @@ -2577,6 +2594,7 @@ const applyRebuildPayload = async ({ migrationDir, jobs }) => {
return {
qualityProfileId: Number(qualityProfile.id ?? qualityProfile.Id),
metadataProfileId: Number(metadataProfile.id ?? metadataProfile.Id),
rootFolderPath,
};
};

Expand Down Expand Up @@ -2667,7 +2685,7 @@ const applyRebuildPayload = async ({ migrationDir, jobs }) => {
tags,
author: {
...local.author,
rootFolderPath: item.addBook.rootFolderPath,
rootFolderPath: targetIds.rootFolderPath,
qualityProfileId: targetIds.qualityProfileId,
metadataProfileId: targetIds.metadataProfileId,
monitored: false,
Expand Down Expand Up @@ -2744,7 +2762,7 @@ const applyRebuildPayload = async ({ migrationDir, jobs }) => {
...lookupAuthor,
qualityProfileId: targetIds.qualityProfileId,
metadataProfileId: targetIds.metadataProfileId,
rootFolderPath: item.addBook.rootFolderPath,
rootFolderPath: targetIds.rootFolderPath,
monitored: false,
monitorNewItems: 'none',
tags: [],
Expand Down Expand Up @@ -2828,7 +2846,7 @@ const applyRebuildPayload = async ({ migrationDir, jobs }) => {
tags,
author: {
...decision.result.author,
rootFolderPath: item.addBook.rootFolderPath,
rootFolderPath: targetIds.rootFolderPath,
qualityProfileId: targetIds.qualityProfileId,
metadataProfileId: targetIds.metadataProfileId,
monitored: false,
Expand Down
4 changes: 2 additions & 2 deletions deploy/compose.main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ services:
healthcheck:
test:
[
"CMD-SHELL",
"node -e \"fetch('http://127.0.0.1:5055/api/v1/status').then((r)=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\"",
'CMD-SHELL',
'node -e "fetch(''http://127.0.0.1:5055/api/v1/status'').then((r)=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"',
]
interval: 10s
timeout: 5s
Expand Down
6 changes: 3 additions & 3 deletions deploy/compose.readonly-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ services:
TZ: ${TZ:-America/Regina}
PORT: 5055
CONFIG_DIRECTORY: /app/config
SEERR_EXTERNAL_READ_ONLY: "true"
SEERR_ALLOW_PRODUCTION_EXTERNAL_READ_ONLY: "true"
SEERR_EXTERNAL_READ_ONLY: 'true'
SEERR_ALLOW_PRODUCTION_EXTERNAL_READ_ONLY: 'true'
LOG_LEVEL: ${LOG_LEVEL:-info}
ports:
- "${SEERRNG_PORT:-5055}:5055"
- '${SEERRNG_PORT:-5055}:5055'
volumes:
- ${SEERRNG_CONFIG_DIR:-../config}:/app/config
6 changes: 3 additions & 3 deletions deploy/compose.readonly-swap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ services:
TZ: ${TZ:-America/Regina}
PORT: 5055
CONFIG_DIRECTORY: /app/config
SEERR_EXTERNAL_READ_ONLY: "true"
SEERR_ALLOW_PRODUCTION_EXTERNAL_READ_ONLY: "true"
SEERR_EXTERNAL_READ_ONLY: 'true'
SEERR_ALLOW_PRODUCTION_EXTERNAL_READ_ONLY: 'true'
LOG_LEVEL: ${LOG_LEVEL:-info}
ports:
- "${SEERRNG_PORT:-5055}:5055"
- '${SEERRNG_PORT:-5055}:5055'
volumes:
- ${SEERRNG_CONFIG_DIR:-./config}:/app/config
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"migration:generate": "ts-node -r tsconfig-paths/register --project server/tsconfig.json ./node_modules/typeorm/cli.js migration:generate -d server/datasource.ts",
"migration:create": "ts-node -r tsconfig-paths/register --project server/tsconfig.json ./node_modules/typeorm/cli.js migration:create -d server/datasource.ts",
"migration:run": "ts-node -r tsconfig-paths/register --project server/tsconfig.json ./node_modules/typeorm/cli.js migration:run -d server/datasource.ts",
"format": "prettier --log-level warn --write --cache .",
"format:check": "prettier --check --cache .",
"format": "git ls-files -z | xargs -0 prettier --log-level warn --write --cache --ignore-unknown",
"format:check": "git ls-files -z | xargs -0 prettier --check --cache --ignore-unknown",
"typecheck": "pnpm typecheck:server && pnpm typecheck:client",
"typecheck:server": "tsc --project server/tsconfig.json --noEmit",
"typecheck:client": "next typegen && tsc --noEmit",
Expand Down Expand Up @@ -85,6 +85,7 @@
"openpgp": "6.3.0",
"pg": "8.20.0",
"pug": "3.0.4",
"qs": "6.15.2",
"react": "19.2.6",
"react-ace": "14.0.1",
"react-animate-height": "3.2.3",
Expand Down Expand Up @@ -236,7 +237,7 @@
"nodemailer": "8.0.5",
"picomatch": "2.3.2",
"postcss": "8.5.10",
"qs": "6.14.2",
"qs": "6.15.2",
"systeminformation": "5.31.6",
"tar": "7.5.15",
"tmp": "0.2.4",
Expand Down
23 changes: 13 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/api/externalapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { requestInterceptorFunction } from '@server/utils/customProxyAgent';
import type { AxiosInstance, AxiosRequestConfig } from 'axios';
import axios from 'axios';
import rateLimit from 'axios-rate-limit';
import { createHash } from 'node:crypto';
import type NodeCache from 'node-cache';
import { createHash } from 'node:crypto';

// 5 minute default TTL (in seconds)
const DEFAULT_TTL = 300;
Expand Down
Loading
Loading