@wjwjq/release-helper 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/deploy/pkg/nginx_binary/compile.sh +37 -0
- package/dist/deploy/pkg/nginx_binary/nginx-x86_64-ssl1.0.2.tar.gz +0 -0
- package/dist/deploy/pkg/nginx_binary/nginx-x86_64-ssl1.1.1.tar.gz +0 -0
- package/dist/deploy/pkg/nginx_binary/nginx-x86_64-ssl3.0.7.tar.gz +0 -0
- package/dist/deploy/script/common.sh +30 -1
- package/dist/deploy/script/install.sh +0 -44
- package/dist/deploy/script/nginx.sh +87 -5
- package/dist/deploy/script/upgrade.sh +0 -43
- package/package.json +2 -2
- package/src/deploy/pkg/nginx_binary/compile.sh +37 -0
- package/src/deploy/pkg/nginx_binary/nginx-x86_64-ssl1.0.2.tar.gz +0 -0
- package/src/deploy/pkg/nginx_binary/nginx-x86_64-ssl1.1.1.tar.gz +0 -0
- package/src/deploy/pkg/nginx_binary/nginx-x86_64-ssl3.0.7.tar.gz +0 -0
- package/src/deploy/script/common.sh +30 -1
- package/src/deploy/script/install.sh +0 -44
- package/src/deploy/script/nginx.sh +87 -5
- package/src/deploy/script/upgrade.sh +0 -43
- package/dist/deploy/nginx/README.md +0 -1
- package/dist/deploy/nginx/pkg/nginx-x86_64-ssl1.0.2.tar.gz +0 -0
- package/dist/deploy/nginx/pkg/nginx-x86_64-ssl1.1.1.tar.gz +0 -0
- package/dist/deploy/nginx/pkg/nginx-x86_64-ssl3.0.7.tar.gz +0 -0
- package/dist/deploy/nginx/script/common.sh +0 -178
- package/dist/deploy/nginx/script/compile.sh +0 -11
- package/dist/deploy/nginx/script/fix.sh +0 -24
- package/dist/deploy/nginx/script/https.sh +0 -79
- package/dist/deploy/nginx/script/install.sh +0 -95
- package/dist/deploy/nginx/script/prompt.sh +0 -10
- package/dist/deploy/nginx/script/upgrade.sh +0 -7
- package/src/deploy/nginx/README.md +0 -1
- package/src/deploy/nginx/pkg/nginx-x86_64-ssl1.0.2.tar.gz +0 -0
- package/src/deploy/nginx/pkg/nginx-x86_64-ssl1.1.1.tar.gz +0 -0
- package/src/deploy/nginx/pkg/nginx-x86_64-ssl3.0.7.tar.gz +0 -0
- package/src/deploy/nginx/script/common.sh +0 -178
- package/src/deploy/nginx/script/compile.sh +0 -11
- package/src/deploy/nginx/script/fix.sh +0 -24
- package/src/deploy/nginx/script/https.sh +0 -79
- package/src/deploy/nginx/script/install.sh +0 -95
- package/src/deploy/nginx/script/prompt.sh +0 -10
- package/src/deploy/nginx/script/upgrade.sh +0 -7
- /package/dist/deploy/{nginx/pkg → pkg/nginx_binary}/nginx-arm-ssl1.1.1.tar.gz +0 -0
- /package/src/deploy/{nginx/pkg → pkg/nginx_binary}/nginx-arm-ssl1.1.1.tar.gz +0 -0
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
COUNTRY="CN"
|
|
4
|
-
PROVINCE="SC"
|
|
5
|
-
CITY="CD"
|
|
6
|
-
ORG="HX"
|
|
7
|
-
OU="HXWX"
|
|
8
|
-
emailAddress="hxwxgroup@qq.com"
|
|
9
|
-
|
|
10
|
-
get_subj () {
|
|
11
|
-
echo "/C=$COUNTRY/ST=$PROVINCE/L=$CITY/O=$ORG/OU=$OU/CN=$1/emailAddress=$emailAddress"
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if [ ! -f "/etc/pki/CA/index.txt" ]; then
|
|
15
|
-
touch /etc/pki/CA/index.txt
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
if [ ! -f "/etc/pki/CA/serial" ]; then
|
|
19
|
-
echo 01 >/etc/pki/CA/serial
|
|
20
|
-
fi
|
|
21
|
-
|
|
22
|
-
# ca
|
|
23
|
-
echo "---------------------generate ca------------------"
|
|
24
|
-
openssl genrsa -des3 -out ca.key 4096
|
|
25
|
-
|
|
26
|
-
read -rep "Please input ca DOMAIN: " -i "HXWXGROUP" CA_GRPUP_DOMAIN
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
subj=$(get_subj $CA_GRPUP_DOMAIN)
|
|
30
|
-
|
|
31
|
-
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt -subj $subj
|
|
32
|
-
|
|
33
|
-
if [[ $? == 0 ]]; then
|
|
34
|
-
echo "$(tput setaf 2)"---------------------generate ca done------------------!"$(tput sgr0)"
|
|
35
|
-
else
|
|
36
|
-
echo "$(tput setaf 1)"---------------------generate ca failed------------------"$(tput sgr0)"
|
|
37
|
-
exit 1
|
|
38
|
-
fi
|
|
39
|
-
|
|
40
|
-
# 服务端
|
|
41
|
-
echo "---------------------generate server ca------------------"
|
|
42
|
-
openssl genrsa -des3 -out server.pem 2048
|
|
43
|
-
|
|
44
|
-
openssl rsa -in server.pem -out server.key
|
|
45
|
-
|
|
46
|
-
read -rep "Please input server DOMAIN: " -i "www.cdsp.com" SERVER_DOMAIN
|
|
47
|
-
|
|
48
|
-
subj=$(get_subj $SERVER_DOMAIN)
|
|
49
|
-
# echo $subj #"/C=CN/ST=SC/L=CD/O=HX/OU=HXWX/CN=www.cdsp.com/emailAddress=''"
|
|
50
|
-
openssl req -new -key server.pem -out server.csr -subj $subj
|
|
51
|
-
|
|
52
|
-
if [[ $? == 0 ]]; then
|
|
53
|
-
openssl ca -policy policy_anything -days 3650 -cert ca.crt -keyfile ca.key -in server.csr -out server.crt
|
|
54
|
-
echo "$(tput setaf 2)"---------------------generate server ca done------------------!"$(tput sgr0)"
|
|
55
|
-
else
|
|
56
|
-
echo "$(tput setaf 1)"---------------------generate server ca failed------------------"$(tput sgr0)"
|
|
57
|
-
exit 1
|
|
58
|
-
fi
|
|
59
|
-
|
|
60
|
-
# 客户端
|
|
61
|
-
echo "---------------------generate client ca------------------"
|
|
62
|
-
openssl genrsa -des3 -out client.pem 2048
|
|
63
|
-
|
|
64
|
-
read -rep "Please input client DOMAIN: " -i "HXWXcdspCLIENT" CLIENT_DOMAIN
|
|
65
|
-
|
|
66
|
-
subj=$(get_subj $CLIENT_DOMAIN)
|
|
67
|
-
|
|
68
|
-
openssl req -new -key client.pem -out client.csr -subj $subj
|
|
69
|
-
|
|
70
|
-
if [[ $? == 0 ]]; then
|
|
71
|
-
openssl ca -policy policy_anything -days 3650 -cert ca.crt -keyfile ca.key -in client.csr -out client.crt
|
|
72
|
-
|
|
73
|
-
openssl pkcs12 -export -clcerts -in client.crt -inkey client.pem -out client.p12
|
|
74
|
-
|
|
75
|
-
echo "$(tput setaf 2)"---------------------generate client ca done------------------!"$(tput sgr0)"
|
|
76
|
-
else
|
|
77
|
-
echo "$(tput setaf 1)"---------------------generate client ca failed------------------"$(tput sgr0)"
|
|
78
|
-
exit 1
|
|
79
|
-
fi
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# 获取脚本所在的目录
|
|
3
|
-
basepath=$(dirname "$(realpath "${BASH_SOURCE[-1]}")")
|
|
4
|
-
|
|
5
|
-
source "$basepath"/common.sh
|
|
6
|
-
|
|
7
|
-
open_port_80() {
|
|
8
|
-
# 查看防火墙是否开启
|
|
9
|
-
systemctl status firewalld
|
|
10
|
-
# 若未开启则开启
|
|
11
|
-
systemctl start firewalld
|
|
12
|
-
|
|
13
|
-
# 查看所有开启的端口
|
|
14
|
-
#firewall-cmd --list-ports
|
|
15
|
-
|
|
16
|
-
# 开启nginx默认80端口(关键步骤一)
|
|
17
|
-
firewall-cmd --zone=public --add-port=80/tcp --permanent
|
|
18
|
-
|
|
19
|
-
# 重启防火墙(关键步骤二)
|
|
20
|
-
firewall-cmd --reload
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
rpm_install() {
|
|
24
|
-
installed=$(rpm -qa | grep -i nginx)
|
|
25
|
-
|
|
26
|
-
if [[ -n "${installed}" ]]; then
|
|
27
|
-
rpm -e "$installed"
|
|
28
|
-
fi
|
|
29
|
-
|
|
30
|
-
rpm -Uivh "$pkg_path"/nginx*.rpm
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
install_from_sourcecode() {
|
|
34
|
-
tar -zxvhf "$pkg_path/nginx-1.20.2.tar.gz"
|
|
35
|
-
(
|
|
36
|
-
cd ./nginx-1.20.2 || exit
|
|
37
|
-
sudo ./configure --prefix="$install_path" --with-http_ssl_module --with-http_v2_module
|
|
38
|
-
make && make install
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
# 安装
|
|
43
|
-
install() {
|
|
44
|
-
log "install nginx to path: ${install_path}"
|
|
45
|
-
|
|
46
|
-
arch=$(uname -m)
|
|
47
|
-
ssl_version=$(openssl version | grep -oP '\d+\.\d+' | sed -n '1p' 2>&1)
|
|
48
|
-
|
|
49
|
-
if [[ -z "${arch}" ]]; then
|
|
50
|
-
arch="x86_64"
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
|
-
if [[ $arch == arm* ]] || [[ $arch = aarch64 ]]; then
|
|
54
|
-
arch="arm"
|
|
55
|
-
fi
|
|
56
|
-
|
|
57
|
-
if [[ "${ssl_version}" == "1.0" ]]; then
|
|
58
|
-
ssl_version="1.0.2"
|
|
59
|
-
fi
|
|
60
|
-
|
|
61
|
-
if [[ "${ssl_version}" == "1.1" ]]; then
|
|
62
|
-
ssl_version="1.1.1"
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
if [[ "${ssl_version}" == "3.0" ]]; then
|
|
66
|
-
ssl_version="3.0.7"
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
if [[ -z "${ssl_version}" ]]; then
|
|
70
|
-
ssl_version="1.0.2"
|
|
71
|
-
fi
|
|
72
|
-
|
|
73
|
-
pkg="$pkg_path"/nginx-"$arch"-ssl"$ssl_version".tar.gz
|
|
74
|
-
|
|
75
|
-
if [ ! -f "$pkg" ]; then
|
|
76
|
-
log_error "Fatal error: nginx-$arch-ssl$ssl_version.tar.gz not matched! contact developer!"
|
|
77
|
-
exit 1
|
|
78
|
-
fi
|
|
79
|
-
|
|
80
|
-
log "current arch: $arch, current ssl_version: $ssl_version"
|
|
81
|
-
|
|
82
|
-
tar -zxvhf "$pkg" -C "$install_path" --strip-components 1
|
|
83
|
-
|
|
84
|
-
cp "$install_path"nginx /usr/sbin/
|
|
85
|
-
|
|
86
|
-
# 检测是否安装成功
|
|
87
|
-
if [[ $? == 0 ]]; then
|
|
88
|
-
log_success "nginx installation successfully!"
|
|
89
|
-
else
|
|
90
|
-
log_error "nginx installation failed!"
|
|
91
|
-
fi
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
install
|
|
95
|
-
log '------------- done ------------------------'
|
|
File without changes
|
|
File without changes
|