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

NB-11852: Set ReleaseChannel In JumpCloud Password Manager command #586

Merged
merged 14 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#### Name

Linux - Set JumpCloud Password Manager's Release Channel | v1.0 JCCG

#### commandType

linux

#### Command

```
#!/bin/bash

# Set $RELEASE_CHANNEL to beta OR dogfood OR public ON LINE 4 depending on your desired release channel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LINE 4? I think we should just say change the variable value. If you copy and paste this today, it's LINE 5


RELEASE_CHANNEL="public"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't expect admins to do the right thing, it would probably be a good idea to add a check to ensure that $RELEASE_CHANNEL is one of 'public','dogfood','beta'


#------- Do not modify below this line ------

for user in $(awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) print $1}' /etc/passwd); do
if [[ -d /home/$user ]]; then
BASE_PATH="/home/$user/.config/JumpCloud Password Manager"

FILE_PATH="$BASE_PATH/data/daemon/releaseChannel.txt"

mkdir -p "$(dirname "$FILE_PATH")"

echo -n "$RELEASE_CHANNEL" >"$FILE_PATH"

sudo chown -R $user:$user "$BASE_PATH"
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,44 @@
#### Name

Mac - Set JumpCloud Password Manager Release Channel | v1.0 JCCG

#### commandType

mac

#### Command

```
#!/bin/bash

# Set $RELEASE_CHANNEL to beta OR dogfood OR public ON LINE 15 depending on your desired release channel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LINE 15?

RELEASE_CHANNEL="public"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't expect admins to do the right thing, it would probably be a good idea to add a check to ensure that $RELEASE_CHANNEL is one of 'public','dogfood','beta'


#------- Do not modify below this line ------

for user in $(dscl . list /Users | grep -vE 'root|daemon|nobody|^_'); do
if [[ -d /Users/$user ]]; then
BASE_PATH="/Users/$user/Library/Application Support/JumpCloud Password Manager"

FILE_PATH="$BASE_PATH/data/daemon/releaseChannel.txt"

mkdir -p "$(dirname "$FILE_PATH")"

echo -n "$RELEASE_CHANNEL" >"$FILE_PATH"

sudo chown -R $user "$BASE_PATH"
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,35 @@
#### Name

Windows - Set JumpCloud Password Manager's Release Channel | v1.0 JCCG

#### commandType

windows

#### Command

```
# Set $RELEASE_CHANNEL to beta OR dogfood OR public depending on your desired release channel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not noting the line here, and I think that's the correct way to tell customers what to do, since it's really easy to forget that we need to update that in the future.

$RELEASE_CHANNEL = "public"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't expect admins to do the right thing, it would probably be a good idea to add a check to ensure that $RELEASE_CHANNEL is one of 'public','dogfood','beta'


#------- Do not modify below this line ------

$FILE_PATH = "$env:APPDATA\JumpCloud Password Manager\data\daemon\releaseChannel.txt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd encourage you to go run a Windows PowerShell command from JumpCloud and print out the $ENV:APPDATA directory.

The windows command doesn't work as described in the PR.
Screenshot 2024-07-09 at 8 20 02 AM

Look at this command and I think you'll see why.
Screenshot 2024-07-09 at 8 21 23 AM

$directory = Split-Path $FILE_PATH
if (-not (Test-Path $directory)) {
New-Item -ItemType Directory -Path $directory -Force
}
Set-Content -Path $FILE_PATH -Value $RELEASE_CHANNEL -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 $RELEASE_CHANNEL to beta OR dogfood OR public ON LINE 4 depending on your desired release channel\n\nRELEASE_CHANNEL=\"public\"\n\n#------- Do not modify below this line ------\n\nfor user in $(awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) print $1}' /etc/passwd); do\n if [[ -d /home/$user ]]; then\n BASE_PATH=\"/home/$user/.config/JumpCloud Password Manager\"\n\n FILE_PATH=\"$BASE_PATH/data/daemon/releaseChannel.txt\"\n\n mkdir -p \"$(dirname \"$FILE_PATH\")\"\n\n echo -n \"$RELEASE_CHANNEL\" >\"$FILE_PATH\"\n\n sudo chown -R $user:$user \"$BASE_PATH\"\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 $RELEASE_CHANNEL to beta OR dogfood OR public ON LINE 15 depending on your desired release channel\nRELEASE_CHANNEL=\"public\"\n\n#------- Do not modify below this line ------\n\nfor user in $(dscl . list /Users | grep -vE 'root|daemon|nobody|^_'); do\n if [[ -d /Users/$user ]]; then\n BASE_PATH=\"/Users/$user/Library/Application Support/JumpCloud Password Manager\"\n\n FILE_PATH=\"$BASE_PATH/data/daemon/releaseChannel.txt\"\n\n mkdir -p \"$(dirname \"$FILE_PATH\")\"\n\n echo -n \"$RELEASE_CHANNEL\" >\"$FILE_PATH\"\n\n sudo chown -R $user \"$BASE_PATH\"\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 $RELEASE_CHANNEL to beta OR dogfood OR public depending on your desired release channel\n$RELEASE_CHANNEL = \"public\"\n\n#------- Do not modify below this line ------\n\n$FILE_PATH = \"$env:APPDATA\\JumpCloud Password Manager\\data\\daemon\\releaseChannel.txt\"\n$directory = Split-Path $FILE_PATH\nif (-not (Test-Path $directory)) {\n New-Item -ItemType Directory -Path $directory -Force\n}\nSet-Content -Path $FILE_PATH -Value $RELEASE_CHANNEL -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
Loading