Compare commits

..

No commits in common. "f6c5d0cc18b01b65ba09b4f84c0330f72406297e" and "3606a8d6d0bc27d8c2a0ce616080dcd18945e2b4" have entirely different histories.

View File

@ -14,7 +14,7 @@ network_check
update_os update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt install -y \ $STD apt-get install -y \
libarchive-dev \ libarchive-dev \
git \ git \
libmariadb-dev \ libmariadb-dev \
@ -24,14 +24,23 @@ $STD apt install -y \
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
setup_imagemagick setup_imagemagick
PG_VERSION="16" setup_postgresql PG_VERSION="16" setup_postgresql
PG_DB_NAME="manyfold" PG_DB_USER="manyfold" setup_postgresql_db
fetch_and_deploy_gh_release "manyfold" "manyfold3d/manyfold" "tarball" "latest" "/opt/manyfold/app" fetch_and_deploy_gh_release "manyfold" "manyfold3d/manyfold" "tarball" "latest" "/opt/manyfold/app"
msg_info "Configuring Manyfold" msg_info "Configuring manyfold environment"
RUBY_INSTALL_VERSION=$(cat /opt/manyfold/app/.ruby-version) RUBY_INSTALL_VERSION=$(cat /opt/manyfold/app/.ruby-version)
YARN_VERSION=$(grep '"packageManager":' /opt/manyfold/app/package.json | sed -E 's/.*"(yarn@[0-9\.]+)".*/\1/') YARN_VERSION=$(grep '"packageManager":' /opt/manyfold/app/package.json | sed -E 's/.*"(yarn@[0-9\.]+)".*/\1/')
RELEASE=$(get_latest_github_release "manyfold3d/manyfold") RELEASE=$(get_latest_github_release "manyfold3d/manyfold")
DB_NAME=manyfold
DB_USER=manyfold
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER TEMPLATE template0;"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
useradd -m -s /usr/bin/bash manyfold useradd -m -s /usr/bin/bash manyfold
cat <<EOF >/opt/manyfold/.env cat <<EOF >/opt/manyfold/.env
export APP_VERSION=${RELEASE} export APP_VERSION=${RELEASE}
@ -41,9 +50,9 @@ export PUBLIC_PORT=5000
export REDIS_URL=redis://127.0.0.1:6379/1 export REDIS_URL=redis://127.0.0.1:6379/1
export DATABASE_ADAPTER=postgresql export DATABASE_ADAPTER=postgresql
export DATABASE_HOST=127.0.0.1 export DATABASE_HOST=127.0.0.1
export DATABASE_USER=${PG_DB_USER} export DATABASE_USER=${DB_USER}
export DATABASE_PASSWORD=${PG_DB_PASS} export DATABASE_PASSWORD=${DB_PASS}
export DATABASE_NAME=${PG_DB_NAME} export DATABASE_NAME=${DB_NAME}
export DATABASE_CONNECTION_POOL=16 export DATABASE_CONNECTION_POOL=16
export MULTIUSER=enabled export MULTIUSER=enabled
export HTTPS_ONLY=false export HTTPS_ONLY=false
@ -70,8 +79,8 @@ bin/rails credentials:edit
bin/rails db:migrate bin/rails db:migrate
bin/rails assets:precompile bin/rails assets:precompile
EOF EOF
$STD mkdir -p /opt/manyfold_data $STD mkdir -p /opt/manyfold/data
msg_ok "Configured Manyfold" msg_ok "Configured manyfold environment"
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
RUBY_VERSION=${RUBY_INSTALL_VERSION} RUBY_INSTALL_RAILS="true" HOME=/home/manyfold setup_ruby RUBY_VERSION=${RUBY_INSTALL_VERSION} RUBY_INSTALL_RAILS="true" HOME=/home/manyfold setup_ruby
@ -83,7 +92,7 @@ chmod +x /opt/manyfold/user_setup.sh
npm install --global corepack npm install --global corepack
$STD sudo -u manyfold bash /opt/manyfold/user_setup.sh $STD sudo -u manyfold bash /opt/manyfold/user_setup.sh
rm -f /opt/manyfold/user_setup.sh rm -f /opt/manyfold/user_setup.sh
msg_ok "Installed Manyfold" msg_ok "Installed manyfold"
msg_info "Creating Services" msg_info "Creating Services"
source /opt/manyfold/.env source /opt/manyfold/.env