mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-07-02 03:57:37 +00:00
Compare commits
2 Commits
refactor_t
...
migrate_ub
Author | SHA1 | Date | |
---|---|---|---|
2fca5309fe | |||
828a52fb92 |
15
CHANGELOG.md
15
CHANGELOG.md
@ -14,14 +14,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
|
||||
|
||||
|
||||
## 2025-06-25
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- #### ✨ New Features
|
||||
|
||||
- YunoHost: add Update-Function [@MickLesk](https://github.com/MickLesk) ([#5450](https://github.com/community-scripts/ProxmoxVE/pull/5450))
|
||||
|
||||
## 2025-06-24
|
||||
|
||||
### 🆕 New Scripts
|
||||
@ -32,18 +24,13 @@ All LXC instances created using this repository come pre-installed with Midnight
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- GoMFT: tmpl bugfix to work with current version until a new release pushed [@MickLesk](https://github.com/MickLesk) ([#5435](https://github.com/community-scripts/ProxmoxVE/pull/5435))
|
||||
- Update all Alpine Scripts to atleast 1GB HDD [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#5418](https://github.com/community-scripts/ProxmoxVE/pull/5418))
|
||||
|
||||
- #### ✨ New Features
|
||||
|
||||
- general: update all alpine scripts to version 3.22 [@MickLesk](https://github.com/MickLesk) ([#5428](https://github.com/community-scripts/ProxmoxVE/pull/5428))
|
||||
- Minio: use latest version or latest feature rich version [@MickLesk](https://github.com/MickLesk) ([#5423](https://github.com/community-scripts/ProxmoxVE/pull/5423))
|
||||
- [core]: Improve GitHub release fetch robustness with split timeouts and retry logic [@MickLesk](https://github.com/MickLesk) ([#5422](https://github.com/community-scripts/ProxmoxVE/pull/5422))
|
||||
|
||||
- #### 💥 Breaking Changes
|
||||
|
||||
- bump scripts (Installer) from Ubuntu 22.04 to Ubuntu 24.04 (agentdvr, emby, jellyfin, plex, shinobi) [@MickLesk](https://github.com/MickLesk) ([#5434](https://github.com/community-scripts/ProxmoxVE/pull/5434))
|
||||
- Minio: use latest version or latest feature rich version [@MickLesk](https://github.com/MickLesk) ([#5423](https://github.com/community-scripts/ProxmoxVE/pull/5423))
|
||||
|
||||
- #### 🔧 Refactor
|
||||
|
||||
|
40
ct/gomft.sh
40
ct/gomft.sh
@ -45,9 +45,6 @@ function update_script() {
|
||||
msg_ok "Stopped $APP"
|
||||
|
||||
msg_info "Updating $APP to ${RELEASE}"
|
||||
if ! command -v git >/dev/null 2>&1; then
|
||||
$STD apt-get install -y git
|
||||
fi
|
||||
rm -f /opt/gomft/gomft
|
||||
temp_file=$(mktemp)
|
||||
curl -fsSL "https://github.com/StarFleetCPTN/GoMFT/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
|
||||
@ -56,43 +53,6 @@ function update_script() {
|
||||
cd /opt/gomft
|
||||
$STD npm install
|
||||
$STD npm run build
|
||||
TEMPL_VERSION="$(awk '/github.com\/a-h\/templ/{print $2}' go.mod)"
|
||||
$STD go install github.com/a-h/templ/cmd/templ@${TEMPL_VERSION}
|
||||
# dirty hack to fix templ
|
||||
cat <<'EOF' >/opt/gomft/components/file_metadata/search/file_metadata_search_content.templ
|
||||
package search
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/starfleetcptn/gomft/components/file_metadata"
|
||||
"github.com/starfleetcptn/gomft/components/file_metadata/list"
|
||||
)
|
||||
|
||||
templ FileMetadataSearchContent(ctx context.Context, data file_metadata.FileMetadataSearchData) {
|
||||
<!-- Search Results -->
|
||||
<div id="search-results">
|
||||
if len(data.Files) > 0 {
|
||||
@list.FileMetadataListPartial(ctx, file_metadata.FileMetadataListData{
|
||||
Files: data.Files,
|
||||
Page: data.Page,
|
||||
Limit: data.Limit,
|
||||
TotalCount: data.TotalCount,
|
||||
TotalPages: data.TotalPages,
|
||||
Filter: data.Filter,
|
||||
SortBy: data.SortBy,
|
||||
SortDir: data.SortDir,
|
||||
}, "/files/search/partial", "#search-results-container")
|
||||
} else {
|
||||
<div class="p-6 text-center text-gray-500 dark:text-gray-400">
|
||||
<svg class="mx-auto mb-4 w-12 h-12 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
|
||||
</svg>
|
||||
<p>No files found matching your search criteria.</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
EOF
|
||||
$STD "$HOME"/go/bin/templ generate
|
||||
export CGO_ENABLED=1
|
||||
export GOOS=linux
|
||||
|
@ -1,6 +1,6 @@
|
||||
____ _ ______ ______ ____________________________
|
||||
/ __ \/ | / / /\ \/ / __ \/ ____/ ____/ _/ ____/ ____/
|
||||
/ / / / |/ / / \ / / / / /_ / /_ / // / / __/
|
||||
/ /_/ / /| / /___/ / /_/ / __/ / __/ _/ // /___/ /___
|
||||
\____/_/ |_/_____/_/\____/_/ /_/ /___/\____/_____/
|
||||
|
||||
____ _ ______ ______ ____________________________ ____
|
||||
/ __ \/ | / / /\ \/ / __ \/ ____/ ____/ _/ ____/ ____/ / __ \____ __________
|
||||
/ / / / |/ / / \ / / / / /_ / /_ / // / / __/ / / / / __ \/ ___/ ___/
|
||||
/ /_/ / /| / /___/ / /_/ / __/ / __/ _/ // /___/ /___ / /_/ / /_/ / /__(__ )
|
||||
\____/_/ |_/_____/_/\____/_/ /_/ /___/\____/_____/ /_____/\____/\___/____/
|
||||
|
||||
|
@ -5,7 +5,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://www.onlyoffice.com/
|
||||
|
||||
APP="ONLYOFFICE"
|
||||
APP="ONLYOFFICE Docs"
|
||||
var_tags="${var_tags:-word;excel;powerpoint;pdf}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
|
@ -20,24 +20,18 @@ color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -f /etc/apt/trusted.gpg.d/php.gpg ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -f /etc/apt/trusted.gpg.d/php.gpg ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating $APP LXC"
|
||||
$STD apt-get update
|
||||
$STD apt-get -y upgrade
|
||||
msg_ok "Updated $APP LXC"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating OS"
|
||||
$STD apt-get update
|
||||
$STD apt-get -y upgrade
|
||||
msg_ok "Updated OS"
|
||||
|
||||
msg_info "Updating $APP LXC"
|
||||
$STD yunohost tools update
|
||||
$STD yunohost tools upgrade system
|
||||
$STD yunohost tools upgrade apps
|
||||
msg_ok "Updated $APP LXC"
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
@ -47,4 +41,4 @@ description
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"
|
4
frontend/public/json/add-tailscale-lxc.json
generated
4
frontend/public/json/add-tailscale-lxc.json
generated
@ -32,6 +32,10 @@
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Only supported on Debian 12 LXCs",
|
||||
"type": "warning"
|
||||
},
|
||||
{
|
||||
"text": "After the script finishes, reboot the LXC then run `tailscale up` in the LXC console",
|
||||
"type": "info"
|
||||
|
110
frontend/public/json/versions.json
generated
110
frontend/public/json/versions.json
generated
@ -1,59 +1,4 @@
|
||||
[
|
||||
{
|
||||
"name": "duplicati/duplicati",
|
||||
"version": "v2.1.0.120-2.1.0.120_canary_2025-06-24",
|
||||
"date": "2025-06-24T22:39:50Z"
|
||||
},
|
||||
{
|
||||
"name": "jenkinsci/jenkins",
|
||||
"version": "jenkins-2.516",
|
||||
"date": "2025-06-24T21:06:15Z"
|
||||
},
|
||||
{
|
||||
"name": "ollama/ollama",
|
||||
"version": "v0.9.3-rc1",
|
||||
"date": "2025-06-24T20:26:55Z"
|
||||
},
|
||||
{
|
||||
"name": "evcc-io/evcc",
|
||||
"version": "0.204.5",
|
||||
"date": "2025-06-24T19:17:16Z"
|
||||
},
|
||||
{
|
||||
"name": "ErsatzTV/ErsatzTV",
|
||||
"version": "v25.2.0",
|
||||
"date": "2025-06-24T17:06:31Z"
|
||||
},
|
||||
{
|
||||
"name": "arunavo4/gitea-mirror",
|
||||
"version": "v2.18.0",
|
||||
"date": "2025-06-24T08:29:55Z"
|
||||
},
|
||||
{
|
||||
"name": "element-hq/synapse",
|
||||
"version": "v1.132.0",
|
||||
"date": "2025-06-17T13:49:30Z"
|
||||
},
|
||||
{
|
||||
"name": "docker/compose",
|
||||
"version": "v2.37.3",
|
||||
"date": "2025-06-24T14:05:33Z"
|
||||
},
|
||||
{
|
||||
"name": "influxdata/influxdb",
|
||||
"version": "v3.2.0",
|
||||
"date": "2025-06-24T13:20:53Z"
|
||||
},
|
||||
{
|
||||
"name": "Checkmk/checkmk",
|
||||
"version": "v2.4.0p5",
|
||||
"date": "2025-06-24T13:06:53Z"
|
||||
},
|
||||
{
|
||||
"name": "home-assistant/core",
|
||||
"version": "2025.6.3",
|
||||
"date": "2025-06-24T13:00:12Z"
|
||||
},
|
||||
{
|
||||
"name": "rcourtman/Pulse",
|
||||
"version": "v3.31.2",
|
||||
@ -64,6 +9,11 @@
|
||||
"version": "preview-fix-proxy-axios",
|
||||
"date": "2025-06-24T08:50:22Z"
|
||||
},
|
||||
{
|
||||
"name": "arunavo4/gitea-mirror",
|
||||
"version": "v2.18.0",
|
||||
"date": "2025-06-24T08:29:55Z"
|
||||
},
|
||||
{
|
||||
"name": "Jackett/Jackett",
|
||||
"version": "v0.22.2052",
|
||||
@ -74,6 +24,11 @@
|
||||
"version": "coverity-w26-4.13.0",
|
||||
"date": "2025-06-24T02:02:34Z"
|
||||
},
|
||||
{
|
||||
"name": "evcc-io/evcc",
|
||||
"version": "0.204.4",
|
||||
"date": "2025-06-23T22:21:08Z"
|
||||
},
|
||||
{
|
||||
"name": "meilisearch/meilisearch",
|
||||
"version": "prototype-incremental-vector-store-1",
|
||||
@ -99,6 +54,16 @@
|
||||
"version": "v4.2.1",
|
||||
"date": "2025-06-03T20:04:28Z"
|
||||
},
|
||||
{
|
||||
"name": "home-assistant/core",
|
||||
"version": "2025.6.2",
|
||||
"date": "2025-06-23T18:38:37Z"
|
||||
},
|
||||
{
|
||||
"name": "Checkmk/checkmk",
|
||||
"version": "v2.4.0p5-rc2",
|
||||
"date": "2025-06-23T15:50:55Z"
|
||||
},
|
||||
{
|
||||
"name": "VictoriaMetrics/VictoriaMetrics",
|
||||
"version": "pmm-6401-v1.120.0",
|
||||
@ -249,6 +214,11 @@
|
||||
"version": "testing",
|
||||
"date": "2025-06-16T18:10:42Z"
|
||||
},
|
||||
{
|
||||
"name": "docker/compose",
|
||||
"version": "v2.37.2",
|
||||
"date": "2025-06-20T13:25:03Z"
|
||||
},
|
||||
{
|
||||
"name": "zabbix/zabbix",
|
||||
"version": "7.2.9",
|
||||
@ -309,6 +279,11 @@
|
||||
"version": "v1.11.11",
|
||||
"date": "2025-06-18T18:04:50Z"
|
||||
},
|
||||
{
|
||||
"name": "ollama/ollama",
|
||||
"version": "v0.9.2",
|
||||
"date": "2025-06-18T14:29:39Z"
|
||||
},
|
||||
{
|
||||
"name": "NodeBB/NodeBB",
|
||||
"version": "v3.12.7",
|
||||
@ -349,6 +324,11 @@
|
||||
"version": "v11.5.6",
|
||||
"date": "2025-06-17T22:00:40Z"
|
||||
},
|
||||
{
|
||||
"name": "jenkinsci/jenkins",
|
||||
"version": "jenkins-2.515",
|
||||
"date": "2025-06-17T19:17:56Z"
|
||||
},
|
||||
{
|
||||
"name": "project-zot/zot",
|
||||
"version": "v2.1.5",
|
||||
@ -359,6 +339,11 @@
|
||||
"version": "v25.05.1",
|
||||
"date": "2025-06-17T14:38:04Z"
|
||||
},
|
||||
{
|
||||
"name": "element-hq/synapse",
|
||||
"version": "v1.132.0",
|
||||
"date": "2025-06-17T13:49:30Z"
|
||||
},
|
||||
{
|
||||
"name": "cloudflare/cloudflared",
|
||||
"version": "2025.6.1",
|
||||
@ -664,6 +649,11 @@
|
||||
"version": "2.0.0-beta.2-temp",
|
||||
"date": "2025-03-28T08:45:58Z"
|
||||
},
|
||||
{
|
||||
"name": "influxdata/influxdb",
|
||||
"version": "v1.12.1rc3",
|
||||
"date": "2025-06-03T14:05:52Z"
|
||||
},
|
||||
{
|
||||
"name": "Pf2eToolsOrg/Pf2eTools",
|
||||
"version": "v0.9.0",
|
||||
@ -729,6 +719,11 @@
|
||||
"version": "0.19.2",
|
||||
"date": "2025-05-29T14:39:17Z"
|
||||
},
|
||||
{
|
||||
"name": "duplicati/duplicati",
|
||||
"version": "v2.1.0.119-2.1.0.119_canary_2025-05-29",
|
||||
"date": "2025-05-29T06:14:27Z"
|
||||
},
|
||||
{
|
||||
"name": "apache/cassandra",
|
||||
"version": "cassandra-4.0.18",
|
||||
@ -1234,6 +1229,11 @@
|
||||
"version": "0.7.2",
|
||||
"date": "2025-01-13T22:17:18Z"
|
||||
},
|
||||
{
|
||||
"name": "ErsatzTV/ErsatzTV",
|
||||
"version": "v25.1.0",
|
||||
"date": "2025-01-10T18:14:54Z"
|
||||
},
|
||||
{
|
||||
"name": "go-vikunja/vikunja",
|
||||
"version": "v0.24.6",
|
||||
|
76
frontend/public/json/yunohost.json
generated
76
frontend/public/json/yunohost.json
generated
@ -1,40 +1,40 @@
|
||||
{
|
||||
"name": "YunoHost",
|
||||
"slug": "yunohost",
|
||||
"categories": [
|
||||
2
|
||||
],
|
||||
"date_created": "2024-05-02",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 80,
|
||||
"documentation": null,
|
||||
"website": "https://yunohost.org/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/yunohost.webp",
|
||||
"config_path": "",
|
||||
"description": "YunoHost is an operating system aiming for the simplest administration of a server, and therefore democratize self-hosting, while making sure it stays reliable, secure, ethical and lightweight.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/yunohost.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 20,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "WARNING: Installation sources scripts outside of Community Scripts repo. Please check the source before installing.",
|
||||
"type": "warning"
|
||||
}
|
||||
]
|
||||
"name": "YunoHost",
|
||||
"slug": "yunohost",
|
||||
"categories": [
|
||||
2
|
||||
],
|
||||
"date_created": "2024-05-02",
|
||||
"type": "ct",
|
||||
"updateable": false,
|
||||
"privileged": false,
|
||||
"interface_port": 80,
|
||||
"documentation": null,
|
||||
"website": "https://yunohost.org/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/yunohost.webp",
|
||||
"config_path": "",
|
||||
"description": "YunoHost is an operating system aiming for the simplest administration of a server, and therefore democratize self-hosting, while making sure it stays reliable, secure, ethical and lightweight.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/yunohost.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 20,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "WARNING: Installation sources scripts outside of Community Scripts repo. Please check the source before installing.",
|
||||
"type": "warning"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -34,43 +34,11 @@ tar -xzf "$temp_file"
|
||||
mv GoMFT-"${RELEASE}"/ /opt/gomft
|
||||
cd /opt/gomft
|
||||
TEMPL_VERSION="$(awk '/github.com\/a-h\/templ/{print $2}' go.mod)"
|
||||
$STD go install github.com/a-h/templ/cmd/templ@${TEMPL_VERSION}
|
||||
$STD go install github.com/a-h/templ/cmd/templ@v${TEMPL_VERSION}
|
||||
cp /opt/gomft/components/file_metadata/search/file_metadata_search_content.templ{,.bak}
|
||||
# dirty hack to fix templ
|
||||
cat <<'EOF' >/opt/gomft/components/file_metadata/search/file_metadata_search_content.templ
|
||||
package search
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/starfleetcptn/gomft/components/file_metadata"
|
||||
"github.com/starfleetcptn/gomft/components/file_metadata/list"
|
||||
)
|
||||
|
||||
templ FileMetadataSearchContent(ctx context.Context, data file_metadata.FileMetadataSearchData) {
|
||||
<!-- Search Results -->
|
||||
<div id="search-results">
|
||||
if len(data.Files) > 0 {
|
||||
@list.FileMetadataListPartial(ctx, file_metadata.FileMetadataListData{
|
||||
Files: data.Files,
|
||||
Page: data.Page,
|
||||
Limit: data.Limit,
|
||||
TotalCount: data.TotalCount,
|
||||
TotalPages: data.TotalPages,
|
||||
Filter: data.Filter,
|
||||
SortBy: data.SortBy,
|
||||
SortDir: data.SortDir,
|
||||
}, "/files/search/partial", "#search-results-container")
|
||||
} else {
|
||||
<div class="p-6 text-center text-gray-500 dark:text-gray-400">
|
||||
<svg class="mx-auto mb-4 w-12 h-12 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
|
||||
</svg>
|
||||
<p>No files found matching your search criteria.</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
EOF
|
||||
sed -i -e '/<div id="search-results">/a \ @{' \
|
||||
-e '/^ }$/a \ }' \
|
||||
/opt/gomft/components/file_metadata/search/file_metadata_search_content.templ
|
||||
$STD "$HOME"/go/bin/templ generate
|
||||
$STD go build -o gomft main.go
|
||||
chmod +x /opt/gomft/gomft
|
||||
|
@ -2,12 +2,10 @@
|
||||
|
||||
# Copyright (c) 2021-2025 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
set -Eeuo pipefail
|
||||
trap 'echo -e "\n[ERROR] in line $LINENO: exit code $?"' ERR
|
||||
|
||||
function header_info() {
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
______ _ __ __
|
||||
@ -18,95 +16,60 @@ function header_info() {
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
function msg_info() { echo -e " \e[1;36m➤\e[0m $1"; }
|
||||
function msg_ok() { echo -e " \e[1;32m✔\e[0m $1"; }
|
||||
function msg_error() { echo -e " \e[1;31m✖\e[0m $1"; }
|
||||
|
||||
header_info
|
||||
|
||||
if ! command -v pveversion &>/dev/null; then
|
||||
msg_error "This script must be run on the Proxmox VE host (not inside an LXC container)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -e
|
||||
while true; do
|
||||
read -rp "This will add Tailscale to an existing LXC Container ONLY. Proceed (y/n)? " yn
|
||||
case "$yn" in
|
||||
read -p "This will add Tailscale to an existing LXC Container ONLY. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit 0 ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
header_info
|
||||
msg_info "Loading container list..."
|
||||
echo "Loading..."
|
||||
function msg() {
|
||||
local TEXT="$1"
|
||||
echo -e "$TEXT"
|
||||
}
|
||||
|
||||
NODE=$(hostname)
|
||||
MSG_MAX_LENGTH=0
|
||||
CTID_MENU=()
|
||||
|
||||
while read -r line; do
|
||||
TAG=$(echo "$line" | awk '{print $1}')
|
||||
ITEM=$(echo "$line" | awk '{print substr($0,36)}')
|
||||
OFFSET=2
|
||||
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=$((${#ITEM} + OFFSET))
|
||||
CTID_MENU+=("$TAG" "$ITEM" "OFF")
|
||||
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
|
||||
MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
|
||||
fi
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(pct list | awk 'NR>1')
|
||||
|
||||
CTID=""
|
||||
while [[ -z "${CTID}" ]]; do
|
||||
while [ -z "${CTID:+x}" ]; do
|
||||
CTID=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Containers on $NODE" --radiolist \
|
||||
"\nSelect a container to add Tailscale to:\n" \
|
||||
16 $((MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit 1
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3)
|
||||
done
|
||||
|
||||
CTID_CONFIG_PATH="/etc/pve/lxc/${CTID}.conf"
|
||||
|
||||
# Skip if already configured
|
||||
grep -q "lxc.cgroup2.devices.allow: c 10:200 rwm" "$CTID_CONFIG_PATH" || echo "lxc.cgroup2.devices.allow: c 10:200 rwm" >>"$CTID_CONFIG_PATH"
|
||||
grep -q "lxc.mount.entry: /dev/net/tun" "$CTID_CONFIG_PATH" || echo "lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file" >>"$CTID_CONFIG_PATH"
|
||||
|
||||
CTID_CONFIG_PATH=/etc/pve/lxc/${CTID}.conf
|
||||
cat <<EOF >>$CTID_CONFIG_PATH
|
||||
lxc.cgroup2.devices.allow: c 10:200 rwm
|
||||
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
|
||||
EOF
|
||||
header_info
|
||||
msg_info "Installing Tailscale in CT $CTID"
|
||||
|
||||
msg "Installing Tailscale..."
|
||||
pct exec "$CTID" -- bash -c '
|
||||
set -e
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
ID=$(grep "^ID=" /etc/os-release | cut -d"=" -f2)
|
||||
VER=$(grep "^VERSION_CODENAME=" /etc/os-release | cut -d"=" -f2)
|
||||
|
||||
# fallback if DNS is poisoned or blocked
|
||||
ORIG_RESOLV="/etc/resolv.conf"
|
||||
BACKUP_RESOLV="/tmp/resolv.conf.backup"
|
||||
|
||||
if ! dig +short pkgs.tailscale.com | grep -qvE "^127\.|^0\.0\.0\.0$"; then
|
||||
echo "[INFO] DNS resolution for pkgs.tailscale.com failed (blocked or redirected)."
|
||||
echo "[INFO] Temporarily overriding /etc/resolv.conf with Cloudflare DNS (1.1.1.1)"
|
||||
cp "$ORIG_RESOLV" "$BACKUP_RESOLV"
|
||||
echo "nameserver 1.1.1.1" >"$ORIG_RESOLV"
|
||||
fi
|
||||
|
||||
curl -fsSL https://pkgs.tailscale.com/stable/${ID}/${VER}.noarmor.gpg \
|
||||
| tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
|
||||
|
||||
echo "deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/${ID} ${VER} main" \
|
||||
>/etc/apt/sources.list.d/tailscale.list
|
||||
|
||||
apt-get update -qq
|
||||
apt-get install -y tailscale >/dev/null
|
||||
|
||||
if [[ -f /tmp/resolv.conf.backup ]]; then
|
||||
echo "[INFO] Restoring original /etc/resolv.conf"
|
||||
mv /tmp/resolv.conf.backup /etc/resolv.conf
|
||||
fi
|
||||
curl -fsSL https://pkgs.tailscale.com/stable/$ID/$VER.noarmor.gpg | tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
|
||||
echo "deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/$ID $VER main" >/etc/apt/sources.list.d/tailscale.list
|
||||
apt-get update &>/dev/null
|
||||
apt-get install -y tailscale &>/dev/null
|
||||
'
|
||||
|
||||
TAGS=$(awk -F': ' '/^tags:/ {print $2}' "$CTID_CONFIG_PATH")
|
||||
TAGS=$(awk -F': ' '/^tags:/ {print $2}' /etc/pve/lxc/${CTID}.conf)
|
||||
TAGS="${TAGS:+$TAGS; }tailscale"
|
||||
pct set "$CTID" -tags "$TAGS"
|
||||
pct set "$CTID" -tags "${TAGS}"
|
||||
msg "\e[1;32m ✔ Installed Tailscale\e[0m"
|
||||
|
||||
msg_ok "Tailscale installed on CT $CTID"
|
||||
msg_info "Reboot the container, then run 'tailscale up' inside the container to activate."
|
||||
msg "\e[1;31m Reboot ${CTID} LXC to apply the changes, then run tailscale up in the LXC console\e[0m"
|
||||
|
Reference in New Issue
Block a user