Skip to content

Commit 4cc3a87

Browse files
ConvertX (#5484)
* 'Add new script' * curl --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ <[email protected]>
1 parent db2671e commit 4cc3a87

File tree

4 files changed

+198
-0
lines changed

4 files changed

+198
-0
lines changed

ct/convertx.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 -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Omar Minaya | MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/C4illin/ConvertX
7+
8+
APP="ConvertX"
9+
var_tags="${var_tags:-converter}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-4096}"
12+
var_disk="${var_disk:-20}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
15+
var_unprivileged="${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 /var ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
RELEASE=$(curl -fsSL https://api.github.com/repos/C4illin/ConvertX/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
31+
if [[ "${RELEASE}" != "$(cat ~/.convertx 2>/dev/null)" ]] || [[ ! -f ~/.convertx ]]; then
32+
msg_info "Stopping $APP"
33+
systemctl stop convertx
34+
msg_ok "Stopped $APP"
35+
36+
msg_info "Move data-Folder"
37+
if [[ -d /opt/convertx/data ]]; then
38+
mv /opt/convertx/data /opt/data
39+
fi
40+
msg_ok "Moved data-Folder"
41+
42+
fetch_and_deploy_gh_release "ConvertX" "C4illin/ConvertX" "tarball" "latest" "/opt/convertx"
43+
44+
msg_info "Updating $APP to v${RELEASE}"
45+
if [[ -d /opt/data ]]; then
46+
mv /opt/data /opt/convertx/data
47+
fi
48+
cd /opt/convertx
49+
$STD bun install
50+
msg_ok "Updated $APP to v${RELEASE}"
51+
52+
msg_info "Starting $APP"
53+
systemctl start convertx
54+
msg_ok "Started $APP"
55+
56+
msg_ok "Update Successful"
57+
else
58+
msg_ok "No update required. ${APP} is already at v${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}"

ct/headers/convertx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
______ __ _ __
2+
/ ____/___ ____ _ _____ _____/ /| |/ /
3+
/ / / __ \/ __ \ | / / _ \/ ___/ __/ /
4+
/ /___/ /_/ / / / / |/ / __/ / / /_/ |
5+
\____/\____/_/ /_/|___/\___/_/ \__/_/|_|
6+

frontend/public/json/convertx.json

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install/convertx-install.sh

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Omar Minaya | MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/C4illin/ConvertX
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+
setup_imagemagick
17+
18+
msg_info "Installing Dependencies"
19+
$STD apt-get install -y \
20+
assimp-utils \
21+
calibre \
22+
dcraw \
23+
dvisvgm \
24+
ffmpeg \
25+
inkscape \
26+
libva2 \
27+
libvips-tools \
28+
lmodern \
29+
mupdf-tools \
30+
pandoc \
31+
poppler-utils \
32+
potrace \
33+
python3-numpy \
34+
texlive \
35+
texlive-fonts-recommended \
36+
texlive-latex-extra \
37+
texlive-latex-recommended \
38+
texlive-xetex
39+
msg_ok "Installed Dependencies"
40+
41+
NODE_VERSION=22 NODE_MODULE="bun" setup_nodejs
42+
fetch_and_deploy_gh_release "ConvertX" "C4illin/ConvertX" "tarball" "latest" "/opt/convertx"
43+
44+
msg_info "Installing ConvertX"
45+
cd /opt/convertx
46+
mkdir -p data
47+
$STD bun install
48+
49+
JWT_SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | head -c 32)
50+
cat <<EOF >/opt/convertx/.env
51+
JWT_SECRET=$JWT_SECRET
52+
HTTP_ALLOWED=true
53+
PORT=3000
54+
EOF
55+
msg_ok "Installed ConvertX"
56+
57+
msg_info "Creating Services"
58+
cat <<EOF >/etc/systemd/system/convertx.service
59+
[Unit]
60+
Description=ConvertX File Converter
61+
After=network.target
62+
63+
[Service]
64+
Type=exec
65+
WorkingDirectory=/opt/convertx
66+
EnvironmentFile=/opt/convertx/.env
67+
ExecStart=/bin/bun dev
68+
Restart=always
69+
70+
[Install]
71+
WantedBy=multi-user.target
72+
EOF
73+
systemctl enable -q --now convertx
74+
msg_ok "Service Created"
75+
76+
motd_ssh
77+
customize
78+
79+
msg_info "Cleaning up"
80+
$STD apt-get -y autoremove
81+
$STD apt-get -y autoclean
82+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)