feat(images): default frontend assets to image service
This commit is contained in:
@@ -77,7 +77,7 @@ const encodeIconPath = (picture: string): string => picture.split('/').map(encod
|
||||
|
||||
const buildPictureUrl = (ctx: GatewayApiContext, picture: string, imageServer: number): string =>
|
||||
imageServer === 1
|
||||
? `${ctx.userIconPublicUrl.replace(/\/$/, '')}/${encodeURIComponent(picture)}`
|
||||
? `${ctx.userIconPublicUrl.replace(/\/$/, '')}/${encodeIconPath(picture)}`
|
||||
: `${ctx.sharedIconPublicUrl.replace(/\/$/, '')}/${encodeIconPath(picture)}`;
|
||||
|
||||
const buildIconUrl = (ctx: GatewayApiContext, user: UserRecord): string | null => {
|
||||
|
||||
@@ -95,10 +95,9 @@ export const resolveGatewayApiConfigFromEnv = (env: NodeJS.ProcessEnv = process.
|
||||
kakaoRedirectUri,
|
||||
publicBaseUrl,
|
||||
userIconDir: env.GATEWAY_USER_ICON_DIR ?? 'uploads/user-icons',
|
||||
userIconPublicUrl: env.GATEWAY_USER_ICON_PUBLIC_URL ?? `${publicBaseUrl.replace(/\/$/, '')}/user-icons`,
|
||||
userIconPublicUrl: env.GATEWAY_USER_ICON_PUBLIC_URL ?? 'https://sam-image.hided.net/icons',
|
||||
imageUploadBaseUrl: env.GATEWAY_IMAGE_UPLOAD_URL ?? 'https://sam-image.hided.net',
|
||||
imageUploadSecretFile:
|
||||
env.GATEWAY_IMAGE_UPLOAD_SECRET_FILE ?? '/run/secrets/image_upload_core2026_secret',
|
||||
imageUploadSecretFile: env.GATEWAY_IMAGE_UPLOAD_SECRET_FILE ?? '/run/secrets/image_upload_core2026_secret',
|
||||
sharedIconPublicUrl: env.GATEWAY_SHARED_ICON_PUBLIC_URL ?? 'https://sam-image.hided.net/icons',
|
||||
adminLocalAccountEnabled: parseBooleanWithFallback(env.GATEWAY_ADMIN_LOCAL_ACCOUNT_ENABLED, false),
|
||||
localRegistrationEnabled: parseBooleanWithFallback(env.GATEWAY_LOCAL_REGISTRATION_ENABLED, true),
|
||||
|
||||
@@ -77,7 +77,7 @@ export const createGatewayApiContext = (options: {
|
||||
oauthSessions: options.oauthSessions,
|
||||
publicBaseUrl: options.publicBaseUrl,
|
||||
userIconDir: options.userIconDir ?? 'uploads/user-icons',
|
||||
userIconPublicUrl: options.userIconPublicUrl ?? `${options.publicBaseUrl.replace(/\/$/, '')}/user-icons`,
|
||||
userIconPublicUrl: options.userIconPublicUrl ?? 'https://sam-image.hided.net/icons',
|
||||
sharedIconPublicUrl: options.sharedIconPublicUrl ?? 'https://sam-image.hided.net/icons',
|
||||
userIconUpload: options.userIconUpload,
|
||||
adminLocalAccountEnabled: options.adminLocalAccountEnabled,
|
||||
|
||||
Reference in New Issue
Block a user