feat: 将sshsvc移除
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
[Unit]
|
||||
Description=OMC SSH MML service daemon
|
||||
After=network-online.target mysql.service
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
LimitNOFILE=65535
|
||||
LimitNPROC=65535
|
||||
|
||||
Restart=always
|
||||
ExecStart=/usr/local/bin/sshsvc -c /usr/local/etc/omc/sshsvc.yaml
|
||||
RestartSec=3
|
||||
RestartPreventExitStatus=SIGTERM SIGKILL
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
ServiceList="omc sshsvc"
|
||||
ServiceList="omc"
|
||||
BinDir="/usr/local/bin"
|
||||
|
||||
# Check if the service exists
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
占位
|
||||
@@ -80,7 +80,6 @@ mkdir -p $BuildTmpDir/omc_api
|
||||
cp -rf $ApiDir/features $BuildTmpDir/omc_api
|
||||
cp -rf $ApiDir/lib $BuildTmpDir/omc_api
|
||||
cp -rf $ApiDir/src $BuildTmpDir/omc_api
|
||||
cp -rf $ApiDir/sshsvc $BuildTmpDir/omc_api
|
||||
cp -rf $ApiDir/swagger_docs $BuildTmpDir/omc_api
|
||||
cp -rf $ApiDir/go.sum $BuildTmpDir/omc_api
|
||||
cp -rf $ApiDir/go.mod $BuildTmpDir/omc_api
|
||||
|
||||
@@ -83,7 +83,6 @@ if [ -n "$BuildApi" ]; then
|
||||
find ./features -type f -name '*.go' -exec sed -i 's/[一-龥、,。?!“”()【】·]//g' {} +
|
||||
find ./lib -type f -name '*.go' -exec sed -i 's/[一-龥、,。?!“”()【】·]//g' {} +
|
||||
find ./src -type f -name '*.go' -exec sed -i 's/[一-龥、,。?!“”()【】·]//g' {} +
|
||||
find ./sshsvc -type f -name '*.go' -exec sed -i 's/[一-龥、,。?!“”()【】·]//g' {} +
|
||||
find ./build/vendor -type f -name '*.sql' -exec sed -i 's/[一-龥、,。?!“”()【】·]//g' {} +
|
||||
find ./build/vendor -type f -name '*.sql' -exec sed -i "s/'true' WHERE \`config_id\`/'false' WHERE \`config_id\`/g" {} +
|
||||
find ./build/vendor -type f -name '*.sql' -exec sed -i "s/'1' WHERE \`menu_id\`/'0' WHERE \`menu_id\`/g" {} +
|
||||
@@ -96,12 +95,6 @@ if [ -n "$BuildApi" ]; then
|
||||
cp -rf omc $output/omc
|
||||
echo "===> go build omc copy to $output"
|
||||
|
||||
# sshsvc
|
||||
cd $ApiDir/sshsvc
|
||||
make
|
||||
cp -rf sshsvc $output/sshsvc
|
||||
echo "===> go build sshsvc copy to $output"
|
||||
|
||||
# Vendor Database
|
||||
output=$BuildDir/linux/usr/local/etc/omc
|
||||
dirs="database default vendor"
|
||||
|
||||
6
pkg.sh
6
pkg.sh
@@ -84,12 +84,6 @@ if [ -n "$BuildApi" ]; then
|
||||
cp -rf omc $output/omc
|
||||
echo "===> go build omc copy to $output"
|
||||
|
||||
# sshsvc
|
||||
cd $ApiDir/sshsvc
|
||||
make
|
||||
cp -rf sshsvc $output/sshsvc
|
||||
echo "===> go build sshsvc copy to $output"
|
||||
|
||||
# Vendor Database
|
||||
output=$BuildDir/linux/usr/local/etc/omc
|
||||
dirs="database default vendor"
|
||||
|
||||
@@ -15,7 +15,6 @@ if [ ! -f $RootDir/machine.ini ]; then
|
||||
chmod +rx /usr/local/bin/omc
|
||||
cp $RootDir/default/omc.conf $RootDir/omc.conf
|
||||
cp $RootDir/default/omc.yaml $RootDir/omc.yaml
|
||||
cp $RootDir/default/sshsvc.yaml $RootDir/sshsvc.yaml
|
||||
cp $RootDir/web/default/config.js $RootDir/web/config.js
|
||||
|
||||
# read environment parameter and to do
|
||||
@@ -34,19 +33,20 @@ if [ ! -f $RootDir/machine.ini ]; then
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable omc.service
|
||||
systemctl enable sshsvc.service
|
||||
systemctl daemon-reload
|
||||
systemctl restart omc.service
|
||||
systemctl restart sshsvc.service
|
||||
else
|
||||
# Operation when upgrading
|
||||
if [ ! -f $RootDir/omc.conf ]; then
|
||||
chmod +rx /usr/local/bin/omc
|
||||
cp $RootDir/default/omc.conf $RootDir/omc.conf
|
||||
cp $RootDir/default/omc.yaml $RootDir/omc.yaml
|
||||
cp $RootDir/default/sshsvc.yaml $RootDir/sshsvc.yaml
|
||||
cp $RootDir/web/default/config.js $RootDir/web/config.js
|
||||
fi
|
||||
# Override Configuration
|
||||
if ! grep -q "# route service configuration" $RootDir/omc.yaml; then
|
||||
cp -rf $RootDir/default/omc.yaml $RootDir/omc.yaml
|
||||
fi
|
||||
|
||||
bash $RootDir/script/setup.sh -u
|
||||
if [ $? -ne 0 ]; then
|
||||
@@ -56,6 +56,5 @@ else
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl restart omc.service
|
||||
systemctl restart sshsvc.service
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -8,9 +8,7 @@ case "$1" in
|
||||
# Deletion of service files
|
||||
systemctl daemon-reload
|
||||
systemctl disable omc.service
|
||||
systemctl disable sshsvc.service
|
||||
rm -rf /lib/systemd/system/omc.service
|
||||
rm -rf /lib/systemd/system/sshsvc.service
|
||||
systemctl daemon-reload
|
||||
|
||||
# Removal of relevant documents
|
||||
|
||||
@@ -4,4 +4,3 @@
|
||||
# Stop Service
|
||||
systemctl daemon-reload
|
||||
systemctl stop omc.service
|
||||
systemctl stop sshsvc.service
|
||||
|
||||
@@ -36,10 +36,6 @@ RUN cd /api && go build -o omc -v -ldflags "-s -w \
|
||||
-X 'be.ems/src/framework/config.Version=$VERSION' \
|
||||
-X 'be.ems/src/framework/config.BuildTime=$(date)' \
|
||||
-X 'be.ems/src/framework/config.GoVer=$(go version)'"
|
||||
# RUN cd /api/sshsvc && go build -o sshsvc -v -ldflags "-s -w \
|
||||
# -X 'be.ems/lib/global.Version=$VERSION' \
|
||||
# -X 'be.ems/lib/global.BuildTime=$(date)' \
|
||||
# -X 'be.ems/lib/global.GoVer=$(go version)'"
|
||||
|
||||
|
||||
## 第三阶段 ====> 构建前后端融合镜像
|
||||
@@ -49,7 +45,6 @@ FROM alpine:3.20
|
||||
COPY --from=build-golang /linux/usr/local/etc/omc /usr/local/etc/omc
|
||||
COPY --from=build-golang /linux/usr/local/omc /usr/local/omc
|
||||
COPY --from=build-golang /api/omc /usr/local/bin/omc
|
||||
# COPY --from=build-golang /api/sshsvc/sshsvc /usr/local/bin/sshsvc
|
||||
COPY --from=build-golang /web /usr/local/etc/omc/web
|
||||
|
||||
# 更新apt并安装必要工具
|
||||
|
||||
@@ -42,10 +42,6 @@ RUN cd /api && go build -o omc -v -ldflags "-s -w \
|
||||
-X 'be.ems/src/framework/config.Version=$VERSION' \
|
||||
-X 'be.ems/src/framework/config.BuildTime=$(date)' \
|
||||
-X 'be.ems/src/framework/config.GoVer=$(go version)'"
|
||||
# RUN cd /api/sshsvc && go build -o sshsvc -v -ldflags "-s -w \
|
||||
# -X 'be.ems/lib/global.Version=$VERSION' \
|
||||
# -X 'be.ems/lib/global.BuildTime=$(date)' \
|
||||
# -X 'be.ems/lib/global.GoVer=$(go version)'"
|
||||
|
||||
|
||||
## 第三阶段 ====> 构建前后端融合镜像
|
||||
@@ -55,7 +51,6 @@ FROM ubuntu:22.04
|
||||
COPY --from=build-golang /linux/usr/local/etc/omc /usr/local/etc/omc
|
||||
COPY --from=build-golang /linux/usr/local/omc /usr/local/omc
|
||||
COPY --from=build-golang /api/omc /usr/local/bin/omc
|
||||
# COPY --from=build-golang /api/sshsvc/sshsvc /usr/local/bin/sshsvc
|
||||
COPY --from=build-golang /web /usr/local/etc/omc/web
|
||||
|
||||
# 更新apt并安装必要工具
|
||||
|
||||
@@ -13,7 +13,6 @@ set -o pipefail
|
||||
# case someone mounts a configuration file in /usr/local/etc/omc/default)
|
||||
cp -n $BASE_DIR/default/omc.conf $BASE_DIR/omc.conf
|
||||
cp -n $BASE_DIR/default/omc.yaml $BASE_DIR/omc.yaml
|
||||
# cp -n $BASE_DIR/default/sshsvc.yaml $BASE_DIR/sshsvc.yaml
|
||||
|
||||
# Initialize OMC DB
|
||||
if [ ! -f /usr/local/etc/omc/machine.ini ]; then
|
||||
|
||||
@@ -17,11 +17,10 @@ chmod +rx /usr/local/bin/omc
|
||||
# case someone mounts a configuration file in /usr/local/etc/omc/default)
|
||||
cp $BASE_DIR/default/omc.conf $BASE_DIR/omc.conf
|
||||
cp $BASE_DIR/default/omc.yaml $BASE_DIR/omc.yaml
|
||||
# cp $BASE_DIR/default/sshsvc.yaml $BASE_DIR/sshsvc.yaml
|
||||
|
||||
# OMC config
|
||||
sed -i "s/port: 33030 # http listen port/port: $API_HTTP_PORT # http listen port/" "$BASE_DIR"/omc.yaml
|
||||
sed -i "s/port: 33443 # https listen port/port: $API_HTTPS_PORT # https listen port/" "$BASE_DIR"/omc.yaml
|
||||
sed -i "s/addr: "0.0.0.0:33030" # route http port/addr: "0.0.0.0:$API_HTTP_PORT" # route http port/" "$BASE_DIR"/omc.yaml
|
||||
sed -i "s/addr: "0.0.0.0:33443" # route https port/addr: "0.0.0.0:$API_HTTPS_PORT" # route https port/" "$BASE_DIR"/omc.yaml
|
||||
sed -i 's/enabled: true # web server enabled/enabled: false # web server enabled/' "$BASE_DIR"/omc.yaml
|
||||
sed -i 's/host: "127.0.0.1" # mysql host$/host: "omc_mariadb" # mysql host/' "$BASE_DIR"/omc.yaml
|
||||
sed -i 's/port: 33066 # mysql port$/port: 3306 # mysql port/' "$BASE_DIR"/omc.yaml
|
||||
|
||||
@@ -47,7 +47,6 @@ if [ ! -f $RootDir/machine.ini ]; then
|
||||
chmod +rx /usr/local/bin/omc
|
||||
cp $RootDir/default/omc.conf $RootDir/omc.conf
|
||||
cp $RootDir/default/omc.yaml $RootDir/omc.yaml
|
||||
cp $RootDir/default/sshsvc.yaml $RootDir/sshsvc.yaml
|
||||
cp $RootDir/web/default/config.js $RootDir/web/config.js
|
||||
|
||||
# read environment parameter and to do
|
||||
@@ -66,19 +65,20 @@ if [ ! -f $RootDir/machine.ini ]; then
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable omc.service
|
||||
systemctl enable sshsvc.service
|
||||
systemctl daemon-reload
|
||||
systemctl restart omc.service
|
||||
systemctl restart sshsvc.service
|
||||
else
|
||||
# Operation when upgrading
|
||||
if [ ! -f $RootDir/omc.conf ]; then
|
||||
chmod +rx /usr/local/bin/omc
|
||||
cp $RootDir/default/omc.conf $RootDir/omc.conf
|
||||
cp $RootDir/default/omc.yaml $RootDir/omc.yaml
|
||||
cp $RootDir/default/sshsvc.yaml $RootDir/sshsvc.yaml
|
||||
cp $RootDir/web/default/config.js $RootDir/web/config.js
|
||||
fi
|
||||
# Override Configuration
|
||||
if ! grep -q "# route service configuration" $RootDir/omc.yaml; then
|
||||
cp -rf $RootDir/default/omc.yaml $RootDir/omc.yaml
|
||||
fi
|
||||
|
||||
bash $RootDir/script/setup.sh -u
|
||||
if [ $? -ne 0 ]; then
|
||||
@@ -88,7 +88,6 @@ else
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl restart omc.service
|
||||
systemctl restart sshsvc.service
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -98,7 +97,6 @@ echo ""
|
||||
# Stop Service
|
||||
systemctl daemon-reload
|
||||
systemctl stop omc.service
|
||||
systemctl stop sshsvc.service
|
||||
|
||||
|
||||
# Post-uninstallation script ========
|
||||
@@ -109,7 +107,6 @@ case "$1" in
|
||||
|
||||
# Deletion of service files
|
||||
rm -rf /lib/systemd/system/omc.service
|
||||
rm -rf /lib/systemd/system/sshsvc.service
|
||||
systemctl daemon-reload
|
||||
|
||||
# Removal of relevant documents
|
||||
|
||||
Reference in New Issue
Block a user