<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>软件推荐 &#8211; Antonio</title>
	<atom:link href="/tag/%E8%BD%AF%E4%BB%B6%E6%8E%A8%E8%8D%90/feed/" rel="self" type="application/rss+xml" />
	<link>https://nstar.ltd</link>
	<description></description>
	<lastBuildDate>Thu, 11 Dec 2025 17:28:07 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>AFFINE AI——一个完美替代Notion AI的本地部署笔记软件</title>
		<link>/affine-ai-%e4%b8%80%e4%b8%aa%e5%ae%8c%e7%be%8e%e6%9b%bf%e4%bb%a3notion-ai%e7%9a%84%e6%9c%ac%e5%9c%b0%e9%83%a8%e7%bd%b2%e7%ac%94%e8%ae%b0%e8%bd%af%e4%bb%b6/</link>
					<comments>/affine-ai-%e4%b8%80%e4%b8%aa%e5%ae%8c%e7%be%8e%e6%9b%bf%e4%bb%a3notion-ai%e7%9a%84%e6%9c%ac%e5%9c%b0%e9%83%a8%e7%bd%b2%e7%ac%94%e8%ae%b0%e8%bd%af%e4%bb%b6/#respond</comments>
		
		<dc:creator><![CDATA[Antonio]]></dc:creator>
		<pubDate>Thu, 11 Dec 2025 17:28:06 +0000</pubDate>
				<category><![CDATA[博客]]></category>
		<category><![CDATA[软件推荐]]></category>
		<guid isPermaLink="false">/?p=281</guid>

					<description><![CDATA[引言：AppFlowy-Cloud踩坑，原先是想用appflowy的，无奈cloud本地部署踩坑太多，此前对于 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>引言：AppFlowy-Cloud踩坑，原先是想用appflowy的，无奈cloud本地部署踩坑太多，此前对于docker-compose配置不太熟悉，故AI咋说我咋做，一做一个不吱声<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f62d.png" alt="😭" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>首先：认识docker-compose</p>



<p>可以通过docker-compose文件直接将所需的docker镜像安装、配置部署。</p>



<p>具体教程可直接参考：</p>



<p><a href="https://blog.lcayun.com/4277.html">Docker 一键部署 AFFiNE 教程：开源 Notion + Miro 替代，打造私有知识库</a></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">1 <strong>搭建方式</strong></h2>



<h3 class="wp-block-heading">1.1 <strong>安装docker和docker-compose</strong></h3>



<h3 class="wp-block-heading">1.2 <strong>获取 Docker Compose 文件和.env文件</strong></h3>



<pre class="wp-block-code"><code>#定义了 AFFiNE 容器、端口映射和卷挂载
wget -O docker-compose.yml https://github.com/toeverything/affine/releases/latest/download/docker-compose.yml</code></pre>



<pre class="wp-block-code"><code>#自动下载示例 .env 文件
wget -O .env https://github.com/toeverything/affine/releases/latest/download/default.env.example</code></pre>



<h3 class="wp-block-heading">1.3 修改docker-compose.yml和.env配置</h3>



<p>通用配置：</p>



<p>（仅需要添加DB数据库密码配置即可）</p>



<p>.env文件</p>



<pre class="wp-block-code"><code># select a revision to deploy, available values: stable, beta, canary
AFFINE_REVISION=stable

# set the port for the server container it will expose the server on
PORT=3010

# set the host for the server for outgoing links
# AFFINE_SERVER_HTTPS=true
# AFFINE_SERVER_HOST=affine.yourdomain.com
# or 
# AFFINE_SERVER_EXTERNAL_URL=https://affine.yourdomain.com

# position of the database data to persist
DB_DATA_LOCATION=~/.affine/self-host/postgres/pgdata
# position of the upload data(images, files, etc.) to persist
UPLOAD_LOCATION=~/.affine/self-host/storage
# position of the configuration files to persist
CONFIG_LOCATION=~/.affine/self-host/config

# database credentials
DB_USERNAME=affine
DB_PASSWORD=affine
DB_DATABASE=affine
</code></pre>



<p>docker-compose.yml文件</p>



<pre class="wp-block-code"><code>name: affine
services:
  affine:
    image: ghcr.io/toeverything/affine:${AFFINE_REVISION:-stable}
    container_name: affine_server
    ports:
      - '${PORT:-3010}:3010'
    depends_on:
      redis:
        condition: service_healthy
      postgres:
        condition: service_healthy
      affine_migration:
        condition: service_completed_successfully
    volumes:
      # custom configurations
      - ${UPLOAD_LOCATION}:/root/.affine/storage
      - ${CONFIG_LOCATION}:/root/.affine/config
    env_file:
      - .env
    environment:
      - REDIS_SERVER_HOST=redis
      - DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
      - AFFINE_INDEXER_ENABLED=false
    restart: unless-stopped

  affine_migration:
    image: ghcr.io/toeverything/affine:${AFFINE_REVISION:-stable}
    container_name: affine_migration_job
    volumes:
      # custom configurations
      - ${UPLOAD_LOCATION}:/root/.affine/storage
      - ${CONFIG_LOCATION}:/root/.affine/config
    command: &#91;'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}
      - AFFINE_INDEXER_ENABLED=false
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy

  redis:
    image: redis
    container_name: affine_redis
    healthcheck:
      test: &#91;'CMD', 'redis-cli', '--raw', 'incr', 'ping']
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped

  postgres:
    image: pgvector/pgvector:pg16
    container_name: affine_postgres
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_DB: ${DB_DATABASE:-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:
        &#91;'CMD', 'pg_isready', '-U', "${DB_USERNAME}", '-d', "${DB_DATABASE:-affine}"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
</code></pre>



<h3 class="wp-block-heading">1.4 启动dokcer</h3>



<pre class="wp-block-code"><code># 启动docker
docker compose up -d

# 重启docker
docker compose stop
docker compose start

# 升级docker
docker compose down
docker compose pull
docker compose up -d</code></pre>



<h3 class="wp-block-heading">1.5<strong> 访问AFFiNE</strong></h3>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1024" height="484" src="/wp-content/uploads/2025/12/image-1.png" alt="" class="wp-image-283" srcset="/wp-content/uploads/2025/12/image-1.png 1024w, /wp-content/uploads/2025/12/image-1-300x142.png 300w, /wp-content/uploads/2025/12/image-1-768x363.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>然后自行创建用户</p>



<p>(设置中文)</p>



<p>更多使用跟介绍可以看看官方文档：<a href="https://docs.affine.pro/self-host-affine/administer/indexer">https://docs.affine.pro/self-host-affine/administer/indexer</a></p>



<h3 class="wp-block-heading">遗留问题</h3>



<p>用户无法通过自行通过邮箱注册账号，只能在管理员界面新建用户</p>



<p>发送验证码邮件时，affine-sever日志会显示<strong>SMTP——500</strong>的错误码</p>



<h1 class="wp-block-heading">迁移Affine服务</h1>



<ol class="wp-block-list">
<li>需备份好以下三个文件夹，然后迁移：</li>
</ol>



<figure class="wp-block-image size-full"><img decoding="async" width="179" height="121" src="/wp-content/uploads/2025/12/image.png" alt="" class="wp-image-282"/></figure>



<ol class="wp-block-list">
<li>需保持数据库账号密码一致，否则无法访问（其他默认）</li>



<li>新服务器登录直接使用原来设置的账号</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>AI服务：</p>



<p>当前使用国内转接：poloai。参考以下配置gemini：</p>



<pre class="wp-block-code"><code>{
"model":"gemini-2.0-flash",
"apiKey":"sk-************",
"baseURL":"https://poloai.top/v1"
}</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>/affine-ai-%e4%b8%80%e4%b8%aa%e5%ae%8c%e7%be%8e%e6%9b%bf%e4%bb%a3notion-ai%e7%9a%84%e6%9c%ac%e5%9c%b0%e9%83%a8%e7%bd%b2%e7%ac%94%e8%ae%b0%e8%bd%af%e4%bb%b6/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
