Files
ProxmoxVE/install/outline-install.sh
T

74 lines
2.0 KiB
Bash
Raw Normal View History

2025-02-26 16:17:22 +01:00
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
2025-02-26 16:17:22 +01:00
# Author: Slaviša Arežina (tremor021)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/outline/outline
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y \
2025-04-15 13:03:51 +02:00
mkcert \
git \
redis
2025-02-26 16:17:22 +01:00
msg_ok "Installed Dependencies"
2026-07-28 21:36:40 +10:00
NODE_VERSION="26" NODE_MODULE="corepack" setup_nodejs
PG_VERSION="16" setup_postgresql
2025-12-24 15:28:00 +01:00
PG_DB_NAME="outline" PG_DB_USER="outline" setup_postgresql_db
2026-01-19 16:33:08 +01:00
2025-08-01 07:24:13 +02:00
fetch_and_deploy_gh_release "outline" "outline/outline" "tarball"
msg_info "Configuring Outline (Patience)"
2025-04-15 13:03:51 +02:00
SECRET_KEY="$(openssl rand -hex 32)"
UTILS_SECRET="$(openssl rand -hex 32)"
2025-02-26 16:17:22 +01:00
cd /opt/outline
cp .env.sample .env
2025-04-15 13:03:51 +02:00
export NODE_ENV=development
sed -i "s#^NODE_ENV=.*#NODE_ENV=development#" /opt/outline/.env
sed -i "s#^SECRET_KEY=.*#SECRET_KEY=${SECRET_KEY}#" /opt/outline/.env
sed -i "s#^UTILS_SECRET=.*#UTILS_SECRET=${UTILS_SECRET}#" /opt/outline/.env
sed -i "s#^DATABASE_URL=.*#DATABASE_URL=postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}#" /opt/outline/.env
sed -i "s#^REDIS_URL=.*#REDIS_URL=redis://localhost:6379#" /opt/outline/.env
sed -i "s#^URL=.*#URL=http://${LOCAL_IP}#" /opt/outline/.env
sed -i "s#^FORCE_HTTPS=.*#FORCE_HTTPS=false#" /opt/outline/.env
2025-02-26 16:17:22 +01:00
export NODE_OPTIONS="--max-old-space-size=3584"
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
2026-01-08 15:28:52 +01:00
$STD yarn install --immutable
2025-04-15 13:03:51 +02:00
export NODE_ENV=production
sed -i "s#^NODE_ENV=.*#NODE_ENV=production#" /opt/outline/.env
2025-08-13 20:59:56 +02:00
$STD yarn build
2025-08-01 07:24:13 +02:00
msg_ok "Configured Outline"
2025-02-26 16:17:22 +01:00
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/outline.service
[Unit]
Description=Outline Service
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/outline
2025-04-15 13:03:51 +02:00
ExecStart=/usr/bin/yarn start
2025-02-26 16:17:22 +01:00
Restart=always
EnvironmentFile=/opt/outline/.env
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now outline
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc