<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Pleroma — Fediverse中文论坛</title>
        <link>https://fediverse.eu.org/</link>
        <pubDate>Tue, 18 Aug 2026 08:39:11 +0000</pubDate>
        <language>zh</language>
            <description>Pleroma — Fediverse中文论坛</description>
    <atom:link href="https://fediverse.eu.org/categories/pleroma/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>Pleroma 添加新中继报错</title>
        <link>https://fediverse.eu.org/discussion/42/pleroma-%E6%B7%BB%E5%8A%A0%E6%96%B0%E4%B8%AD%E7%BB%A7%E6%8A%A5%E9%94%99</link>
        <pubDate>Sun, 24 Jul 2022 07:18:13 +0000</pubDate>
        <category>Pleroma</category>
        <dc:creator>Happiness</dc:creator>
        <guid isPermaLink="false">42@/discussions</guid>
        <description><![CDATA[<ol><li><p>在管理员的Pleroma-FE【relays】页面上添加中继时，报错500<br /><img src="https://fediverse.eu.org/uploads/editor/78/qpo8g2h0uygb.png" alt="" title="" /></p></li>
<li><p>根据<a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fdocs-develop.pleroma.social%2Fbackend%2Fadministration%2FCLI_tasks%2Frelay%2F">文档</a><br />
运行命令行 <code spellcheck="false" tabindex="0">MIX_ENV=prod mix pleroma.relay list</code>，也报错<br /><img src="https://fediverse.eu.org/uploads/editor/mf/y1m3won6xp6s.png" alt="" title="" /></p></li>
</ol><p>请问这种要怎么处理，谢谢~~</p>
]]>
        </description>
    </item>
    <item>
        <title>Pleroma 如何添加 known network</title>
        <link>https://fediverse.eu.org/discussion/36/pleroma-%E5%A6%82%E4%BD%95%E6%B7%BB%E5%8A%A0-known-network</link>
        <pubDate>Sun, 22 May 2022 08:46:16 +0000</pubDate>
        <category>Pleroma</category>
        <dc:creator>alygz9</dc:creator>
        <guid isPermaLink="false">36@/discussions</guid>
        <description><![CDATA[<p>有没有什么方法把别的 instances 加入到 pleroma 的 known network 里面嘛</p>
]]>
        </description>
    </item>
    <item>
        <title>五分钟设计一个漂亮的pleroma主题</title>
        <link>https://fediverse.eu.org/discussion/27/%E4%BA%94%E5%88%86%E9%92%9F%E8%AE%BE%E8%AE%A1%E4%B8%80%E4%B8%AA%E6%BC%82%E4%BA%AE%E7%9A%84pleroma%E4%B8%BB%E9%A2%98</link>
        <pubDate>Fri, 29 Apr 2022 16:32:09 +0000</pubDate>
        <category>Pleroma</category>
        <dc:creator>zhichi</dc:creator>
        <guid isPermaLink="false">27@/discussions</guid>
        <description><![CDATA[<p>写在前面：</p>

<p>本篇有标题党的嫌疑，下面的内容也缺乏原创性。</p>

<p>Pleroma主题设计教程详见官方文档：<a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fdocs-develop.pleroma.social%2Fbackend%2Fconfiguration%2Fhowto_theming_your_instance%2F">https://docs-develop.pleroma.social/backend/configuration/howto_theming_your_instance/</a></p>

<p>本篇只是做了一点点翻译。希望通过这篇文章，介绍一些已有的漂亮pleroma主题，让各位有兴趣的朋友来欣赏Pleroma的美丽^_^</p>

<p><br /></p>

<h1 data-id="pleroma">快速便捷地设计您的Pleroma站点风格</h1>

<ul><li><p>您可以使用Pleroma FE创建自己的主题，方法是转到设置（右上角的齿轮）并选择主题选项卡。在这里，您可以选择创建个人主题。</p></li>
<li><p>可以根据图上的红框与箭头开始手动制作（瞎改）主题</p></li>
<li><img src="https://fediverse.eu.org/uploads/editor/x2/ioj4kharah30.png" alt="" title="" /></li>
<li><img src="https://fediverse.eu.org/uploads/editor/wh/5h1l6pnupup4.png" alt="" title="" /></li>
<li><img src="https://fediverse.eu.org/uploads/editor/y8/fmy11dunzrtv.png" alt="" title="" /></li>
<li><img src="https://fediverse.eu.org/uploads/editor/iu/5d8e4wqf4zuq.png" alt="" title="" /></li>
<li><img src="https://fediverse.eu.org/uploads/editor/xt/2mngudnbs86g.png" alt="" title="" /></li>
<li><img src="https://fediverse.eu.org/uploads/editor/og/akpytwmwxesf.png" alt="" title="" /></li>
<li><img src="https://fediverse.eu.org/uploads/editor/ca/dxgz7binonsl.png" alt="" title="" /></li>
<li><img src="https://fediverse.eu.org/uploads/editor/uz/02d63384u4hh.png" alt="" title="" /></li>
</ul><p><strong>经过上面的步骤，您已经获得了一个自己制作的pleroma主题文件。</strong></p>

<p>当然，您也可以去访问别的pleroma站点，在齿轮设置里面保存并下载该站的主题；<br />
或者访问一些提供pleroma主题的网址：<br /><a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fmindpalace.michaelis.website%2Ftech%2Fpleroma-theme.html">https://mindpalace.michaelis.website/tech/pleroma-theme.html</a><br /><a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fplthemes.vulpes.one%2F">https://plthemes.vulpes.one/</a></p>

<p><br /></p>

<h1 data-id="vps">将漂亮主题上传到您自己的vps</h1>

<p>下面的操作以Bitvise SSH Client为例</p>

<ul><li>重命名刚刚下载的那个json文件，例如命名为XXX.json</li>
<li>打开该文件，添加下列代码（注意括号），并且保存</li>
</ul><blockquote><div>
  <p>{<br />
  "_pleroma_theme_version": 2, <br />
  "name": "XXX", <br />
  "theme": {}<br />
  }</p>
</div></blockquote>

<ul><li>访问VPS中存放Pleroma主题文件的地址</li>
</ul><p>/var/lib/pleroma/static/frontends/pleroma-fe/develop/static/themes<br />
（可能与您的安装路径有些许出入）</p>

<ul><li><p>将修改好的XXX.json上传到这里</p></li>
<li><p>修改/var/lib/pleroma/static/frontends/pleroma-fe/develop/static 中的styles.json文件代码</p></li>
</ul><blockquote><div>
  <p>{ <br />
  "pleroma-dark": [ "Pleroma Dark", "#121a24", "#182230", "#b9b9ba", "#d8a070", "#d31014", "#0fa00f", "#0095ff", "#ffa500" ], <br />
  "pleroma-light": [ "Pleroma Light", "#f2f4f6", "#dbe0e8", "#304055", "#f86f0f", "#d31014", "#0fa00f", "#0095ff", "#ffa500" ],<br />
  "classic-dark": [ "Classic Dark", "#161c20", "#282e32", "#b9b9b9", "#baaa9c", "#d31014", "#0fa00f", "#0095ff", "#ffa500" ],<br />
  "bird": [ "Bird", "#f8fafd", "#e6ecf0", "#14171a", "#0084b8", "#e0245e", "#17bf63", "#1b95e0", "#fab81e"],<br />
  "ir-black": [ "Ir Black", "#000000", "#242422", "#b5b3aa", "#ff6c60", "#FF6C60", "#A8FF60", "#96CBFE", "#FFFFB6" ],<br />
  "monokai": [ "Monokai", "#272822", "#383830", "#f8f8f2", "#f92672", "#F92672", "#a6e22e", "#66d9ef", "#f4bf75" ],<br />
  "redmond-xx": "/static/themes/redmond-xx.json", <br />
  "redmond-xx-se": "/static/themes/redmond-xx-se.json",<br />
  "redmond-xxi": "/static/themes/redmond-xxi.json",<br />
  "breezy-dark": "/static/themes/breezy-dark.json",<br />
  "breezy-light": "/static/themes/breezy-light.json",<br />
  "mammal": "/static/themes/mammal.json",<br />
  "XXX": "/static/themes/XXX.json"<br />
  }</p>
</div></blockquote>

<ul><li><p>此刻，您可以来到Pleroma站点，点击齿轮设置，在网站预置主题中，您会发现列表里面多出了一个XXX的选项，恭喜，您的漂亮主题上传成功了</p></li>
<li><p>然后，您可以登陆Pleroma Fe-Settings-Frontend-Theme,输入XXX，将其设置为默认配置主题</p></li>
</ul><p><br /></p>

<h1 data-id="pleroma-1">我很欣赏的某些Pleroma站点的漂亮主题展示</h1>

<p>希望您也喜欢！</p>

<p><a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fmindpalace.michaelis.website%2Ftech%2Fpleroma-theme.html">The Pleroma Themes (michaelis.website)</a><br /><a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fsuicablog.cobaltkiss.blue%2Fposts%2Fthemes-gallery%2F">Themes Gallery (cobaltkiss.blue)</a></p>
]]>
        </description>
    </item>
    <item>
        <title>在 Debian 10 / Ubuntu 20.04 上安装 Pleroma</title>
        <link>https://fediverse.eu.org/discussion/22/%E5%9C%A8-debian-10-ubuntu-20-04-%E4%B8%8A%E5%AE%89%E8%A3%85-pleroma</link>
        <pubDate>Fri, 29 Apr 2022 08:58:37 +0000</pubDate>
        <category>Pleroma</category>
        <dc:creator>blue</dc:creator>
        <guid isPermaLink="false">22@/discussions</guid>
        <description><![CDATA[<p>博文链接： <a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fsuicablog.cobaltkiss.blue%2Fposts%2Fpleroma-installation-on-linux-using-otp-releases%2F">https://suicablog.cobaltkiss.blue/posts/pleroma-installation-on-linux-using-otp-releases/</a></p>

<p>Pleroma 官方 OTP 方式安装教程： <a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fdocs-develop.pleroma.social%2Fbackend%2Finstallation%2Fotp_en%2F">https://docs-develop.pleroma.social/backend/installation/otp_en/</a></p>

<p>（因话题字数受限删除了「正式安装」前的内容，完整文章请点击上方博文链接查看）</p>

<h1 data-id="n-a">推荐配置</h1>

<p>尽管 Pleroma 内存需求远低于 Mastodon 和 Misskey，但<strong>购入 VPS 请最低保证 1 GB 的内存</strong>。这个配置对于用户较少的小型实例是足够的，再小实例就容易变得不稳定。如果预计会在未来接纳更多用户，请根据您需要购买更合适的套餐。</p>

<h1 data-id="n-a-1">正式安装</h1>

<h2 data-id="n-a-2"><strong>一、前置安装</strong></h2>

<p>1、安装依赖</p>

<pre spellcheck="false" tabindex="0">apt install curl unzip libncurses5 postgresql postgresql-contrib nginx certbot libmagic-dev
</pre>

<p>如果安装途中出现错误，则执行以下命令后再次尝试安装：</p>

<pre spellcheck="false" tabindex="0">apt-get update
</pre>

<p>2、安装可选安装包（建议全部安装）</p>

<pre spellcheck="false" tabindex="0">apt install imagemagick ffmpeg libimage-exiftool-perl
</pre>

<p>3、Postgresql 性能调优（可选）<br />
为了优化性能，您可以使用 <a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fpgtune.leopard.in.ua%2F%23%2F">pgTune</a> 生成一个合适的配置文件。编辑 /etc/postgresql/11.9/main/postgresql.conf 中的相应数值并使用以下命令重启 PostgreSQL 。</p>

<pre spellcheck="false" tabindex="0">systemctl restart postgresql
</pre>

<p>（11.9 为我系统 Postgresql 的版本，您的版本不同的话会显示为其他序号）</p>

<h2 data-id="pleroma"><strong>二、安装 Pleroma</strong></h2>

<p>1、创建一个 Pleroma 用户</p>

<pre spellcheck="false" tabindex="0">adduser --system --shell /bin/false --home /opt/pleroma pleroma
</pre>

<p>2、检测并设置环境变量 FLAVOUR</p>

<pre spellcheck="false" tabindex="0">arch="$(uname -m)";if [ "$arch" = "x86_64" ];then arch="amd64";elif [ "$arch" = "armv7l" ];then arch="arm";elif [ "$arch" = "aarch64" ];then arch="arm64";else echo "Unsupported arch: $arch"&gt;&amp;2;fi;if getconf GNU_LIBC_VERSION&gt;/dev/null;then libc_postfix="";elif [ "$(ldd 2&gt;&amp;1|head -c 9)" = "musl libc" ];then libc_postfix="-musl";elif [ "$(find /lib/libc.musl*|wc -l)" ];then libc_postfix="-musl";else echo "Unsupported libc"&gt;&amp;2;fi;echo "$arch$libc_postfix"
</pre>

<p>假设输出结果是 "amd64"（请替换为您自己的输出结果），输入 ：</p>

<pre spellcheck="false" tabindex="0">export FLAVOUR="amd64"
</pre>

<p>3、下载安装 Pleroma 所需的文件到 /tmp 文件夹并解压</p>

<pre spellcheck="false" tabindex="0">su pleroma -s $SHELL -lc "
curl 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job=$FLAVOUR' -o /tmp/pleroma.zip
unzip /tmp/pleroma.zip -d /tmp/
"
</pre>

<p>4、移动文件到 /opt/pleroma 并删除临时文件夹</p>

<pre spellcheck="false" tabindex="0">su pleroma -s $SHELL -lc "
mv /tmp/release/* /opt/pleroma
rmdir /tmp/release
rm /tmp/pleroma.zip
"
</pre>

<p>5、创建 /uploads 文件夹并设置适当的权限</p>

<pre spellcheck="false" tabindex="0">mkdir -p /var/lib/pleroma/uploads
chown -R pleroma /var/lib/pleroma
</pre>

<p>6、创建 static 文件（用于存放表情等文件）并设置其所有者为用户 pleroma</p>

<pre spellcheck="false" tabindex="0">mkdir -p /var/lib/pleroma/static
chown -R pleroma /var/lib/pleroma
</pre>

<p>7、创建存放配置文件的文件夹并设置其所有者为用户 pleorma</p>

<pre spellcheck="false" tabindex="0">mkdir -p /etc/pleroma
chown -R pleroma /etc/pleroma
</pre>

<p>8、生成 config 配置文件</p>

<pre spellcheck="false" tabindex="0">su pleroma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/pleroma/config.exs --output-psql /tmp/setup_db.psql"
</pre>

<p>9、若 config 文件生成成功，则出现若干问题需要回答：</p>

<p>What domain will your instance use? (e.g pleroma.soykaf.com) []<br />
您的网站将使用什么网址？</p>

<p>What is the name of your instance? (e.g. Pleroma/Soykaf) []<br />
您的网站叫什么名字？</p>

<p>What is your admin email address? []<br />
网站管理员的邮箱地址是什么？</p>

<p>What email address do you want to use for sending email notifications?<br />
[]<br />
您想要用什么邮件地址来发送邮件通知？（这里先输入邮箱，之后若要向用户发送邮件需要额外配置）</p>

<p>Do you want search engines to index your site? (y/n) [n]<br />
您希望搜索引擎收录您的网站吗？（建议不收录）</p>

<p>Do you want to store the configuration in the database (allows controlling it from admin-fe)? (y/n) [n] y<br />
您希望将配置信息存入数据库吗（允许从管理后台进行控制）？（建议存入，否则 admin-fe 将无法使用）</p>

<p>Do you want to strip location (GPS) data from uploaded images? (y/n) [y] n<br />
您希望从上传的图片中消除 GPS 信息吗？（建议消除）</p>

<p>Do you want to anonymize the filenames of uploads? (y/n) [n] y<br />
您希望将上传文件的文件名匿名化吗？（建议匿名化）</p>

<p>Do you want to deduplicate uploaded files? (y/n) [n] y<br />
您希望去除重复的已上传文件吗？（建议去除）</p>

<p>除以上问题外，其余选项均按 enter 选择默认配置即可</p>

<p>如果成功则有如下显示：</p>

<p>All files successfully written! Refer to the installation instructions for your platform for next steps. Please transfer your config to the database after running database migrations. Refer to "Transfering the config to/from the database" section of the docs for more information.</p>

<p>10、创建 postgres 数据库</p>

<pre spellcheck="false" tabindex="0">su postgres -s $SHELL -lc "psql -f /tmp/setup_db.psql"
</pre>

<p>11、更新数据库 schema</p>

<pre spellcheck="false" tabindex="0">su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate"
</pre>

<p>12、启动实例以验证一切都按预期工作</p>

<pre spellcheck="false" tabindex="0">su pleroma -s $SHELL -lc "./bin/pleroma daemon"
</pre>

<p>13、等待大约 60 秒并检测实例运行状况，如果它正确地显示了您的网址、网站名称和电子邮件地址，则说明实例已经安装成功（update: 经建议，由 20 秒延长为 60 秒）</p>

<pre spellcheck="false" tabindex="0">sleep 60 &amp;&amp; curl http://localhost:4000/api/v1/instance
</pre>

<p>注：如果出现错误 "curl: (7) Failed to connect to localhost port 4000: Connection refused" ，请等待一会儿再此尝试，错误可能是 Pleroma 初次加载时间较慢导致的。</p>

<p>14、最后，暂时先暂停实例的运行</p>

<pre spellcheck="false" tabindex="0">su pleroma -s $SHELL -lc "./bin/pleroma stop"
</pre>

<h2 data-id="nginx-let-s-encrypt-ssl"><strong>三、设置 nginx 并获取 Let’s Encrypt SSL 证书</strong></h2>

<p>1、获取一个 Let’s Encrypt 证书（注意修改域名）</p>

<pre spellcheck="false" tabindex="0">certbot certonly --standalone --preferred-challenges http -d &lt;yourinstance.tld&gt;
</pre>

<p>2、输入您的邮箱地址（用于紧急重建和安全通知）并按照指示选择 A（agree）和 Y(yes)</p>

<p>*之前 Let’s Encrypt 曾撤销了一批有问题的证书，撤销前曾通过邮件进行通知，请务必留下一个有效的联系邮件。**</p>

<p>3、显示以下结果证明证书获取成功（否则尝试再次执行第一个指令）：</p>

<p>Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/&lt;实例域名&gt;/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/&lt;实例域名&gt;/privkey.pem Your cert will expire on &lt;到期日期&gt;. To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew <em>all</em> of your certificates, run "certbot renew"……（省略）</p>

<p>注：如果提示与我上面写的不同，请仔细检查证书有没有成功申请并存放到"/etc/letsencrypt/live/实例域名/"，若没有申请成功，后面依旧会卡住。</p>

<p>一般这一步出错有两种可能，第一，您没有添加 A 记录，请到域名注册网站添加或修改 A 记录；二，80 和 443 端口未开放，如果这里出现错误"Problem binding to port 80: Could not bind to IPv4 or IPv6."，请检查防火墙端口开放情况（Debian 需要额外安装 ufw）：<code spellcheck="false" tabindex="0">sudo ufw status verbose</code>，如果只有 22 端口开放，请通过 <code spellcheck="false" tabindex="0">sudo ufw allow 80/tcp</code>、<code spellcheck="false" tabindex="0">sudo ufw allow 443/tcp</code> 将 80 和 443 端口开放。(*备注)</p>

<p>操作完成后，再次输入指令，直到看到正确的成功提示。</p>

<p>4、复制 Pleroma nginx 配置到 nginx 文件夹</p>

<pre spellcheck="false" tabindex="0">cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.conf
ln -s /etc/nginx/sites-available/pleroma.conf /etc/nginx/sites-enabled/pleroma.conf
</pre>

<p>5、使用 nano 编辑器打开 Nginx 配置文件</p>

<pre spellcheck="false" tabindex="0">nano /etc/nginx/sites-available/pleroma.conf
</pre>

<p>6、将文件中所有 example.tld 更改为您的实例的对应名称（操控方向键滑动页面，用 backspace 删除默认名称，并输入新的地址即可）</p>

<p><em>注（未经验证）</em>：location 处只保留后面的<code spellcheck="false" tabindex="0">$</code>符号，删除前面的<code spellcheck="false" tabindex="0">$</code>符号）：</p>

<pre spellcheck="false" tabindex="0">location / {
  return         301 https://&lt;您的实例名&gt;$request_uri;
}
</pre>

<p>7、修改完毕后按 ctrl X，选择 Y（yes）保存，然后按 enter 退出</p>

<p>8、确认 nginx 是否配置正确</p>

<pre spellcheck="false" tabindex="0">nginx -t
</pre>

<p>出现以下内容则配置成功：</p>

<p>nginx: the configuration file /etc/nginx/nginx.conf syntax is ok<br />
nginx: configuration file /etc/nginx/nginx.conf test is successful</p>

<p>9、启动 nginx（若先前 nginx 已在运行则 reload <code spellcheck="false" tabindex="0">nginx -s reload</code>）</p>

<pre spellcheck="false" tabindex="0">systemctl start nginx
</pre>

<h2 data-id="n-a-3"><strong>四、设置系统服务</strong></h2>

<p>1、将 pleroma.service 复制到适当的文件夹中</p>

<pre spellcheck="false" tabindex="0">cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service
</pre>

<p>2、启动 pleroma 并设置开机自启动</p>

<pre spellcheck="false" tabindex="0">systemctl start pleroma
systemctl enable pleroma
</pre>

<p>在地址栏输入您的实例域名，若 pleroma 服务启动成功，则应显示 pleroma 页面；若显示 502 bad gateway，再次执行 systemctl start pleroma ，之后刷新页面</p>

<h2 data-id="let-s-encrypt"><strong>五、设置 Let’s Encrypt 证书的自动更新</strong></h2>

<p><em>这部分内容可以参考</em> → <a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fsuicablog.cobaltkiss.blue%2Fposts%2Fwildcard-with-cloudflare-using-certbot%2F">通配符域名证书申请与自动更新</a></p>

<p>1、创建路径</p>

<pre spellcheck="false" tabindex="0">mkdir -p /var/lib/letsencrypt
</pre>

<p>2、使用 nano 编辑器打开 Nginx 配置文件</p>

<pre spellcheck="false" tabindex="0">nano /etc/nginx/sites-available/pleroma.conf
</pre>

<p>3、去除<br />
location ~ /.well-known/acme-challenge { root /var/lib/letsencrypt/; }<br />
前的 # 注释符号</p>

<p>内容全部显示为白色后按 ctrl X，选择 Y（yes）保存，然后按 enter 退出</p>

<p>4、确认配置是否正确</p>

<pre spellcheck="false" tabindex="0">nginx -t
</pre>

<p>5、重启 nginx</p>

<pre spellcheck="false" tabindex="0">systemctl restart nginx
</pre>

<p>6、确认自动更新任务设置成功（注意修改域名）</p>

<pre spellcheck="false" tabindex="0">certbot renew --cert-name &lt;yourinstance.tld&gt; --webroot -w /var/lib/letsencrypt/ --dry-run --post-hook 'systemctl reload nginx'
</pre>

<p>显示以下内容则设置成功：<br />
Congratulations, all renewals succeeded. The following certs have been renewed: /etc/letsencrypt/live/yourinstance.tld/fullchain.pem (success)<br />
** DRY RUN: simulating 'certbot renew' close to cert expiry<br />
** (The test certificates above have not been saved.)</p>

<p>7、添加自动任务（注意修改域名）</p>

<pre spellcheck="false" tabindex="0">echo '#!/bin/sh
certbot renew --cert-name &lt;yourinstance.tld&gt; --webroot -w /var/lib/letsencrypt/ --post-hook "systemctl reload nginx"
' &gt; /etc/cron.daily/renew-pleroma-cert
chmod +x /etc/cron.daily/renew-pleroma-cert
</pre>

<p>8、确认任务添加成功</p>

<pre spellcheck="false" tabindex="0">run-parts --test /etc/cron.daily
</pre>

<p>若显示内容中包含 /etc/cron.daily/renew-pleroma-cert 则添加成功</p>

<h2 data-id="n-a-4"><strong>六、创建第一个用户并设置为管理员</strong></h2>

<p><code spellcheck="false" tabindex="0">&lt;joeuser&gt;</code> 处为管理员 ID，后面为管理员邮箱地址，根据自己情况设置</p>

<pre spellcheck="false" tabindex="0">cd /opt/pleroma/bin
su pleroma -s $SHELL -lc "./bin/pleroma_ctl user new &lt;joeuser&gt; &lt;joeuser@sld.tld&gt; --admin"
</pre>

<p>选择 [y] 后终端会出现一个链接，复制链接并粘贴到浏览器打开，为管理员账号设置密码，设置完毕即可进入实例页面。</p>

<p>一些可能对您有帮助的文章:</p>

<ul><li><a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fwiki.iroiro.party%2Fdoku.php%3Fid%3Dstart%26do%3Dindex">形形色色 - 各种的建站教程以及一些建站所需要的基本知识</a></li>
<li><a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fkyo.iroiro.party%2Fposts%2Fpleroma-building%2F">尽量细致的Pleroma搭建教程（仮）</a></li>
<li><a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fmindpalace.michaelis.website%2Ftech%2Ffedi-intro-trans.html">一份友好的联邦宇宙介绍</a></li>
<li><a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fdasgelobteland.github.io%2Fposts%2F22pleroma%2F">我的pleroma搭建笔记</a></li>
</ul>]]>
        </description>
    </item>
    <item>
        <title>arch服务器搭pleroma的两个小问题 (以及解决方案)</title>
        <link>https://fediverse.eu.org/discussion/24/arch%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%90%ADpleroma%E7%9A%84%E4%B8%A4%E4%B8%AA%E5%B0%8F%E9%97%AE%E9%A2%98-%E4%BB%A5%E5%8F%8A%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88</link>
        <pubDate>Fri, 29 Apr 2022 12:19:53 +0000</pubDate>
        <category>Pleroma</category>
        <dc:creator>3kirhs</dc:creator>
        <guid isPermaLink="false">24@/discussions</guid>
        <description><![CDATA[<p>在服务器上运行arch的都是勇士 <img src="https://fediverse.eu.org/resources/emoji/frowning.png" title=":(" alt=":(" height="20" /></p>

<h1 data-id="pleroma-systemd-service-arch">pleroma systemd service 在arch上跑不起来</h1>

<p>如果在config中设置了Exiftool的话</p>

<pre spellcheck="false" tabindex="0">config :pleroma, Pleroma.Upload, filters: [Pleroma.Upload.Filter.Exiftool]
</pre>

<p>即使装了exiftool (extra/perl-image-exiftool)，启动pleroma服务时他也会报错说找不到exiftool (not in path)。这是因为 archlinux 会把perl包放在 <code spellcheck="false" tabindex="0">/usr/bin/vendor_perl/</code> 下，并通过<code spellcheck="false" tabindex="0">/etc/profile.d/perlbin.sh</code>导入 PATH，而倒霉的systemd在加载服务的时候并不认这一套，所以会找不到exiftool的可执行文件而报错退出。</p>

<p>参考这个<a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fgit.pleroma.social%2Fpleroma%2Fpleroma%2F-%2Fissues%2F2443">issue</a></p>

<p>一个简单而愚蠢的方法是把exiftool 软链接到一个systemd认识的PATH里去，e.g.</p>

<pre spellcheck="false" tabindex="0">ln -s /usr/bin/core_perl/exiftool /usr/local/bin/exiftool
</pre>

<h1 data-id="postgresql">postgresql 更新</h1>

<p>众所周知arch是滚动升级的，而postgresql大版本之间的数据文件是不通用的，搞不好哪天pacman -Syu 就把数据库给扬了, 所以建议让pacman <a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fwiki.archlinux.org%2Ftitle%2FPacman%23Skip_package_from_being_upgraded">跳过对postgresql的更新</a></p>

<p>如果需要升级postgresql大版本，需要使用pg_upgrade工具迁移数据。如果你不幸忘记迁移数据就升级了postgresql，又把之前版本的postgres给删了，extra/postgresql-old-upgrade 贴心地提供了后悔药，它提供了上一个postgresql大版本的一些可执行文件。</p>

<p>总之，为了抢救数据库，需要做以下步骤：</p>

<pre spellcheck="false" tabindex="0"># 暂停postgresql服务
sudo sytemd stop postgresql

# 备份数据
mv /var/lib/postgres/data /var/lib/postgres/olddata

# 创建临时工作目录
mkdir /var/lib/postgres/data /var/lib/postgres/tmp
chown postgres:postgres /var/lib/postgres/data /var/lib/postgres/tmp

# 切换到 postgres 用户: 
sudo -iu postgres
cd /var/lib/postgres/tmp

# 初始化新版本postgresql的数据文件
# 注意此命令的相关参数要和创建旧版本数据库时一致，如果数据库是按照pleroma默认安装教程创建的，可以使用如下的命令。
initdb -D /var/lib/postgres/data 

# 迁移数据
# 将&lt;PG_VERSION&gt;替换为上个版本号，例如从psql 13升级到14，这里就填13。
pg_upgrade -b /opt/pgsql-&lt;PG_VERSION&gt;/bin -B /usr/bin -d /var/lib/postgres/olddata

# 重启数据库
sudo systemd restart postgresql
</pre>

<p>注: 视情况可能需要对pleroma进行迁移 (mix ecto.migrate) 或者对数据库进行REINDEX</p>

<p>ref <a rel="nofollow" href="/home/leaving?target=https%3A%2F%2Fwiki.archlinux.org%2Ftitle%2FPostgreSQL%23pg_upgrade">https://wiki.archlinux.org/title/PostgreSQL#pg_upgrade</a></p>
]]>
        </description>
    </item>
   </channel>
</rss>
