Skip to content

Commit

Permalink
Merge pull request #586 from TheJumpCloud/NB-11852-desktop-app-dogfood
Browse files Browse the repository at this point in the history
NB-11852: Set ReleaseChannel In JumpCloud Password Manager command
  • Loading branch information
gbitarjc authored Jul 11, 2024
2 parents 8962079 + 771e031 commit cd5e972
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 0 deletions.
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"
```
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="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 $(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"
```
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"
```
21 changes: 21 additions & 0 deletions PowerShell/JumpCloud Commands Gallery/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@
"link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Linux%20Commands/Linux%20-%20Set%20Agent%20Log%20Level%20to%20Default.md",
"description": "This command will set the JumpCloud Agent Log Level to Default logging level."
},
{
"name": "Linux - Set JumpCloud Password Manager's Release Channel | v1.0 JCCG",
"type": "linux",
"command": "#!/bin/bash\n\n# Set $releaseChannel to beta OR dogfood OR public depending on your desired release channel\nreleaseChannel=\"public\"\n\n#------- Do not modify below this line ------\n\nallowed_values=(\"beta\" \"dogfood\" \"public\")\n\nif [[ ! \" ${allowed_values[@]} \" =~ \" $releaseChannel \" ]]; then\n echo \"Error: Variable \\$releaseChannel must be either 'beta', 'dogfood', or 'public'.\"\n exit 1\nfi\n\nfor user in $(awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) print $1}' /etc/passwd); do\n if [[ -d /home/$user ]]; then\n basePath=\"/home/$user/.config/JumpCloud Password Manager\"\n\n filePath=\"$basePath/data/daemon/releaseChannel.txt\"\n\n mkdir -p \"$(dirname \"$filePath\")\"\n\n echo -n \"$releaseChannel\" >\"$filePath\"\n\n sudo chown -R $user:$user \"$basePath\"\n fi\ndone",
"link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Linux%20Commands/Linux%20-%20Set%20ReleaseChannel%20In%20JumpCloud%20Password%20Manager.md",
"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."
},
{
"name": "Linux - Snap - Install Microsoft VS Code | v1.0 JCCG",
"type": "linux",
Expand Down Expand Up @@ -223,6 +230,13 @@
"link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Mac%20Commands/Mac%20-%20Set%20Desktop%20Background.md",
"description": "NOTE: As of MacOS 12.3 or higher, this command does not work. Please use an MDM configuration profile to deploy wallpapers as a workaround.\n\nThe \"JumpCloud_Background.png\" file is downloaded to the local machine and saved in the folder \"/Users/Shared\"/\n\nTo modify this command to download and set a background image of your choice follow the steps under '*** Customize ***' by updating the backgroundURL and corresponding fileType variables.\n\nThis command used in tandem with the wallpaper modification Mac policy can be used to set and then prevent end users from updating their background.\n\nThis command can be built manually as a Mac command where the 'run-as' user is set to the JC managed user on that machine and can not be executed as the root user."
},
{
"name": "Mac - Set JumpCloud Password Manager Release Channel | v1.0 JCCG",
"type": "mac",
"command": "#!/bin/bash\n\n# Set releaseChannel to beta OR dogfood OR public depending on your desired release channel\nreleaseChannel=\"public\"\n\n#------- Do not modify below this line ------\n\nallowed_values=(\"beta\" \"dogfood\" \"public\")\n\nif [[ ! \" ${allowed_values[@]} \" =~ \" $releaseChannel \" ]]; then\n echo \"Error: Variable \\$releaseChannel must be either 'beta', 'dogfood', or 'public'.\"\n exit 1\nfi\n\nfor user in $(dscl . list /Users | grep -vE 'root|daemon|nobody|^_'); do\n if [[ -d /Users/$user ]]; then\n basePath=\"/Users/$user/Library/Application Support/JumpCloud Password Manager\"\n\n filePath=\"$basePath/data/daemon/releaseChannel.txt\"\n\n mkdir -p \"$(dirname \"$filePath\")\"\n\n echo -n \"$releaseChannel\" >\"$filePath\"\n\n sudo chown -R $user \"$basePath\"\n fi\ndone",
"link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Mac%20Commands/Mac%20-%20Set%20ReleaseChannel%20In%20JumpCloud%20Password%20Manager.md",
"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."
},
{
"name": "Windows - 64-Bit Command | v1.0 JCCG",
"type": "windows",
Expand Down Expand Up @@ -391,6 +405,13 @@
"link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Windows%20Commands/Windows%20-%20Set%20Agent%20Log%20Level%20to%20Default.md",
"description": "This command will set the JumpCloud Agent Log Level to Default. After the command is run, a scheduled task triggers a second script that sets restarts the JumpCloud Agent and removes the itself."
},
{
"name": "Windows - Set JumpCloud Password Manager's Release Channel | v1.0 JCCG",
"type": "windows",
"command": "# Set $releaseChannel to beta OR dogfood OR public depending on your desired release channel\n$releaseChannel = \"public\"\n#------- Do not modify below this line ------\n\n$allowed_values = @(\"beta\", \"dogfood\", \"public\")\n\nif (-not ($allowed_values -ccontains $releaseChannel)) {\n Write-Host \"Error: Variable `$releaseChannel must be either 'beta', 'dogfood', or 'public'.\"\n exit 1\n}\n\n# Get the current user's SID (Security Identifier)\n$loggedUser = Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty UserName\n$loggedUser = $loggedUser -replace '.*\\\\'\n\n# Construct the Registry path using the user's SID\n$userSID = (New-Object System.Security.Principal.NTAccount($loggedUser)).Translate([System.Security.Principal.SecurityIdentifier]).Value\n$registryPath = \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\$userSID\"\n$loggedOnUserProfileImagePath = Get-ItemPropertyValue -Path $registryPath -Name 'ProfileImagePath'\n$filePath = \"$loggedOnUserProfileImagePath\\AppData\\Roaming\\JumpCloud Password Manager\\data\\daemon\\releaseChannel.txt\"\n\n$directory = Split-Path $filePath\nif (-not (Test-Path $directory)) {\n New-Item -ItemType Directory -Path $directory -Force\n}\n\nSet-Content -Path $filePath -Value $releaseChannel -NoNewline",
"link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Windows%20Commands/Windows%20-%20Set%20ReleaseChannel%20In%20JumpCloud%20Password%20Manager.md",
"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."
},
{
"name": "Windows - Software Restriction Policy | v1.0 JCCG",
"type": "windows",
Expand Down

0 comments on commit cd5e972

Please sign in to comment.