From d4b006aec1959cfa5d135826771dfe33e40fd258 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Fri, 19 Sep 2025 09:10:54 +0200 Subject: [PATCH 1/3] Add Outline for testing --- ct/outline.sh | 67 ++++++++++++++++++++++++++++ install/outline-install.sh | 90 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+) create mode 100644 ct/outline.sh create mode 100644 install/outline-install.sh diff --git a/ct/outline.sh b/ct/outline.sh new file mode 100644 index 00000000..c94eb63b --- /dev/null +++ b/ct/outline.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: Slaviša Arežina (tremor021) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/outline/outline + +APP="Outline" +var_tags="${var_tags:-documentation}" +var_disk="${var_disk:-8}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-4096}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/outline ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "outline" "outline/outline"; then + msg_info "Stopping Services" + systemctl stop outline + msg_ok "Services Stopped" + + msg_info "Creating backup" + cp /opt/outline/.env /opt + msg_ok "Backup created" + + fetch_and_deploy_gh_release "outline" "outline/outline" "tarball" + + msg_info "Updating ${APP}" + cd /opt/outline + mv /opt/.env /opt/outline + export NODE_ENV=development + export NODE_OPTIONS="--max-old-space-size=3584" + $STD yarn install --frozen-lockfile + export NODE_ENV=production + $STD yarn build + msg_ok "Updated ${APP}" + + msg_info "Starting Services" + systemctl start outline + msg_ok "Started Services" + msg_ok "Updated Successfully" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/install/outline-install.sh b/install/outline-install.sh new file mode 100644 index 00000000..068d1b38 --- /dev/null +++ b/install/outline-install.sh @@ -0,0 +1,90 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# 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-get install -y \ + mkcert \ + git \ + redis +msg_ok "Installed Dependencies" + +NODE_VERSION="20" NODE_MODULE="yarn@latest" setup_nodejs +PG_VERSION="16" setup_postgresql + +msg_info "Set up PostgreSQL Database" +DB_NAME="outline" +DB_USER="outline" +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 ENCODING 'UTF8' 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';" +{ + echo "Outline-Credentials" + echo "Outline Database User: $DB_USER" + echo "Outline Database Password: $DB_PASS" + echo "Outline Database Name: $DB_NAME" +} >>~/outline.creds +msg_ok "Set up PostgreSQL Database" + +fetch_and_deploy_gh_release "outline" "outline/outline" "tarball" + +msg_info "Configuring Outline (Patience)" +SECRET_KEY="$(openssl rand -hex 32)" +LOCAL_IP="$(hostname -I | awk '{print $1}')" +cd /opt/outline +cp .env.sample .env +export NODE_ENV=development +sed -i 's/NODE_ENV=production/NODE_ENV=development/g' /opt/outline/.env +sed -i "s/generate_a_new_key/${SECRET_KEY}/g" /opt/outline/.env +sed -i "s/user:pass@postgres/${DB_USER}:${DB_PASS}@localhost/g" /opt/outline/.env +sed -i 's/redis:6379/localhost:6379/g' /opt/outline/.env +sed -i "5s#URL=#URL=http://${LOCAL_IP}#g" /opt/outline/.env +sed -i 's/FORCE_HTTPS=true/FORCE_HTTPS=false/g' /opt/outline/.env +export NODE_OPTIONS="--max-old-space-size=3584" +$STD yarn install --frozen-lockfile +export NODE_ENV=production +sed -i 's/NODE_ENV=development/NODE_ENV=production/g' /opt/outline/.env +$STD yarn build +msg_ok "Configured Outline" + +msg_info "Creating Service" +cat </etc/systemd/system/outline.service +[Unit] +Description=Outline Service +After=network.target + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/outline +ExecStart=/usr/bin/yarn start +Restart=always +EnvironmentFile=/opt/outline/.env + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now outline +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" From 53d5127c5ad8d326bb5ce6c95ee18b5870f7a3f7 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Fri, 19 Sep 2025 09:13:40 +0200 Subject: [PATCH 2/3] Update Outline --- ct/outline.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/outline.sh b/ct/outline.sh index c94eb63b..41bfa2fb 100644 --- a/ct/outline.sh +++ b/ct/outline.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: Slaviša Arežina (tremor021) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE From 14bac9468fd87efb0e95166fd150c5cdf5799fe0 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Fri, 19 Sep 2025 09:23:39 +0200 Subject: [PATCH 3/3] Pin Outline version --- install/outline-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/outline-install.sh b/install/outline-install.sh index 068d1b38..ed496101 100644 --- a/install/outline-install.sh +++ b/install/outline-install.sh @@ -40,7 +40,7 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';" } >>~/outline.creds msg_ok "Set up PostgreSQL Database" -fetch_and_deploy_gh_release "outline" "outline/outline" "tarball" +fetch_and_deploy_gh_release "outline" "outline/outline" "tarball" "v0.87.3" msg_info "Configuring Outline (Patience)" SECRET_KEY="$(openssl rand -hex 32)"