Skip to content

Commit eaebc18

Browse files
authored
New Script: Alpine-Komodo (#4234)
1 parent b959453 commit eaebc18

File tree

3 files changed

+148
-0
lines changed

3 files changed

+148
-0
lines changed

ct/alpine-komodo.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL 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://komo.do
7+
8+
APP="Alpine-Komodo"
9+
var_tags="${var_tags:-docker,alpine}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-1024}"
12+
var_disk="${var_disk:-10}"
13+
var_os="${var_os:-alpine}"
14+
var_version="${var_version:-3.21}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
[[ -d /opt/komodo ]] || {
24+
msg_error "No ${APP} Installation Found!"
25+
exit 1
26+
}
27+
28+
msg_info "Updating ${APP}"
29+
COMPOSE_FILE=$(find /opt/komodo -maxdepth 1 -type f -name '*.compose.yaml' ! -name 'compose.env' | head -n1)
30+
if [[ -z "$COMPOSE_FILE" ]]; then
31+
msg_error "No valid compose file found in /opt/komodo!"
32+
exit 1
33+
fi
34+
COMPOSE_BASENAME=$(basename "$COMPOSE_FILE")
35+
BACKUP_FILE="/opt/komodo/${COMPOSE_BASENAME}.bak_$(date +%Y%m%d_%H%M%S)"
36+
cp "$COMPOSE_FILE" "$BACKUP_FILE" || {
37+
msg_error "Failed to create backup of ${COMPOSE_BASENAME}!"
38+
exit 1
39+
}
40+
GITHUB_URL="https://raw.githubusercontent.com/moghtech/komodo/main/compose/${COMPOSE_BASENAME}"
41+
if ! curl -fsSL "$GITHUB_URL" -o "$COMPOSE_FILE"; then
42+
msg_error "Failed to download ${COMPOSE_BASENAME} from GitHub!"
43+
mv "$BACKUP_FILE" "$COMPOSE_FILE"
44+
exit 1
45+
fi
46+
$STD docker compose -p komodo -f "$COMPOSE_FILE" --env-file /opt/komodo/compose.env up -d
47+
msg_ok "Updated ${APP}"
48+
exit
49+
}
50+
51+
start
52+
build_container
53+
description
54+
55+
msg_ok "Completed Successfully!\n"
56+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
57+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
58+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9120${CL}"

frontend/public/json/komodo.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@
2525
"os": "debian",
2626
"version": "12"
2727
}
28+
},
29+
{
30+
"type": "alpine",
31+
"script": "ct/alpine-komodo.sh",
32+
"resources": {
33+
"cpu": 1,
34+
"ram": 1024,
35+
"hdd": 10,
36+
"os": "alpine",
37+
"version": "3.21"
38+
}
2839
}
2940
],
3041
"default_credentials": {

install/alpine-komodo-install.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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://komo.do/
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 apk add --no-cache ca-certificates openssl
18+
msg_ok "Installed Dependencies"
19+
20+
msg_info "Setup Docker Repository"
21+
$STD apk add --no-cache docker docker-cli docker-compose openrc
22+
msg_ok "Setup Docker Repository"
23+
24+
msg_info "Enabling Docker Service"
25+
$STD rc-update add docker boot
26+
$STD service docker start
27+
msg_ok "Enabled Docker Service"
28+
29+
echo "Choose the database for Komodo installation:"
30+
echo "1) MongoDB (recommended)"
31+
echo "2) SQLite"
32+
echo "3) PostgreSQL"
33+
read -rp "Enter your choice (default: 1): " DB_CHOICE
34+
DB_CHOICE=${DB_CHOICE:-1}
35+
36+
case $DB_CHOICE in
37+
1)
38+
DB_COMPOSE_FILE="mongo.compose.yaml"
39+
;;
40+
2)
41+
DB_COMPOSE_FILE="sqlite.compose.yaml"
42+
;;
43+
3)
44+
DB_COMPOSE_FILE="postgres.compose.yaml"
45+
;;
46+
*)
47+
echo "Invalid choice. Defaulting to MongoDB."
48+
DB_COMPOSE_FILE="mongo.compose.yaml"
49+
;;
50+
esac
51+
52+
mkdir -p /opt/komodo
53+
cd /opt/komodo
54+
curl -fsSL "https://raw.githubusercontent.com/moghtech/komodo/main/compose/$DB_COMPOSE_FILE" -o "$(basename "$DB_COMPOSE_FILE")"
55+
56+
msg_info "Setup Komodo Environment"
57+
curl -fsSL "https://raw.githubusercontent.com/moghtech/komodo/main/compose/compose.env" -o "/opt/komodo/compose.env"
58+
DB_PASSWORD=$(openssl rand -base64 16 | tr -d '/+=')
59+
PASSKEY=$(openssl rand -base64 24 | tr -d '/+=')
60+
WEBHOOK_SECRET=$(openssl rand -base64 24 | tr -d '/+=')
61+
JWT_SECRET=$(openssl rand -base64 24 | tr -d '/+=')
62+
63+
sed -i "s/^KOMODO_DB_USERNAME=.*/KOMODO_DB_USERNAME=komodo_admin/" /opt/komodo/compose.env
64+
sed -i "s/^KOMODO_DB_PASSWORD=.*/KOMODO_DB_PASSWORD=${DB_PASSWORD}/" /opt/komodo/compose.env
65+
sed -i "s/^KOMODO_PASSKEY=.*/KOMODO_PASSKEY=${PASSKEY}/" /opt/komodo/compose.env
66+
sed -i "s/^KOMODO_WEBHOOK_SECRET=.*/KOMODO_WEBHOOK_SECRET=${WEBHOOK_SECRET}/" /opt/komodo/compose.env
67+
sed -i "s/^KOMODO_JWT_SECRET=.*/KOMODO_JWT_SECRET=${JWT_SECRET}/" /opt/komodo/compose.env
68+
msg_ok "Setup Komodo Environment"
69+
70+
msg_info "Initialize Komodo"
71+
$STD docker compose -p komodo -f "/opt/komodo/$DB_COMPOSE_FILE" --env-file /opt/komodo/compose.env up -d
72+
msg_ok "Initialized Komodo"
73+
74+
motd_ssh
75+
customize
76+
77+
msg_info "Cleaning up"
78+
$STD apk cache clean
79+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)