mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-17 05:54:56 +02:00
Compare commits
2 Commits
add-script
...
add-script
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a12576130 | ||
|
|
f2a654a668 |
@@ -1,16 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: mathiasnagler
|
||||
# Author: John Lombardo
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/router-for-me/CLIProxyAPI
|
||||
# Source: https://github.com/thelastoutpostworkshop/ESPConnect
|
||||
|
||||
APP="CLIProxyAPI"
|
||||
var_tags="${var_tags:-ai;proxy}"
|
||||
APP="ESPConnect"
|
||||
var_tags="${var_tags:-iot;esp32;flash}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-2}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
@@ -25,21 +24,21 @@ function update_script() {
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/cliproxyapi ]]; then
|
||||
msg_error "No CLIProxyAPI Installation Found!"
|
||||
if [[ ! -d /opt/espconnect ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "cliproxyapi" "router-for-me/CLIProxyAPI"; then
|
||||
msg_info "Stopping CLIProxyAPI"
|
||||
systemctl stop cliproxyapi
|
||||
msg_ok "Stopped CLIProxyAPI"
|
||||
if check_for_gh_release "espconnect" "thelastoutpostworkshop/ESPConnect"; then
|
||||
msg_info "Stopping Nginx"
|
||||
systemctl stop nginx
|
||||
msg_ok "Stopped Nginx"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "cliproxyapi" "router-for-me/CLIProxyAPI" "prebuild" "latest" "/opt/cliproxyapi" "CLIProxyAPI_*_linux_amd64.tar.gz"
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "espconnect" "thelastoutpostworkshop/ESPConnect" "prebuild" "latest" "/opt/espconnect" "dist.zip"
|
||||
|
||||
msg_info "Starting CLIProxyAPI"
|
||||
systemctl start cliproxyapi
|
||||
msg_ok "Started CLIProxyAPI"
|
||||
msg_info "Starting Nginx"
|
||||
systemctl start nginx
|
||||
msg_ok "Started Nginx"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
@@ -49,7 +48,7 @@ start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed successfully!\n"
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8317${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}https://${IP}${CL}"
|
||||
@@ -1,6 +0,0 @@
|
||||
________ ________ ___ ____ ____
|
||||
/ ____/ / / _/ __ \_________ _ ____ __/ | / __ \/ _/
|
||||
/ / / / / // /_/ / ___/ __ \| |/_/ / / / /| | / /_/ // /
|
||||
/ /___/ /____/ // ____/ / / /_/ /> </ /_/ / ___ |/ ____// /
|
||||
\____/_____/___/_/ /_/ \____/_/|_|\__, /_/ |_/_/ /___/
|
||||
/____/
|
||||
6
ct/headers/espconnect
Normal file
6
ct/headers/espconnect
Normal file
@@ -0,0 +1,6 @@
|
||||
___________ ____ ______ __
|
||||
/ ____/ ___// __ \/ ____/___ ____ ____ ___ _____/ /_
|
||||
/ __/ \__ \/ /_/ / / / __ \/ __ \/ __ \/ _ \/ ___/ __/
|
||||
/ /___ ___/ / ____/ /___/ /_/ / / / / / / / __/ /__/ /_
|
||||
/_____//____/_/ \____/\____/_/ /_/_/ /_/\___/\___/\__/
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: mathiasnagler
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/router-for-me/CLIProxyAPI
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y openssl
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
fetch_and_deploy_gh_release "cliproxyapi" "router-for-me/CLIProxyAPI" "prebuild" "latest" "/opt/cliproxyapi" "CLIProxyAPI_*_linux_amd64.tar.gz"
|
||||
|
||||
msg_info "Configuring CLIProxyAPI"
|
||||
MANAGEMENT_PASSWORD=$(openssl rand -hex 32)
|
||||
API_KEY="sk-$(openssl rand -hex 16)"
|
||||
cat <<EOF >/opt/cliproxyapi/config.yaml
|
||||
host: ""
|
||||
port: 8317
|
||||
auth-dir: "/root/.cli-proxy-api"
|
||||
remote-management:
|
||||
allow-remote: true
|
||||
secret-key: "${MANAGEMENT_PASSWORD}"
|
||||
api-keys:
|
||||
- "${API_KEY}"
|
||||
request-retry: 3
|
||||
quota-exceeded:
|
||||
switch-project: true
|
||||
switch-preview-model: true
|
||||
routing:
|
||||
strategy: "round-robin"
|
||||
EOF
|
||||
msg_ok "Configured CLIProxyAPI"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/cliproxyapi.service
|
||||
[Unit]
|
||||
Description=CLIProxyAPI
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/cliproxyapi
|
||||
ExecStart=/opt/cliproxyapi/cli-proxy-api
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now cliproxyapi
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
62
install/espconnect-install.sh
Normal file
62
install/espconnect-install.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: John Lombardo
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/thelastoutpostworkshop/ESPConnect
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y nginx
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
fetch_and_deploy_gh_release "espconnect" "thelastoutpostworkshop/ESPConnect" "prebuild" "latest" "/opt/espconnect" "dist.zip"
|
||||
|
||||
msg_info "Configuring Nginx"
|
||||
mkdir -p /etc/ssl/private
|
||||
$STD openssl req -x509 -nodes -newkey rsa:2048 -days 3650 \
|
||||
-keyout /etc/ssl/private/espconnect-selfsigned.key \
|
||||
-out /etc/ssl/certs/espconnect-selfsigned.crt \
|
||||
-subj "/CN=ESPConnect"
|
||||
|
||||
cat <<'EOF' >/etc/nginx/sites-available/espconnect
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl default_server;
|
||||
listen [::]:443 ssl default_server;
|
||||
|
||||
ssl_certificate /etc/ssl/certs/espconnect-selfsigned.crt;
|
||||
ssl_certificate_key /etc/ssl/private/espconnect-selfsigned.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
|
||||
root /opt/espconnect;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
ln -sf /etc/nginx/sites-available/espconnect /etc/nginx/sites-enabled/espconnect
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
$STD nginx -t
|
||||
systemctl enable -q nginx
|
||||
systemctl restart nginx
|
||||
msg_ok "Configured Nginx"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in New Issue
Block a user