This commit is contained in:
8
.gitattributes
vendored
Normal file
8
.gitattributes
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
* filter=lfs diff=lfs merge=lfs -text
|
||||
*.sh !filter !diff !merge
|
||||
*.sha256 !filter !diff !merge
|
||||
.gitlab-ci.yml !filter !diff !merge
|
||||
.gitignore !filter !diff !merge
|
||||
.gitattributes !filter !diff !merge
|
||||
.github/** !filter !diff !merge
|
||||
README.md !filter !diff !merge
|
||||
1
.gitattributes.sha256
Normal file
1
.gitattributes.sha256
Normal file
@@ -0,0 +1 @@
|
||||
7c1fe4c8f56b61326c64d813552ed55041850e0d41b59c10bbedadfd02e818b4 *.gitattributes
|
||||
43
.github/workflows/checksums.yml
vendored
Normal file
43
.github/workflows/checksums.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Generate Checksums
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
jobs:
|
||||
checksums:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.ref_name }}
|
||||
persist-credentials: true
|
||||
lfs: false
|
||||
- name: Setup Git LFS
|
||||
run: |
|
||||
git lfs install --local
|
||||
AUTH=$(git config http.${{ github.server_url }}/.extraheader)
|
||||
AUTH_FILE=$(git config includeif.gitdir:/workspace/${{ github.repository }}/.git.path)
|
||||
git config -f $AUTH_FILE --unset http.${{ github.server_url }}/.extraheader
|
||||
git config -f $AUTH_FILE http.${{ github.server_url }}/${{ github.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH"
|
||||
git lfs pull
|
||||
- name: Generate checksums
|
||||
run: |
|
||||
set -e
|
||||
IFS=$'\n'
|
||||
for file in $(git ls-files | grep -v ".sha256$" | grep -v ".txt$" | grep -v "^.github/"); do
|
||||
filename=$(basename "$file");
|
||||
sha256sum -b "$file" | sed "s|$file|$filename|" > "${file}.sha256";
|
||||
done
|
||||
unset IFS
|
||||
echo "ok"
|
||||
- name: Commit changes
|
||||
run: |
|
||||
SERVER_URL=$(echo "${{ github.server_url }}" | sed 's|https\?://||')
|
||||
git remote set-url origin https://oauth2:${{ secrets.GITHUB_TOKEN }}@${SERVER_URL}/${{ github.repository }}.git
|
||||
git config --global user.name "gitea-actions"
|
||||
git config --global user.email "teabot@gitea.io"
|
||||
git add -A
|
||||
git commit -m "chore: update checksums" || true
|
||||
git push origin HEAD:${{ github.ref_name }}
|
||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.DS_Store
|
||||
.idea
|
||||
1
.gitignore.sha256
Normal file
1
.gitignore.sha256
Normal file
@@ -0,0 +1 @@
|
||||
c8ff93ff5a9942406fcab52c60206f1db1c87818a2f642ee30edc9582a65f968 *.gitignore
|
||||
1
CLAUDE.md.sha256
Normal file
1
CLAUDE.md.sha256
Normal file
@@ -0,0 +1 @@
|
||||
126c8d8a9789c1a8cb943cbe94ae0065388bbce6c3b793e046fa0fb5bb7557ad *CLAUDE.md
|
||||
1
README.md.sha256
Normal file
1
README.md.sha256
Normal file
@@ -0,0 +1 @@
|
||||
a7e1afc5505f8ddfc85bf7a61336cc2f8cb40a9c1a739579453f2cc455c99107 *README.md
|
||||
BIN
acepanel-helper-amd64
LFS
Executable file
BIN
acepanel-helper-amd64
LFS
Executable file
Binary file not shown.
1
acepanel-helper-amd64.sha256
Normal file
1
acepanel-helper-amd64.sha256
Normal file
@@ -0,0 +1 @@
|
||||
883c538f4a5304368791e428c6c3c8c1c6926bc389b834499c53db32ac7c3b35 *acepanel-helper-amd64
|
||||
BIN
acepanel-helper-arm64
LFS
Executable file
BIN
acepanel-helper-arm64
LFS
Executable file
Binary file not shown.
1
acepanel-helper-arm64.sha256
Normal file
1
acepanel-helper-arm64.sha256
Normal file
@@ -0,0 +1 @@
|
||||
ff051b980e5b25c0abd2c7f5d2ead179c1209c5df8dd5a690b39dc0dae760d2d *acepanel-helper-arm64
|
||||
BIN
acepanel.service
LFS
Normal file
BIN
acepanel.service
LFS
Normal file
Binary file not shown.
1
acepanel.service.sha256
Normal file
1
acepanel.service.sha256
Normal file
@@ -0,0 +1 @@
|
||||
62d93afe9445ffcdfbeb8d0d047c9b1a17a052b76161255af0e41b886a78e9fb *acepanel.service
|
||||
BIN
apache/apr-1.7.6.tar.gz
LFS
Normal file
BIN
apache/apr-1.7.6.tar.gz
LFS
Normal file
Binary file not shown.
1
apache/apr-1.7.6.tar.gz.sha256
Normal file
1
apache/apr-1.7.6.tar.gz.sha256
Normal file
@@ -0,0 +1 @@
|
||||
6a10e7f7430510600af25fabf466e1df61aaae910bf1dc5d10c44a4433ccc81d *apr-1.7.6.tar.gz
|
||||
BIN
apache/apr-util-1.6.3.tar.gz
LFS
Normal file
BIN
apache/apr-util-1.6.3.tar.gz
LFS
Normal file
Binary file not shown.
1
apache/apr-util-1.6.3.tar.gz.sha256
Normal file
1
apache/apr-util-1.6.3.tar.gz.sha256
Normal file
@@ -0,0 +1 @@
|
||||
2b74d8932703826862ca305b094eef2983c27b39d5c9414442e9976a9acf1983 *apr-util-1.6.3.tar.gz
|
||||
BIN
apache/httpd-2.4.66.tar.gz
LFS
Normal file
BIN
apache/httpd-2.4.66.tar.gz
LFS
Normal file
Binary file not shown.
1
apache/httpd-2.4.66.tar.gz.sha256
Normal file
1
apache/httpd-2.4.66.tar.gz.sha256
Normal file
@@ -0,0 +1 @@
|
||||
442184763b60936471b88a91275f79d2407733b7aac27e345f270e8bc31c3d49 *httpd-2.4.66.tar.gz
|
||||
317
apache/install.sh
Normal file
317
apache/install.sh
Normal file
@@ -0,0 +1,317 @@
|
||||
#!/bin/bash
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
apache_path="${setup_path}/server/apache"
|
||||
j=$(calculate_j)
|
||||
|
||||
# 安装依赖
|
||||
if [ ${OS} == "rhel" ]; then
|
||||
dnf makecache -y
|
||||
dnf groupinstall "Development Tools" -y
|
||||
dnf install cmake tar unzip pcre2-devel openssl-devel zlib-devel libxml2-devel expat-devel lua-devel libnghttp2-devel brotli-devel curl-devel jansson-devel libcurl-devel systemd-devel -y
|
||||
elif [ ${OS} == "debian" ] || [ ${OS} == "ubuntu" ]; then
|
||||
apt-get update
|
||||
apt-get install build-essential cmake tar unzip libpcre2-dev libssl-dev zlib1g-dev libxml2-dev libexpat1-dev liblua5.4-dev libnghttp2-dev libbrotli-dev libcurl4-openssl-dev libjansson-dev libsystemd-dev -y
|
||||
else
|
||||
error "Unsupported operating system"
|
||||
fi
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to install dependencies"
|
||||
fi
|
||||
|
||||
# 准备目录
|
||||
rm -rf ${apache_path}
|
||||
mkdir -p ${apache_path}
|
||||
cd ${apache_path}
|
||||
|
||||
# 下载源码
|
||||
dl "${apache_path}" "/apache/httpd-${version}.tar.gz"
|
||||
|
||||
tar -zxvf httpd-${version}.tar.gz
|
||||
rm -f httpd-${version}.tar.gz
|
||||
mv httpd-${version} src
|
||||
cd src
|
||||
|
||||
# 下载并解压 APR
|
||||
dl "${apache_path}/src/srclib" "/apache/apr-1.7.6.tar.gz"
|
||||
cd ${apache_path}/src/srclib
|
||||
tar -zxvf apr-1.7.6.tar.gz
|
||||
rm -f apr-1.7.6.tar.gz
|
||||
mv apr-1.7.6 apr
|
||||
|
||||
# 下载并解压 APR-Util
|
||||
dl "${apache_path}/src/srclib" "/apache/apr-util-1.6.3.tar.gz"
|
||||
cd ${apache_path}/src/srclib
|
||||
tar -zxvf apr-util-1.6.3.tar.gz
|
||||
rm -f apr-util-1.6.3.tar.gz
|
||||
mv apr-util-1.6.3 apr-util
|
||||
|
||||
cd ${apache_path}/src
|
||||
|
||||
# 配置编译
|
||||
./configure --prefix=${apache_path} \
|
||||
--enable-mods-shared=most \
|
||||
--with-included-apr \
|
||||
--enable-ssl \
|
||||
--enable-http2 \
|
||||
--enable-proxy \
|
||||
--enable-brotli \
|
||||
--enable-deflate \
|
||||
--enable-rewrite \
|
||||
--enable-remoteip \
|
||||
--enable-lua \
|
||||
--enable-dav \
|
||||
--enable-dav-fs \
|
||||
--enable-cache \
|
||||
--enable-cache-disk \
|
||||
--enable-socache-shmcb \
|
||||
--enable-slotmem-shm \
|
||||
--enable-watchdog \
|
||||
--enable-md \
|
||||
--enable-systemd
|
||||
|
||||
if [ "$?" != "0" ]; then
|
||||
rm -rf ${apache_path}
|
||||
error "Configure failed"
|
||||
fi
|
||||
|
||||
make "-j${j}"
|
||||
if [ "$?" != "0" ]; then
|
||||
rm -rf ${apache_path}
|
||||
error "Compilation failed"
|
||||
fi
|
||||
|
||||
make install
|
||||
if [ ! -f "${apache_path}/bin/httpd" ]; then
|
||||
rm -rf ${apache_path}
|
||||
error "Installation failed"
|
||||
fi
|
||||
|
||||
cd ${apache_path}
|
||||
|
||||
# 设置软链接
|
||||
ln -sf ${apache_path}/bin/httpd /usr/local/bin/httpd
|
||||
ln -sf ${apache_path}/bin/apachectl /usr/local/bin/apachectl
|
||||
|
||||
# 创建站点目录
|
||||
mkdir -p ${setup_path}/sites
|
||||
chmod -R 755 ${setup_path}/sites
|
||||
|
||||
# 修改默认配置
|
||||
sed -i "s|#ServerName www.example.com:80|ServerName 0.0.0.0:80|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|User daemon|User www|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|Group daemon|Group www|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|DirectoryIndex index.html|DirectoryIndex index.php index.html|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|AllowOverride none|AllowOverride All|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|AllowOverride None|AllowOverride All|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|Require all denied|Require all granted|" ${apache_path}/conf/httpd.conf
|
||||
|
||||
# 启用模块
|
||||
sed -i "s|#LoadModule deflate_module|LoadModule deflate_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule brotli_module|LoadModule brotli_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule expires_module|LoadModule expires_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule rewrite_module|LoadModule rewrite_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule ssl_module|LoadModule ssl_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule socache_shmcb_module|LoadModule socache_shmcb_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule http2_module|LoadModule http2_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule proxy_module|LoadModule proxy_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule proxy_connect_module|LoadModule proxy_connect_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule proxy_http_module|LoadModule proxy_http_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule proxy_http2_module|LoadModule proxy_http2_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule proxy_fcgi_module|LoadModule proxy_fcgi_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule proxy_scgi_module|LoadModule proxy_scgi_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule proxy_uwsgi_module|LoadModule proxy_uwsgi_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule proxy_fdpass_module|LoadModule proxy_fdpass_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule proxy_wstunnel_module|LoadModule proxy_wstunnel_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule proxy_balancer_module|LoadModule proxy_balancer_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule proxy_hcheck_module|LoadModule proxy_hcheck_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule slotmem_shm_module|LoadModule slotmem_shm_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule remoteip_module|LoadModule remoteip_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule lua_module|LoadModule lua_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule dav_module|LoadModule dav_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule dav_fs_module|LoadModule dav_fs_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule dav_lock_module|LoadModule dav_lock_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule cache_module|LoadModule cache_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule cache_disk_module|LoadModule cache_disk_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule cache_socache_module|LoadModule cache_socache_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule lbmethod_byrequests_module|LoadModule lbmethod_byrequests_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule lbmethod_bytraffic_module|LoadModule lbmethod_bytraffic_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule lbmethod_bybusyness_module|LoadModule lbmethod_bybusyness_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule lbmethod_heartbeat_module|LoadModule lbmethod_heartbeat_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule watchdog_module|LoadModule watchdog_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule md_module|LoadModule md_module|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#LoadModule systemd_module|LoadModule systemd_module|" ${apache_path}/conf/httpd.conf
|
||||
|
||||
# 安全增强
|
||||
sed -i "s|^ServerTokens.*|ServerTokens Prod|" ${apache_path}/conf/extra/httpd-default.conf
|
||||
sed -i "s|^ServerSignature.*|ServerSignature Off|" ${apache_path}/conf/extra/httpd-default.conf
|
||||
echo "TraceEnable Off" >>${apache_path}/conf/extra/httpd-default.conf
|
||||
|
||||
# 启用额外配置
|
||||
sed -i "s|#Include conf/extra/httpd-default.conf|Include conf/extra/httpd-default.conf|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#Include conf/extra/httpd-mpm.conf|Include conf/extra/httpd-mpm.conf|" ${apache_path}/conf/httpd.conf
|
||||
sed -i "s|#Include conf/extra/httpd-ssl.conf|Include conf/extra/httpd-ssl.conf|" ${apache_path}/conf/httpd.conf
|
||||
|
||||
# 生成自签名证书
|
||||
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \
|
||||
-keyout ${apache_path}/conf/server.key \
|
||||
-out ${apache_path}/conf/server.crt \
|
||||
-subj "/C=US/ST=State/L=City/O=AcePanel/CN=localhost" \
|
||||
-addext "basicConstraints=CA:FALSE" \
|
||||
-addext "subjectAltName=DNS:localhost,IP:127.0.0.1"
|
||||
|
||||
# 修改 SSL 虚拟主机 ServerName
|
||||
sed -i "s|ServerName www.example.com:443|ServerName localhost:443|" ${apache_path}/conf/extra/httpd-ssl.conf
|
||||
|
||||
# 追加自定义配置
|
||||
cat >>${apache_path}/conf/httpd.conf <<CONF
|
||||
<IfModule http2_module>
|
||||
ProtocolsHonorOrder On
|
||||
Protocols h2 h2c http/1.1
|
||||
</IfModule>
|
||||
|
||||
<IfModule remoteip_module>
|
||||
RemoteIPHeader X-Forwarded-For
|
||||
RemoteIPInternalProxy 127.0.0.1
|
||||
RemoteIPInternalProxy ::1
|
||||
</IfModule>
|
||||
|
||||
<IfModule deflate_module>
|
||||
SetOutputFilter DEFLATE
|
||||
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|ico|webp|avif|bmp|tiff?)$ no-gzip dont-vary
|
||||
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|7z|xz|lz|lzma|zst|br|cab|arj)$ no-gzip dont-vary
|
||||
SetEnvIfNoCase Request_URI \.(?:iso|dmg|img|apk|ipa|deb|rpm|msi|pkg|appimage)$ no-gzip dont-vary
|
||||
SetEnvIfNoCase Request_URI \.(?:pdf|mov|avi|mp[34]|rm|flv|swf|wmv|mkv|webm|m4[av]|ogg|ogv|opus)$ no-gzip dont-vary
|
||||
SetEnvIfNoCase Request_URI \.(?:mp3|aac|flac|wav|wma|m4a|mid|midi)$ no-gzip dont-vary
|
||||
SetEnvIfNoCase Request_URI \.(?:woff2?|ttf|otf|eot)$ no-gzip dont-vary
|
||||
DeflateCompressionLevel 6
|
||||
</IfModule>
|
||||
|
||||
<IfModule brotli_module>
|
||||
SetOutputFilter BROTLI_COMPRESS
|
||||
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|ico|webp|avif|bmp|tiff?)$ no-brotli
|
||||
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|7z|xz|lz|lzma|zst|br|cab|arj)$ no-brotli
|
||||
SetEnvIfNoCase Request_URI \.(?:iso|dmg|img|apk|ipa|deb|rpm|msi|pkg|appimage)$ no-brotli
|
||||
SetEnvIfNoCase Request_URI \.(?:pdf|mov|avi|mp[34]|rm|flv|swf|wmv|mkv|webm|m4[av]|ogg|ogv|opus)$ no-brotli
|
||||
SetEnvIfNoCase Request_URI \.(?:mp3|aac|flac|wav|wma|m4a|mid|midi)$ no-brotli
|
||||
SetEnvIfNoCase Request_URI \.(?:woff2?|ttf|otf|eot)$ no-brotli
|
||||
BrotliCompressionQuality 6
|
||||
</IfModule>
|
||||
|
||||
<Location /server_status>
|
||||
SetHandler server-status
|
||||
Require ip 127.0.0.1 ::1
|
||||
</Location>
|
||||
|
||||
<LocationMatch "^/phpfpm_status/(?<phpver>[0-9]+)$">
|
||||
Require ip 127.0.0.1 ::1
|
||||
|
||||
SetHandler "proxy:unix:/tmp/php-cgi-%{env:MATCH_PHPVER}.sock|fcgi://localhost/"
|
||||
|
||||
ProxyFCGISetEnvIf "true" SCRIPT_NAME "/phpfpm_status/%{env:MATCH_PHPVER}"
|
||||
ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "/phpfpm_status/%{env:MATCH_PHPVER}"
|
||||
</LocationMatch>
|
||||
|
||||
IncludeOptional conf/extra/acme.conf
|
||||
IncludeOptional ${setup_path}/sites/*/config/*.conf
|
||||
CONF
|
||||
|
||||
touch ${apache_path}/conf/extra/acme.conf
|
||||
|
||||
# 修改 SSL 配置
|
||||
sed -i "s|^SSLProtocol.*|SSLProtocol -all +TLSv1.2 +TLSv1.3|" ${apache_path}/conf/extra/httpd-ssl.conf
|
||||
sed -i "s|^SSLProxyProtocol.*|SSLProxyProtocol -all +TLSv1.2 +TLSv1.3|" ${apache_path}/conf/extra/httpd-ssl.conf
|
||||
sed -i "s|^SSLCipherSuite.*|SSLCipherSuite 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:DHE-RSA-CHACHA20-POLY1305|" ${apache_path}/conf/extra/httpd-ssl.conf
|
||||
sed -i "s|^SSLProxyCipherSuite.*|SSLProxyCipherSuite 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:DHE-RSA-CHACHA20-POLY1305|" ${apache_path}/conf/extra/httpd-ssl.conf
|
||||
sed -i "s|^SSLHonorCipherOrder.*|SSLHonorCipherOrder off|" ${apache_path}/conf/extra/httpd-ssl.conf
|
||||
|
||||
# 写入默认站点页
|
||||
cat >${apache_path}/htdocs/index.html <<EOF
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>AcePanel</title>
|
||||
<style>body{background:#f2f3f5;margin:0;padding:20px;font-family:system-ui,sans-serif}.container{max-width:600px;margin:3em auto;background:#fff;padding:40px;border-radius:12px;box-shadow:0 4px 12px rgba(0,0,0,.05)}h1{font-size:3em;font-weight:600;margin:0 0 30px;color:#1a1a1a}p{color:#5a5a5a;line-height:1.6}a{text-decoration:none;color:#333;font-weight:600}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>AcePanel</h1>
|
||||
<p>This is the default page of AcePanel!</p>
|
||||
<p>You see this page because the requested website was not found on this server.</p>
|
||||
<p><em>Powered by <a target="_blank" href="https://acepanel.net">AcePanel</a></em></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
|
||||
# 写入站点停止页
|
||||
cat >${apache_path}/htdocs/stop.html <<EOF
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-Hans">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>AcePanel</title>
|
||||
<style>body{background:#f2f3f5;margin:0;padding:20px;font-family:system-ui,sans-serif}.container{max-width:600px;margin:3em auto;background:#fff;padding:40px;border-radius:12px;box-shadow:0 4px 12px rgba(0,0,0,.05)}h1{font-size:3em;font-weight:600;margin:0 0 30px;color:#1a1a1a}p{color:#5a5a5a;line-height:1.6}a{text-decoration:none;color:#333;font-weight:600}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Website Suspended</h1>
|
||||
<p>You see this page because the website has been stopped by the server administrator.</p>
|
||||
<p><em>Powered by <a target="_blank" href="https://acepanel.net">AcePanel</a></em></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
|
||||
# 处理文件权限
|
||||
chmod -R 755 ${apache_path}
|
||||
chmod -R 600 ${apache_path}/conf
|
||||
chown -R www:www ${apache_path}/logs
|
||||
|
||||
# 写入服务文件
|
||||
cat >/etc/systemd/system/apache.service <<CONF
|
||||
[Unit]
|
||||
Description=The Apache HTTP Server
|
||||
After=network.target remote-fs.target nss-lookup.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
ExecStart=${apache_path}/bin/httpd -DFOREGROUND
|
||||
ExecReload=${apache_path}/bin/httpd -k graceful
|
||||
ExecStop=${apache_path}/bin/httpd -k graceful-stop
|
||||
KillSignal=SIGWINCH
|
||||
KillMode=mixed
|
||||
PrivateTmp=false
|
||||
LimitNOFILE=500000
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
CONF
|
||||
|
||||
chmod 644 /etc/systemd/system/apache.service
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now apache
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
|
||||
acepanel app write apache ${channel} ${version}
|
||||
acepanel setting write webserver apache
|
||||
|
||||
echo -e $HR
|
||||
echo "Installation successful"
|
||||
echo -e $HR
|
||||
1
apache/install.sh.sha256
Normal file
1
apache/install.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
33172fc3f14998093bedf2ea6a066623a9e5e9b458abe5aee8d94762eb4ab671 *install.sh
|
||||
22
apache/uninstall.sh
Normal file
22
apache/uninstall.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
systemctl stop apache
|
||||
systemctl disable apache
|
||||
rm -f /etc/systemd/system/apache.service
|
||||
systemctl daemon-reload
|
||||
rm -rf ${setup_path}/server/apache
|
||||
rm -f /usr/local/bin/httpd
|
||||
rm -f /usr/local/bin/apachectl
|
||||
|
||||
acepanel app remove apache
|
||||
acepanel setting remove webserver
|
||||
|
||||
echo -e $HR
|
||||
echo "Uninstallation successful"
|
||||
echo -e $HR
|
||||
1
apache/uninstall.sh.sha256
Normal file
1
apache/uninstall.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
4405bcb6211780c1730b14eff52c0843076df8cdf06a2d1a3fea2865aef92b5a *uninstall.sh
|
||||
96
apache/update.sh
Normal file
96
apache/update.sh
Normal file
@@ -0,0 +1,96 @@
|
||||
#!/bin/bash
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
apache_path="${setup_path}/server/apache"
|
||||
j=$(calculate_j)
|
||||
|
||||
if [ ! -d "${apache_path}" ]; then
|
||||
error "Apache is not installed"
|
||||
fi
|
||||
|
||||
# 清理旧源码
|
||||
rm -rf ${apache_path}/src
|
||||
|
||||
# 下载新源码
|
||||
dl "${apache_path}" "/apache/httpd-${version}.tar.gz"
|
||||
|
||||
cd ${apache_path}
|
||||
tar -zxvf httpd-${version}.tar.gz
|
||||
rm -f httpd-${version}.tar.gz
|
||||
mv httpd-${version} src
|
||||
cd src
|
||||
|
||||
# 下载并解压 APR
|
||||
dl "${apache_path}/src/srclib" "/apache/apr-1.7.6.tar.gz"
|
||||
cd ${apache_path}/src/srclib
|
||||
tar -zxvf apr-1.7.6.tar.gz
|
||||
rm -f apr-1.7.6.tar.gz
|
||||
mv apr-1.7.6 apr
|
||||
|
||||
# 下载并解压 APR-Util
|
||||
dl "${apache_path}/src/srclib" "/apache/apr-util-1.6.3.tar.gz"
|
||||
cd ${apache_path}/src/srclib
|
||||
tar -zxvf apr-util-1.6.3.tar.gz
|
||||
rm -f apr-util-1.6.3.tar.gz
|
||||
mv apr-util-1.6.3 apr-util
|
||||
|
||||
cd ${apache_path}/src
|
||||
|
||||
# 配置编译
|
||||
./configure --prefix=${apache_path} \
|
||||
--enable-mods-shared=most \
|
||||
--with-included-apr \
|
||||
--enable-ssl \
|
||||
--enable-http2 \
|
||||
--enable-proxy \
|
||||
--enable-brotli \
|
||||
--enable-deflate \
|
||||
--enable-rewrite \
|
||||
--enable-remoteip \
|
||||
--enable-lua \
|
||||
--enable-dav \
|
||||
--enable-dav-fs \
|
||||
--enable-cache \
|
||||
--enable-cache-disk \
|
||||
--enable-socache-shmcb \
|
||||
--enable-slotmem-shm \
|
||||
--enable-watchdog \
|
||||
--enable-md \
|
||||
--enable-systemd
|
||||
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Configure failed"
|
||||
fi
|
||||
|
||||
make "-j${j}"
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Compilation failed"
|
||||
fi
|
||||
|
||||
# 停止服务
|
||||
systemctl stop apache
|
||||
|
||||
make install
|
||||
if [ ! -f "${apache_path}/bin/httpd" ]; then
|
||||
systemctl start apache
|
||||
error "Installation failed"
|
||||
fi
|
||||
|
||||
# 重启服务
|
||||
systemctl start apache
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
|
||||
acepanel app write apache ${channel} ${version}
|
||||
|
||||
echo -e $HR
|
||||
echo "Upgrade successful"
|
||||
echo -e $HR
|
||||
1
apache/update.sh.sha256
Normal file
1
apache/update.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
bca952d055c2063e40338732e70cf52e30f809e41c5273fc25be1cb692dadbe4 *update.sh
|
||||
38
auto_update.sh
Normal file
38
auto_update.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ${OS} == "unknown" ]; then
|
||||
error "The system does not support installing the panel"
|
||||
fi
|
||||
|
||||
old_version=$(acepanel setting get version)
|
||||
old_version=${old_version#v}
|
||||
panel_path="${setup_path}/panel"
|
||||
|
||||
# 大于
|
||||
function version_gt() { test "$(echo -e "$1\n$2" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
|
||||
# 小于
|
||||
function version_lt() { test "$(echo -e "$1\n$2" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
|
||||
# 大于等于
|
||||
function version_ge() { test "$(echo -e "$1\n$2" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
|
||||
# 小于等于
|
||||
function version_le() { test "$(echo -e "$1\n$2" | tr " " "\n" | sort -V | head -n 1)" == "$1"; }
|
||||
|
||||
# 判断版本号是否合法
|
||||
version_pattern="^[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta|rc)\.[0-9]+)?$"
|
||||
if [[ ! $old_version =~ $version_pattern ]]; then
|
||||
error "The panel version number is invalid"
|
||||
fi
|
||||
|
||||
echo $HR
|
||||
|
||||
# TODO
|
||||
|
||||
echo $HR
|
||||
echo "Update finished"
|
||||
1
auto_update.sh.sha256
Normal file
1
auto_update.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
1e9338b2609389cd106b3c73d6d7f3e2afaa57a38843629e65245d0e25700599 *auto_update.sh
|
||||
BIN
code-server/code-server-4.108.1-linux-amd64.7z
LFS
Normal file
BIN
code-server/code-server-4.108.1-linux-amd64.7z
LFS
Normal file
Binary file not shown.
1
code-server/code-server-4.108.1-linux-amd64.7z.sha256
Normal file
1
code-server/code-server-4.108.1-linux-amd64.7z.sha256
Normal file
@@ -0,0 +1 @@
|
||||
45c057ed0e7eec1c3f2d4dc7a3a5e01b53987a51907ec32ee94e57d9784be85c *code-server-4.108.1-linux-amd64.7z
|
||||
BIN
code-server/code-server-4.108.1-linux-arm64.7z
LFS
Normal file
BIN
code-server/code-server-4.108.1-linux-arm64.7z
LFS
Normal file
Binary file not shown.
1
code-server/code-server-4.108.1-linux-arm64.7z.sha256
Normal file
1
code-server/code-server-4.108.1-linux-arm64.7z.sha256
Normal file
@@ -0,0 +1 @@
|
||||
fd0ae85527fff548996d70c15031fed8adc76aa78825b988840e6d12d9c85bfc *code-server-4.108.1-linux-arm64.7z
|
||||
90
code-server/install.sh
Normal file
90
code-server/install.sh
Normal file
@@ -0,0 +1,90 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
code_server_path="${setup_path}/server/code-server"
|
||||
|
||||
if [ ! -d "${code_server_path}" ]; then
|
||||
mkdir -p ${code_server_path}
|
||||
fi
|
||||
|
||||
# 架构判断
|
||||
if [ ${ARCH} == "x86_64" ]; then
|
||||
code_server_file="code-server-${version}-linux-amd64.7z"
|
||||
elif [ ${ARCH} == "aarch64" ]; then
|
||||
code_server_file="code-server-${version}-linux-arm64.7z"
|
||||
else
|
||||
error "Unsupported architecture"
|
||||
fi
|
||||
|
||||
# 下载
|
||||
cd ${code_server_path}
|
||||
dl "${code_server_path}" "/code-server/${code_server_file}"
|
||||
|
||||
# 解压
|
||||
cd ${code_server_path}
|
||||
7z x ${code_server_file}
|
||||
rm -f ${code_server_file}
|
||||
if [ ! -f "${code_server_path}/bin/code-server" ]; then
|
||||
rm -rf ${code_server_path}
|
||||
error "code-server extraction failed"
|
||||
fi
|
||||
|
||||
# 初始化目录
|
||||
chown -R root:root ${code_server_path}
|
||||
chmod -R 700 ${code_server_path}
|
||||
ln -sf ${code_server_path}/bin/code-server /usr/local/bin/code-server
|
||||
|
||||
# 写入配置
|
||||
password=$(cat /dev/urandom | head -n 16 | sha256sum | head -c 16)
|
||||
cat >/root/.config/code-server/config.yaml <<EOF
|
||||
bind-addr: 0.0.0.0:9999
|
||||
auth: password
|
||||
password: ${password}
|
||||
cert: true
|
||||
EOF
|
||||
chmod 600 /root/.config/code-server/config.yaml
|
||||
|
||||
# 配置systemd
|
||||
cat >/etc/systemd/system/code-server.service <<EOF
|
||||
[Unit]
|
||||
Description=VS Code in the browser
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
Group=root
|
||||
|
||||
WorkingDirectory=${code_server_path}
|
||||
ExecStart=/usr/local/bin/code-server --disable-telemetry
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
chmod 644 /etc/systemd/system/code-server.service
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now code-server
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
|
||||
# 防火墙
|
||||
firewall-cmd --zone=public --add-port=9999/tcp --permanent
|
||||
firewall-cmd --reload
|
||||
|
||||
acepanel app write codeserver ${channel} ${version}
|
||||
|
||||
echo -e $HR
|
||||
echo "Installation successful"
|
||||
echo "默认端口 9999,密码见配置文件"
|
||||
echo "Default port 9999, password in config file"
|
||||
echo -e $HR
|
||||
1
code-server/install.sh.sha256
Normal file
1
code-server/install.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
2393bb4f7f2604f9018c5803b2ad78a66ec6a0c0bf7330d947b081ce96083593 *install.sh
|
||||
23
code-server/uninstall.sh
Normal file
23
code-server/uninstall.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
code_server_path="${setup_path}/server/code-server"
|
||||
|
||||
systemctl stop code-server
|
||||
systemctl disable code-server
|
||||
|
||||
rm -f /usr/local/bin/code-server
|
||||
rm -rf ${code_server_path}
|
||||
rm -f /etc/systemd/system/code-server.service
|
||||
systemctl daemon-reload
|
||||
|
||||
acepanel app remove codeserver
|
||||
echo -e $HR
|
||||
echo "Uninstall successful"
|
||||
echo -e $HR
|
||||
1
code-server/uninstall.sh.sha256
Normal file
1
code-server/uninstall.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
cc73a6f78be813051aba09d1fc407ead37e22a4e30e50de75847b1d0b74498cf *uninstall.sh
|
||||
54
code-server/update.sh
Normal file
54
code-server/update.sh
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
code_server_path="${setup_path}/server/code-server"
|
||||
|
||||
if [ ! -d "${code_server_path}" ]; then
|
||||
mkdir -p ${code_server_path}
|
||||
fi
|
||||
|
||||
# 架构判断
|
||||
if [ ${ARCH} == "x86_64" ]; then
|
||||
code_server_file="code-server-${version}-linux-amd64.7z"
|
||||
elif [ ${ARCH} == "aarch64" ]; then
|
||||
code_server_file="code-server-${version}-linux-arm64.7z"
|
||||
else
|
||||
error "Unsupported architecture"
|
||||
fi
|
||||
|
||||
# 下载
|
||||
systemctl stop code-server
|
||||
cd ${code_server_path}
|
||||
rm -rf ${code_server_path}/*
|
||||
dl "${code_server_path}" "/code-server/${code_server_file}"
|
||||
|
||||
# 解压
|
||||
cd ${code_server_path}
|
||||
7z x ${code_server_file}
|
||||
rm -f ${code_server_file}
|
||||
if [ ! -f "${code_server_path}/bin/code-server" ]; then
|
||||
rm -rf ${code_server_path}
|
||||
error "code-server extraction failed"
|
||||
fi
|
||||
|
||||
# 初始化目录
|
||||
chown -R root:root ${code_server_path}
|
||||
chmod -R 700 ${code_server_path}
|
||||
systemctl start code-server
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
|
||||
acepanel app write codeserver ${channel} ${version}
|
||||
|
||||
echo -e $HR
|
||||
echo "Upgrade successful"
|
||||
echo -e $HR
|
||||
1
code-server/update.sh.sha256
Normal file
1
code-server/update.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
d4a4263ebecf90138ca492250444b408f60cbbfdd1df1b418b73947660f2fbed *update.sh
|
||||
49
docker/install.sh
Normal file
49
docker/install.sh
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
in_china=$(curl --retry 2 -m 10 -L -k https://www.qualcomm.cn/cdn-cgi/trace 2>/dev/null | grep -qx 'loc=CN' && echo "true" || echo "false")
|
||||
|
||||
if [ ${OS} == "rhel" ]; then
|
||||
dnf makecache -y
|
||||
dnf remove -y docker* containerd.io podman* runc
|
||||
elif [ ${OS} == "debian" ] || [ ${OS} == "ubuntu" ]; then
|
||||
apt-get update
|
||||
apt-get remove -y docker* containerd.io podman* runc
|
||||
apt-get autoremove -y
|
||||
else
|
||||
error "Unsupported operating system"
|
||||
fi
|
||||
|
||||
if ${in_china}; then
|
||||
bash <(curl -f -s --connect-timeout 10 --retry 3 https://linuxmirrors.cn/docker-lite.sh) --source mirrors.tencent.com/docker-ce --source-registry docker.1ms.run --protocol https --install-latest true --close-firewall false
|
||||
else
|
||||
bash <(curl -f -s --connect-timeout 10 --retry 3 https://linuxmirrors.cn/docker-lite.sh) --source download.docker.com --source-registry docker.1ms.run --protocol https --install-latest true --close-firewall false
|
||||
# 海外不需要镜像加速
|
||||
echo "" >/etc/docker/daemon.json
|
||||
fi
|
||||
|
||||
sleep 5 # 不等久一点的话可能会报错启动太快
|
||||
systemctl restart docker
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
error "Installation failed"
|
||||
fi
|
||||
|
||||
# 创建编排目录
|
||||
mkdir -p ${setup_path}/compose
|
||||
# 创建acepanel网络
|
||||
docker network create --label created_by=acepanel acepanel-network
|
||||
|
||||
acepanel app write docker ${channel} ${version}
|
||||
|
||||
echo -e ${HR}
|
||||
echo "Installation successful"
|
||||
echo -e ${HR}
|
||||
1
docker/install.sh.sha256
Normal file
1
docker/install.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
c1641541ef2c25c2003daa7c4010a1259e725d74554f93c039fddd01c1f8788e *install.sh
|
||||
26
docker/uninstall.sh
Normal file
26
docker/uninstall.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
systemctl stop docker
|
||||
systemctl disable docker
|
||||
|
||||
if [ ${OS} == "rhel" ]; then
|
||||
dnf remove -y docker* containerd.io podman* runc
|
||||
elif [ ${OS} == "debian" ] || [ ${OS} == "ubuntu" ]; then
|
||||
apt-get remove -y docker* containerd.io podman* runc
|
||||
apt-get autoremove -y
|
||||
else
|
||||
error "Unsupported operating system"
|
||||
fi
|
||||
|
||||
acepanel app remove docker
|
||||
|
||||
echo -e $HR
|
||||
echo "Uninstall successful"
|
||||
echo -e $HR
|
||||
1
docker/uninstall.sh.sha256
Normal file
1
docker/uninstall.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
f21726f0daf4192339ea3165ab7c88b00bd6825051149563badee6b680ddd64d *uninstall.sh
|
||||
34
docker/update.sh
Normal file
34
docker/update.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
|
||||
if [ ${OS} == "rhel" ]; then
|
||||
dnf makecache -y
|
||||
dnf update docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||
elif [ ${OS} == "debian" ] || [ ${OS} == "ubuntu" ]; then
|
||||
apt-get update
|
||||
apt-get upgrade docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||
else
|
||||
error "Unsupported operating system"
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
error "Upgrade failed"
|
||||
fi
|
||||
|
||||
sleep 5 # 不等久一点的话可能会报错启动太快
|
||||
systemctl restart docker
|
||||
|
||||
acepanel app write docker ${channel} ${version}
|
||||
|
||||
echo -e ${HR}
|
||||
echo "Upgrade successful"
|
||||
echo -e ${HR}
|
||||
1
docker/update.sh.sha256
Normal file
1
docker/update.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
516a795643dbd420dcbcd0a5e38e919ef0843be02a63dcb444a2130c1a3c03ae *update.sh
|
||||
59
fail2ban/install.sh
Normal file
59
fail2ban/install.sh
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
|
||||
if [ ${OS} == "rhel" ]; then
|
||||
dnf install -y fail2ban python3-systemd
|
||||
elif [ ${OS} == "debian" ] || [ ${OS} == "ubuntu" ]; then
|
||||
apt-get install -y fail2ban python3-systemd
|
||||
else
|
||||
error "Unsupported operating system"
|
||||
fi
|
||||
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Installation failed"
|
||||
fi
|
||||
|
||||
# 修改 fail2ban 配置文件
|
||||
cat >/etc/fail2ban/jail.local <<EOF
|
||||
[DEFAULT]
|
||||
backend = systemd
|
||||
logtarget = SYSTEMD-JOURNAL
|
||||
ignoreip = 127.0.0.1/8
|
||||
bantime = 600
|
||||
findtime = 300
|
||||
maxretry = 5
|
||||
banaction = firewallcmd-rich-rules
|
||||
banaction_allports = firewallcmd-rich-rules
|
||||
|
||||
# ssh-START
|
||||
[ssh]
|
||||
enabled = true
|
||||
filter = sshd
|
||||
port = 22
|
||||
maxretry = 5
|
||||
findtime = 300
|
||||
bantime = 86400
|
||||
# ssh-END
|
||||
EOF
|
||||
# 替换端口
|
||||
ssh=$(cat /etc/ssh/sshd_config | grep 'Port ' | awk '{print $2}')
|
||||
if [ "${ssh}" == "" ]; then
|
||||
ssh="22"
|
||||
fi
|
||||
sed -i "s/port = 22/port = ${ssh}/g" /etc/fail2ban/jail.local
|
||||
|
||||
# 启动 fail2ban
|
||||
systemctl daemon-reload
|
||||
systemctl unmask fail2ban
|
||||
systemctl enable --now fail2ban
|
||||
|
||||
acepanel app write fail2ban ${channel} ${version}
|
||||
1
fail2ban/install.sh.sha256
Normal file
1
fail2ban/install.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
0aeb3e07296b49c031ada69c095b1fcdfda7db4b4e9f6055de59f8387ef0f6d0 *install.sh
|
||||
25
fail2ban/uninstall.sh
Normal file
25
fail2ban/uninstall.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fail2ban-client unban --all
|
||||
fail2ban-client stop
|
||||
systemctl stop fail2ban
|
||||
systemctl disable fail2ban
|
||||
|
||||
if [ ${OS} == "rhel" ]; then
|
||||
dnf remove -y fail2ban
|
||||
elif [ ${OS} == "debian" ] || [ ${OS} == "ubuntu" ]; then
|
||||
apt-get purge -y fail2ban
|
||||
else
|
||||
error "Unsupported operating system"
|
||||
fi
|
||||
|
||||
rm -rf /etc/fail2ban
|
||||
|
||||
acepanel app remove fail2ban
|
||||
1
fail2ban/uninstall.sh.sha256
Normal file
1
fail2ban/uninstall.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
ad7a6bc1013dfc3003e07f2cafd917c7b23fe6a6ceb61fade772dd4a6c4dfa2b *uninstall.sh
|
||||
27
fail2ban/update.sh
Normal file
27
fail2ban/update.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
|
||||
if [ ${OS} == "rhel" ]; then
|
||||
dnf update -y fail2ban
|
||||
elif [ ${OS} == "debian" ] || [ ${OS} == "ubuntu" ]; then
|
||||
apt-get install --only-upgrade -y fail2ban
|
||||
else
|
||||
error "Unsupported operating system"
|
||||
fi
|
||||
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Update failed"
|
||||
fi
|
||||
|
||||
systemctl restart fail2ban
|
||||
|
||||
acepanel app write fail2ban ${channel} ${version}
|
||||
1
fail2ban/update.sh.sha256
Normal file
1
fail2ban/update.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
c10e54cabfaa447466d16d93585e274e189ca36ec5f2d24bb10c02d002d36525 *update.sh
|
||||
BIN
frp/frp_0.66.0_linux_amd64.7z
LFS
Normal file
BIN
frp/frp_0.66.0_linux_amd64.7z
LFS
Normal file
Binary file not shown.
1
frp/frp_0.66.0_linux_amd64.7z.sha256
Normal file
1
frp/frp_0.66.0_linux_amd64.7z.sha256
Normal file
@@ -0,0 +1 @@
|
||||
8d6f7ddfa41054ffb06233e0dabac4b82d7cc75ac46542f7405bb321e37a411e *frp_0.66.0_linux_amd64.7z
|
||||
BIN
frp/frp_0.66.0_linux_arm64.7z
LFS
Normal file
BIN
frp/frp_0.66.0_linux_arm64.7z
LFS
Normal file
Binary file not shown.
1
frp/frp_0.66.0_linux_arm64.7z.sha256
Normal file
1
frp/frp_0.66.0_linux_arm64.7z.sha256
Normal file
@@ -0,0 +1 @@
|
||||
e83f04b87817fc745a2a4a14d462a0acf563f4aa3af1d333ed953573a4adc9ed *frp_0.66.0_linux_arm64.7z
|
||||
91
frp/install.sh
Normal file
91
frp/install.sh
Normal file
@@ -0,0 +1,91 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
frp_path="${setup_path}/server/frp"
|
||||
|
||||
if [ ! -d "${frp_path}" ]; then
|
||||
mkdir -p ${frp_path}
|
||||
fi
|
||||
|
||||
# 架构判断
|
||||
if [ ${ARCH} == "x86_64" ]; then
|
||||
frp_file="frp_${version}_linux_amd64.7z"
|
||||
elif [ ${ARCH} == "aarch64" ]; then
|
||||
frp_file="frp_${version}_linux_arm64.7z"
|
||||
else
|
||||
error "Unsupported architecture"
|
||||
fi
|
||||
|
||||
# 下载frp
|
||||
cd ${frp_path}
|
||||
dl "${frp_path}" "/frp/${frp_file}"
|
||||
|
||||
# 解压frp
|
||||
cd ${frp_path}
|
||||
7z x ${frp_file}
|
||||
chown -R www:www ${frp_path}
|
||||
chmod -R 700 ${frp_path}
|
||||
|
||||
# 配置systemd
|
||||
cat >/etc/systemd/system/frps.service <<EOF
|
||||
[Unit]
|
||||
Description=Frp Server Service
|
||||
After=network.target syslog.target
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
User=www
|
||||
Group=www
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
ExecStart=${setup_path}/server/frp/frps -c ${setup_path}/server/frp/frps.toml
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
cat >/etc/systemd/system/frpc.service <<EOF
|
||||
[Unit]
|
||||
Description=Frp Client Service
|
||||
After=network.target syslog.target
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
User=www
|
||||
Group=www
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
ExecStart=${setup_path}/server/frp/frpc -c ${setup_path}/server/frp/frpc.toml
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
chmod 644 /etc/systemd/system/frps.service
|
||||
chmod 644 /etc/systemd/system/frpc.service
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now frps
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
systemctl enable --now frpc
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
|
||||
acepanel app write frp ${channel} ${version}
|
||||
|
||||
echo -e ${HR}
|
||||
echo "Installation successful"
|
||||
echo -e ${HR}
|
||||
1
frp/install.sh.sha256
Normal file
1
frp/install.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
b414f154283987392f3a3cc41510e083fd19c1b0fe32d8b733a1388288f312a2 *install.sh
|
||||
25
frp/uninstall.sh
Normal file
25
frp/uninstall.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
frp_path="${setup_path}/server/frp"
|
||||
|
||||
systemctl stop frps
|
||||
systemctl stop frpc
|
||||
systemctl disable frps
|
||||
systemctl disable frpc
|
||||
|
||||
rm -rf ${frp_path}
|
||||
rm -f /etc/systemd/system/frps.service
|
||||
rm -f /etc/systemd/system/frpc.service
|
||||
systemctl daemon-reload
|
||||
|
||||
acepanel app remove frp
|
||||
echo -e $HR
|
||||
echo "frp uninstall successful"
|
||||
echo -e $HR
|
||||
1
frp/uninstall.sh.sha256
Normal file
1
frp/uninstall.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
ff35fd8a394d4568c78460ed91c2f38d30f9f9b3fef797e4b7cfc66243ea7abb *uninstall.sh
|
||||
66
frp/update.sh
Normal file
66
frp/update.sh
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
frp_path="${setup_path}/server/frp"
|
||||
|
||||
if [ ! -d "${frp_path}" ]; then
|
||||
mkdir -p ${frp_path}
|
||||
fi
|
||||
|
||||
# 架构判断
|
||||
if [ ${ARCH} == "x86_64" ]; then
|
||||
frpFile="frp_${version}_linux_amd64.7z"
|
||||
elif [ ${ARCH} == "aarch64" ]; then
|
||||
frpFile="frp_${version}_linux_arm64.7z"
|
||||
else
|
||||
error "Unsupported architecture"
|
||||
fi
|
||||
|
||||
# 备份配置
|
||||
if [ -f "${frp_path}/frps.toml" ]; then
|
||||
\cp -f ${frp_path}/frps.toml ${frp_path}/frps.toml.bak
|
||||
fi
|
||||
if [ -f "${frp_path}/frpc.toml" ]; then
|
||||
\cp -f ${frp_path}/frpc.toml ${frp_path}/frpc.toml.bak
|
||||
fi
|
||||
|
||||
# 下载frp
|
||||
cd ${frp_path}
|
||||
dl "${frp_path}" "/frp/${frpFile}"
|
||||
|
||||
# 解压frp
|
||||
cd ${frp_path}
|
||||
7z x ${frpFile}
|
||||
chown -R www:www ${frp_path}
|
||||
chmod -R 700 ${frp_path}
|
||||
|
||||
# 还原配置
|
||||
if [ -f "${frp_path}/frps.toml.bak" ]; then
|
||||
\cp -f ${frp_path}/frps.toml.bak ${frp_path}/frps.toml
|
||||
fi
|
||||
if [ -f "${frp_path}/frpc.toml.bak" ]; then
|
||||
\cp -f ${frp_path}/frpc.toml.bak ${frp_path}/frpc.toml
|
||||
fi
|
||||
|
||||
systemctl restart frps
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
systemctl restart frpc
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
|
||||
acepanel app write frp ${channel} ${version}
|
||||
|
||||
echo -e ${HR}
|
||||
echo "Upgrade successful"
|
||||
echo -e ${HR}
|
||||
1
frp/update.sh.sha256
Normal file
1
frp/update.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
e923be956bdcec2f50e1bb4ad83380c5092288976da8270f88548c891774622c *update.sh
|
||||
BIN
gitea/gitea-1.25.4-linux-amd64.7z
LFS
Normal file
BIN
gitea/gitea-1.25.4-linux-amd64.7z
LFS
Normal file
Binary file not shown.
1
gitea/gitea-1.25.4-linux-amd64.7z.sha256
Normal file
1
gitea/gitea-1.25.4-linux-amd64.7z.sha256
Normal file
@@ -0,0 +1 @@
|
||||
285125328a05a9756a93416ac6e794e82c986e1b28b87a987038fd7e576a6a50 *gitea-1.25.4-linux-amd64.7z
|
||||
BIN
gitea/gitea-1.25.4-linux-arm64.7z
LFS
Normal file
BIN
gitea/gitea-1.25.4-linux-arm64.7z
LFS
Normal file
Binary file not shown.
1
gitea/gitea-1.25.4-linux-arm64.7z.sha256
Normal file
1
gitea/gitea-1.25.4-linux-arm64.7z.sha256
Normal file
@@ -0,0 +1 @@
|
||||
5dbfcaa39facd2728fd5231f54704cc20358f59ba31070e41e62f0cc388a21f8 *gitea-1.25.4-linux-arm64.7z
|
||||
116
gitea/install.sh
Normal file
116
gitea/install.sh
Normal file
@@ -0,0 +1,116 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
gitea_path="${setup_path}/server/gitea"
|
||||
|
||||
if [ ! -d "${gitea_path}" ]; then
|
||||
mkdir -p ${gitea_path}
|
||||
fi
|
||||
|
||||
# 架构判断
|
||||
if [ ${ARCH} == "x86_64" ]; then
|
||||
gitea_file="gitea-${version}-linux-amd64.7z"
|
||||
elif [ ${ARCH} == "aarch64" ]; then
|
||||
gitea_file="gitea-${version}-linux-arm64.7z"
|
||||
else
|
||||
error "Unsupported architecture"
|
||||
fi
|
||||
|
||||
# 安装依赖
|
||||
if [ ${OS} == "rhel" ]; then
|
||||
dnf makecache -y
|
||||
dnf install git git-lfs -y
|
||||
elif [ ${OS} == "debian" ] || [ ${OS} == "ubuntu" ]; then
|
||||
apt-get update
|
||||
apt-get install git git-lfs -y
|
||||
else
|
||||
error "Unsupported system"
|
||||
fi
|
||||
|
||||
git lfs install
|
||||
git lfs version
|
||||
|
||||
# 下载
|
||||
cd ${gitea_path}
|
||||
dl "${gitea_path}" "/gitea/${gitea_file}"
|
||||
|
||||
# 解压
|
||||
cd ${gitea_path}
|
||||
7z x ${gitea_file}
|
||||
rm -f ${gitea_file}
|
||||
mv gitea-${version}-linux-* gitea
|
||||
if [ ! -f "${gitea_path}/gitea" ]; then
|
||||
rm -rf ${gitea_path}
|
||||
error "Extraction failed"
|
||||
fi
|
||||
|
||||
# 初始化目录
|
||||
mkdir -p ${gitea_path}/{custom,data,log}
|
||||
chown -R www:www ${gitea_path}
|
||||
chmod -R 700 ${gitea_path}
|
||||
ln -sf ${gitea_path}/gitea /usr/local/bin/gitea
|
||||
|
||||
# 配置systemd
|
||||
cat >/etc/systemd/system/gitea.service <<EOF
|
||||
[Unit]
|
||||
Description=Gitea (Git with a cup of tea)
|
||||
After=network.target
|
||||
###
|
||||
# 可以自行添加数据库服务依赖
|
||||
# Can add database service dependencies yourself
|
||||
###
|
||||
#
|
||||
#Wants=mysqld.service
|
||||
#After=mysqld.service
|
||||
#
|
||||
#Wants=postgresql.service
|
||||
#After=postgresql.service
|
||||
#
|
||||
#Wants=redis.service
|
||||
#After=redis.service
|
||||
#
|
||||
|
||||
[Service]
|
||||
LimitNOFILE=524288:524288
|
||||
RestartSec=2s
|
||||
Type=simple
|
||||
User=www
|
||||
Group=www
|
||||
WorkingDirectory=${setup_path}/server/gitea/
|
||||
ExecStart=/usr/local/bin/gitea web --config ${setup_path}/server/gitea/app.ini
|
||||
Restart=always
|
||||
Environment=USER=www HOME=/home/www GITEA_WORK_DIR=${setup_path}/server/gitea
|
||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
PrivateUsers=false
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
chmod 644 /etc/systemd/system/gitea.service
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now gitea
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
|
||||
# 防火墙
|
||||
firewall-cmd --zone=public --add-port=3000/tcp --permanent
|
||||
firewall-cmd --reload
|
||||
|
||||
acepanel app write gitea ${channel} ${version}
|
||||
|
||||
echo -e $HR
|
||||
echo "gitea installation successful, please visit IP:3000 to complete the initialization wizard"
|
||||
echo "安装后建议修改 systemd 配置 /etc/systemd/system/gitea.service 中的数据库依赖"
|
||||
echo -e $HR
|
||||
1
gitea/install.sh.sha256
Normal file
1
gitea/install.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
3cede5e3b97ddd458922a2cbac915922c9c807f116daae95d10a9129450a2584 *install.sh
|
||||
23
gitea/uninstall.sh
Normal file
23
gitea/uninstall.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gitea_path="${setup_path}/server/gitea"
|
||||
|
||||
systemctl stop gitea
|
||||
systemctl disable gitea
|
||||
|
||||
rm -f /usr/local/bin/gitea
|
||||
rm -rf ${gitea_path}
|
||||
rm -f /etc/systemd/system/gitea.service
|
||||
systemctl daemon-reload
|
||||
|
||||
acepanel app remove gitea
|
||||
echo -e $HR
|
||||
echo "gitea uninstall successful, database may need to be deleted manually"
|
||||
echo -e $HR
|
||||
1
gitea/uninstall.sh.sha256
Normal file
1
gitea/uninstall.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
968aba3d7bda5284a4d4df7a507132f79efac60aa4b9c6c945676a3e5388bd3e *uninstall.sh
|
||||
51
gitea/update.sh
Normal file
51
gitea/update.sh
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
gitea_path="${setup_path}/server/gitea"
|
||||
|
||||
# 架构判断
|
||||
if [ ${ARCH} == "x86_64" ]; then
|
||||
gitea_file="gitea-${version}-linux-amd64.7z"
|
||||
elif [ ${ARCH} == "aarch64" ]; then
|
||||
gitea_file="gitea-${version}-linux-arm64.7z"
|
||||
else
|
||||
error "Unsupported architecture"
|
||||
fi
|
||||
|
||||
# 下载
|
||||
cd ${gitea_path}
|
||||
dl "${gitea_path}" "/gitea/${gitea_file}"
|
||||
|
||||
# 解压
|
||||
cd ${gitea_path}
|
||||
7z x ${gitea_file}
|
||||
rm -f ${gitea_file}
|
||||
|
||||
# 替换文件
|
||||
systemctl stop gitea
|
||||
rm -f gitea
|
||||
mv gitea-${version}-linux-* gitea
|
||||
if [ ! -f "${gitea_path}/gitea" ]; then
|
||||
error "Extraction failed"
|
||||
fi
|
||||
|
||||
chown -R www:www ${gitea_path}/gitea
|
||||
chmod -R 700 ${gitea_path}/gitea
|
||||
systemctl start gitea
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
|
||||
acepanel app write gitea ${channel} ${version}
|
||||
|
||||
echo -e $HR
|
||||
echo "Upgrade successful"
|
||||
echo -e $HR
|
||||
1
gitea/update.sh.sha256
Normal file
1
gitea/update.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
fb59abb45e3ae9ef3c6e04eba9849aa8f0e339013d20f0f1c708da3a1ee038ce *update.sh
|
||||
91
go/install.sh
Normal file
91
go/install.sh
Normal file
@@ -0,0 +1,91 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
slug=${1}
|
||||
version=${2}
|
||||
go_path="${setup_path}/server/go/${slug}"
|
||||
in_china=$(curl --retry 2 -m 10 -L -k https://www.qualcomm.cn/cdn-cgi/trace 2>/dev/null | grep -qx 'loc=CN' && echo "true" || echo "false")
|
||||
|
||||
# 架构映射
|
||||
case ${ARCH} in
|
||||
x86_64)
|
||||
GO_ARCH="amd64"
|
||||
;;
|
||||
aarch64)
|
||||
GO_ARCH="arm64"
|
||||
;;
|
||||
esac
|
||||
|
||||
# 准备安装目录
|
||||
rm -rf ${go_path}
|
||||
mkdir -p ${go_path}
|
||||
cd ${go_path}
|
||||
|
||||
# 下载Go安装包
|
||||
GO_TARBALL="go${version}.linux-${GO_ARCH}.tar.gz"
|
||||
|
||||
if ${in_china}; then
|
||||
GO_URL="https://mirrors.aliyun.com/golang/${GO_TARBALL}"
|
||||
echo "Downloading ${GO_TARBALL} from Aliyun mirror..."
|
||||
else
|
||||
GO_URL="https://dl.google.com/go/${GO_TARBALL}"
|
||||
echo "Downloading ${GO_TARBALL} from Google..."
|
||||
fi
|
||||
|
||||
aria2c -x8 \
|
||||
-U "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36" \
|
||||
-o ${GO_TARBALL} \
|
||||
${GO_URL}
|
||||
if [ $? -ne 0 ]; then
|
||||
rm -rf ${go_path}
|
||||
error "Failed to download Go ${version}"
|
||||
fi
|
||||
|
||||
# 解压
|
||||
tar -zxf ${GO_TARBALL}
|
||||
if [ $? -ne 0 ]; then
|
||||
rm -rf ${go_path}
|
||||
error "Failed to extract Go ${version}"
|
||||
fi
|
||||
|
||||
# Go解压后会在go目录下,移动到当前目录
|
||||
mv go/* .
|
||||
rmdir go
|
||||
rm -f ${GO_TARBALL}
|
||||
|
||||
# 验证安装
|
||||
if [ ! -f "${go_path}/bin/go" ]; then
|
||||
rm -rf ${go_path}
|
||||
error "Go ${version} installation failed"
|
||||
fi
|
||||
|
||||
# 设置软链接
|
||||
ln -sf ${go_path}/bin/go /usr/local/bin/go${slug}
|
||||
ln -sf ${go_path}/bin/gofmt /usr/local/bin/gofmt${slug}
|
||||
[ ! -f /usr/local/bin/go ] && ln -sf ${go_path}/bin/go /usr/local/bin/go
|
||||
[ ! -f /usr/local/bin/gofmt ] && ln -sf ${go_path}/bin/gofmt /usr/local/bin/gofmt
|
||||
|
||||
# 国内设置GOPROXY
|
||||
if ${in_china}; then
|
||||
go env -w GO111MODULE=on
|
||||
go env -w GOPROXY=https://goproxy.cn,direct
|
||||
fi
|
||||
|
||||
# 创建环境变量配置
|
||||
cat >${go_path}/env.sh <<EOF
|
||||
export GOROOT=${go_path}
|
||||
export PATH=\$GOROOT/bin:\$PATH
|
||||
EOF
|
||||
chmod 644 ${go_path}/env.sh
|
||||
|
||||
echo -e $HR
|
||||
echo "Go ${version} installation successful"
|
||||
echo "Go path: ${go_path}"
|
||||
echo "To use this version, run: source ${go_path}/env.sh"
|
||||
echo -e $HR
|
||||
1
go/install.sh.sha256
Normal file
1
go/install.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
fa71e7b7e896f09c1cbad2708eab73b66acd353327121cb2d1688cc431e0424f *install.sh
|
||||
28
go/uninstall.sh
Normal file
28
go/uninstall.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
slug=${1}
|
||||
go_path="${setup_path}/server/go/${slug}"
|
||||
|
||||
rm -rf ${go_path}
|
||||
rm -f /usr/local/bin/go${slug}
|
||||
rm -f /usr/local/bin/gofmt${slug}
|
||||
|
||||
if [ -L /usr/local/bin/go ]; then
|
||||
link_path=$(readlink /usr/local/bin/go)
|
||||
[ "${link_path}" == "${go_path}/bin/go" ] && rm -f /usr/local/bin/go
|
||||
fi
|
||||
if [ -L /usr/local/bin/gofmt ]; then
|
||||
link_path=$(readlink /usr/local/bin/gofmt)
|
||||
[ "${link_path}" == "${go_path}/bin/gofmt" ] && rm -f /usr/local/bin/gofmt
|
||||
fi
|
||||
|
||||
echo -e $HR
|
||||
echo "Uninstall successful"
|
||||
echo -e $HR
|
||||
1
go/uninstall.sh.sha256
Normal file
1
go/uninstall.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
0a200415467cdbdfb333ffbecb617b7b641a6210a618444db448662ec23c814a *uninstall.sh
|
||||
73
go/update.sh
Normal file
73
go/update.sh
Normal file
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
slug=${1}
|
||||
version=${2}
|
||||
go_path="${setup_path}/server/go/${slug}"
|
||||
in_china=$(curl --retry 2 -m 10 -L -k https://www.qualcomm.cn/cdn-cgi/trace 2>/dev/null | grep -qx 'loc=CN' && echo "true" || echo "false")
|
||||
|
||||
# 预检查
|
||||
if [ ! -f "${go_path}/bin/go" ]; then
|
||||
error "Go ${slug} is not installed"
|
||||
fi
|
||||
|
||||
# 架构映射
|
||||
case ${ARCH} in
|
||||
x86_64)
|
||||
GO_ARCH="amd64"
|
||||
;;
|
||||
aarch64)
|
||||
GO_ARCH="arm64"
|
||||
;;
|
||||
esac
|
||||
|
||||
# 下载Go安装包
|
||||
GO_TARBALL="go${version}.linux-${GO_ARCH}.tar.gz"
|
||||
|
||||
if ${in_china}; then
|
||||
GO_URL="https://mirrors.aliyun.com/golang/${GO_TARBALL}"
|
||||
echo "Downloading ${GO_TARBALL} from Aliyun mirror..."
|
||||
else
|
||||
GO_URL="https://dl.google.com/go/${GO_TARBALL}"
|
||||
echo "Downloading ${GO_TARBALL} from Google..."
|
||||
fi
|
||||
|
||||
cd ${go_path}
|
||||
aria2c -x8 \
|
||||
-U "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36" \
|
||||
-o ${GO_TARBALL} \
|
||||
${GO_URL}
|
||||
if [ $? -ne 0 ]; then
|
||||
rm -f ${GO_TARBALL}
|
||||
error "Failed to download Go ${version}"
|
||||
fi
|
||||
|
||||
# 删除旧文件
|
||||
find ${go_path} -mindepth 1 ! -name "${GO_TARBALL}" -exec rm -rf {} + 2>/dev/null
|
||||
|
||||
# 解压
|
||||
tar -zxf ${GO_TARBALL}
|
||||
if [ $? -ne 0 ]; then
|
||||
rm -f ${GO_TARBALL}
|
||||
error "Failed to extract Go ${version}"
|
||||
fi
|
||||
|
||||
# Go解压后移动到当前目录
|
||||
mv go/* .
|
||||
rm -rf go
|
||||
rm -f ${GO_TARBALL}
|
||||
|
||||
# 验证安装
|
||||
if [ ! -f "${go_path}/bin/go" ]; then
|
||||
error "Go ${version} upgrade failed"
|
||||
fi
|
||||
|
||||
echo -e $HR
|
||||
echo "Upgrade successful"
|
||||
echo -e $HR
|
||||
1
go/update.sh.sha256
Normal file
1
go/update.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
9cc36d95cd260c19580ff35c18f7095a330b3045a32fbca886834dd2094714ba *update.sh
|
||||
41
helper.sh
Normal file
41
helper.sh
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
detect_arch() {
|
||||
case "${ARCH}" in
|
||||
x86_64) echo "amd64" ;;
|
||||
arm64 | aarch64) echo "arm64" ;;
|
||||
*) echo "unknown" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
run() {
|
||||
local arch=$(detect_arch)
|
||||
if [ "${arch}" == "unknown" ]; then
|
||||
error "Unsupported architecture: ${ARCH}"
|
||||
fi
|
||||
|
||||
TARGET="acepanel-helper-${arch}"
|
||||
BIN_NAME="acepanel-helper"
|
||||
|
||||
dl "$(pwd)" "/${TARGET}"
|
||||
|
||||
mv "${TARGET}" "${BIN_NAME}"
|
||||
chmod +x "$BIN_NAME"
|
||||
|
||||
if [ ! -t 0 ]; then
|
||||
exec </dev/tty # 尝试恢复终端输入
|
||||
fi
|
||||
|
||||
./"$BIN_NAME" "$@"
|
||||
|
||||
rm -f "$BIN_NAME"
|
||||
}
|
||||
|
||||
run "$@"
|
||||
1
helper.sh.sha256
Normal file
1
helper.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
6226de829e0c71aab2b6aba45acfeb21d95fb95704dbfa44d12141b769f8989b *helper.sh
|
||||
78
java/install.sh
Normal file
78
java/install.sh
Normal file
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
slug=${1}
|
||||
version=${2}
|
||||
java_path="${setup_path}/server/java/${slug}"
|
||||
|
||||
# 架构映射
|
||||
case ${ARCH} in
|
||||
x86_64)
|
||||
JAVA_ARCH="x64"
|
||||
;;
|
||||
aarch64)
|
||||
JAVA_ARCH="aarch64"
|
||||
;;
|
||||
esac
|
||||
|
||||
# 准备安装目录
|
||||
rm -rf ${java_path}
|
||||
mkdir -p ${java_path}
|
||||
cd ${java_path}
|
||||
|
||||
# 下载Amazon Corretto JDK
|
||||
JAVA_TARBALL="amazon-corretto-${version}-linux-${JAVA_ARCH}.tar.gz"
|
||||
JAVA_URL="https://corretto.aws/downloads/resources/${version}/${JAVA_TARBALL}"
|
||||
echo "Downloading Corretto ${version} from AWS..."
|
||||
|
||||
aria2c -x8 \
|
||||
-U "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36" \
|
||||
-o ${JAVA_TARBALL} \
|
||||
${JAVA_URL}
|
||||
if [ $? -ne 0 ]; then
|
||||
rm -rf ${java_path}
|
||||
error "Failed to download Java ${version}"
|
||||
fi
|
||||
|
||||
# 解压
|
||||
tar -zxf ${JAVA_TARBALL}
|
||||
if [ $? -ne 0 ]; then
|
||||
rm -rf ${java_path}
|
||||
error "Failed to extract Java ${version}"
|
||||
fi
|
||||
|
||||
# Corretto解压后会在amazon-corretto-{full_version}-linux-{arch}目录下,移动到当前目录
|
||||
mv amazon-corretto-*/* .
|
||||
rm -rf amazon-corretto-*/
|
||||
rm -f ${JAVA_TARBALL}
|
||||
|
||||
# 验证安装
|
||||
if [ ! -f "${java_path}/bin/java" ]; then
|
||||
rm -rf ${java_path}
|
||||
error "Java ${version} installation failed"
|
||||
fi
|
||||
|
||||
# 设置软链接
|
||||
ln -sf ${java_path}/bin/java /usr/local/bin/java${slug}
|
||||
ln -sf ${java_path}/bin/javac /usr/local/bin/javac${slug}
|
||||
[ ! -f /usr/local/bin/java ] && ln -sf ${java_path}/bin/java /usr/local/bin/java
|
||||
[ ! -f /usr/local/bin/javac ] && ln -sf ${java_path}/bin/javac /usr/local/bin/javac
|
||||
|
||||
# 创建环境变量配置
|
||||
cat >${java_path}/env.sh <<EOF
|
||||
export JAVA_HOME=${java_path}
|
||||
export PATH=\$JAVA_HOME/bin:\$PATH
|
||||
EOF
|
||||
chmod 644 ${java_path}/env.sh
|
||||
|
||||
echo -e $HR
|
||||
echo "Java ${version} (Amazon Corretto) installation successful"
|
||||
echo "Java path: ${java_path}"
|
||||
echo "To use this version, run: source ${java_path}/env.sh"
|
||||
echo -e $HR
|
||||
1
java/install.sh.sha256
Normal file
1
java/install.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
0891946632ca16f75ef96d09d8e2a6af23f5d8a0130c144a88211126d1d6f3a3 *install.sh
|
||||
28
java/uninstall.sh
Normal file
28
java/uninstall.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
slug=${1}
|
||||
java_path="${setup_path}/server/java/${slug}"
|
||||
|
||||
rm -rf ${java_path}
|
||||
rm -f /usr/local/bin/java${slug}
|
||||
rm -f /usr/local/bin/javac${slug}
|
||||
|
||||
if [ -L /usr/local/bin/java ]; then
|
||||
link_path=$(readlink /usr/local/bin/java)
|
||||
[ "${link_path}" == "${java_path}/bin/java" ] && rm -f /usr/local/bin/java
|
||||
fi
|
||||
if [ -L /usr/local/bin/javac ]; then
|
||||
link_path=$(readlink /usr/local/bin/javac)
|
||||
[ "${link_path}" == "${java_path}/bin/javac" ] && rm -f /usr/local/bin/javac
|
||||
fi
|
||||
|
||||
echo -e $HR
|
||||
echo "Uninstall successful"
|
||||
echo -e $HR
|
||||
1
java/uninstall.sh.sha256
Normal file
1
java/uninstall.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
619e8d9607057dcf6e37d8bea11a815d65d24a0a69294d7fe462da46bba70fe9 *uninstall.sh
|
||||
66
java/update.sh
Normal file
66
java/update.sh
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
slug=${1}
|
||||
version=${2}
|
||||
java_path="${setup_path}/server/java/${slug}"
|
||||
|
||||
# 预检查
|
||||
if [ ! -f "${java_path}/bin/java" ]; then
|
||||
error "Java ${slug} is not installed"
|
||||
fi
|
||||
|
||||
# 架构映射
|
||||
case ${ARCH} in
|
||||
x86_64)
|
||||
JAVA_ARCH="x64"
|
||||
;;
|
||||
aarch64)
|
||||
JAVA_ARCH="aarch64"
|
||||
;;
|
||||
esac
|
||||
|
||||
# 下载Amazon Corretto JDK
|
||||
JAVA_TARBALL="amazon-corretto-${version}-linux-${JAVA_ARCH}.tar.gz"
|
||||
JAVA_URL="https://corretto.aws/downloads/resources/${version}/${JAVA_TARBALL}"
|
||||
echo "Downloading Corretto ${version} from AWS..."
|
||||
|
||||
cd ${java_path}
|
||||
aria2c -x8 \
|
||||
-U "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36" \
|
||||
-o ${JAVA_TARBALL} \
|
||||
${JAVA_URL}
|
||||
if [ $? -ne 0 ]; then
|
||||
rm -f ${JAVA_TARBALL}
|
||||
error "Failed to download Java ${version}"
|
||||
fi
|
||||
|
||||
# 删除旧文件
|
||||
find ${java_path} -mindepth 1 ! -name "${JAVA_TARBALL}" -exec rm -rf {} + 2>/dev/null
|
||||
|
||||
# 解压
|
||||
tar -zxf ${JAVA_TARBALL}
|
||||
if [ $? -ne 0 ]; then
|
||||
rm -f ${JAVA_TARBALL}
|
||||
error "Failed to extract Java ${version}"
|
||||
fi
|
||||
|
||||
# Corretto解压后移动到当前目录
|
||||
mv amazon-corretto-*/* .
|
||||
rm -rf amazon-corretto-*/
|
||||
rm -f ${JAVA_TARBALL}
|
||||
|
||||
# 验证安装
|
||||
if [ ! -f "${java_path}/bin/java" ]; then
|
||||
error "Java ${version} upgrade failed"
|
||||
fi
|
||||
|
||||
echo -e $HR
|
||||
echo "Upgrade successful"
|
||||
echo -e $HR
|
||||
1
java/update.sh.sha256
Normal file
1
java/update.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
a960ac80bf7788a3da823b5f12131652a55de654c2e89c16c73d7b7d1b75b7ee *update.sh
|
||||
25
mariadb/install.sh
Normal file
25
mariadb/install.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ${ARCH} == "x86_64" ]] &&
|
||||
[[ (${OS} == "ubuntu" && ${VERSION} -ge 22) ||
|
||||
(${OS} == "debian" && ${VERSION} -ge 12) ||
|
||||
(${OS} == "rhel" && ${VERSION} -ge 9) ]]; then
|
||||
dl "/tmp" "/mysql/prebuilt.sh"
|
||||
bash /tmp/prebuilt.sh mariadb "$1" "$2"
|
||||
else
|
||||
dl "/tmp" "/mysql/build.sh"
|
||||
bash /tmp/build.sh mariadb "$1" "$2"
|
||||
fi
|
||||
|
||||
dl "/tmp" "/mysql/init.sh"
|
||||
bash /tmp/init.sh mariadb "$1" "$2"
|
||||
|
||||
rm -f /tmp/prebuilt.sh
|
||||
rm -f /tmp/build.sh
|
||||
rm -f /tmp/init.sh
|
||||
1
mariadb/install.sh.sha256
Normal file
1
mariadb/install.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
00386c2d6d419726fd95f5ea5228b19db6d7ece7b414d416ab8f03b5698f7f00 *install.sh
|
||||
158
memcached/install.sh
Normal file
158
memcached/install.sh
Normal file
@@ -0,0 +1,158 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
memcached_path="${setup_path}/server/memcached"
|
||||
|
||||
if ! id -u "memcached" >/dev/null 2>&1; then
|
||||
groupadd memcached
|
||||
useradd -s /sbin/nologin -g memcached memcached
|
||||
fi
|
||||
|
||||
# 安装依赖
|
||||
if [ ${OS} == "rhel" ]; then
|
||||
dnf makecache -y
|
||||
dnf groupinstall "Development Tools" -y
|
||||
dnf install openssl-devel cyrus-sasl cyrus-sasl-devel libevent-devel -y
|
||||
elif [ ${OS} == "debian" ] || [ ${OS} == "ubuntu" ]; then
|
||||
apt-get update
|
||||
apt-get install build-essential libssl-dev libsasl2-2 libsasl2-dev libevent-dev -y
|
||||
else
|
||||
error "Unsupported operating system"
|
||||
fi
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to install dependencies"
|
||||
fi
|
||||
|
||||
# 准备目录
|
||||
rm -rf ${memcached_path}
|
||||
mkdir -p ${memcached_path}
|
||||
cd ${memcached_path}
|
||||
|
||||
# 下载源码
|
||||
dl "${memcached_path}" "/memcached/memcached-${version}.tar.gz"
|
||||
|
||||
tar -zxvf memcached-${version}.tar.gz
|
||||
rm -f memcached-${version}.tar.gz
|
||||
mv memcached-${version} src
|
||||
cd src
|
||||
chmod +x configure
|
||||
|
||||
./configure --prefix=${memcached_path} --enable-tls --enable-sasl --enable-sasl-pwdb --enable-64bit
|
||||
if [ "$?" != "0" ]; then
|
||||
rm -rf ${memcached_path}
|
||||
error "Configuration failed"
|
||||
fi
|
||||
|
||||
make -j${CORES}
|
||||
if [ "$?" != "0" ]; then
|
||||
rm -rf ${memcached_path}
|
||||
error "Compilation failed"
|
||||
fi
|
||||
|
||||
make install
|
||||
if [ ! -f "${memcached_path}/bin/memcached" ]; then
|
||||
rm -rf ${memcached_path}
|
||||
error "Installation failed"
|
||||
fi
|
||||
|
||||
chown -R memcached:memcached ${memcached_path}
|
||||
chmod -R 700 ${memcached_path}
|
||||
|
||||
# 设置服务
|
||||
cat >/etc/systemd/system/memcached.service <<EOF
|
||||
[Unit]
|
||||
Description=memcached daemon
|
||||
After=network.target
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
User=memcached
|
||||
Group=memcached
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
ExecStart=${memcached_path}/bin/memcached -p 11211 -u memcached -m 128 -c 1024 $OPTIONS
|
||||
|
||||
# Set up a new file system namespace and mounts private /tmp and /var/tmp
|
||||
# directories so this service cannot access the global directories and
|
||||
# other processes cannot access this service's directories.
|
||||
PrivateTmp=true
|
||||
|
||||
# Mounts the /usr, /boot, and /etc directories read-only for processes
|
||||
# invoked by this unit.
|
||||
ProtectSystem=full
|
||||
|
||||
# Ensures that the service process and all its children can never gain new
|
||||
# privileges
|
||||
NoNewPrivileges=true
|
||||
|
||||
# Sets up a new /dev namespace for the executed processes and only adds API
|
||||
# pseudo devices such as /dev/null, /dev/zero or /dev/random (as well as
|
||||
# the pseudo TTY subsystem) to it, but no physical devices such as /dev/sda.
|
||||
PrivateDevices=true
|
||||
|
||||
# Required for dropping privileges and running as a different user
|
||||
CapabilityBoundingSet=CAP_SETGID CAP_SETUID CAP_SYS_RESOURCE
|
||||
|
||||
# Restricts the set of socket address families accessible to the processes
|
||||
# of this unit. Protects against vulnerabilities such as CVE-2016-8655
|
||||
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
|
||||
|
||||
# Attempts to create memory mappings that are writable and executable at
|
||||
# the same time, or to change existing memory mappings to become executable
|
||||
# are prohibited.
|
||||
MemoryDenyWriteExecute=true
|
||||
|
||||
# Explicit module loading will be denied. This allows to turn off module
|
||||
# load and unload operations on modular kernels. It is recommended to turn
|
||||
# this on for most services that do not need special file systems or extra
|
||||
# kernel modules to work.
|
||||
ProtectKernelModules=true
|
||||
|
||||
# Kernel variables accessible through /proc/sys, /sys, /proc/sysrq-trigger,
|
||||
# /proc/latency_stats, /proc/acpi, /proc/timer_stats, /proc/fs and /proc/irq
|
||||
# will be made read-only to all processes of the unit. Usually, tunable
|
||||
# kernel variables should only be written at boot-time, with the sysctl.d(5)
|
||||
# mechanism. Almost no services need to write to these at runtime; it is hence
|
||||
# recommended to turn this on for most services.
|
||||
ProtectKernelTunables=true
|
||||
|
||||
# The Linux Control Groups (cgroups(7)) hierarchies accessible through
|
||||
# /sys/fs/cgroup will be made read-only to all processes of the unit.
|
||||
# Except for container managers no services should require write access
|
||||
# to the control groups hierarchies; it is hence recommended to turn this
|
||||
# on for most services
|
||||
ProtectControlGroups=true
|
||||
|
||||
# Any attempts to enable realtime scheduling in a process of the unit are
|
||||
# refused.
|
||||
RestrictRealtime=true
|
||||
|
||||
# Takes away the ability to create or manage any kind of namespace
|
||||
RestrictNamespaces=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
chmod 644 /etc/systemd/system/memcached.service
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now memcached
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
|
||||
acepanel app write memcached ${channel} ${version}
|
||||
|
||||
echo -e $HR
|
||||
echo "Installation successful"
|
||||
echo -e $HR
|
||||
1
memcached/install.sh.sha256
Normal file
1
memcached/install.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
596f313477ed2cd62fbdd22094ed31e2a065c8eecb25dd7fc71aa062cd1bfcda *install.sh
|
||||
BIN
memcached/memcached-1.6.39.tar.gz
LFS
Normal file
BIN
memcached/memcached-1.6.39.tar.gz
LFS
Normal file
Binary file not shown.
1
memcached/memcached-1.6.39.tar.gz.sha256
Normal file
1
memcached/memcached-1.6.39.tar.gz.sha256
Normal file
@@ -0,0 +1 @@
|
||||
23e5507e933b15463161d4c5d3921b0c5f340b542d6edd7f6c5e17c34f11a363 *memcached-1.6.39.tar.gz
|
||||
BIN
memcached/memcached-1.6.40.tar.gz
LFS
Normal file
BIN
memcached/memcached-1.6.40.tar.gz
LFS
Normal file
Binary file not shown.
1
memcached/memcached-1.6.40.tar.gz.sha256
Normal file
1
memcached/memcached-1.6.40.tar.gz.sha256
Normal file
@@ -0,0 +1 @@
|
||||
a3d360e9da2221a49bf9aae4e6880f2d44da6b2a2fae39b1911b9ca76488fbfd *memcached-1.6.40.tar.gz
|
||||
20
memcached/uninstall.sh
Normal file
20
memcached/uninstall.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
systemctl stop memcached
|
||||
systemctl disable memcached
|
||||
rm -rf /etc/systemd/system/memcached.service
|
||||
systemctl daemon-reload
|
||||
rm -rf ${setup_path}/server/memcached
|
||||
|
||||
acepanel app remove memcached
|
||||
|
||||
echo -e $HR
|
||||
echo "Uninstall successful"
|
||||
echo -e $HR
|
||||
1
memcached/uninstall.sh.sha256
Normal file
1
memcached/uninstall.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
660664416f5a8a6cb0ed8777928a0f262682e9fb29e1c0d45e6909108647c418 *uninstall.sh
|
||||
64
memcached/update.sh
Normal file
64
memcached/update.sh
Normal file
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
memcached_path="${setup_path}/server/memcached"
|
||||
|
||||
# 预检查
|
||||
systemctl is-active --quiet memcached
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Application is not running properly"
|
||||
fi
|
||||
|
||||
rm -rf ${memcached_path}
|
||||
mkdir -p ${memcached_path}
|
||||
cd ${memcached_path}
|
||||
|
||||
# 下载源码
|
||||
dl "${memcached_path}" "/memcached/memcached-${version}.tar.gz"
|
||||
|
||||
tar -zxvf memcached-${version}.tar.gz
|
||||
rm -f memcached-${version}.tar.gz
|
||||
mv memcached-${version} src
|
||||
cd src
|
||||
chmod +x configure
|
||||
|
||||
./configure --prefix=${memcached_path} --enable-tls --enable-sasl --enable-sasl-pwdb --enable-64bit
|
||||
if [ "$?" != "0" ]; then
|
||||
rm -rf ${memcached_path}
|
||||
error "Configuration failed"
|
||||
fi
|
||||
|
||||
make -j${CORES}
|
||||
if [ "$?" != "0" ]; then
|
||||
rm -rf ${memcached_path}
|
||||
error "Compilation failed"
|
||||
fi
|
||||
|
||||
# 停止已有服务
|
||||
systemctl stop memcached
|
||||
|
||||
make install
|
||||
if [ ! -f "${memcached_path}/bin/memcached" ]; then
|
||||
rm -rf ${memcached_path}
|
||||
error "Installation failed"
|
||||
fi
|
||||
|
||||
chown -R memcached:memcached ${memcached_path}
|
||||
chmod -R 700 ${memcached_path}
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl start memcached
|
||||
|
||||
acepanel app write memcached ${channel} ${version}
|
||||
|
||||
echo -e $HR
|
||||
echo "Upgrade successful"
|
||||
echo -e $HR
|
||||
1
memcached/update.sh.sha256
Normal file
1
memcached/update.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
f7a7e1468b49388015fc6a82e10f66ef5f4c29e7599b0d6a34a8eeca49221a33 *update.sh
|
||||
137
minio/install.sh
Normal file
137
minio/install.sh
Normal file
@@ -0,0 +1,137 @@
|
||||
#!/bin/bash
|
||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
|
||||
|
||||
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Download public.sh failed, please check the network or try again later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
channel=${1}
|
||||
version=${2}
|
||||
minio_path="${setup_path}/server/minio"
|
||||
|
||||
if [ ! -d "${minio_path}" ]; then
|
||||
mkdir -p ${minio_path}
|
||||
fi
|
||||
|
||||
minio_user_check=$(cat /etc/passwd | grep minio)
|
||||
if [ "${minio_user_check}" == "" ]; then
|
||||
groupadd minio
|
||||
useradd -s /sbin/nologin -g minio minio
|
||||
fi
|
||||
|
||||
# 架构判断
|
||||
if [ ${ARCH} == "x86_64" ]; then
|
||||
minio_file="minio-${version}-amd64.7z"
|
||||
elif [ ${ARCH} == "aarch64" ]; then
|
||||
minio_file="minio-${version}-arm64.7z"
|
||||
else
|
||||
error "Unsupported architecture"
|
||||
fi
|
||||
|
||||
# 下载
|
||||
cd ${minio_path}
|
||||
dl "${minio_path}" "/minio/${minio_file}"
|
||||
|
||||
# 解压
|
||||
cd ${minio_path}
|
||||
7z x ${minio_file}
|
||||
rm -f ${minio_file}
|
||||
mv minio-${version}-* minio
|
||||
if [ ! -f "${minio_path}/minio" ]; then
|
||||
rm -rf ${minio_path}
|
||||
error "minio extraction failed"
|
||||
fi
|
||||
|
||||
# 初始化目录
|
||||
mkdir -p ${minio_path}/data
|
||||
chown -R minio:minio ${minio_path}
|
||||
chmod -R 700 ${minio_path}
|
||||
ln -sf ${minio_path}/minio /usr/local/bin/minio
|
||||
|
||||
# 配置systemd
|
||||
cat >/etc/systemd/system/minio.service <<EOF
|
||||
[Unit]
|
||||
Description=MinIO
|
||||
Documentation=https://docs.min.io
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
AssertFileIsExecutable=/usr/local/bin/minio
|
||||
AssertFileNotEmpty=/etc/default/minio
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
|
||||
WorkingDirectory=${minio_path}/
|
||||
|
||||
User=minio
|
||||
Group=minio
|
||||
ProtectProc=invisible
|
||||
|
||||
EnvironmentFile=/etc/default/minio
|
||||
ExecStart=/usr/local/bin/minio server \$MINIO_OPTS \$MINIO_VOLUMES
|
||||
|
||||
# Let systemd restart this service always
|
||||
Restart=always
|
||||
|
||||
# Specifies the maximum file descriptor number that can be opened by this process
|
||||
LimitNOFILE=1048576
|
||||
|
||||
# Specifies the maximum number of threads this process can create
|
||||
TasksMax=infinity
|
||||
|
||||
# Disable timeout logic and wait until process is stopped
|
||||
TimeoutSec=infinity
|
||||
|
||||
# Disable killing of MinIO by the kernel's OOM killer
|
||||
OOMScoreAdjust=-1000
|
||||
|
||||
SendSIGKILL=no
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
chmod 644 /etc/systemd/system/minio.service
|
||||
|
||||
# 环境变量
|
||||
root_user=$(cat /dev/urandom | head -n 16 | sha256sum | head -c 8)
|
||||
root_password=$(cat /dev/urandom | head -n 16 | sha256sum | head -c 16)
|
||||
cat >/etc/default/minio <<EOF
|
||||
# MINIO_ROOT_USER and MINIO_ROOT_PASSWORD sets the root account for the MinIO server.
|
||||
# This user has unrestricted permissions to perform S3 and administrative API operations on any resource in the deployment.
|
||||
# Omit to use the default values 'minioadmin:minioadmin'.
|
||||
# MinIO recommends setting non-default values as a best practice, regardless of environment
|
||||
|
||||
MINIO_ROOT_USER=${root_user}
|
||||
MINIO_ROOT_PASSWORD=${root_password}
|
||||
|
||||
# MINIO_VOLUMES sets the storage volume or path to use for the MinIO server.
|
||||
|
||||
MINIO_VOLUMES="${minio_path}/data"
|
||||
|
||||
# MINIO_OPTS sets any additional commandline options to pass to the MinIO server.
|
||||
# For example, \$(--console-address :9001) sets the MinIO Console listen port
|
||||
MINIO_OPTS="--console-address :9001"
|
||||
EOF
|
||||
|
||||
chmod 600 /etc/default/minio
|
||||
chown minio:minio /etc/default/minio
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now minio
|
||||
if [ "$?" != "0" ]; then
|
||||
error "Failed to start"
|
||||
fi
|
||||
|
||||
# 防火墙
|
||||
firewall-cmd --zone=public --add-port=9000/tcp --permanent
|
||||
firewall-cmd --zone=public --add-port=9001/tcp --permanent
|
||||
firewall-cmd --reload
|
||||
|
||||
acepanel app write minio ${channel} ${version}
|
||||
|
||||
echo -e $HR
|
||||
echo "minio installation successful, default account see environment variables"
|
||||
echo -e $HR
|
||||
1
minio/install.sh.sha256
Normal file
1
minio/install.sh.sha256
Normal file
@@ -0,0 +1 @@
|
||||
7e154409cd8b42425a2949e09c5a5b2c4e75b2efeeb767aae35a5229364347be *install.sh
|
||||
BIN
minio/minio-20250422-amd64.7z
LFS
Normal file
BIN
minio/minio-20250422-amd64.7z
LFS
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user