chore: remove the hard coded artalk link for in favor the env.
This commit is contained in:
parent
cb95e90d97
commit
0fce8d770c
@ -14,4 +14,6 @@ POSTGRES_PASSWORD=
|
|||||||
POSTGRES_DATABASE=
|
POSTGRES_DATABASE=
|
||||||
|
|
||||||
# Artalk configuration
|
# Artalk configuration
|
||||||
|
ARTALK_SCHEME=
|
||||||
ARTALK_HOST=
|
ARTALK_HOST=
|
||||||
|
ARTALK_PORT=
|
||||||
|
@ -32,7 +32,9 @@ export default defineConfig({
|
|||||||
POSTGRES_PASSWORD: envField.string({ context: 'server', access: 'secret' }),
|
POSTGRES_PASSWORD: envField.string({ context: 'server', access: 'secret' }),
|
||||||
POSTGRES_DATABASE: envField.string({ context: 'server', access: 'secret' }),
|
POSTGRES_DATABASE: envField.string({ context: 'server', access: 'secret' }),
|
||||||
// Artalk Comment
|
// Artalk Comment
|
||||||
|
ARTALK_SCHEME: envField.string({ context: 'server', access: 'secret' }),
|
||||||
ARTALK_HOST: envField.string({ context: 'server', access: 'secret' }),
|
ARTALK_HOST: envField.string({ context: 'server', access: 'secret' }),
|
||||||
|
ARTALK_PORT: envField.number({ context: 'server', access: 'secret' }),
|
||||||
},
|
},
|
||||||
validateSecrets: true,
|
validateSecrets: true,
|
||||||
},
|
},
|
||||||
|
@ -2,7 +2,7 @@ import type { Comment, CommentItem, CommentReq, CommentResp, Comments, ErrorResp
|
|||||||
import { queryUser } from '@/helpers/db/query';
|
import { queryUser } from '@/helpers/db/query';
|
||||||
import { urlJoin } from '@/helpers/tools';
|
import { urlJoin } from '@/helpers/tools';
|
||||||
import options from '@/options';
|
import options from '@/options';
|
||||||
import { ARTALK_HOST } from 'astro:env/server';
|
import { ARTALK_HOST, ARTALK_PORT, ARTALK_SCHEME } from 'astro:env/server';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { marked } from 'marked';
|
import { marked } from 'marked';
|
||||||
import querystring from 'node:querystring';
|
import querystring from 'node:querystring';
|
||||||
@ -10,7 +10,7 @@ import { ELEMENT_NODE, transform, walk } from 'ultrahtml';
|
|||||||
import sanitize from 'ultrahtml/transformers/sanitize';
|
import sanitize from 'ultrahtml/transformers/sanitize';
|
||||||
|
|
||||||
// Access the artalk in internal docker host when it was deployed on zeabur.
|
// Access the artalk in internal docker host when it was deployed on zeabur.
|
||||||
const server = options.isProd() ? `http://${ARTALK_HOST}:23366` : `https://${ARTALK_HOST}`;
|
const server = `${ARTALK_SCHEME}://${ARTALK_HOST}:${ARTALK_PORT}`;
|
||||||
|
|
||||||
export const loadComments = async (key: string, title: string | null, offset: number): Promise<Comments | null> => {
|
export const loadComments = async (key: string, title: string | null, offset: number): Promise<Comments | null> => {
|
||||||
let params: Record<string, string | number | boolean> = {
|
let params: Record<string, string | number | boolean> = {
|
||||||
|
Loading…
Reference in New Issue
Block a user