分类 原创文章 下的文章

runuo.png

sudo apt install dirmngr ca-certificates gnupg
sudo gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/debian stable-buster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update

sudo apt install mono-devel mono-complete mono-dbg referenceassemblies-pcl ca-certificates-mono mono-xsp4

作者: reistlin
来源: http://www.reistlin.com/blog/470
更新时间: 2024.06
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

runuo.png

一,下载

RunUO 2.0 下载:
[https://github.com/runuo/runuo/tree/releases/2.0]

Neruns Distro 5.2.1a 下载:
[https://github.com/nerun/runuo-nerun-distro/releases/tag/Old-521a]

ClassicUO 下载:
[https://github.com/ClassicUO/ClassicUO]

Ultima Online Mondains Legacy 蒙丹遗产:
[Client Patch 5.0.9.1]

二,安装

1)解压缩 RunUO-2.0 和 NerunsDistro.v5.2.1a

2)将 NerunsDistro.v5.2.1a 文件夹下的 DataScripts 两个文件夹 复制(覆盖) 到 RunUO-2.0

3)复制 zlib32.dllzlib64.dll 文件到 RunUO-2.0

4)进入 RunUO-2.0,新建 Build.bat 文件:

@echo off

chcp 65001
echo.

echo ================ 删除 RunUO.exe ================
echo.
del /s /q /s "%~dp0RunUO.exe"
echo.

timeout /t 1

echo.
echo ================ 编译 RunUO.exe ================
echo.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc /optimize /unsafe /t:exe /out:RunUO.exe /win32icon:Server\runuo.ico /d:NEWTIMERS /d:NEWPARENT /recurse:Server\*.cs
echo 编译完成...

timeout /t 5

5)运行 Build.bat 文件。完成 .NET 编译,生成 RunUO.exe 文件。

runuo_build.png

三,配置

1)设置 UO 服务器名称
编辑文件:Scripts\Misc\ServerList.cs

public static readonly string ServerName = "RunUO TC";
为:
public static readonly string ServerName = "REISTLIN";

2)设置 UO 服务器客户端(蒙丹遗产 UOML v5.0.9.1)路径
编辑文件:Scripts\Misc\DataPath.cs

private static string CustomPath = null;
为:
private static string CustomPath = @"D:\Games\Ultima Online ML (5.0.9.1)";

3)设置 UO 服务器支持客户端版本(Client Patch < v6.0.0.0
编辑文件:Scripts\Misc\MapDefinitions.cs

RegisterMap( 1, 1, 1, 7168, 4096, 0, "Trammel",		MapRules.TrammelRules );
为:
RegisterMap( 1, 1, 0, 7168, 4096, 0, "Trammel",		MapRules.TrammelRules );
以及:
TileMatrixPatch.Enabled = false;
为:
TileMatrixPatch.Enabled = true;

四,启动

1)运行 RunUO.exe

runuo_init.png

2)设置 ClassicUO Launcher 客户端登录

runuo_login.png

3)登录游戏,点击界面或者输入命令:

[PremiumSpawner

启动 Premium Spawner Engine 世界初始化界面,根据需要自动生成各个地图物品、NPC。

runuo_admin.png

4)RunUO GM 命令:[https://runuo.github.io/runuo/docs/commands.html]

五,UO 中文配置

1)UO 客户端配置文件:Uo.cfg

UserLanguageCodeString=CHT

2)ClassicUO Launcher 配置文件:ClassicUO Launcher\ClassicUO\settings.json

"lang": "CHT",

采编: reistlin
来源: Internet 互联网
更新时间: 2024.04
版权声明: <<了解这个世界>>系列文章.转载请保留作者信息和原文完整.

knowledge.png

mandelbrot_sequence.gif

曼德博集合(Mandelbrot Set,或译为曼德布洛特复数集合)是一种在复平面上组成分形的点的集合,以数学家本华·曼德博的名字命名。曼德博集合与朱利亚集合有些相似的地方,例如使用相同的复二次多项式来进行迭代。

mandel_zoom_00_mandelbrot_set.jpg

- 阅读剩余部分 -

作者: reistlin
来源: http://www.reistlin.com/blog/444
更新时间: 2024.04
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

uo.png

UO Outlands:[https://uooutlands.com]
UO Razor Assistant:[https://www.razorce.com]

一,关闭 UO 客户端,编辑 default.xml 文件

游戏目录\ClassicUO\Data\Plugins\Assistant\Profiles\default.xml

二,替换 XML 标签 overheadmessages 之间的内容

<overheadmessages>
	<overheadmessage searchtext="The world will save in 15 seconds" message="* 服务器准备保存 *" hue="53" />
	<overheadmessage searchtext="The world is saving, please wait" message="* 服务器正在保存 *" hue="38" />
	<overheadmessage searchtext="World save complete" message="* 服务器保存完成 *" hue="68" />
	<overheadmessage searchtext="Captcha successful" message="* 验证成功 *" hue="68" />
	<overheadmessage searchtext="You are now under the protection of the town guards" message="* 进入城镇(安全) *" hue="68" />
	<overheadmessage searchtext="You have left the protection of the town guards" message="* 离开城镇(危险) *" hue="53" />
	<overheadmessage searchtext="You enter the rental room" message="* 进入房间(租用) *" hue="68" />
	<overheadmessage searchtext="You exit the rental room" message="* 离开房间(租用) *" hue="53" />
	<overheadmessage searchtext="You begin applying the bandages" message="* 开始绷带 *" hue="88" />
	<overheadmessage searchtext="You finish applying the bandages" message="* 绷带完成 *" hue="68" />
	<overheadmessage searchtext="You begin using veterinary supplies" message="* 开始绷带(宠物) *" hue="88" />
	<overheadmessage searchtext="You finish using veterinary supplies" message="* 绷带完成(宠物) *" hue="68" />
	<overheadmessage searchtext="You are able to resurrect your follower" message="* 绷带复活(宠物) *" hue="68" />
	<overheadmessage searchtext="You fail to resurrect one or more of your followers" message="* 绷带复活(失败) *" hue="38" />
	<overheadmessage searchtext="Passive taming skill gain available" message="* 获得技能(驯兽) *" hue="68" />
	<overheadmessage searchtext="You enter a meditative trance" message="* 开始冥想 *" hue="68" />
	<overheadmessage searchtext="You stop meditating" message="* 停止冥想 *" hue="68" />
	<overheadmessage searchtext="You cannot focus your concentration" message="* 冥想失败 *" hue="53" />
	<overheadmessage searchtext="You are currently prevented from" message="* 禁止拾取 *" hue="53" />
	<overheadmessage searchtext="Magical travel is not allowed in this location" message="* 禁止传送 *" hue="53" />
	<overheadmessage searchtext="You are too fatigued to move" message="* 已超重 *" hue="38" />
	<overheadmessage searchtext="You charge your spell with additional energy" message="* 法术充能 *" hue="88" />
	<overheadmessage searchtext="You absorb their spell" message="* 法术吸收 *" hue="88" />
	<overheadmessage searchtext="You parry the spell" message="* 法术格挡 *" hue="88" />
	<overheadmessage searchtext="Being perfectly rested, you shove them out of the way" message="* 推开 *" hue="88" />
	<overheadmessage searchtext="Your attack causes your target to bleed" message="* 流血 *" hue="88" />
	<overheadmessage searchtext="You smash through the remainder" message="* 破甲 *" hue="88" />
	<overheadmessage searchtext="Your shot hinders your target" message="* 定身 *" hue="88" />
	<overheadmessage searchtext="Your lightning spell hinders your target" message="* 定身(闪电) *" hue="88" />
	<overheadmessage searchtext="You cause your target to bleed out" message="* 终结技(BleedOut) *" hue="88" />
	<overheadmessage searchtext="You execute your target" message="* 终结技(Execute) *" hue="88" />
	<overheadmessage searchtext="Crafting queue begun" message="* 开始制造(队列) *" hue="68" />
	<overheadmessage searchtext="Crafting queue stopped" message="* 停止制造(队列) *" hue="53" />
	<overheadmessage searchtext="Crafting queue complete" message="* 制造完成(队列) *" hue="68" />
	<overheadmessage searchtext="You create the item" message="* 制造成功 *" hue="68" />
	<overheadmessage searchtext="You create an exceptional quality item" message="* 制造成功(卓越) *" hue="68" />
	<overheadmessage searchtext="You failed to create the item" message="* 制造失败 *" hue="53" />
	<overheadmessage searchtext="You pour the potion into a bottle" message="* 制造成功 *" hue="68" />
	<overheadmessage searchtext="You fail to create a useful potion" message="* 制造失败 *" hue="53" />
	<overheadmessage searchtext="You don't have the resources required to make that item" message="* 缺少制造材料 *" hue="53" />
	<overheadmessage searchtext="You have worn out your tool" message="* 工具损坏 *" hue="38" />
	<overheadmessage searchtext="Target an individual item to recycle" message="* 选择物品(回收) *" hue="53" />
	<overheadmessage searchtext="You successfully steal the item" message="* 偷窃成功 *" hue="68" />
	<overheadmessage searchtext="You fail in your stealing attempt" message="* 偷窃失败 *" hue="38" />
	<overheadmessage searchtext="Now tracking" message="* 目标 {3} *" hue="38" />
	<overheadmessage searchtext="Distance to destination" message="* 目标距离 {4} *" hue="38" />
	<overheadmessage searchtext="You cannot cast a spell while frozen" message="* 无法施法 *" hue="38" />
	<overheadmessage searchtext="You cannot move" message="* 无法移动 *" hue="38" />
	<overheadmessage searchtext="You must wait another" message="* 冷却 {5} 秒 *" hue="53" />
	<overheadmessage searchtext="Target cannot be seen" message="* 目标不在视野 *" hue="53" />
	<overheadmessage searchtext="You cannot see that from here" message="* 目标不在视野 *" hue="53" />
	<overheadmessage searchtext="That is too far away" message="* 距离太远 *" hue="53" />
	<overheadmessage searchtext="That vendor is too far away from you" message="* 距离太远(商人) *" hue="53" />
	<overheadmessage searchtext="You are too far away to use that" message="* 距离太远(物品) *" hue="53" />
	<overheadmessage searchtext="Target is too far away." message="* 距离太远(目标) *" hue="53" />
	<overheadmessage searchtext="You or your nearby followers do not require healing" message="* 距离太远(宠物) *" hue="53" />
	<overheadmessage searchtext="You do not have enough holy symbols for that ability" message="* 神圣符文不足 *" hue="53" />
	<overheadmessage searchtext="You consume a magic mushroom and restore some mana" message="* 魔法蘑菇(已使用) *" hue="68" />
	<overheadmessage searchtext="You may now use another magic mushroom" message="* 魔法蘑菇(已冷却) *" hue="88" />
	<overheadmessage searchtext="You have been in combat" message="* 战斗状态中 *" hue="53" />
	<overheadmessage searchtext="That spell will not adhere to you at this time" message="* 法术冷却中 *" hue="53" />
	<overheadmessage searchtext="You are already casting a spell" message="* 施法进行中 *" hue="53" />
	<overheadmessage searchtext="You have not yet recovered from casting a spell" message="* 施法恢复中 *" hue="53" />
	<overheadmessage searchtext="Your concentration is disturbed, thus ruining thy spell" message="* 施法被干扰 *" hue="38" />
	<overheadmessage searchtext="You must wait to perform another action" message="* 等待动作完成 *" hue="53" />
	<overheadmessage searchtext="You must wait a few moments to use another skill" message="* 等待技能完成 *" hue="53" />
	<overheadmessage searchtext="You must wait a few moments before you may use this item again" message="* 等待物品完成 *" hue="53" />
	<overheadmessage searchtext="You must wait another moment before you may pick up an item from here" message="* 等待拾取物品 *" hue="53" />
	<overheadmessage searchtext="The recipient of this trade would not be able to carry this" message="* 对方无法接收 *" hue="53" />
	<overheadmessage searchtext="There are no charges left on that item" message="* 剩余次数用完 *" hue="53" />
	<overheadmessage searchtext="You do not have that spell" message="* 没有这个法术 *" hue="53" />
	<overheadmessage searchtext="You must be near an anvil and a forge to smith items" message="* 没有锻炉铁砧 *" hue="53" />
	<overheadmessage searchtext="You place the gathered wool into your backpack" message="* 收集羊毛 *" hue="88" />
	<overheadmessage searchtext="You begin to move quietly" message="* 开始潜行 *" hue="88" />
	<overheadmessage searchtext="You feel comfortable enough to begin stealthing	" message="* 开始潜行 *" hue="88" />
	<overheadmessage searchtext="You feel ready to continue stealthing" message="* 继续潜行 *" hue="88" />
	<overheadmessage searchtext="You will automatically stealth when out of steps" message="* 继续潜行 *" hue="88" />
	<overheadmessage searchtext="Lock what down" message="* 锁定(Lock) *" hue="68" />
	<overheadmessage searchtext="Choose the item you wish to secure" message="* 保护(Secure) *" hue="68" />
	<overheadmessage searchtext="Choose the item you wish to release" message="* 解锁(Release) *" hue="38" />
	<overheadmessage searchtext="You cannot pick that up" message="* 无法拾取物品 *" hue="53" />
</overheadmessages>

三,启动游戏,Razor > General > Profiles 选择 default。

Outlands.jpg

作者: reistlin
来源: http://www.reistlin.com/blog/447
更新时间: 2024.03
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

azerothcore.png

AzerothCore 主页:[https://www.azerothcore.org]
AzerothCore Wiki 文档:[https://www.azerothcore.org/wiki/home]

一,使用 screen 启动 worldserver

1、安装 screen:

apt-get install screen

2、使用 screen 启动 worldserver,窗口名称为:worldserver

cd /home/reistlin/azerothcore/bin
screen -S worldserver
./worldserver

3、退出当前 screen 窗口

Ctrl + a键 d键

4、查看 screen 窗口状态

reistlin@Debian:~/azerothcore/bin$ screen -ls
There is a screen on:
        112233.worldserver      (03/20/2024 10:00:00 AM)        (Attached)
1 Socket in /run/screen/S-reistlin.

二,使用 restart.sh 重启 AzerothCore

acore_screen:screen 窗口名称(默认:worldserver)
acore_path:AzerothCore 系统根目录(默认:/home/reistlin/azerothcore)
acore_delay:服务器计划重启时间,默认 60 秒后重启,同时通知所有在线玩家
app_user:运行 worldserver 的用户名称

#!/bin/bash

# name: restart AzerothCore by screen v0.1 (Linux Server)
# author: reistlin
# website: www.reistlin.com
# date: 2024.03.20

acore_screen="worldserver"
acore_path="/home/reistlin/azerothcore"
acore_delay="60"

app_user="reistlin"
app_process="SCREEN -S ${acore_screen}"
app_port="8085"

check1=`ps v -U ${app_user} | grep "${app_process}" | grep -v "grep" | wc -l`
check2=`netstat -nlpt | grep ":${app_port}" | wc -l`

if [ "${check1}" -eq 1 ] && [ "${check2}" -eq 1 ]; then
	# save
	screen -x -S ${acore_screen} -p 0 -X stuff "save\n"          
	sleep 1

	# shutdown
	screen -x -S ${acore_screen} -p 0 -X stuff "server shutdown ${acore_delay}\n"
	sleep `expr ${acore_delay} + 3`

	# start
	screen -x -S ${acore_screen} -p 0 -X stuff "${acore_path}/bin/worldserver\n"
	sleep 1

	# logfile
	echo "[`date "+%Y-%m-%d %H:%M:%S"`] ${acore_screen} service has successfully restarted" >> $HOME/crontab/restart.log
else
	echo "[EXIT] Not found worldserver by screen"
fi

编辑 crontab,设置每天凌晨 6 点自动重启

# restart AzerothCore worldserver
0  6 * * * /home/reistlin/crontab/restart.sh > /dev/null 2>&1

作者: reistlin
来源: http://www.reistlin.com/blog/439
更新时间: 2023.07
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

azerothcore.png

AzerothCore 主页:[https://www.azerothcore.org]
AzerothCore Wiki 文档:[https://www.azerothcore.org/wiki/home]
Eluna Lua Engine 主页:[https://github.com/azerothcore/mod-eluna]
Eluna Lua Engine API 文档:[https://www.azerothcore.org/pages/eluna/index.html]

一,安装 MySQL 8.0

wget https://repo.mysql.com//mysql-apt-config_0.8.29-1_all.deb -O /tmp/mysql-apt-config_all.deb

apt-get install gnupg

Debian 11

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AABBCC1122334455

Debian 12

gpg --keyserver keyserver.ubuntu.com --recv-keys AABBCC1122334455
gpg --export --armor AABBCC1122334455 | apt-key add
apt-get update
apt-get upgrade

dpkg -i /tmp/mysql-apt-config_all.deb

apt-get update

二,安装编译环境

apt-get install git clang cmake make gcc g++ libmysqlclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev libboost-all-dev mysql-server p7zip

三,通过 alternatives 设置 clang 版本

update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 100

四,通过 git clone 下载 AzerothCore,同时安装 mod-ah-bot 和 mod-eluna

cd /home/reistlin
mkdir AzerothCore
git clone https://github.com/azerothcore/azerothcore-wotlk.git --branch master --single-branch AzerothCore --depth 1
cd AzerothCore/modules
git clone https://github.com/azerothcore/mod-ah-bot.git
git clone https://github.com/azerothcore/mod-eluna.git

五,编译安装

cd /home/reistlin/AzerothCore
mkdir build
cd build

cmake ../ -DCMAKE_INSTALL_PREFIX=/home/reistlin/azerothcore/ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DWITH_WARNINGS=1 -DTOOLS_BUILD=all -DSCRIPTS=static -DMODULES=static

make -j 8
make install

六,MySQL 设置

mysql -u root -p

DROP USER IF EXISTS 'acore'@'localhost';
CREATE USER 'acore'@'%' IDENTIFIED BY 'NEWPASSWORD';
GRANT ALL PRIVILEGES ON * . * TO 'acore'@'%';
GRANT ALL PRIVILEGES ON `acore_world` . * TO 'acore'@'%';
GRANT ALL PRIVILEGES ON `acore_characters` . * TO 'acore'@'%';
GRANT ALL PRIVILEGES ON `acore_auth` . * TO 'acore'@'%';
exit

作者: reistlin
来源: http://www.reistlin.com/blog/438
更新时间: 2023.07
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

windows.png

一,下载 [Microsoft.VCLibs.140.00_14.0.26706.0.x86.x64.zip]

二,开始 -> 运行 -> PowerShell

powershell

32 位系统:

Add-AppxPackage -Path D:\Microsoft.VCLibs.140.00_14.0.26706.0_x86__8wekyb3d8bbwe.Appx

64 位系统:

Add-AppxPackage -Path D:\Microsoft.VCLibs.140.00_14.0.26706.0_x64__8wekyb3d8bbwe.Appx

三,重新启动

解决 Windows 10 LTSC 启动缺少 VCLib 导致 AppXSVC 服务 CPU 占用高、微软拼音输入法不显示候选词问题。

作者: reistlin
来源: http://www.reistlin.com/blog/436
更新时间: 2023.05
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

linux.pngcentos.png

一,升级 CentOS 6 openssl 1.0.2u

查看 CentOS 6 openssl 版本,默认为 1.0.1e
也可以用 yum info openssl 查看 CentOS6 默认版本信息

[reistlin@reistlin ~]$ openssl version  
OpenSSL 1.0.1e-fips 11 Feb 2013

wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz --no-check-certificate
tar zxvf openssl-1.0.2u.tar.gz
cd openssl-1.0.2u
./config
make depend
make
make test
make install

默认安装路径:/usr/local/ssl/bin/openssl

安装完成后再次确认版本,升级成功

[reistlin@reistlin ~]$ openssl version
OpenSSL 1.0.2u  20 Dec 2019

二,安装 libressl 2.7.5

wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.7.5.tar.gz --no-check-certificate
tar zxvf libressl-2.7.5.tar.gz
cd libressl-2.7.5
./configure --prefix=/usr/local
make
make install

vim /etc/ld.so.conf

/usr/local/lib
/usr/local/lib64

ldconfig -v

三,安装 CentOS 6 Python 3.8.9

wget https://www.python.org/ftp/python/3.8.9/Python-3.8.9.tgz
tar zxvf Python-3.8.9.tgz
cd Python-3.8.9

vim Modules/Setup

取消下面 4 行注释,启用 libressl

# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
        -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
        -L$(SSL)/lib -lssl -lcrypto

./configure --prefix=/usr/local/python3 --enable-optimizations --with-openssl=/usr/local/ssl/
make
make install

四,解决 CentOS 6 编译安装 Python 3.8.9 openSSL 报错问题:

Could not build the ssl module! Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host(). LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381

作者: reistlin
来源: http://www.reistlin.com/blog/434
更新时间: 2023.02
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

linux.pngsynology.png

一,Ubuntu 16.04.7 配置(VMware x86 64bit)

1,下载安装 [Ubuntu 16.04],内核版本 4.4(非常重要!需要与群晖 Synology DSM 6.2.4 版本一致

uname -a
Linux ubuntu 4.4.0-186-generic #216-Ubuntu SMP Wed Jul 1 05:34:05 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/os-release

NAME="Ubuntu"
VERSION="16.04.7 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.7 LTS"
VERSION_ID="16.04"

2,安装 ubuntu 编译环境

apt-get install --no-install-recommends gettext build-essential autoconf libtool libpcre3-dev asciidoc xmlto libev-dev libc-ares-dev automake libmbedtls-dev libsodium-dev pkg-config

3,交叉编译安装 libsodium-1.0.16,安装路径: /usr

下载 Synology DSM 6.2.4 Tool Chains 环境
选择 DS220+ 对应的 Intel x86 Linux 4.4.59 (GeminiLake) 目录
选择 geminilake-gcc493_glibc220_linaro_x86_64-GPL.txz 下载

wget https://sourceforge.net/projects/dsgpl/files/Tool%20Chain/DSM%206.2.4%20Tool%20Chains/Intel%20x86%20Linux%204.4.59%20%28GeminiLake%29/geminilake-gcc493_glibc220_linaro_x86_64-GPL.txz/download
tar Jxvf geminilake-gcc493_glibc220_linaro_x86_64-GPL.txz
cd x86_64-pc-linux-gnu

配置环境变量,启用 DSM 6.2.4 Tool Chains 交叉编译 libsodium-1.0.16

export PATH="/root/x86_64-pc-linux-gnu/bin:$PATH"
export CC=/root/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc
export LD=/root/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ld
export RANLIB=/root/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ranlib
export CFLAGS="-I/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/include"
export LDFLAGS="-L/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/lib"

交叉编译安装 libsodium-1.0.16,安装路径: /usr

wget https://download.libsodium.org/libsodium/releases/old/libsodium-1.0.16.tar.gz
tar zxvf libsodium-1.0.16.tar.gz
cd libsodium-1.0.16
./configure --prefix=/usr
make
make install
ldconfig

4,编译安装 mbedtls-2.6.1,安装路径: /usr

wget https://codeload.github.com/Mbed-TLS/mbedtls/tar.gz/refs/tags/mbedtls-2.6.1
tar zxvf mbedtls-mbedtls-2.6.1.tar.gz
cd mbedtls-mbedtls-2.6.1
make SHARED=1 CFLAGS="-O2 -fPIC"
make DESTDIR=/usr install
ldconfig

5,编译安装 shadowsocks-libev,安装路径: /root/shadowsocks

wget https://github.com/shadowsocks/shadowsocks-libev/releases/download/v3.3.5/shadowsocks-libev-3.3.5.tar.gz
tar zxvf shadowsocks-libev-3.3.5.tar.gz 
cd shadowsocks-libev-3.3.5
autoreconf --install --force
./configure --prefix=/root/shadowsocks --with-sodium-include=/usr/include --with-sodium-lib=/usr/lib --with-mbedtls-include=/usr/include --with-mbedtls-lib=/usr/lib
make
make install

注意!./configure 需要指定 libsodium-1.0.16 和 mbedtls-2.6.1 的 include 和 lib 路径,否则 make 时会报错

ss_local-aead.o: In function `aead_cipher_decrypt'':
/root/pkgs/shadowsocks-libev-3.3.5/src/aead.c:239: undefined reference to `crypto_aead_xchacha20poly1305_ietf_decrypt''
ss_local-aead.o: In function `aead_cipher_encrypt'':
/root/pkgs/shadowsocks-libev-3.3.5/src/aead.c:192: undefined reference to `crypto_aead_xchacha20poly1305_ietf_encrypt''
collect2: error: ld returned 1 exit status

6,复制 ubuntu 系统 so 文件到 /root/shadowsocks/lib/ 目录,用于后续群晖 DSM 6.2.4 系统正常运行依赖。总计 4 个文件:

libev.so.4.0.0
libpcre.so.3.13.2
libsodium.so.23.1.0
libmbedcrypto.so.0

cd /root/shadowsocks/lib/
cp -a /usr/lib/x86_64-linux-gnu/libev.so.4.0.0 .
cp -a /lib/x86_64-linux-gnu/libpcre.so.3.13.2 .
cp -a /usr/lib/libsodium.so.23.1.0 .
cp -a /usr/lib/libmbedcrypto.so.0 .

7,新建 shell 脚本,用于后续 so 文件 symbolic link 到群晖 DSM 6.2.4 系统 /usr/lib/ 目录

vim /root/shadowsocks/lib/libshadowsocks-libev.sh

#!/bin/sh

ln -s /root/shadowsocks/lib/libev.so.4.0.0 /usr/lib/libev.so.4
ln -s /root/shadowsocks/lib/libpcre.so.3.13.2 /usr/lib/libpcre.so.3
ln -s /root/shadowsocks/lib/libsodium.so.23.1.0 /usr/lib/libsodium.so.23
ln -s /root/shadowsocks/lib/libmbedcrypto.so.0 /usr/lib/libmbedcrypto.so.0

chmod 755 /root/shadowsocks/lib/libshadowsocks-libev.sh

8,完成所有配置,压缩打包 /root/shadowsocks 目录为 shadowsocks.tar.gz,下载。

cd /root
tar zcvf shadowsocks.tar.gz shadowsocks

二,群晖 DS220+ 配置(Synology DS220+ Intel Celeron J4025 Geminilake)

1,将 shadowsocks.tar.gz 上传至群晖 DS220+

2,切换群晖 root 用户

sudo -i

3,进入 root 目录,解压缩 shadowsocks.tar.gz
运行 shadowsocks/lib 目录下的 libshadowsocks-libev.sh
将 so 文件 symbolic link 到 /usr/lib/

cd /root
tar zxvf shadowsocks.tar.gz
cd shadowsocks/lib
./libshadowsocks-libev.sh

4,正式启动,运行 ss-local,-c 参数指定 jsoin 配置文件,-f 参数指定 pid 文件
默认加密方法:chacha20-ietf-poly1305

cd /root/shadowsocks/bin/
./ss-local -c /root/shadowsocks/etc/ss.json -f /root/shadowsocks/etc/ss.pid

作者: reistlin
来源: http://www.reistlin.com/blog/432
更新时间: 2023.01
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

linux.pngnginx.png

Lets Encrypt 是一家免费、开放、自动化的证书颁发机构(CA),为公众的利益而运行。它是一项由 Internet Security Research Group (ISRG) 提供的服务。

免费:任何拥有域名的人都可以使用 Lets Encrypt 免费获取受信的证书。

自动化:运行于服务器上的软件可以与 Lets Encrypt 直接交互,以便轻松获取证书,安全地配置它,并自动进行续期。

安全:Lets Encrypt 将成为一个推动 TLS 安全最佳实践发展的平台,无论是作为一个证书颁发机构(CA)还是通过帮助网站运营商正确地保护其服务器。

透明:所有颁发或吊销的证书将被公开记录,供任何人查阅。

开放:自动签发和续订协议已经发布作为其他人可以采用的开放标准。

乐于合作:就像互联网底层协议本身一样,Lets Encrypt 是为了让整个互联网社区受益而做出的共同努力,它不受任何单一组织的控制。Lets Encrypt 是为了让整个互联网社区受益而做出的共同努力,它不受任何单一组织的控制。

通过 acme.sh 实现 ACME (Automatic Certificate Management Environment) 协议,生成免费 SSL 证书并自动 Renew 续期。

自动化证书管理环境(ACME)是用于自动验证 X.509 证书的域验证,安装和管理的标准协议。 ACME 协议由 Internet 安全研究小组设计,并在 IETF RFC 8555。作为具有许多可用的客户端实现的文档齐全的开放标准,ACME 被广泛用作企业证书自动化解决方案。

一,下载安装 acme.sh

curl https://get.acme.sh | sh -s email=test@reistlin.com

默认安装路径:~/.acme.sh/
举例:/home/reistlin/.acme.sh/

二,设置证书颁发机构 Lets Encrypt

acme.sh --set-default-ca --server letsencrypt

三,生成证书

acme.sh --issue -d reistlin.com -d www.reistlin.com --webroot /home/wwwroot/

-d 参数指定默认域名和 www 域名
--webroot 参数指定网站根目录

举例:申请成功,证书保存在 /home/reistlin/.acme.sh/reistlin.com_ecc 目录

2023年 01月 30日 星期一 17:24:39 CST] Your cert is in: /home/reistlin/.acme.sh/reistlin.com_ecc/reistlin.com.cer
[2023年 01月 30日 星期一 17:24:39 CST] Your cert key is in: /home/reistlin/.acme.sh/reistlin.com_ecc/reistlin.com.key
[2023年 01月 30日 星期一 17:24:39 CST] _on_issue_success

四,配置证书

举例:Nginx SSL 配置

server {
    listen       443 ssl http2;
    server_name  reistlin.com  *.reistlin.com;

    ssl_certificate            /etc/nginx/conf.d/reistlin.com.cer;
    ssl_certificate_key        /etc/nginx/conf.d/reistlin.com.key;
    ssl_session_cache          shared:SSL:1m;
    ssl_session_timeout        5m;
}

五,自动续期

Lets Encrypt 免费 SSL 证书有效期 90 天,通过 acme.sh 配置系统 crontab 任务自动 Renew 续期:

系统 crontab 任务:

crontab -l
15 0 * * * "/home/reistlin/.acme.sh"/acme.sh --cron --home "/home/reistlin/.acme.sh" > /dev/null

crontab 每天 0 点 15 分自动检测证书有效性,到期自动 Renew 续期:

[2023年 01月 30日 星期一 21:26:51 CST] ===Starting cron===
[2023年 01月 30日 星期一 21:26:51 CST] Renew: "reistlin.com"
[2023年 01月 30日 星期一 21:26:51 CST] Renew to Le_API=https://acme-v02.api.letsencrypt.org/directory
[2023年 01月 30日 星期一 21:26:51 CST] Skip, Next renewal time is: 2023-03-30T09:24:39Z
[2023年 01月 30日 星期一 21:26:51 CST] Add "--force" to force to renew.
[2023年 01月 30日 星期一 21:26:51 CST] Skipped reistlin.com_ecc
[2023年 01月 30日 星期一 21:26:51 CST] ===End cron===