2025-04-17 06:33:23
immich虽然开源又好用,但如果你的照片和视频文件很珍贵,在使用immich时请做好备份。原因就如官方项目页面所说:
The project is under very active development.
Expect bugs and breaking changes.
Do not use the app as the only way to store your photos and videos.
这是immich目前最大的问题,除了这个真没啥毛病可挑了。。。
之前immich还有个小瓜,大概就是开发人员想恰米,搞什么收费模式,结果被红迪的用户硬生生给怼回去了,然后就不提这事了,取而代之的是搞了个类似“捐赠”的购买界面,你虽然花钱买了immich但是没有任何额外的功能和好处,哈哈
要是当时开发人员刚一点,估计现在的immich就分家了,绝对有人fork开个分支出来继续维护= =
安装需要用到的包:
apt -y update apt -y install curl wget nginx python3-certbot-nginx curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh
创建目录、下载compose文件以及环境变量配置文件:
mkdir -p /opt/immich && cd /opt/immich wget -O docker-compose.yml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env
编辑环境变量配置文件:
nano .env
只需修改下面的内容:
TZ=Asia/Shanghai DB_PASSWORD=pgpassword
启动immich:
docker compose up -d
配置NGINX反向代理:
nano /etc/nginx/sites-available/immich
写入如下内容:
server { listen 80; server_name immich.example.com; # allow large file uploads client_max_body_size 50000M; # Set headers proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # enable websockets: http://nginx.org/en/docs/http/websocket.html proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_redirect off; # set timeout proxy_read_timeout 600s; proxy_send_timeout 600s; send_timeout 600s; location / { proxy_pass http://127.0.0.1:2283; } }
启用站点:
ln -s /etc/nginx/sites-available/immich /etc/nginx/sites-enabled/immich
签发SSL证书:
certbot --nginx
优化中文以文搜图,使用nllb-clip-large-siglip__v1模型:
也可以用nllb-clip-base-siglip__v1模型,这个模型执行时间短一些,但效果差一点。
导入外部图库(图片)如果你有的话。编辑compose文件:
nano docker-compose.yml
先使用bind mount挂载你的外部图库到容器内:
... services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /home/debian/photo:/mnt/photo:ro # 在这里挂载你的外部图库,你还可以添加更多 - /your/photo/path:/mnt/photo2:ro # 第二个外部图库 - /etc/localtime:/etc/localtime:ro ...
然后重启immich:
docker compose up -d
在immich系统管理界面->外部图库->创建图库,填写容器内的路径:
别忘记保存:
最后执行一次扫描就导入成功了:
需要注意的是在挂载的时候添加了:ro标志,这表示即便你在immich内删除了外部图库的照片,但照片文件本身是不会被删除的,依旧保留在磁盘上。如果你想要immich能够直接删除文件可以去掉:ro标志。
2025-04-14 11:26:26
最近尝试了很多开源的笔记程序,说实话个人目前觉得AFFiNE最好用。我简单和Appflowy比较下吧,因为我之前还部署了一个Appflowy试了下来着。。
Appflowy的Win客户端对中文字体的支持真的是一言难尽,一会粗一会细,眼睛都看花了,可能是因为他们的客户端是用Flutter开发的原因吧。。
再就是Appflowy的搜索功能感觉不太行,它那个搜索功能是依赖AI的,对于文档里面的AI支持似乎用的是Claude,但是Claude那个API的价格太TM贵了。。反正我当时只配置了一个OpenAI的API就只能用搜索,文档里面的AI功能用不了,然后我就没试了。后来我发现他们的客户端支持本地LLM,可以用Ollama,但是我主要使用Web客户端偶尔才用Win。。
其实最重要的是我觉得AFFiNE的Web界面设计的真的非常精细,怎么说呢,给人一种很精致的感觉,相比较Appflowy的Web界面就显得有些粗糙了,没有AFFiNE美观(细腻)。
Appflowy部署起来也比AFFiNE麻烦不少,那个环境变量的配置文件,你不花个把小时阅读真的搞不清楚它的整个架构是怎样的。。
AFFiNE也不是完美的,目前使用下来也发现一些问题,但基本不影响我个人的体验。
AFFiNE目前自托管的版本只支持10个成员,但我就一个人用= =对于我来说没有任何影响。
AFFiNE似乎有一个100GB的存储空间限制,但是我看官方在Github的回复又说实际是没有限制的,只是界面上故意这么显示为了与他们的付费产品保持一致。。这个可能得等到我用满100GB空间后再说了,不过有一说一看着这个100GB的限制心里多少还是有点膈应的。。。
废话不多说了,下面就记录下部署和配置过程,首先安装好Docker和需要用到的软件包:
apt -y update apt -y install curl nginx python3-certbot-nginx curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh
创建目录并下载compose文件:
mkdir -p /opt/affine && cd /opt/affine wget -O compose.yml https://github.com/toeverything/affine/releases/latest/download/docker-compose.yml
新建一个环境变量配置文件:
nano .env
写入如下内容:
# 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.example.com # or # AFFINE_SERVER_EXTERNAL_URL=https://affine.example.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=pgpassword DB_DATABASE=affine
启动:
docker compose up -d
配置NGINX反向代理:
nano /etc/nginx/sites-available/affine
写入如下内容:
server { listen 80; server_name affine.example.com; client_max_body_size 0; location / { proxy_pass http://127.0.0.1:3010; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
启用站点:
ln -s /etc/nginx/sites-available/affine /etc/nginx/sites-enabled/affine
签发SSL证书:
certbot --nginx
访问affine.example.com创建管理员账号:
接下来配置AFFiNE的AI功能,以下配置方法在当前最新版本(0.21.2)测试可用。
首先在https://auth.openai.com/log-in创建API KEY。
创建API KEY免费,但是使用是收费的哈,必须先往里面充至少5USD。怎么充这里就不详细说了,稍微提一嘴,现在很多U卡(虚拟卡)都标榜支持OpenAI。。
进入如下目录:
cd /opt/affine/.affine/self-host/config/
在这个目录内新建一个json配置文件:
nano config.json
写入如下内容,将sk-proj-***替换为你的API KEY:
{ "copilot": { "enabled": true, "providers.openai": { "apiKey": "sk-proj-***" } } }
之后访问affine.example.com/admin管理面板,修改如下配置:
重启AFFiNE:
docker compose down docker compose up -d
效果:
2025-04-04 19:49:57
Outline介绍(摘自项目官方页面)
The fastest knowledge base for growing teams. Beautiful, realtime collaborative, feature packed, and markdown compatible.
安装好Docker和需要用到的软件包:
apt -y update apt -y install curl nginx python3-certbot-nginx curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh
创建目录和compose文件:
mkdir -p /opt/outline && cd /opt/outline && nano docker-compose.yml
写入如下内容:
name: Outline services: outline: image: docker.getoutline.com/outlinewiki/outline:latest container_name: outline restart: unless-stopped depends_on: redis: condition: service_healthy postgres: condition: service_healthy env_file: ./docker.env ports: - "127.0.0.1:3000:3000" volumes: - ./outline-data:/var/lib/outline/data postgres: image: postgres:16-alpine container_name: outline-postgres restart: unless-stopped environment: POSTGRES_USER: 'imlala' POSTGRES_PASSWORD: 'pgpassword' POSTGRES_DB: 'outline' volumes: - ./db-data:/var/lib/postgresql/data healthcheck: test: ["CMD", "pg_isready", "-d", "outline", "-U", "imlala"] interval: 30s timeout: 20s retries: 3 redis: image: redis container_name: outline-redis restart: unless-stopped healthcheck: test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping'] interval: 10s timeout: 5s retries: 5
新建环境变量配置文件:
nano docker.env
写入如下内容:
NODE_ENV=production SECRET_KEY=hidden UTILS_SECRET=hidden DATABASE_URL=postgres://imlala:pgpassword@postgres:5432/outline # 注意修改数据库用户名和密码 DATABASE_CONNECTION_POOL_MIN= #留空 DATABASE_CONNECTION_POOL_MAX= #留空 PGSSLMODE=disable REDIS_URL=redis://redis:6379 URL=https://outline.example.com # 注意修改域名 PORT=3000 COLLABORATION_URL= # 留空 FILE_STORAGE=local FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data FILE_STORAGE_UPLOAD_MAX_SIZE=262144000 FILE_STORAGE_IMPORT_MAX_SIZE= # 留空 FILE_STORAGE_WORKSPACE_IMPORT_MAX_SIZE= # 留空 FORCE_HTTPS=true ENABLE_UPDATES=false WEB_CONCURRENCY=2 DEFAULT_LANGUAGE=zh_CN
SECRET_KEY、UTILS_SECRET使用如下命令生成:
openssl rand -hex 32
创建outline存储数据的目录:
mkdir outline-data
修改目录的权限解决头像、附件等文件无法上传的问题:
chown 1001 outline-data
接下来需要配置一个外部身份验证,这里我用的是Logto。Logto的部署与配置可以参考我的这篇文章:
登录到Logto的管理后台,创建Outline应用:
填写应用名称和描述:
填写重定向URI,假设你的Outline域名是:https://outline.example.com。
这里就填写为:https://outline.example.com/auth/oidc.callback
然后根据提示需要我们配置相关的环境变量:
所以再次编辑Outline环境变量配置文件:
nano docker.env
添加以下配置:
OIDC_CLIENT_ID=hidden OIDC_CLIENT_SECRET=hidden OIDC_AUTH_URI=https://logto-api.example.com/oidc/auth OIDC_TOKEN_URI=https://logto-api.example.com/oidc/token OIDC_USERINFO_URI=https://logto-api.example.com/oidc/me OIDC_USERNAME_CLAIM=username OIDC_DISPLAY_NAME=Logto OIDC_SCOPES=openid profile email
只按照Logto的提示配置的话,我发现后续使用的过程中用户无法退出登录,还需要添加以下配置:
OIDC_DISABLE_REDIRECT=true OIDC_LOGOUT_URI=https://logto-api.example.com/oidc/session/end
接下来还需要在Logto配置SMTP连接器:
按下图配置SMTP服务器相关信息,使用587端口发信只需要配置这4个必填项即可,其他的设置不用管:
之后找到登录体验:
按照下图进行设置:
至此Logto的配置就全部完成了。现在我们启动Outline:
docker compose up -d
配置NGINX反向代理,新建NGINX站点配置文件:
nano /etc/nginx/sites-available/outline
写入如下内容:
server { listen 80; server_name outline.example.com; client_max_body_size 0; location / { proxy_pass http://127.0.0.1:3000/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Scheme $scheme; proxy_set_header X-Forwarded-Proto $scheme; # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
启用站点:
ln -s /etc/nginx/sites-available/outline /etc/nginx/sites-enabled/outline
签发SSL证书:
certbot --nginx
访问Outline注册账号,如果正常的话会跳转到Logto:
如果一切正常的话,就能登录到Outline了:
自己的账号注册完成后,可以在Logto->登录体验->高级选项,关闭注册:
参考:
https://docs.getoutline.com/s/hosting/doc/oidc-8CPBm6uC0I
https://docs.logto.io/end-user-flows/sign-out#clear-sign-in-session-at-logto
https://docs.getoutline.com/s/hosting/doc/nginx-6htaRboR57
https://docs.getoutline.com/s/hosting/doc/file-storage-N4M0T6Ypu7#h-file-system-folder
https://docs.getoutline.com/s/hosting/doc/docker-7pfeLP5a8t
2025-04-04 19:48:49
Logto项目介绍(摘自官方项目页面)
Logto is the open-source auth alternative to Auth0, Cognito, and Firebase Auth. It offers a complete identity solution with pre-built UI, modern protocols for authentication and authorization (OIDC/OAuth 2.0/SAML), and enterprise-grade security. Perfect for multi-device apps, SaaS products, and API services.
安装好Docker和需要用到的包:
apt -y update apt -y install curl nginx python3-certbot-nginx curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh
创建目录和compose文件:
mkdir -p /opt/logto && cd /opt/logto && nano docker-compose.yml
写入如下内容:
name: logto.io services: app: image: svhd/logto:latest container_name: logto-server restart: unless-stopped depends_on: postgres: condition: service_healthy environment: - TRUST_PROXY_HEADER=1 - DB_URL=postgres://imlala:pgpassword@postgres:5432/logto - ENDPOINT=https://logto-api.example.com - ADMIN_ENDPOINT=https://logto-admin.example.com ports: - "127.0.0.1:3001:3001" - "127.0.0.1:3002:3002" entrypoint: ["sh", "-c", "npm run cli db seed -- --swe && npm start"] postgres: image: postgres:17-alpine container_name: logto-postgres restart: unless-stopped environment: POSTGRES_USER: imlala POSTGRES_PASSWORD: pgpassword POSTGRES_DB: logto volumes: - ./db-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready"] interval: 10s timeout: 5s retries: 5
启动:
docker compose up -d
配置NGINX反向代理,需要反代API和管理面板。
新建反代API的NGINX配置文件:
nano /etc/nginx/sites-available/logto
写入如下配置:
server { listen 80; server_name logto-api.example.com; client_max_body_size 0; location / { proxy_pass http://127.0.0.1:3001; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
新建反代管理面板的NGINX配置文件:
nano /etc/nginx/sites-available/logto-admin
写入如下配置:
server { listen 80; server_name logto-admin.example.com; client_max_body_size 0; location / { proxy_pass http://127.0.0.1:3002; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
启用站点:
ln -s /etc/nginx/sites-available/logto /etc/nginx/sites-enabled/logto ln -s /etc/nginx/sites-available/logto-admin /etc/nginx/sites-enabled/logto-admin
签发SSL证书:
certbot --nginx
访问logto-admin.example.com,创建管理员账号:
2025-04-02 21:20:47
Ente是印度人开源的一套端到端加密平台服务,他们打算在这个平台内开发众多产品,目前平台内已经开发出了2个产品分别是:
Ente Photos(Apple和Google Photos的替代品)、Ente Auth(2FA应用程序)
这篇文章详细记录下部署过程,喜欢折腾的可以逝试。。。
由于他们的文档写的太拉稀了(估计是故意的,想让别人买他们的托管服务)导致整个部署过程中坑太多了,而且他们的这些个程序涉及到很多不同的组件又相互依赖,导致配置起来非常复杂,硬生生让我体验到了小时候拼积木的那种感觉。。。
说实话咖喱味有点重,到处糊,连文档都是这里糊一点那里糊一点。。。
其实当我部署完了后我压根就没有心情去用了,这么复杂的东西要我自托管,没出问题还好,要出了点问题修都不知道从哪里开始。。而且最重要的是Ente Photos这个程序,就我个人体验了一番后,真的觉得不如immich一根,我直接去用immich多好,省时又省力。。。
至于Ente Auth(2FA应用程序),这玩意谁去用自托管的啊,是Google身份验证器不香了嘛?你的小鸡再稳能有Google的稳?不怕哪天机子炸了把你全关门外了?我最多自托管个Bitwarden密码管理器,要我自托管2FA程序我觉得完全没必要,我又不是FBI,又不是国家机密人员。。。
不过有一说一,人家好歹开源了就是。。是真开源,非常完整的开源。。服务端、Web端、各种客户端(Android、iOS、Windows等)都开源了。。
纯当闲着没事瞎坤8折腾了。。
准备工作:
1、一个SMTP服务器,用于注册账号发验证码。
2、域名做好如下解析:
ente-museum.example.com (后端服务)
ente-web.example.com (Ente Photos的Web客户端)
ente-cast.example.com (为Ente Photos提供投屏幻灯片的功能)
ente-albums.example.com (为Ente Photos提供分享相册的功能)
ente-accounts.example.com (Passkey通行密钥,这也是一种2FA服务,这个和Ente Auth是分开的)
ente-auth.example.com (Ente Auth 2FA应用程序的Web客户端)
minio.example.com (minio对象存储API)
console.minio.example.com (minio对象存储控制台)
安装好Docker和需要用到的包:
apt -y update apt -y install curl wget nginx python3-certbot-nginx curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh
创建目录和compose文件:
mkdir -p /opt/ente.io && cd /opt/ente.io && nano docker-compose.yml
写入如下内容,需要修改的地方都写了注释:
name: ente.io services: museum: image: ghcr.io/ente-io/server:latest container_name: ente-museum restart: unless-stopped depends_on: postgres: condition: service_healthy ports: - "127.0.0.1:8080:8080" volumes: - ./museum.yaml:/museum.yaml:ro - ./ente-data:/data:ro web: image: ghcr.io/ente-io/web:latest container_name: ente-web restart: unless-stopped environment: ENTE_API_ORIGIN: https://ente-museum.example.com # 后端服务museum的域名 ENTE_ALBUMS_ORIGIN: https://ente-albums.example.com # 分享相册的域名 ports: - "127.0.0.1:3000:3000" # Photos web app - "127.0.0.1:3001:3001" # Accounts - "127.0.0.1:3003:3003" # Auth - "127.0.0.1:3004:3004" # Cast albums: image: ghcr.io/ente-io/web:latest container_name: ente-albums restart: unless-stopped environment: ENTE_API_ORIGIN: https://ente-museum.example.com # 后端服务museum的域名 ENTE_ALBUMS_ORIGIN: https://ente-albums.example.com # 分享相册的域名 ports: - "127.0.0.1:3002:3002" # Public albums socat: image: alpine/socat container_name: ente-socat restart: unless-stopped network_mode: service:museum depends_on: - museum command: "TCP-LISTEN:3200,fork,reuseaddr TCP:minio:3200" postgres: image: postgres:16 container_name: ente-postgres restart: unless-stopped environment: POSTGRES_USER: imlala # 数据库用户名 POSTGRES_PASSWORD: pgpassword # 数据库用户的密码 POSTGRES_DB: ente_db # 数据库名 volumes: - ./db-data:/var/lib/postgresql/data healthcheck: test: [ "CMD", "pg_isready", "-q", "-d", "ente_db", "-U", "pguser" ] start_period: 40s start_interval: 1s minio: image: minio/minio container_name: ente-minio restart: unless-stopped environment: MINIO_SERVER_URL: "https://minio.example.com" # MinIO对象存储API的域名 MINIO_BROWSER_REDIRECT_URL: "https://console.minio.example.com" # MinIO对象存储控制台的域名 MINIO_ROOT_USER: admin # MinIO对象存储用户名 MINIO_ROOT_PASSWORD: miniopassword # MinIO对象存储用户的密码 ports: - "127.0.0.1:3200:3200" - "127.0.0.1:3201:3201" volumes: - ./minio-data:/data command: server /data --address ":3200" --console-address ":3201" minio-provision: image: minio/mc container_name: ente-provision depends_on: - minio volumes: - ./minio-provision.sh:/provision.sh:ro - ./minio-data:/data entrypoint: sh /provision.sh
新建后端服务museum需要用到的配置文件:
nano museum.yaml
写入如下配置:
key: encryption: hidden hash: hidden jwt: secret: hidden apps: public-albums: https://ente-albums.example.com cast: https://ente-cast.example.com accounts: https://ente-accounts.example.com webauthn: rpid: ente-accounts.example.com rporigins: - "https://ente-accounts.example.com" #internal: # admins: # - hidden # disable-registration: true smtp: host: mail.example.com port: 587 username: smtp password: smtppassword email: [email protected] db: host: postgres port: 5432 name: ente_db user: imlala password: pgpassword s3: are_local_buckets: true b2-eu-cen: key: admin secret: miniopassword endpoint: https://minio.example.com region: eu-central-2 bucket: b2-eu-cen wasabi-eu-central-2-v3: key: admin secret: miniopassword endpoint: https://minio.example.com region: eu-central-2 bucket: wasabi-eu-central-2-v3 compliance: false scw-eu-fr-v3: key: admin secret: miniopassword endpoint: https://minio.example.com region: eu-central-2 bucket: scw-eu-fr-v3
注意事项:
1.配置文件内各种加密密钥的生成:
key生成:
head -c 32 /dev/urandom | base64 | tr -d '\n';
hash生成:
head -c 64 /dev/urandom | base64 | tr -d '\n';
jwt生成:
head -c 32 /dev/urandom | base64 | tr -d '\n' | tr '+/' '-_';
用生成好的内容替换掉上述配置文件内的hidden字符串。
2.s3存储的名字目前在配置文件内是硬编码的,不能修改,比如b2-eu-cen。但是实际的bucket的名字是可以改的。
3.如果不启用复制功能(默认情况下未启用),实际上只需要b2-eu-cen这一个bucket就够了,剩下的wasabi-eu-central-2-v3和scw-eu-fr-v3没有用到,数据是不会存储在里面的。
接下来还需要新建一个脚本文件:
nano minio-provision.sh
写入如下内容,用于初始化minio对象存储,创建需要用到的bucket等,注意修改脚本内的miniopassword密码为你自己的:
#!/bin/sh # Script used to prepare the minio instance that runs as part of the development # Docker compose cluster. while ! mc config host add h0 http://minio:3200 admin miniopassword do echo "waiting for minio..." sleep 0.5 done cd /data mc mb -p b2-eu-cen mc mb -p wasabi-eu-central-2-v3 mc mb -p scw-eu-fr-v3
给执行权限:
chmod +x minio-provision.sh
启动:
docker compose up -d
现在来配置NGINX反向代理。新建反向代理museum后端的配置文件:
nano /etc/nginx/sites-available/ente-museum
写入如下配置:
server { listen 80; server_name ente-museum.example.com; client_max_body_size 0; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
新建反向代理Ente Photos Web客户端的配置文件:
nano /etc/nginx/sites-available/ente-web
写入如下配置:
server { listen 80; server_name ente-web.example.com; client_max_body_size 0; location / { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
新建反向代理Ente Photos投屏幻灯片的配置文件:
nano /etc/nginx/sites-available/ente-cast
写入如下配置:
server { listen 80; server_name ente-cast.example.com; client_max_body_size 0; location / { proxy_pass http://127.0.0.1:3004; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
新建反向代理Ente Photos分享相册的配置文件:
nano /etc/nginx/sites-available/ente-albums
写入如下配置:
server { listen 80; server_name ente-albums.example.com; client_max_body_size 0; location / { proxy_pass http://127.0.0.1:3002; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
新建反向代理Passkey通行密钥的配置文件:
nano /etc/nginx/sites-available/ente-accounts
写入如下配置:
server { listen 80; server_name ente-accounts.example.com; client_max_body_size 0; location / { proxy_pass http://127.0.0.1:3001; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
新建反向代理Ente Auth Web客户端的配置文件:
nano /etc/nginx/sites-available/ente-auth
写入如下配置:
server { listen 80; server_name ente-auth.example.com; client_max_body_size 0; location / { proxy_pass http://127.0.0.1:3003; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # WebSocket support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
新建反向代理MinIO API的配置文件:
nano /etc/nginx/sites-available/minio
写入如下配置:
server { listen 80; server_name minio.example.com; ignore_invalid_headers off; client_max_body_size 0; proxy_buffering off; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_connect_timeout 300; proxy_http_version 1.1; proxy_set_header Connection ""; chunked_transfer_encoding off; proxy_pass http://127.0.0.1:3200; } }
新建反向代理MinIO控制台的配置文件:
nano /etc/nginx/sites-available/console-minio
写入如下配置:
server { listen 80; server_name console.minio.example.com; ignore_invalid_headers off; client_max_body_size 0; proxy_buffering off; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_connect_timeout 300; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; chunked_transfer_encoding off; proxy_pass http://127.0.0.1:3201; } }
检查NGINX配置是否正确:
nginx -t
然后为刚才所有的站点签发SSL证书:
certbot --nginx
访问ente-web.example.com注册一个账号。登录进去后你会发现存储空间被限制为5GB了,我们需要修改一下。
Ente这个程序目前没有可视化的管理员界面,所有管理操作只能通过CLI来完成。
安装ente-cli:
mkdir -p /opt/ente-cli/export && cd /opt/ente-cli wget https://github.com/ente-io/ente/releases/download/cli-v0.2.3/ente-cli-v0.2.3-linux-amd64.tar.gz tar -xzvf ente-cli-v0.2.3-linux-amd64.tar.gz
这玩意目前在Linux下运行会报错,运行前必须先导入这个环境变量才行:
export ENTE_CLI_SECRETS_PATH=./secrets.txt
嫌麻烦的话可以写到.bashrc里面,这样每次打开终端就自动加载了。
在这个CLI所在的目录下新建一个配置文件:
nano config.yaml
写入如下内容,将API的地址改为你自己的后端地址:
endpoint: api: "https://ente-museum.example.com"
添加账号,CLI只能添加现有账号,不能注册新账号,也就是只能添加刚才通过Web界面注册的账号:
./ente account add
添加的时候会让你输入一个导出目录,这里就填写export即可,之前已经创建好这个目录了:
Enter app type (default: photos): Use default app type: photos Enter export directory: export Enter email address: [email protected] Enter password: Please wait authenticating... Account added successfully run `ente export` to initiate export of your account data
然后这个CLI目前有BUG。。如果你启用了Passkey通行密钥,在使用CLI登录的时候返回的验证URL是错的,这会导致无法登录,只能暂时先把Passkey关了。。
执行如下命令查看账号的ID:
./ente account list
类似如下回显:
Configured accounts: 1 ==================================== Email: [email protected] ID: 1580559962386438 App: photos ExportDir: export ====================================
然后编辑后端的museum.yaml配置文件:
cd /opt/ente.io && nano museum.yaml
取消掉之前的注释,将ID修改为你自己的,同时为防止滥用可以关闭新用户注册:
internal: admins: - 1580559962386438 disable-registration: true
重启服务:
docker compose down docker compose up -d
回到CLI的目录下:
cd /opt/ente-cli
执行如下命令修改账号的存储空间:
./ente admin update-subscription -u [email protected]
这样就把空间搞到100TB了:
我测试了所有功能都是正常的,下面简单截了几张图片。
相册分享:
Passkey通行密钥:
投屏幻灯片:
还有Ente Auth,可以通过访问ente-auth.example.com来登录,但目前Web客户端的功能非常少:
我还特地看了一眼MinIO里面存的照片数据,确实是加密过的:
2025-03-11 15:39:59
昨天发现一台稳定运行了几年的龟壳ARM突然失联了,登录后台看到这个消息:
我也不知道这是什么东西,好像是计划维护(迁移)?但是我没有收到任何维护的邮件通知,我也不知道这个维护是具体维护了什么,反正它显示已经完成了。。但是我的机子确实连不上了,所以这是维护了什么。。修复了机子运行过于稳定的BUG?真的就是一脸懵逼的状态。。。仔细一想我猜测可能和我私自把系统重装成Debian有关?但具体的情况我不得而知。
要解决这个问题,首先我得想办法看到机子的屏幕,获取更多有用的信息。我在龟壳后台创建了一个控制台连接,然后用VNC客户端去连接,连是连上了,能看到屏幕了,但是没办法操作,我还以为是我的VNC客户端出问题了,结果我换了个VNC客户端还是一样。。只能看不能摸?不过我看到屏幕上的UEFI Shell就大概已经知道是什么原因了。
接着我又重新弄了个串行控制台,这回可算是中看又中用了:
敲一个quit还是exit就能进到机子的BIOS了,马上看Boot Manager,发现我Debian系统的启动项怎么没了???
不会是我的EFI分区炸了吧?赶紧去Boot维护管理,里面有一个Boot From File的功能:
尝试能不能用EFI文件直接引导,万幸万幸,分区是好的,文件也还在:
机子引导成功了,连上了用efibootmgr看一下,发现启动顺序不对,启动项也没:
这个时候如果机器重启的话还是会回到UEFI Shell,现在需要重新安装GRUB。看一下EFI分区的挂载点:
重新安装GRUB:
grub-install --target=arm64-efi --efi-directory=/boot/efi --bootloader-id=debian
机器重启后再检查一下,正常了:
龟壳控制台连接创建与使用方法:
1、登录一台Linux系统的VPS,生成SSH密钥:
ssh-keygen -b 4096 # 一路回车即可
生成完成之后查看公钥内容,全部复制下来:
cat ~/.ssh/id_rsa.pub
2、在龟壳后台创建控制台连接,选择创建本地连接:
粘贴刚才复制的公钥:
创建完成后复制连接命令到VPS内执行:
使用完成后记得在龟壳后台删除控制台连接,如有必要也可以把VPS内的SSH密钥删除。