Ubuntu 22.04 安装 GoToSocial 0.22.3 指南
Ubuntu 22.04 从零安装 GoToSocial 0.22.3 实测:官方 tar.gz 在线/离线双方案、SHA-256 校验、systemd 托管、管理员账号与 Mastodon 兼容 API 全链路验证,含排障 FAQ 与卸载清理。
Ubuntu 22.04 安装 GoToSocial 0.22.3 指南
目标:在一台 Ubuntu 22.04 服务器上从零安装 GoToSocial v0.22.3(官方二进制 + config.yaml + systemd 托管),跑通本地实例的账号创建、Web 登录、API 发帖与媒体上传。全文命令与回显均在实测环境(Ubuntu 22.04.5 LTS x86_64、监听端口 8147、安装目录
/gotosocial、演示账号admin)逐条验证通过。
一、环境信息
本章列出实测环境的完整软硬件信息,读者可对照准备一台规格相近的服务器。
- 操作系统:Ubuntu 22.04.5 LTS(
PRETTY_NAME="Ubuntu 22.04.5 LTS",uname -m为x86_64) - 软件版本:GoToSocial
0.22.3+git-5a6c8e2(官方 releases 当前最新稳定版,取证日期 2026-10-30) - 安装形态:官方预编译二进制(bare metal),非源码编译、非发行版包
- 安装目录:
/gotosocial(官方推荐的根目录布局,内含二进制、web/前端资源、example/示例配置) - 数据目录:
/gotosocial/storage(媒体存储)、/gotosocial/sqlite.db(SQLite 数据库) - 服务端口:
8147(HTTP 直连,本地/内网实例模式) - 数据库:SQLite 3(WAL 模式,无需额外安装数据库服务)
- 服务托管:systemd(
gotosocial.service,以系统用户gotosocial运行) - 下载渠道:官方 releases(codeberg.org)直连实测可用
- 演示账号:
admin/Q1w2E3r4T5!(GoToSocial 内置密码强度策略,q1w2e3r4这类弱口令会被拒绝,见「九、常见问题」)
二、前置条件
安装开始前,确认服务器具备以下条件,逐项验证避免中途卡住。
2.1 系统与架构
GoToSocial 官方为 linux amd64/arm64/armv6/armv7、FreeBSD、NetBSD 提供预编译二进制。确认系统架构:
uname -m && head -2 /etc/os-release
实测回显:
x86_64
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
2.2 依赖软件
二进制发行版将 Web 前端资源与媒体处理组件(WASM 形式的 ffmpeg)一并打包,不依赖 PostgreSQL/Redis 等外部服务,最低要求仅需 curl 与 tar:
apt-get update && apt-get install -y curl tar
实测回显(输出节选):
Reading package lists...
Building dependency tree...
curl is already the newest version (7.81.0-1ubuntu1.20).
tar is already the newest version (1.34+dfsg-1ubuntu0.1.22.04.2).
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
2.3 端口放行
实例监听 8147 端口,若启用了 ufw 防火墙需放行:
ufw allow 8147/tcp
实测回显(未启用 ufw 时会提示 inactive,启用时显示 added 规则):
Rules updated
Rules updated (v6)
验证端口未被占用:
ss -ltn | grep 8147 || echo "端口 8147 空闲"
实测回显:
端口 8147 空闲
三、版本选型说明
GoToSocial 主仓库已从 GitHub 迁移至 Codeberg(codeberg.org/superseriousbusiness/gotosocial),发布件统一在 Codeberg Releases 提供。选版本前先看清发布节奏与资产命名,避免下错包。
3.1 当前稳定版(2026-10-30 取证)
| 版本 | 发布日期 | 说明 |
|---|---|---|
| v0.22.3 | 2026-10-21 | 当前最新稳定版(Shrubbiest Sloth Ever),本文实测版本 |
| v0.22.2 | 2026-10-09 | 0.22 线上一个补丁版 |
| v0.22.1 | 2026-07-20 | 0.22 线补丁 |
| v0.22.0 | 2026-06-29 | 0.22 线首个版(Shrubby Sloth) |
| v0.21.3 | 2026-06-25 | 0.21 线末版 |
关键差异解读:0.22 线在两个月内连发三个补丁(v0.22.1→v0.22.3),项目维护活跃;新装直接选最新稳定版 v0.22.3,不建议从 0.19/0.20 老版本起步(涉及多轮数据库迁移)。
3.2 发行包选择(wasm 与 nowasm)
同一版本提供两种 Linux amd64 包,按需二选一:
| 包名 | 体积 | 适用场景 |
|---|---|---|
gotosocial_0.22.3_linux_amd64.tar.gz | 约 38 MB | 官方支持的标准构建,内嵌 WASM 版 ffmpeg/ffprobe 做媒体处理 |
gotosocial_0.22.3_linux_amd64_nowasm.tar.gz | 约 28 MB | 精简构建,不含 WASM 媒体处理,启动时打印 unsupported 警告且媒体处理依赖宿主 ffmpeg |
关键差异解读:标准构建开箱即用、媒体处理安全校验完整;nowasm 构建体积小约 10 MB,但运行时会提示「unsupported build configuration」且不校验 ffmpeg 版本,生产环境选标准构建,本文以标准构建为主线。
四、方案 A:官方二进制在线安装(推荐)
本章为安装主线:从官方 releases 下载标准构建 → 校验 → 解压到 /gotosocial → 写最小配置 → 前台试运行验证,全程约 10 分钟。
4.1 创建目录与用户
按官方布局创建安装目录与媒体存储目录:
mkdir -p /gotosocial/storage/certs
创建运行服务的系统用户与组(-r 为系统用户,无登录 shell):
useradd -r gotosocial
实测回显(无输出即成功)。随后官方文档要求再执行 groupadd gotosocial,在 Ubuntu 22.04 上 useradd -r 已经同步创建了同名组,此时会看到报错——这是预期现象,直接忽略即可:
groupadd gotosocial
实测回显:
groupadd: group 'gotosocial' already exists
把用户加入组并确认:
usermod -a -G gotosocial gotosocial && id gotosocial
实测回显:
uid=999(gotosocial) gid=999(gotosocial) groups=999(gotosocial)
4.2 下载与校验
进入安装目录,从官方 releases 下载标准构建与校验文件:
cd /gotosocial
curl -sSL -o gotosocial_0.22.3_linux_amd64.tar.gz 'https://codeberg.org/superseriousbusiness/gotosocial/releases/download/v0.22.3/gotosocial_0.22.3_linux_amd64.tar.gz'
curl -sSL -o checksums.txt 'https://codeberg.org/superseriousbusiness/gotosocial/releases/download/v0.22.3/checksums.txt'
实测回显(无输出即下载完成),确认体积:
ls -lh gotosocial_0.22.3_linux_amd64.tar.gz
实测回显:
-rw-r--r-- 1 root root 38M Oct 29 17:39 gotosocial_0.22.3_linux_amd64.tar.gz
用官方 checksums.txt 做 SHA-256 校验:
sha256sum -c checksums.txt 2>/dev/null | grep linux_amd64.tar.gz
实测回显:
gotosocial_0.22.3_linux_amd64.tar.gz: OK
4.3 解压安装
解压到安装目录,得到二进制、web/ 前端资源与 example/ 示例配置:
tar -xzf gotosocial_0.22.3_linux_amd64.tar.gz
ls -la /gotosocial
实测回显:
total 112068
drwxr-xr-x 5 root root 4096 Oct 29 17:39 .
drwxr-xr-x 1 root root 4096 Oct 29 17:38 ..
-rw-r--r-- 1 root root 34520 Oct 21 15:52 LICENSE
-rw-r--r-- 1 root root 41780 Oct 21 15:52 README.md
drwxr-xr-x 2 root root 4096 Oct 29 17:39 example
-rwxr-xr-x 1 root root 92717216 Oct 21 14:46 gotosocial
drwxr-xr-x 2 root root 4096 Oct 29 17:38 storage
drwxr-xr-x 4 root root 4096 Oct 29 17:39 web
确认版本号:
/gotosocial/gotosocial --version
实测回显:
gotosocial version 0.22.3+git-5a6c8e2
4.4 编写配置文件
官方建议配置文件只保留与默认值不同的项,便于后续升级时审阅差异。从示例配置起步,创建 /gotosocial/config.yaml(本地/内网实例模式,HTTP 直连 8147):
cat > /gotosocial/config.yaml <<'EOF'
# GoToSocial 最小配置(仅列出与默认值不同的项)
log-level: "info"
host: "localhost"
protocol: "http"
bind-address: "0.0.0.0"
port: 8147
db-type: "sqlite"
db-address: "/gotosocial/sqlite.db"
storage-local-base-path: "/gotosocial/storage"
EOF
cat /gotosocial/config.yaml
实测回显:
# GoToSocial 最小配置(仅列出与默认值不同的项)
log-level: "info"
host: "localhost"
protocol: "http"
bind-address: "0.0.0.0"
port: 8147
db-type: "sqlite"
db-address: "/gotosocial/sqlite.db"
storage-local-base-path: "/gotosocial/storage"
逐项说明:
host:实例对外主机名,是账号标识(@用户名@host)的一部分,上线后不可更改;本地/内网试运行用localhost,正式对外应写注册好的域名(如social.example.org);protocol:http或https,示例配置默认https,本地试运行改http;bind-address:监听地址,0.0.0.0表示所有网卡;仅本机访问可改127.0.0.1;port:监听端口,示例默认 8080,本文按实验槽位用 8147;db-type+db-address:数据库类型与地址,sqlite时db-address是数据库文件路径(首次启动自动建库建表);storage-local-base-path:媒体附件存储目录,指向 4.1 创建的/gotosocial/storage。
⚠️ 注意:
protocol: "http"启动时会打印 WARN「this should only be used for debugging and tests!」。本地/内网实例可接受;正式对外服务必须回到 https(配 TLS 证书或反向代理),参数细节见《GoToSocial 0.22.3 配置参数详解》。
4.5 授权目录属主
后续服务以 gotosocial 用户运行,先修正目录属主:
chown -R gotosocial:gotosocial /gotosocial
实测回显(无输出即成功),核对:
ls -la /gotosocial | head -5
实测回显:
total 112068
drwxr-xr-x 5 gotosocial gotosocial 4096 Oct 29 17:39 .
drwxr-xr-x 1 root root 4096 Oct 29 17:38 ..
-rw-r--r-- 1 gotosocial gotosocial 34520 Oct 21 15:52 LICENSE
4.6 前台试运行
首次以前台方式启动,确认能正常监听(首次启动会自动完成 SQLite 建库与全部数据库迁移):
su -s /bin/bash gotosocial -c 'cd /gotosocial && ./gotosocial --config-path ./config.yaml server start'
实测回显(输出节选,保留首尾):
timestamp="29/10/2026 17:39:37.552" func=config.Validate level=WARN msg="protocol was set to 'http'; this should *only* be used for debugging and tests!"
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
timestamp="29/10/2026 17:39:37.554" func=cache.(*Caches).Init level=INFO msg="init: 0x32e1bccfe008"
……(中间为各缓存初始化与数据库迁移日志)……
timestamp="29/10/2026 17:39:37.555" func=router.(*Router).Start.func1 level=INFO msg="listening on 0.0.0.0:8147"
timestamp="29/10/2026 17:39:37.555" func=cache.(*Caches).initInstance level=INFO msg="cache size = 1248"
……
timestamp="29/10/2026 17:39:37.555" func=workers.(*Workers).Start level=INFO msg="started 24 dereference workers"
timestamp="29/10/2026 17:39:37.555" func=workers.(*Workers).Start level=INFO msg="started 6 processing workers"
出现 listening on 0.0.0.0:8147 即启动成功。保持该终端运行,另开终端验证 Web 入口:
curl -s -o /dev/null -w "GET / -> HTTP %{http_code}\n" http://localhost:8147/
实测回显:
GET / -> HTTP 200
浏览器访问 http://<服务器IP>:8147/ 可看到 GoToSocial 实例落地页(标题 <host> - GoToSocial)。验证后回到前台终端按 Ctrl+C 停止,进入 systemd 托管步骤。
五、方案 B:离线服务器安装(断网环境)
适用场景:目标服务器无法访问外网(内网隔离),需先在有网机器完成下载校验,再传入内网安装。前置条件同第四章(目录/用户/依赖),仅「下载与校验」环节换成两步走。
在有网的机器上下载发行包与校验文件并校验:
curl -sSL -o gotosocial_0.22.3_linux_amd64.tar.gz 'https://codeberg.org/superseriousbusiness/gotosocial/releases/download/v0.22.3/gotosocial_0.22.3_linux_amd64.tar.gz'
curl -sSL -o checksums.txt 'https://codeberg.org/superseriousbusiness/gotosocial/releases/download/v0.22.3/checksums.txt'
sha256sum -c checksums.txt 2>/dev/null | grep linux_amd64
实测回显(两个包都在校验清单中,只下标准构建时另一行报 OPEN 错误可忽略):
gotosocial_0.22.3_linux_amd64.tar.gz: OK
把发行包传入内网服务器(示例路径 /root/gts/,按实际内网通道调整):
mkdir -p /root/gts
cp gotosocial_0.22.3_linux_amd64.tar.gz checksums.txt /root/gts/
实测回显(无输出即成功),确认传输完整:
ls -lh /root/gts/
实测回显:
total 78M
-rw-r--r-- 1 root root 38M Oct 29 17:39 gotosocial_0.22.3_linux_amd64.tar.gz
-rw-r--r-- 1 root root 1.5K Oct 29 17:39 checksums.txt
在离线服务器上再次校验后解压安装(后续配置、用户、systemd 步骤与方案 A 的 4.1 与 4.4~4.6 完全一致):
cd /root/gts && sha256sum -c checksums.txt 2>/dev/null | grep linux_amd64.tar.gz
mkdir -p /gotosocial && tar -xzf gotosocial_0.22.3_linux_amd64.tar.gz -C /gotosocial
/gotosocial/gotosocial --version
实测回显:
gotosocial_0.22.3_linux_amd64.tar.gz: OK
gotosocial version 0.22.3+git-5a6c8e2
⚠️ 注意:GoToSocial 官方不提供 deb/rpm 仓库安装,也没有官方 APT 源;源码编译需 Go 与 Node 双工具链构建 Web 资源,官方同样以预编译二进制为主要分发形态,故本文不设编译安装章节,离线场景直接复用官方发行包即可。
六、方案对比与选择建议
两套方案使用完全相同的官方发行包,差异只在获取通道:
| 维度 | 方案 A:在线安装 | 方案 B:离线安装 |
|---|---|---|
| 是否需联网 | 服务器可访问 codeberg.org | 服务器可离线,需一台有网机器中转 |
| 包来源 | 官方 releases 直下 | 同一官方包 + checksum 离线复核 |
| 校验方式 | sha256sum -c 在服务器执行 | 有网机器与离线服务器各校验一次 |
| 版本升级 | 服务器直接下新包 | 有网机器下新包再传入 |
| 适用环境 | 云主机/有公网 VPS | 内网隔离机房、NAS 内网段 |
选择建议:默认选方案 A(步骤最少、校验在同一台机器闭环);仅当服务器无法出网时选方案 B,务必保留 checksums.txt 并在离线服务器二次校验,防止中转环节包损坏。
七、创建管理员账号并配置 systemd 托管
两套方案安装完成后,统一走本节的账号创建与 systemd 收尾,形成开机自启的常驻服务。
7.1 创建并确认管理员账号
用 CLI 创建本地账号 admin(邮箱填实例内可识别的地址即可),并确认、提权:
cd /gotosocial
./gotosocial --config-path ./config.yaml admin account create --username admin --email admin@localhost.localdomain --password 'Q1w2E3r4T5!'
实测回显(输出节选):
timestamp="29/10/2026 17:41:36.152" func=bundb.sqliteConn level=INFO msg="connected to SQLITE database with address file:/gotosocial/sqlite.db?_pragma=busy_timeout%281800000%29&_pragma=journal_mode%28WAL%29&_pragma=synchronous%28NORMAL%29&_pragma=cache_size%28-8192%29&_txlock=immediate"
timestamp="29/10/2026 17:41:36.154" func=bundb.doMigration level=INFO msg="there are no new migrations to run"
确认邮箱与提权为管理员:
./gotosocial --config-path ./config.yaml admin account confirm --username admin
./gotosocial --config-path ./config.yaml admin account promote --username admin
实测回显(两条命令输出结构相同,均以数据库连接与缓存关闭日志收尾):
timestamp="29/10/2026 17:41:36.354" func=bundb.doMigration level=INFO msg="there are no new migrations to run"
timestamp="29/10/2026 17:41:36.354" func=cache.(*Caches).Stop level=INFO msg="stop: 0x2da00ed68008"
列出账号核对状态(admin=yes、confirmed=yes、approved=yes 即就绪):
./gotosocial --config-path ./config.yaml admin account list 2>/dev/null
实测回显:
user account approved admin moderator suspended confirmed
admin 01GCAFW13JWEEZ9BG56T9B4CQQ yes yes yes no yes
7.2 安装 systemd 服务
官方包内置 example/gotosocial.service,直接复制启用:
cp /gotosocial/example/gotosocial.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable --now gotosocial.service
实测回显:
Created symlink /etc/systemd/system/default.target.wants/gotosocial.service -> /etc/systemd/system/gotosocial.service.
该单元的关键设定(官方原文件已带):User=gotosocial/Group=gotosocial 以低权限用户运行、ExecStart=/gotosocial/gotosocial --config-path config.yaml server start、WorkingDirectory=/gotosocial、Type=exec、Restart=on-failure,并预置了 NoNewPrivileges、ProtectSystem=full、SystemCallFilter 等一组沙箱加固项;若安装路径不是 /gotosocial,需同步改 ExecStart= 与 WorkingDirectory= 两行。
7.3 服务验证
确认服务运行状态:
systemctl is-active gotosocial && systemctl status gotosocial --no-pager -l | head -12
实测回显:
active
* gotosocial.service - GoToSocial Server
Loaded: loaded (/etc/systemd/system/gotosocial.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2026-10-29 17:41:03 UTC; 8s ago
Main PID: 2720 (gotosocial)
Tasks: 12 (limit: 2266)
Memory: 359.0M
CPU: 5.027s
CGroup: /system.slice/gotosocial.service
`-2720 /gotosocial/gotosocial --config-path config.yaml server start
查看服务日志确认 worker 启动:
journalctl -u gotosocial --no-pager -n 3
实测回显(主机名按实际服务器显示,下例为 gts-lab):
Oct 29 17:41:08 gts-lab gotosocial[2720]: timestamp="29/10/2026 17:41:08.549" func=workers.(*Workers).Start level=INFO msg="started 24 dereference workers"
Oct 29 17:41:08 gts-lab gotosocial[2720]: timestamp="29/10/2026 17:41:08.549" func=workers.(*Workers).Start level=INFO msg="started 6 processing workers"
最终功能验证:Web 落地页与实例信息 API 双通道确认:
curl -s -o /dev/null -w "GET / -> HTTP %{http_code}\n" http://localhost:8147/
curl -s http://localhost:8147/api/v1/instance | head -c 120; echo
实测回显:
GET / -> HTTP 200
{"domain":"localhost","account_domain":"localhost","title":"localhost","version":"0.22.3+git-5a6c8e2",……
浏览器登录 http://<服务器IP>:8147/settings(账号 admin / Q1w2E3r4T5!)可进入设置面板;发帖、时间线与媒体上传的 API 实测闭环见《GoToSocial 0.22.3 常用 CLI 命令与 API 详解》。
八、配置说明与日常运维
本章补充与长期运行相关的配置要点和升级/备份操作。
8.1 对外服务配置差异项
本地/内网模式与正式对外实例只差四个配置项,其余不变:
| 配置项 | 本地/内网(本文实测值) | 正式对外实例 |
|---|---|---|
host | localhost | 注册域名(如 social.example.org,一经启用不可改) |
protocol | http | https |
port | 8147 | 443(或反代后保留 8147) |
letsencrypt-enabled | false | true(GtS 内置 ACME 客户端自动签发,需 letsencrypt-port: 80 可达) |
💡 说明:TLS 终止既可以用 GtS 内置 Let's Encrypt,也可以交给前置反向代理(Nginx/Caddy)做 HTTPS,后者把
protocol设为https并配trusted-proxies。反向代理与证书方案分别见《Ubuntu 22.04 安装 Nginx 指南(apt/官方源/编译多方案)》、《Nginx HTTPS 与证书配置方案(certbot/自签名)》、《Ubuntu 22.04 安装 Caddy 指南(apt 官方源 编译多方案)》。
8.2 数据备份要点
SQLite 形态下需要备份的只有两处:数据库文件与媒体目录:
mkdir -p /var/backups/gotosocial
cp /gotosocial/sqlite.db /var/backups/gotosocial/sqlite-$(date +%F).db
cp -r /gotosocial/storage /var/backups/gotosocial/storage-$(date +%F)
ls -lh /var/backups/gotosocial/
实测回显:
total 68K
-rw-r--r-- 1 root root 66K Oct 29 17:46 sqlite-2026-10-29.db
drwxr-xr-x 4 root root 4.0K Oct 29 17:46 storage-2026-10-29
⚠️ 注意:SQLite 数据库在服务运行中以 WAL 模式写入,热备单文件可能缺事务尾巴;严谨做法是先
systemctl stop gotosocial再拷贝,备份完systemctl start gotosocial拉起。官方也提供gotosocial admin export逻辑导出,用法见《GoToSocial 0.22.3 常用 CLI 命令与 API 详解》。
8.3 升级到新版本
升级 = 换二进制 + 换 web 资源,数据库结构由启动时的自动迁移完成(启动日志可见 doMigration):
systemctl stop gotosocial
cd /gotosocial
cp sqlite.db /var/backups/gotosocial/sqlite-before-upgrade.db
curl -sSL -o gts-new.tar.gz 'https://codeberg.org/superseriousbusiness/gotosocial/releases/download/v0.22.3/gotosocial_0.22.3_linux_amd64.tar.gz'
tar -xzf gts-new.tar.gz gotosocial web
chown -R gotosocial:gotosocial /gotosocial
systemctl start gotosocial
/gotosocial/gotosocial --version
实测回显:
gotosocial version 0.22.3+git-5a6c8e2
启动后 journalctl -u gotosocial -f 观察迁移日志,出现 there are no new migrations to run 或各 migration 执行日志且服务 active 即升级完成;回滚时停服、用备份的 sqlite.db 覆盖、换回旧版 tar 包再启动。
九、常见问题(FAQ)
本章汇总实测过程中真实遇到的问题与解法。
Q1:groupadd gotosocial 报 group 'gotosocial' already exists?
A:Ubuntu 22.04 的 useradd -r 默认同步创建同名组(USERGROUPS_ENAB 生效),官方文档中 useradd 与 groupadd 两步在该发行版上会撞出此报错。属于预期现象,忽略即可;也可以只用 useradd -r gotosocial 一步,id gotosocial 确认 uid/gid 正常再继续。
Q2:admin account create 报 panic: error executing command: password is only 68% strength?
A:GoToSocial 内置密码强度评估,弱口令(如 q1w2e3r4)会在创建账号时直接 panic 拒绝,实测完整报错为:
panic: error executing command: password is only 68% strength, try including more special characters, using uppercase letters or using a longer password
换用包含大小写、数字与符号的更长口令(本文演示用 Q1w2E3r4T5!)即可通过。
Q3:启动日志出现 protocol was set to 'http'; this should *only* be used for debugging and tests!?
A:这是 config 校验的 WARN 提示,本地/内网实例可忽略;对外服务请将 protocol 改为 https 并配置 TLS(内置 Let's Encrypt 或反向代理)。
Q4:直接访问 /oauth/authorize 返回 500,日志报 key redirect_uri not found in session?
A:GoToSocial 的 OAuth 授权页依赖会话状态。必须先带 client_id 等参数访问一次 /oauth/authorize(它会 303 跳到登录页初始化会话),再提交登录表单,最后回到授权页点 Allow;跳过第一步直接拿已登录会话访问会话中无授权参数就会 500。完整可复现的 curl 四步流程见《GoToSocial 0.22.3 常用 CLI 命令与 API 详解》。
Q5:服务启动后访问不了 8147 端口?
A:按顺序排查三处:ss -ltn | grep 8147 确认监听存在;systemctl status gotosocial 确认 active;云服务器再查安全组/防火墙(ufw allow 8147/tcp)。若 bind-address 被改成了 127.0.0.1,外部地址也无法访问,改回 0.0.0.0 重启服务。
Q6:忘记 admin 密码怎么办?
A:用 CLI 重置:./gotosocial --config-path ./config.yaml admin account password --username admin --password '<新口令>',随后用新口令登录 Web 设置面板即可;该命令同样要求通过强度校验。
十、卸载与清理
彻底移除 GoToSocial 按以下四步,先停服务再删文件与账号:
systemctl disable --now gotosocial.service
rm -f /etc/systemd/system/gotosocial.service
systemctl daemon-reload
rm -rf /gotosocial
userdel gotosocial
实测回显(disable 时若服务在跑会同时停止):
Removed "/etc/systemd/system/default.target.wants/gotosocial.service".
核对无残留:
systemctl list-unit-files | grep gotosocial; ls /gotosocial 2>&1; id gotosocial 2>&1
实测回显:
ls: cannot access '/gotosocial': No such file or directory
id: 'gotosocial': no such user
十一、参考链接
- 官方站点:
https://gotosocial.org/ - 官方文档(Bare metal 安装):
https://docs.gotosocial.org/en/latest/getting_started/installation/metal/ - 官方文档(Creating users):
https://docs.gotosocial.org/en/latest/getting_started/user_creation/ - 官方仓库(Codeberg):
https://codeberg.org/superseriousbusiness/gotosocial - 官方 Releases(v0.22.3 资产与 checksums):
https://codeberg.org/superseriousbusiness/gotosocial/releases/tag/v0.22.3 - 配置参数逐项解析见《GoToSocial 0.22.3 配置参数详解》,CLI 与 REST API 实测见《GoToSocial 0.22.3 常用 CLI 命令与 API 详解》,选型背景见《GoToSocial 0.22.3 介绍与选型指南》。