mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-06 11:59:51 +08:00
build: fix selfhost config
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user