Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT FOR DISCUSSION] Support for helper-scripts environment variables #906

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

remz1337
Copy link
Contributor

🛠️ 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

This is a draft PR, following some ideas we had discussed over Discord a few weeks ago. It was also requested by a few users (can't recall where)

Idea is to be able to save/reuse come configurations/parameters. I'm using a configuration file in /etc/pve-helper-scripts.conf to store the variables, and load them in memory when calling install_script function.

Variables are stored like this in the config file:

APT_CACHER_IP='192.168.1.123'
SSH_USER='admin'
SSH_PASSWORD='$1$PCdmJEPa$.YOlH8I4qBP15r7LV8Ho50'

🛠️ 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)

@github-actions github-actions bot added the high risk A change that can affect many scripts label Dec 18, 2024
@havardthom
Copy link
Contributor

I would prefer to make this simpler and just support reading a /etc/pve-helper-scripts.conf file if it exists and not do any writing to it. Any environment variable defined in the config file would be prefilled in the input during advanced install. Then just have some docs informing about the possibility.

@newzealandpaul
Copy link
Contributor

I think either/or is a good idea. Doing advanced mode and setting everything one at a time is tedious. I would like to be promoted specifically showing what values are overriding the defaults (maybe "****" our the passwords).

@michelroegl-brunner
Copy link
Member

I would side with @havardthom on this. We should not overcomplicate the UI, keep it simpler then bloat it.

One addition could be that we make the path configerable. When you have more then one node in a Cluster you could make it so the config file can be shared on a Network Share / a folder wich is accesible from everey Host in the cluster. This Way you only need one consitent config file and not 5 different one. With this feature implemente we could also more easily look into supoorting SSH Keys.

Also maybe @BramSuurdje could in addition to Documentation create a Config File Editor similar to the JSON-Editor.

This could mabe look somthing like this:

import /NFS/folder/pve-helper-scripts.conf  #Here you may import a "global" config file"

IP_ADDRESS=10.0.0.1 #Settings only relevant for this host, when you have more then one VLAN/Network for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high risk A change that can affect many scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants