Skip to content

Commit 7d29d8a

Browse files
authored
New Script: Outline (#2653)
* Added Outline script * Update outline-install.sh
1 parent e679279 commit 7d29d8a

File tree

3 files changed

+220
-0
lines changed

3 files changed

+220
-0
lines changed

ct/outline.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/outline/outline
7+
8+
APP="Outline"
9+
var_tags="documentation"
10+
var_disk="8"
11+
var_cpu="2"
12+
var_ram="4096"
13+
var_os="debian"
14+
var_version="12"
15+
var_unprivileged="1"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -d /opt/outline ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
RELEASE=$(curl -s https://api.github.com/repos/outline/outline/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
31+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
32+
msg_info "Stopping Services"
33+
systemctl stop outline
34+
msg_ok "Services Stopped"
35+
36+
msg_info "Updating ${APP} to ${RELEASE}"
37+
temp_file=$(mktemp)
38+
rm -rf /opt/outline/node_modules
39+
wget -q "https://github.com/outline/outline/archive/refs/tags/v${RELEASE}.tar.gz" -O $temp_file
40+
tar zxf $temp_file
41+
cp -rf outline-${RELEASE}/* /opt/outline
42+
cd /opt/outline
43+
export NODE_OPTIONS="--max-old-space-size=3584"
44+
$STD yarn install --frozen-lockfile
45+
$STD yarn build
46+
echo "${RELEASE}" >/opt/${APP}_version.txt
47+
msg_ok "Updated ${APP}"
48+
49+
msg_info "Starting Services"
50+
systemctl start outline
51+
msg_ok "Started Services"
52+
53+
msg_info "Cleaning Up"
54+
rm -rf $temp_file
55+
rm -rf $HOME/outline-${RELEASE}
56+
msg_ok "Cleaned"
57+
msg_ok "Updated Successfully"
58+
else
59+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
60+
fi
61+
exit
62+
}
63+
64+
start
65+
build_container
66+
description
67+
68+
msg_ok "Completed Successfully!\n"
69+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
70+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
71+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"

install/outline-install.sh

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/outline/outline
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc \
21+
gnupg \
22+
mkcert \
23+
git \
24+
redis
25+
msg_ok "Installed Dependencies"
26+
27+
msg_info "Setting up Node.js Repository"
28+
mkdir -p /etc/apt/keyrings
29+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
30+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
31+
msg_ok "Set up Node.js Repository"
32+
33+
msg_info "Setting up PostgreSQL Repository"
34+
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
35+
echo "deb https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" >/etc/apt/sources.list.d/pgdg.list
36+
msg_ok "Set up PostgreSQL Repository"
37+
38+
msg_info "Installing Node.js"
39+
$STD apt-get update
40+
$STD apt-get install -y nodejs
41+
$STD npm install -g yarn
42+
msg_ok "Installed Node.js"
43+
44+
msg_info "Install/Set up PostgreSQL Database"
45+
$STD apt-get install -y postgresql-16
46+
DB_NAME="outline"
47+
DB_USER="outline"
48+
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
49+
SECRET_KEY="$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)"
50+
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
51+
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
52+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
53+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
54+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
55+
msg_ok "Set up PostgreSQL"
56+
57+
msg_info "Setup Outline (Patience)"
58+
temp_file=$(mktemp)
59+
LOCAL_IP="$(hostname -I | awk '{print $1}')"
60+
RELEASE=$(curl -s https://api.github.com/repos/outline/outline/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
61+
wget -q "https://github.com/outline/outline/archive/refs/tags/v${RELEASE}.tar.gz" -O $temp_file
62+
tar zxf $temp_file
63+
mv outline-${RELEASE} /opt/outline
64+
cd /opt/outline
65+
cp .env.sample .env
66+
sed -i 's/NODE_ENV=production/NODE_ENV=development/g' /opt/outline/.env
67+
sed -i "s/generate_a_new_key/${SECRET_KEY}/g" /opt/outline/.env
68+
sed -i "s/user:pass@postgres/${DB_USER}:${DB_PASS}@localhost/g" /opt/outline/.env
69+
sed -i 's/redis:6379/localhost:6379/g' /opt/outline/.env
70+
sed -i "32s#URL=#URL=http://${LOCAL_IP}#g" /opt/outline/.env
71+
sed -i 's/FORCE_HTTPS=true/FORCE_HTTPS=false/g' /opt/outline/.env
72+
$STD yarn install --frozen-lockfile
73+
export NODE_OPTIONS="--max-old-space-size=3584"
74+
$STD yarn build
75+
sed -i 's/NODE_ENV=development/NODE_ENV=production/g' /opt/outline/.env
76+
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
77+
msg_ok "Setup Outline"
78+
79+
msg_info "Creating Service"
80+
cat <<EOF >/etc/systemd/system/outline.service
81+
[Unit]
82+
Description=Outline Service
83+
After=network.target
84+
85+
[Service]
86+
Type=simple
87+
User=root
88+
WorkingDirectory=/opt/outline
89+
ExecStart=/usr/bin/node ./build/server/index.js
90+
Restart=always
91+
EnvironmentFile=/opt/outline/.env
92+
93+
[Install]
94+
WantedBy=multi-user.target
95+
EOF
96+
systemctl enable -q --now outline
97+
msg_ok "Created Service"
98+
99+
motd_ssh
100+
customize
101+
102+
msg_info "Cleaning up"
103+
rm -rf $temp_file
104+
$STD apt-get -y autoremove
105+
$STD apt-get -y autoclean
106+
msg_ok "Cleaned"

json/outline.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "Outline",
3+
"slug": "outline",
4+
"categories": [
5+
12
6+
],
7+
"date_created": "2025-02-26",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 3000,
12+
"documentation": "https://docs.getoutline.com/s/hosting/",
13+
"website": "https://www.getoutline.com",
14+
"logo": "https://www.getoutline.com/images/logo.svg",
15+
"description": "The fastest knowledge base for growing teams. Beautiful, realtime collaborative, feature packed, and markdown compatible. It’s time to get your team’s knowledge organized.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/outline.sh",
20+
"resources": {
21+
"cpu": 2,
22+
"ram": 4096,
23+
"hdd": 8,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"text": "After installation finishes, application will do a database migration so web UI might be unavailable for a minute or two. Also you need to manually add authentication and/or enable HTTPS.",
36+
"type": "info"
37+
},
38+
{
39+
"text": "Configuration file is at: `/opt/outline/.env`. Modify to suit your environment.",
40+
"type": "info"
41+
}
42+
]
43+
}

0 commit comments

Comments
 (0)