build: fix selfhost config

This commit is contained in:
LongYinan
2024-02-27 23:13:13 +08:00
parent d34eb2cbe5
commit 428a2b67cb
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
services: services:
affine: affine:
image: ghcr.io/toeverything/affine-graphql:beta image: ghcr.io/toeverything/affine-graphql:stable
container_name: affine_selfhosted container_name: affine_selfhosted
command: command:
['sh', '-c', 'node ./scripts/self-host-predeploy && node ./dist/index.js'] ['sh', '-c', 'node ./scripts/self-host-predeploy && node ./dist/index.js']
@@ -23,7 +23,7 @@ services:
max-size: '1000m' max-size: '1000m'
restart: unless-stopped restart: unless-stopped
environment: environment:
- NODE_OPTIONS=--es-module-specifier-resolution node - NODE_OPTIONS=--es-module-specifier-resolution=node
- AFFINE_CONFIG_PATH=/root/.affine/config - AFFINE_CONFIG_PATH=/root/.affine/config
- REDIS_SERVER_HOST=redis - REDIS_SERVER_HOST=redis
- DATABASE_URL=postgres://affine:affine@postgres:5432/affine - DATABASE_URL=postgres://affine:affine@postgres:5432/affine
@@ -21,12 +21,12 @@ class CustomAttachmentService extends AttachmentService {
} }
function customLoadFonts(service: PageService): void { function customLoadFonts(service: PageService): void {
const officialDomains = new Set(['affine.pro', 'affine.fail']); const officialDomains = new Set(['app.affine.pro', 'affine.fail']);
if (!officialDomains.has(window.location.host)) { if (!officialDomains.has(window.location.host)) {
const fonts = CanvasTextFonts.map(font => ({ const fonts = CanvasTextFonts.map(font => ({
...font, ...font,
// self-hosted fonts are served from /assets // self-hosted fonts are served from /assets
url: '/assets' + new URL(font.url).pathname.split('/').pop(), url: '/assets/' + new URL(font.url).pathname.split('/').pop(),
})); }));
service.fontLoader.load(fonts); service.fontLoader.load(fonts);
} else { } else {