[video] 新增video线管的内容
This commit is contained in:
2
.idea/dataSources.local.xml
generated
2
.idea/dataSources.local.xml
generated
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="dataSourceStorageLocal" created-in="IU-232.10227.8">
|
<component name="dataSourceStorageLocal" created-in="IU-233.11799.241">
|
||||||
<data-source name="腾讯云-成都" uuid="79c9466f-d8a3-418a-b54a-f6e314306a0c">
|
<data-source name="腾讯云-成都" uuid="79c9466f-d8a3-418a-b54a-f6e314306a0c">
|
||||||
<database-info product="MySQL" version="8.0.27" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-java-8.0.25 (Revision: 08be9e9b4cba6aa115f9b27b215887af40b159e0)" dbms="MYSQL" exact-version="8.0.27" exact-driver-version="8.0">
|
<database-info product="MySQL" version="8.0.27" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-java-8.0.25 (Revision: 08be9e9b4cba6aa115f9b27b215887af40b159e0)" dbms="MYSQL" exact-version="8.0.27" exact-driver-version="8.0">
|
||||||
<extra-name-characters>#@</extra-name-characters>
|
<extra-name-characters>#@</extra-name-characters>
|
||||||
|
|||||||
32
.idea/inspectionProfiles/Project_Default.xml
generated
32
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,6 +1,38 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
<component name="InspectionProjectProfileManager">
|
||||||
<profile version="1.0">
|
<profile version="1.0">
|
||||||
<option name="myName" value="Project Default" />
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="HttpUrlsUsage" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||||
|
<option name="ignoredUrls">
|
||||||
|
<list>
|
||||||
|
<option value="http://$offline_host_ip" />
|
||||||
|
<option value="http://${offline_host_ip}" />
|
||||||
|
<option value="http://0.0.0.0" />
|
||||||
|
<option value="http://127.0.0.1" />
|
||||||
|
<option value="http://activemq.apache.org/schema/" />
|
||||||
|
<option value="http://cxf.apache.org/schemas/" />
|
||||||
|
<option value="http://java.sun.com/" />
|
||||||
|
<option value="http://javafx.com/fxml" />
|
||||||
|
<option value="http://javafx.com/javafx/" />
|
||||||
|
<option value="http://json-schema.org/draft" />
|
||||||
|
<option value="http://localhost" />
|
||||||
|
<option value="http://maven.apache.org/POM/" />
|
||||||
|
<option value="http://maven.apache.org/xsd/" />
|
||||||
|
<option value="http://primefaces.org/ui" />
|
||||||
|
<option value="http://schema.cloudfoundry.org/spring/" />
|
||||||
|
<option value="http://schemas.xmlsoap.org/" />
|
||||||
|
<option value="http://tiles.apache.org/" />
|
||||||
|
<option value="http://www.ibm.com/webservices/xsd" />
|
||||||
|
<option value="http://www.jboss.com/xml/ns/" />
|
||||||
|
<option value="http://www.jboss.org/j2ee/schema/" />
|
||||||
|
<option value="http://www.springframework.org/schema/" />
|
||||||
|
<option value="http://www.springframework.org/security/tags" />
|
||||||
|
<option value="http://www.springframework.org/tags" />
|
||||||
|
<option value="http://www.thymeleaf.org" />
|
||||||
|
<option value="http://www.w3.org/" />
|
||||||
|
<option value="http://xmlns.jcp.org/" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
<inspection_tool class="bashproGoogleFileNameStyle" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="bashproGoogleFileNameStyle" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="bashproShellCheck" enabled="true" level="ERROR" enabled_by_default="true">
|
<inspection_tool class="bashproShellCheck" enabled="true" level="ERROR" enabled_by_default="true">
|
||||||
<shellcheck_settings value="SC2068,SC2145" />
|
<shellcheck_settings value="SC2068,SC2145" />
|
||||||
|
|||||||
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@@ -1,4 +1,3 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
|||||||
@@ -6,11 +6,12 @@
|
|||||||
|
|
||||||
|
|
||||||
docker_version=20.10.10
|
docker_version=20.10.10
|
||||||
oss_url_prefix="https://oss-s1.107421.xyz"
|
oss_url_prefix="http://10.250.0.100:9000/octopus"
|
||||||
modify_ssh_port=22333
|
modify_ssh_port=22333
|
||||||
octopus_agent_path=/usr/local/etc/octpus-agent
|
octopus_agent_path=/usr/local/etc/octpus-agent
|
||||||
octopus_agent_url=https://happybirthday.107421.xyz/octopus-agent
|
octopus_agent_url=https://happybirthday.107421.xyz/octopus-agent
|
||||||
agent_config_url=https://happybirthday.107421.xyz/agent-config
|
agent_config_url=https://happybirthday.107421.xyz/agent-config
|
||||||
|
offline_host_ip="10.250.0.100"
|
||||||
|
|
||||||
# 脚本执行内容
|
# 脚本执行内容
|
||||||
deploy_in_cn=0
|
deploy_in_cn=0
|
||||||
@@ -26,6 +27,7 @@ is_modify_ssh_port=0
|
|||||||
is_install_agent=0
|
is_install_agent=0
|
||||||
is_update_agent=0
|
is_update_agent=0
|
||||||
is_remove_agent=0
|
is_remove_agent=0
|
||||||
|
is_offline=0
|
||||||
# 脚本执行内容
|
# 脚本执行内容
|
||||||
|
|
||||||
# read config
|
# read config
|
||||||
@@ -73,6 +75,9 @@ while [[ $# -gt 0 ]]; do
|
|||||||
is_modify_ssh_port=1
|
is_modify_ssh_port=1
|
||||||
modify_ssh_port=$2
|
modify_ssh_port=$2
|
||||||
;;
|
;;
|
||||||
|
--offline)
|
||||||
|
is_offline=1
|
||||||
|
;;
|
||||||
--agent-install)
|
--agent-install)
|
||||||
is_install_agent=1
|
is_install_agent=1
|
||||||
;;
|
;;
|
||||||
@@ -93,9 +98,11 @@ echo ""
|
|||||||
echo ""
|
echo ""
|
||||||
mkdir -p ${octopus_agent_path}/lib/
|
mkdir -p ${octopus_agent_path}/lib/
|
||||||
lib_file_list=(wdd-lib-log.sh wdd-lib-sys.sh)
|
lib_file_list=(wdd-lib-log.sh wdd-lib-sys.sh)
|
||||||
|
# shellcheck disable=SC2068
|
||||||
for lib_file in ${lib_file_list[@]}; do
|
for lib_file in ${lib_file_list[@]}; do
|
||||||
wget "${oss_url_prefix}/${lib_file}" -qO "${octopus_agent_path}/lib/${lib_file}"
|
wget "${oss_url_prefix}/${lib_file}" -qO "${octopus_agent_path}/lib/${lib_file}"
|
||||||
echo "加载库文件 < ${octopus_agent_path}/lib/${lib_file}"
|
echo "加载库文件 < ${octopus_agent_path}/lib/${lib_file}"
|
||||||
|
# shellcheck disable=SC1090
|
||||||
. "${octopus_agent_path}/lib/${lib_file}"
|
. "${octopus_agent_path}/lib/${lib_file}"
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -111,6 +118,7 @@ done
|
|||||||
## 安装所需要的程序,及依赖程序
|
## 安装所需要的程序,及依赖程序
|
||||||
install_demand_softwares() {
|
install_demand_softwares() {
|
||||||
local software=""
|
local software=""
|
||||||
|
# shellcheck disable=SC2068
|
||||||
for software in $@; do
|
for software in $@; do
|
||||||
## 安装该软件
|
## 安装该软件
|
||||||
if [[ -n $(command -v "${software}") ]]; then
|
if [[ -n $(command -v "${software}") ]]; then
|
||||||
@@ -273,6 +281,7 @@ install_docker() {
|
|||||||
systemctl disable docker
|
systemctl disable docker
|
||||||
local pre_soft_ware=(docker-ce containerd.io docker-ce-cli docker-compose kubelet kubeadm kubectl)
|
local pre_soft_ware=(docker-ce containerd.io docker-ce-cli docker-compose kubelet kubeadm kubectl)
|
||||||
local pre_one=""
|
local pre_one=""
|
||||||
|
# shellcheck disable=SC2068
|
||||||
for pre_one in ${pre_soft_ware[@]}; do
|
for pre_one in ${pre_soft_ware[@]}; do
|
||||||
$cmd_remove "$pre_one"
|
$cmd_remove "$pre_one"
|
||||||
done
|
done
|
||||||
@@ -694,6 +703,7 @@ modify_ssh_port() {
|
|||||||
local sshd_change_to_no=("ChallengeResponseAuthentication" "PermitEmptyPasswords" "StrictModes")
|
local sshd_change_to_no=("ChallengeResponseAuthentication" "PermitEmptyPasswords" "StrictModes")
|
||||||
|
|
||||||
local yes_item
|
local yes_item
|
||||||
|
# shellcheck disable=SC2068
|
||||||
for yes_item in ${sshd_change_to_yes[@]}; do
|
for yes_item in ${sshd_change_to_yes[@]}; do
|
||||||
if grep -x "$yes_item yes" $ssh_config_file; then
|
if grep -x "$yes_item yes" $ssh_config_file; then
|
||||||
# 已经存在了,什么都不做
|
# 已经存在了,什么都不做
|
||||||
@@ -711,6 +721,7 @@ modify_ssh_port() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
local no_item
|
local no_item
|
||||||
|
# shellcheck disable=SC2068
|
||||||
for no_item in ${sshd_change_to_no[@]}; do
|
for no_item in ${sshd_change_to_no[@]}; do
|
||||||
if grep -x "$no_item no" $ssh_config_file; then
|
if grep -x "$no_item no" $ssh_config_file; then
|
||||||
:
|
:
|
||||||
@@ -786,7 +797,7 @@ modify_ssh_login() {
|
|||||||
SplitLine
|
SplitLine
|
||||||
|
|
||||||
log "下载公共id_rsa.pub文件!"
|
log "下载公共id_rsa.pub文件!"
|
||||||
wget https://oss-s1.107421.xyz/ssh_key_pub.txt -qO /tmp/ssh_key_pub.txt
|
wget "$oss_url_prefix/ssh_key_pub.txt" -qO /tmp/ssh_key_pub.txt
|
||||||
if [[ ! -s /tmp/ssh_key_pub.txt ]]; then
|
if [[ ! -s /tmp/ssh_key_pub.txt ]]; then
|
||||||
error "下载 ssh-key 失败!"
|
error "下载 ssh-key 失败!"
|
||||||
return 1
|
return 1
|
||||||
@@ -814,9 +825,11 @@ common_tool_install() {
|
|||||||
echo ""
|
echo ""
|
||||||
if [[ ${linux_release_version} == "centos" ]]; then
|
if [[ ${linux_release_version} == "centos" ]]; then
|
||||||
local centos_common_tool=(deltarpm net-tools iputils bind-utils lsof curl wget vim mtr htop)
|
local centos_common_tool=(deltarpm net-tools iputils bind-utils lsof curl wget vim mtr htop)
|
||||||
|
# shellcheck disable=SC2068
|
||||||
install_demand_softwares ${centos_common_tool[@]}
|
install_demand_softwares ${centos_common_tool[@]}
|
||||||
elif [[ ${linux_release_version} == "ubuntu" ]] || [[ ${linux_release_version} == "debian" ]]; then
|
elif [[ ${linux_release_version} == "ubuntu" ]] || [[ ${linux_release_version} == "debian" ]]; then
|
||||||
local ubuntu_common_tool=(iputils-ping net-tools dnsutils lsof curl wget mtr-tiny vim htop lrzsz)
|
local ubuntu_common_tool=(iputils-ping net-tools dnsutils lsof curl wget mtr-tiny vim htop lrzsz)
|
||||||
|
# shellcheck disable=SC2068
|
||||||
install_demand_softwares ${ubuntu_common_tool[@]}
|
install_demand_softwares ${ubuntu_common_tool[@]}
|
||||||
fi
|
fi
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
@@ -839,6 +852,7 @@ remove_octopus_agent() {
|
|||||||
|
|
||||||
local systemd_config_file
|
local systemd_config_file
|
||||||
local agent_installed=0
|
local agent_installed=0
|
||||||
|
# shellcheck disable=SC2068
|
||||||
for systemd_config_file in ${systemd_config_path[@]}; do
|
for systemd_config_file in ${systemd_config_path[@]}; do
|
||||||
if ls "${systemd_config_file}"* | grep -q octopus-agent.service; then
|
if ls "${systemd_config_file}"* | grep -q octopus-agent.service; then
|
||||||
agent_installed=1
|
agent_installed=1
|
||||||
@@ -892,7 +906,7 @@ SyslogIdentifier=octopus-agent
|
|||||||
User=root
|
User=root
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=$octopus_agent_path
|
WorkingDirectory=$octopus_agent_path
|
||||||
ExecStart=$octopus_agent_path/octopus-agent -agentServerInfoConf=$octopus_agent_path/octopus-agent.conf -version=shanghai
|
ExecStart=$octopus_agent_path/octopus-agent -agentServerInfoConf=$octopus_agent_path/octopus-agent.conf -version=standard
|
||||||
ExecStop=/bin/kill -15 \$MAINPID
|
ExecStop=/bin/kill -15 \$MAINPID
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
@@ -928,11 +942,30 @@ install_octopus_agent() {
|
|||||||
FunctionStart "安装 Octopus Agent"
|
FunctionStart "安装 Octopus Agent"
|
||||||
|
|
||||||
colorEchoBlue "开始检查最新的版本!"
|
colorEchoBlue "开始检查最新的版本!"
|
||||||
local latest_version=$(curl "$octopus_agent_url/" | grep -v h1 | grep "a href=" | head -1 | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4-)
|
|
||||||
|
# add for offline version
|
||||||
|
if [[ $is_offline -eq 1 ]]; then
|
||||||
|
octopus_agent_url="http://${offline_host_ip}/octopus-agent"
|
||||||
|
agent_config_url="http://${offline_host_ip}/agent-config"
|
||||||
|
colorEchoBlue "[install_octopus_agent] - offline agent url are => $octopus_agent_url"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
local latest_version=""
|
||||||
|
latest_version=$(curl "$octopus_agent_url/" | grep -v h1 | grep "a href=" | head -1 | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4-)
|
||||||
|
|
||||||
|
if [[ $latest_version == "" ]]; then
|
||||||
|
echo ""
|
||||||
|
colorEchoRed "[install_octopus_agent] - get agent version error ! break !"
|
||||||
|
colorEchoRed "[install_octopus_agent] - get agent version error ! break !"
|
||||||
|
echo ""
|
||||||
|
return 233
|
||||||
|
fi
|
||||||
|
|
||||||
log "查询得到的Octopus Agent的最新版本为 => ${latest_version}"
|
log "查询得到的Octopus Agent的最新版本为 => ${latest_version}"
|
||||||
SplitBlue
|
SplitBlue
|
||||||
# Agent二进制文件的命名规则为 octopus-agent_linux_amd64_<version>
|
# Agent二进制文件的命名规则为 octopus-agent_linux_amd64_<version>
|
||||||
|
# shellcheck disable=SC2154
|
||||||
local agent_latest_version="octopus-agent_linux_${linux_release}_${latest_version}"
|
local agent_latest_version="octopus-agent_linux_${linux_release}_${latest_version}"
|
||||||
colorEchoBlue "octopus agent latest version is => [ $agent_latest_version ]"
|
colorEchoBlue "octopus agent latest version is => [ $agent_latest_version ]"
|
||||||
|
|
||||||
@@ -949,7 +982,8 @@ install_octopus_agent() {
|
|||||||
log "开始下载 Octopus Agent Config !"
|
log "开始下载 Octopus Agent Config !"
|
||||||
rm -rf index.html
|
rm -rf index.html
|
||||||
|
|
||||||
local agentConfigFileList=$(curl "$agent_config_url/" | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4- | tr "\n" " ")
|
local agentConfigFileList=""
|
||||||
|
agentConfigFileList=$(curl "$agent_config_url/" | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4- | tr "\n" " ")
|
||||||
|
|
||||||
IFS=" " read -ra file_array <<<"$agentConfigFileList"
|
IFS=" " read -ra file_array <<<"$agentConfigFileList"
|
||||||
|
|
||||||
@@ -958,7 +992,7 @@ install_octopus_agent() {
|
|||||||
colorEchoBlue "agent config file is => $agent_config"
|
colorEchoBlue "agent config file is => $agent_config"
|
||||||
wget -q "$agent_config_url/$agent_config" -qO "${octopus_agent_path}/$agent_config"
|
wget -q "$agent_config_url/$agent_config" -qO "${octopus_agent_path}/$agent_config"
|
||||||
echo ""
|
echo ""
|
||||||
done
|
done
|
||||||
|
|
||||||
colorEchoBlue "---------------- ls the ${octopus_agent_path} ----------------------"
|
colorEchoBlue "---------------- ls the ${octopus_agent_path} ----------------------"
|
||||||
ls ${octopus_agent_path} | grep ".yaml"
|
ls ${octopus_agent_path} | grep ".yaml"
|
||||||
@@ -975,7 +1009,15 @@ install_octopus_agent() {
|
|||||||
echo ""
|
echo ""
|
||||||
SplitGreen
|
SplitGreen
|
||||||
|
|
||||||
|
# ok
|
||||||
daemon_octopus_agent
|
daemon_octopus_agent
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# change for it
|
||||||
|
sed -i "s/OFFLINE_HOST_IP/${offline_host_ip}/g" ${octopus_agent_path}/octopus-agent-standard.yaml
|
||||||
|
colorEchoGreen "[install_octopus_agent] - agent-config is ok !"
|
||||||
|
# see the config file
|
||||||
|
|
||||||
|
|
||||||
log "开始启动 Octopus Agent!"
|
log "开始启动 Octopus Agent!"
|
||||||
|
|
||||||
@@ -1007,6 +1049,7 @@ update_octopus_agent(){
|
|||||||
|
|
||||||
local systemd_config_file
|
local systemd_config_file
|
||||||
local agent_installed=0
|
local agent_installed=0
|
||||||
|
# shellcheck disable=SC2068
|
||||||
for systemd_config_file in ${systemd_config_path[@]}; do
|
for systemd_config_file in ${systemd_config_path[@]}; do
|
||||||
if ls "${systemd_config_file}"* | grep -q octopus-agent.service; then
|
if ls "${systemd_config_file}"* | grep -q octopus-agent.service; then
|
||||||
agent_installed=1
|
agent_installed=1
|
||||||
@@ -1029,9 +1072,26 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
colorEchoBlue "开始检查最新的版本!"
|
colorEchoBlue "开始检查最新的版本!"
|
||||||
local latest_version=$(curl "$octopus_agent_url/" | grep -v h1 | grep "a href=" | head -1 | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4-)
|
|
||||||
|
# add for ofline version
|
||||||
|
if [[ $is_offline -eq 1 ]]; then
|
||||||
|
octopus_agent_url="http://$offline_host_ip/octopus-agent"
|
||||||
|
agent_config_url="http://$offline_host_ip/agent-config"
|
||||||
|
colorEchoBlue "[install_octopus_agent] - offline agent url are => $octopus_agent_url"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local latest_version=""
|
||||||
|
latest_version=$(curl "$octopus_agent_url/" | grep -v h1 | grep "a href=" | head -1 | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4-)
|
||||||
|
|
||||||
log "查询得到的Octopus Agent的最新版本为 => ${latest_version}"
|
log "查询得到的Octopus Agent的最新版本为 => ${latest_version}"
|
||||||
|
if [[ $latest_version == "" ]]; then
|
||||||
|
echo ""
|
||||||
|
colorEchoRed "[update_octopus_agent] - get agent version error ! break !"
|
||||||
|
colorEchoRed "[update_octopus_agent] - get agent version error ! break !"
|
||||||
|
echo ""
|
||||||
|
return 233
|
||||||
|
fi
|
||||||
|
|
||||||
SplitBlue
|
SplitBlue
|
||||||
# Agent二进制文件的命名规则为 octopus-agent_linux_amd64_<version>
|
# Agent二进制文件的命名规则为 octopus-agent_linux_amd64_<version>
|
||||||
local agent_latest_version="octopus-agent_linux_${linux_release}_${latest_version}"
|
local agent_latest_version="octopus-agent_linux_${linux_release}_${latest_version}"
|
||||||
@@ -1050,7 +1110,8 @@ EOF
|
|||||||
log "开始下载 Octopus Agent Config !"
|
log "开始下载 Octopus Agent Config !"
|
||||||
rm -rf index.html
|
rm -rf index.html
|
||||||
|
|
||||||
local agentConfigFileList=$(curl "$agent_config_url/" | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4- | tr "\n" " ")
|
local agentConfigFileList=""
|
||||||
|
agentConfigFileList=$(curl "$agent_config_url/" | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4- | tr "\n" " ")
|
||||||
|
|
||||||
IFS=" " read -ra file_array <<<"$agentConfigFileList"
|
IFS=" " read -ra file_array <<<"$agentConfigFileList"
|
||||||
|
|
||||||
@@ -1066,6 +1127,9 @@ EOF
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
log "开始重启启动 Octopus Agent!"
|
log "开始重启启动 Octopus Agent!"
|
||||||
|
# change for it
|
||||||
|
sed -i "s/OFFLINE_HOST_IP/${offline_host_ip}/g" ${octopus_agent_path}/octopus-agent-standard.yaml
|
||||||
|
colorEchoGreen "[update_octopus_agent] - agent-config is ok !"
|
||||||
|
|
||||||
systemctl enable octopus-agent.service
|
systemctl enable octopus-agent.service
|
||||||
systemctl start octopus-agent.service
|
systemctl start octopus-agent.service
|
||||||
@@ -1086,6 +1150,28 @@ EOF
|
|||||||
FunctionEnd
|
FunctionEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build_offline_host_ip(){
|
||||||
|
|
||||||
|
FunctionStart "offline installation ! start to build for host ip !"
|
||||||
|
|
||||||
|
local host_ip=""
|
||||||
|
colorEchoBlue "[build_offline_host_ip] - offline install of octopus agent, oss url is => ${oss_url_prefix}"
|
||||||
|
host_ip=$(echo "$oss_url_prefix" | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b")
|
||||||
|
echo ""
|
||||||
|
colorEchoBlue "[build_offline_host_ip] - make sure agent offline package has been synchronized to => $host_ip !"
|
||||||
|
colorEchoBlue "[build_offline_host_ip] - make sure agent offline package has been synchronized to => $host_ip !"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [[ "$host_ip" -eq "" ]]; then
|
||||||
|
colorEchoRed "[build_offline_host_ip] - offline host ip extraction error ! break !"
|
||||||
|
return 233
|
||||||
|
fi
|
||||||
|
|
||||||
|
offline_host_ip=${host_ip}
|
||||||
|
|
||||||
|
FunctionEnd
|
||||||
|
}
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# description
|
# description
|
||||||
# Arguments:
|
# Arguments:
|
||||||
@@ -1125,6 +1211,7 @@ help() {
|
|||||||
--docker-compose 安装docker-compose 2.18.0
|
--docker-compose 安装docker-compose 2.18.0
|
||||||
--zsh 安装并且配置ZSH
|
--zsh 安装并且配置ZSH
|
||||||
--cn 是否在国内安装
|
--cn 是否在国内安装
|
||||||
|
--offline 是否是纯离线安装
|
||||||
--host 是否配置服务器的Host解析
|
--host 是否配置服务器的Host解析
|
||||||
--time 是否配置时间同步
|
--time 是否配置时间同步
|
||||||
--ssh-login 修改ssh的登录密钥
|
--ssh-login 修改ssh的登录密钥
|
||||||
@@ -1158,6 +1245,10 @@ main() {
|
|||||||
check_root
|
check_root
|
||||||
check_sys
|
check_sys
|
||||||
|
|
||||||
|
if [[ $is_offline -eq "1" ]]; then
|
||||||
|
build_offline_host_ip
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $is_shutdown_firewall -eq "1" ]]; then
|
if [[ $is_shutdown_firewall -eq "1" ]]; then
|
||||||
shutdown_firewall
|
shutdown_firewall
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -330,6 +330,18 @@ get_ipv4_info() {
|
|||||||
public_ipv4="$(wget -q -T10 -O- ipinfo.io/ip)"
|
public_ipv4="$(wget -q -T10 -O- ipinfo.io/ip)"
|
||||||
public_ipv6="$(curl -q --max-time 5 -6 https://ifconfig.co/ip)"
|
public_ipv6="$(curl -q --max-time 5 -6 https://ifconfig.co/ip)"
|
||||||
|
|
||||||
|
if [[ $city -eq "" ]]; then
|
||||||
|
city="Chengdu"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $country -eq "" ]]; then
|
||||||
|
country="CN"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $region -eq "" ]]; then
|
||||||
|
region="Shuangliu"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$public_ipv4" ]; then
|
if [ -z "$public_ipv4" ]; then
|
||||||
public_ipv4=" "
|
public_ipv4=" "
|
||||||
fi
|
fi
|
||||||
@@ -458,7 +470,7 @@ collect_system_info() {
|
|||||||
uptime | head -1 | awk -F'load average:' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//'
|
uptime | head -1 | awk -F'load average:' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//'
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
os_info=$(get_host_arch_info)
|
os_info=$(get_host_arch_info | tr "\n" " ")
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
local l_bit
|
local l_bit
|
||||||
if command_exists "getconf"; then
|
if command_exists "getconf"; then
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
oss_url_prefix="https://oss-s1.107421.xyz"
|
|
||||||
octopus_agent_path=/usr/local/etc/octpus-agent
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
lib_file_list=(wdd-lib-log.sh)
|
lib_file_list=(wdd-lib-log.sh)
|
||||||
|
# shellcheck disable=SC2068
|
||||||
for lib_file in ${lib_file_list[@]}; do
|
for lib_file in ${lib_file_list[@]}; do
|
||||||
|
# shellcheck disable=SC2154
|
||||||
wget "${oss_url_prefix}/${lib_file}" -qO "${octopus_agent_path}/lib/${lib_file}"
|
wget "${oss_url_prefix}/${lib_file}" -qO "${octopus_agent_path}/lib/${lib_file}"
|
||||||
echo "加载库文件 < ${octopus_agent_path}/lib/${lib_file}"
|
echo "加载库文件 < ${octopus_agent_path}/lib/${lib_file}"
|
||||||
|
# shellcheck disable=SC1090
|
||||||
. "${octopus_agent_path}/lib/${lib_file}"
|
. "${octopus_agent_path}/lib/${lib_file}"
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -112,6 +112,7 @@ check_sys() {
|
|||||||
elif [[ -n $(command -v zypper) ]]; then
|
elif [[ -n $(command -v zypper) ]]; then
|
||||||
cmd_install="zypper -y install"
|
cmd_install="zypper -y install"
|
||||||
cmd_update="zypper ref"
|
cmd_update="zypper ref"
|
||||||
|
# shellcheck disable=SC2034
|
||||||
cmd_remove="zypper -y remove"
|
cmd_remove="zypper -y remove"
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
@@ -128,6 +129,13 @@ check_sys() {
|
|||||||
|
|
||||||
log "系统包管理工具为 => $cmd_install"
|
log "系统包管理工具为 => $cmd_install"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2154
|
||||||
|
if [[ $is_offline == 1 ]]; then
|
||||||
|
FunctionEnd
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
### 更新程序引索
|
### 更新程序引索
|
||||||
if [[ $software_updated -eq 0 ]]; then
|
if [[ $software_updated -eq 0 ]]; then
|
||||||
log "正在更新软件包管理...可能花费较长时间…………"
|
log "正在更新软件包管理...可能花费较长时间…………"
|
||||||
|
|||||||
118
Public/sync-agent-for-offline.sh
Normal file
118
Public/sync-agent-for-offline.sh
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# set -o errexit
|
||||||
|
# set -o nounset
|
||||||
|
# set -o pipefail
|
||||||
|
|
||||||
|
|
||||||
|
octopus_agent_url=https://happybirthday.107421.xyz/octopus-agent
|
||||||
|
agent_config_url=https://happybirthday.107421.xyz/agent-config
|
||||||
|
default_octopus_agent_local_path=/data/github-action/octopus-agent/
|
||||||
|
default_octopus_agent_config_local_path=/data/github-action/agent-config/
|
||||||
|
|
||||||
|
|
||||||
|
sync_octopus_agent(){
|
||||||
|
|
||||||
|
local octopus_agent_html="octopus_agent.html"
|
||||||
|
|
||||||
|
rm -rf ${octopus_agent_html}
|
||||||
|
wget "$octopus_agent_url/" -qO ${octopus_agent_html}
|
||||||
|
|
||||||
|
if [[ ! -s $octopus_agent_html ]]; then
|
||||||
|
echo "[sync_octopus_agent] - download agent version file error ! return false !"
|
||||||
|
return 233
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "清除旧的Agnet内容"
|
||||||
|
rm -rf ${default_octopus_agent_local_path}
|
||||||
|
mkdir -p ${default_octopus_agent_local_path}
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
echo "开始同步最新版本的Octopus Agent !"
|
||||||
|
local octopus_agent_config_file_list=""
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
octopus_agent_config_file_list=$(cat ${octopus_agent_html} | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | tr "\n" " ")
|
||||||
|
local octopus_agent_config_list
|
||||||
|
IFS=" " read -ra octopus_agent_config_list <<<"$octopus_agent_config_file_list"
|
||||||
|
echo ""
|
||||||
|
local octopus_agent_file
|
||||||
|
for octopus_agent_file in "${octopus_agent_config_list[@]}"
|
||||||
|
do
|
||||||
|
echo "[sync_octopus_agent] => start to download => ${octopus_agent_url}/${octopus_agent_file}"
|
||||||
|
wget "${octopus_agent_url}/${octopus_agent_file}" -qO "${default_octopus_agent_local_path}${octopus_agent_file}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [[ ! -s "${default_octopus_agent_local_path}${octopus_agent_file}" ]]; then
|
||||||
|
echo ""
|
||||||
|
echo "[sync_octopus_agent] - ERROR download file ${octopus_agent_url}/${octopus_agent_file} !"
|
||||||
|
echo ""
|
||||||
|
return 233
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "[sync_octopus_agent] - check for octopus agent download .."
|
||||||
|
echo ""
|
||||||
|
ls ${default_octopus_agent_local_path}
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sync_octopus_agent_config(){
|
||||||
|
|
||||||
|
local octopus_agent_config_html="octopus_agent_config.html"
|
||||||
|
|
||||||
|
rm -rf ${octopus_agent_config_html}
|
||||||
|
wget "$agent_config_url/" -qO ${octopus_agent_config_html}
|
||||||
|
|
||||||
|
if [[ ! -s $octopus_agent_config_html ]]; then
|
||||||
|
echo "[sync_octopus_agent_config] - download agent config file error ! return false !"
|
||||||
|
return 233
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "清除旧的Agnet Config内容"
|
||||||
|
rm -rf $default_octopus_agent_config_local_path
|
||||||
|
mkdir -p ${default_octopus_agent_config_local_path}
|
||||||
|
echo ""
|
||||||
|
echo "开始同步最新版本的Octopus Agent Config !"
|
||||||
|
|
||||||
|
local octopus_agent_config_file_list=""
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
octopus_agent_config_file_list=$(cat ${octopus_agent_config_html} | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | tr "\n" " ")
|
||||||
|
local octopus_agent_config_list
|
||||||
|
IFS=" " read -ra octopus_agent_config_list <<<"$octopus_agent_config_file_list"
|
||||||
|
echo ""
|
||||||
|
local octopus_agent_config_file
|
||||||
|
for octopus_agent_config_file in "${octopus_agent_config_list[@]}"
|
||||||
|
do
|
||||||
|
echo "[sync_octopus_agent_config] => start to download => ${agent_config_url}/${octopus_agent_config_file}"
|
||||||
|
wget "${agent_config_url}/${octopus_agent_config_file}" -qO "${default_octopus_agent_config_local_path}${octopus_agent_config_file}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [[ ! -s "${default_octopus_agent_config_local_path}${octopus_agent_config_file}" ]]; then
|
||||||
|
echo ""
|
||||||
|
echo "[sync_octopus_agent_config] - ERROR download file ${agent_config_url}/${octopus_agent_config_file} !"
|
||||||
|
echo ""
|
||||||
|
return 233
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "[sync_octopus_agent_config] - check for octopus agent config download .."
|
||||||
|
echo ""
|
||||||
|
ls ${default_octopus_agent_config_local_path}
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
main(){
|
||||||
|
|
||||||
|
sync_octopus_agent
|
||||||
|
|
||||||
|
sync_octopus_agent_config
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
|
||||||
|
services:
|
||||||
|
invidious:
|
||||||
|
#image: quay.io/invidious/invidious:latest
|
||||||
|
image: quay.io/invidious/invidious:latest-arm64 # ARM64/AArch64 devices
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:4000:3000"
|
||||||
|
environment:
|
||||||
|
# Please read the following file for a comprehensive list of all available
|
||||||
|
# configuration options and their associated syntax:
|
||||||
|
# https://github.com/iv-org/invidious/blob/master/config/config.example.yml
|
||||||
|
INVIDIOUS_CONFIG: |
|
||||||
|
db:
|
||||||
|
dbname: invidious
|
||||||
|
user: kemal
|
||||||
|
password: kemal
|
||||||
|
host: invidious-db
|
||||||
|
port: 5432
|
||||||
|
check_tables: true
|
||||||
|
# external_port:
|
||||||
|
# domain:
|
||||||
|
https_only: false
|
||||||
|
# statistics_enabled: false
|
||||||
|
hmac_key: "Aigho5thieC0ahng6Ahj"
|
||||||
|
locale: zh-CN
|
||||||
|
region: US
|
||||||
|
captions: ["Chinese (Simplified)", "English", "English (auto-generated)"]
|
||||||
|
dark_mode: "auto"
|
||||||
|
quality: hd720
|
||||||
|
volume: 70
|
||||||
|
force_resolve: ipv6
|
||||||
|
use_innertube_for_captions: true
|
||||||
|
healthcheck:
|
||||||
|
test: wget -nv --tries=1 --spider http://127.0.0.1:4000/api/v1/comments/jNQXAC9IVRw || exit 1
|
||||||
|
interval: 30s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 2
|
||||||
|
logging:
|
||||||
|
options:
|
||||||
|
max-size: "1G"
|
||||||
|
max-file: "4"
|
||||||
|
depends_on:
|
||||||
|
- invidious-db
|
||||||
|
|
||||||
|
invidious-db:
|
||||||
|
image: docker.io/library/postgres:14
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- postgresdata:/var/lib/postgresql/data
|
||||||
|
- ./config/sql:/config/sql
|
||||||
|
- ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: invidious
|
||||||
|
POSTGRES_USER: kemal
|
||||||
|
POSTGRES_PASSWORD: kemal
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgresdata:
|
||||||
|
|
||||||
|
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
enable_ipv6: true
|
||||||
|
ipam:
|
||||||
|
config:
|
||||||
|
- subnet: 2001:0DB9::/112
|
||||||
|
gateway: 2001:0DB9::1
|
||||||
|
|
||||||
|
# docker network create --driver bridge --ipv6 --subnet 2001:0DB9::/112 youtube-invidious_invidious_ip6net --attachable
|
||||||
|
# https://github.com/iv-org/smart-ipv6-rotator.
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
server {
|
||||||
|
server_name video.107421.xyz;
|
||||||
|
listen 80 ;
|
||||||
|
return 301 https://video.107421.xyz$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
server_name video.107421.xyz;
|
||||||
|
|
||||||
|
ssl_certificate /etc/nginx/conf.d/ssl_key/video.107421.xyz.cert.pem;
|
||||||
|
ssl_certificate_key /etc/nginx/conf.d/ssl_key/video.107421.xyz.key.pem;
|
||||||
|
ssl_session_timeout 1d;
|
||||||
|
ssl_session_cache shared:MozSSL:10m;
|
||||||
|
ssl_session_tickets off;
|
||||||
|
|
||||||
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||||||
|
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
|
||||||
|
ssl_prefer_server_ciphers off;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
access_log /var/log/nginx/access.log main;
|
||||||
|
client_max_body_size 5120m;
|
||||||
|
client_body_buffer_size 5120m;
|
||||||
|
client_body_timeout 6000s;
|
||||||
|
proxy_send_timeout 10000s;
|
||||||
|
proxy_read_timeout 10000s;
|
||||||
|
proxy_connect_timeout 600s;
|
||||||
|
proxy_max_temp_file_size 5120m;
|
||||||
|
proxy_request_buffering on;
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_buffer_size 4k;
|
||||||
|
proxy_buffers 4 12k;
|
||||||
|
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_pass http://127.0.0.1:4000;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export DOMAIN_NAME=video.107421.xyz
|
||||||
|
|
||||||
|
export CF_Token="oXJRP5XI8Zhipa_PtYtB_jy6qWL0I9BosrJEYE8p"
|
||||||
|
export CF_Account_ID="dfaadeb83406ef5ad35da02617af9191"
|
||||||
|
export CF_Zone_ID="511894a4f1357feb905e974e16241ebb"
|
||||||
|
|
||||||
|
acme.sh --issue --dns dns_cf -d ${DOMAIN_NAME} --keylength ec-256
|
||||||
|
acme.sh --install-cert -d ${DOMAIN_NAME} --ecc \
|
||||||
|
--key-file /etc/nginx/conf.d/ssl_key/${DOMAIN_NAME}.key.pem \
|
||||||
|
--fullchain-file /etc/nginx/conf.d/ssl_key/${DOMAIN_NAME}.cert.pem \
|
||||||
|
--reloadcmd "systemctl restart nginx --force"
|
||||||
Reference in New Issue
Block a user