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

Add RunAsUser and env vars to Community scripts .json for prefilled default deployment #245

Open
silversword411 opened this issue Aug 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@silversword411
Copy link
Contributor

No description provided.

@silversword411 silversword411 added the enhancement New feature or request label Aug 14, 2024
@cdp1337
Copy link
Contributor

cdp1337 commented Aug 14, 2024

Issue:

When creating a custom script meant for deployment, it is possible to assign default execution parameters to the scripts as per https://github.com/amidaware/community-scripts/blob/main/community_scripts.schema.json (refer to the following directive:

"args": {
        "description": "The script arguments listed as an array.",
        "type": "array",
        "items": {
          "type": "string"
        }
      },

However, at the moment it is not possible to define defaults for environmental variables and the Windows-only option of "Run As User".

For the environmental variables option, it makes sense to stick with the same format as args as they share similar functionality, (just different implementations).

Proposal:

"env": {
        "description": "The environmental variables when running the script listed as an array.",
        "type": "array",
        "items": {
          "type": "string"
        }
      },
"run_as_user": {
        "description": "Run this script as the active user as opposed to System (Windows only)",
        "type": "boolean"
      },

Be added to the schema and modification of the underlying script importer (if necessary), to support these new defaults.

(Example proposal, obviously feel free to implement how you see fit)

cdp1337 added a commit to cdp1337/tacticalrmm that referenced this issue Aug 15, 2024
Modify the load_community_scripts logic to add
env and run_as_user keys.
cdp1337 added a commit to cdp1337/tacticalrmm-community-scripts that referenced this issue Aug 15, 2024
Just add the env and run_as_user keys to the schema.
wh1te909 added a commit that referenced this issue Aug 20, 2024
wh1te909 added a commit to amidaware/tacticalrmm that referenced this issue Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants