Drawpile 联机绘画服务器搭建 – 幻想郷 ~ Gensōkyō ~

您所在的位置:网站首页 绘画软件茶绘 Drawpile 联机绘画服务器搭建 – 幻想郷 ~ Gensōkyō ~

Drawpile 联机绘画服务器搭建 – 幻想郷 ~ Gensōkyō ~

2024-07-17 15:49| 来源: 网络整理| 查看: 265

Drawpile 茶绘服务器搭建

Drawpile[1] 是一个免费、开源的茶绘平台,在 Windows、Linux 和 MacOS 甚至 Android 平台都有客户端。

logo.6e1efcf24cd6

根据我自己在 Windows 端测试的结果,其对于数位板的驱动支持也较好,压感什么的都正常,功能也比较全面,其实作为一款绘画软件也未尝不可。

20231016234754

作为茶绘软件,可以让多人联机作画,但他的服务器在国外,国内连接可能会掉线,体验不是很好。但官方也放出了自己搭建服务器的方法,下面简要介绍一下。

注意:服务端目前只有 x86 平台的, arm 平台暂时没法搭服务器 ← 可惜了一帮低功耗电视盒子

利用 docker(Portainer) 搭建

docker 容器是非常方便的东西,基本上能够做到开箱即用,而且在多个平台上可以部署。这里考虑是 x86 平台,而且作为服务器要长时间开机,考虑在 NAS 设备上部署。

我所用的 NAS 型号是 QNAP TS-451D,搭载 Intel J4025 双核双线程垃圾处理器,装了 8G 内存。处理器是 J4125 神U同代产品,只不过少了一半的核心……

其实在哪里部署都一样,QNAP 的话自带有 Container Station 可以直接用,也可以在应用市场里面下载 Portainer 来管理 docker 容器,我个人更倾向于后者。没有其他的原因,自带的 Container Station 在配置和后续升级上操作很反人类,Portainer 同为图形化界面,但配置起来要好用的多。

20231016235901

portainer 当然也可以通过终端命令部署,如果你用的不是 NAS 的话。当然这点不在这篇笔记的范畴之内。

首先建立一个文件夹,用于 Drawpile 容器的文档交互。然后进入 Portainer 内添加一个容器。配置参考下图:

20231017203147

下面 Advanced container settings 中,Command 选择 Override,填写

--sessions /home/drawpile/sessions --config /home/drawpile/config.cfg

意思是,指定 Drawpile 的会话保存在 /home/drawpile/sessions 文件夹,服务器使用文件 /home/drawpile/config.cfg 作为配置文件。

切到 Volume 标签,给容器链接文件夹:

20231017203634

Container 后面填写 /home/drawpile ,host 后面填写前面刚刚给 Drawpile 建立的文件夹路径。

最后切到 Restart policy 页签,选择 On failure 或者 Always。

确认没问题后,就点击 Deploy container 按钮开始部署容器。如果网络没问题的话,容器应该在半分钟之内就能部署完成并启动。

容器启动后,就可以去软件里试试能不能连接上。

20231017204236

20231017204456

没什么问题的话应该能正常连接上。

编写配置文件 config.cfg

之前部署容器的时候我们指定了配置文件路径和名称,但实际上这个文件目前还不存在,服务器使用了默认参数启动。下面我们来编写这个文件。

定位到之前给 Drawpile 建立的文件夹(如果之前进行了连接测试,这里应该有一个 sessions 文件夹)。在这个文件夹下新建一个文件起名 config.cfg ,并打开编辑。粘贴并按需求修改以下文本:

[config] sessionSizeLimit = 15MB sessionCountLimit = 25 idleTimeLimit = 3h title = Welcome to my test server! welcomeMessage= Welcome to my test server! announceWhiteList = true persistence = true archive=true [announceWhitelist] https://drawpile.net/api/sessions/ [ipbans] 192.168.1.1 10.0.0.1/16 [users] username:plain;password:MOD,HOST

persistance = true 指定了持久会话,即使最后一名用户离开,会话也不会被终止。这样,即使临时离开会话,也可以稍后重新登入此会话。 idleTimeLimit = 3h 指定了会话的闲置过期时间。离最后一次活跃行为超过此时间,会话会被终止。这包括了上面指定的持久会话,也包含了挂机行为!(即使还有用户在会话中,但没有活跃行为超过这里指定的时间,会话也会终止) archive = true 指定了结束的会话会被存档而非销毁。会话会被保存在 sessions 文件夹中,以 .archived 作为后缀。 最后 [users] 块中可以指定注册用户,以 username:plain;password:identity 格式指定。指定为 MOD 的用户具有高权限,可以进入密码房,以及执行管理员命令。

更多设置请参考下面的内容[2]:

较长,折叠处理展开/折叠 namespace config { static const ConfigKey ClientTimeout(0, "clientTimeout", "60", ConfigKey::TIME), // Connection ping timeout for clients SessionSizeLimit(1, "sessionSizeLimit", "99mb", ConfigKey::SIZE), // Session history size limit in bytes SessionCountLimit(2, "sessionCountLimit", "25", ConfigKey::INT), // Maximum number of active sessions (int) EnablePersistence(3, "persistence", "false", ConfigKey::BOOL), // Enable session persistence (bool) AllowGuestHosts(4, "allowGuestHosts", "true", ConfigKey::BOOL), // Allow guests (or users without the HOST flag) to host sessions IdleTimeLimit(5, "idleTimeLimit", "0", ConfigKey::TIME), // Session idle time limit in seconds (int) ServerTitle(6, "serverTitle", "", ConfigKey::STRING), // Server title (string) WelcomeMessage(7, "welcomeMessage", "", ConfigKey::STRING), // Message sent to a user when they join a session (string) AnnounceWhiteList(8, "announceWhitelist", "false", ConfigKey::BOOL), // Should the announcement server whitelist be used (bool) PrivateUserList(9, "privateUserList", "false", ConfigKey::BOOL), // Don't include user list in announcement AllowGuests(10, "allowGuests", "true", ConfigKey::BOOL), // Allow unauthenticated users ArchiveMode(11, "archive", "false", ConfigKey::BOOL), // Don't delete terminated session files UseExtAuth(12, "extauth", "false", ConfigKey::BOOL), // Enable external authentication ExtAuthKey(13, "extauthkey", "", ConfigKey::STRING), // ExtAuth signature verification key ExtAuthGroup(14, "extauthgroup", "", ConfigKey::STRING), // ExtAuth user group (leave blank for default set) ExtAuthFallback(15, "extauthfallback", "true", ConfigKey::BOOL), // Fall back to guest logins if ext auth server is unreachable ExtAuthMod(16, "extauthmod", "true", ConfigKey::BOOL), // Respect ext-auth user's "MOD" flag ExtAuthHost(17, "extauthhost", "true", ConfigKey::BOOL), // Respect ext-auth user's "HOST" flag AbuseReport(18, "abusereport", "false", ConfigKey::BOOL), // Enable abuse report (server address must have been set) ReportToken(19, "reporttoken", "", ConfigKey::STRING), // Abuse report backend server authorization token LogPurgeDays(20, "logpurgedays", "0", ConfigKey::INT), // Automatically purge log entries older than this many days (DB log only) AutoresetThreshold(21, "autoResetThreshold", "15mb", ConfigKey::SIZE), // Default autoreset threshold in bytes AllowCustomAvatars(22, "customAvatars", "true", ConfigKey::BOOL), // Allow users to set a custom avatar when logging in ExtAuthAvatars(23, "extAuthAvatars", "true", ConfigKey::BOOL), // Use avatars received from ext-auth server (unless a custom avatar has been set) ForceNsfm(24, "forceNsfm", "false", ConfigKey::BOOL), // Force NSFM flag to be set on all sessions // URL to source an external ban list from. ExtBansUrl(25, "extBansUrl", "", ConfigKey::STRING), // How often to refresh the external ban list (minimum 1 minute.) ExtBansCheckInterval(26, "extBansCheckInterval", "900", ConfigKey::TIME), // Last URL used to fetch bans. Internal value used for caching. ExtBansCacheUrl(27, "extBansCacheUrl", "", ConfigKey::STRING), // Last cache key from external bans. Internal value used for caching. ExtBansCacheKey(28, "extBansCacheKey", "", ConfigKey::STRING), // Last external bans response. Internal value used for caching. ExtBansCacheResponse(29, "extBansCacheResponse", "", ConfigKey::STRING), // Respect ext-auth user's "BANEXEMPT" flag. ExtAuthBanExempt(30, "extauthbanexempt", "true", ConfigKey::BOOL); }

编写完成后保存即可,不需要重新启动容器,Drawpile 服务器会自动读取以及应用新的设置文档。然后可以进软件测试设置是否正常生效。

到这里,一个独立 Drawpile 服务器已经搭建完成,可以在局域网或者公网(如果你的服务器设备有公网 ip 的话)正常访问。如果服务器在内网,又想在公网访问的话可以使用 frp,教程不在本篇笔记中记载。

https://drawpile.net/ ↩︎

https://github.com/drawpile/Drawpile/blob/main/src/libserver/serverconfig.h ↩︎



【本文地址】


今日新闻


推荐新闻


    CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3