Skip to content
Merged
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
23 changes: 0 additions & 23 deletions .docker/selfhost/.env.example

This file was deleted.

36 changes: 13 additions & 23 deletions .docker/selfhost/compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: affine
services:
affine:
image: ghcr.io/toeverything/affine:${AFFINE_REVISION:-stable}
image: ghcr.io/toeverything/affine:stable
container_name: affine_server
ports:
- '${PORT:-3010}:3010'
- '3010:3010'
Comment thread
darkskygit marked this conversation as resolved.
depends_on:
redis:
condition: service_healthy
Expand All @@ -13,30 +13,24 @@ services:
affine_migration:
condition: service_completed_successfully
volumes:
# custom configurations
- ${UPLOAD_LOCATION}:/root/.affine/storage
- ${CONFIG_LOCATION}:/root/.affine/config
env_file:
- .env
- ./data/storage:/root/.affine/storage
- ./config:/root/.affine/config
environment:
- REDIS_SERVER_HOST=redis
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
- DATABASE_URL=postgresql://affine@postgres:5432/affine
Comment thread
darkskygit marked this conversation as resolved.
- AFFINE_INDEXER_ENABLED=false
restart: unless-stopped

affine_migration:
image: ghcr.io/toeverything/affine:${AFFINE_REVISION:-stable}
image: ghcr.io/toeverything/affine:stable
container_name: affine_migration_job
volumes:
# custom configurations
- ${UPLOAD_LOCATION}:/root/.affine/storage
- ${CONFIG_LOCATION}:/root/.affine/config
- ./data/storage:/root/.affine/storage
- ./config:/root/.affine/config
command: ['sh', '-c', 'node ./scripts/self-host-predeploy.js']
env_file:
- .env
environment:
- REDIS_SERVER_HOST=redis
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
- DATABASE_URL=postgresql://affine@postgres:5432/affine
- AFFINE_INDEXER_ENABLED=false
depends_on:
postgres:
Expand All @@ -58,18 +52,14 @@ services:
image: pgvector/pgvector:pg16
container_name: affine_postgres
volumes:
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
- ./data/postgres:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE:-affine}
POSTGRES_USER: affine
POSTGRES_DB: affine
POSTGRES_INITDB_ARGS: '--data-checksums'
# you better set a password for you database
# or you may add 'POSTGRES_HOST_AUTH_METHOD=trust' to ignore postgres security policy
POSTGRES_HOST_AUTH_METHOD: trust
healthcheck:
test:
['CMD', 'pg_isready', '-U', "${DB_USERNAME}", '-d', "${DB_DATABASE:-affine}"]
test: ['CMD', 'pg_isready', '-U', 'affine', '-d', 'affine']
interval: 10s
timeout: 5s
retries: 5
Expand Down
14 changes: 14 additions & 0 deletions .docker/selfhost/config.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://github.com/toeverything/affine/releases/latest/download/config.schema.json",
Comment thread
darkskygit marked this conversation as resolved.
"server": {
"name": "AFFiNE Self-hosted",
"externalUrl": "http://localhost:3010"
},
"copilot": {
"enabled": true,
"byok": {
"enabled": true,
"allowCustomEndpoint": true
}
}
}
8 changes: 4 additions & 4 deletions .docker/selfhost/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1140,17 +1140,17 @@
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether to enable the copilot plugin. <br> Document: <a href=\"https://docs.affine.pro/self-host-affine/administer/ai\" target=\"_blank\">https://docs.affine.pro/self-host-affine/administer/ai</a>\n@default false",
"description": "Enable AI features. Workspace owners configure provider keys in Workspace Settings → Integrations → AI BYOK.\n@default false",
"default": false
},
"byok.enabled": {
"type": "boolean",
"description": "Whether to enable workspace BYOK.\n@default true",
"description": "Allow workspace owners and admins to configure AI provider keys through AI BYOK.\n@default true",
"default": true
},
"byok.allowedProviders": {
"type": "array",
"description": "The allowlist for workspace BYOK providers.\n@default [\"openai\",\"anthropic\",\"gemini\",\"fal\"]",
"description": "AI providers that workspace owners and admins may add through AI BYOK.\n@default [\"openai\",\"anthropic\",\"gemini\",\"fal\"]",
"default": [
"openai",
"anthropic",
Expand All @@ -1160,7 +1160,7 @@
},
"byok.allowCustomEndpoint": {
"type": "boolean",
"description": "Whether workspace BYOK custom endpoints are accepted.\n@default false",
"description": "Allow AI BYOK keys to use a custom provider endpoint.\n@default false",
"default": false
},
"byok.allowPrivateEndpoint": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ jobs:
- name: Copy Selfhost Release Files
run: |
cp ./.docker/selfhost/compose.yml ./release/docker-compose.yml
cp ./.docker/selfhost/.env.example ./release/.env.example
cp ./.docker/selfhost/config.json.example ./release/config.json.example
cp ./.docker/selfhost/schema.json ./release/config.schema.json
- name: Generate Release yml
run: |
Expand Down
8 changes: 4 additions & 4 deletions packages/backend/server/src/plugins/copilot/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,21 @@ declare global {

defineModuleConfig('copilot', {
enabled: {
desc: 'Whether to enable the copilot plugin. <br> Document: <a href="https://docs.affine.pro/self-host-affine/administer/ai" target="_blank">https://docs.affine.pro/self-host-affine/administer/ai</a>',
desc: 'Enable AI features. Workspace owners configure provider keys in Workspace Settings → Integrations → AI BYOK.',
default: false,
},
'byok.enabled': {
desc: 'Whether to enable workspace BYOK.',
desc: 'Allow workspace owners and admins to configure AI provider keys through AI BYOK.',
default: true,
shape: z.boolean(),
},
'byok.allowedProviders': {
desc: 'The allowlist for workspace BYOK providers.',
desc: 'AI providers that workspace owners and admins may add through AI BYOK.',
default: ['openai', 'anthropic', 'gemini', 'fal'],
shape: z.array(z.enum(['openai', 'anthropic', 'gemini', 'fal'])),
},
'byok.allowCustomEndpoint': {
desc: 'Whether workspace BYOK custom endpoints are accepted.',
desc: 'Allow AI BYOK keys to use a custom provider endpoint.',
default: false,
shape: z.boolean(),
},
Expand Down
10 changes: 6 additions & 4 deletions packages/frontend/admin/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ export const Workspaces = lazy(
export const Queue = lazy(
() => import(/* webpackChunkName: "queue" */ './modules/queue')
);
export const AI = lazy(
() => import(/* webpackChunkName: "ai" */ './modules/ai')
);
export const About = lazy(
() => import(/* webpackChunkName: "about" */ './modules/about')
);
Expand Down Expand Up @@ -131,7 +128,12 @@ export const App = () => {
}
/>
<Route path={`${ROUTES.admin.queue}/*`} element={<Queue />} />
<Route path={ROUTES.admin.ai} element={<AI />} />
<Route
path={ROUTES.admin.ai}
element={
<Navigate to={ROUTES.admin.settings.index} replace />
}
/>
<Route path={ROUTES.admin.about} element={<About />} />
<Route
path={ROUTES.admin.settings.index}
Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/admin/src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,19 +367,19 @@
"copilot": {
"enabled": {
"type": "Boolean",
"desc": "Whether to enable the copilot plugin. <br> Document: <a href=\"https://docs.affine.pro/self-host-affine/administer/ai\" target=\"_blank\">https://docs.affine.pro/self-host-affine/administer/ai</a>"
"desc": "Enable AI features. Workspace owners configure provider keys in Workspace Settings → Integrations → AI BYOK."
},
"byok.enabled": {
"type": "Boolean",
"desc": "Whether to enable workspace BYOK."
"desc": "Allow workspace owners and admins to configure AI provider keys through AI BYOK."
},
"byok.allowedProviders": {
"type": "Array",
"desc": "The allowlist for workspace BYOK providers."
"desc": "AI providers that workspace owners and admins may add through AI BYOK."
},
"byok.allowCustomEndpoint": {
"type": "Boolean",
"desc": "Whether workspace BYOK custom endpoints are accepted."
"desc": "Allow AI BYOK keys to use a custom provider endpoint."
},
"byok.allowPrivateEndpoint": {
"type": "Boolean",
Expand Down
50 changes: 0 additions & 50 deletions packages/frontend/admin/src/modules/ai/index.tsx

This file was deleted.

69 changes: 0 additions & 69 deletions packages/frontend/admin/src/modules/ai/keys.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions packages/frontend/admin/src/modules/nav/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ export function Nav({ isCollapsed = false }: NavProps) {
label="Queue"
isCollapsed={isCollapsed}
/>
{/* <NavItem
to="/admin/ai"
icon={<AiOutlineIcon fontSize={20} />}
label="AI"
isCollapsed={isCollapsed}
/> */}
<SettingsItem isCollapsed={isCollapsed} />
<NavItem
to={ROUTES.admin.about}
Expand Down
Loading
Loading