diff --git a/blog/pages/posts/2023~[share]-life-second-hand-house-note.md b/blog/pages/posts/2023~[share]-second-hand-house.md similarity index 100% rename from blog/pages/posts/2023~[share]-life-second-hand-house-note.md rename to blog/pages/posts/2023~[share]-second-hand-house.md diff --git a/blog/pages/posts/2024~[share].encrpt.md b/blog/pages/posts/2024~[share].encrpt.md new file mode 100644 index 00000000..f3b90198 --- /dev/null +++ b/blog/pages/posts/2024~[share].encrpt.md @@ -0,0 +1,9 @@ +--- +date: 2023-10-07T16:00:00.000+00:00 +title: 使用 Ansible 加密 git 仓库中的隐私信息 +lang: zh +duration: 10min +--- + +## Reference + diff --git a/vm/scripts/v2ray/v2ray.service b/vm/scripts/v2ray/v2ray.service new file mode 100644 index 00000000..9d52742f --- /dev/null +++ b/vm/scripts/v2ray/v2ray.service @@ -0,0 +1,16 @@ +[Unit] +Description=V2Ray Service +Documentation=https://www.v2fly.org/ +After=network.target nss-lookup.target + +[Service] +User=nobody +CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +NoNewPrivileges=true +ExecStart=/usr/local/bin/v2ray run -config /usr/local/etc/v2ray/config.json +Restart=on-failure +RestartPreventExitStatus=23 + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/vm/ubuntu.sh b/vm/ubuntu.sh index a6777d6e..c812c518 100755 --- a/vm/ubuntu.sh +++ b/vm/ubuntu.sh @@ -6,10 +6,10 @@ GIT_RAW_URL=https://raw.githubusercontent.com BRANCH=master MIX_REPOSITORY=alomerry/mix MIX_VM_VPS_STATIC=vm/scripts -NGINX_PATH=${GIT_RAW_URL}/${MIX_REPOSITY}/${BRANCH}/${MIX_VM_VPS_STATIC}/nginx -ACME_PATH=${GIT_RAW_URL}/${MIX_REPOSITY}/${BRANCH}/${MIX_VM_VPS_STATIC}/acme -V2RAY_PATH=${GIT_RAW_URL}/${MIX_REPOSITY}/${BRANCH}/${MIX_VM_VPS_STATIC}/v2ray -FRP_PATH=${GIT_RAW_URL}/${MIX_REPOSITY}/${BRANCH}/${MIX_VM_VPS_STATIC}/frp +NGINX_PATH=${GIT_RAW_URL}/${MIX_REPOSITORY}/${BRANCH}/${MIX_VM_VPS_STATIC}/nginx +ACME_PATH=${GIT_RAW_URL}/${MIX_REPOSITORY}/${BRANCH}/${MIX_VM_VPS_STATIC}/acme +V2RAY_PATH=${GIT_RAW_URL}/${MIX_REPOSITORY}/${BRANCH}/${MIX_VM_VPS_STATIC}/v2ray +FRP_PATH=${GIT_RAW_URL}/${MIX_REPOSITORY}/${BRANCH}/${MIX_VM_VPS_STATIC}/frp NODE_VERSION=${NODE_VERSION:-"20.10.0"} NVM_VERSION=${NVM_VERSION:-"0.39.7"} @@ -82,7 +82,9 @@ install_v2ray() { case "$1" in client) + mkdir /usr/local/etc/v2ray/ -p wget -P /usr/local/etc/v2ray/ $V2RAY_PATH/client.json + wget -P /etc/systemd/system $V2RAY_PATH/v2ray.service mv /usr/local/etc/v2ray/client.json /usr/local/etc/v2ray/config.json ansible-vault decrypt --vault-id ~/.ansible/.vault /usr/local/etc/v2ray/config.json ;;