Fix GitHub Actions build (#427)
* Fix server build * Remove server drop-base submod * Update lockfile * Use debian images for build * Fix pino errors, lint * Fix macOS keychain lookup
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
||||
# Server
|
||||
|
||||
The hosted, accessible portion of Drop. Exposes a web UI and API for applications to use.
|
||||
The hosted, accessible portion of Drop. Exposes a web UI and API for applications to use.
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ plugins:
|
||||
opt: target=ts
|
||||
|
||||
inputs:
|
||||
- directory: ../
|
||||
- directory: ../
|
||||
|
||||
Submodule server/drop-base deleted from dad3487be6
@@ -11,9 +11,9 @@ export default withNuxt([
|
||||
eslintConfigPrettier,
|
||||
|
||||
// vue-i18n plugin
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error
|
||||
...vueI18n.configs.recommended,
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error
|
||||
{
|
||||
rules: {
|
||||
// Optional.
|
||||
@@ -37,10 +37,10 @@ export default withNuxt([
|
||||
},
|
||||
},
|
||||
},
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error
|
||||
{
|
||||
plugins: {
|
||||
drop: { rules: { "no-prisma-delete": noPrismaDelete } },
|
||||
},
|
||||
}
|
||||
},
|
||||
]);
|
||||
|
||||
+2
-2
@@ -56,8 +56,8 @@
|
||||
"nuxt-security": "2.2.0",
|
||||
"otp-io": "^1.2.7",
|
||||
"parse-cosekey": "^1.0.2",
|
||||
"pino": "9.7.0",
|
||||
"pino-pretty": "^13.0.0",
|
||||
"pino": "^9.14.0",
|
||||
"pino-pretty": "^13.1.1",
|
||||
"prisma": "7.3.0",
|
||||
"sanitize-filename": "^1.6.3",
|
||||
"semver": "^7.7.1",
|
||||
|
||||
@@ -14,9 +14,9 @@ export const FilesystemProviderConfig = type({
|
||||
baseDir: "string",
|
||||
});
|
||||
|
||||
export class FilesystemProvider
|
||||
implements LibraryProvider<typeof FilesystemProviderConfig.infer>
|
||||
{
|
||||
export class FilesystemProvider implements LibraryProvider<
|
||||
typeof FilesystemProviderConfig.infer
|
||||
> {
|
||||
private config: typeof FilesystemProviderConfig.infer;
|
||||
private myId: string;
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ export const FlatFilesystemProviderConfig = type({
|
||||
baseDir: "string",
|
||||
});
|
||||
|
||||
export class FlatFilesystemProvider
|
||||
implements LibraryProvider<typeof FlatFilesystemProviderConfig.infer>
|
||||
{
|
||||
export class FlatFilesystemProvider implements LibraryProvider<
|
||||
typeof FlatFilesystemProviderConfig.infer
|
||||
> {
|
||||
private config: typeof FlatFilesystemProviderConfig.infer;
|
||||
private myId: string;
|
||||
|
||||
|
||||
@@ -188,7 +188,10 @@ export class PCGamingWikiProvider implements MetadataProvider {
|
||||
return url.pathname.replace("/games/", "").replace(/\/$/, "");
|
||||
}
|
||||
default: {
|
||||
logger.warn("Pcgamingwiki, unknown host", url.hostname);
|
||||
logger.warn(
|
||||
{ hostname: url.hostname },
|
||||
"Pcgamingwiki, unknown host",
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
@@ -222,8 +225,8 @@ export class PCGamingWikiProvider implements MetadataProvider {
|
||||
});
|
||||
if (ratingObj instanceof type.errors) {
|
||||
logger.info(
|
||||
{ summary: ratingObj.summary },
|
||||
"pcgamingwiki: failed to properly get review rating",
|
||||
ratingObj.summary,
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
@@ -327,7 +330,7 @@ export class PCGamingWikiProvider implements MetadataProvider {
|
||||
* @returns
|
||||
*/
|
||||
private parseTS(isoStr: string): DateTime {
|
||||
return DateTime.fromISO(isoStr.split(";")[0]);
|
||||
return DateTime.fromISO(isoStr.split(";")[0]!);
|
||||
}
|
||||
|
||||
private parseWebsitesGetFirst(websiteStr?: string | null): string {
|
||||
@@ -429,7 +432,7 @@ export class PCGamingWikiProvider implements MetadataProvider {
|
||||
);
|
||||
|
||||
const released = game.Released
|
||||
? DateTime.fromISO(game.Released.split(";")[0]).toJSDate()
|
||||
? DateTime.fromISO(game.Released.split(";")[0]!).toJSDate()
|
||||
: new Date();
|
||||
|
||||
const metadata: GameMetadata = {
|
||||
|
||||
@@ -306,7 +306,8 @@ export class SteamProvider implements MetadataProvider {
|
||||
"https://store.steampowered.com/publisher/",
|
||||
),
|
||||
)
|
||||
.map((v) => v.attribs.href);
|
||||
.map((v) => v.attribs.href)
|
||||
.filter((v) => v !== undefined);
|
||||
|
||||
const companies: {
|
||||
[key: string]: {
|
||||
@@ -320,6 +321,8 @@ export class SteamProvider implements MetadataProvider {
|
||||
.substring("https://store.steampowered.com/".length, v.indexOf("?"))
|
||||
.split("/");
|
||||
|
||||
if (!type || !name) return;
|
||||
|
||||
companies[name] ??= { pub: false, dev: false };
|
||||
switch (type) {
|
||||
case "publisher":
|
||||
@@ -546,7 +549,9 @@ export class SteamProvider implements MetadataProvider {
|
||||
let titleMatch = ogTitleRegex.exec(html);
|
||||
titleMatch ??= titleTagRegex.exec(html);
|
||||
|
||||
return titleMatch ? this._decodeHtmlEntities(titleMatch[1]) : undefined;
|
||||
return titleMatch && titleMatch[1]
|
||||
? this._decodeHtmlEntities(titleMatch[1])
|
||||
: undefined;
|
||||
}
|
||||
|
||||
private _extractDescription(html: string): string | undefined {
|
||||
@@ -558,7 +563,9 @@ export class SteamProvider implements MetadataProvider {
|
||||
let descMatch = ogDescRegex.exec(html);
|
||||
descMatch ??= nameDescRegex.exec(html);
|
||||
|
||||
return descMatch ? this._decodeHtmlEntities(descMatch[1]) : undefined;
|
||||
return descMatch && descMatch[1]
|
||||
? this._decodeHtmlEntities(descMatch[1])
|
||||
: undefined;
|
||||
}
|
||||
|
||||
private _extractImage(html: string): string | undefined {
|
||||
@@ -583,6 +590,7 @@ export class SteamProvider implements MetadataProvider {
|
||||
curatorUrlMatch ??= linkfilterRegex.exec(html);
|
||||
|
||||
if (!curatorUrlMatch) return undefined;
|
||||
if (!curatorUrlMatch[1]) return undefined;
|
||||
|
||||
try {
|
||||
return decodeURIComponent(curatorUrlMatch[1]);
|
||||
@@ -601,11 +609,12 @@ export class SteamProvider implements MetadataProvider {
|
||||
bannerMatch ??= backgroundImageRegex.exec(html);
|
||||
|
||||
if (!bannerMatch) return undefined;
|
||||
if (!bannerMatch[1]) return undefined;
|
||||
|
||||
let bannerUrl = bannerMatch[1].replace(/['"]/g, "");
|
||||
// Clean up the URL
|
||||
if (bannerUrl.includes("?")) {
|
||||
bannerUrl = bannerUrl.split("?")[0];
|
||||
bannerUrl = bannerUrl.split("?")[0]!;
|
||||
}
|
||||
return bannerUrl;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,10 @@ export class FsObjectBackend extends ObjectBackend {
|
||||
const metadataRaw = JSON.parse(fs.readFileSync(metadataPath, "utf-8"));
|
||||
const metadata = objectMetadata(metadataRaw);
|
||||
if (metadata instanceof type.errors) {
|
||||
logger.error("FsObjectBackend#fetchMetadata", metadata.summary);
|
||||
logger.error(
|
||||
{ summary: metadata.summary },
|
||||
"FsObjectBackend#fetchMetadata",
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
await this.metadataCache.set(id, metadata);
|
||||
@@ -198,8 +201,8 @@ export class FsObjectBackend extends ObjectBackend {
|
||||
);
|
||||
} catch (error) {
|
||||
cleanupLogger.error(
|
||||
{ error },
|
||||
`[FsObjectBackend#cleanupMetadata]: Failed to remove ${file}`,
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ class TaskHandler {
|
||||
parentTask?.progress ??
|
||||
((progress: number) => {
|
||||
if (progress < 0 || progress > 100) {
|
||||
logger.error("Progress must be between 0 and 100", { progress });
|
||||
logger.error({ progress }, "Progress must be between 0 and 100");
|
||||
return;
|
||||
}
|
||||
const taskEntry = this.taskPool.get(task.id);
|
||||
|
||||
@@ -49,10 +49,13 @@ export default defineDropTask({
|
||||
|
||||
// if response failed somehow
|
||||
if (!response.ok) {
|
||||
logger.info("Failed to check for update ", {
|
||||
status: response.status,
|
||||
body: response.body,
|
||||
});
|
||||
logger.info(
|
||||
{
|
||||
status: response.status,
|
||||
body: response.body,
|
||||
},
|
||||
"Failed to check for update ",
|
||||
);
|
||||
|
||||
throw new Error(
|
||||
`Failed to check for update: ${response.status} ${response.body}`,
|
||||
|
||||
Reference in New Issue
Block a user