MoreRSS

site iconLala | 荒岛修改

一个应用分享、教程类的博客,主要是那些需要自部署的。
请复制 RSS 到你的阅读器,或快速订阅到 :

Inoreader Feedly Follow Feedbin Local Reader

Lala | 荒岛的 RSS 预览

Docker部署Outline团队知识库+Logto身份验证

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的部署与配置可以参考我的这篇文章:

Docker部署开源身份验证服务: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

Docker部署开源身份验证服务:Logto

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,创建管理员账号:

Ente全家桶部署:Ente Photos、Ente Auth

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里面存的照片数据,确实是加密过的:

龟壳ARM Debian11 UEFI GRUB启动项丢失修复

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密钥删除。

sing-box ss报错 bad timestamp

2025-01-21 11:00:28

一个节点一直以来用着好好的,突然出现问题:浏览器访问网页,一会能访问一会不行,能访问的时候网页还可能加载不全:

查看服务器节点的最新日志:

journalctl -u sing-box -e

发现很多bad timestamp的报错:

好像和服务器时间相关?看一下服务器当前的时间:

timedatectl

发现比我本地的时间快了几十秒:

不知道为啥会快几十秒,但是从上面的命令输出结果也可以看到系统是没有启用时间同步(NTP)的,那我配置一下NTP应该就可以解决这个问题了。配置NTP的软件有很多,比如Chrony、systemd-timesyncd,我这里就用更轻量的systemd-timesyncd了:

apt update
apt install systemd-timesyncd

安装完成后应该是自动启动的,可以查看一下运行状态:

systemctl status systemd-timesyncd

这是系统层面的解决办法。如果不依赖系统本身,sing-box自身也有一个NTP的配置项可用:

{
  "log": {
    "level": "info"
  },
  "dns": {
    "servers": [
      {
        "address": "tls://8.8.8.8"
      }
    ]
  },
  "ntp": {
    "enabled": true,
    "server": "time.apple.com",
    "server_port": 123,
    "interval": "10m",
    "detour": "direct"
  },
  "inbounds": [
    {
      "type": "shadowsocks",
      "listen": "::",
      "listen_port": 8080,
      "sniff": true,
      "method": "2022-blake3-aes-128-gcm",
      "password": "hidden"
    }
  ],
  "outbounds": [
    {
      "type": "direct",
      "tag": "direct"
    },
    {
      "type": "dns",
      "tag": "dns-out"
    }
  ],
  "route": {
    "rules": [
      {
        "protocol": "dns",
        "outbound": "dns-out"
      }
    ]
  }
}

重启:

systemctl restart sing-box

我真的得吐槽一下,这个节点我主要是拿来玩游戏的,昨天出问题后导致我游戏上不去,我游戏内的东西都过期了,气死我了,这傻吊服务器早不出问题晚不出问题偏偏要在最关键的时候整活。。。

Nala:Debian APT命令的前端

2025-01-12 16:37:21

Nala主要特点:漂亮的输出、并行下载、镜像源延迟测试、命令历史记录,并且支持撤销。我主要看上命令历史记录和撤销功能了,很方便!我在安装Nala和使用的过程中遇到点小问题,记录下解决的方法。

如果系统是Debian 12 Cloud镜像,有安装cloud-init的,不要使用Debian 12官方源安装Nala,因为后续使用时会遇到卡在软件包下载这里,并且无法退出,搜了一下发现这是Nala旧版本的BUG:

https://gitlab.com/volian/nala/-/issues/285

已经卡住了咋办,先看pid,然后强行结束进程,再卸载掉旧版本。。。

ps aux
kill -9 pid
apt purge nala
apt autoremove

安装最新版:

curl https://gitlab.com/volian/volian-archive/-/raw/main/install-nala.sh | bash
apt install nala

首次使用先fetch一下:

nala fetch

把你觉得延迟最低的几个源输上去保存:

保存的文件在sources.list.d目录里面,不会影响到主配置文件:

/etc/apt/sources.list.d/nala-sources.list

使用Nala更新系统的时候发现不更新内核软件包,搜了一下发现作者在这里详细说明了原因:

https://github.com/volitank/nala/issues/29#issuecomment-1863176093

简而言之在upgrade后面加–full即可:

nala upgrade --full

如果不加–full想让这变成默认行为,可编辑Nala的配置文件:

nano /etc/nala/nala.conf

修改如下配置为true:

full_upgrade = false

试一下撤销功能,假设我先安装了一个ffmpeg:

nala install ffmpeg

查看命令历史记录:

nala history

撤销,等于是卸载掉了:

nala history undo 2

甚至我还可以继续撤销,就等于重新安装了:

nala history undo 3

删除不需要的记录:

nala history clear 

接受–all直接删除全部记录:

nala history clear --all