's'
This commit is contained in:
73
spa电子书/neko安装.md
Normal file
73
spa电子书/neko安装.md
Normal file
@@ -0,0 +1,73 @@
|
||||
清空 profile 目录
|
||||
|
||||
```
|
||||
# 1. 创建并清空 profile 目录(必须清空,否则旧数据会导致黑屏)
|
||||
rm -rf ~/neko-chromium-profile/*
|
||||
rm -rf ~/neko-chromium-profile/.??* # 删除所有隐藏文件
|
||||
```
|
||||
|
||||
数据持久化
|
||||
|
||||
```
|
||||
mkdir -p ~/neko-chromium-profile
|
||||
chown -R 1000:1000 ~/neko-chromium-profile
|
||||
```
|
||||
|
||||
自定义策略
|
||||
|
||||
```
|
||||
mkdir -p ~/neko-policies/managed
|
||||
chown -R 1000:1000 ~/neko-policies
|
||||
```
|
||||
|
||||
写入配置
|
||||
|
||||
```
|
||||
cat <<EOF > ~/neko-policies/managed/policies.json
|
||||
{
|
||||
"ExtensionInstallForcelist": [
|
||||
"dhdgffkkebhmkfjojejmpbldmpobfkfo;https://clients2.google.com/service/update2/crx"
|
||||
],
|
||||
"ExtensionInstallAllowlist": [
|
||||
"*"
|
||||
],
|
||||
"ExtensionInstallBlocklist": [],
|
||||
"DownloadRestrictions": 0,
|
||||
"AllowFileSelectionDialogs": true,
|
||||
"URLAllowlist": ["file:///home/neko/Downloads/*"],
|
||||
"DefaultCookiesSetting": 4,
|
||||
"RestoreOnStartup": 4,
|
||||
"RestoreOnStartupURLs": ["https://nomadro.com"]
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
打开防火墙端口
|
||||
|
||||
```
|
||||
sudo ufw allow 8080 && sudo ufw allow 56000:56100/udp
|
||||
```
|
||||
|
||||
设置本地ip变量
|
||||
|
||||
```
|
||||
LAN_IP=$(ip route get 1 | awk '{print $7;exit}')
|
||||
```
|
||||
|
||||
dokcer安装
|
||||
|
||||
```
|
||||
docker run -d \
|
||||
--name neko-browser \
|
||||
--network host \
|
||||
--shm-size=4g \
|
||||
--cap-add=SYS_ADMIN \
|
||||
-v ~/neko-chromium-profile:/home/neko/.config/chromium \
|
||||
-v ~/neko-policies/managed:/etc/chromium/policies/managed:ro \
|
||||
-e NEKO_WEBRTC_EPR=56000-56100 \
|
||||
-e NEKO_WEBRTC_NAT1TO1=$LAN_IP \
|
||||
-e NEKO_SCREEN=1920x1080@60 \
|
||||
-e NEKO_PASSWORD=user123 \
|
||||
-e NEKO_PASSWORD_ADMIN=admin123 \
|
||||
ghcr.io/m1k1o/neko/chromium:latest
|
||||
```
|
||||
Reference in New Issue
Block a user