-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
198 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
GITHUB_TOKEN=${GITHUB_TOKEN} | ||
|
||
load_SK() { | ||
# 将 curl 返回值 return 到变量中 | ||
res=$(curl "${SECRET_PATH}/$1" -H "Authorization: token ${GITHUB_TOKEN}" -H 'Accept: application/vnd.github.v3.raw') | ||
echo "$res" | ||
} | ||
|
||
main() { | ||
if command -v acme.sh; then | ||
/root/.acme.sh/acme.sh --upgrade | ||
return | ||
fi | ||
|
||
wget -qO - https://get.acme.sh | sh -s [email protected] | ||
/root/.acme.sh/acme.sh --register-account -m [email protected] | ||
/root/.acme.sh/acme.sh --set-default-ca --server letsencrypt | ||
|
||
serverCfg=$(load_SK "vm/vps/acme/account.conf") | ||
echo "$serverCfg" | ||
echo "$serverCfg" > /root/.acme.sh/account.conf | ||
} | ||
|
||
main "$@" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
FRP_VERSION=${FRP_VERSION:-"0.54.0"} | ||
|
||
load_SK() { | ||
res=$(curl "${SECRET_PATH}/$1" -H "Authorization: token ${GITHUB_TOKEN}" -H 'Accept: application/vnd.github.v3.raw') | ||
echo "$res" | ||
} | ||
|
||
main() { | ||
if [ -f /root/apps/frps/${FRP_VERSION}.version ]; then | ||
return | ||
fi | ||
|
||
wget https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_amd64.tar.gz -qO /tmp/frp.tar.gz | ||
|
||
rm -rf /root/apps/frps && mkdir /root/apps/frps -p | ||
tar -xf /tmp/frp.tar.gz --strip-components 1 -C /root/apps/frps/ | ||
|
||
wget $FRP_PATH/cfg/frps.service -qO /etc/systemd/system/frps.service | ||
|
||
touch /root/apps/frps/${FRP_VERSION}.version | ||
rm /root/apps/frps/*.toml /root/apps/frps/{LICENSE,frpc} | ||
|
||
serverCfg=$(load_SK "vm/vps/frps/frps.toml") | ||
echo "$serverCfg" > /root/apps/frps/frps.toml | ||
|
||
systemctl enable frps.service && systemctl stop frps.service | ||
systemctl daemon-reload && systemctl start frps.service | ||
|
||
rm -rf /tmp/frp.tar.gz | ||
} | ||
|
||
main "$@" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# 安装 nginx | ||
curl ${NGINX_PATH}/install.sh | bash | ||
# 初始化 nginx | ||
curl ${NGINX_PATH}/init.sh | bash | ||
# 配置 nginx | ||
curl ${NGINX_PATH}/setup.sh | bash |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -d /root/apps/nginx ]; then | ||
mkdir /root/apps/nginx/{site,cert,conf,logs} -p | ||
mkdir /root/apps/nginx/site/{admin,blog,ref,empty,it-tools}.alomerry.com -p | ||
touch /root/apps/nginx/cert/{privkey,fullchain}.pem | ||
fi |
6 changes: 2 additions & 4 deletions
6
vm/scripts/install/nginx.sh → vm/scripts/app/nginx/install.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
#!/bin/bash | ||
|
||
main() { | ||
if ! command -v nginx > /dev/null 2>&1; then | ||
echo "y" | apt-get install socat curl gnupg2 ca-certificates lsb-release ubuntu-keyring; | ||
|
||
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null | ||
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg | ||
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" | tee /etc/apt/sources.list.d/nginx.list | ||
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" | tee /etc/apt/preferences.d/99nginx | ||
apt update && apt install nginx -y | ||
} | ||
|
||
main "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
|
||
if [ ! -f /etc/systemd/system/nginx.service ]; then | ||
wget ${NGINX_PATH}/cfg/nginx.service -qO /etc/systemd/system/nginx.service | ||
systemctl enable nginx | ||
fi | ||
|
||
if [ ! -f /etc/nginx/nginx.conf ]; then | ||
wget ${NGINX_PATH}/cfg/nginx.conf -qO /etc/nginx/nginx.conf | ||
fi | ||
|
||
if [ ! -f /root/apps/nginx/conf/website.conf ]; then | ||
wget ${NGINX_PATH}/cfg/website.conf -qO /root/apps/nginx/conf/website.conf | ||
fi | ||
|
||
chmod 644 /etc/nginx/nginx.conf | ||
|
||
systemctl daemon-reload | ||
sleep 1 | ||
systemctl stop nginx | ||
sleep 1 | ||
systemctl start nginx |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
GITHUB_TOKEN=${GITHUB_TOKEN} | ||
|
||
# 根据传入配置地址返回内容,例如 vm/vps/v2ray/server.json | ||
load_SK() { | ||
# 将 curl 返回值 return 到变量中 | ||
res=$(curl "${SECRET_PATH}/$1" -H "Authorization: token ${GITHUB_TOKEN}" -H 'Accept: application/vnd.github.v3.raw') | ||
echo "$res" | ||
} | ||
|
||
main() { | ||
# 检查是否有 v2ray server 配置 | ||
if [ ! -f /usr/local/etc/v2ray/server.json ]; then | ||
# 下载配置文件 | ||
serverCfg=$(load_SK "vm/vps/v2ray/server.json") | ||
echo "$serverCfg" > /usr/local/etc/v2ray/server.json | ||
fi | ||
|
||
if ! command -v v2ray > /dev/null 2>&1; then | ||
curl ${GIT_RAW_URL}/v2fly/fhs-install-v2ray/master/install-release.sh | bash | ||
mv /usr/local/etc/v2ray/server.json /usr/local/etc/v2ray/config.json | ||
systemctl enable v2ray | ||
fi | ||
|
||
systemctl stop v2ray | ||
sleep 1 | ||
systemctl start v2ray | ||
} | ||
|
||
main "$@" |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# export http_proxy=127.0.0.1:7890 https_proxy=127.0.0.1:7890 | ||
# unset http_proxy https_proxy | ||
|
||
PROXY=127.0.0.1:7890 | ||
|
||
# https://raw.githubusercontent.com/alomerry/mix/master/vm/scripts | ||
export GIT_RAW_URL=https://raw.githubusercontent.com; \ | ||
export BRANCH=master; \ | ||
export MIX_REPOSITORY=alomerry/mix; \ | ||
export MIX_VM_VPS_STATIC=vm/scripts/app; \ | ||
export SCRIPTS_PATH=${GIT_RAW_URL}/${MIX_REPOSITORY}/${BRANCH}/${MIX_VM_VPS_STATIC}; \ | ||
export NGINX_PATH=${GIT_RAW_URL}/${MIX_REPOSITORY}/${BRANCH}/${MIX_VM_VPS_STATIC}/nginx; \ | ||
export V2RAY_PATH=${GIT_RAW_URL}/${MIX_REPOSITORY}/${BRANCH}/${MIX_VM_VPS_STATIC}/v2ray; \ | ||
export ACME_PATH=${GIT_RAW_URL}/${MIX_REPOSITORY}/${BRANCH}/${MIX_VM_VPS_STATIC}/acme; \ | ||
export FRP_PATH=${GIT_RAW_URL}/${MIX_REPOSITORY}/${BRANCH}/${MIX_VM_VPS_STATIC}/frp; \ | ||
export SECRET_PATH=${GIT_RAW_URL}/alomerry/secrets/master; \ | ||
export JAVA_VERSION=${JAVA_VERSION:-"8"}; |
Oops, something went wrong.