Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nvus #24

Merged
merged 13 commits into from
Oct 31, 2024
Merged

Nvus #24

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
33 changes: 0 additions & 33 deletions .github/workflows/npm-publish.yml

This file was deleted.

17 changes: 17 additions & 0 deletions packages/backend/src/models/entities/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,23 @@ export class Meta {
length: 128,
nullable: true,
})
public enableGithubIntegration: boolean;

@Column("varchar", {
length: 128,
nullable: true,
})
public githubClientId: string | null;

@Column("varchar", {
length: 128,
nullable: true,
})
public githubClientSecret: string | null;

@Column("boolean", {
default: false,
})
public deeplAuthKey: string | null;

@Column("boolean", {
Expand Down
11 changes: 6 additions & 5 deletions packages/backend/src/remote/activitypub/resolver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { config } from "@/config.js";
const allowedContexts = ["https://www.w3.org/ns/activitystreams"];
import type { ILocalUser } from "@/models/entities/user.js";
import {
extractHost,
Expand Down Expand Up @@ -125,10 +126,10 @@ export default class Resolver {
if (
object == null ||
(Array.isArray(object["@context"])
? !(object["@context"] as unknown[]).includes(
"https://www.w3.org/ns/activitystreams",
)
: object["@context"] !== "https://www.w3.org/ns/activitystreams")
? !((object["@context"] as unknown[]).every(
(ctx) => allowedContexts.includes(ctx)
))
: !allowedContexts.includes(object["@context"]))
) {
throw new Error("invalid response");
}
Expand Down Expand Up @@ -219,4 +220,4 @@ export default class Resolver {
throw new Error(`resolveLocal: type ${parsed.type} unhandled`);
}
}
}
}
5 changes: 5 additions & 0 deletions packages/backend/src/server/api/endpoints/admin/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ export const meta = {
optional: false,
nullable: false,
},
enableGithubIntegration: {
type: "boolean",
optional: false,
nullable: false,
},
enableServiceWorker: {
type: "boolean",
optional: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ export const paramDef = {
deeplIsPro: { type: "boolean" },
libreTranslateApiUrl: { type: "string", nullable: true },
libreTranslateApiKey: { type: "string", nullable: true },
enableGithubIntegration: { type: "boolean" },
githubClientId: { type: "string", nullable: true },
githubClientSecret: { type: "string", nullable: true },
enableEmail: { type: "boolean" },
email: { type: "string", nullable: true },
smtpSecure: { type: "boolean" },
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/server/api/endpoints/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ export const meta = {
optional: false,
nullable: false,
},
enableGithubIntegration: {
type: "boolean",
optional: false,
nullable: false,
},
enableServiceWorker: {
type: "boolean",
optional: false,
Expand Down
Loading
Loading