Skip to content

Commit 5a72b1e

Browse files
authored
New Script: Docmost (#2472)
* New Script: Docmost LXC * fix path * add redis
1 parent 2693fab commit 5a72b1e

File tree

3 files changed

+201
-0
lines changed

3 files changed

+201
-0
lines changed

ct/docmost.sh

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

install/docmost-install.sh

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (Canbiz)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/documenso/documenso
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+
gpg \
19+
curl \
20+
sudo \
21+
redis \
22+
make \
23+
mc \
24+
postgresql
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_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
31+
msg_ok "Set up Node.js Repository"
32+
33+
msg_info "Installing Node.js"
34+
$STD apt-get update
35+
$STD apt-get install -y nodejs
36+
$STD npm install -g pnpm
37+
msg_ok "Installed Node.js"
38+
39+
msg_info "Setting up PostgreSQL"
40+
DB_NAME="docmost_db"
41+
DB_USER="docmost_user"
42+
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
43+
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
44+
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
45+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
46+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
47+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
48+
{
49+
echo "Docmost-Credentials"
50+
echo "Database Name: $DB_NAME"
51+
echo "Database User: $DB_USER"
52+
echo "Database Password: $DB_PASS"
53+
} >> ~/docmost.creds
54+
msg_ok "Set up PostgreSQL"
55+
56+
msg_info "Installing Docmost (Patience)"
57+
temp_file=$(mktemp)
58+
RELEASE=$(curl -s https://api.github.com/repos/docmost/docmost/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
59+
wget -q "https://github.com/docmost/docmost/archive/refs/tags/v${RELEASE}.tar.gz" -O "$temp_file"
60+
tar -xzf "$temp_file"
61+
mv docmost-${RELEASE} /opt/docmost
62+
cd /opt/docmost
63+
mv .env.example .env
64+
sed -i "s|APP_SECRET=.*|APP_SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)|" /opt/docmost/.env
65+
sed -i "s|DATABASE_URL=.*|DATABASE_URL=postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME|" /opt/docmost/.env
66+
export NODE_OPTIONS="--max-old-space-size=2048"
67+
$STD pnpm install --force
68+
$STD pnpm build
69+
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
70+
msg_ok "Installed Docmost"
71+
72+
msg_info "Creating Service"
73+
cat <<EOF >/etc/systemd/system/docmost.service
74+
[Unit]
75+
Description=Docmost Service
76+
After=network.target postgresql.service
77+
78+
[Service]
79+
WorkingDirectory=/opt/docmost
80+
ExecStart=/usr/bin/pnpm start
81+
Restart=always
82+
EnvironmentFile=/opt/docmost/.env
83+
84+
[Install]
85+
WantedBy=multi-user.target
86+
EOF
87+
systemctl enable -q --now docmost
88+
msg_ok "Created Service"
89+
90+
motd_ssh
91+
customize
92+
93+
msg_info "Cleaning up"
94+
rm -f "$temp_file"
95+
$STD apt-get -y autoremove
96+
$STD apt-get -y autoclean
97+
msg_ok "Cleaned"

json/docmost.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "Docmost",
3+
"slug": "docmost",
4+
"categories": [
5+
12
6+
],
7+
"date_created": "2025-02-18",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 3000,
12+
"documentation": "https://docmost.com/docs/installation",
13+
"website": "https://docmost.com/",
14+
"logo": "https://raw.githubusercontent.com/docmost/docmost/refs/heads/main/apps/client/public/favicon-32x32.png",
15+
"description": "Open-source collaborative wiki and documentation software Create, collaborate, and share knowledge seamlessly with Docmost. Ideal for managing your wiki, knowledge-base, documentation and a lot more.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/docmost.sh",
20+
"resources": {
21+
"cpu": 3,
22+
"ram": 3072,
23+
"hdd": 7,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": []
34+
}

0 commit comments

Comments
 (0)