mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-18 18:46:10 +02:00
fdormatting
This commit is contained in:
+24
-24
@@ -18,25 +18,25 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/AdGuardHome.service
|
||||
[Unit]
|
||||
Description=AdGuard Home: Network-level blocker
|
||||
ConditionFileIsExecutable=/opt/AdGuardHome/AdGuardHome
|
||||
After=syslog.target network-online.target
|
||||
[Unit]
|
||||
Description=AdGuard Home: Network-level blocker
|
||||
ConditionFileIsExecutable=/opt/AdGuardHome/AdGuardHome
|
||||
After=syslog.target network-online.target
|
||||
|
||||
[Service]
|
||||
StartLimitInterval=5
|
||||
StartLimitBurst=10
|
||||
ExecStart=/opt/AdGuardHome/AdGuardHome "-s" "run"
|
||||
WorkingDirectory=/opt/AdGuardHome
|
||||
StandardOutput=file:/var/log/AdGuardHome.out
|
||||
StandardError=file:/var/log/AdGuardHome.err
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
EnvironmentFile=-/etc/sysconfig/AdGuardHome
|
||||
[Service]
|
||||
StartLimitInterval=5
|
||||
StartLimitBurst=10
|
||||
ExecStart=/opt/AdGuardHome/AdGuardHome "-s" "run"
|
||||
WorkingDirectory=/opt/AdGuardHome
|
||||
StandardOutput=file:/var/log/AdGuardHome.out
|
||||
StandardError=file:/var/log/AdGuardHome.err
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
EnvironmentFile=-/etc/sysconfig/AdGuardHome
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now AdGuardHome
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
@@ -54,13 +54,13 @@ setup_alpine() {
|
||||
|
||||
msg_info "Creating AdGuard Home Service"
|
||||
cat <<EOF >/etc/init.d/adguardhome
|
||||
#!/sbin/openrc-run
|
||||
name="AdGuardHome"
|
||||
description="AdGuard Home Service"
|
||||
command="/opt/AdGuardHome/AdGuardHome"
|
||||
command_background="yes"
|
||||
pidfile="/run/adguardhome.pid"
|
||||
EOF
|
||||
#!/sbin/openrc-run
|
||||
name="AdGuardHome"
|
||||
description="AdGuard Home Service"
|
||||
command="/opt/AdGuardHome/AdGuardHome"
|
||||
command_background="yes"
|
||||
pidfile="/run/adguardhome.pid"
|
||||
EOF
|
||||
$STD chmod +x /etc/init.d/adguardhome
|
||||
msg_ok "Created AdGuard Home Service"
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ setup_deb_based() {
|
||||
read -r -p "${TAB3}Enter your TMDB API key if you have one: " tmdbapikey
|
||||
|
||||
cat <<EOF >/etc/bitmagnet.env
|
||||
POSTGRES_HOST=localhost
|
||||
POSTGRES_USER=${PG_DB_USER}
|
||||
POSTGRES_NAME=${PG_DB_NAME}
|
||||
POSTGRES_PASSWORD=${PG_DB_PASS}
|
||||
EOF
|
||||
POSTGRES_HOST=localhost
|
||||
POSTGRES_USER=${PG_DB_USER}
|
||||
POSTGRES_NAME=${PG_DB_NAME}
|
||||
POSTGRES_PASSWORD=${PG_DB_PASS}
|
||||
EOF
|
||||
|
||||
if [ -z "$tmdbapikey" ]; then
|
||||
echo "TMDB_ENABLED=false" >>/etc/bitmagnet.env
|
||||
@@ -51,21 +51,21 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/bitmagnet-web.service
|
||||
[Unit]
|
||||
Description=bitmagnet Web GUI
|
||||
After=network-online.target
|
||||
[Unit]
|
||||
Description=bitmagnet Web GUI
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/bitmagnet
|
||||
EnvironmentFile=/etc/bitmagnet.env
|
||||
ExecStart=/opt/bitmagnet/bitmagnet worker run --all
|
||||
Restart=on-failure
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/bitmagnet
|
||||
EnvironmentFile=/etc/bitmagnet.env
|
||||
ExecStart=/opt/bitmagnet/bitmagnet worker run --all
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now bitmagnet-web
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
@@ -109,23 +109,23 @@ setup_alpine() {
|
||||
|
||||
msg_info "Enabling bitmagnet Service"
|
||||
cat <<EOF >/etc/init.d/bitmagnet
|
||||
#!/sbin/openrc-run
|
||||
description="bitmagnet Service"
|
||||
directory="/opt/bitmagnet"
|
||||
command="/opt/bitmagnet/bitmagnet"
|
||||
command_args="worker run --all"
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/bitmagnet.pid"
|
||||
#!/sbin/openrc-run
|
||||
description="bitmagnet Service"
|
||||
directory="/opt/bitmagnet"
|
||||
command="/opt/bitmagnet/bitmagnet"
|
||||
command_args="worker run --all"
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/bitmagnet.pid"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
export TMDB_API_KEY="$tmdbapikey"
|
||||
}
|
||||
EOF
|
||||
start_pre() {
|
||||
export TMDB_API_KEY="$tmdbapikey"
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/bitmagnet
|
||||
$STD rc-update add bitmagnet default
|
||||
msg_ok "Enabled bitmagnet Service"
|
||||
|
||||
+22
-22
@@ -46,33 +46,33 @@ setup_alpine() {
|
||||
msg_info "Installing Caddy"
|
||||
$STD apk add --no-cache caddy caddy-openrc
|
||||
cat <<EOF >/etc/caddy/Caddyfile
|
||||
:80 {
|
||||
# Set this path to your site's directory.
|
||||
root * /var/www/html
|
||||
:80 {
|
||||
# Set this path to your site's directory.
|
||||
root * /var/www/html
|
||||
|
||||
# Enable the static file server.
|
||||
file_server
|
||||
# Enable the static file server.
|
||||
file_server
|
||||
|
||||
# Another common task is to set up a reverse proxy:
|
||||
# reverse_proxy localhost:8080
|
||||
# Another common task is to set up a reverse proxy:
|
||||
# reverse_proxy localhost:8080
|
||||
|
||||
# Or serve a PHP site through php-fpm:
|
||||
# php_fastcgi localhost:9000
|
||||
}
|
||||
EOF
|
||||
# Or serve a PHP site through php-fpm:
|
||||
# php_fastcgi localhost:9000
|
||||
}
|
||||
EOF
|
||||
mkdir -p /var/www/html
|
||||
cat <<EOF >/var/www/html/index.html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Caddy works!</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello Caddy!</h1>
|
||||
<p>For more information, refer to the Caddy <a href="https://caddyserver.com/docs/">documentation</a><p>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Caddy works!</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello Caddy!</h1>
|
||||
<p>For more information, refer to the Caddy <a href="https://caddyserver.com/docs/">documentation</a><p>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
msg_ok "Installed Caddy"
|
||||
|
||||
read -r -p "${TAB3}Would you like to install xCaddy Addon? <y/N> " prompt
|
||||
|
||||
@@ -57,10 +57,10 @@ setup_deb_based() {
|
||||
|
||||
mkdir -p /etc/systemd/system/docker.service.d
|
||||
cat <<EOF >/etc/systemd/system/docker.service.d/override.conf
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=$(command -v dockerd || echo /usr/sbin/dockerd)
|
||||
EOF
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=$(command -v dockerd || echo /usr/sbin/dockerd)
|
||||
EOF
|
||||
|
||||
$STD systemctl daemon-reexec
|
||||
$STD systemctl daemon-reload
|
||||
|
||||
+16
-16
@@ -35,22 +35,22 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/forgejo.service
|
||||
[Unit]
|
||||
Description=Forgejo
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
[Service]
|
||||
RestartSec=2s
|
||||
Type=simple
|
||||
User=git
|
||||
Group=git
|
||||
WorkingDirectory=/var/lib/forgejo/
|
||||
ExecStart=/usr/local/bin/forgejo web --config /etc/forgejo/app.ini
|
||||
Restart=always
|
||||
Environment=USER=git HOME=/home/git FORGEJO_WORK_DIR=/var/lib/forgejo
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Unit]
|
||||
Description=Forgejo
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
[Service]
|
||||
RestartSec=2s
|
||||
Type=simple
|
||||
User=git
|
||||
Group=git
|
||||
WorkingDirectory=/var/lib/forgejo/
|
||||
ExecStart=/usr/local/bin/forgejo web --config /etc/forgejo/app.ini
|
||||
Restart=always
|
||||
Environment=USER=git HOME=/home/git FORGEJO_WORK_DIR=/var/lib/forgejo
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now forgejo
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
|
||||
+82
-82
@@ -24,64 +24,64 @@ setup_deb_based() {
|
||||
ADMIN_TOKEN=$(openssl rand -base64 32)
|
||||
METRICS_TOKEN=$(openssl rand -base64 32)
|
||||
cat <<EOF >~/garage.creds
|
||||
Garage Tokens and Secrets
|
||||
RPC Secret: $RPC_SECRET
|
||||
Admin Token: $ADMIN_TOKEN
|
||||
Metrics Token: $METRICS_TOKEN
|
||||
EOF
|
||||
Garage Tokens and Secrets
|
||||
RPC Secret: $RPC_SECRET
|
||||
Admin Token: $ADMIN_TOKEN
|
||||
Metrics Token: $METRICS_TOKEN
|
||||
EOF
|
||||
echo $GITEA_RELEASE >>~/.garage
|
||||
cat <<EOF >/etc/garage.toml
|
||||
metadata_dir = "/var/lib/garage/meta"
|
||||
data_dir = "/var/lib/garage/data"
|
||||
db_engine = "sqlite"
|
||||
replication_factor = 1
|
||||
metadata_dir = "/var/lib/garage/meta"
|
||||
data_dir = "/var/lib/garage/data"
|
||||
db_engine = "sqlite"
|
||||
replication_factor = 1
|
||||
|
||||
rpc_bind_addr = "[::]:3901"
|
||||
rpc_public_addr = "127.0.0.1:3901"
|
||||
rpc_secret = "${RPC_SECRET}"
|
||||
rpc_bind_addr = "[::]:3901"
|
||||
rpc_public_addr = "127.0.0.1:3901"
|
||||
rpc_secret = "${RPC_SECRET}"
|
||||
|
||||
[s3_api]
|
||||
s3_region = "garage"
|
||||
api_bind_addr = "[::]:3900"
|
||||
root_domain = ".s3.garage.localhost"
|
||||
[s3_api]
|
||||
s3_region = "garage"
|
||||
api_bind_addr = "[::]:3900"
|
||||
root_domain = ".s3.garage.localhost"
|
||||
|
||||
[s3_web]
|
||||
bind_addr = "[::]:3902"
|
||||
root_domain = ".web.garage.localhost"
|
||||
index = "index.html"
|
||||
[s3_web]
|
||||
bind_addr = "[::]:3902"
|
||||
root_domain = ".web.garage.localhost"
|
||||
index = "index.html"
|
||||
|
||||
[k2v_api]
|
||||
api_bind_addr = "[::]:3904"
|
||||
[k2v_api]
|
||||
api_bind_addr = "[::]:3904"
|
||||
|
||||
[admin]
|
||||
api_bind_addr = "[::]:3903"
|
||||
admin_token = "${ADMIN_TOKEN}"
|
||||
metrics_token = "${METRICS_TOKEN}"
|
||||
EOF
|
||||
[admin]
|
||||
api_bind_addr = "[::]:3903"
|
||||
admin_token = "${ADMIN_TOKEN}"
|
||||
metrics_token = "${METRICS_TOKEN}"
|
||||
EOF
|
||||
msg_ok "Set up Garage"
|
||||
|
||||
msg_info "Creating service"
|
||||
cat <<'EOF' >/etc/systemd/system/garage.service
|
||||
[Unit]
|
||||
Description=Garage Object Storage (Deuxfleurs)
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
[Unit]
|
||||
Description=Garage Object Storage (Deuxfleurs)
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/garage -c /etc/garage.toml server
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
User=root
|
||||
WorkingDirectory=/var/lib/garage
|
||||
Environment=RUST_LOG=info
|
||||
StandardOutput=append:/var/log/garage.log
|
||||
StandardError=append:/var/log/garage.log
|
||||
LimitNOFILE=65536
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/garage -c /etc/garage.toml server
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
User=root
|
||||
WorkingDirectory=/var/lib/garage
|
||||
Environment=RUST_LOG=info
|
||||
StandardOutput=append:/var/log/garage.log
|
||||
StandardError=append:/var/log/garage.log
|
||||
LimitNOFILE=65536
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
$STD systemctl enable -q --now garage
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
@@ -100,54 +100,54 @@ setup_alpine() {
|
||||
ADMIN_TOKEN=$(openssl rand -base64 32)
|
||||
METRICS_TOKEN=$(openssl rand -base64 32)
|
||||
cat <<EOF >~/garage.creds
|
||||
Garage Tokens and Secrets
|
||||
RPC Secret: $RPC_SECRET
|
||||
Admin Token: $ADMIN_TOKEN
|
||||
Metrics Token: $METRICS_TOKEN
|
||||
EOF
|
||||
Garage Tokens and Secrets
|
||||
RPC Secret: $RPC_SECRET
|
||||
Admin Token: $ADMIN_TOKEN
|
||||
Metrics Token: $METRICS_TOKEN
|
||||
EOF
|
||||
echo $GITEA_RELEASE >>~/.garage
|
||||
cat <<EOF >/etc/garage.toml
|
||||
metadata_dir = "/var/lib/garage/meta"
|
||||
data_dir = "/var/lib/garage/data"
|
||||
db_engine = "sqlite"
|
||||
replication_factor = 1
|
||||
metadata_dir = "/var/lib/garage/meta"
|
||||
data_dir = "/var/lib/garage/data"
|
||||
db_engine = "sqlite"
|
||||
replication_factor = 1
|
||||
|
||||
rpc_bind_addr = "0.0.0.0:3901"
|
||||
rpc_public_addr = "127.0.0.1:3901"
|
||||
rpc_secret = "${RPC_SECRET}"
|
||||
rpc_bind_addr = "0.0.0.0:3901"
|
||||
rpc_public_addr = "127.0.0.1:3901"
|
||||
rpc_secret = "${RPC_SECRET}"
|
||||
|
||||
[s3_api]
|
||||
s3_region = "garage"
|
||||
api_bind_addr = "0.0.0.0:3900"
|
||||
root_domain = ".s3.garage"
|
||||
[s3_api]
|
||||
s3_region = "garage"
|
||||
api_bind_addr = "0.0.0.0:3900"
|
||||
root_domain = ".s3.garage"
|
||||
|
||||
[s3_web]
|
||||
bind_addr = "0.0.0.0:3902"
|
||||
root_domain = ".web.garage"
|
||||
index = "index.html"
|
||||
[s3_web]
|
||||
bind_addr = "0.0.0.0:3902"
|
||||
root_domain = ".web.garage"
|
||||
index = "index.html"
|
||||
|
||||
[k2v_api]
|
||||
api_bind_addr = "0.0.0.0:3904"
|
||||
[k2v_api]
|
||||
api_bind_addr = "0.0.0.0:3904"
|
||||
|
||||
[admin]
|
||||
api_bind_addr = "0.0.0.0:3903"
|
||||
admin_token = "${ADMIN_TOKEN}"
|
||||
metrics_token = "${METRICS_TOKEN}"
|
||||
EOF
|
||||
[admin]
|
||||
api_bind_addr = "0.0.0.0:3903"
|
||||
admin_token = "${ADMIN_TOKEN}"
|
||||
metrics_token = "${METRICS_TOKEN}"
|
||||
EOF
|
||||
msg_ok "Configured Garage"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<'EOF' >/etc/init.d/garage
|
||||
#!/sbin/openrc-run
|
||||
name="Garage Object Storage"
|
||||
command="/usr/local/bin/garage"
|
||||
command_args="server"
|
||||
command_background="yes"
|
||||
pidfile="/run/garage.pid"
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
EOF
|
||||
#!/sbin/openrc-run
|
||||
name="Garage Object Storage"
|
||||
command="/usr/local/bin/garage"
|
||||
command_args="server"
|
||||
command_background="yes"
|
||||
pidfile="/run/garage.pid"
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
EOF
|
||||
|
||||
chmod +x /etc/init.d/garage
|
||||
$STD rc-update add garage default
|
||||
|
||||
+27
-27
@@ -33,20 +33,20 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/gatus.service
|
||||
[Unit]
|
||||
Description=gatus Service
|
||||
After=network.target
|
||||
[Unit]
|
||||
Description=gatus Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/gatus
|
||||
ExecStart=/opt/gatus/gatus
|
||||
Restart=always
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/gatus
|
||||
ExecStart=/opt/gatus/gatus
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now gatus
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
@@ -75,23 +75,23 @@ setup_alpine() {
|
||||
|
||||
msg_info "Enabling gatus Service"
|
||||
cat <<EOF >/etc/init.d/gatus
|
||||
#!/sbin/openrc-run
|
||||
description="gatus Service"
|
||||
directory="/opt/gatus"
|
||||
command="/opt/gatus/gatus"
|
||||
command_args=""
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/gatus.pid"
|
||||
#!/sbin/openrc-run
|
||||
description="gatus Service"
|
||||
directory="/opt/gatus"
|
||||
command="/opt/gatus/gatus"
|
||||
command_args=""
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/gatus.pid"
|
||||
|
||||
export GATUS_CONFIG_PATH=""
|
||||
export GATUS_LOG_LEVEL="INFO"
|
||||
export PORT="8080"
|
||||
export GATUS_CONFIG_PATH=""
|
||||
export GATUS_LOG_LEVEL="INFO"
|
||||
export PORT="8080"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/gatus
|
||||
$STD rc-update add gatus default
|
||||
msg_ok "Enabled gatus Service"
|
||||
|
||||
+27
-27
@@ -36,35 +36,35 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/gitea.service
|
||||
[Unit]
|
||||
Description=Gitea (Git with a cup of tea)
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
[Unit]
|
||||
Description=Gitea (Git with a cup of tea)
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
# Uncomment notify and watchdog if you want to use them
|
||||
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
|
||||
# LimitNOFILE=524288:524288
|
||||
RestartSec=2s
|
||||
Type=simple
|
||||
#Type=notify
|
||||
User=gitea
|
||||
Group=gitea
|
||||
#The mount point we added to the container
|
||||
WorkingDirectory=/var/lib/gitea
|
||||
#Create directory in /run
|
||||
RuntimeDirectory=gitea
|
||||
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
|
||||
Restart=always
|
||||
Environment=USER=gitea HOME=/var/lib/gitea/data GITEA_WORK_DIR=/var/lib/gitea
|
||||
#WatchdogSec=30s
|
||||
#Capabilities to bind to low-numbered ports
|
||||
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||
#AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
[Service]
|
||||
# Uncomment notify and watchdog if you want to use them
|
||||
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
|
||||
# LimitNOFILE=524288:524288
|
||||
RestartSec=2s
|
||||
Type=simple
|
||||
#Type=notify
|
||||
User=gitea
|
||||
Group=gitea
|
||||
#The mount point we added to the container
|
||||
WorkingDirectory=/var/lib/gitea
|
||||
#Create directory in /run
|
||||
RuntimeDirectory=gitea
|
||||
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
|
||||
Restart=always
|
||||
Environment=USER=gitea HOME=/var/lib/gitea/data GITEA_WORK_DIR=/var/lib/gitea
|
||||
#WatchdogSec=30s
|
||||
#Capabilities to bind to low-numbered ports
|
||||
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||
#AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now gitea
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
|
||||
+48
-48
@@ -32,21 +32,21 @@ setup_deb_based() {
|
||||
GATEWAY_TOKEN=$(openssl rand -hex 32)
|
||||
mkdir -p /root/.ironclaw
|
||||
cat <<EOF >/root/.ironclaw/gateway.creds
|
||||
Gateway-Token
|
||||
Token: $GATEWAY_TOKEN
|
||||
EOF
|
||||
Gateway-Token
|
||||
Token: $GATEWAY_TOKEN
|
||||
EOF
|
||||
|
||||
mkdir -p /root/.ironclaw
|
||||
cat <<EOF >/root/.ironclaw/.env
|
||||
DATABASE_BACKEND=postgres
|
||||
DATABASE_URL=postgresql://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}?sslmode=disable
|
||||
GATEWAY_ENABLED=true
|
||||
GATEWAY_HOST=0.0.0.0
|
||||
GATEWAY_PORT=3000
|
||||
GATEWAY_AUTH_TOKEN=${GATEWAY_TOKEN}
|
||||
CLI_ENABLED=false
|
||||
RUST_LOG=ironclaw=info,tower_http=info
|
||||
EOF
|
||||
DATABASE_BACKEND=postgres
|
||||
DATABASE_URL=postgresql://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}?sslmode=disable
|
||||
GATEWAY_ENABLED=true
|
||||
GATEWAY_HOST=0.0.0.0
|
||||
GATEWAY_PORT=3000
|
||||
GATEWAY_AUTH_TOKEN=${GATEWAY_TOKEN}
|
||||
CLI_ENABLED=false
|
||||
RUST_LOG=ironclaw=info,tower_http=info
|
||||
EOF
|
||||
chmod 600 /root/.ironclaw/.env
|
||||
msg_ok "Configured Environment"
|
||||
|
||||
@@ -67,19 +67,19 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/ironclaw.service
|
||||
[Unit]
|
||||
Description=IronClaw AI Agent
|
||||
After=network.target postgresql.service
|
||||
[Unit]
|
||||
Description=IronClaw AI Agent
|
||||
After=network.target postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/dbus-run-session /usr/local/bin/ironclaw run
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/dbus-run-session /usr/local/bin/ironclaw run
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q ironclaw
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
@@ -111,21 +111,21 @@ setup_alpine() {
|
||||
GATEWAY_TOKEN=$(openssl rand -hex 32)
|
||||
mkdir -p /root/.ironclaw
|
||||
cat <<EOF >/root/.ironclaw/gateway.creds
|
||||
Gateway-Token
|
||||
Token: $GATEWAY_TOKEN
|
||||
EOF
|
||||
Gateway-Token
|
||||
Token: $GATEWAY_TOKEN
|
||||
EOF
|
||||
|
||||
mkdir -p /root/.ironclaw
|
||||
cat <<EOF >/root/.ironclaw/.env
|
||||
DATABASE_BACKEND=postgres
|
||||
DATABASE_URL=postgresql://ironclaw:${PG_PASS}@localhost:5432/ironclaw?sslmode=disable
|
||||
GATEWAY_ENABLED=true
|
||||
GATEWAY_HOST=0.0.0.0
|
||||
GATEWAY_PORT=3000
|
||||
GATEWAY_AUTH_TOKEN=${GATEWAY_TOKEN}
|
||||
CLI_ENABLED=false
|
||||
RUST_LOG=ironclaw=info,tower_http=info
|
||||
EOF
|
||||
DATABASE_BACKEND=postgres
|
||||
DATABASE_URL=postgresql://ironclaw:${PG_PASS}@localhost:5432/ironclaw?sslmode=disable
|
||||
GATEWAY_ENABLED=true
|
||||
GATEWAY_HOST=0.0.0.0
|
||||
GATEWAY_PORT=3000
|
||||
GATEWAY_AUTH_TOKEN=${GATEWAY_TOKEN}
|
||||
CLI_ENABLED=false
|
||||
RUST_LOG=ironclaw=info,tower_http=info
|
||||
EOF
|
||||
chmod 600 /root/.ironclaw/.env
|
||||
msg_ok "Configured Environment"
|
||||
|
||||
@@ -146,21 +146,21 @@ setup_alpine() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/init.d/ironclaw
|
||||
#!/sbin/openrc-run
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="IronClaw"
|
||||
description="IronClaw AI Agent"
|
||||
command="/usr/bin/dbus-run-session"
|
||||
command_args="/usr/local/bin/ironclaw"
|
||||
command_background=true
|
||||
pidfile="/run/ironclaw.pid"
|
||||
directory="/root"
|
||||
supervise_daemon_args="--env-file /root/.ironclaw/.env"
|
||||
name="IronClaw"
|
||||
description="IronClaw AI Agent"
|
||||
command="/usr/bin/dbus-run-session"
|
||||
command_args="/usr/local/bin/ironclaw"
|
||||
command_background=true
|
||||
pidfile="/run/ironclaw.pid"
|
||||
directory="/root"
|
||||
supervise_daemon_args="--env-file /root/.ironclaw/.env"
|
||||
|
||||
depend() {
|
||||
need net postgresql
|
||||
}
|
||||
EOF
|
||||
depend() {
|
||||
need net postgresql
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/ironclaw
|
||||
$STD rc-update add ironclaw default
|
||||
msg_ok "Created Service"
|
||||
|
||||
+70
-70
@@ -26,47 +26,47 @@ setup_deb_based() {
|
||||
mkdir -p /var/lib/loki/{chunks,boltdb-shipper-active,boltdb-shipper-cache}
|
||||
chown -R loki /var/lib/loki
|
||||
cat <<EOF >/etc/loki/config.yml
|
||||
auth_enabled: false
|
||||
auth_enabled: false
|
||||
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
log_level: info
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
log_level: info
|
||||
|
||||
common:
|
||||
instance_addr: 127.0.0.1
|
||||
path_prefix: /var/lib/loki
|
||||
storage:
|
||||
filesystem:
|
||||
chunks_directory: /var/lib/loki/chunks
|
||||
rules_directory: /var/lib/loki/rules
|
||||
replication_factor: 1
|
||||
ring:
|
||||
kvstore:
|
||||
store: inmemory
|
||||
common:
|
||||
instance_addr: 127.0.0.1
|
||||
path_prefix: /var/lib/loki
|
||||
storage:
|
||||
filesystem:
|
||||
chunks_directory: /var/lib/loki/chunks
|
||||
rules_directory: /var/lib/loki/rules
|
||||
replication_factor: 1
|
||||
ring:
|
||||
kvstore:
|
||||
store: inmemory
|
||||
|
||||
schema_config:
|
||||
configs:
|
||||
- from: 2020-10-24
|
||||
store: tsdb
|
||||
object_store: filesystem
|
||||
schema: v13
|
||||
index:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
schema_config:
|
||||
configs:
|
||||
- from: 2020-10-24
|
||||
store: tsdb
|
||||
object_store: filesystem
|
||||
schema: v13
|
||||
index:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
|
||||
query_range:
|
||||
results_cache:
|
||||
cache:
|
||||
embedded_cache:
|
||||
enabled: true
|
||||
max_size_mb: 100
|
||||
query_range:
|
||||
results_cache:
|
||||
cache:
|
||||
embedded_cache:
|
||||
enabled: true
|
||||
max_size_mb: 100
|
||||
|
||||
limits_config:
|
||||
metric_aggregation_enabled: true
|
||||
limits_config:
|
||||
metric_aggregation_enabled: true
|
||||
|
||||
ruler:
|
||||
alertmanager_url: http://localhost:9093
|
||||
EOF
|
||||
ruler:
|
||||
alertmanager_url: http://localhost:9093
|
||||
EOF
|
||||
chown loki /etc/loki/config.yml
|
||||
systemctl enable -q --now loki
|
||||
msg_ok "Installed Loki"
|
||||
@@ -81,47 +81,47 @@ setup_alpine() {
|
||||
mkdir -p /var/log/loki
|
||||
chown -R loki:grafana /var/log/loki
|
||||
cat <<EOF >/etc/loki/loki-local-config.yaml
|
||||
auth_enabled: false
|
||||
auth_enabled: false
|
||||
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
log_level: info
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
log_level: info
|
||||
|
||||
common:
|
||||
instance_addr: 127.0.0.1
|
||||
path_prefix: /var/lib/loki
|
||||
storage:
|
||||
filesystem:
|
||||
chunks_directory: /var/lib/loki/chunks
|
||||
rules_directory: /var/lib/loki/rules
|
||||
replication_factor: 1
|
||||
ring:
|
||||
kvstore:
|
||||
store: inmemory
|
||||
common:
|
||||
instance_addr: 127.0.0.1
|
||||
path_prefix: /var/lib/loki
|
||||
storage:
|
||||
filesystem:
|
||||
chunks_directory: /var/lib/loki/chunks
|
||||
rules_directory: /var/lib/loki/rules
|
||||
replication_factor: 1
|
||||
ring:
|
||||
kvstore:
|
||||
store: inmemory
|
||||
|
||||
schema_config:
|
||||
configs:
|
||||
- from: 2020-10-24
|
||||
store: tsdb
|
||||
object_store: filesystem
|
||||
schema: v13
|
||||
index:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
schema_config:
|
||||
configs:
|
||||
- from: 2020-10-24
|
||||
store: tsdb
|
||||
object_store: filesystem
|
||||
schema: v13
|
||||
index:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
|
||||
query_range:
|
||||
results_cache:
|
||||
cache:
|
||||
embedded_cache:
|
||||
enabled: true
|
||||
max_size_mb: 100
|
||||
query_range:
|
||||
results_cache:
|
||||
cache:
|
||||
embedded_cache:
|
||||
enabled: true
|
||||
max_size_mb: 100
|
||||
|
||||
limits_config:
|
||||
metric_aggregation_enabled: true
|
||||
limits_config:
|
||||
metric_aggregation_enabled: true
|
||||
|
||||
ruler:
|
||||
alertmanager_url: http://localhost:9093
|
||||
EOF
|
||||
ruler:
|
||||
alertmanager_url: http://localhost:9093
|
||||
EOF
|
||||
chown loki:grafana /etc/loki/loki-local-config.yaml
|
||||
chmod 644 /etc/loki/loki-local-config.yaml
|
||||
echo "output_log=\"\${output_log:-/var/log/loki/output.log}\"" >> /etc/init.d/loki
|
||||
|
||||
@@ -22,104 +22,104 @@ setup_deb_based() {
|
||||
PG_VERSION=$ver setup_postgresql
|
||||
|
||||
cat <<EOF >/etc/postgresql/$ver/main/pg_hba.conf
|
||||
# PostgreSQL Client Authentication Configuration File
|
||||
local all postgres peer
|
||||
# TYPE DATABASE USER ADDRESS METHOD
|
||||
# "local" is for Unix domain socket connections only
|
||||
local all all md5
|
||||
# IPv4 local connections:
|
||||
host all all 127.0.0.1/32 scram-sha-256
|
||||
host all all 0.0.0.0/24 md5
|
||||
# IPv6 local connections:
|
||||
host all all ::1/128 scram-sha-256
|
||||
host all all 0.0.0.0/0 md5
|
||||
# Allow replication connections from localhost, by a user with the
|
||||
# replication privilege.
|
||||
local replication all peer
|
||||
host replication all 127.0.0.1/32 scram-sha-256
|
||||
host replication all ::1/128 scram-sha-256
|
||||
EOF
|
||||
# PostgreSQL Client Authentication Configuration File
|
||||
local all postgres peer
|
||||
# TYPE DATABASE USER ADDRESS METHOD
|
||||
# "local" is for Unix domain socket connections only
|
||||
local all all md5
|
||||
# IPv4 local connections:
|
||||
host all all 127.0.0.1/32 scram-sha-256
|
||||
host all all 0.0.0.0/24 md5
|
||||
# IPv6 local connections:
|
||||
host all all ::1/128 scram-sha-256
|
||||
host all all 0.0.0.0/0 md5
|
||||
# Allow replication connections from localhost, by a user with the
|
||||
# replication privilege.
|
||||
local replication all peer
|
||||
host replication all 127.0.0.1/32 scram-sha-256
|
||||
host replication all ::1/128 scram-sha-256
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/postgresql/$ver/main/postgresql.conf
|
||||
# -----------------------------
|
||||
# PostgreSQL configuration file
|
||||
# -----------------------------
|
||||
# -----------------------------
|
||||
# PostgreSQL configuration file
|
||||
# -----------------------------
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# FILE LOCATIONS
|
||||
#------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
# FILE LOCATIONS
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
data_directory = '/var/lib/postgresql/$ver/main'
|
||||
hba_file = '/etc/postgresql/$ver/main/pg_hba.conf'
|
||||
ident_file = '/etc/postgresql/$ver/main/pg_ident.conf'
|
||||
external_pid_file = '/var/run/postgresql/$ver-main.pid'
|
||||
data_directory = '/var/lib/postgresql/$ver/main'
|
||||
hba_file = '/etc/postgresql/$ver/main/pg_hba.conf'
|
||||
ident_file = '/etc/postgresql/$ver/main/pg_ident.conf'
|
||||
external_pid_file = '/var/run/postgresql/$ver-main.pid'
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# CONNECTIONS AND AUTHENTICATION
|
||||
#------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
# CONNECTIONS AND AUTHENTICATION
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# - Connection Settings -
|
||||
# - Connection Settings -
|
||||
|
||||
listen_addresses = '*'
|
||||
port = 5432
|
||||
max_connections = 100
|
||||
unix_socket_directories = '/var/run/postgresql'
|
||||
listen_addresses = '*'
|
||||
port = 5432
|
||||
max_connections = 100
|
||||
unix_socket_directories = '/var/run/postgresql'
|
||||
|
||||
# - SSL -
|
||||
# - SSL -
|
||||
|
||||
ssl = on
|
||||
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
|
||||
ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'
|
||||
ssl = on
|
||||
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
|
||||
ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# RESOURCE USAGE (except WAL)
|
||||
#------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
# RESOURCE USAGE (except WAL)
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
shared_buffers = 128MB
|
||||
dynamic_shared_memory_type = posix
|
||||
shared_buffers = 128MB
|
||||
dynamic_shared_memory_type = posix
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# WRITE-AHEAD LOG
|
||||
#------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
# WRITE-AHEAD LOG
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
max_wal_size = 1GB
|
||||
min_wal_size = 80MB
|
||||
max_wal_size = 1GB
|
||||
min_wal_size = 80MB
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# REPORTING AND LOGGING
|
||||
#------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
# REPORTING AND LOGGING
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# - What to Log -
|
||||
# - What to Log -
|
||||
|
||||
log_line_prefix = '%m [%p] %q%u@%d '
|
||||
log_timezone = 'Etc/UTC'
|
||||
log_line_prefix = '%m [%p] %q%u@%d '
|
||||
log_timezone = 'Etc/UTC'
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# PROCESS TITLE
|
||||
#------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
# PROCESS TITLE
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
cluster_name = '$ver/main'
|
||||
cluster_name = '$ver/main'
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# CLIENT CONNECTION DEFAULTS
|
||||
#------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
# CLIENT CONNECTION DEFAULTS
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# - Locale and Formatting -
|
||||
# - Locale and Formatting -
|
||||
|
||||
datestyle = 'iso, mdy'
|
||||
timezone = 'Etc/UTC'
|
||||
lc_messages = 'C'
|
||||
lc_monetary = 'C'
|
||||
lc_numeric = 'C'
|
||||
lc_time = 'C'
|
||||
default_text_search_config = 'pg_catalog.english'
|
||||
datestyle = 'iso, mdy'
|
||||
timezone = 'Etc/UTC'
|
||||
lc_messages = 'C'
|
||||
lc_monetary = 'C'
|
||||
lc_numeric = 'C'
|
||||
lc_time = 'C'
|
||||
default_text_search_config = 'pg_catalog.english'
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# CONFIG FILE INCLUDES
|
||||
#------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
# CONFIG FILE INCLUDES
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
include_dir = 'conf.d'
|
||||
EOF
|
||||
include_dir = 'conf.d'
|
||||
EOF
|
||||
|
||||
systemctl restart postgresql
|
||||
msg_ok "Installed PostgreSQL"
|
||||
|
||||
@@ -24,24 +24,24 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<'EOF' >/etc/systemd/system/prometheus.service
|
||||
[Unit]
|
||||
Description=Prometheus
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
[Unit]
|
||||
Description=Prometheus
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
Restart=always
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/prometheus \
|
||||
--config.file=/etc/prometheus/prometheus.yml \
|
||||
--storage.tsdb.path=/var/lib/prometheus/ \
|
||||
--web.listen-address=0.0.0.0:9090
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
[Service]
|
||||
User=root
|
||||
Restart=always
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/prometheus \
|
||||
--config.file=/etc/prometheus/prometheus.yml \
|
||||
--storage.tsdb.path=/var/lib/prometheus/ \
|
||||
--web.listen-address=0.0.0.0:9090
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now prometheus
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
|
||||
+31
-31
@@ -25,28 +25,28 @@ setup_deb_based() {
|
||||
RCLONE_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||
$STD htpasswd -cb -B /opt/login.pwd admin "$RCLONE_PASSWORD"
|
||||
cat <<EOF >~/rclone.creds
|
||||
rclone-Credentials
|
||||
rclone User Name: admin
|
||||
rclone Password: $RCLONE_PASSWORD
|
||||
EOF
|
||||
rclone-Credentials
|
||||
rclone User Name: admin
|
||||
rclone Password: $RCLONE_PASSWORD
|
||||
EOF
|
||||
msg_ok "Installed rclone"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/rclone-web.service
|
||||
[Unit]
|
||||
Description=Rclone Web GUI
|
||||
After=network-online.target
|
||||
[Unit]
|
||||
Description=Rclone Web GUI
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/rclone
|
||||
ExecStart=/opt/rclone/rclone rcd --rc-web-gui --rc-web-gui-no-open-browser --rc-addr :3000 --rc-htpasswd /opt/login.pwd
|
||||
Restart=on-failure
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/rclone
|
||||
ExecStart=/opt/rclone/rclone rcd --rc-web-gui --rc-web-gui-no-open-browser --rc-addr :3000 --rc-htpasswd /opt/login.pwd
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now rclone-web
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
@@ -67,28 +67,28 @@ setup_alpine() {
|
||||
RCLONE_PASSWORD=$(head -c 16 /dev/urandom | xxd -p -c 16)
|
||||
$STD htpasswd -cb -B /opt/login.pwd admin "$RCLONE_PASSWORD"
|
||||
cat <<EOF >~/rclone.creds
|
||||
rclone-Credentials
|
||||
rclone User Name: admin
|
||||
rclone Password: $RCLONE_PASSWORD
|
||||
EOF
|
||||
rclone-Credentials
|
||||
rclone User Name: admin
|
||||
rclone Password: $RCLONE_PASSWORD
|
||||
EOF
|
||||
echo "${RELEASE}" >/opt/rclone_version.txt
|
||||
rm -f "$temp_file"
|
||||
msg_ok "Installed rclone"
|
||||
|
||||
msg_info "Enabling rclone Service"
|
||||
cat <<EOF >/etc/init.d/rclone
|
||||
#!/sbin/openrc-run
|
||||
description="rclone Service"
|
||||
command="/opt/rclone/rclone"
|
||||
command_args="rcd --rc-web-gui --rc-web-gui-no-open-browser --rc-addr :3000 --rc-htpasswd /opt/login.pwd"
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rclone.pid"
|
||||
#!/sbin/openrc-run
|
||||
description="rclone Service"
|
||||
command="/opt/rclone/rclone"
|
||||
command_args="rcd --rc-web-gui --rc-web-gui-no-open-browser --rc-addr :3000 --rc-htpasswd /opt/login.pwd"
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rclone.pid"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/rclone
|
||||
$STD rc-update add rclone default
|
||||
msg_ok "Enabled rclone Service"
|
||||
|
||||
@@ -52,65 +52,65 @@ setup_alpine() {
|
||||
ADMINPASS=$(head -c 16 /dev/urandom | xxd -p -c 16)
|
||||
$STD ./apimain reset-admin-pwd "$ADMINPASS"
|
||||
cat <<EOF >~/rustdesk.creds
|
||||
RustDesk WebUI
|
||||
RustDesk WebUI
|
||||
|
||||
Username: admin
|
||||
Password: $ADMINPASS
|
||||
EOF
|
||||
Username: admin
|
||||
Password: $ADMINPASS
|
||||
EOF
|
||||
echo "${APIRELEASE}" >~/.rustdesk-api
|
||||
msg_ok "Installed RustDesk API v${APIRELEASE}"
|
||||
|
||||
msg_info "Enabling RustDesk Server Services"
|
||||
cat <<EOF >/etc/init.d/rustdesk-server-hbbs
|
||||
#!/sbin/openrc-run
|
||||
description="RustDesk HBBS Service"
|
||||
directory="/opt/rustdesk-server"
|
||||
command="/opt/rustdesk-server/hbbs"
|
||||
command_args=""
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rustdesk-server-hbbs.pid"
|
||||
output_log="/var/log/rustdesk-hbbs.log"
|
||||
error_log="/var/log/rustdesk-hbbs.err"
|
||||
#!/sbin/openrc-run
|
||||
description="RustDesk HBBS Service"
|
||||
directory="/opt/rustdesk-server"
|
||||
command="/opt/rustdesk-server/hbbs"
|
||||
command_args=""
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rustdesk-server-hbbs.pid"
|
||||
output_log="/var/log/rustdesk-hbbs.log"
|
||||
error_log="/var/log/rustdesk-hbbs.err"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/init.d/rustdesk-server-hbbr
|
||||
#!/sbin/openrc-run
|
||||
description="RustDesk HBBR Service"
|
||||
directory="/opt/rustdesk-server"
|
||||
command="/opt/rustdesk-server/hbbr"
|
||||
command_args=""
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rustdesk-server-hbbr.pid"
|
||||
output_log="/var/log/rustdesk-hbbr.log"
|
||||
error_log="/var/log/rustdesk-hbbr.err"
|
||||
#!/sbin/openrc-run
|
||||
description="RustDesk HBBR Service"
|
||||
directory="/opt/rustdesk-server"
|
||||
command="/opt/rustdesk-server/hbbr"
|
||||
command_args=""
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rustdesk-server-hbbr.pid"
|
||||
output_log="/var/log/rustdesk-hbbr.log"
|
||||
error_log="/var/log/rustdesk-hbbr.err"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/init.d/rustdesk-api
|
||||
#!/sbin/openrc-run
|
||||
description="RustDesk API Service"
|
||||
directory="/opt/rustdesk-api"
|
||||
command="/opt/rustdesk-api/apimain"
|
||||
command_args=""
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rustdesk-api.pid"
|
||||
output_log="/var/log/rustdesk-api.log"
|
||||
error_log="/var/log/rustdesk-api.err"
|
||||
#!/sbin/openrc-run
|
||||
description="RustDesk API Service"
|
||||
directory="/opt/rustdesk-api"
|
||||
command="/opt/rustdesk-api/apimain"
|
||||
command_args=""
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rustdesk-api.pid"
|
||||
output_log="/var/log/rustdesk-api.log"
|
||||
error_log="/var/log/rustdesk-api.err"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/rustdesk-server-hbbs
|
||||
chmod +x /etc/init.d/rustdesk-server-hbbr
|
||||
chmod +x /etc/init.d/rustdesk-api
|
||||
|
||||
@@ -24,18 +24,18 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/rustypaste.service
|
||||
[Unit]
|
||||
Description=rustypaste Service
|
||||
After=network.target
|
||||
[Unit]
|
||||
Description=rustypaste Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/opt/rustypaste
|
||||
ExecStart=/opt/rustypaste/rustypaste
|
||||
Restart=always
|
||||
[Service]
|
||||
WorkingDirectory=/opt/rustypaste
|
||||
ExecStart=/opt/rustypaste/rustypaste
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now rustypaste
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
@@ -52,27 +52,27 @@ setup_alpine() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<'EOF' >/etc/init.d/rustypaste
|
||||
#!/sbin/openrc-run
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="rustypaste"
|
||||
description="RustyPaste - A minimal file upload/pastebin service"
|
||||
command="/usr/bin/rustypaste"
|
||||
command_args=""
|
||||
command_user="root"
|
||||
command_background=true
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
directory="/var/lib/rustypaste"
|
||||
name="rustypaste"
|
||||
description="RustyPaste - A minimal file upload/pastebin service"
|
||||
command="/usr/bin/rustypaste"
|
||||
command_args=""
|
||||
command_user="root"
|
||||
command_background=true
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
directory="/var/lib/rustypaste"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
after firewall
|
||||
}
|
||||
depend() {
|
||||
need net
|
||||
after firewall
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
export CONFIG=/etc/rustypaste/config.toml
|
||||
checkpath --directory --owner root:root --mode 0755 /var/lib/rustypaste
|
||||
}
|
||||
EOF
|
||||
start_pre() {
|
||||
export CONFIG=/etc/rustypaste/config.toml
|
||||
checkpath --directory --owner root:root --mode 0755 /var/lib/rustypaste
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/rustypaste
|
||||
$STD rc-update add rustypaste default
|
||||
$STD rc-service rustypaste start
|
||||
|
||||
@@ -27,24 +27,24 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating service"
|
||||
cat <<EOF >/etc/systemd/system/teamspeak-server.service
|
||||
[Unit]
|
||||
Description=TeamSpeak3 Server
|
||||
Wants=network-online.target
|
||||
After=network.target
|
||||
[Unit]
|
||||
Description=TeamSpeak3 Server
|
||||
Wants=network-online.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/opt/teamspeak-server
|
||||
User=root
|
||||
Type=forking
|
||||
ExecStart=/opt/teamspeak-server/ts3server_startscript.sh start
|
||||
ExecStop=/opt/teamspeak-server/ts3server_startscript.sh stop
|
||||
ExecReload=/opt/teamspeak-server/ts3server_startscript.sh restart
|
||||
Restart=always
|
||||
RestartSec=15
|
||||
[Service]
|
||||
WorkingDirectory=/opt/teamspeak-server
|
||||
User=root
|
||||
Type=forking
|
||||
ExecStart=/opt/teamspeak-server/ts3server_startscript.sh start
|
||||
ExecStop=/opt/teamspeak-server/ts3server_startscript.sh stop
|
||||
ExecReload=/opt/teamspeak-server/ts3server_startscript.sh restart
|
||||
Restart=always
|
||||
RestartSec=15
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now teamspeak-server
|
||||
msg_ok "Created service"
|
||||
}
|
||||
@@ -71,23 +71,23 @@ setup_alpine() {
|
||||
|
||||
msg_info "Enabling TeamSpeak Server Service"
|
||||
cat <<EOF >/etc/init.d/teamspeak
|
||||
#!/sbin/openrc-run
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="TeamSpeak Server"
|
||||
description="TeamSpeak 3 Server"
|
||||
command="/opt/teamspeak-server/ts3server_startscript.sh"
|
||||
command_args="start"
|
||||
output_log="/var/log/teamspeak.out.log"
|
||||
error_log="/var/log/teamspeak.err.log"
|
||||
command_background=true
|
||||
pidfile="/run/teamspeak-server.pid"
|
||||
directory="/opt/teamspeak-server"
|
||||
name="TeamSpeak Server"
|
||||
description="TeamSpeak 3 Server"
|
||||
command="/opt/teamspeak-server/ts3server_startscript.sh"
|
||||
command_args="start"
|
||||
output_log="/var/log/teamspeak.out.log"
|
||||
error_log="/var/log/teamspeak.err.log"
|
||||
command_background=true
|
||||
pidfile="/run/teamspeak-server.pid"
|
||||
directory="/opt/teamspeak-server"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use dns
|
||||
}
|
||||
EOF
|
||||
depend() {
|
||||
need net
|
||||
use dns
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/teamspeak
|
||||
$STD rc-update add teamspeak default
|
||||
msg_ok "Enabled TeamSpeak Server Service"
|
||||
|
||||
+43
-43
@@ -26,35 +26,35 @@ setup_deb_based() {
|
||||
PASS=$(openssl rand -base64 8 | tr -dc 'a-zA-Z0-9' | head -c 8)
|
||||
USER=$(htpasswd -Bbn "tinyauth" "${PASS}")
|
||||
cat <<EOF >/opt/tinyauth/credentials.txt
|
||||
Tinyauth Credentials
|
||||
Username: tinyauth
|
||||
Password: ${PASS}
|
||||
EOF
|
||||
Tinyauth Credentials
|
||||
Username: tinyauth
|
||||
Password: ${PASS}
|
||||
EOF
|
||||
msg_ok "Set up Tinyauth"
|
||||
|
||||
read -r -p "${TAB3}Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/opt/tinyauth/.env
|
||||
TINYAUTH_DATABASE_PATH=/opt/tinyauth/database.db
|
||||
TINYAUTH_AUTH_USERS='${USER}'
|
||||
TINYAUTH_APPURL=${app_url}
|
||||
EOF
|
||||
TINYAUTH_DATABASE_PATH=/opt/tinyauth/database.db
|
||||
TINYAUTH_AUTH_USERS='${USER}'
|
||||
TINYAUTH_APPURL=${app_url}
|
||||
EOF
|
||||
cat <<EOF >/etc/systemd/system/tinyauth.service
|
||||
[Unit]
|
||||
Description=Tinyauth Service
|
||||
After=network.target
|
||||
[Unit]
|
||||
Description=Tinyauth Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
EnvironmentFile=/opt/tinyauth/.env
|
||||
ExecStart=/opt/tinyauth/tinyauth
|
||||
WorkingDirectory=/opt/tinyauth
|
||||
Restart=on-failure
|
||||
[Service]
|
||||
Type=simple
|
||||
EnvironmentFile=/opt/tinyauth/.env
|
||||
ExecStart=/opt/tinyauth/tinyauth
|
||||
WorkingDirectory=/opt/tinyauth
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now tinyauth
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
@@ -73,41 +73,41 @@ setup_alpine() {
|
||||
USER=$(htpasswd -Bbn "tinyauth" "${PASS}")
|
||||
|
||||
cat <<EOF >/opt/tinyauth/credentials.txt
|
||||
Tinyauth Credentials
|
||||
Username: tinyauth
|
||||
Password: ${PASS}
|
||||
EOF
|
||||
Tinyauth Credentials
|
||||
Username: tinyauth
|
||||
Password: ${PASS}
|
||||
EOF
|
||||
echo "${RELEASE}" >~/.tinyauth
|
||||
msg_ok "Installed Tinyauth"
|
||||
|
||||
read -r -p "${TAB3}Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url
|
||||
|
||||
cat <<EOF >/opt/tinyauth/.env
|
||||
TINYAUTH_DATABASE_PATH=/opt/tinyauth/database.db
|
||||
TINYAUTH_AUTH_USERS='${USER}'
|
||||
TINYAUTH_APPURL=${app_url}
|
||||
EOF
|
||||
TINYAUTH_DATABASE_PATH=/opt/tinyauth/database.db
|
||||
TINYAUTH_AUTH_USERS='${USER}'
|
||||
TINYAUTH_APPURL=${app_url}
|
||||
EOF
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<'EOF' >/etc/init.d/tinyauth
|
||||
#!/sbin/openrc-run
|
||||
description="Tinyauth Service"
|
||||
#!/sbin/openrc-run
|
||||
description="Tinyauth Service"
|
||||
|
||||
set -a
|
||||
ENV_FILE="/opt/tinyauth/.env"
|
||||
[ -f "$ENV_FILE" ] && . "$ENV_FILE"
|
||||
set +a
|
||||
set -a
|
||||
ENV_FILE="/opt/tinyauth/.env"
|
||||
[ -f "$ENV_FILE" ] && . "$ENV_FILE"
|
||||
set +a
|
||||
|
||||
command="/opt/tinyauth/tinyauth"
|
||||
directory="/opt/tinyauth"
|
||||
command_user="root"
|
||||
command_background="true"
|
||||
pidfile="/var/run/tinyauth.pid"
|
||||
command="/opt/tinyauth/tinyauth"
|
||||
directory="/opt/tinyauth"
|
||||
command_user="root"
|
||||
command_background="true"
|
||||
pidfile="/var/run/tinyauth.pid"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/tinyauth
|
||||
$STD rc-update add tinyauth default
|
||||
msg_ok "Enabled Tinyauth Service"
|
||||
|
||||
+57
-57
@@ -23,74 +23,74 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating Traefik configuration"
|
||||
cat <<EOF >/etc/traefik/traefik.yaml
|
||||
providers:
|
||||
file:
|
||||
directory: /etc/traefik/conf.d/
|
||||
providers:
|
||||
file:
|
||||
directory: /etc/traefik/conf.d/
|
||||
|
||||
entryPoints:
|
||||
web:
|
||||
address: ':80'
|
||||
http:
|
||||
redirections:
|
||||
entryPoint:
|
||||
to: websecure
|
||||
scheme: https
|
||||
websecure:
|
||||
address: ':443'
|
||||
http:
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
traefik:
|
||||
address: ':8080'
|
||||
entryPoints:
|
||||
web:
|
||||
address: ':80'
|
||||
http:
|
||||
redirections:
|
||||
entryPoint:
|
||||
to: websecure
|
||||
scheme: https
|
||||
websecure:
|
||||
address: ':443'
|
||||
http:
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
traefik:
|
||||
address: ':8080'
|
||||
|
||||
certificatesResolvers:
|
||||
letsencrypt:
|
||||
acme:
|
||||
email: "foo@bar.com"
|
||||
storage: /etc/traefik/ssl/acme.json
|
||||
tlsChallenge: {}
|
||||
certificatesResolvers:
|
||||
letsencrypt:
|
||||
acme:
|
||||
email: "foo@bar.com"
|
||||
storage: /etc/traefik/ssl/acme.json
|
||||
tlsChallenge: {}
|
||||
|
||||
api:
|
||||
dashboard: true
|
||||
insecure: true
|
||||
api:
|
||||
dashboard: true
|
||||
insecure: true
|
||||
|
||||
log:
|
||||
filePath: /var/log/traefik/traefik.log
|
||||
format: json
|
||||
level: INFO
|
||||
log:
|
||||
filePath: /var/log/traefik/traefik.log
|
||||
format: json
|
||||
level: INFO
|
||||
|
||||
accessLog:
|
||||
filePath: /var/log/traefik/traefik-access.log
|
||||
format: json
|
||||
filters:
|
||||
statusCodes:
|
||||
- "200"
|
||||
- "400-599"
|
||||
retryAttempts: true
|
||||
minDuration: "10ms"
|
||||
bufferingSize: 0
|
||||
fields:
|
||||
headers:
|
||||
defaultMode: drop
|
||||
names:
|
||||
User-Agent: keep
|
||||
EOF
|
||||
accessLog:
|
||||
filePath: /var/log/traefik/traefik-access.log
|
||||
format: json
|
||||
filters:
|
||||
statusCodes:
|
||||
- "200"
|
||||
- "400-599"
|
||||
retryAttempts: true
|
||||
minDuration: "10ms"
|
||||
bufferingSize: 0
|
||||
fields:
|
||||
headers:
|
||||
defaultMode: drop
|
||||
names:
|
||||
User-Agent: keep
|
||||
EOF
|
||||
msg_ok "Created Traefik configuration"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<'EOF' >/etc/systemd/system/traefik.service
|
||||
[Unit]
|
||||
Description=Traefik is an open-source Edge Router that makes publishing your services a fun and easy experience
|
||||
[Unit]
|
||||
Description=Traefik is an open-source Edge Router that makes publishing your services a fun and easy experience
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
ExecStart=/usr/bin/traefik --configFile=/etc/traefik/traefik.yaml
|
||||
Restart=on-failure
|
||||
ExecReload=/bin/kill -USR1 \$MAINPID
|
||||
[Service]
|
||||
Type=notify
|
||||
ExecStart=/usr/bin/traefik --configFile=/etc/traefik/traefik.yaml
|
||||
Restart=on-failure
|
||||
ExecReload=/bin/kill -USR1 \$MAINPID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now traefik
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
|
||||
+18
-18
@@ -50,23 +50,23 @@ setup_deb_based() {
|
||||
if [[ ${tls_only,,} =~ ^(y|yes)$ ]]; then
|
||||
cat <<EOF >/etc/valkey/valkey.conf
|
||||
|
||||
# TLS configuration generated by Proxmox VE Valkey helper-script
|
||||
port 0
|
||||
tls-port 6379
|
||||
tls-cert-file $TLS_DIR/valkey.crt
|
||||
tls-key-file $TLS_DIR/valkey.key
|
||||
tls-auth-clients no
|
||||
EOF
|
||||
# TLS configuration generated by Proxmox VE Valkey helper-script
|
||||
port 0
|
||||
tls-port 6379
|
||||
tls-cert-file $TLS_DIR/valkey.crt
|
||||
tls-key-file $TLS_DIR/valkey.key
|
||||
tls-auth-clients no
|
||||
EOF
|
||||
msg_ok "Enabled TLS-only mode on port 6379"
|
||||
else
|
||||
cat <<EOF >/etc/valkey/valkey.conf
|
||||
|
||||
# TLS configuration generated by Proxmox VE Valkey helper-script
|
||||
tls-port 6380
|
||||
tls-cert-file $TLS_DIR/valkey.crt
|
||||
tls-key-file $TLS_DIR/valkey.key
|
||||
tls-auth-clients no
|
||||
EOF
|
||||
# TLS configuration generated by Proxmox VE Valkey helper-script
|
||||
tls-port 6380
|
||||
tls-cert-file $TLS_DIR/valkey.crt
|
||||
tls-key-file $TLS_DIR/valkey.key
|
||||
tls-auth-clients no
|
||||
EOF
|
||||
msg_ok "Enabled TLS on port 6380 and TCP on 6379"
|
||||
fi
|
||||
fi
|
||||
@@ -89,11 +89,11 @@ setup_alpine() {
|
||||
MAXMEMORY_MB=$((MEMTOTAL_MB * 75 / 100))
|
||||
|
||||
cat <<EOF >/etc/valkey/valkey.conf
|
||||
# Memory-optimized settings for small-scale deployments
|
||||
maxmemory ${MAXMEMORY_MB}mb
|
||||
maxmemory-policy allkeys-lru
|
||||
maxmemory-samples 10
|
||||
EOF
|
||||
# Memory-optimized settings for small-scale deployments
|
||||
maxmemory ${MAXMEMORY_MB}mb
|
||||
maxmemory-policy allkeys-lru
|
||||
maxmemory-samples 10
|
||||
EOF
|
||||
msg_ok "Installed Valkey"
|
||||
|
||||
# Note: Alpine's valkey package is compiled without TLS support
|
||||
|
||||
@@ -47,14 +47,14 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Configuring Vaultwarden"
|
||||
cat <<EOF >/opt/vaultwarden/.env
|
||||
ADMIN_TOKEN=''
|
||||
ROCKET_ADDRESS=0.0.0.0
|
||||
ROCKET_TLS='{certs="/opt/vaultwarden/ssl-cert-snakeoil.pem",key="/opt/vaultwarden/ssl-cert-snakeoil.key"}'
|
||||
DATA_FOLDER=/opt/vaultwarden/data
|
||||
DATABASE_MAX_CONNS=10
|
||||
WEB_VAULT_FOLDER=/opt/vaultwarden/web-vault
|
||||
WEB_VAULT_ENABLED=true
|
||||
EOF
|
||||
ADMIN_TOKEN=''
|
||||
ROCKET_ADDRESS=0.0.0.0
|
||||
ROCKET_TLS='{certs="/opt/vaultwarden/ssl-cert-snakeoil.pem",key="/opt/vaultwarden/ssl-cert-snakeoil.key"}'
|
||||
DATA_FOLDER=/opt/vaultwarden/data
|
||||
DATABASE_MAX_CONNS=10
|
||||
WEB_VAULT_FOLDER=/opt/vaultwarden/web-vault
|
||||
WEB_VAULT_ENABLED=true
|
||||
EOF
|
||||
mv /etc/ssl/certs/ssl-cert-snakeoil.pem /opt/vaultwarden/
|
||||
mv /etc/ssl/private/ssl-cert-snakeoil.key /opt/vaultwarden/
|
||||
|
||||
@@ -67,37 +67,37 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/vaultwarden.service
|
||||
[Unit]
|
||||
Description=Bitwarden Server (Powered by Vaultwarden)
|
||||
Documentation=https://github.com/dani-garcia/vaultwarden
|
||||
After=network.target
|
||||
[Unit]
|
||||
Description=Bitwarden Server (Powered by Vaultwarden)
|
||||
Documentation=https://github.com/dani-garcia/vaultwarden
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=vaultwarden
|
||||
Group=vaultwarden
|
||||
EnvironmentFile=-/opt/vaultwarden/.env
|
||||
ExecStart=/opt/vaultwarden/bin/vaultwarden
|
||||
LimitNOFILE=65535
|
||||
LimitNPROC=4096
|
||||
PrivateTmp=true
|
||||
PrivateDevices=true
|
||||
ProtectHome=true
|
||||
ProtectSystem=strict
|
||||
DevicePolicy=closed
|
||||
ProtectControlGroups=yes
|
||||
ProtectKernelModules=yes
|
||||
ProtectKernelTunables=yes
|
||||
RestrictNamespaces=yes
|
||||
RestrictRealtime=yes
|
||||
MemoryDenyWriteExecute=yes
|
||||
LockPersonality=yes
|
||||
WorkingDirectory=/opt/vaultwarden
|
||||
ReadWriteDirectories=/opt/vaultwarden/data
|
||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
[Service]
|
||||
User=vaultwarden
|
||||
Group=vaultwarden
|
||||
EnvironmentFile=-/opt/vaultwarden/.env
|
||||
ExecStart=/opt/vaultwarden/bin/vaultwarden
|
||||
LimitNOFILE=65535
|
||||
LimitNPROC=4096
|
||||
PrivateTmp=true
|
||||
PrivateDevices=true
|
||||
ProtectHome=true
|
||||
ProtectSystem=strict
|
||||
DevicePolicy=closed
|
||||
ProtectControlGroups=yes
|
||||
ProtectKernelModules=yes
|
||||
ProtectKernelTunables=yes
|
||||
RestrictNamespaces=yes
|
||||
RestrictRealtime=yes
|
||||
MemoryDenyWriteExecute=yes
|
||||
LockPersonality=yes
|
||||
WorkingDirectory=/opt/vaultwarden
|
||||
ReadWriteDirectories=/opt/vaultwarden/data
|
||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now vaultwarden
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
|
||||
@@ -45,37 +45,37 @@ setup_deb_based() {
|
||||
msg_info "Create Example Config for WGDashboard"
|
||||
private_key=$(wg genkey)
|
||||
cat <<EOF >/etc/wireguard/wg0.conf
|
||||
[Interface]
|
||||
PrivateKey = ${private_key}
|
||||
Address = 10.0.0.1/24
|
||||
SaveConfig = true
|
||||
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;
|
||||
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
|
||||
ListenPort = 51820
|
||||
EOF
|
||||
[Interface]
|
||||
PrivateKey = ${private_key}
|
||||
Address = 10.0.0.1/24
|
||||
SaveConfig = true
|
||||
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;
|
||||
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
|
||||
ListenPort = 51820
|
||||
EOF
|
||||
msg_ok "Created Example Config for WGDashboard"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/wg-dashboard.service
|
||||
[Unit]
|
||||
After=syslog.target network-online.target
|
||||
Wants=wg-quick.target
|
||||
ConditionPathIsDirectory=/etc/wireguard
|
||||
[Unit]
|
||||
After=syslog.target network-online.target
|
||||
Wants=wg-quick.target
|
||||
ConditionPathIsDirectory=/etc/wireguard
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/etc/wgdashboard/src/gunicorn.pid
|
||||
WorkingDirectory=/etc/wgdashboard/src
|
||||
ExecStart=/etc/wgdashboard/src/wgd.sh start
|
||||
ExecStop=/etc/wgdashboard/src/wgd.sh stop
|
||||
ExecReload=/etc/wgdashboard/src/wgd.sh restart
|
||||
TimeoutSec=120
|
||||
PrivateTmp=yes
|
||||
Restart=always
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/etc/wgdashboard/src/gunicorn.pid
|
||||
WorkingDirectory=/etc/wgdashboard/src
|
||||
ExecStart=/etc/wgdashboard/src/wgd.sh start
|
||||
ExecStop=/etc/wgdashboard/src/wgd.sh stop
|
||||
ExecReload=/etc/wgdashboard/src/wgd.sh restart
|
||||
TimeoutSec=120
|
||||
PrivateTmp=yes
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now wg-dashboard
|
||||
msg_ok "Created Service"
|
||||
fi
|
||||
@@ -96,14 +96,14 @@ setup_alpine() {
|
||||
|
||||
private_key=$(wg genkey)
|
||||
cat <<EOF >/etc/wireguard/wg0.conf
|
||||
[Interface]
|
||||
PrivateKey = ${private_key}
|
||||
Address = 10.0.0.1/24
|
||||
SaveConfig = true
|
||||
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;
|
||||
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
|
||||
ListenPort = 51820
|
||||
EOF
|
||||
[Interface]
|
||||
PrivateKey = ${private_key}
|
||||
Address = 10.0.0.1/24
|
||||
SaveConfig = true
|
||||
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;
|
||||
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
|
||||
ListenPort = 51820
|
||||
EOF
|
||||
echo "net.ipv4.ip_forward=1" >>/etc/sysctl.conf
|
||||
$STD rc-update add sysctl
|
||||
$STD sysctl -p /etc/sysctl.conf
|
||||
@@ -131,28 +131,28 @@ setup_alpine() {
|
||||
|
||||
msg_info "Creating Service for WGDashboard"
|
||||
cat <<EOF >/etc/init.d/wg-dashboard
|
||||
#!/sbin/openrc-run
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="WireGuard Dashboard Service"
|
||||
description="WireGuard Dashboard Service"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
after firewall
|
||||
}
|
||||
depend() {
|
||||
need net
|
||||
after firewall
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting WGDashboard"
|
||||
cd /etc/wgdashboard/src/
|
||||
./wgd.sh start &
|
||||
eend $?
|
||||
}
|
||||
start() {
|
||||
ebegin "Starting WGDashboard"
|
||||
cd /etc/wgdashboard/src/
|
||||
./wgd.sh start &
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping WGDashboard"
|
||||
pkill -f "wgd.sh"
|
||||
eend $?
|
||||
}
|
||||
EOF
|
||||
stop() {
|
||||
ebegin "Stopping WGDashboard"
|
||||
pkill -f "wgd.sh"
|
||||
eend $?
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/wg-dashboard
|
||||
$STD rc-update add wg-dashboard default
|
||||
$STD rc-service wg-dashboard start
|
||||
|
||||
@@ -33,22 +33,22 @@ setup_deb_based() {
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/zigbee2mqtt.service
|
||||
[Unit]
|
||||
Description=zigbee2mqtt
|
||||
After=network.target
|
||||
[Unit]
|
||||
Description=zigbee2mqtt
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Environment=NODE_ENV=production
|
||||
ExecStart=/usr/bin/pnpm start
|
||||
WorkingDirectory=/opt/zigbee2mqtt
|
||||
StandardOutput=inherit
|
||||
StandardError=inherit
|
||||
Restart=always
|
||||
User=root
|
||||
[Service]
|
||||
Environment=NODE_ENV=production
|
||||
ExecStart=/usr/bin/pnpm start
|
||||
WorkingDirectory=/opt/zigbee2mqtt
|
||||
StandardOutput=inherit
|
||||
StandardError=inherit
|
||||
Restart=always
|
||||
User=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now zigbee2mqtt
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user