Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
alomerry committed Jan 14, 2024
1 parent b952031 commit bb11a5a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
9 changes: 9 additions & 0 deletions blog/pages/posts/2024~[share].encrpt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
date: 2023-10-07T16:00:00.000+00:00
title: 使用 Ansible 加密 git 仓库中的隐私信息
lang: zh
duration: 10min
---

## Reference

16 changes: 16 additions & 0 deletions vm/scripts/v2ray/v2ray.service
Original file line number Diff line number Diff line change
@@ -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
10 changes: 6 additions & 4 deletions vm/ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down Expand Up @@ -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
;;
Expand Down

0 comments on commit bb11a5a

Please sign in to comment.