mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-07 05:13:27 +02:00
Let forgejo-runner and pangolin take their answers up front
forgejo-runner already exported two of the three values its install script requires, but not var_forgejo_runner_uuid — so an unattended install passed the ct-level guard and then stopped at a prompt inside the container, which is the one place nobody can answer it. The guard missed it for the same reason. pangolin asked for its URL and email with no way to supply them. Both sides are needed: the read in install/ now only fires when the variable is unset, and ct/ exports it, because lxc-attach carries the caller's environment but only what was exported. Reverts the docker change from the previous commit; it is superseded by work on another branch.
This commit is contained in:
+10
-2
@@ -118,8 +118,16 @@ var_admin_user="${var_admin_user:-admin}"
|
||||
```
|
||||
|
||||
Name them `var_<something>`, the same namespace the container variables use.
|
||||
`install/forgejo-runner-install.sh` and `install/docker-install.sh` both follow
|
||||
this.
|
||||
`install/forgejo-runner-install.sh` and `install/pangolin-install.sh` both
|
||||
follow this.
|
||||
|
||||
The variable also has to be exported from `ct/<app>.sh`, or it never reaches
|
||||
the container — `lxc-attach` carries the caller's environment, but only for
|
||||
what was actually exported:
|
||||
|
||||
```bash
|
||||
export var_admin_user="${var_admin_user:-}"
|
||||
```
|
||||
|
||||
Declare them on the script's PocketBase record in `app_vars` so the website's
|
||||
generator can offer them as fields:
|
||||
|
||||
@@ -18,6 +18,7 @@ var_nesting="${var_nesting:-1}"
|
||||
var_keyctl="${var_keyctl:-1}"
|
||||
|
||||
export var_forgejo_instance="${var_forgejo_instance:-}"
|
||||
export var_forgejo_runner_uuid="${var_forgejo_runner_uuid:-}"
|
||||
export var_forgejo_runner_token="${var_forgejo_runner_token:-}"
|
||||
export var_runner_labels="${var_runner_labels:-}"
|
||||
|
||||
@@ -64,6 +65,10 @@ if [[ -n "${mode:-}" ]]; then
|
||||
msg_error "var_forgejo_instance is required for unattended installs."
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "${var_forgejo_runner_uuid:-}" ]]; then
|
||||
msg_error "var_forgejo_runner_uuid is required for unattended installs."
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "${var_forgejo_runner_token:-}" ]]; then
|
||||
msg_error "var_forgejo_runner_token is required for unattended installs."
|
||||
exit 1
|
||||
|
||||
@@ -17,6 +17,9 @@ var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
var_tun="${var_tun:-1}"
|
||||
|
||||
export var_pangolin_url="${var_pangolin_url:-}"
|
||||
export var_pangolin_email="${var_pangolin_email:-}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
|
||||
@@ -17,24 +17,11 @@ PORTAINER_AGENT_LATEST_VERSION=$(get_latest_github_release "portainer/agent")
|
||||
|
||||
setup_docker
|
||||
|
||||
# Every choice below can be supplied up front so the install runs unattended.
|
||||
# Same convention as install/forgejo-runner-install.sh: read the variable, and
|
||||
# only ask when it was not set.
|
||||
if [[ -z "${var_portainer:-}" ]]; then
|
||||
if prompt_confirm "${TAB3}Would you like to install Portainer (UI) via the community-scripts addon?" "n" 60; then
|
||||
var_portainer="yes"
|
||||
else
|
||||
var_portainer="no"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${var_portainer:-}" =~ ^([yY]|[yY][eE][sS])$ ]]; then
|
||||
if prompt_confirm "${TAB3}Would you like to install Portainer (UI) via the community-scripts addon?" "n" 60; then
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/portainer.sh)" <<<"y"
|
||||
else
|
||||
if [[ -z "${var_portainer_agent:-}" ]]; then
|
||||
read -r -p "${TAB3}Would you like to install the Portainer Agent (for remote management)? <y/N> " var_portainer_agent
|
||||
fi
|
||||
if [[ "${var_portainer_agent:-}" =~ ^([yY]|[yY][eE][sS])$ ]]; then
|
||||
read -r -p "${TAB3}Would you like to install the Portainer Agent (for remote management)? <y/N> " prompt_agent
|
||||
if [[ ${prompt_agent,,} =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Portainer Agent $PORTAINER_AGENT_LATEST_VERSION"
|
||||
$STD docker run -d \
|
||||
-p 9001:9001 \
|
||||
@@ -47,14 +34,12 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "${var_docker_socket:-}" ]]; then
|
||||
read -r -p "${TAB3}Expose Docker TCP socket (insecure) ? [n = No, l = Local only (127.0.0.1), a = All interfaces (0.0.0.0)] <n/l/a>: " var_docker_socket
|
||||
fi
|
||||
case "${var_docker_socket:-}" in
|
||||
l | L | local | Local)
|
||||
read -r -p "${TAB3}Expose Docker TCP socket (insecure) ? [n = No, l = Local only (127.0.0.1), a = All interfaces (0.0.0.0)] <n/l/a>: " socket_choice
|
||||
case "${socket_choice,,}" in
|
||||
l)
|
||||
socket="tcp://127.0.0.1:2375"
|
||||
;;
|
||||
a | A | all | All)
|
||||
a)
|
||||
socket="tcp://0.0.0.0:2375"
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -27,9 +27,18 @@ fetch_and_deploy_gh_release "pangolin" "fosrl/pangolin" "tarball" "$PANGOLIN_VER
|
||||
fetch_and_deploy_gh_release "gerbil" "fosrl/gerbil" "singlefile" "latest" "/usr/bin" "gerbil_linux_$(arch_resolve)"
|
||||
fetch_and_deploy_gh_release "traefik" "traefik/traefik" "prebuild" "latest" "/usr/bin" "traefik_v*_linux_$(arch_resolve).tar.gz"
|
||||
|
||||
read -rp "${TAB3}Enter your Pangolin URL (ex: https://pangolin.example.com): " pango_url
|
||||
# Read the variable first and prompt only when it is unset, so the install can
|
||||
# be supplied up front. Same convention as install/forgejo-runner-install.sh.
|
||||
pango_url="${var_pangolin_url:-}"
|
||||
if [[ -z "$pango_url" ]]; then
|
||||
read -rp "${TAB3}Enter your Pangolin URL (ex: https://pangolin.example.com): " pango_url
|
||||
fi
|
||||
[[ "$pango_url" != https://* && "$pango_url" != http://* ]] && pango_url="https://${pango_url}"
|
||||
read -rp "${TAB3}Enter your email address: " pango_email
|
||||
|
||||
pango_email="${var_pangolin_email:-}"
|
||||
if [[ -z "$pango_email" ]]; then
|
||||
read -rp "${TAB3}Enter your email address: " pango_email
|
||||
fi
|
||||
|
||||
msg_info "Setup Pangolin"
|
||||
SECRET_KEY=$(openssl rand -base64 48 | tr -dc 'A-Za-z0-9' | head -c 32)
|
||||
|
||||
Reference in New Issue
Block a user