[PR #1230] [CLOSED] Implement overridable URL for scripts #3067

Closed
opened 2026-02-26 13:32:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/1230
Author: @cricalix
Created: 1/4/2025
Status: Closed

Base: developHead: relocatable-url


📝 Commits (2)

  • fc71c77 Implement overridable URL for container scripts
  • 3ca54f6 Replace wget with curl, as wget does not do file:///

📊 Changes

200 files changed (+404 additions, -205 deletions)

View changed files

📝 ct/actualbudget.sh (+2 -1)
📝 ct/adguard.sh (+2 -1)
📝 ct/adventurelog.sh (+2 -1)
📝 ct/agentdvr.sh (+2 -1)
📝 ct/alpine-docker.sh (+2 -1)
📝 ct/alpine-grafana.sh (+2 -1)
📝 ct/alpine-nextcloud.sh (+2 -1)
📝 ct/alpine-vaultwarden.sh (+2 -1)
📝 ct/alpine-zigbee2mqtt.sh (+2 -1)
📝 ct/alpine.sh (+2 -1)
📝 ct/apache-cassandra.sh (+2 -1)
📝 ct/apache-couchdb.sh (+2 -1)
📝 ct/apache-guacamole.sh (+2 -1)
📝 ct/apt-cacher-ng.sh (+2 -1)
📝 ct/archivebox.sh (+2 -1)
📝 ct/aria2.sh (+2 -1)
📝 ct/audiobookshelf.sh (+2 -1)
📝 ct/authentik.sh (+2 -1)
📝 ct/autobrr.sh (+2 -1)
📝 ct/bazarr.sh (+2 -1)

...and 80 more files

📄 Description

🛠️ Note:
We are meticulous about merging code into the main branch, so please understand that pull requests not meeting the project's standards may be rejected. It's never personal!
🎮 Note for game-related scripts: These have a lower likelihood of being merged.


✍️ Description

In #1202, I proposed that it would be beneficial to support a mechanism that allows changing the URL sourced by the ct/*.sh scripts through an environment variable. This PR implements the changes needed to achieve this, as best I can tell.

It is now possible to set the environment variable CSCRIPTS_BASE_URL to any URL format that curl supports - http://, https://, file://, and more - which points to the base location for the ct, misc, install etcetera directories.

A previous version of this PR declared a second variable, BRANCH, and re-used it in the CSCRIPTS_BASE_URL default definition. After some thinking, I decided this was probably not the right approach; I presume there is automation for switching from develop to main (or the other way) that replaces URLs already, so having a separate variable for the branch didn't make much sense. Changing branches in the URL now (for testing by hand etc) is a case of setting CSCRIPTS_BASE_URL to whatever repository URL is needed, with the branch present in the string.

This PR is essentially a codemod done with rg -sl 'curl -s' | xargs sed -i -e '/ProxmoxVE\/develop\/misc/ i: "${CSCRIPTS_BASE_URL:=https://raw.githubusercontent.com/community-scripts/ProxmoxVE/develop}"' -e 's%https://raw.githubusercontent.com/community-scripts/ProxmoxVE/develop/misc/build.func%"${CSCRIPTS_BASE_URL}/misc/build.func"%'

build.func had one call to wget (outside of the containers) that has to be switched to curl, as wget does not understand file:/// URLs. Since the other fetches in the file are done with curl, consistency here makes sense to me.

I cross-checked with some rg usage that the other occurrences of ProxmoxVE/develop were in Markdown files or image URLs.


Please remove unneeded lines!

  • Related Discussion: #1202

🛠️ Type of Change

Please check the relevant options:

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change unexpectedly)
  • New script (a fully functional and thoroughly tested script or set of scripts)

Prerequisites

The following steps must be completed for the pull request to be considered:

  • Self-review performed (I have reviewed my code to ensure it follows established patterns and conventions.)
  • Testing performed (I have thoroughly tested my changes and verified expected functionality.)
  • Documentation updated (I have updated any relevant documentation)

📋 Additional Information (optional)

From the linked discussion

~/Source/ProxmoxVE$ CSCRIPTS_BASE_URL=file://$HOME/Source/ProxmoxVE bash ct/lidarr.sh
FIGlet or the slant font is missing. Installing...
Unsupported operating system.
Using file:///home/cricalix/Source/ProxmoxVE as source of truth
  🖥  Operating System: debian
  🌟  Version: 12
  📦  Container Type: Unprivileged (WOOHOO)
  💾  Disk Size: 4GB
  🧠  CPU Cores: 2
  🛠  RAM Size: 1024MB
  🆔  Container ID: 
  🚀  Creating a Lidarr LXC using the above default settings

Previously submitted as #1211, which I broke somehow..

Screencast_20250104_124526.webm

20250104_124631


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/1230 **Author:** [@cricalix](https://github.com/cricalix) **Created:** 1/4/2025 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `relocatable-url` --- ### 📝 Commits (2) - [`fc71c77`](https://github.com/community-scripts/ProxmoxVE/commit/fc71c77ee51f22e576d0baf8460df9d0639a4b45) Implement overridable URL for container scripts - [`3ca54f6`](https://github.com/community-scripts/ProxmoxVE/commit/3ca54f63b52fbe7ed161d93a9b4a0cf168cb3a90) Replace wget with curl, as wget does not do file:/// ### 📊 Changes **200 files changed** (+404 additions, -205 deletions) <details> <summary>View changed files</summary> 📝 `ct/actualbudget.sh` (+2 -1) 📝 `ct/adguard.sh` (+2 -1) 📝 `ct/adventurelog.sh` (+2 -1) 📝 `ct/agentdvr.sh` (+2 -1) 📝 `ct/alpine-docker.sh` (+2 -1) 📝 `ct/alpine-grafana.sh` (+2 -1) 📝 `ct/alpine-nextcloud.sh` (+2 -1) 📝 `ct/alpine-vaultwarden.sh` (+2 -1) 📝 `ct/alpine-zigbee2mqtt.sh` (+2 -1) 📝 `ct/alpine.sh` (+2 -1) 📝 `ct/apache-cassandra.sh` (+2 -1) 📝 `ct/apache-couchdb.sh` (+2 -1) 📝 `ct/apache-guacamole.sh` (+2 -1) 📝 `ct/apt-cacher-ng.sh` (+2 -1) 📝 `ct/archivebox.sh` (+2 -1) 📝 `ct/aria2.sh` (+2 -1) 📝 `ct/audiobookshelf.sh` (+2 -1) 📝 `ct/authentik.sh` (+2 -1) 📝 `ct/autobrr.sh` (+2 -1) 📝 `ct/bazarr.sh` (+2 -1) _...and 80 more files_ </details> ### 📄 Description > **🛠️ Note:** > We are meticulous about merging code into the main branch, so please understand that pull requests not meeting the project's standards may be rejected. It's never personal! > 🎮 **Note for game-related scripts:** These have a lower likelihood of being merged. --- ## ✍️ Description In #1202, I proposed that it would be beneficial to support a mechanism that allows changing the URL sourced by the `ct/*.sh` scripts through an environment variable. This PR implements the changes needed to achieve this, as best I can tell. It is now possible to set the environment variable `CSCRIPTS_BASE_URL` to any URL format that `curl` supports - http://, https://, file://, and more - which points to the base location for the `ct`, `misc`, `install` etcetera directories. A previous version of this PR declared a second variable, `BRANCH`, and re-used it in the `CSCRIPTS_BASE_URL` default definition. After some thinking, I decided this was probably not the right approach; I presume there is automation for switching from develop to main (or the other way) that replaces URLs already, so having a separate variable for the branch didn't make much sense. Changing branches in the URL now (for testing by hand etc) is a case of setting `CSCRIPTS_BASE_URL` to whatever repository URL is needed, with the branch present in the string. This PR is essentially a codemod done with `rg -sl 'curl -s' | xargs sed -i -e '/ProxmoxVE\/develop\/misc/ i: "${CSCRIPTS_BASE_URL:=https://raw.githubusercontent.com/community-scripts/ProxmoxVE/develop}"' -e 's%https://raw.githubusercontent.com/community-scripts/ProxmoxVE/develop/misc/build.func%"${CSCRIPTS_BASE_URL}/misc/build.func"%'` `build.func` had one call to `wget` (outside of the containers) that has to be switched to `curl`, as `wget` does not understand `file:///` URLs. Since the other fetches in the file are done with `curl`, consistency here makes sense to me. I cross-checked with some `rg` usage that the other occurrences of ProxmoxVE/develop were in Markdown files or image URLs. - - - **_Please remove unneeded lines!_** - Related Discussion: #1202 --- ## 🛠️ Type of Change Please check the relevant options: - [ ] Bug fix (non-breaking change that resolves an issue) - [ ] New feature (non-breaking change that adds functionality) - [X] Breaking change (fix or feature that would cause existing functionality to change unexpectedly) - [ ] New script (a fully functional and thoroughly tested script or set of scripts) --- ## ✅ Prerequisites The following steps must be completed for the pull request to be considered: - [X] Self-review performed (I have reviewed my code to ensure it follows established patterns and conventions.) - [X] Testing performed (I have thoroughly tested my changes and verified expected functionality.) - [ ] ~Documentation updated (I have updated any relevant documentation)~ --- ## 📋 Additional Information (optional) From the linked discussion ``` ~/Source/ProxmoxVE$ CSCRIPTS_BASE_URL=file://$HOME/Source/ProxmoxVE bash ct/lidarr.sh FIGlet or the slant font is missing. Installing... Unsupported operating system. Using file:///home/cricalix/Source/ProxmoxVE as source of truth 🖥 Operating System: debian 🌟 Version: 12 📦 Container Type: Unprivileged (WOOHOO) 💾 Disk Size: 4GB 🧠 CPU Cores: 2 🛠 RAM Size: 1024MB 🆔 Container ID: 🚀 Creating a Lidarr LXC using the above default settings ``` Previously submitted as #1211, which I broke somehow.. [Screencast_20250104_124526.webm](https://github.com/user-attachments/assets/bb0a20ba-bbb7-4fb5-9b74-a74928f982f3) ![20250104_124631](https://github.com/user-attachments/assets/af264057-52b4-435c-83d9-6b4e8130d10b) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 13:32:18 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE#3067
No description provided.