mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-31 09:37:23 -04:00
Compare commits
3 Commits
github-act
...
fix/discou
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36ba6581ed | ||
|
|
2f70cb0e2f | ||
|
|
d795d2f709 |
@@ -51,16 +51,31 @@ function update_script() {
|
|||||||
cd /opt/discourse
|
cd /opt/discourse
|
||||||
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
|
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
|
||||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||||
|
export BUNDLE_SILENCE_ROOT_WARNING=1
|
||||||
set -a
|
set -a
|
||||||
source /opt/discourse/.env
|
source /opt/discourse/.env
|
||||||
set +a
|
set +a
|
||||||
$STD git pull origin main
|
$STD git pull origin main
|
||||||
$STD bundle install
|
msg_ok "Updated Discourse"
|
||||||
|
|
||||||
|
msg_info "Updating Dependencies"
|
||||||
|
RUBY_TARGET=$(grep -A1 '^RUBY VERSION' /opt/discourse/Gemfile.lock | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
|
||||||
|
RUBY_VERSION="${RUBY_TARGET:-4.0.7}" RUBY_INSTALL_RAILS="false" setup_ruby
|
||||||
|
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
|
||||||
|
hash -r
|
||||||
|
cd /opt/discourse
|
||||||
|
$STD bundle install -j"$(nproc)"
|
||||||
$STD pnpm install
|
$STD pnpm install
|
||||||
|
msg_ok "Updated Dependencies"
|
||||||
|
|
||||||
|
msg_info "Running Database Migrations"
|
||||||
$STD runuser -u postgres -- psql -d discourse -c "CREATE EXTENSION IF NOT EXISTS vector;"
|
$STD runuser -u postgres -- psql -d discourse -c "CREATE EXTENSION IF NOT EXISTS vector;"
|
||||||
$STD bundle exec rails db:migrate
|
$STD bundle exec rails db:migrate
|
||||||
|
msg_ok "Ran Database Migrations"
|
||||||
|
|
||||||
|
msg_info "Precompiling Assets"
|
||||||
$STD bundle exec rails assets:precompile
|
$STD bundle exec rails assets:precompile
|
||||||
msg_ok "Updated Discourse"
|
msg_ok "Precompiled Assets"
|
||||||
|
|
||||||
msg_info "Starting Services"
|
msg_info "Starting Services"
|
||||||
systemctl start discourse discourse-sidekiq
|
systemctl start discourse discourse-sidekiq
|
||||||
|
|||||||
@@ -28,9 +28,14 @@ $STD apt install -y \
|
|||||||
redis-server
|
redis-server
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
msg_info "Cloning Discourse"
|
||||||
|
$STD git clone --depth 1 https://github.com/discourse/discourse.git /opt/discourse
|
||||||
|
msg_ok "Cloned Discourse"
|
||||||
|
|
||||||
PG_VERSION="17" PG_MODULES="pgvector" setup_postgresql
|
PG_VERSION="17" PG_MODULES="pgvector" setup_postgresql
|
||||||
NODE_VERSION="24" setup_nodejs
|
NODE_VERSION="24" setup_nodejs
|
||||||
RUBY_VERSION="3.4.4" setup_ruby
|
RUBY_TARGET=$(grep -A1 '^RUBY VERSION' /opt/discourse/Gemfile.lock | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
|
||||||
|
RUBY_VERSION="${RUBY_TARGET:-4.0.7}" RUBY_INSTALL_RAILS="false" setup_ruby
|
||||||
|
|
||||||
msg_info "Configuring PostgreSQL for Discourse"
|
msg_info "Configuring PostgreSQL for Discourse"
|
||||||
DISCOURSE_DB_PASS=$(random_password 13)
|
DISCOURSE_DB_PASS=$(random_password 13)
|
||||||
@@ -42,7 +47,6 @@ msg_ok "Configured PostgreSQL for Discourse"
|
|||||||
|
|
||||||
msg_info "Configuring Discourse"
|
msg_info "Configuring Discourse"
|
||||||
DISCOURSE_SECRET_KEY=$(openssl rand -hex 64)
|
DISCOURSE_SECRET_KEY=$(openssl rand -hex 64)
|
||||||
$STD git clone --depth 1 https://github.com/discourse/discourse.git /opt/discourse
|
|
||||||
cd /opt/discourse
|
cd /opt/discourse
|
||||||
cat <<EOF >/opt/discourse/.env
|
cat <<EOF >/opt/discourse/.env
|
||||||
RAILS_ENV=production
|
RAILS_ENV=production
|
||||||
@@ -77,6 +81,7 @@ export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
|
|||||||
eval "$(rbenv init - bash)" 2>/dev/null || true
|
eval "$(rbenv init - bash)" 2>/dev/null || true
|
||||||
export RAILS_ENV=production
|
export RAILS_ENV=production
|
||||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||||
|
export BUNDLE_SILENCE_ROOT_WARNING=1
|
||||||
$STD corepack enable
|
$STD corepack enable
|
||||||
$STD bundle config set --local deployment true
|
$STD bundle config set --local deployment true
|
||||||
$STD bundle config set --local without 'test development'
|
$STD bundle config set --local without 'test development'
|
||||||
|
|||||||
Reference in New Issue
Block a user