sync build tree from private myoffice
This commit is contained in:
+2
-2
@@ -137,8 +137,8 @@ If jobs use ephemeral containers without that volume, SDKs download every run.
|
||||
## Defaults
|
||||
|
||||
- Debian 12 LXC, unprivileged, `--onboot 1`
|
||||
- 2 vCPU / 4096 MiB / 20G / `vmbr0` / DHCP
|
||||
- Listen `:9100`
|
||||
- Prompts: **IP** (DHCP or static), **CPU** (default 2), **RAM** (default 2048 MiB), **Disk** (default 10 GiB)
|
||||
- Bridge `vmbr0` / listen `:9100`
|
||||
|
||||
## Demo logins
|
||||
|
||||
|
||||
+81
-63
@@ -179,12 +179,83 @@ select_storage() {
|
||||
msg_ok "Using ${CL}${BL}${STORAGE}${CL}${GN} for storage."
|
||||
}
|
||||
|
||||
ask_ip_cpu_ram_disk() {
|
||||
# Always prompt: IP, CPU (default 2), RAM MiB (default 2048), disk GiB (default 10).
|
||||
while true; do
|
||||
if CORE_COUNT=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "CPU cores" 8 58 "${CORE_COUNT:-2}" --title "CPU" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
[[ -z "$CORE_COUNT" ]] && CORE_COUNT="2"
|
||||
if [[ "$CORE_COUNT" =~ ^[1-9][0-9]*$ ]]; then
|
||||
echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}${CORE_COUNT}${CL}"
|
||||
break
|
||||
fi
|
||||
whiptail --backtitle "MyOffice Proxmox" --title "INVALID" --msgbox "CPU cores must be a positive integer." 8 58
|
||||
else
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
|
||||
while true; do
|
||||
if RAM_SIZE=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "RAM in MiB" 8 58 "${RAM_SIZE:-2048}" --title "MEMORY" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
[[ -z "$RAM_SIZE" ]] && RAM_SIZE="2048"
|
||||
if [[ "$RAM_SIZE" =~ ^[1-9][0-9]*$ ]]; then
|
||||
echo -e "${RAMSIZE}${BOLD}${DGN}RAM: ${BGN}${RAM_SIZE} MiB${CL}"
|
||||
break
|
||||
fi
|
||||
whiptail --backtitle "MyOffice Proxmox" --title "INVALID" --msgbox "RAM must be a positive integer (MiB)." 8 58
|
||||
else
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
|
||||
while true; do
|
||||
if DISK_SIZE=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "Disk size in GiB" 8 58 "${DISK_SIZE:-10}" --title "DISK" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
DISK_SIZE=$(echo "${DISK_SIZE:-10}" | tr -d ' Gg')
|
||||
[[ -z "$DISK_SIZE" ]] && DISK_SIZE="10"
|
||||
if [[ "$DISK_SIZE" =~ ^[1-9][0-9]*$ ]]; then
|
||||
echo -e "${DISKSIZE}${BOLD}${DGN}Disk: ${BGN}${DISK_SIZE}G${CL}"
|
||||
break
|
||||
fi
|
||||
whiptail --backtitle "MyOffice Proxmox" --title "INVALID" --msgbox "Disk must be a positive integer (GiB)." 8 58
|
||||
else
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
|
||||
if whiptail --backtitle "MyOffice Proxmox" --title "NETWORK" --yesno "Use DHCP for IP?\n\nYes = DHCP\nNo = static IP" --yes-button DHCP --no-button Static 12 58; then
|
||||
NET="dhcp"
|
||||
GATEWAY_IP=""
|
||||
echo -e "${GATEWAY}${BOLD}${DGN}IP: ${BGN}DHCP${CL}"
|
||||
else
|
||||
while true; do
|
||||
if NET=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "Static IP with CIDR\n(e.g. 192.168.1.120/24)" 10 58 "${NET:-}" --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
if [[ -n "$NET" && "$NET" == */* ]]; then
|
||||
break
|
||||
fi
|
||||
whiptail --backtitle "MyOffice Proxmox" --title "INVALID" --msgbox "Enter IP/CIDR, e.g. 192.168.1.120/24" 8 58
|
||||
else
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
while true; do
|
||||
if GATEWAY_IP=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "Gateway\n(e.g. 192.168.1.1)" 10 58 "${GATEWAY_IP:-}" --title "GATEWAY" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
if [[ -n "$GATEWAY_IP" ]]; then
|
||||
break
|
||||
fi
|
||||
whiptail --backtitle "MyOffice Proxmox" --title "INVALID" --msgbox "Gateway is required for static IP." 8 58
|
||||
else
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
echo -e "${GATEWAY}${BOLD}${DGN}IP: ${BGN}${NET} gw ${GATEWAY_IP}${CL}"
|
||||
fi
|
||||
}
|
||||
|
||||
default_settings() {
|
||||
CTID=$(get_valid_nextid)
|
||||
HN="myoffice"
|
||||
CORE_COUNT="2"
|
||||
RAM_SIZE="4096"
|
||||
DISK_SIZE="20"
|
||||
RAM_SIZE="2048"
|
||||
DISK_SIZE="10"
|
||||
BRG="vmbr0"
|
||||
NET="dhcp"
|
||||
GATEWAY_IP=""
|
||||
@@ -195,19 +266,21 @@ default_settings() {
|
||||
echo -e "${CONTAINERID}${BOLD}${DGN}Container ID: ${BGN}${CTID}${CL}"
|
||||
echo -e "${HOSTNAME}${BOLD}${DGN}Hostname: ${BGN}${HN}${CL}"
|
||||
echo -e "${OS}${BOLD}${DGN}OS: ${BGN}Debian 12${CL}"
|
||||
echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}${CORE_COUNT}${CL}"
|
||||
echo -e "${RAMSIZE}${BOLD}${DGN}RAM: ${BGN}${RAM_SIZE} MiB${CL}"
|
||||
echo -e "${DISKSIZE}${BOLD}${DGN}Disk: ${BGN}${DISK_SIZE}G${CL}"
|
||||
ask_ip_cpu_ram_disk
|
||||
echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}${BRG}${CL}"
|
||||
echo -e "${GATEWAY}${BOLD}${DGN}IP: ${BGN}DHCP${CL}"
|
||||
echo -e "${DEFAULT}${BOLD}${DGN}API listen: ${BGN}:${API_PORT}${CL} (SPA from release wwwroot)"
|
||||
echo -e "${CONTAINERTYPE}${BOLD}${DGN}Stack: ${BGN}PostgreSQL + ASP.NET + Gitea release${CL}"
|
||||
echo -e "${CREATING}${BOLD}${DGN}Creating MyOffice LXC with default settings${CL}"
|
||||
echo -e "${CREATING}${BOLD}${DGN}Creating MyOffice LXC${CL}"
|
||||
}
|
||||
|
||||
advanced_settings() {
|
||||
METHOD="advanced"
|
||||
[[ -z "${CTID:-}" ]] && CTID=$(get_valid_nextid)
|
||||
CORE_COUNT="${CORE_COUNT:-2}"
|
||||
RAM_SIZE="${RAM_SIZE:-2048}"
|
||||
DISK_SIZE="${DISK_SIZE:-10}"
|
||||
NET="${NET:-dhcp}"
|
||||
GATEWAY_IP="${GATEWAY_IP:-}"
|
||||
|
||||
while true; do
|
||||
if CTID=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "Set Container ID" 8 58 "$CTID" --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
@@ -232,44 +305,7 @@ advanced_settings() {
|
||||
exit_script
|
||||
fi
|
||||
|
||||
while true; do
|
||||
if CORE_COUNT=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "Allocate CPU Cores" 8 58 2 --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
[[ -z "$CORE_COUNT" ]] && CORE_COUNT="2"
|
||||
if [[ "$CORE_COUNT" =~ ^[1-9][0-9]*$ ]]; then
|
||||
echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}${CORE_COUNT}${CL}"
|
||||
break
|
||||
fi
|
||||
whiptail --backtitle "MyOffice Proxmox" --title "INVALID" --msgbox "CPU cores must be a positive integer." 8 58
|
||||
else
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
|
||||
while true; do
|
||||
if RAM_SIZE=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "Allocate RAM in MiB" 8 58 4096 --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
[[ -z "$RAM_SIZE" ]] && RAM_SIZE="4096"
|
||||
if [[ "$RAM_SIZE" =~ ^[1-9][0-9]*$ ]]; then
|
||||
echo -e "${RAMSIZE}${BOLD}${DGN}RAM: ${BGN}${RAM_SIZE} MiB${CL}"
|
||||
break
|
||||
fi
|
||||
whiptail --backtitle "MyOffice Proxmox" --title "INVALID" --msgbox "RAM must be a positive integer (MiB)." 8 58
|
||||
else
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
|
||||
while true; do
|
||||
if DISK_SIZE=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "Disk size in GiB" 8 58 20 --title "DISK" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
DISK_SIZE=$(echo "${DISK_SIZE:-20}" | tr -d ' Gg')
|
||||
if [[ "$DISK_SIZE" =~ ^[1-9][0-9]*$ ]]; then
|
||||
echo -e "${DISKSIZE}${BOLD}${DGN}Disk: ${BGN}${DISK_SIZE}G${CL}"
|
||||
break
|
||||
fi
|
||||
whiptail --backtitle "MyOffice Proxmox" --title "INVALID" --msgbox "Disk must be a positive integer (GiB)." 8 58
|
||||
else
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
ask_ip_cpu_ram_disk
|
||||
|
||||
if BRG=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "Bridge" 8 58 vmbr0 --title "BRIDGE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
[[ -z "$BRG" ]] && BRG="vmbr0"
|
||||
@@ -278,24 +314,6 @@ advanced_settings() {
|
||||
exit_script
|
||||
fi
|
||||
|
||||
if whiptail --backtitle "MyOffice Proxmox" --title "NETWORK" --yesno "Use DHCP?" --yes-button DHCP --no-button Static 10 58; then
|
||||
NET="dhcp"
|
||||
GATEWAY_IP=""
|
||||
echo -e "${GATEWAY}${BOLD}${DGN}IP: ${BGN}DHCP${CL}"
|
||||
else
|
||||
if NET=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "Static IP CIDR (e.g. 192.168.1.120/24)" 8 58 --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
:
|
||||
else
|
||||
exit_script
|
||||
fi
|
||||
if GATEWAY_IP=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "Gateway (e.g. 192.168.1.1)" 8 58 --title "GATEWAY" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
:
|
||||
else
|
||||
exit_script
|
||||
fi
|
||||
echo -e "${GATEWAY}${BOLD}${DGN}IP: ${BGN}${NET} gw ${GATEWAY_IP}${CL}"
|
||||
fi
|
||||
|
||||
if API_PORT=$(whiptail --backtitle "MyOffice Proxmox" --inputbox "Kestrel listen port" 8 58 9100 --title "API PORT" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
[[ -z "$API_PORT" ]] && API_PORT="9100"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user