-
Notifications
You must be signed in to change notification settings - Fork 153
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
NB-11852: Set ReleaseChannel In JumpCloud Password Manager command #586
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2207f89
NB-11852: Linux Set ReleaseChannel In JumpCloud Password Manager command
gbitarjc 7f9aca5
NB-11852: Mac Set ReleaseChannel In JumpCloud Password Manager command
gbitarjc f882502
NB-11852: Windows Set ReleaseChannel In JumpCloud Password Manager co…
gbitarjc c948526
feat: Updated commands.json to include the new macOS command related …
jkhalifejc b4036f8
feat: Added import JC command to the macOS release channel script
jkhalifejc 779fd34
fix: Removed empty line at eof in commands.json
jkhalifejc 0142359
feat: Updated macOS md file
jkhalifejc accbfb7
feat: Added windows set release channel script
jkhalifejc e7cf69a
feat: Added Linux set release channel script
jkhalifejc dbba080
fix: release channel scripts
gbitarjc 4be1aaf
fix: Mac - Set ReleaseChannel In JumpCloud Password Manager.md loops …
gbitarjc d69dee6
fix: Linux - Set ReleaseChannel In JumpCloud Password Manager.md loop…
gbitarjc 08ec9d2
fix: addressed PR comments
gbitarjc 771e031
fix: Mac - Set ReleaseChannel In JumpCloud Password Manager script re…
gbitarjc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...lery/Linux Commands/Linux - Set ReleaseChannel In JumpCloud Password Manager.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#### Name | ||
|
||
Linux - Set JumpCloud Password Manager's Release Channel | v1.0 JCCG | ||
|
||
#### commandType | ||
|
||
linux | ||
|
||
#### Command | ||
|
||
``` | ||
#!/bin/bash | ||
|
||
# Set $releaseChannel to beta OR dogfood OR public depending on your desired release channel | ||
releaseChannel="public" | ||
|
||
#------- Do not modify below this line ------ | ||
|
||
allowed_values=("beta" "dogfood" "public") | ||
|
||
if [[ ! " ${allowed_values[@]} " =~ " $releaseChannel " ]]; then | ||
echo "Error: Variable \$releaseChannel must be either 'beta', 'dogfood', or 'public'." | ||
exit 1 | ||
fi | ||
|
||
for user in $(awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) print $1}' /etc/passwd); do | ||
if [[ -d /home/$user ]]; then | ||
basePath="/home/$user/.config/JumpCloud Password Manager" | ||
|
||
filePath="$basePath/data/daemon/releaseChannel.txt" | ||
|
||
mkdir -p "$(dirname "$filePath")" | ||
|
||
echo -n "$releaseChannel" >"$filePath" | ||
|
||
sudo chown -R $user:$user "$basePath" | ||
fi | ||
done | ||
``` | ||
|
||
#### Description | ||
|
||
This command will set the desired release channel for JumpCloud's Password Manager in application's directory. The relesase channel options are beta, dogfood and public. | ||
|
||
#### *Import This Command* | ||
|
||
To import this command into your JumpCloud tenant run the below command using the [JumpCloud PowerShell Module](https://github.com/TheJumpCloud/support/wiki/Installing-the-JumpCloud-PowerShell-Module) | ||
|
||
``` | ||
Import-JCCommand -URL "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Linux%20Commands/Linux%20-%20Set%20ReleaseChannel%20In%20JumpCloud%20Password%20Manager.md" | ||
``` |
51 changes: 51 additions & 0 deletions
51
... Gallery/Mac Commands/Mac - Set ReleaseChannel In JumpCloud Password Manager.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#### Name | ||
|
||
Mac - Set JumpCloud Password Manager Release Channel | v1.0 JCCG | ||
|
||
#### commandType | ||
|
||
mac | ||
|
||
#### Command | ||
|
||
``` | ||
#!/bin/bash | ||
|
||
# Set releaseChannel to beta OR dogfood OR public depending on your desired release channel | ||
releaseChannel="dogfood" | ||
|
||
#------- Do not modify below this line ------ | ||
|
||
allowed_values=("beta" "dogfood" "public") | ||
|
||
if [[ ! " ${allowed_values[@]} " =~ " $releaseChannel " ]]; then | ||
echo "Error: Variable \$releaseChannel must be either 'beta', 'dogfood', or 'public'." | ||
exit 1 | ||
fi | ||
|
||
for user in $(dscl . list /Users | grep -vE 'root|daemon|nobody|^_'); do | ||
if [[ -d /Users/$user ]]; then | ||
basePath="/Users/$user/Library/Application Support/JumpCloud Password Manager" | ||
|
||
filePath="$basePath/data/daemon/releaseChannel.txt" | ||
|
||
mkdir -p "$(dirname "$filePath")" | ||
|
||
echo -n "$releaseChannel" >"$filePath" | ||
|
||
sudo chown -R $user "$basePath" | ||
fi | ||
done | ||
``` | ||
|
||
#### Description | ||
|
||
This command will set the desired release channel for JumpCloud's Password Manager in application's directory. The relesase channel options are beta, dogfood and public. | ||
|
||
#### *Import This Command* | ||
|
||
To import this command into your JumpCloud tenant run the below command using the [JumpCloud PowerShell Module](https://github.com/TheJumpCloud/support/wiki/Installing-the-JumpCloud-PowerShell-Module) | ||
|
||
``` | ||
Import-JCCommand -URL "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Mac%20Commands/Mac%20-%20Set%20ReleaseChannel%20In%20JumpCloud%20Password%20Manager.md" | ||
``` |
51 changes: 51 additions & 0 deletions
51
.../Windows Commands/Windows - Set ReleaseChannel In JumpCloud Password Manager.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#### Name | ||
|
||
Windows - Set JumpCloud Password Manager's Release Channel | v1.0 JCCG | ||
|
||
#### commandType | ||
|
||
windows | ||
|
||
#### Command | ||
|
||
``` | ||
# Set $releaseChannel to beta OR dogfood OR public depending on your desired release channel | ||
$releaseChannel = "public" | ||
#------- Do not modify below this line ------ | ||
|
||
$allowed_values = @("beta", "dogfood", "public") | ||
|
||
if (-not ($allowed_values -ccontains $releaseChannel)) { | ||
Write-Host "Error: Variable `$releaseChannel must be either 'beta', 'dogfood', or 'public'." | ||
exit 1 | ||
} | ||
|
||
# Get the current user's SID (Security Identifier) | ||
$loggedUser = Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty UserName | ||
$loggedUser = $loggedUser -replace '.*\\' | ||
|
||
# Construct the Registry path using the user's SID | ||
$userSID = (New-Object System.Security.Principal.NTAccount($loggedUser)).Translate([System.Security.Principal.SecurityIdentifier]).Value | ||
$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$userSID" | ||
$loggedOnUserProfileImagePath = Get-ItemPropertyValue -Path $registryPath -Name 'ProfileImagePath' | ||
$filePath = "$loggedOnUserProfileImagePath\AppData\Roaming\JumpCloud Password Manager\data\daemon\releaseChannel.txt" | ||
|
||
$directory = Split-Path $filePath | ||
if (-not (Test-Path $directory)) { | ||
New-Item -ItemType Directory -Path $directory -Force | ||
} | ||
|
||
Set-Content -Path $filePath -Value $releaseChannel -NoNewline | ||
``` | ||
|
||
#### Description | ||
|
||
This command will set the desired release channel for JumpCloud's Password Manager in application's directory. The relesase channel options are beta, dogfood and public. | ||
|
||
#### *Import This Command* | ||
|
||
To import this command into your JumpCloud tenant run the below command using the [JumpCloud PowerShell Module](https://github.com/TheJumpCloud/support/wiki/Installing-the-JumpCloud-PowerShell-Module) | ||
|
||
``` | ||
Import-JCCommand -URL "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Windows%20Commands/Windows%20-%20Set%20ReleaseChannel%20In%20JumpCloud%20Password%20Manager.md" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change this to public so that every script is set to the public channel by default?