mirror of
https://github.com/amidaware/tacticalrmm.git
synced 2026-04-26 06:55:52 +03:00
[GH-ISSUE #1206] Use Git repo for custom scripts #2686
Labels
No labels
In Process
bug
bug
dev-triage
documentation
duplicate
enhancement
fixed
good first issue
help wanted
integration
invalid
pull-request
question
requires agent update
security
ui tweak
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tacticalrmm#2686
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @captainpteracloud on GitHub (Jul 11, 2022).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1206
Under Script Manager, add the option to add Git Repos as a source for custom scripts.
Have the ability to add multiple repos as sources.
Add a "Source" column to table where they scripts reside (Local, TRMM Community, Git)
Add filtering on the table view
@silversword411 commented on GitHub (Jul 11, 2022):
I like it.
Could probably replicate the existing scripts and processes...though right now it's a one-way sync. Probably a lot of work to do the reverse direction, and how to control sync and might impose some restrictions
@dinger1986 commented on GitHub (Jul 11, 2022):
This could be done with a script as currently they are updated with the trmm update script.
@captainpteracloud commented on GitHub (Jul 11, 2022):
I suppose I could set a cron job to clone a git repo and have that copied to the Tactical RMM scripts folder. However, I think this is something that should be implemented in the GUI.
@dinger1986 commented on GitHub (Jul 11, 2022):
Maybe I'm missing something but if they are public on GitHub why wouldn't they be in the scripts repo?
@silversword411 commented on GitHub (Jul 12, 2022):
You could have scripts customized to your environment and private repo with API key...I could see reasons for it.
Of course if there were scripts that would be useful for all, giving back and integrating with community library would be preferred.
@ninjamonkey198206 commented on GitHub (Jul 18, 2022):
@silversword411 the only issue with that would be that you need to include a login method of some sort to use a private repo, as keeping potentially sensitive info in a public repo would be a bad idea.
@captainpteracloud commented on GitHub (Jul 18, 2022):
It would be a private repo, ideally utilizing API tokens to download. It makes sense to keep all my scripts in a git repo and track commits and changes.
Could be done something like https://stackoverflow.com/questions/9504791/is-there-anyway-to-programmatically-fetch-a-zipball-of-private-github-repo
Then its a matter of extracting the zip of the scripts to a folder matching the Repo name in the scripts directory.
I think the actual grab of the repo would be the easiest part.
@dinger1986 commented on GitHub (Jul 19, 2022):
I really struggle to see the merit in this, if its used only in one Tactical (max 2 as one is maybe prod and other dev you would really want uploading from there to the repo as well) RMM Server then its not advantageous to download from GitHub, your backups include your scripts etc so would copy to another server in the event of DR.
@ninjamonkey198206 commented on GitHub (Jul 19, 2022):
Look at it from a hosting perspective:
If Amidaware is hosting a lot of these and managing them, them it actually would make sense for clients to have a way to easily upload their custom scripts from the UI.
It's a pretty good idea to have as an option, though I don't know if I'd put it at the top of the to-do list.
@NiceGuyIT commented on GitHub (Jul 19, 2022):
This is needed from a SDLC standpoint because it adds 1) versioning and 2) management by pinning a script to a particular version. For me, most development happens outside TRMM in a full IDE where I can iterate over the script faster. It's not until the end that I copy it into TRMM. The original is kept in a self-hosted Gitea repo. Keeping the git repo in sync with Tactical is a manual process.
The current implementation has several drawbacks.
git log --patchis the closest but it doesn't show changes for PRs.Using a custom git repo (public or private) for scripts in production makes sense until all above items are addressed.
@captainpteracloud commented on GitHub (Jul 20, 2022):
I don't see a drawback of implementing git. Its maturation of the software and will make it more attractive to enterprise use.
There is no reason to try and make Tactical RMM into a version control system or IDE. So it makes sense to integrate in a system that is.
@bbrendon commented on GitHub (Jul 21, 2022):
Interesting idea. Looks like you could do this now by merging your own scripts into /opt/trmm-community-scripts and running
python manage.py load_community_scripts@NiceGuyIT commented on GitHub (May 15, 2023):
Here's my solution: https://github.com/NiceGuyIT/taskfiles/tree/main/trmm
@nativeit commented on GitHub (Dec 21, 2023):
I think there were a few slightly diverging takes on this idea, judging from the context clues in some of the comments.
I could see having both the ability to link one's own private git repository with their own custom scripts, as well as changing the community scripts such they are hosted/managed/synced directly with the Github repo. The community scripts being moved to git has all the crucial advantages mentioned by @NiceGuyIT, and it could also resolve many of the significant issues that were raised and discussed in #1486 as well (specifically the behavior of modified and/or deprecated scripts that are removed from automation routines).
If someone worked to further flesh out the git interface within TRMM, so SSH/GPG keys and access tokens could be utilized, it might also facilitate some additional features and options that could be used within scripts. Things like:
@clambert-daileycomputer commented on GitHub (Mar 8, 2024):
here's a hacky implementation of github webhooks + tactical rmm:
https://github.com/daileycomputerconsulting/tactical-rmm-webhooks