This commit is contained in:
2023-06-29 11:55:02 +08:00
commit 36e95249b1
1236 changed files with 464197 additions and 0 deletions

View File

@@ -0,0 +1,110 @@
---
title: BuildGraph与UnrealBinaryBuilde
date: 2022-08-06 20:41:15
tags: BuildGraph
rating: ⭐️⭐️
---
## BuildGraph
- 共享共同的构建步骤,以节约构建时间
- 能使用Graph对编译量进行优化
- 易于并行化构建
- 存储构建脚本在每个分支中,而不需要编写额外的后端程序
- 不同的产品可以定制不同的额外步骤
基于以上的需求EPIC的开发了BuildGraph类似于Make/Ant/MSBuild,但一开始就是基于并行分布式处理设计的。各种操作定义在AutomationTool中可以通过派生CustomTask类来扩展构建任务。
文档https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/BuildTools/AutomationTool/BuildGraph/
本人推荐看查利鹏的文章《BuildGraph构建支持多平台打包的二进制引擎》https://imzlp.com/posts/11956/里面除了介绍了基础用法之外还介绍了加快构建的方法如何砍掉不必要的构建过程以及构建安卓与IOS端的方法。
官方视频也有对它进行介绍1017分开始
《Tools and Infrastructure for Large Teams | Unreal Dev Days 2019 | Unreal Engine》
https://youtu.be/d6lyAI4Ftkw
视频中还介绍了:
- EPIC的自动合并工具RoboMerge源码位于Engine\Extras\RoboMerge。
- 同步工作区工具BuildAgent源码位于Engine\Source\Programs\BuildAgent。
- AutoSDK源码位于Engine\Extras\AutoSDK。
- UnrealGameSync源码位于Engine\Source\Programs\UnrealGameSync。
PS.BuildAgent与UnrealGameSync基于perforce。
分布式流程逻辑:
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/BuildGraph_DistributedBuilds.png)
## 插件构建命令
>Engine\Build\BatchFiles\RunUAT.bat BuildPlugin -Plugin=[Path to .uplugin file, must be outside engine directory] -Package=[Output directory] -Rocket -VS2019
`D:\UnrealEngine\UnrealEngine\Engine\Build\BatchFiles\RunUAT.bat BuildPlugin -Plugin=C:\Users\BlueRose\Desktop\YueHuaProject\Plugins\MultiDraw\MultiDraw.uplugin -Package=C:\Users\BlueRose\Desktop\Ouput\plugins -Rocket -VS2019 -TargetPlatforms=Win64`
## 引擎构建命令
`D:\UnrealEngine\UnrealEngine\Engine\Build\BatchFiles\RunUAT.bat BuildGraph -target="Make Installed Build Win64" -script=Engine/Build/InstalledEngineBuild.xml -set:WithDDC=true -set:SignExecutables=false -set:EmbedSrcSrvInfo=false -set:GameConfigurations=Development;Shipping -set:WithFullDebugInfo=false -set:HostPlatformEditorOnly=false -set:AnalyticsTypeOverride= -set:HostPlatformDDCOnly=true -set:WithWin64=true -set:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false -set:WithLinux=false -set:WithLumin=false -set:WithLinuxArm64=false -set:CompileDatasmithPlugins=false -set:WithServer=false -set:WithClient=false -set:WithHoloLens=false`
## AutomationTool其他命令
具体可以参考https://github.com/botman99/ue4-unreal-automation-tool
```
AnalyzeThirdPartyLibs CleanDevices RebasePublicIncludePaths TestKillAll
BenchmarkBuild CleanFormalBuilds RebuildHLOD TestLog
BenchmarkOptions CleanTempStorage RebuildLightMaps TestMacZip
BlameKeyword CodeSurgery RecordPerformance TestMcpConfigs
Build CopySharedCookedBuild ReplaceAssetsUsingManifest TestMessage
BuildCMakeLib CopyUAT ResavePackages TestOSSCommands
BuildCommonTools CryptoKeys ResavePluginDescriptors TestP4_ClientOps
BuildCookRun DebugSleep ResaveProjectDescriptors TestP4_CreateChangelist
BuildDerivedDataCache DumpBranch RunEditorTests TestP4_Info
BuildEditor ExportIPAFromArchive RunP4Reconcile TestP4_LabelDescription
BuildForUGS ExportMcpTemplates RunUnreal TestP4_StrandCheckout
BuildGame ExtractPaks StashTarget TestRecursion
BuildGraph FinalizeInstalledBuild SubmitUtilizationReportToEC TestRecursionAuto
BuildHlslcc FixPerforceCase SyncBinariesFromUGS TestStopProcess
BuildPhysX FixupRedirects SyncDDC TestSuccess
BuildPlugin GenerateAutomationProject SyncDepotPath TestTestFarm
BuildServer GenerateDSYM SyncProject TestThreadedCopyFiles
BuildTarget GitPullRequest SyncSource TestUATBuildProducts
BuildThirdPartyLibs IPhonePackager TempStorageTests UBT
CheckBalancedMacros ListMobileDevices TestArguments UE4BuildUtilDummyBuildCommand
CheckCsprojDotNetVersion ListThirdPartySoftware TestBlame UnstashTarget
CheckForHacks Localise TestChangeFileType UpdateLocalVersion
CheckPerforceCase Localize TestChanges UploadDDCToAWS
CheckRestrictedFolders LookForOverlappingBuildProducts TestCleanFormalBuilds WriteIniValueToPlist
CheckTargetExists MegaXGE TestCombinePaths ZipProjectUp
CheckXcodeVersion OpenEditor TestFail ZipUtils
CleanAutomationReports P4WriteConfig TestFileUtility
CleanDDC ParseMsvcTimingInfo TestGauntlet
```
## UnrealBinaryBuilder
使用BuildGraph需要使用命令行对开发者还是不够友好所以可以使用UnrealBinaryBuilderhttps://github.com/ryanjon2040/Unreal-Binary-Builder 这个项目使用c#编写代码相对比较简单可以参考用于公司内部的CI/CD工具以及分布式构建系统编写如何与BuildGraph交互与通信。查看源码后发现已经对应UE5进行了适配所以可以放心使用。
一开始进入的是界面。如果是刚下载的源代码可以点击Start来下载二进制文件、生成引擎解决方案文件以及构建AutomationTool。
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/UnrealBinaryBuilder_Setup.png)
之后点击Compile选项卡来设置构建选项。左边的Platform选择要构建的平台其中Mac、Ios、Android可以参考查利鹏的文章。其中构建需要能够打开的引擎需要勾选的include DDC与Host DDC Only不然运行引擎会提示丢失各种Shader与Shader文件夹。左下角的输入栏可以指定编译的版本默认是Development与Shipping。点击Copy Commandline To Clipboard会将生成的命令行复制到剪贴板之后可以粘贴到文字编辑工具中查看来确定所有的编译参数是否正确也可以之后在cmd中直接运行这个命令来执行编译。最后点击Build UnrealEngine来进行构建。
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/UnrealBinaryBuilder_Compile.png)
实际的编译时间比你手动编译的要长是因为默认的BuildGraph构建文件**Engine/Build/InstalledEngineBuild.xml**中会有编译所有模块的指令。这里可以根据需求来创建新的BuildGraph文件去掉 -allmodules与-nolink来解决。
```xml
<Node Name="Compile UE4Game Win64" Requires="Compile UnrealHeaderTool Win64" Produces="#UE4Game Win64;#UE4Game Win64 Unstripped;#UE4Game Win64 Stripped;#UE4Game Win64 Unsigned;#UE4Game Win64 Signed">
<ForEach Name="Target" Values="UE4Game;$(OptionalClientTarget);$(OptionalServerTarget)">
<ForEach Name="Configuration" Values="$(GameConfigurations)">
<Compile Target="$(Target)" Platform="Win64" Configuration="$(Configuration)" Tag="#UE4Game Win64" Arguments="-precompile -allmodules -nolink $(VSCompilerArg) $(TargetDebugInfoArg)"/>
<Compile Target="$(Target)" Platform="Win64" Configuration="$(Configuration)" Tag="#UE4Game Win64" Arguments="-precompile $(VSCompilerArg) $(TargetDebugInfoArg)" Clean="false"/>
</ForEach>
</ForEach>
</Node>
```
在Zip Build选项卡中你可以设置是否在编译完成后使用zip将引擎打包推荐勾选FeaturePacks、Samples、Templates不然新建项目与Level中的选项将会失效。如果用户需要debug那就需要勾选PDB与DEBUG。
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/UnrealBinaryBuilder_Zip.png)
### “missing PDBCopy”问题解决
构建的时候会遇到一个“missing PDBCopy”的问题。需要下载Win10 SDK安装Debugging Tools for Windows。下载地址
https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
只需要勾选**Debugging Tools for Windows**并安装即可解决问题。
![](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/images/debugger-download-sdk.png)
## 构建无源码版本
编译是需要所有的头文件的。所以使用默认设置并在打包Zip时勾选`Source`,最后再解压把所有`*.cpp`文件删除。

View File

@@ -0,0 +1,47 @@
---
title: EPIC大型项目资产数据跨地域同步方案
date: 2022-11-10 14:59:48
excerpt:
tags: DDC
rating: ⭐
---
## 前言
对于大型项目来说同步Asset相对较快但是构建资产数据缓存却比较慢经常需要花很长时间才能打开编辑器。该视频介绍了一些解决方法。视频为[Improving Developer Iteration in Unreal Engine 5 | Unreal Fest 2022](https://www.youtube.com/watch?v=_gpJeeqIbjo)
## 资产数据同步方法
1. [[#Unreal Cloud DDC]] UE5.2(Beta)
2. [[#Virtual Asset]]UE5.1(Beta)
3. [[#Horde Compute]]UE5.x(TBD)
## Unreal Cloud DDC
- Local Project DDC项目DDC
- Local Share DDC(本地共享DDC)
但是我们目标是`Team Shared DDC`,即每个人都有自己的一部分LocalDDC然后团队有其他大部分共享的DDC。但并不适合使用VPN来获取数据。所以EPIC使用多台云服务器多个地区上构建DDC。他们开发了一个灵活可配置的系统来进行管理。
- 云上部署
- 多地部署
- 云服务器数据两两同步
- 支持OIDC登录与身份验证
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/UnrealCloudDDC_01.png)
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/UnrealCloudDDC_02.png)
## Virtual Asset
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/VirtualAsset_01.png)
通过将Asset的结构数据生成DDC Key这样就可以从DDC缓存中获取到数据了。所以我们就不需要BulkData了。以此来减少每日同步数据的量。同时因为这些缓存数据是散列形式的这样就不会出现重复生成的问题。
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/VirtualAsset_02.png)
而DDC Key就是视频中介绍的VirtualAssets![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/VirtualAsset_03.png)
Virtual Asset
- 同步更快
- 更小的足迹数据
- 优先从UnrealCloudDDC上同步次选Perforce
## Horde Compute
不充钱你会变强么
## 其他
EPIC在UE5开发了新的针对DDC构建的API
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/DDCBuildCommand.png)
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/DDCBuild.png)

View File

@@ -0,0 +1,49 @@
---
title: FastBuild联机编译Shader以及共享DDC
date: 2022-08-09 13:55:15
tags: FastBuild DDC
rating: ⭐️⭐️
---
# 前言
目前考虑的方法是使用FastBuild的分布式编译来加快Shader编译与速度并且使用共享DDC来减少构建时间。
- 在 Mac 构建机上配置 UE4 FastBuild 及 DDChttps://zhuanlan.zhihu.com/p/474404469
- UE4.24 FastBuild(v1.02) 支持C++与 Shader 可用的分布编译加速方案https://zhuanlan.zhihu.com/p/307581961
- 官方文档
- FastBuildhttps://docs.unrealengine.com/4.27/en-US/ProductionPipelines/BuildTools/UnrealBuildTool/BuildConfiguration/
- DDC文档https://docs.unrealengine.com/4.27/zh-CN/ProductionPipelines/DerivedDataCache/
## 共享DDC
1. 在DefaultEngine.ini中覆盖你的项目设置如下图所示该覆盖项会将路径设置为团队的有效位置。
```ini
[InstalledDerivedDataBackendGraph] Shared=(Type=FileSystem, ReadOnly=false, Clean=false, Flush=false, DeleteUnused=true, UnusedFileAge=10, FoldersToClean=10, MaxFileChecksPerSec=1, ConsiderSlowAt=70, PromptIfMissing=false, Path=\YourCompanyServer\DDC, EnvPathOverride=UE-SharedDataCachePath, EditorOverrideSetting=SharedDerivedDataCache)
```
2. 将 `UE-SharedDataCachePath`在Mac/Linux上为 `UE_SharedDataCachePath`)的环境变量(如下图所示)设置为要使用的文件夹。
3. 在编辑器General-Global-DerivedDataCache中设置 `SharedDerivedDataCache` 变量。
- 官方译版引擎:[InstalledDerivedDataBackendGraph]
- 源码版:[DerivedDataBackendGraph]
### 使用Commandlet生成DDC
在设置完之后就可以通过 Commandlet 来执行DDC的生成了
```cmd
Engine\Binaries\Win64\UE4Editor.exe Client\Client.uproject -run=DerivedDataCache -fill
```
### 禁用共享DDC
当开发人员远程处理项目时并且该项目已配置了共享DDC时开发人员可能会遇到性能不佳的情况这是因为访问DDC数据比生成DDC数据花费的时间更长。要暂时禁用共享DCC请使用以下方法之一
- 在命令行上传递-ddc=noshared。
- 将环境变量设置为本地硬盘驱动器:
- `UE-SharedDataCachePath=None`
- 在Mac上`UE_SharedDataCachePath=None`
## 启用FastBuild编译Shader
Shader 编译使用 CVars 打开,在 DefaultEngine.ini 中的 [/Script/Engine.RendererSettings] 部分,添加如下内容:
```
r.FASTBuildShaderCompile=1
```
### FASTBuild Dashboard
可以使用FASTBuild Dashboard来查看联机构建情况。
地址https://github.com/hillin/FASTBuild-Dashboard

View File

@@ -0,0 +1,59 @@
---
title: UE符号服务器搭建笔记
date: 2022-09-13 10:56:50
excerpt:
tags:
rating: ⭐⭐
---
## 前言
主要是为了解决在美术不用下载调试符号的情况下,引擎崩溃时可以准确定位到代码。
>PDB文件主要存储了调试程序时所需要的基本信息主要包括源文件名、变量名、函数名、FPO(帧指针)、对应的行号等等但是我们算了一下整个项目的pdb文件加起来有30多个G每天编辑器要编10个版本导致拉pdb到本地的成本也很高会浪费很多时间。
思路为:
>搭建一个pdb服务器(同符号服务器一个意思这里)每次做好版本的时候将pdb都传到这台服务器上在策划机器上发生crash的时候ue才会用dbghelp去解析dump文件dbghelp会拉起symsrv.dll 去pdb服务器取得需要的pdb文件拉到本地(也可以不拉)从而进一步实现对dump中的地址解析变成文件名函数名行号等详细信息
参考文章:
- ue4 符号服务器搭建https://zhuanlan.zhihu.com/p/563637510
- 微软官方文档
- SymStore使用案例 https://docs.microsoft.com/en-us/windows/win32/debug/using-symstore
- SymStore所有参数列表https://docs.microsoft.com/en-us/windows/win32/debug/symstore-command-line-options
- SymSrv使用案例https://docs.microsoft.com/en-us/windows/win32/debug/using-symsrv
## 流程
1. 安装pdb相关工具。
- 我们需要symstore命令要做的是安装Debugging Tools for Windows [官方下载地址](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools)
- symstore的默认安装位置为`C:\Program Files (x86)\Windows Kits\10\Debuggers\x64`
2. 搭建pdb服务器。
- 支持本地路径、共享与Https方式。
3. 使用symastore上传pdb。
- `symstore.exe add /r /f H:\MyGame\Engine\Binaries\Win64 /s \\sanhao-NB0\pdbShare /t ACM /z pri`
- [[#微软文档中的symstore案例]]
4. 增加`DefaultEditorPerProjectUserSettings.ini`设置。
```ini
[/Script/UnrealEd.CrashReporterSettings]
RemoteStorage=\\sanhao-NB0\pdbShare
DownstreamStorage=D:\PDBTest //这个是本地缓存pdb文件的路径
```
5. 在美术的机器上的`C:\Windows\System32`目录下放置`symsrv.dll`。与symstore同路径。
6. 在美术的机器上添加环境变量:`_NT_SYMBOL_PATH srv*d:\PDBTest*\\sanhao-NB0\pdbShare
- [[#微软文档中的SymSrv案例]]
7. 符号服务器的空间是有限的需要定期删除过期文件删除需要的命令是agestore。
### 微软文档中的SymStore案例
- `symstore add /r /f \\largeapp\appserver\bins\*.* /s \\testdir\symsrv /t "Large Application" /v "Build 432" /c "Sample add"`
- `symstore add /r /p /f \\BuildServer\BuildShare\3790free\symbols\*.* /s \\sampledir\symsrv /t "Windows Server 2003" /v "Build 3790 x86 free" /c "Sample add"
- `symstore add /r /p /f \\BuildServer\BuildShare\3790Chk\symbols\*.* /s \\sampledir\symsrv /t "Windows Server 2003" /v "Build 3790 x86 checked" /c "Sample add"`
### 微软文档中的SymSrv案例
o use SymSrv with a symbol store on \\mybuilds\mysymbols, set the following symbol path:
`set _NT_SYMBOL_PATH= srv*\\mybuilds\mysymbols`
To set the symbol path so that the debugger will copy symbol files from a symbol store on \\mybuilds\mysymbols to your local directory c:\localsymbols, use:
`set _NT_SYMBOL_PATH=srv*c:\localsymbols*\\mybuilds\mysymbols`
To set the symbol path so that the debugger will copy symbol files from a symbol store on \\mybuilds\mysymbols to the default downstream store (typically c:\debuggers\sym), use:
`set _NT_SYMBOL_PATH=srv**\\mybuilds\mysymbols`
To use a cascading store, set the following symbol path:
`set _NT_SYMBOL_PATH = srv*c:\localsymbols*\\NearbyServer\store*https://DistantServer`

View File

@@ -0,0 +1,48 @@
## 地址
https://github.com/acmesh-official/acme.sh
## 通过acme.sh脚本来设置证书
安装acme.sh
```
apt-get update && apt-get -y install socat //安装socat
yum install socat
wget -qO- get.acme.sh | bash //安装脚本
source ~/.bashrc
```
## 申请证书
在你的域名解析服务提供商那里添加好解析记录假定你的域名是yourdomain.com记得不要开启CDN然后执行下面命令申请证书。
```
acme.sh --issue --standalone -d yourdomain.com -k ec-256
```
因为本人要有blog需要与nginx容器共存所以使用网站目录方式
```
acme.sh --issue -d blueroses.top -d www.blueroses.top -d tj.blueroses.top -k ec-256 --webroot /root/docker/nginx/html
```
### 通配符证书申请
通配符证书只支持dns方式这里使用CloudFlare。首先在https://dash.cloudflare.com/profile/api-tokens 申请一个Global API Token。点击Global API Key栏的View即可之后输入
```bash
export CF_Key="19db67256c0eca16b5f4f4e8a7150c00eec16"
export CF_Email="378100977@qq.com"
```
```bash
acme.sh --issue -d blueroses.top -d *.blueroses.top --dns dns_cf \
--key-file /root/docker/trojan/trojan.key \
--fullchain-file /root/docker/trojan/trojan.crt \
--reloadcmd "docker restart nginx-web trojan"
```
## 安装证书和私钥到指定位置
```
acme.sh --installcert -d blueroses.top \
--fullchain-file /root/docker/trojan/trojan.crt \
--key-file /root/docker/trojan/trojan.key \
--ecc --reloadcmd "docker restart nginx-web trojan"
```
## 自动续期
```
acme.sh --upgrade --auto-upgrade
```

View File

@@ -0,0 +1,21 @@
## CloudFlare Key
https://dash.cloudflare.com/profile
点击 API令牌->API秘钥
- Global API Key23402010e956bb4d996ab994e178c62b3742c
- Origin CA Keyv1.0-e2bbd4334c2f22123bde5da9-6540095b825ebbcfcf3e4abb47a07c51ea3a7ae66042059fb54ec5711cdbc11c4d380d09e3ed2837d55a90e918f10c86a6bdcf782601501fccc67191064186d9246842b23cd3092f
在域名的概述里有个区域ID就是zoneId。
- 区域IDf84f14315f6b630be28364a1c217eea2
## 华硕路由器CloundFlare DDNS
说明网址http://tech.mornlong.com/post/29.html
## NodeJS DDNS服务
最后更新于2018年最好再自己看看
- https://xcoder.in/2014/09/20/lets-build-ourselves-ddns/
- https://github.com/XadillaX/dloucflare
其他:
- https://www.npmjs.com/package/@oawu/ddns
- https://www.npmjs.com/package/cloudflare-ddns-sync

View File

@@ -0,0 +1,70 @@
## 安装教程地址
https://hub.docker.com/r/xavierniu/cloudreve
## 安装caddy用于反向代理
```
www.blueroses.top {
tls admin@blueroses.top
proxy / cloudreve:5212 {
transparent
}
}
```
```
docker run -d \
--name caddy \
-e "ACME_AGREE=true" \
-e "CADDYPATH=/etc/caddycerts" \
-v /dockercnf/caddy/certs:/etc/caddycerts \
-v /dockercnf/caddy/Caddyfile:/etc/Caddyfile \
--network my-network \
-p 80:80 -p 443:443 \
--restart unless-stopped \
abiosoft/caddy
```
## aria2
uid=0(root) gid=0(root) groups=0(root)
```
docker run -d \
--name aria2 \
--restart unless-stopped \
--log-opt max-size=1m \
-e PUID=0 \
-e PGID=0 \
-p 6800:6800 \
-p 6888:6888 -p 6888:6888/udp \
--network my-network \
-v /dockercnf/aria2/config:/config \
-v /dockercnf/aria2/downloads:/downloads \
p3terx/aria2-pro
```
## cloudreve本体
```
docker run -d \
--name cloudreve \
-e PUID=0 \
-e PGID=0 \
-e TZ="Asia" \
--network my-network \
--restart=unless-stopped \
-p 5212:5212 \
-v /dockercnf/cloudreve/uploads:/cloudreve/uploads \
-v /dockercnf/aria2/downloads:/downloads \
-v /dockercnf/cloudreve/conf.ini:/cloudreve/conf.ini \
-v /dockercnf/cloudreve/cloudreve.db:/cloudreve/cloudreve.db \
xavierniu/cloudreve
```
## 账号密码
首次启动后请执行docker logs -f cloudreve
```
[Info] 2020-04-08 07:15:19 初始化数据库连接
[Info] 2020-04-08 07:15:19 开始进行数据库初始化...
[Info] 2020-04-08 07:15:19 初始管理员账号admin@cloudreve.org
[Info] 2020-04-08 07:15:19 初始管理员密码IAFhUH3m
[Info] 2020-04-08 07:15:20 数据库初始化结束
[Info] 2020-04-08 07:15:20 初始化任务队列WorkerNum = 10
[Info] 2020-04-08 07:15:20 初始化定时任务...
[Info] 2020-04-08 07:15:20 当前运行模式Master
[Info] 2020-04-08 07:15:20 开始监听 :5212
```
账号为本人QQ邮箱密码为常用密码

View File

@@ -0,0 +1,27 @@
#TODO
# Jenkins通过命令行启动Ue4的自动测试框架
https://www.emidee.net/ue4/2018/11/13/UE4-Unit-Tests-in-Jenkins.html
好像可以通过 命令行来启动Ue4的自动测试框架
基础过程
https://patricevignola.com/post/automation-jenkins-unreal
# GitHook
Git hooks是基于事件的。当你执行特定的git指令时该软件会从git仓库下的hooks目录下检查是否有相对应的脚本如果有就执行。
有些脚本是在动作执行之前被执行的这种“先行脚本”可用于实现代码规范的统一、完整性检查、环境搭建等功能。有些脚本则在事件之后被执行这种“后行脚本”可用于实现代码的部署、权限错误纠正git在这方面的功能有点欠缺等功能。
# 安装一个钩子
钩子都被存储在Git目录下的hooks子目录中。也即绝大部分项目中的.git/hooks。当你用git init初始化一个新版本库时Git 默认会在这个目录中放置一些示例脚本。这些脚本除了本身可以被调用外,它们还暴露了被触发时所传入的参数。这些示例的名字都是以 .sample 结尾,如果想启用它们,移除这个后缀即可。
把一个正确命名且可执行的文件放入 Git 目录下的 hooks 子目录中,即可激活该钩子脚本。这样一来,它就能 被 Git 调用。
第三方选择使用
# Gitlab Webhooks
Webhooks 允许第三方应用监听 GitLab 上的特定事件,在这些事件发生时通过 HTTP POST 方式通知( 超时5秒) 到第三方应用指定的 Web URL。 例如项目有新的内容 Push或是 Merge Request 有更新等。 WebHooks 可方便用户实现自动部署,自动测试,自动打包,监控项目变化等。
webhooks, 可以在 pull request / merge master 等几个场景下, 设置异步回调通知(http 请求)。这个背后就是 git hooks 在起作用。
因此,利用 WebHooks 的特性,可配合 Jenkins 实现一系列的自动化任务。

View File

@@ -0,0 +1,809 @@
---
title: NAS与服务部署
date: 2022-09-15 10:02:03
excerpt:
tags:
rating: ⭐
---
## 路由器DDNS
https://blueroses.asuscomm.com:8443/Main_Login.asp
## 杂项
- 星际蜗牛
- [阿文菌爱捡垃圾 篇二十九手把手教您组装一台ITX的高性能NAS598元的6盘位准系统+I5 8代+B365+万兆网卡](https://post.smzdm.com/p/a834noe6/)
- 黑群晖
- [文菌装NAS 篇五手把手教您安装黑群晖918+ 6.2保姆级教程这应该是装黑群晖NAS最详细的教程了含群晖设置](https://post.smzdm.com/p/aqx07xmk/)
- UPS
- 山特SANTAK)TG-BOX600/850 UPS
## NAS系统选择
- OMV与FreeNAS相比拥有原生Docker可以直接让容器使用硬件。
- [官方下载地址](https://www.openmediavault.org/download.html)
- [一次满足两个愿望HTPC_NAS二合一服务器搭建教学OMV新手入门](https://www.bilibili.com/video/BV1Ge41147B9?spm_id_from=333.999.0.0&vd_source=d47c0bb42f9c72fd7d74562185cee290)
- [OMV搭建系列教程[0] 最小化安装Debian11](https://www.bilibili.com/read/cv13834759/)
- 可使用protainer管理Docker
- FreeNAS比较适合企业使用优势在于拷贝速度以及硬盘寿命。
- ZFS
- Docker需要在虚拟机上安装系统再部署。
- UnRaid要钱……
测速网速测试:
```
apt-get install speedtest-cli
speedtest-cli --secure
```
测速脚本:
`wget -qO- bench.sh | bash`
## 待部署列表
- [ ] Heidmall 导航页方便找对应应用
- [x] 百度网盘
- [x] gitea
- 漫画
- [x] LANraragi
- [x] OnlyOffice
- 影片
- Emby Server收费
- Plex收费
- Overseerr附带BT下载、传输功能
- [x] nas-tools
- [x] JellyfinEmby Server代替品
- [x] qbittorrent
- 下载
- [x] Aria2
- [x] Aria-NG
- [ ] Transmisiion
- 智能设备管理
- HomeBridge
- 照片
- Moment
- ResilioSync手机照片备份
- Drive
- hentaiathome
# Docker源
Portainer可以更换Docker的源来加快下载速度。
- azure源docker源dockerhub.azk8s.cn
- Docker中国区官方registry.docker-cn.com
- 网易:[http://hub-mirror.c.163.com](https://link.zhihu.com/?target=http%3A//hub-mirror.c.163.com/)
- 中国科技大学镜像加速:[https://docker.mirrors.ustc.edu.cn](https://link.zhihu.com/?target=https%3A//docker.mirrors.ustc.edu.cn/)
# 域名与地址
https://blueroses.asuscomm.com:8443
ipv4.blueroses.top
bluerose.top
## DNSPod
ID:350298
Token:ed4a9b995c02c1185964f0fdb01b76df
350311
# 服务部署
- Portainer:9000 admin ljj@88483649
- 路由器:https://blueroses.asuscomm.com:8443/
- ~~Heidmall:8080~~
- CloudReve:5212
- Gitea:8888
- SVN: http://ipv4.blueroses.top:7777/svnadmin
- baidunetdisk:5800
- lanraragi:9999
- NASTools:10000
- qbittorrenthttp:8080
- Jellyfin:8096
- [[#Perlite]]
## Heidmall
参考https://zhuanlan.zhihu.com/p/405906100
```bash
cd /home
mkdir -vp heimdall
```
```bash
docker run -d \
--name=heimdall \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Asia/Shanghai \
-p 8080:80 \
-p 666:443 \
-v /home/heimdall:/config \
--restart unless-stopped \
linuxserver/heimdall:latest
```
### 增加密码保护
This image now supports password protection through htpasswd. Run the following command on your host to generate the htpasswd file `docker exec -it heimdall htpasswd -c /config/nginx/.htpasswd <username>`. Replace
## CloudReve
### 创建目录结构
```c++
cd /home
mkdir -vp cloudreve/{uploads,avatar} \
&& touch cloudreve/conf.ini \
&& touch cloudreve/cloudreve.db \
&& mkdir -p aria2/config \
&& mkdir -p data/aria2 \
&& chmod -R 777 data/aria2
```
### 运行
然后将以下文件保存为 `docker-compose.yml`,放置于当前目录,与 cloudreve 同一层级,同时,修改文件中的 `RPC_SECRET`。
```c++
version: "3.8"
services:
  cloudreve:
    container_name: cloudreve
    image: cloudreve/cloudreve:latest
    restart: unless-stopped
    ports:
      - "5212:5212"
    volumes:
      - temp_data:/data
      - ./cloudreve/uploads:/cloudreve/uploads
      - ../srv/dev-disk-by-uuid-186bd712-77aa-422d-972f-8666404ff8ea/jellyfin/:/cloudreve/uploads/1/H
      - ./cloudreve/conf.ini:/cloudreve/conf.ini
      - ./cloudreve/cloudreve.db:/cloudreve/cloudreve.db
      - ./cloudreve/avatar:/cloudreve/avatar
    depends_on:
      - aria2
  aria2:
    container_name: aria2
    image: p3terx/aria2-pro
    restart: unless-stopped
ports:
      - "6800:6800"
    environment:
      - RPC_SECRET=bluerose
      - RPC_PORT=6800
    volumes:
      - ./aria2/config:/config
      - temp_data:/data
volumes:
  temp_data:
    driver: local
    driver_opts:
      type: none
      device: $PWD/data
      o: bind
```
### 运行镜像
后台运行模式,可以从 docker/docker-compose 的日志中获取默认管理员账户用户名和密码
```c++
docker-compose up -d
```
或者直接运行log 将会直接输出在当前控制台中,请注意退出之后保持当前容器运行
```c++
docker-compose up
```
在之后的控制面板中,按照如下配置
1. **[不可修改]** RPC 服务器地址 => `http://aria2:6800`
2. **[可修改, 需保持和 docker-compose.yml 文件一致]** RPC 授权令牌 => `your_aria_rpc_token`
3. **[不可修改]** Aria2 用作临时下载目录的 节点上的绝对路径 => `/data`
### 更新
关闭当前运行的容器,此步骤不会删除挂载的配置文件以及相关目录
>docker-compose down
如果此前已经拉取 docker 镜像,使用以下命令获取最新镜像
>docker pull cloudreve/cloudreve
## Aria2-NG
- http://192.168.50.6:6800/jsonrpc
- get
- bluerose
```c++
docker run -d \
--name ariang \
--log-opt max-size=1m \
--restart unless-stopped \
-p 6880:6880 \
p3terx/ariang
```
## Gitea
```c++
cd /home
mkdir -vp gitea
```
```c++
docker run -d --restart=always --privileged=true --name=gitea \
-p 822:22 \
-p 8888:3000 \
-v /home/gitea:/data \
gitea/gitea:latest
```
## SVN
参考文章:
- https://www.cnblogs.com/zepc007/p/14521394.html
- https://blog.csdn.net/zhuocailing3390/article/details/123777266
创建目录并且修改权限:
```c++
cd /home
mkdir -vp svn
chmod -R 777 /home/svn
```
```c++
docker run -d --name svn-server --restart=always \
-v /home/svn:/home/svn \
-p 7777:80 \
-p 3690:3690 \
elleflorio/svn-server
```
创建管理员用户
```c++
docker exec -t svn-server htpasswd -b /etc/subversion/passwd <username> <password>
docker exec -t svn-server htpasswd -b /etc/subversion/passwd bluerose ljj199221
```
进入容器内部
```bash
docker exec -it svn-server /bin/sh
```
修改配置:
```shell
# 进入apache2目录
cd /etc/apache2/
# 修改
vi httpd.conf
```
修改内容:
```shell
ServerName ipv4.blueroses.top:7777
```
### 配置
访问地址http://ipv4.blueroses.top:7777/svnadmin进行后台的配置管理配置内容如下
- Subversion authorization file /etc/subversion/subversion-access-control
- User authentication file (SVNUserFile) /etc/subversion/passwd
- Parent directory of the repositories (SVNParentPath) /home/svn
- Subversion client executable/usr/bin/svn
- Subversion admin executable/usr/bin/svnadmin
>注意配置填写好后进行test测试Test passed后再进行保存配置信息
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/20220924184130.png)
### 测试
访问仓库,地址规则为:`ip:prot/svn/仓库名称`,比如:[http://ipv4.blueroses.top:7777/svn/demo/](http://ipv4.blueroses.top:7777/svn/demo/)svn客户端也用这个地址。
## 百度网盘
```bash
cd /home
mkdir -vp baidunetdisk/{config,downloads}
```
```c++
docker create \
--name=baidunetdisk \
-p 5800:5800 \
-p 5900:5900 \
-v /home/baidunetdisk/config:/config \
-v /home/baidunetdisk/downloads:/config/baidunetdiskdownload \
--restart unless-stopped \
johngong/baidunetdisk:latest
```
## calibre-web
```bash
cd /home
mkdir -vp calibre/{config,books}
```
```bash
docker run -d \
--name=calibre-web \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Asia/Shanghai \
-e DOCKER_MODS=linuxserver/mods:universal-calibre `#optional` \
-e OAUTHLIB_RELAX_TOKEN_SCOPE=1 `#optional` \
-p 8083:8083 \
-v /home/calibre/config:/config \
-v /home/calibre/books/library:/books \
--restart unless-stopped \
linuxserver/calibre-web:latest
```
安装完进入网页界面会提示没有Meta.db可以通过安装另一个镜像来获得
```c++
docker run -d \
  --name=calibre \
  --security-opt seccomp=unconfined `#optional` \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -e PASSWORD= `#optional` \
  -e CLI_ARGS= `#optional` \
  -p 8080:8080 \
  -p 8081:8081 \
  -v /home/calibreTest/:/config \
  --restart unless-stopped \
  linuxserver/calibre:latest
```
安装完进入8080完成安装即可之后在Calibre Library中就有Meta.db了。
## lanraragi
https://post.smzdm.com/p/aenz8k7q/
```bash
cd /home
mkdir -vp lanraragi/{content,database}
```
```c++
docker run --name=lanraragi -d \
-p 9999:3000 \
-v /home/lanraragi/content:/home/koyomi/lanraragi/content \
-v /home/lanraragi/database:/home/koyomi/lanraragi/database \
--restart unless-stopped \
dezhao/lanraragi_cn
```
```bash
cd /srv/dev-disk-by-uuid-186bd712-77aa-422d-972f-8666404ff8ea
mkdir -vp lanraragi/{content,database}
```
```c++
docker run --name=lanraragi -d \
-p 9999:3000 \
-v /srv/dev-disk-by-uuid-186bd712-77aa-422d-972f-8666404ff8ea/lanraragi/content:/home/koyomi/lanraragi/content \
-v /srv/dev-disk-by-uuid-186bd712-77aa-422d-972f-8666404ff8ea/lanraragi/database:/home/koyomi/lanraragi/database \
--restart unless-stopped \
dezhao/lanraragi_cn
```
/srv/dev-disk-by-uuid-186bd712-77aa-422d-972f-8666404ff8ea/
https://e-hentai.org/
IOS APPhttps://github.com/Doraemoe/DuReader
## 影音系列
media使用一个公共外部文件夹
```c++
cd /home
mkdir -vp media
```
- TMDB:blueroses
- API 36dfc472117c89d9d747184c31c4777d
- TMDB超时问题解决 https://todsay.com/views/59.html
- TMDB超时问题解决https://www.hao4k.cn/thread-56601-1-1.html
- 检测工具
- https://tools.ipip.net/dns.php
- 爱站ping检测工具
修改NAS Host即可修改/etc/hosts文件。
NAS翻墙https://www.youtube.com/watch?v=ha6mYJW8tIo
### V2ray
```c++
cd /home
mkdir -vp v2ray/modules
```
```c++
docker run -d \
--restart=always \
--privileged \
--network=host \
--name v2raya \
-e V2RAYA_ADDRESS=0.0.0.0:2017 \
-v /home/v2ray/modules:/lib/modules:ro \
-v /home/v2ray/resolv.conf:/etc/resolv.conf \
-v /home/v2ray:/etc/v2raya \
mzz2017/v2raya
```
预览端口2017
进入之后选择导入V2ray设置之后选择这一行的“选择”按钮并且点击左上角的开启。并且勾选放置DNS污染。
### NAS-TOOl
```bash
cd /home
mkdir -vp nastools/{config,media}
```
```bash
docker run -d \
--name nas-tools \
--hostname nas-tools \
-p 10000:3000 `# 默认的webui控制端口` \
-v /home/nastools/config:/config `# 冒号左边请修改为你想在主机上保存配置文件的路径` \
-v /home/media:/media `# 媒体目录,多个目录需要分别映射进来` \
-e PUID=0 `# 想切换为哪个用户来运行程序该用户的uid详见下方说明` \
-e PGID=0 `# 想切换为哪个用户来运行程序该用户的gid详见下方说明` \
-e UMASK=000 `# 掩码权限默认000可以考虑设置为022` \
-e NASTOOL_AUTO_UPDATE=false `# 如需在启动容器时自动升级程程序请设置为true` \
-e REPO_URL="https://ghproxy.com/https://github.com/jxxghp/nas-tools.git" `# 如果你访问github的网络不太好可以考虑在创建容器时增加设置一个环境变量` \
--restart unless-stopped \
jxxghp/nas-tools
```
NASToolsadmin password
- 从零开始的软路由之爱快docker安装nastools:https://zhuanlan.zhihu.com/p/547732022
- 耗资过万新手如何搭建家庭影院绿联nas-tools详细教程:https://zhuanlan.zhihu.com/p/553313603
其他需要安装的:
- Kodi Sync Queue(电视盒子)
- kodi-19.4-Matrix-armeabi-v7a.apk电视机上安装
### jellyfin
- 中国特供版https://hub.docker.com/r/nyanmisaka/jellyfin
```bash
cd /home
mkdir -vp jellyfin/{config,tvshows,movies}
cd /srv/dev-disk-by-uuid-186bd712-77aa-422d-972f-8666404ff8ea
mkdir -vp jellyfin/H
```
```c++
docker run -d \
--name=jellyfin \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Asia/Shanghai \
-p 8096:8096 \
-p 8920:8920 `#optional` \
-p 7359:7359/udp `#optional` \
-p 1900:1900/udp `#optional` \
-v /home/jellyfin/config:/config \
-v /home/media/tvshows:/data/tvshows \
-v /home/media:/data/movies \
-v /srv/dev-disk-by-uuid-186bd712-77aa-422d-972f-8666404ff8ea/jellyfin:/data/movies/H \
--restart unless-stopped \
nyanmisaka/jellyfin:latest
```
### prowlarr
```bash
cd /home
mkdir -vp prowlarr/{config}
```
```bash
docker run -d \
--name=prowlarr \
-e PUID=1000 \
-e PGID=1000 \
--network=host \
-e TZ=Asia/Shanghai \
-p 9696:9696 \
-v /home/prowlarr/config:/config \
--restart unless-stopped \
linuxserver/prowlarr:develop
```
/home/prowlarr/config/config.xml 中api key
ACG资源
- https://www.acgbox.link/#term-7
### ChineseSubFinder
```c++
cd /home
mkdir -vp ChineseSubFinder /{config,media,browser}
```
```c++
docker run -d \
-v /home/ChineseSubFinder/config:/config `# 冒号左边请修改为你想在主机上保存配置、日志等文件的路径` \
-v /home/media:/media `# 请修改为需要下载字幕的媒体目录,冒号右边可以改成你方便记忆的目录,多个媒体目录需要添加多个-v映射` \
-e PUID=1000 \
-e PGID=1000 \
-e PERMS=true `# 是否重设/media权限` \
-e TZ=Asia/Shanghai `# 时区` \
-e UMASK=022 `# 权限掩码` \
-p 19035:19035 \
-p 19037:19037 `# webui 的视频列表读取图片用,务必设置不要暴露到外网` \
--name chinesesubfinder \
--hostname chinesesubfinder \
--log-driver "json-file" \
--log-opt "max-size=100m" `# 限制docker控制台日志大小可自行调整` \
allanpk716/chinesesubfinder:latest-lite
```
### opensubtitles
- blueroses
- Ljj@88483649
### qBittorent
```bash
cd /home
mkdir -vp qBittorent/{config,media}
```
```c++
docker run -d \
--name=qbittorrent \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Asia/Shanghai \
-e WEBUI_PORT=8080 \
-p 8080:8080 \
-p 6881:6881 \
-p 6881:6881/udp \
-v /home/qBittorent/config:/config \
-v /home/media/home:/downloads/home \
-v /srv/dev-disk-by-uuid-186bd712-77aa-422d-972f-8666404ff8ea/jellyfin/:/downloads/home/H \
-v /srv/dev-disk-by-uuid-186bd712-77aa-422d-972f-8666404ff8ea/jellyfin/AV:/downloads/home/AV \
-v /srv/dev-disk-by-uuid-186bd712-77aa-422d-972f-8666404ff8ea/jellyfin/3D:/downloads/home/3D \
-v /srv/dev-disk-by-uuid-186bd712-77aa-422d-972f-8666404ff8ea/jellyfin/2D:/downloads/home/2D \
--restart unless-stopped \
linuxserver/qbittorrent
```
▼默认监听端口是6881即使想要映射监听端口也不要监听默认端口大多数PT站都是禁了的用6881端口进行PT下载就会遇到以下问题“Port 6881 is blacklisted端口被黑名单了。
![](https://pic1.zhimg.com/80/v2-c8f0814424dba32edaa5e495a721b3b4_720w.jpg)
▼翻看PT站点的公告或者是常见问题就可以看到被屏蔽的端口号6881-6889都是禁封的像这个站点推荐了49153-65535端口随便自行设置就好。
![](https://pic3.zhimg.com/80/v2-dd65dd3c6c6b35b191472527f0b7fd92_720w.jpg)
### 让qBit可以外网访问
去掉 启用Host Header属性验证。
▼刚安装好的qBit是不能通过外网访问的即使在路由器上做了端口转发访问时你会发现出现下面的情况。
![](https://pic2.zhimg.com/80/v2-47fb6ccb1c0db3b1788ba2bb07039851_720w.jpg)
▼这时候我们需要将配置文件”qbittorent.conf“下载到本地进行修改在文档末尾加入下面的代码。
> WebUI\HostHeaderValidation=false
![](https://pic4.zhimg.com/80/v2-746d06eecf6033183dd2115571b74167_720w.jpg)
▼将修改好的conf文件上传到qBit的config文件夹下进行覆盖。
![](https://pic3.zhimg.com/80/v2-e3fb5518745fd528d48f5b66f41f2b2a_720w.jpg)
**注意似乎只有admin用户有删除Container文件夹下文件的权限请用admin用户进行操作。**
![](https://pic3.zhimg.com/80/v2-d641fe50f0b7059e012a6563c27e9b92_720w.jpg)
### 初见qBittorrent
▼现在在外网环境下也能够登录qBittorent了用户名为admin密码为adminadmin。
![](https://pic3.zhimg.com/80/v2-8decd8224733caf24d02ebac03acf32a_720w.jpg)
▼此时的qBit还是英文找到图中的小齿轮➡Web UI➡简体中文。
![](https://pic1.zhimg.com/80/v2-8fe0b60a418f8ef05cb03fa910235a10_720w.jpg)
修改默认密码
▼在刚刚修改语言的位置往下拉一点点就可以看到修改账号密码的地方了为了省事偷懒也可以对局域网内网中的IP地址设置白名单省去身份验证的步骤。
![](https://pic1.zhimg.com/80/v2-5d4e2bab4e96687c157d0466b49e57b8_720w.jpg)
修改监听端口
▼就香前面说的监听端口在部署Docker时咱们没有做映射默认的时6881为了下载有速度咱们这里随便roll一个用于传入连接的端口同时开启UPnP功能转发端口下载就能跑的起来了。
![](https://pic1.zhimg.com/80/v2-4aca10689218c61724d8760cc6dc536c_720w.jpg)
### 修改下载位置与自动添加种子
▼我们之前将downloads文件夹映射到了Multimedia文件夹这里展示出来的download是容器内部的文件夹实际上是我们Nas上的Multimedia相当于是根目录是不能修改的能做的只是在后面跟上新的路径比如说”/Music“或者是”/Movie“之类的如此下载就会下载到Multimedia下的Music/Movie等自建文件夹。自动添加种子奶爸一般不用小伙伴们自行使用。
![](https://pic3.zhimg.com/80/v2-a81c515378b75eeb7b928a8cf5cd9ed6_720w.jpg)
### PT站
https://blog.csdn.net/u012558210/article/details/106538528
- http://share.dmhy.org/
- https://www.36dm.com/
- https://www.skyey2.com/login_notice.php
- https://www.nicept.net/donate.php
## OnlyOffice
```bash
cd /home
mkdir -vp onlyoffice/{logs,data}
```
```bash
docker run -i -t -d -p 9999:80 \
-v /home/onlyoffice/logs:/var/log/onlyoffice \
-v /home/onlyoffice/data:/var/www/onlyoffice/Data \
onlyoffice/documentserver
```
之后让Example自动启动
```bash
docker exec 6b51e5dd3e43 sudo sed 's,autostart=false,autostart=true,' -i /etc/supervisor/conf.d/ds-example.conf
```
## hentaiathome
客户编号44771
客户端密钥m4NKWURvR83BsnJTuej1
44771-m4NKWURvR83BsnJTuej1
```bash
#Pull image
docker pull ghcr.io/disappear9/hentaiathome:latest
#Create volume for caches and logs
docker volume create h_at_h_data
#Run it
docker run -d --name h_at_h \
-p 9876:9876 \
-v /home/hentaiathome/data:/hath/data \
-v /home/hentaiathome/download:/hath/download \
-e HatH_KEY=44771-m4NKWURvR83BsnJTuej1 \
ghcr.io/disappear9/hentaiathome
```
Update:
```bash
#Stop
sudo docker stop h_at_h
#Delete
sudo docker rm h_at_h
#Delete old image
sudo docker rmi ghcr.io/disappear9/hentaiathome
#Pull new image
sudo docker pull ghcr.io/disappear9/hentaiathome
#Run it
sudo docker run -d --name h_at_h -p YOUR_PORT:YOUR_PORT -v h_at_h_data:/hath/data -v /DOWNLOAD_DIR:/hath/download ghcr.io/disappear9/hentaiathome
Or
sudo docker run -d --name h_at_h --net host -v h_at_h_data:/hath/data -v /DOWNLOAD_DIR:/hath/download ghcr.io/disappear9/hentaiathome
If you want to change port in the future.
```
## Perlite
```bash
cd /home
mkdir -vp perlite/{notes,config,web}
docker container rm perlite
docker image rm sec77/perlite:latest
docker-compose up -d
```
notes就是放笔记的位置
```bash
version: "3.9"
services:
perlite:
image: sec77/perlite:latest
container_name: perlite
restart: unless-stopped
environment:
- NOTES_PATH=note
- HIDE_FOLDERS=docs,private,trash
- LINE_BREAKS=true
volumes:
- ./note:/var/www/perlite/note:ro
- ./config:/web/config \
web:
build:
context: ./web
image: sec77/perlite_web:stable
container_name: perlite_web
restart: unless-stopped
ports:
- 9090:80
volumes_from:
- perlite
depends_on:
- perlite
```
Gitea Token e2eb7193b043e0d914ba76651197ad0a36daa974
## Perforce
参考:
- https://www.froyok.fr/blog/2018-09-setting-up-perforce-with-docker-for-unreal-engine-4/
- https://docs.unrealengine.com/5.1/zh-CN/using-perforce-as-source-control-for-unreal-engine/
Docker的Perforce镜像映射路径会报错导致无法提取文件与挂载到NAS硬盘上。
```
make perforce-server-{image,tag}
```
-v /mnt/nfs-1/perforce/data:/data \
-v /mnt/nfs-1/perforce/config:/etc/perforce \
```bash
docker run -d -h perforce --name perforce --restart unless-stopped \
-e PUID=1000 \
-e PGID=1000 \
-v /mnt/nfs-1/perforce/data:/data \
-v /mnt/nfs-1/perforce/config:/etc/perforce \
-p 8080:8080 \
-p 1666:1666 \
ambakshi/perforce-server
```
```bash
docker run -d -h perforce -u root --name perforce --restart unless-stopped \
-e PUID=1000 \
-e PGID=1000 \
-v /mnt/nfs-1/perforce/data:/app \
-p 8080:8080 \
-p 1666:1666 \
ambakshi/perforce-server
```
```bash
docker run -d -h perforce --name perforce --restart unless-stopped \
-p 8080:8080 \
-p 1666:1666 \
ambakshi/perforce-server
```
```bash
docker exec -it perforce /bin/sh
```
p4admin
pass12349ers!
https://www.perforce.com/blog/vcs/how-docker-works
官方提供的基准:
https://swarm.workshop.perforce.com/files/guest/robert_cowham/perforce/utils/benchmark/
官方提供的DockerFile
https://swarm.workshop.perforce.com/files/guest/robert_cowham/perforce/utils/benchmark/p4/docker/Dockerfile
https://swarm.workshop.perforce.com/files/guest/robert_cowham/perforce/utils/benchmark/run_browse_p4d_in_docker.sh
https://swarm.workshop.perforce.com/files/guest/robert_cowham/perforce/utils/benchmark/build_docker.sh
## Jenkins
参考https://zhuanlan.zhihu.com/p/89312003
```bash
docker run --name jenkinsci-blueocean -d -u root --restart unless-stopped \
-p 8080:8080 \
-p 50000:50000 \
-v /mnt/nfs-1/jenkins/Data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkinsci/blueocean
```
## jeessy/ddns-go
- 不挂载主机目录, 删除容器同时会删除配置
```bash
# host模式, 同时支持IPv4/IPv6, Liunx系统推荐
docker run -d --name ddns-go --restart=always --net=host jeessy/ddns-go
# 桥接模式, 只支持IPv4, Mac/Windows系统推荐
docker run -d --name ddns-go --restart=always -p 9876:9876 jeessy/ddns-go
```
- 在浏览器中打开`http://主机IP:9876`,修改你的配置,成功
- [可选] 挂载主机目录, 删除容器后配置不会丢失。可替换 `/opt/ddns-go` 为主机目录, 配置文件为隐藏文件
```bash
docker run -d --name ddns-go --restart=always --net=host -v /opt/ddns-go:/root jeessy/ddns-go
```
- [可选] 支持启动带参数 `-l`监听地址 `-f`间隔时间(秒)
```bash
docker run -d --name ddns-go --restart=always --net=host jeessy/ddns-go -l :9877 -f 600
```
### DAWA使用配置
```bash
docker run -d --name ddns-go --restart=always --net=host \
-v /mnt/nfs-1/ddns-go:/root \
jeessy/ddns-go
```
DAWAHZ
ID369049
Tokeneb547401d3dddf813e018e7afeab8763

View File

@@ -0,0 +1,81 @@
## 运行 有问题不能使用
mkdir -p /root/docker/nginx/conf
mkdir -p /root/docker/nginx/html
mkdir -p /root/docker/nginx/log
mkdir -p /root/docker/nginx/ssl
```
docker run -d --restart=always --name nginx-web \
-v /root/docker/nginx/nginx.conf:/etc/nginx/nginx.conf \
-v /root/docker/nginx/html:/usr/share/nginx/html \
-v /root/docker/nginx/log:/var/log/nginx \
-p 80:80 \
nginx
```
## 默认配置地址
https://github.com/nginx/nginx/blob/master/conf/nginx.conf
记得修改
```
location / {
root html;
index index.html index.htm;
}
```
```
location / {
root /usr/share/nginx/html/;
index index.html index.htm;
}
```
修改完配置后需要重启docker容器。
## 默认路径
/usr/share/nginx/html/
## 有关DNS
~~默认的域名blueroses.top是指向cloudflare的所以通过域名来访问SFTP需要访问在cloudflare设置的子域名~~。然而是cloudflare域名解析的问题。
- tj.blueroses.top
- www.blueroses.top
因为还添加了阿里云DNS解析所以更换VPS时需要记得**修改阿里云的DNS设置**。
## VPS Blog部署
其他方法都或多或少的比较麻烦所以最后用SFtp。
### SFtp
```
docker run --name sftp \
-v /root/docker/nginx/html:/home/web/ \
-p 2222:22 -d atmoz/sftp \
web:web
```
账号密码结为web,遇到权限问题,需要设置一下目录权限。
chmod -R 666 /docker/nginx/html/
```
docker run --name mysftp -p 2294:22 -d atmoz/sftp foo:pass:::upload
--name mysftp  容器名称
foo:pass:::upload  其中foo为用户名pass为密码upload为上传的文件会保存到容器里面的/home/foo/upload目录里面
-p 22:22  将宿主机的22端口映射到容器的22端口这样方位宿主机的22端口则会转发到容器的22端口上
-d atmoz/sftp  使用dockup hub中的atmoz/sftp镜像创建容器
```
### githook
因为使用docker所以没法直接执行bash。
```
rm -rf /docker/nginx/test/
mkdir /docker/nginx/test/
git clone /docker/gitea/git/repositories/bluerose/blog.git /docker/nginx/test/
rm -rf
cp -rf /docker/nginx/test/ /docker/nginx/html/
```
```
GIT_REPO=/docker/gitea/git/repositories/bluerose/blog.git \
TMP_GIT_CLONE=/docker/test/ \
PUBLIC_WWW=/docker/nginx/html/ \
rm -rf ${TMP_GIT_CLONE} \
mkdir ${TMP_GIT_CLONE} \
git clone $GIT_REPO $TMP_GIT_CLONE \
cp -rf ${TMP_GIT_CLONE} ${PUBLIC_WWW}
```

View File

@@ -0,0 +1,115 @@
---
title: Perforce Helix Core搭建
date: 2022-12-21 14:51:55
excerpt:
tags: Perforce
rating: ⭐
---
# Perforce Docker
可以使用这个容器:
https://hub.docker.com/r/sourcegraph/helix-p4d
但这个容器是2020年构建的我这里重新调整了一下并且手动构建成功具体可以参考下文。
## DockerFile构建
大致步骤如下:
1. 下载**blueroseslol/helix-docker**仓库的所有文件。
2. 构建DockerFile。
```bash
cd /home/perforce/helix-docker/helix-p4d/ && \
docker build -f /home/perforce/helix-docker/helix-p4d/Dockerfile -t helix-p4d:2023.5 .
```
## 使用
```shell
docker run -d --name helix-p4d\
-p 1666:1666 \
-v /home/perforce/p4:/p4 \
helix-p4d:2023.5
```
```bash
docker run -d \
-p 1666:1666 \
-v /home/perforce/p4:/p4 \
sourcegraph/helix-p4d:2020.2
```
### Github文档
```shell
docker run --rm \
--publish 1666:1666 \
sourcegraph/helix-p4d:2020.2
```
默认端口`:1666`, 默认用户名为 `admin`, 默认密码: `pass12349ers`。以下是所有配置的默认值。
```shell
NAME=perforce-server
P4HOME=/p4
P4NAME=master
P4TCP=1666
P4PORT=1666
P4USER=admin
P4PASSWD=pass12349ers
P4CASE=-C0
P4CHARSET=utf8
JNL_PREFIX=perforce-server
```
可以使用`--env` 覆盖上述环境变量:
```shell
docker run --rm \
--publish 1666:1666 \
--env P4USER=amy \
--env P4PASSWD=securepassword \
sourcegraph/helix-p4d:2020.2
```
请注意尽管服务器在重启后仍能存活即数据被保留但如果你在初始启动后即镜像的第一次运行在选项被硬编码为Perforce Helix核心服务器自身配置时改变选项它可能会中断。要启动一个长期运行的生产容器记得要把数据目录`P4HOME`)容器,把`--rm`标志换成`d`(分离):
```shell
docker run -d \
--publish 1666:1666 \
--env P4PASSWD=securepassword \
--volume ~/.helix-p4d-home:/p4 \
sourcegraph/helix-p4d:2020.2
```
### 推送镜像到Dockerhub
```text
docker tag 9f45f31246ac blueroses/perforce-helix-p4d:2023.5
docker push blueroses/perforce-helix-p4d:2023.5
```
# UE部分操作
- https://docs.unrealengine.com/5.1/en-US/using-perforce-as-source-control-for-unreal-engine/
- https://zhuanlan.zhihu.com/p/414193101?utm_id=0
- [UE4管理多重项目-WiseeEngineering](https://zhuanlan.zhihu.com/p/364346565)
- [UnrealEnigne源码构建&Perforce&UnrealGameSync开发版本控制基础部署](https://zhuanlan.zhihu.com/p/362276094)
- [打通UE4美术资源版本控制关节](https://zhuanlan.zhihu.com/p/261692804)
编码使用UTF8-no bom
- 注册源码引擎到EpicGames
经过上面的步骤,源码引擎已经构建成功,但是在对项目就行选择引擎版本的时候,发现并没有这个版本 。这是因为构建的引擎没有注册到EpicGames中找到EpicGames安装目录下的注册器。复制到源码工程并且运行即可。
```text
Launcher\Engine\Binaries\Win64
```
# Perforce
- https://help.perforce.com/helix-core/quickstart-unreal/Content/quickstart/game-home-quickstart.html
- https://www.perforce.com/manuals/p4v/Content/P4V/Home-p4v.html
- https://www.perforce.com/manuals/p4guide/Content/P4Guide/Home-p4guide.html
- https://www.perforce.com/manuals/p4sag/Content/P4SAG/Home-p4sag.html
- https://www.perforce.com/manuals/p4admin/Content/P4Admin/Home-p4admin.html
## 相关概念
### Workspace
Workspace可以理解为depot到本地的一个映射对应本地的一个目录。
新建Workspace在p4admin中depot查看在服务器中存放的所有Ddepot仓库
开发的过程中可以有多个Workspace例如一个用来开发一个用来更新验证保证提交没有错误但一般只推荐有一个Workspace
###

View File

@@ -0,0 +1,42 @@
## 参考网址
https://www.kutu66.com//GitHub/article_113357
## docker后缀
在 Docker 容器中运行带有smtp身份验证( sasldb )的postfix。 TLS和OpenDKIM支持是可选的。
## 需求
Docker 1.0
## 安装
```
sudo docker pull catatnight/postfix
```
## 用法
使用smtp身份验证创建后缀容器
```
docker run -p 25:25
-e maildomain=mail.example.com -e smtp_user=user:pwd
--name postfix -d catatnight/postfix# Set multiple user credentials: -e smtp_user=user1:pwd1,user2:pwd2,...,userN:pwdN
```
本人使用
```
docker run -p 25:25 -e maildomain=mail.blueroses.top -e smtp_user=gitea@blueroses.top:ljj@12345678 --name postfix -d catatnight/postfix
```
```
$ sudo docker run -p 25:25
-e maildomain=mail.example.com -e smtp_user=user:pwd
--name postfix -d catatnight/postfix# Set multiple user credentials: -e smtp_user=user1:pwd1,user2:pwd2,...,userN:pwdN
启用 OpenDKIM: 在 /path/to/domainkeys 中保存你的域密钥 .private
$ sudo docker run -p 25:25
-e maildomain=mail.example.com -e smtp_user=user:pwd
-v/path/to/domainkeys:/etc/opendkim/domainkeys
--name postfix -d catatnight/postfix
启用 TLS(587): 将SSL证书 .key 和 .crt 保存到 /path/to/certs
$ sudo docker run -p 587:587
-e maildomain=mail.example.com -e smtp_user=user:pwd
-v/path/to/certs:/etc/postfix/certs
--name postfix -d catatnight/postfix
```

View File

@@ -0,0 +1,304 @@
## vps 价格
### hostkey
1核 2G内存 30G硬盘 0.010K贝壳/小时 2M带宽 (≈72元/月)
2核 4G内存 40G硬盘 0.020K贝壳/小时 3M带宽 (≈144元/月)
### 搬瓦工
CN2 GIA 1190元/年
### UCloud
1M/2M 225元/年起
2M/5M 534元/年起
### 硅云
1核1G 带宽 2M 232 元/1年
2核2G 带宽 2M 482 元/1年
## blueroses.top(阿里云)
### DNS
alla.ns.cloudflare.com
micah.ns.cloudflare.com
dns19.hichina.com
dns20.hichina.com
f1g1ns1.dnspod.net
f1g1ns2.dnspod.net
### cloudflare
如果不通可能是cloudflare出问题了。
默认的域名blueroses.top是指向cloudflare的所以通过域名来访问SFTP需要访问在cloudflare设置的子域名。
- tj.blueroses.top
- www.blueroses.top
因为还添加了阿里云DNS解析所以更换VPS时需要记得**修改阿里云的DNS设置**。
## 搬瓦工
378100977@qq.com ljj199221
## 测速网址
### SpeedTest
https://www.speedtest.net/
测速命令:`wget -qO- bench.sh | bash`
### ip测速
https://tools.ipip.net/newping.php
### 检查Ip是否被墙
https://bandwagonhoster.com/653.html
http://www.ping.pe/
https://ping.pe/
### 搬瓦工免费换ip
https://kiwivm.64clouds.com/main-exec.php?mode=blacklistcheck
## 单位阿里云账号
```
阿里云账号(拜托华城租的服务器)
子账户zjsjcpzljczx@1042965787832287
密码:123456&*()LlL
123456&*()LlL
zaq1@XSW2
登录地址http://signin.aliyun.com/1042965787832287/login.htm
116.62.69.44
```
```
门户网站域名:轻工院方工管理。
```
# Trojan
## BBR Plus加速脚本
wget "https://github.com/chiakge/Linux-NetSpeed/raw/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
## 一键Trojan脚本
curl -O https://raw.githubusercontent.com/atrandys/trojan/master/trojan_centos7.sh && chmod +x trojan_centos7.sh && ./trojan_centos7.sh
curl -O https://raw.githubusercontent.com/atrandys/trojan/master/trojan_mult.sh && chmod +x trojan_mult.sh && ./trojan_mult.sh
### 修改密码
修改Trojan服务端密码需用到的命令
```
sudo systemctl stop trojan
cd /usr/src/trojan
vi server.conf
sudo systemctl restart trojan
```
### 安卓Android端Igniter下载地址
https://github.com/trojan-gfw/igniter...
### IOS
需要借用他人IOS账号购买ShadowRocket。
## 使用Docker安装Trojan
### 安装Docker
1. 卸载老版本的 docker 及其相关依赖
sudo yum remove docker docker-common container-selinux docker-selinux docker-engine
2. 更新yum
yum update
3. 安装 yum-utils它提供了 yum-config-manager可用来管理yum源
sudo yum install -y yum-utils
4. 添加yum源
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
5. 更新索引
sudo yum makecache fast
6. 安装 docker-ce
sudo yum install -y docker-ce
指定版本安装
yum -y install docker-ce-18.06.3.ce
yum install docker-ce docker-ce-cli containerd.io
7. 启动 docker
sudo systemctl start docker
8. 验证是否安装成功
sudo docker info
9. 开机自启动
systemctl enable docker
### 通过acme.sh脚本来设置证书
安装acme.sh
```
apt-get update && apt-get -y install socat //安装socat
yum install socat
wget -qO- get.acme.sh | bash //安装脚本
source ~/.bashrc
```
#### 申请证书
在你的域名解析服务提供商那里添加好解析记录假定你的域名是yourdomain.com记得不要开启CDN然后执行下面命令申请证书。
```
acme.sh --issue --standalone -d yourdomain.com -k ec-256
```
因为本人要有blog需要与nginx容器共存所以使用网站目录方式
```
acme.sh --issue -d blueroses.top -d www.blueroses.top -d tj.blueroses.top -k ec-256 --webroot /root/docker/nginx/html
```
#### 安装证书和私钥到指定位置
```
acme.sh --installcert -d blueroses.top \
--fullchain-file /root/docker/trojan/trojan.crt \
--key-file /root/docker/trojan/trojan.key \
--ecc --reloadcmd "docker restart nginx-web trojan"
```
#### 自动续期
```
acme.sh --upgrade --auto-upgrade
```
#### 证书过期解决方法手动使用DNS验证(没必要用这个)
通过Docker关闭Nginx服务器之后执行申请证书
```
acme.sh --issue --standalone -d tj.blueroses.top -k ec-256
```
2020.9.19遇到证书过期是cloudflare把我的DNS解析删掉了
如果出错可以考虑用DNS验证
```
acme.sh --issue --dns -d tj.blueroses.top -k ec-256 --yes-I-know-dns-manual-mode-enough-go-ahead-please
```
重启Trojan服务。
#### acme.sh证书签发单位更换
因为acme.sh 2.0更换了默认的签发单位为zerossl所以如果有需要可以更换
```
acme.sh --set-default-ca --server letsencrypt
acme.sh --set-default-ca --server zerossl
```
### 安装Docker
```
wget -qO- get.docker.com | bash //安装docker
systemctl start docker //启动docker服务
systemctl status docker //查看docker运行状态
docker -v //查看docker版本
systemctl enable docker //将docker服务加入开机自启动
```
### 安装Trojan
```
docker pull teddysun/trojan
```
创建并且修改配置文件**(证书路径、密码)**。
```cd /docker/trojan && vim config.json```
password可以设置多个方便多用户使用.
```
{
"run_type": "server",
"local_addr": "0.0.0.0",
"local_port": 443,
"remote_addr": "127.0.0.1",
"remote_port": 80,
"password": [
"512512512",
"512"
],
"log_level": 1,
"ssl": {
"cert": "/etc/trojan/trojan.crt",
"key": "/etc/trojan/trojan.key",
"key_password": "",
"cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384",
"cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
"prefer_server_cipher": true,
"alpn": [
"http/1.1"
],
"reuse_session": true,
"session_ticket": false,
"session_timeout": 600,
"plain_http_response": "",
"curves": "",
"dhparam": ""
},
"tcp": {
"prefer_ipv4": false,
"no_delay": true,
"keep_alive": true,
"reuse_port": false,
"fast_open": false,
"fast_open_qlen": 20
},
"mysql": {
"enabled": false,
"server_addr": "127.0.0.1",
"server_port": 3306,
"database": "trojan",
"username": "trojan",
"password": ""
}
}
```
#### 启动命令
trojan
```
docker run -d --name trojan --restart always --net host \
-p 443:443 \
-v /root/docker/trojan:/etc/trojan \
teddysun/trojan
```
trojan-go
```bash
docker run -d --network host --name trojan-go --restart=always \
-v /root/docker/trojan-go:/etc/trojan-go \
teddysun/trojan-go
```
#### 一键脚本紧急时候使用
```bash
curl -sL https://raw.githubusercontent.com/phlinhng/v2ray-tcp-tls-web/master/install.sh) && v2script
```
#### ~~带有管理后台的Docker部署~~ 会顶掉我Blog网站所以放弃
1. 安装mysql
因为mariadb内存使用比mysql至少减少一半, 所以推荐使用mariadb数据库
```
docker run --name trojan-mariadb --restart=always -p 3306:3306 \
-v /root/docker/mariadb:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=trojan \
-e MYSQL_ROOT_HOST=% \
-e MYSQL_DATABASE=trojan \
-d mariadb:10.2
```
数据库trojan
账号root
密码trojan
2. 安装trojan
```
docker run -it -d --name trojan-web --net=host --restart=always --privileged jrohy/trojan init
```
运行完后进入容器 `docker exec -it trojan-web bash`, 然后输入`trojan`即可进行初始化安装
- 启动web服务: `systemctl start trojan-web`
- 设置自启动: `systemctl enable trojan-web`
- 更新管理程序: `source <(curl -sL https://git.io/trojan-install)`
#### 查看日志
docker logs -f 容器id
docker logs -f --tail string 容器id
# Nginx
```bash
docker run -d --restart=always --name nginx-web \
-v /root/docker/nginx/nginx.conf:/etc/nginx/nginx.conf \
-v /root/docker/nginx/html:/usr/share/nginx/html \
-v /root/docker/nginx/log:/var/log/nginx \
-v /root/docker/trojan/:/root/docker/trojan \
-v /etc/localtime:/etc/localtime:ro \
-p 80:80 \
nginx
```
# X-UI
```bash
docker run -itd --network=host \
-v /root/docker/x-ui/db/:/etc/x-ui/ \
-v /root/docker/trojan/:/root/cert/ \
--name x-ui --restart=unless-stopped \
enwaiax/x-ui
```

View File

@@ -0,0 +1,2 @@
## 访问指定页面需要输入账号密码的方法
https://www.cnblogs.com/brianzhu/p/8625502.html

View File

@@ -0,0 +1,135 @@
---
title: 使用Fastbuild加快UnrealEngine编译速度
date: 2021-11-09 22:34:16
excerpt:
tags: FastBuild
rating: ⭐
---
# 使用Fastbuild加快UnrealEngine编译速度
如果你有多台电脑或者服务器就可以使用FastBuild提高编译速度。虽然最后测试法线i7-7700+一台几年前的e5 40核心服务器依然比不过今年买的枪神5笔记本。
如果你完全按照 https://zhuanlan.zhihu.com/p/158400394 的教程来操作那你就被坑了。目前Fastbuild的最新版本与UE是不兼容的。很可能会出现寻找的目录与FastBuild创建的目录不一致的问题。以下是本人的log
```
已启动生成…
1>------ 已启动生成: 项目: UE4, 配置: Development_Editor x64 ------
1>Building UE4Editor and ShaderCompileWorker...
1>Using Visual Studio 2019 14.29.30136 toolchain (D:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133) and Windows 10.0.19041.0 SDK (D:\Windows Kits\10).
1>Detected build type as Windows from 'D:\UnrealEngine\UnrealEngine4.27\Engine\Build\Windows\cl-filter\cl-filter.exe' using search term 'Windows'
1>Using path : {D:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC/Redist/MSVC\14.29.30133} for vccorlib_.dll (MSVC redist)...
1> ...Add an entry for MsvcCRTRedistVersion in BuildConfiguration.xml to specify a version number
1>FBuild Command Line Arguments: '-monitor -summary -dist -cacheread -ide -clean -config "D:\UnrealEngine\UnrealEngine4.27\Engine\Intermediate\Build\fbuild.bff" -nostoponerror
1>BFF file 'D:\UnrealEngine\UnrealEngine4.27\Engine\Intermediate\Build\fbuild.bff' has changed (reparsing will occur).
1>Using brokerage folder
1>No workers found in '\\DESKTOP-QI1GP15\FastBuildBroker\main\20.windows\'
1>No workers available - Distributed compilation disabled
```
## 操作步骤
上述问题是因为当前使用的FastBuild协议版本与UE4所需的不同造成的所以你需要使用EPIC定制的FastBuild。本人使用Win10与UnrelEngine4.27.0源码版目前正确的操作步骤如下:
1. 使用源码目录`Engine\Extras\ThirdPartyNotUE\FASTBuild\Win64\`下的FastBuild。指定一个不含用中文路径的目录。
2. 在该目录中再新建一个名为`FBuild`的文件夹并将3个文件复制进去。这一步是可选步骤是为了兼容`FBDashboard.exe`。你可以去FastBuild官网下载并且指定目录下。只需要复制FBDashboard.exe放在FBuild外面
3. 创建共享文件夹。添加当前用户与Everyone用户权限为读/写。之后再用其他电脑访问一次能进入并且写文件就完成了。只需要其中一台电脑or服务器创建共享文件夹即可其他所有机器都会使用这个共享文件夹
4. 添加环境变量FASTBUILD_BROKERAGE_PATH内容为共享文件夹的网络路径比如`\\DESKTOP-QI1GP15\FastBuildBroker`Path变量添加FBuild.exe所在目录之后在CMD中输入FBuild运行后提示`Failed to open BFF 'fbuild.bff'`就代表添加成功了。
5. 在其他电脑与服务器上执行上述步骤。
6. 添加编译配置。给`Engine\Saved\UnrealBuildTool\BuildConfiguration.xml`添加`bAllowFASTBuild`配置为true。
比如这样:
```xml
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<BuildConfiguration>
<bAllowFASTBuild>true</bAllowFASTBuild>
</BuildConfiguration>
</Configuration>
```
## 共享问题
你很可能会遇到无法打开共享或是网络发现的功能下面我分享以下解决方法。测试系统win10、win2012 r2。
1. 关闭win防火墙。
2. 在控制面板-程序-启动或者关闭服务器功能中确保安装了SMB 1.0/CIFS 文件共享支持下的所有功能。
3. 运行services.msc启动Computer Browser服务并将启动方式设置为自动。将下列服务启动并将启动方式设置为自动延迟启动Function Discovery Provider Host、Function Discovery Resource Publication、Network Connections、UPnP Device Host。
## 其他注意点
`江湖小辈`教程中使用FastBuild源码版是为了做测试以及通过修改源代码来实现通过Ip来代替计算机名来寻找共享。如果你想使用最新版本就需要修改FastBuild源码中的`distributed protocol version`。本人没有试过,但应该是这样没错。
对于团队来说添加Shader编译也许必须的所以还可能修改UBT代码。可以参考《腾讯游戏开发精粹》一书的对应章节但记住在修改完UBT代码后需要重新编译UBT。 调试UBT的话需要在UBT工程上右键-属性-调试页面中将配置设为Debug,之后添加命行参数,之后在Debug模式下就可以命中断点了。编译UE4源码命令行如下
```
UE4Editor Win64 Development -Quiet -WaitMutex -FromMsBuild
```
对于在家办公想要使用公司服务器进行编译,使用反向代理+OpenConnect应该是可行的只要带宽足够。
## 编译配置
是一个名为`BuildConfiguration.xml`的xml文件用于控制编译。除了可以在项目`Config/UnrealBuildTool`中添加外。UBT还会从以下位置Windows系统的XML配置文件读取设置
- Engine/Saved/UnrealBuildTool/BuildConfiguration.xml - 针对特定引擎版本。
- User Folder/AppData/Roaming/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml
- My Documents/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml - 适用于所有已安装的引擎版本。
除了上文中说到的bAllowFASTBuild外因为本人使用附带git信息的引擎源码编译时UBT会先去读取git信息但因为源码git信息量太大非常浪费时间。这里可以添加
```xml
<SourceFileWorkingSet>
<Provider>None</Provider>
<RepositoryPath></RepositoryPath>
<GitPath></GitPath>
</SourceFileWorkingSet>
```
起到让UBT禁用“使用 'git status' 来确定AdaptiveUnityBuild。下面介绍一下其他参数完整参数请去官方文档参考。
### LocalExecutor
- ProcessorCountMultiplier本地执行的处理器计数乘数。设为小于1可为其他任务保留CPU。使用本地执行器非XGE在每个CPU核心上运行单一操作。注意: 可将该属性设为较大的值,在多数情况下可稍微提高编译速度,但电脑在编译期间的响应速度将变慢。
- MaxProcessorCount本地执行的最大处理器数量。
### ParallelExecutor
- MaxProcessorCount本地执行的最大处理器数量。
- ProcessorCountMultiplier本地执行的处理器计数乘数。设为小于1可为其他任务保留CPU。
- bStopCompilationAfterErrors启用时将在发生编译错误后停止编译目标。
我在查看了AnswerHUB看到有人分享了自己的配置
查阅代码之后发现,这些配置选项要去看 BuildConfigProperties.INT.udn 里的参数ProcessorCountMultiplier 是在 ParallelExecutor 下的,所以改成以下配置:
```xml
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<ParallelExecutor>
<ProcessorCountMultiplier>7</ProcessorCountMultiplier>
<MaxProcessorCount>7</MaxProcessorCount>
<bStopCompilationAfterErrors>true</bStopCompilationAfterErrors>
</ParallelExecutor>
</Configuration>
```
目前我使用的完整配置:
```xml
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<BuildConfiguration>
<ProcessorCountMultiplier>7</ProcessorCountMultiplier>
<MaxParallelActions>7</MaxParallelActions>
<bAllowParallelExecutor>true</bAllowParallelExecutor>
</BuildConfiguration>
<SNDBS>
<ProcessorCountMultiplier>4</ProcessorCountMultiplier>
<MaxProcessorCount>4</MaxProcessorCount>
</SNDBS>
<ParallelExecutor>
<ProcessorCountMultiplier>7</ProcessorCountMultiplier>
<MaxProcessorCount>7</MaxProcessorCount>
<bStopCompilationAfterErrors>true</bStopCompilationAfterErrors>
</ParallelExecutor>
</Configuration>
```
### FASTBuild
- FBuildExecutablePath用于指定 fbuild.exe 的位置(如果发布的二进制文件未使用)
- bEnableDistribution控制网络构建分布network build distribution
- FBuildBrokeragePath用于指定中间件的位置。如为null则FASTBuild退回检查FASTBUILD_BROKERAGE_PATH
- bEnableCaching控制是否使用缓存。仅当该选项启用后CachePath和FASTCacheMode才会相关。
- CacheMode缓存访问模式 - 仅当bEnableCaching为真时相关
- FBuildCachePath用于指定缓存的位置。如为nullFASTBuild会退回检查FASTBUILD_CACHE_PATH
- bForceRemote是否强制远程
- bStopOnError是否在错误上停止
- MsvcCRTRedistVersion使用哪个MSVC CRT Redist版本
## UnityBuild
- bUseAdaptiveUnityBuild使用启发式方法来确定哪些文件目前正在被迭代并将它们从unity blobs中排除从而加快增量编译的时间。目前的实现使用只读标志来区分工作集假设文件正在被修改源码控制系统将使其可写。这对Perforce是正确的但对Git不是。

View File

@@ -0,0 +1,515 @@
---
title: 提升FastBuild编译UnrealEngine的速度
date: 2021-11-09 22:34:16
excerpt:
tags: FastBuild
rating: ⭐
---
在上一篇文章之后我进行了进一步测试,下面是结果。
## 测试结果
**测试配置**
i7-8700 3.2Ghz 12线程
16GB内存
WDC PC SN730 SDBQNTY-256G-1001 固态硬盘
ST1000DM003-1SB102 机械硬盘
**服务器配置**
Inter Xeon Silver 4114 2.2GHz 2处理器40线程
64GB内存
引擎版本`4.27.0 Release`
网络:百兆网络
### 引擎放在机械硬盘
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/FastBuildDefault.PNG)
总共花费时间与编译量:
```
1>[2328/2328] UnrealBuildTool.exe UE4Editor.target
1>Total time in FASTBuild executor: 8160.80 seconds
1>Total execution time: 8501.83 seconds
```
141min
### 引擎放在机械硬盘并禁用插件
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/FastBuildDisablePlugins.png)
总共花费时间与编译量:
```
3>[1000/1000] UnrealBuildTool.exe UEToonRenderingEditor.target
3>Total time in FASTBuild executor: 3765.71 seconds
3>Total execution time: 3902.75 seconds
```
65min
这里我额外测试了一下开启`ForceRemote`的情况:
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/FastBuildForceRemote_DisablePlugins.png)
```
3>[1000/1000] UnrealBuildTool.exe UEToonRenderingEditor.target
3>Total time in FASTBuild executor: 4508.08 seconds
3>Total execution time: 4708.38 seconds
```
78min
### 引擎放在固态硬盘并禁用插件
因为将引擎从机械硬盘移动到固态硬盘中间删除了一些东西导致引擎多编译了一些实际时间要比测试的要短3~8min。
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/FastBuildSolidDisk.png)
```
3>[1006/1006] UnrealBuildTool.exe UEToonRenderingEditor.target
3>Total time in FASTBuild executor: 2478.80 seconds
3>Total execution time: 2584.69 seconds
```
43min
## 猜想与总结
首先FastBuild的大致编译流程为分发编译任务=》远程机编译完之后下载obj文件=》所有编译任务完成后在本地进行链接并且生成对应文件。了解此我们才能对瓶颈进行分析。
- 远程机经常“偷懒”:本人在测试中发现远程机在编译时经常“偷懒”,且该阶段下内存、网络经常处于满负荷状态。因此本人认为这是因为没有使用千兆网络,下载时间过场而导致这种情况的产生。
- 任务显示超时:在编译过程中,远程机有时会出现超时的情况,个人猜测可能是因为动用了所有核心编译,导致网络连接的心跳检测失败而导致的。
基于以上结果我
但我经过一系列测试之后发现以下方法可以提升编译速度,影响程度由高到低排列如下:
1. 在uproject文件中禁用不必要插件。
2. 将源码放在固态硬盘中。
3. 使用千兆网络而非百兆。预计能加快5min
4. 使用缓存模式。
## 在uproject文件中禁用不必要插件
直接在插件管理界面中禁用插件即可。也可以直接将禁用的列表复制到uproject文件中。本人禁用的插件如下
```json
"Plugins": [
{
"Name": "AlembicImporter",
"Enabled": false
},
{
"Name": "AppleMoviePlayer",
"Enabled": false
},
{
"Name": "AppleImageUtils",
"Enabled": false
},
{
"Name": "OnlineSubsystemGooglePlay",
"Enabled": false,
"SupportedTargetPlatforms": [
"Android"
]
},
{
"Name": "AndroidPermission",
"Enabled": false
},
{
"Name": "AndroidMoviePlayer",
"Enabled": false
},
{
"Name": "AndroidMedia",
"Enabled": false
},
{
"Name": "AndroidDeviceProfileSelector",
"Enabled": false
},
{
"Name": "AudioCapture",
"Enabled": false
},
{
"Name": "AutomationUtils",
"Enabled": false
},
{
"Name": "AvfMedia",
"Enabled": false
},
{
"Name": "ChaosClothEditor",
"Enabled": false
},
{
"Name": "ChaosCloth",
"Enabled": false
},
{
"Name": "ChaosEditor",
"Enabled": false
},
{
"Name": "ChaosNiagara",
"Enabled": false
},
{
"Name": "ChaosSolverPlugin",
"Enabled": false
},
{
"Name": "CodeLiteSourceCodeAccess",
"Enabled": false
},
{
"Name": "CLionSourceCodeAccess",
"Enabled": false
},
{
"Name": "Paper2D",
"Enabled": false
},
{
"Name": "GooglePAD",
"Enabled": false
},
{
"Name": "MagicLeapMedia",
"Enabled": false,
"SupportedTargetPlatforms": [
"Lumin"
]
},
{
"Name": "MagicLeap",
"Enabled": false,
"SupportedTargetPlatforms": [
"Lumin",
"Mac",
"Win64"
]
},
{
"Name": "MagicLeapPassableWorld",
"Enabled": false,
"SupportedTargetPlatforms": [
"Lumin",
"Mac",
"Win64"
]
},
{
"Name": "OpenImageDenoise",
"Enabled": false
},
{
"Name": "IOSDeviceProfileSelector",
"Enabled": false
},
{
"Name": "LinuxDeviceProfileSelector",
"Enabled": false
},
{
"Name": "CharacterAI",
"Enabled": false
},
{
"Name": "DatasmithContent",
"Enabled": false
},
{
"Name": "GeometryCache",
"Enabled": false
},
{
"Name": "SpeedTreeImporter",
"Enabled": false
},
{
"Name": "LuminPlatformFeatures",
"Enabled": false,
"SupportedTargetPlatforms": [
"Lumin"
]
},
{
"Name": "MLSDK",
"Enabled": false
},
{
"Name": "WmfMedia",
"Enabled": false
},
{
"Name": "WebMMoviePlayer",
"Enabled": false
},
{
"Name": "MediaCompositing",
"Enabled": false
},
{
"Name": "ImgMedia",
"Enabled": false
},
{
"Name": "OnlineSubsystemNull",
"Enabled": false
},
{
"Name": "OnlineSubsystemUtils",
"Enabled": false
},
{
"Name": "OnlineSubsystemIOS",
"Enabled": false,
"SupportedTargetPlatforms": [
"IOS",
"TVOS"
]
},
{
"Name": "ChunkDownloader",
"Enabled": false
},
{
"Name": "OnlineSubsystem",
"Enabled": false
},
{
"Name": "XCodeSourceCodeAccess",
"Enabled": false
},
{
"Name": "EditableMesh",
"Enabled": false
},
{
"Name": "PerforceSourceControl",
"Enabled": false
},
{
"Name": "PlasticSourceControl",
"Enabled": false
},
{
"Name": "SubversionSourceControl",
"Enabled": false
},
{
"Name": "SteamVR",
"Enabled": false,
"SupportedTargetPlatforms": [
"Win32",
"Win64",
"Linux"
]
},
{
"Name": "OpenXRHandTracking",
"Enabled": false,
"SupportedTargetPlatforms": [
"Win32",
"Win64",
"Linux",
"HoloLens",
"Android"
]
},
{
"Name": "OpenXREyeTracker",
"Enabled": false,
"SupportedTargetPlatforms": [
"Win32",
"Win64",
"Linux",
"HoloLens",
"Android"
]
},
{
"Name": "OpenXR",
"Enabled": false,
"SupportedTargetPlatforms": [
"Win32",
"Win64",
"Linux",
"Android",
"HoloLens"
]
},
{
"Name": "OculusVR",
"Enabled": false,
"SupportedTargetPlatforms": [
"Win32",
"Win64",
"Android"
]
},
{
"Name": "EnvironmentQueryEditor",
"Enabled": false
},
{
"Name": "AISupport",
"Enabled": false
},
{
"Name": "Synthesis",
"Enabled": false
},
{
"Name": "MotoSynth",
"Enabled": false
},
{
"Name": "SoundFields",
"Enabled": false
},
{
"Name": "LocationServicesBPLibrary",
"Enabled": false
},
{
"Name": "XGEController",
"Enabled": false
},
{
"Name": "OodleData",
"Enabled": false
},
{
"Name": "OodleNetwork",
"Enabled": false
},
{
"Name": "TextureFormatOodle",
"Enabled": false
},
{
"Name": "ExampleDeviceProfileSelector",
"Enabled": false
},
{
"Name": "GeometryMode",
"Enabled": false
},
{
"Name": "MeshPainting",
"Enabled": false
},
{
"Name": "TcpMessaging",
"Enabled": false
},
{
"Name": "UdpMessaging",
"Enabled": false
},
{
"Name": "MacGraphicsSwitching",
"Enabled": false
},
{
"Name": "MobileLauncherProfileWizard",
"Enabled": false
},
{
"Name": "PlatformCrypto",
"Enabled": false
},
{
"Name": "MobilePatchingUtils",
"Enabled": false
},
{
"Name": "WindowsMoviePlayer",
"Enabled": false
},
{
"Name": "GoogleCloudMessaging",
"Enabled": false
},
{
"Name": "PhysXVehicles",
"Enabled": false
},
{
"Name": "NullSourceCodeAccess",
"Enabled": false
},
{
"Name": "FacialAnimation",
"Enabled": false
},
{
"Name": "PostSplashScreen",
"Enabled": false,
"SupportedTargetPlatforms": [
"XboxOne"
]
},
{
"Name": "KDevelopSourceCodeAccess",
"Enabled": false
},
{
"Name": "MatineeToLevelSequence",
"Enabled": false
},
{
"Name": "MediaPlayerEditor",
"Enabled": false
},
{
"Name": "VisualStudioCodeSourceCodeAccess",
"Enabled": false
}
]
```
其实还可以禁用更多的插件,我在测试的时候没有全部禁用。
除了可以减少编译量以节约时间外。同时也可以减少编译完之后所占用的空间。占用空间165G=>108G。
## 使用缓存模式
经过测试仅仅是将`bEnableCaching`设置为true好像是不能开启缓存模式的。应该还需要设置`CacheMode`。在源码中`CacheMode`分别为ReadWrite、ReadOnly、WriteOnly,枚举对应的值依次为0,1,2。因为缓存模式适用于多人引擎团队对于我这种独狼爱好者来说意义不大所以就没测试。有兴趣的可以自己跟一下UBT的代码。
```xml
<FASTBuild>
<bEnableCaching>true</bEnableCaching>
<CacheMode>0</CacheMode>
</FASTBuild>
```
## 本地核心控制
在编译UE4时FastBuildWorker.exe无法控制本地使用核心数。如果你不想占用本地资源可以将bForceRemote设置为true,引擎编译过程中就不会占用本地核心了开头还是会使用一些以及Link阶段只能进行
如果只想让本地不会卡死,则可以使用一下参数:
```xml
<LocalExecutor>
<ProcessorCountMultiplier>0.9</ProcessorCountMultiplier>
<MaxProcessorCount>11</MaxProcessorCount>
</LocalExecutor>
<ParallelExecutor>
<ProcessorCountMultiplier>0.9</ProcessorCountMultiplier>
<MaxProcessorCount>11</MaxProcessorCount>
</ParallelExecutor>
```
本人测试结果不设置MaxProcessorCount是不行的。
## BuildConfigure
```xml
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<BuildConfiguration>
<bAllowFASTBuild>true</bAllowFASTBuild>
</BuildConfiguration>
<SourceFileWorkingSet>
<Provider>None</Provider>
<RepositoryPath></RepositoryPath>
<GitPath></GitPath>
</SourceFileWorkingSet>
<LocalExecutor>
<ProcessorCountMultiplier>0.95</ProcessorCountMultiplier>
<MaxProcessorCount>11</MaxProcessorCount>
</LocalExecutor>
<ParallelExecutor>
<ProcessorCountMultiplier>0.95</ProcessorCountMultiplier>
<MaxProcessorCount>11</MaxProcessorCount>
<bStopCompilationAfterErrors>true</bStopCompilationAfterErrors>
</ParallelExecutor>
<FASTBuild>
<bEnableCaching>true</bEnableCaching>
</FASTBuild>
</Configuration>
```

View File

@@ -0,0 +1,13 @@
---
title: P4V学习笔记
date: 2022-09-27 17:37:02
excerpt:
tags:
rating: ⭐
---
## P4V
1. 新建一个工作区。
2. 选择仓库点击GetLatest。
- GetLatest更新

View File

@@ -0,0 +1,129 @@
#TODO 二分法 定位bug git bisect让你闭眼都能定位疑难 bug的利器
https://zhuanlan.zhihu.com/p/521905865
本文分享自华为云社区《利用好 git bisect 这把利器,帮助你快速定位疑难 bug》作者 DevUI。
使用git bisect二分法定位问题的基本步骤
git bisect start [最近的出错的commitid] [较远的正确的commitid]
测试相应的功能
git bisect good 标记正确
直到出现问题则 标记错误 git bisect bad
提示的commitid就是导致问题的那次提交
问题描述
我们以Vue DevUI组件库的一个bug举例子
5d14c34b这一次commit执行yarn build报错报错信息如下
✓ building client + server bundles...
✖ rendering pages...
build error:
ReferenceError: document is not defined
我可以确定的是上一次发版本d577ce4是可以build成功的。
git bisect 简介
git bisect命令使用二分搜索算法来查找提交历史中的哪一次提交引入了错误。它几乎能让你闭着眼睛快速定位任何源码导致的问题非常实用。
你只需要告诉这个命令一个包含该bug的坏commit ID和一个引入该bug之前的好commit ID这个命令会用二分法在这两个提交之间选择一个中间的commit ID切换到那个commit ID的代码然后询问你这是好的commit ID还是坏的commit ID你告诉它是好还是坏然后它会不断缩小范围直到找到那次引入bug的凶手commit ID。
这样我们就只需要分析那一次提交的代码就能快速定位和解决这个bug具体定位的时间取决于该次提交的代码量和你的经验所以我们提交代码时一定要养成小批量提交的习惯每次只提交一个小的独立功能这样出问题了定位起来会非常快。
接下来我就以Vue DevUI之前出现过的一个bug为例详细介绍下如何使用git bisect这把利器。
定位过程
git bisect start 5d14c34b d577ce4
or
git bisect start HEAD d577ce4
其中5d14c34b这次是最近出现的有bug的提交d577ce4这个是上一次发版本没问题的提交。
执行完启动bisect之后马上就切到中间的一次提交啦以下是打印结果
kagol:vue-devui kagol$ git bisect start 5d14c34b d577ce4
Bisecting: 11 revisions left to test after this (roughly 4 steps)
[1cfafaaa58e03850e0c9ddc4246ae40d18b03d71] fix: read-tip icon样式泄露 (#54)
可以看到已经切到以下提交:
[1cfafaaa] fix: read-tip icon样式泄露 (#54)
执行命令:
yarn build
构建成功所以标记下good
git bisect good
kagol:vue-devui kagol$ git bisect good
Bisecting: 5 revisions left to test after this (roughly 3 steps)
[c0c4cc1a25c5c6967b85100ee8ac636d90eff4b0] feat(drawer): add service model (#27)
标记万good马上又通过二分法切到了一次新的提交
[c0c4cc1a] feat(drawer): add service model (#27)
再次执行build命令
yarn build
build失败了出现了我们最早遇到的报错
✓ building client + server bundles...
✖ rendering pages...
build error:
ReferenceError: document is not defined
标记下bad再一次切到中间的提交
kagol:vue-devui kagol$ git bisect bad
Bisecting: 2 revisions left to test after this (roughly 2 steps)
[86634fd8efd2b808811835e7cb7ca80bc2904795] feat: add scss preprocessor in docs && fix:(Toast) single lifeMode bug in Toast
以此类推不断地验证、标记、验证、标记…最终会提示我们那一次提交导致了这次的bug提交者、提交时间、提交message等信息。
kagol:vue-devui kagol$ git bisect good
c0c4cc1a25c5c6967b85100ee8ac636d90eff4b0 is the first bad commit
commit c0c4cc1a25c5c6967b85100ee8ac636d90eff4b0
Author: nif <lnzhangsong@163.com>
Date: Sun Dec 26 21:37:05 2021 +0800
feat(drawer): add service model (#27)
* feat(drawer): add service model
* docs(drawer): add service model demo
* fix(drawer): remove 'console.log()'
packages/devui-vue/devui/drawer/index.ts | 7 +++--
.../devui-vue/devui/drawer/src/drawer-service.ts | 33 ++++++++++++++++++++++
packages/devui-vue/devui/drawer/src/drawer.tsx | 3 ++
packages/devui-vue/docs/components/drawer/index.md | 29 +++++++++++++++++++
4 files changed, 69 insertions(+), 3 deletions(-)
create mode 100644 packages/devui-vue/devui/drawer/src/drawer-service.ts
最终定位到出问题的commit
c0c4cc1a is the first bad commit
https://github.com/DevCloudFE/vue-devui/commit/c0c4cc1a25c5c6967b85100ee8ac636d90eff4b0
整个定位过程几乎是机械的操作不需要了解项目源码不需要了解最近谁提交了什么内容只需要无脑地验证、标记、验证、标记最后git会告诉我们那一次提交出错。
这么香的工具,赶紧来试试吧!
问题分析
直到哪个commit出问题了定位起来范围就小了很多。
如果平时提交代码又能很好地遵循小颗粒提交的话bug呼之欲出。
这里必须表扬下我们DevUI的田主Contributor他们都养成了小颗粒提交的习惯这次导致bug的提交c0c4cc1a只提交了4个文件涉及70多行代码。
我们在其中搜索下document关键字发现了两处都在drawer-service.ts整个文件中
一处是12行的
static $body: HTMLElement | null = document.body
另一处是17行的
this.$div = document.createElement('div')
最终发现罪魁祸首就是12行的代码
破案!
此处@lnzhangsong我们的田主有空麻烦修下这个bug。
点击关注,第一时间了解华为云新鲜技术~

View File

@@ -0,0 +1,37 @@
---
title: 使用Git SubModule来管理开源插件
date: 2022-08-10 13:55:20
excerpt:
tags: Git
rating: ⭐
---
# 前言
之前有考虑过将项目中自己的移植版AdvancedLocomotionSystem v4换成社区维护版本[ALS-Community](https://github.com/dyanikoglu/ALS-Community)。众所周知,如果主仓库下存在子.git文件夹那子.git文件夹中的改动主仓库是无法检测到的除非把子.git删除。但我既想在主项目中使用git来管理版本又想在插件中保留git信息以方便从github中获取最新的改动。查了一番资料最后发现git已经给出了解决方案Git SubModule。
## 用法
### submodule add
第一步添加submodule命令为
>git submodule add url path
例如:
>git submodule add https://github.com/dyanikoglu/ALS-Community.git Plugins/ALS-Community
执行完之后就会出现.gitmodules文件里面主要是git submodule相关信息。
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/Git-SubModule2.png)
同时还会有一个与子模块同名的文件出现它记录Commit的hash值如果子模块的Commit发生变动主仓库的这个文件都会出现改动。
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/Git-SubModule1.png)
在上传github之后点击这个文件就会自动跳转到之前定义的仓库url。
### Clone
默认的clone可能会出现submodule为空的情况。这是需要在Clone后面加上`--recurse-submodules`选项。例如:
>git clone --recurse-submodules https://github.com/XXXX/XXXX
## 个人建议
因为考虑到后续可能会修改插件所以还是建议先fork一下目标仓库之后git submodule add这个仓库。这样依然可以通过添加原仓库Remote的方式来更新代码。
最近本人开始使用Obsidian笔记把Github图床仓库作为子模块下载到Asset目录下或许也是个不错的选择。
### Git-Fork
这里我推荐git-fork这个软件免费小巧又好用。特别是打开源码仓库的时候速度比SourceTree快多了。默认情况下已经可以自动下载submodule。
另外说一点,点击标签页右边的+,除了会显示之前打开过的仓库之外,还会显示这些仓库目录下的子仓库,可以说是相当方便了。

View File

@@ -0,0 +1,231 @@
---
title: OMV与Debian安装与使用笔记
date: 2022-09-20 09:31:42
excerpt: 摘要
tags: Debian
rating: ⭐⭐
---
## 前言
推荐入门文章:
- [Debian 新手指南(持续更新)](https://zhuanlan.zhihu.com/p/488109156)
- [锐角云 N3450折腾OMV记录](https://www.cnblogs.com/wxfy/p/15765363.html)
- omv5 基于debian 10
- omv6 基于debian 11
后台http://ipv4.blueroses.top/
| 版本 | 说明 | 示例 |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
| alpine | Alpine Linux 操作系统,它是一个独立发行版本,相比较 Debian 操作系统来说 Alpine更加轻巧 https://alpinelinux.org | docker pull node:alpine3.14 |
| jessie | Debian 8更旧的稳定oldoldstable马上就淘汰了 2015 https://wiki.debian.org/DebianJessie | docker pull node:10.22.0-jessie |
| stretch | Debian 9旧的稳定oldstable现有长期支持 2017比较老目前除了 LTS 其他版本已经不再提供技术支持了,所以我们非必要情况下还是不要选择它比较好 https://wiki.debian.org/DebianStretch | docker pull node:lts-stretch |
| buster | Debian 10当前的稳定stable版 2019比较新支持比较全面受广大Debian爱好者的好评像 PHP、Python 之类的语言、应用都会使用这个版本的 Debian 搭建 Docker 基础镜像 https://wiki.debian.org/DebianBuster | docker pull node:lts-buster |
| bullseye | Debian 11即将上位的稳定stable版 2021https://wiki.debian.org/DebianBullseye docker pull node:lts-bullseye xxx-slim 一般都基于 Debian 和 glibc删除了许多非必需的软件包优化了体积 docker pull node:stretch-slim | docker pull node:buster-slim |
## 在Debian上安装OMV
### 添加秘钥
```
apt-get install --yes gnupg
wget -O "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" https://packages.openmediavault.org/public/archive.key
apt-key add "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc"
```
### 添加软件包存储库
大陆地区使用TUNA的源
```ini
cat <<EOF > /etc/apt/sources.list.d/openmediavault.list
deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/public usul main
deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/packages usul main
## Uncomment the following line to add software from the proposed repository.
# deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/public usul-proposed main
# deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/packages usul-proposed main
## This software is not part of OpenMediaVault, but is offered by third-party
## developers as a service to OpenMediaVault users.
# deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/public usul partner
# deb https://mirrors.tuna.tsinghua.edu.cn/OpenMediaVault/packages usul partner
EOF
```
### 安装
```c++
export LANG=C.UTF-8
export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
apt-get update
apt-get --yes --auto-remove --show-upgraded \
--allow-downgrades --allow-change-held-packages \
--no-install-recommends \
--option DPkg::Options::="--force-confdef" \
--option DPkg::Options::="--force-confold" \
install openmediavault-keyring openmediavault
omv-confdbadm populate
```
### 安装脚本(非桌面环境有效)
大概率是需要没有安装过桌面的Debianhttps://github.com/OpenMediaVault-Plugin-Developers/installScript
## Debian检查软件包依赖
- 查看谁依赖了这个包:
- aptitude why libboost1.71-tools-dev
- 查看libboost-all-dev 依赖哪些包
- apt-cache depends libboost-all-dev
- 查看所有带libboost的包
- dpkg -l | grep libboost
Debian phpapi-20151012 不能安装的原因可能是因为某个包安装了更新phpapi的版本。可能是php7.4系列)
### 用apt安装时出现依赖障碍时如何解决
出现因依赖无法安装,可以尝试:
>aptitude   install   xxx-软件
```ini
install - 安装/升级软件包
remove - 卸载软件包
purge - 卸载软件包并删除其配置文件
hold - 将软件包置于保持状态
unhold - 取消对一个软件包的保持命令
markauto - 将软件包标记为自动安装
unmarkauto - 将软件包标记为手动安装
forbid-version - 禁止 aptitude 升级到某一特定版本的软件包。
update - 下载新/可升级软件包列表
safe-upgrade - 执行一次安全的升级
full-upgrade - 执行升级,可能会安装和卸载软件包
forget-new - 忘记哪些软件包是“新”的
search - 按名称 和/或 表达式搜索软件包
show - 显示一个软件包的详细信息
clean - 删除已下载的软件包文件
autoclean - 删除旧的已下载软件包文件
changelog - 查看一个软件包的变更日志
download - 下载软件包的 .deb 文件
reinstall - 下载并(可能)重新安装一个现在已经安装了的软件包
```
## Debian安装时驱动加载
参考https://wiki.debian.org/Firmware
一种简单的方法是使用直接包含所有非免费固件包的**安装程序映像** [https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/](https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/)。另一种方法是单独下载固件已经烧纸镜像的移动介质中U盘。可以在[https://cdimage.debian.org/cdimage/unofficial/non-free/firmware/](https://cdimage.debian.org/cdimage/unofficial/non-free/firmware/)中寻找对应Debian版本的固件。
- Debian软件包查找https://packages.debian.org/
- firmware-iwlwifi_20210315-3_all.debhttps://packages.debian.org/bullseye/all/firmware-iwlwifi/download
- 带有Nonfree固件的Debian镜像https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/
- https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/11.5.0+nonfree/amd64/iso-dvd/
### 加载驱动
将下载的驱动`*.ucode`放到`/lib/firmware`该目录需要手动新建。或者在另一个U盘 分区fat32里新建一个目录`/firmware`并放置`*.ucode`或者deb软件包或者放在根目录。
### OMV驱动版本
>**openmediavault 是否有适用于我的硬件的驱动程序?**
所有模块驱动程序均由 oldstable 8.9 版(又名 Jessie的 Debian 标准内核提供。默认情况下,此发行版附带内核 3.16。可以选择安装 backport kernel 4.9。如果 Debian Jessie 支持硬件,那么 openmediavault 也支持硬件。Jessie backport kernel 4.9 是目前 Stretch (Debian 9.3) 使用的默认内核,因此它为较新的硬件提供支持。
## 更新源
源目录:
- 官方源
```ini
deb http://deb.debian.org/debian buster main contrib non-free
# deb-src http://deb.debian.org/debian buster main contrib non-free
deb http://deb.debian.org/debian buster-updates main contrib non-free
# deb-src http://deb.debian.org/debian buster-updates main contrib non-free
deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
# deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free
```
- 清华
```ini
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ testing main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ testing main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ testing-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ testing-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ testing-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ testing-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security testing-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security testing-security main contrib non-free
```
- 中国科技大学
```ini
deb https://mirrors.ustc.edu.cn/debian/ stretch main non-free contrib
#deb-src https://mirrors.ustc.edu.cn/debian/ stretch main non-free contrib
deb https://mirrors.ustc.edu.cn/debian/ stretch-updates main non-free contrib
#deb-src https://mirrors.ustc.edu.cn/debian/ stretch-updates main non-free contrib
deb https://mirrors.ustc.edu.cn/debian/ stretch-backports main non-free contrib
#deb-src https://mirrors.ustc.edu.cn/debian/ stretch-backports main non-free contrib
deb https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main non-free contrib
#deb-src https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main non-free contrib
```
- 阿里云
```ini
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
#deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
#deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
#deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
deb http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contrib
#deb-src http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contrib
```
更新操作:
```c++
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
```
`apt-get dist-upgrade `为更新发行版/分支操作。
### 替换源解决源失效问题
如果提示下面的问题,可以使用替换源的方式来解决:
>E: Some index files failed to download, they have been ignored, or old ones used instead.
>E: 仓库 “https://download.docker.com/linux/debian n/a Release” 没有 Release 文件
1. 修改`/etc/apt/sources.list`文件,在桌面系统内可以使用`gedit /etc/apt/sources.list`。
2. 替换成其他的源。比如阿里云的:
```ini
deb http://mirrors.aliyun.com/debian wheezy main contrib non-free
#deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
#deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
#deb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
```
3. 如果还是提示错误就需要删除 **/etc/apt/sources.list.d** 下的所有文件了。
```ini
cd /etc/apt/sources.list.d
ls
rm XXXX
```
#### 其他更换源命令
```ini
mv /etc/apt/sources.list /etc/apt/sources.list.bak ?(先备份)
echo "deb https://mirrors.ustc.edu.cn/debian/ stretch main non-free contrib" >/etc/apt/sources.list
echo "deb https://mirrors.ustc.edu.cn/debian/ stretch-updates main non-free contrib " >>/etc/apt/sources.list
echo "deb https://mirrors.ustc.edu.cn/debian/ stretch-backports main non-free contrib" >>/etc/apt/sources.list
```
## 杂项
### 允许Root用户登录
默认情况下debian是不允许以root用户登录的只能以其他用户登录系统中然后su到root用户下进行操作。
1. 修改/etc/gdm3/daemon.conf文件新增下面一行AllowRoot = true。
```ini
[security]
AllowRoot = true
```
2. 修改/etc/pam.d/gdm-password注释掉下面内容
```ini
#auth required pam_succeed_if.so user != root quiet_success
```
然后重启操作系统就可以使用root用户登录操作系统了。
### 安装V2rayA客户端
https://v2raya.org/docs/prologue/installation/debian/
### Debian设置Http代理
方法一:有系统变量文件/etc/profile 里增加
>export http_proxy=[http://username:password@proxyIP:proxyPORT](http://username:password@proxyip:proxyPORT/)或者ip地址+端口号)
方法二:有用户变量文件~/.bashrc 里增加上面那句,只对指定的用户生效。
方法三:修改/etc/apt/apt.conf 文件,如果没有这个文件可以新建一个 增加一句:
>Acquire::http::Proxy  "[http://username:password@proxyIP:proxyPORT](http://username:password@proxyip:proxyPORT/)"; 或者ip地址+端口号)注意后面有一个分号。
最后输入 sudo apt-get update  测试
# OMV网页后台出错解决方法
清楚网页缓存
Try if clearing the browser cache solves it. Or try Ctrl+Shift+R when you are on the OMV web GUI

View File

@@ -0,0 +1,82 @@
# 插件参考
1. Develop Plugin for Asuswrt Merlin:https://wdicc.com/develop-plugin-for-asuswrt-merlin/
2. [插件集成] 【AsusWrt】自制路由器信息插件:https://bbs.hassbian.com/thread-3697-1-1.html
# 脚本
## 脚本1重新拨号的脚本
刷的官改固件,脚本可以放到/koolshare/scripts 下,重启的话也不会丢失,官方固件的话可以放到/jffs 下
```bash
vi /koolshare/scripts/repppd.sh
#!/bin/sh
/usr/bin/logger -c "断开拨号连接"
killall pppd
/usr/bin/logger -c "延时10秒"
sleep 10
/usr/bin/logger -c "重新拨号"
pppd file /tmp/ppp/options.wan0 >/dev/null 2>&1 &
```
## 脚本2检测脚本
检测百度是否可以连接5秒超时两次检测间隔1分钟如果两次检测都无法连接百度则执行脚本1重新拨号。具体参数看懂了自己改哦很简单的。
```bash
vi /koolshare/scripts/checknetwork.sh
#!/bin/sh
#检测网络链接畅通
function network()
{
#超时时间
local timeout=5
#目标网站
local target=www.baidu.com
#获取响应状态码
local ret_code=`curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1`
if [ "x$ret_code" = "x200" ]; then
#网络畅通
return 1
else
#网络不畅通
return 0
fi
return 0
}
#第1次检测
network
first_check=$?
#睡眠60秒
sleep 60
#第2次检测
network
second_check=$?
if [[ $first_check -eq 0 && $second_check -eq 0 ]];then
/usr/bin/logger -c "无法连接互联网,准备重新拨号!"
#执行脚本1重新拨号
/bin/sh /koolshare/scripts/repppd.sh
exit -1
fi
/usr/bin/logger -c "网络正常"
exit
```
## 脚本3开机添加定时任务脚本
因为路由器重启后crontab的定时任务会被清空所以需要在开机时用命令添加定时检测任务 /jffs/scripts/这个目录下的脚本在重启后都会重新执行。我写的是每10分钟执行一次网络检测的脚本。
```bash
vi /jffs/scripts/services-start.sh
#!/bin/sh
#添加定时任务每10分钟检测网络一次
/usr/sbin/cru a checknetwork "*/10 * * * * /bin/sh /koolshare/scripts/checknetwork.sh"
#每周一早上6点05分重新拨号
/usr/sbin/cru a repppd "5 6 * * 1 /bin/sh /koolshare/scripts/repppd.sh"
```

View File

@@ -0,0 +1,168 @@
## 前言
之前买了华硕路由器趁着过年有空打算好好玩玩打算做个版本管理服务器啥。但最后因为买的机器内存只有0.5g又遇到运行gitea二进制文件报错的问题就没继续了。
> line 1: syntax error: unexpected "("
不过研究过程感觉有些意义便有了此文。之前建议先知道一下内核版本:
```
uname -a
```
本人的路由器为:
```
Linux TUF-AX3000-07F8 4.1.52 #2 SMP PREEMPT Sat Nov 7 03:08:27 CST 2020 armv7 GNU/Linux
```
另外本人不推荐购买ax3000。真要做版本管理服务器可能还是x86 CPU的NAS比较好。树莓派之前也尝试搭过gitlab基本处于崩溃边缘但用gitea就没问题。
## 对于USB2JFFS插件的U盘选择
USB2JFFS插件对U盘读写速度有要求同时也为了有更好的使用体验。所以本人购买了CHIPFANCIER U盘。品名为
>CHIPFANCIER固态U盘SSD 高性能纯金属 windows to go USB3.0旋转外壳 128G
这里不推荐使用金士顿以及闪迪的低端U盘。因为他们的写入速度都不会超过30MB/s都不符合USB2JFFS插件要求(35MB/s)。本人购买U盘的测速结果
```
【2021年02月16日 19:49:16】 USB磁盘[/dev/sda1]的三次平均顺序读取速度大约为263.16 MB/s
【2021年02月16日 19:49:16】 USB磁盘[/dev/sda1]的三次平均顺序写入速度大约为132.74 MB/s
【2021年02月16日 19:49:16】 USB磁盘[/dev/sda1]的读写速度符合USB2JFFS插件要求
```
使用这个插件还需要将U盘格式化成EXT4。可以使用diskgenius来进行格式化。
## 安装Entware
找到两种安装方法:
### 使用SCRIPTS BOOTLOADER FOR ASUS ROUTER
安装起来比较方便附带几个常用插件而且会将安装的内容都转移到U盘。但该插件只保证对在官方固件或梅林固件能完美运行。
安装过程:
1. 插入空白U盘
2. 登录ssh并输入命令
```
cd /tmp && wget -q -O /tmp/install_online --no-check-certificate "https://cdn.jsdelivr.net/gh/JACK-THINK/SCRIPTS-BOOTLOADER-FOR-ASUS-ROUTER@latest/script_bootloader/bin/install_online" && chmod 777 /tmp/install_online && /tmp/install_online
```
3. 中间会有需要输入参数的环节在输入后回车即可(虚拟内存以及路由器账号密码)
参考文章:
- https://koolshare.cn/thread-138615-1-1.html
- https://github.com/JACK-THINK/SCRIPTS-BOOTLOADER-FOR-ASUS-ROUTER/blob/master/How_to_Use_zh-CN.md#scripts-bootloader-for-asus-router-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E
### 官方命令安装方法
安装命令:
```
mkdir /jffs/entware-ng.arm
ln -nsf /jffs/entware-ng.arm /tmp/opt
wget -O - http://pkg.entware.net/binaries/ ... /entware_install.sh | /bin/sh
echo "#!/bin/sh" > /jffs/scripts/services-start
echo "sleep 20" >> /jffs/scripts/services-start
echo "ln -ns /jffs/entware-ng.arm /tmp/opt" >> /jffs/scripts/services-start
echo "/opt/etc/init.d/rc.unslung start" >> /jffs/scripts/services-start
echo "#!/bin/sh" > /jffs/scripts/services-stop
echo "/opt/etc/init.d/rc.unslung stop" >> /jffs/scripts/services-stop
chmod a+rx /jffs/scripts/*
```
参考文章:
- https://www.cnblogs.com/YangGC/p/12524609.html
## 查看entware软件列表
安装之前最好看一些有哪些是可以安装的:
http://pkg.entware.net/binaries/armv7/Packages.html
- lighttpd
- node-npm
- node
- aria2
- git
- git-http
- nagix
不过很可惜没有docker所以gitea就必须手动部署了。
## Gitea
这里我尝试使用二进制安装方式。
参考文章:
- https://docs.gitea.io/en-us/install-from-binary/
- https://www.cnblogs.com/skymyyang/p/13606587.html
- https://www.cnblogs.com/azureology/p/13237221.html
## 其他环境安装
### Node.js
```
opkg install node
opkg install node-npm
```
之后安装request模块
```
npm install request
```
参考文章:
- https://koolshare.cn/forum.php?mod=viewthread&tid=189560&extra=page%3D2%26filter%3Dtypeid%26typeid%3D104
### PHP环境安装
使用的是ONMP
参考文章:
- https://zhih.me/onmp-installation/
#### EDE+Entware+ONMP搭建个人私有云Nextcloud
https://koolshare.cn/thread-137015-1-1.html
## 其他步骤
### 查看默认Bash位置
Enterprise 默认使用的shell即为bash shell。
```
echo $SHELL
```
## gitea
### 下载二进制文件
```
wget -O gitea https://dl.gitea.io/gitea/1.13.2/gitea-1.13.2-linux-amd64
chmod +x gitea
```
### 增加用户
文档中的命令为:
```
adduser \
--system \
--shell /bin/bash \
--gecos 'Git Version Control' \
--group \
--disabled-password \
--home /home/git \
git
```
但路由器系统默认没有adduser命令所以我们需要安装对应的模块
```
opkginstall shadow-common
opkginstall shadow-useradd
opkginstall shadow-groupad
opkginstall shadow-usermod
```
```
useradd \
--system \
--shell /bin/bash \
--comment 'Git Version Control' \
--create-home \
--home-dir /tmp/mnt/ASUS_ROUTER/home/git/ \
git
```
会遇到问题:
>useradd: cannot open /opt/etc/passwd
```
opkg install lsattr
opkg install chattr
```
PS.但到这一步还是遇到无法cannot open /opt/etc/passwd的问题之后尝试手动添加用户也宣告失败。但最后我发现可以在路由器的文件共享服务页面中添加用户。@-@
### 设置环境变量
```
export GITEA_WORK_DIR=/tmp/mnt/ASUS_ROUTER/var/lib/gitea/
```
### 将Gitea二进制文件复制到全局位置
```
cp gitea /tmp/mnt/ASUS_ROUTER/usr/local/bin/
```
## 运行Gitea
### 从命令行/终端运行
```
GITEA_WORK_DIR=/tmp/mnt/ASUS_ROUTER/var/lib/gitea/ /tmp/mnt/ASUS_ROUTER/usr/local/bin/gitea web -c /tmp/mnt/ASUS_ROUTER/etc/gitea/app.ini
```

View File

@@ -0,0 +1,137 @@
---
title: 远程唤醒WOL
date: 2022-8-10 22:00:49
excerpt: 摘要
tags: TODO
rating: ⭐
status: inprogress
---
## 参考
- [新手小白如何使用TeamViewer远程开关机远程唤醒WOL并远程控制电脑](https://zhuanlan.zhihu.com/p/144834189)
- [如何远程开启你的电脑WoL的原理和陷阱](https://zhuanlan.zhihu.com/p/28859620)
- [WOL网络唤醒在微星主板上开启(ubuntu 20.04/Windows 10双系统)](https://www.mobibrw.com/2020/28210)
- [华硕主板如何在BIOS中设置和启用WOL(Wake On Lan)功能](https://www.asus.com/support/FAQ/1045950/)
大概率需要自己安装官方的驱动而不是使用Win10自带的。
## APP
- 手机APP
- DD-WRT
- PC APP
- WakeOnLanGui
## 华硕路由器
首先设置远程访问授权,系统管理-系统设置-远程访问设置。之后就可以通过8443端口进行访问了。
## OMV6
除了在主板中开启这个设置外,在`网络-接口-高级设置`中勾选`网络唤醒 WOL`即可。
## 唤醒服务部署
### wol-go-web(没有http page)
参考http://blog.sysu.tech/Docker/%E4%BD%BF%E7%94%A8Docker%E9%85%8D%E7%BD%AEWOL(Wake%20On%20Lan)%E6%9C%8D%E5%8A%A1/
```bash
docker run -d \
--net=host \
--env PORT=8000 \
--name=wol \
chishin/wol-go-web
```
使用说明http://192.168.0.236:8000/;随后直接访问 [http://192.168.211.1:8002/wol?mac=your_mac](http://192.168.211.1:8002/wol?mac=your_mac) 即可远程开机。注意这里`your_mac`要替换为你要唤醒电脑网卡的mac地址
### go-rest-wol
>需要手动先创建externall-file-on-host.csv文件。并且添加csv内容
```bash
docker run --name=wol -d \
-e "WOLHTTPPORT=7000" \
-p 7000:7000 \
-v /mnt/nfs-1/wol/externall-file-on-host.csv:/app/computer.csv \
--restart unless-stopped \
dabondi/go-rest-wol
```
### 其他备选容器
- 1M+ https://hub.docker.com/r/dabondi/go-rest-wol
- 10k+ https://hub.docker.com/r/aranajuan/wolweb
- 500k+ https://hub.docker.com/r/ex0nuss/remote-wake-sleep-on-lan-docker
- 10k+ https://hub.docker.com/r/chtake/pi-wol
## 开启WOL
参考
- https://post.smzdm.com/p/amx025p4/
- https://zhuanlan.zhihu.com/p/29100706
- https://zhuanlan.zhihu.com/p/183704557
- https://blog.berd.moe/archives/intel-nuc-i210-wol-troubleshooting/
- https://office66.cn/post/39888.html
相关关键词:
- ACPI
- PCIE 设备开机
- Automatic Power On
- Wake on LAN/WLAN
- Power Management
- Power On by Onboard LAN
- Power On by PCI-E Devices
- ......
>注意路由器需要绑定静态路由表,否则关机时间长了,就会无法远程开机
微星BIOS
![](https://pic3.zhimg.com/80/v2-67b267ebc26917fef8cdf1a2a19a83d2_720w.webp)
![](https://pic4.zhimg.com/80/v2-bf3c3073b3c85c9c04f55f898301144f_720w.webp)
![](https://pic3.zhimg.com/80/v2-350dd847f4a2eb7219f97be8f8a3f816_720w.webp)
![](https://pic4.zhimg.com/80/v2-0b792bed94902bb87461c586c524e157_720w.webp)
![](https://pic1.zhimg.com/80/v2-5d5bc0e3f7ad78a3403d96bfa76fb4b8_720w.webp)
Inter网卡需要安装对应驱动**Intel PROSet Adapter Configuration Utility**。这个程序中会列出我们在 `devmgmt.msc` 中看不到的一部分设置,其中就包括 “电源关闭状态下魔包唤醒”,这个值在 I210 上默认是禁用,而在 I219 上默认是启用的
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/20221215204334.png)
如图,`devmgmt.msc` 中不存在这个设置,应该是网卡特有的
![](https://cdn.jsdelivr.net/gh/blueroseslol/ImageBag@latest/ImageBag/Images/20221215204344.png)
## 关机后网卡保持供电
BIOS-Advanced-APM Configuration 里,将 Power On By PCI-E 设置为开启,如下图所示:
![](https://office66.cn/d/file/p/2022/06-09/bc2f1f4004f62a44d7398c508fc69097.jpg)
进系统后,安装过网卡官网驱动后,我们看网卡属性高级设置里,有“关机网络唤醒”的设置,这个设置,默认也是开启的,只要注意不要设置为关闭即可。然后机器关机。
![intel主板怎么设置华硕主板如何开启网络唤醒(2)](https://office66.cn/d/file/p/2022/06-09/3cc3585c06e0516679ce5948fb5064c1.jpg)
板载 Realtek 8111x 系列的千兆网卡的主板WOL 的实现中Windows10 下 电源管理中,开启与关闭快速启动都不影响 WOL 的实现。
第二,我们介绍板载 Intel i219V 千兆网卡的主板的网络唤醒。
步骤如前,接上网线,开机后我们进入 BIOS-Advanced-APM Configuration 里, 将 Power On By PCI-E/PCI 设置为开启,如下图所示:
![intel主板怎么设置华硕主板如何开启网络唤醒(3)](https://office66.cn/d/file/p/2022/06-09/8a04d76cc683c17fdd2b363aa850aa85.jpg)
进入系统后,安装好官网的网卡驱动,进入设备管理器的网络适配器里找到 Intel(R) Ethernet Connetion I219V 网卡设备,在其属性----高级设置里这里有很多设置项 目,拉到下面,有个启用 PME 的设置,这个默认也是开启的,只要不设置为关闭即可。
![intel主板怎么设置华硕主板如何开启网络唤醒(4)](https://office66.cn/d/file/p/2022/06-09/b454792f46179024af2161b196bf62c0.jpg)
对于 i219V 的千兆网卡,我们必须要把 Windows10 下面电源管理中的快速启动取消掉,才可以在 Windows 关机后实现 WOL。
![intel主板怎么设置华硕主板如何开启网络唤醒(5)](https://office66.cn/d/file/p/2022/06-09/5807f95ad2c9b5cf09618da030b53376.jpg)
第三,对于板载了 Intel i211AT 千兆网卡的主板来讲,网络唤醒的设置如下: BIOS-Advanced-APM Configuration 里,将 Power On By PCI-E/PCI 设置为开 启,如下图所示:
![intel主板怎么设置华硕主板如何开启网络唤醒(6)](https://office66.cn/d/file/p/2022/06-09/72507b106d51b86cb604d79143efbcf0.jpg)
操作系统下,进入设备管理器的网络适配器里找到 Intel(R) I211 Gigabit Network Connetion 网卡设备,在其属性----高级设置里这里有很多设置项目,拉到下面,有个启用 PME 的设置,请一定把这个设置设置为开启,默认是关闭的。
![intel主板怎么设置华硕主板如何开启网络唤醒(7)](https://office66.cn/d/file/p/2022/06-09/eea4c70bcb99480b211f32a2c6918586.jpg)
开启后,无论 Windows10 里的快速关机开启与否,关机后,都可以实现网络唤醒。
最后以表格形式总结如下:
![intel主板怎么设置华硕主板如何开启网络唤醒(8)](https://office66.cn/d/file/p/2022/06-09/9f96cf032357276e2b49eb6302d05201.jpg)
华硕主板
http://m.dnxtc.net/zixun/zuzhuangjiaocheng/2022-09-28/11233.html

View File

@@ -0,0 +1,154 @@
#TODO 远程办公与自动化逻辑 流程尝试
# 需求与功能整理
## 杭州部门需求
- 服务器联机构建
- 外包公司场景交付,不构建,效果不一样,构建了会耗费大量时间。
- 外包动画镜头时因为烘焙时间过长动画师只能使用Hack手段去打光。
- Shader联机编译
- 网盘搭建
- 外包公司资产传递使用百度云、QQ直接传递
- 公司外/内部的资产共享与版本管理
- 外包上下游的资产有效性检测,使用Lyda工具进行自动的有效性检查
- 使用Win的文件查找功能找到目标资产比较耗时
- 制作Asset的GameplayTag以及查询工具以方便其他人调用
- 远程唤醒
- 员工失误将电脑关了使得无法远程控制
- UE4协作
- 多人一起编辑一个虚幻工程
- 制作流程管理
- 使用腾讯文档手动进行管理 卡 的制作进度。问题是这个表格是死的。
- 其他公司会使用CGTeamWork。
- 可以考虑使用飞书的多维表格飞书开放了开发接口可以与版本管理软件、CI/CD连用。https://open.feishu.cn/document/ukTMukTMukTM/uATMzUjLwEzM14CMxMTN/overview
- https://www.bilibili.com/video/BV1o44y1a7JT?spm_id_from=333.337.search-card.all.click&vd_source=d47c0bb42f9c72fd7d74562185cee290
- ~~资产生命周期管理(制片 中卡的状态:缩略图、使用的角色资产、资产改进)~~
- 还需要制作UE4版本管理插件、以及MovieRenderQueue插件
- 插件编写
- UE4使用同一设置导入ABC
- Maya材质导入UE工具
- 知识库编写
## DCC中间文件
- fbx
- usd
- Animation Workflows Using Unreal Engine and Maya | Webinar https://www.youtube.com/watch?v=Ddu7TAICAXw
- Omniverse平台系列MDL材质格式
- abc
- vdb
- Import VDBs into Unreal Engine 5 https://www.youtube.com/watch?v=iEclyxwCWaY
- 使用OpenVDB流程。
# 问题解决
- 大部分需求都需要服务器的支持,而且都是需要外网连接到服务器的,所以最好有网络安全专业人帮忙做好服务器安全防护。
- 联机烘焙与构建需要占用大量带宽。最好是在使用光纤来搭建局域网。(已经有一些家庭使用光纤了)
- 一台数据存储服务器,用于存储数据。(硬盘空间大,同时考虑硬盘可替换性,放置数据丢失)
- 一台编译构建服务器。CPU强劲一些避免存重要数据腾讯的编译机器1~2年换一次硬盘
- 适配光口的网卡、交换机、路由器。
## 服务器联机构建
通过服务器的强劲CPU性能对编译工作进行加速。
- 联机烘焙光影:
- 在服务器部署Unreal Swarm进行联机烘焙。
- 或许可以使用GPULightMass提高速度但效果会与基于CPU的LightMass不同是否可以和一些一手包方沟通一下
- 联机编译引擎源码:
- 使用FastBuild编译。亲自测试过
- 二分法查找Bug。
- 联机编译Shader
- 使用FastBuild编译。需要修改FastBuild与引擎的代码。
如果是多地服务器联机编译卡脖子就是网络带宽问题上传与下载目前的企业专线宽带也就1000M。联机编译能把100M的上传/下载全部吃完,多地服务器没测试过。
## 网盘搭建
使用Centos(Linux) 作为服务器Docker来部署。系统可以NextCloud、FileSea、Cloudreve(这款有亲自试过Windows版还未测试过)。
## 公司外/内部的资产共享与版本管理
- 版本管理软件
- SVN Git混合优势是免费。
- Perforce优势是EPIC提供了很多相关工具。
- CI/CD软件
- JB TeamCity
- Jenkins
建议先使用一台电脑进行流程搭建测试。
同时还需要制作插件给Asset或者Asset包打上标签方便后续查找资产以及资产复用。类似大数据的方法
### 流程
假设分支设计为类似:
- GitFlow
- Master分支
- Release分支
- 程序Develop分支
- 美术Develop分支
- Feature分支
- HotFixs分支
#### 引擎/游戏开发:
理想的情况下程序组员在开发完某个功能后发送给MergeRequest给组长组长在审阅完之后将其合并至Develop分支。在合并之前会触发Hook调用自动测试与打包测试功能。部分错误在Development模式不会出现但会在Shipping模式出现。通过测试之后系统才会完成合并。
每个Release版本版本都应该执行打包与自动部署功能以保证测试组能够及时收到完整测试版本。
上述阶段无论成功与失败都会发送EMail或者调用办公软件钉钉或者飞书提醒相关组员
#### UE影片制作
从接到外包开始:
- 使用网盘或者版本管理系统来接收项目
- 如果对方愿意使用版本管理系统Perforce推荐使用这个因为上传前会对数据进行压缩这样传输下效率会更高并且方便修改。
- 如果对方不愿意可以时候我公司自己搭建的网盘。等上传完之后CI/CD程序将这个包解压并且加入到Perforce流程。每制作到一定程度再自动压缩放回网盘。
- 使用版本管理的一个好处就是可以来回对比多个版本的效果。(但只限于序列帧,视频的话,只能同时放映进行人肉对比)
- 制作进度控制。版本系统上传数据之后会发送EMail或者调用办公软件钉钉或者飞书提醒相关组员
#### CI/CD
- 资产检查
- 检查是否有资源引用丢失,避免反工。(外包方资源没有拷贝全,这个问题在打开对应关卡后才会发现)
- 资产打包测试UE4的打包测试
- 游戏与引擎开发最好有一个定时打包测试的功能,这样可以及时发现问题,一些问题只有在打包时才会发现。
- UE的自动测试框架偏游戏与CI/CD配合使用模拟用户操作
- 蓝图可视化测试
- 序列帧上传到版本管理系统后,服务器开始压片
#### 自动部署
- docker 像素流自动部署
- 开游戏分区
#### 给美术同步引擎
如果使用Perforce就可以使用官方的UnrealGameSync来同步引擎与资产。
具体需要考虑其他分公司的情况,对于我们这次二次元项目来说,很合适。
## 远程唤醒
对员工电脑的BIOS进行设置以允许服务器对其唤醒再使用华硕路由器里的插件~~研发一个简单的Web网站~~就可以实现远程唤醒电脑了。(可以节约较多电费)
https://zhuanlan.zhihu.com/p/302835122
## 联机协作
### 多人一起编辑一个虚幻工程
Explore Collaboration with Unreal Engines Multi-User Editor | Webinar
https://www.youtube.com/watch?v=MPIpOdNmNGE
这个插件潘翔他们在用。或许可以在以下的应用场景中使用:
1. 重庆动捕棚,做虚拟拍摄
2. 杭州帮忙修改场景、打光。
3. 多地区领导与客户同时审片。
### 网络协作
[教育直播]虚幻引擎里的团队协作 | Collaboration and Teamwork in Unreal Engine(官方字幕)
https://www.bilibili.com/video/BV1oZ4y1n7j2?spm_id_from=333.337.search-card.all.click&vd_source=d47c0bb42f9c72fd7d74562185cee290
蓝图Asset合并与Diff
## 制作流程管理
## 知识库编写
【Obsidian推荐】论文笔记和日程管理科研好帮手
https://www.bilibili.com/video/BV1XR4y1w7jp?spm_id_from=333.1007.top_right_bar_window_default_collection.content.click&vd_source=d47c0bb42f9c72fd7d74562185cee290
分享个用Obsidian搭建的小型团队协同工作方案上-演示与目录设置)
https://www.bilibili.com/video/BV1oZ4y1U7b9/
https://zhuanlan.zhihu.com/p/457800106
gitbookUnity使用这个来制作文档。
# 任务安排