mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-07-18 20:05:06 +02:00
Fix Manyfold Ruby setup home initialization
Create the `manyfold` service user before calling `setup_ruby` so `/home/manyfold` exists when rbenv profile snippets are written. Also harden `setup_ruby` by creating `$HOME` if missing, preventing profile-write failures for installers that pass a home directory before creating the user.
This commit is contained in:
@@ -31,13 +31,16 @@ NODE_VERSION="24" NODE_MODULE="corepack,yarn" setup_nodejs
|
||||
|
||||
fetch_and_deploy_gh_release "manyfold" "manyfold3d/manyfold" "tarball" "latest" "/opt/manyfold/app"
|
||||
|
||||
# Create the service user (and its home) before setup_ruby, which writes rbenv
|
||||
# profile snippets into HOME=/home/manyfold.
|
||||
useradd -m -s /usr/bin/bash manyfold
|
||||
|
||||
RUBY_INSTALL_VERSION=$(cat /opt/manyfold/app/.ruby-version)
|
||||
RUBY_VERSION=${RUBY_INSTALL_VERSION} RUBY_INSTALL_RAILS="true" HOME=/home/manyfold setup_ruby
|
||||
|
||||
msg_info "Configuring Manyfold"
|
||||
YARN_VERSION=$(grep '"packageManager":' /opt/manyfold/app/package.json | sed -E 's/.*"(yarn@[0-9\.]+)".*/\1/')
|
||||
RELEASE=$(get_latest_github_release "manyfold3d/manyfold")
|
||||
useradd -m -s /usr/bin/bash manyfold
|
||||
cat <<EOF >/opt/manyfold/.env
|
||||
export APP_VERSION=${RELEASE}
|
||||
export GUID=1002
|
||||
|
||||
@@ -8637,6 +8637,11 @@ setup_ruby() {
|
||||
local BASHRC_FILE="$HOME/.bashrc"
|
||||
local TMP_DIR=$(mktemp -d)
|
||||
|
||||
# Ensure HOME exists: callers may pass a not-yet-created home (e.g. a service
|
||||
# user that is created later in the install), so the profile writes below do
|
||||
# not fail on a missing directory.
|
||||
mkdir -p "$HOME"
|
||||
|
||||
if ! grep -q 'rbenv init' "$PROFILE_FILE" 2>/dev/null; then
|
||||
cat <<'EOF' >>"$PROFILE_FILE"
|
||||
export PATH="$HOME/.rbenv/bin:$PATH"
|
||||
|
||||
Reference in New Issue
Block a user