Skip to content

Commit 505bfef

Browse files
authored
Merge pull request #2258 from mews-se/add-dietpi
New Script: DietPi
2 parents d83225e + f1b18b2 commit 505bfef

3 files changed

Lines changed: 148 additions & 0 deletions

File tree

‎ct/dietpi.sh‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
# Engine comes from community-scripts/core; this repo only ships the scripts.
3+
# Local checkout wins (COMMUNITY_SCRIPTS_CORE_DIR, else a sibling ../core), so a
4+
# fork/branch of core can be tested without touching this file.
5+
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
6+
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
7+
8+
# Copyright (c) 2021-2026 community-scripts ORG
9+
# Author: mews-se
10+
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
11+
# Source: https://dietpi.com/
12+
13+
APP="DietPi"
14+
var_tags="${var_tags:-os}"
15+
var_cpu="${var_cpu:-1}"
16+
var_ram="${var_ram:-512}"
17+
var_disk="${var_disk:-4}"
18+
var_os="${var_os:-debian}"
19+
var_version="${var_version:-13}"
20+
#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified
21+
var_unprivileged="${var_unprivileged:-1}"
22+
23+
header_info "$APP"
24+
variables
25+
color
26+
catch_errors
27+
28+
function update_script() {
29+
header_info
30+
check_container_storage
31+
check_container_resources
32+
if [[ ! -f /boot/dietpi/.version ]]; then
33+
msg_error "No ${APP} Installation Found!"
34+
exit
35+
fi
36+
msg_info "Updating DietPi LXC"
37+
$STD /boot/dietpi/dietpi-update 1
38+
msg_ok "Updated DietPi LXC"
39+
exit
40+
}
41+
42+
start
43+
build_container
44+
description
45+
46+
msg_ok "Completed successfully!"
47+
msg_custom "🚀" "${GN}" "${APP} setup has been successfully initialized!"
48+
echo -e "${INFO}${YW} Restart the container once, DietPi's first run setup then continues on the console.${CL}"

‎install/dietpi-install.sh‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: mews-se
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
6+
# Source: https://dietpi.com/
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_warn "WARNING: This script will run an external installer from a third-party source (https://dietpi.com/)."
17+
msg_warn "The following code is NOT maintained or audited by our repository."
18+
msg_warn "If you have any doubts or concerns, please review the installer code before proceeding:"
19+
msg_custom "${TAB3}${GATEWAY}${BGN}${CL}" "\e[1;34m" "→ https://raw.githubusercontent.com/MichaIng/DietPi/master/.build/images/dietpi-installer"
20+
echo
21+
read -r -p "${TAB3}Do you want to continue? [y/N]: " CONFIRM
22+
if [[ ! "$CONFIRM" =~ ^([yY][eE][sS]|[yY])$ ]]; then
23+
msg_error "Aborted by user. No changes have been made."
24+
exit 10
25+
fi
26+
27+
motd_ssh
28+
29+
msg_info "Converting Debian to DietPi"
30+
curl -fsSL https://raw.githubusercontent.com/MichaIng/DietPi/master/.build/images/dietpi-installer -o /tmp/dietpi-installer
31+
$STD env G_INTERACTIVE=0 GITBRANCH=master HW_MODEL=75 DISTRO_TARGET=8 GUEST_NETWORK_REQUIRED=1 IMAGE_CREATOR=community-scripts PREIMAGE_INFO='Proxmox Debian LXC template' bash /tmp/dietpi-installer
32+
rm -f /tmp/dietpi-installer
33+
msg_ok "Converted Debian to DietPi"
34+
35+
msg_info "Configuring DietPi"
36+
sed -i -e 's/^AUTO_SETUP_NET_ETHERNET_ENABLED=.*/AUTO_SETUP_NET_ETHERNET_ENABLED=0/' \
37+
-e "s/^AUTO_SETUP_NET_HOSTNAME=.*/AUTO_SETUP_NET_HOSTNAME=$(hostname)/" /boot/dietpi.txt
38+
if [[ -n "${PASSWORD:-}" ]]; then
39+
sed -i '/^AUTO_SETUP_GLOBAL_PASSWORD=/d' /boot/dietpi.txt
40+
echo "AUTO_SETUP_GLOBAL_PASSWORD=$PASSWORD" >>/boot/dietpi.txt
41+
fi
42+
rm -f /etc/apt/sources.list.d/debian.sources
43+
msg_ok "Configured DietPi"
44+
45+
customize
46+
# Autologin on tty1 only: DietPi's first run setup runs on the first console that logs in, and the Proxmox UI attaches to tty1
47+
rm -f /etc/systemd/system/console-getty.service.d/override.conf
48+
cleanup_lxc

‎json/dietpi.json‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "DietPi",
3+
"slug": "dietpi",
4+
"categories": [
5+
2
6+
],
7+
"date_created": "2026-09-13",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": null,
12+
"documentation": "https://dietpi.com/docs/",
13+
"website": "https://dietpi.com/",
14+
"repository": "https://github.com/MichaIng/DietPi",
15+
"architectures": [
16+
"amd64"
17+
],
18+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/dietpi.webp",
19+
"description": "DietPi is a lightweight Debian-based OS with a curated software catalogue (dietpi-software) and simple configuration tools. The script creates a Debian LXC and converts it with the official dietpi-installer.",
20+
"install_methods": [
21+
{
22+
"type": "default",
23+
"script": "ct/dietpi.sh",
24+
"config_path": "/boot/dietpi.txt",
25+
"resources": {
26+
"cpu": 1,
27+
"ram": 512,
28+
"hdd": 4,
29+
"os": "Debian",
30+
"version": "13"
31+
}
32+
}
33+
],
34+
"default_credentials": {
35+
"username": "root",
36+
"password": "dietpi"
37+
},
38+
"notes": [
39+
{
40+
"text": "Restart the container once after creation; DietPi's interactive first run setup starts at the next login.",
41+
"type": "info"
42+
},
43+
{
44+
"text": "SSH server, locale, software picks and more can be preconfigured in /boot/dietpi.txt before that restart.",
45+
"type": "info"
46+
},
47+
{
48+
"text": "A root password set in the advanced settings is applied to root and the dietpi user at that restart. Without one, both get the password dietpi.",
49+
"type": "info"
50+
}
51+
]
52+
}

0 commit comments

Comments
 (0)