Skip to content

Commit a5f77f2

Browse files
tremor021bvdberg01
andauthored
New Script: TasmoCompiler (#2235)
* add tasmocompiler script * bunch of script fixes * remove typo * Update json/tasmocompiler.json Co-authored-by: bvdberg01 <[email protected]> * Update ct/tasmocompiler.sh Co-authored-by: bvdberg01 <[email protected]> * Update json/tasmocompiler.json Co-authored-by: bvdberg01 <[email protected]> * Update ct/tasmocompiler.sh Co-authored-by: bvdberg01 <[email protected]> --------- Co-authored-by: bvdberg01 <[email protected]>
1 parent 0f7ff18 commit a5f77f2

File tree

3 files changed

+192
-0
lines changed

3 files changed

+192
-0
lines changed

ct/tasmocompiler.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/benzino77/tasmocompiler
7+
8+
APP="TasmoCompiler"
9+
TAGS="compiler"
10+
var_cpu="2"
11+
var_ram="2048"
12+
var_disk="10"
13+
var_os="debian"
14+
var_version="12"
15+
var_unprivileged="1"
16+
17+
header_info "$APP"
18+
base_settings
19+
20+
variables
21+
color
22+
catch_errors
23+
24+
function update_script() {
25+
header_info
26+
check_container_storage
27+
check_container_resources
28+
if [[ ! -d /opt/tasmocompiler ]]; then
29+
msg_error "No ${APP} Installation Found!"
30+
exit
31+
fi
32+
RELEASE=$(curl -s https://api.github.com/repos/benzino77/tasmocompiler/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
33+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
34+
msg_info "Stopping $APP"
35+
systemctl stop tasmocompiler
36+
msg_ok "Stopped $APP"
37+
msg_info "Updating $APP to v${RELEASE}"
38+
cd /opt
39+
rm -rf /opt/tasmocompiler
40+
RELEASE=$(curl -s https://api.github.com/repos/benzino77/tasmocompiler/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
41+
wget -q https://github.com/benzino77/tasmocompiler/archive/refs/tags/v${RELEASE}.tar.gz
42+
tar xzf v${RELEASE}.tar.gz
43+
mv tasmocompiler-${RELEASE}/ /opt/tasmocompiler/
44+
cd /opt/tasmocompiler
45+
yarn install &> /dev/null
46+
export NODE_OPTIONS=--openssl-legacy-provider
47+
npm i &> /dev/null
48+
yarn build &> /dev/null
49+
msg_ok "Updated $APP to v${RELEASE}"
50+
msg_info "Starting $APP"
51+
systemctl start tasmocompiler
52+
msg_ok "Started $APP"
53+
echo "${RELEASE}" >/opt/${APP}_version.txt
54+
msg_info "Cleaning up"
55+
rm -r "/opt/v${RELEASE}.tar.gz"
56+
msg_ok "Cleaned"
57+
msg_ok "Update Successful"
58+
else
59+
msg_ok "No update required. ${APP} is already at v${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/tasmocompiler-install.sh

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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/benzino77/tasmocompiler
7+
8+
# Import Functions und Setup
9+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
10+
color
11+
verb_ip6
12+
catch_errors
13+
setting_up_container
14+
network_check
15+
update_os
16+
17+
msg_info "Installing Dependencies. Patience"
18+
$STD apt-get install -y \
19+
curl \
20+
sudo \
21+
mc \
22+
gnupg \
23+
git
24+
msg_ok "Installed Dependencies"
25+
26+
msg_info "Setup Python3"
27+
$STD apt-get install python3-venv
28+
msg_ok "Setup Python3"
29+
30+
msg_info "Setup Node.js & yarn"
31+
mkdir -p /etc/apt/keyrings
32+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
33+
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
34+
$STD apt-get update
35+
$STD apt-get install -y nodejs
36+
$STD npm install -g yarn
37+
msg_ok "Setup Node.js & yarn"
38+
39+
msg_info "Setup Platformio"
40+
curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
41+
$STD python3 get-platformio.py
42+
msg_ok "Setup Platformio"
43+
44+
msg_info "Setup TasmoCompiler"
45+
mkdir /tmp/Tasmota
46+
RELEASE=$(curl -s https://api.github.com/repos/benzino77/tasmocompiler/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
47+
wget -q https://github.com/benzino77/tasmocompiler/archive/refs/tags/v${RELEASE}.tar.gz -O /tmp/v${RELEASE}.tar.gz
48+
cd /tmp
49+
tar xzf /tmp/v${RELEASE}.tar.gz
50+
mv tasmocompiler-${RELEASE}/ /opt/tasmocompiler/
51+
cd /opt/tasmocompiler
52+
$STD yarn install
53+
export NODE_OPTIONS=--openssl-legacy-provider
54+
$STD npm i
55+
$STD yarn build
56+
mkdir -p /usr/local/bin
57+
ln -s ~/.platformio/penv/bin/platformio /usr/local/bin/platformio
58+
ln -s ~/.platformio/penv/bin/pio /usr/local/bin/pio
59+
ln -s ~/.platformio/penv/bin/piodebuggdb /usr/local/bin/piodebuggdb
60+
echo "${RELEASE}" >"/opt/tasmocompiler_version.txt"
61+
msg_ok "Setup TasmoCompiler"
62+
63+
msg_info "Creating Service"
64+
cat <<EOF >/etc/systemd/system/tasmocompiler.service
65+
[Unit]
66+
Description=TasmoCompiler Service
67+
After=multi-user.target
68+
69+
[Service]
70+
Type=simple
71+
User=root
72+
ExecStart=/usr/bin/node /opt/tasmocompiler/server/app.js
73+
74+
[Install]
75+
WantedBy=multi-user.target
76+
EOF
77+
systemctl enable -q --now tasmocompiler
78+
msg_ok "Created Service"
79+
80+
motd_ssh
81+
customize
82+
83+
msg_info "Cleaning up"
84+
rm -f /tmp/v${RELEASE}.tar.gz
85+
$STD apt-get -y autoremove
86+
$STD apt-get -y autoclean
87+
msg_ok "Cleaned"

json/tasmocompiler.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "TasmoCompiler",
3+
"slug": "tasmocompiler",
4+
"categories": [
5+
16
6+
],
7+
"date_created": "2025-02-10",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 3000,
12+
"documentation": "https://github.com/benzino77/tasmocompiler/blob/master/README.md",
13+
"website": "https://github.com/benzino77/tasmocompiler",
14+
"logo": "https://github.com/benzino77/tasmocompiler/raw/master/docs/logo/tasmocompiler-symbol.svg",
15+
"description": "TasmoCompiler is a simple web GUI which allows you to compile fantastic Tasmota firmware with your own settings.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/tasmocompiler.sh",
20+
"resources": {
21+
"cpu": 2,
22+
"ram": 2048,
23+
"hdd": 10,
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)