mirror of https://github.com/tteck/Proxmox
commit
94da462585
30 changed files with 417 additions and 93 deletions
@ -0,0 +1,72 @@ |
|||||||
|
#!/usr/bin/env bash |
||||||
|
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) |
||||||
|
# Copyright (c) 2021-2024 tteck |
||||||
|
# Author: tteck (tteckster) |
||||||
|
# License: MIT |
||||||
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE |
||||||
|
|
||||||
|
function header_info { |
||||||
|
clear |
||||||
|
cat <<"EOF" |
||||||
|
________ _ ___ ____ |
||||||
|
/ ____/ /___ _ __(_)_______ / | / _/ |
||||||
|
/ /_ / / __ \ | /| / / / ___/ _ \/ /| | / / |
||||||
|
/ __/ / / /_/ / |/ |/ / (__ ) __/ ___ |_/ / |
||||||
|
/_/ /_/\____/|__/|__/_/____/\___/_/ |_/___/ |
||||||
|
|
||||||
|
EOF |
||||||
|
} |
||||||
|
header_info |
||||||
|
echo -e "Loading..." |
||||||
|
APP="FlowiseAI" |
||||||
|
var_disk="10" |
||||||
|
var_cpu="2" |
||||||
|
var_ram="2048" |
||||||
|
var_os="debian" |
||||||
|
var_version="12" |
||||||
|
variables |
||||||
|
color |
||||||
|
catch_errors |
||||||
|
|
||||||
|
function default_settings() { |
||||||
|
CT_TYPE="1" |
||||||
|
PW="" |
||||||
|
CT_ID=$NEXTID |
||||||
|
HN=$NSAPP |
||||||
|
DISK_SIZE="$var_disk" |
||||||
|
CORE_COUNT="$var_cpu" |
||||||
|
RAM_SIZE="$var_ram" |
||||||
|
BRG="vmbr0" |
||||||
|
NET="dhcp" |
||||||
|
GATE="" |
||||||
|
APT_CACHER="" |
||||||
|
APT_CACHER_IP="" |
||||||
|
DISABLEIP6="no" |
||||||
|
MTU="" |
||||||
|
SD="" |
||||||
|
NS="" |
||||||
|
MAC="" |
||||||
|
VLAN="" |
||||||
|
SSH="no" |
||||||
|
VERB="no" |
||||||
|
echo_default |
||||||
|
} |
||||||
|
|
||||||
|
function update_script() { |
||||||
|
header_info |
||||||
|
if [[ ! -f /etc/systemd/system/flowise.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi |
||||||
|
msg_info "Updating ${APP}" |
||||||
|
systemctl stop flowise |
||||||
|
npm install -g flowise --upgrade |
||||||
|
systemctl start flowise |
||||||
|
msg_ok "Updated ${APP}" |
||||||
|
exit |
||||||
|
} |
||||||
|
|
||||||
|
start |
||||||
|
build_container |
||||||
|
description |
||||||
|
|
||||||
|
msg_ok "Completed Successfully!\n" |
||||||
|
echo -e "${APP} should be reachable by going to the following URL. |
||||||
|
${BL}http://${IP}:3000${CL} \n" |
@ -0,0 +1,107 @@ |
|||||||
|
#!/usr/bin/env bash |
||||||
|
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) |
||||||
|
# Copyright (c) 2021-2024 tteck |
||||||
|
# Author: tteck |
||||||
|
# Co-Author: MickLesk (Canbiz) |
||||||
|
# License: MIT |
||||||
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE |
||||||
|
# Source: https://github.com/matze/wastebin |
||||||
|
|
||||||
|
|
||||||
|
function header_info { |
||||||
|
clear |
||||||
|
cat <<"EOF" |
||||||
|
_ __ __ __ _ |
||||||
|
| | / /___ ______/ /____ / /_ (_)___ |
||||||
|
| | /| / / __ `/ ___/ __/ _ \/ __ \/ / __ \ |
||||||
|
| |/ |/ / /_/ (__ ) /_/ __/ /_/ / / / / / |
||||||
|
|__/|__/\__,_/____/\__/\___/_.___/_/_/ /_/ |
||||||
|
|
||||||
|
EOF |
||||||
|
} |
||||||
|
header_info |
||||||
|
echo -e "Loading..." |
||||||
|
APP="Wastebin" |
||||||
|
var_disk="4" |
||||||
|
var_cpu="4" |
||||||
|
var_ram="2048" |
||||||
|
var_os="debian" |
||||||
|
var_version="12" |
||||||
|
variables |
||||||
|
color |
||||||
|
catch_errors |
||||||
|
|
||||||
|
function default_settings() { |
||||||
|
CT_TYPE="1" |
||||||
|
PW="" |
||||||
|
CT_ID=$NEXTID |
||||||
|
HN=$NSAPP |
||||||
|
DISK_SIZE="$var_disk" |
||||||
|
CORE_COUNT="$var_cpu" |
||||||
|
RAM_SIZE="$var_ram" |
||||||
|
BRG="vmbr0" |
||||||
|
NET="dhcp" |
||||||
|
GATE="" |
||||||
|
APT_CACHER="" |
||||||
|
APT_CACHER_IP="" |
||||||
|
DISABLEIP6="no" |
||||||
|
MTU="" |
||||||
|
SD="" |
||||||
|
NS="" |
||||||
|
MAC="" |
||||||
|
VLAN="" |
||||||
|
SSH="no" |
||||||
|
VERB="no" |
||||||
|
echo_default |
||||||
|
} |
||||||
|
|
||||||
|
function update_script() { |
||||||
|
header_info |
||||||
|
if [[ ! -d /opt/wastebin ]]; then msg_error "No ${APP} Installation Found!"; exit; fi |
||||||
|
if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then |
||||||
|
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt |
||||||
|
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit |
||||||
|
fi |
||||||
|
msg_info "Stopping Wastebin" |
||||||
|
systemctl stop wastebin |
||||||
|
msg_ok "Wastebin Stopped" |
||||||
|
|
||||||
|
msg_info "Updating Wastebin" |
||||||
|
RELEASE=$(curl -s https://api.github.com/repos/matze/wastebin/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') |
||||||
|
cd /opt |
||||||
|
if [ -d wastebin_bak ]; then |
||||||
|
rm -rf wastebin_bak |
||||||
|
fi |
||||||
|
mv wastebin wastebin_bak |
||||||
|
wget -q "https://github.com/matze/wastebin/archive/refs/tags/${RELEASE}.zip" |
||||||
|
unzip -q ${RELEASE}.zip |
||||||
|
mv wastebin-${RELEASE} /opt/wastebin |
||||||
|
cd /opt/wastebin |
||||||
|
cargo update -q |
||||||
|
cargo build -q --release |
||||||
|
msg_ok "Updated Wastebin" |
||||||
|
|
||||||
|
msg_info "Starting Wastebin" |
||||||
|
systemctl start wastebin |
||||||
|
msg_ok "Started Wastebin" |
||||||
|
|
||||||
|
msg_info "Cleaning Up" |
||||||
|
cd /opt |
||||||
|
rm -R ${RELEASE}.zip |
||||||
|
rm -R wastebin_bak |
||||||
|
msg_ok "Cleaned" |
||||||
|
msg_ok "Updated Successfully" |
||||||
|
exit |
||||||
|
} |
||||||
|
|
||||||
|
start |
||||||
|
build_container |
||||||
|
description |
||||||
|
|
||||||
|
msg_info "Setting Container to Normal Resources" |
||||||
|
pct set $CTID -cores 2 |
||||||
|
msg_ok "Set Container to Normal Resources" |
||||||
|
|
||||||
|
msg_ok "Completed Successfully!\n" |
||||||
|
echo -e "${APP} Setup should be reachable by going to the following URL. |
||||||
|
${BL}http://${IP}:8088${CL} \n" |
@ -0,0 +1,60 @@ |
|||||||
|
#!/usr/bin/env bash |
||||||
|
|
||||||
|
# Copyright (c) 2021-2024 tteck |
||||||
|
# Author: tteck (tteckster) |
||||||
|
# License: MIT |
||||||
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE |
||||||
|
|
||||||
|
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" |
||||||
|
color |
||||||
|
verb_ip6 |
||||||
|
catch_errors |
||||||
|
setting_up_container |
||||||
|
network_check |
||||||
|
update_os |
||||||
|
|
||||||
|
msg_info "Installing Dependencies" |
||||||
|
$STD apt-get install -y curl |
||||||
|
$STD apt-get install -y sudo |
||||||
|
$STD apt-get install -y mc |
||||||
|
$STD apt-get install -y gpg |
||||||
|
msg_ok "Installed Dependencies" |
||||||
|
|
||||||
|
msg_info "Installing Node.js" |
||||||
|
mkdir -p /etc/apt/keyrings |
||||||
|
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg |
||||||
|
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list |
||||||
|
$STD apt-get update |
||||||
|
$STD apt-get install -y nodejs |
||||||
|
msg_ok "Installed Node.js" |
||||||
|
|
||||||
|
msg_info "Installing FlowiseAI (Patience)" |
||||||
|
$STD npm install -g flowise |
||||||
|
mkdir -p /opt/flowiseai |
||||||
|
wget -q https://raw.githubusercontent.com/FlowiseAI/Flowise/main/packages/server/.env.example -O /opt/flowiseai/.env |
||||||
|
msg_ok "Installed FlowiseAI" |
||||||
|
|
||||||
|
msg_info "Creating Service" |
||||||
|
cat <<EOF >/etc/systemd/system/flowise.service |
||||||
|
[Unit] |
||||||
|
Description=FlowiseAI |
||||||
|
After=network.target |
||||||
|
|
||||||
|
[Service] |
||||||
|
EnvironmentFile=/opt/flowiseai/.env |
||||||
|
ExecStart=npx flowise start |
||||||
|
Restart=always |
||||||
|
|
||||||
|
[Install] |
||||||
|
WantedBy=multi-user.target |
||||||
|
EOF |
||||||
|
systemctl enable -q --now flowise.service |
||||||
|
msg_ok "Created Service" |
||||||
|
|
||||||
|
motd_ssh |
||||||
|
customize |
||||||
|
|
||||||
|
msg_info "Cleaning up" |
||||||
|
$STD apt-get autoremove |
||||||
|
$STD apt-get autoclean |
||||||
|
msg_ok "Cleaned" |
@ -0,0 +1,67 @@ |
|||||||
|
#!/usr/bin/env bash |
||||||
|
|
||||||
|
# Copyright (c) 2021-2024 tteck |
||||||
|
# Author: tteck |
||||||
|
# Co-Author: MickLesk (Canbiz) |
||||||
|
# License: MIT |
||||||
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE |
||||||
|
# Source: https://github.com/matze/wastebin |
||||||
|
|
||||||
|
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" |
||||||
|
color |
||||||
|
verb_ip6 |
||||||
|
catch_errors |
||||||
|
setting_up_container |
||||||
|
network_check |
||||||
|
update_os |
||||||
|
|
||||||
|
msg_info "Installing Dependencies (Patience)" |
||||||
|
$STD apt-get install -y --no-install-recommends \ |
||||||
|
build-essential \ |
||||||
|
unzip \ |
||||||
|
curl \ |
||||||
|
sudo \ |
||||||
|
git \ |
||||||
|
make \ |
||||||
|
mc |
||||||
|
msg_ok "Installed Dependencies" |
||||||
|
|
||||||
|
msg_info "Installing Rust (Patience)" |
||||||
|
$STD bash <(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs) -y |
||||||
|
source ~/.cargo/env |
||||||
|
msg_ok "Installed Rust" |
||||||
|
|
||||||
|
msg_info "Installing Wastebin (Patience)" |
||||||
|
RELEASE=$(curl -s https://api.github.com/repos/matze/wastebin/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') |
||||||
|
wget -q "https://github.com/matze/wastebin/archive/refs/tags/${RELEASE}.zip" |
||||||
|
unzip -q ${RELEASE}.zip |
||||||
|
mv wastebin-${RELEASE} /opt/wastebin |
||||||
|
rm -R ${RELEASE}.zip |
||||||
|
cd /opt/wastebin |
||||||
|
cargo build -q --release |
||||||
|
msg_ok "Installed Wastebin" |
||||||
|
|
||||||
|
msg_info "Creating Service" |
||||||
|
cat <<EOF >/etc/systemd/system/wastebin.service |
||||||
|
[Unit] |
||||||
|
Description=Start Wastebin Service |
||||||
|
After=network.target |
||||||
|
|
||||||
|
[Service] |
||||||
|
User=root |
||||||
|
WorkingDirectory=/opt/wastebin |
||||||
|
ExecStart=/root/.cargo/bin/cargo run --release --quiet |
||||||
|
|
||||||
|
[Install] |
||||||
|
WantedBy=multi-user.target |
||||||
|
EOF |
||||||
|
systemctl enable -q --now wastebin.service |
||||||
|
msg_ok "Created Service" |
||||||
|
|
||||||
|
motd_ssh |
||||||
|
customize |
||||||
|
|
||||||
|
msg_info "Cleaning up" |
||||||
|
$STD apt-get autoremove |
||||||
|
$STD apt-get autoclean |
||||||
|
msg_ok "Cleaned" |
Loading…
Reference in new issue