Guacinator is a command line utility to interact programmatically with Apache Guacamole.
-
Download and install the gh cli tool.
-
Clone the repo:
gh repo clone CowDogMoo/guacinator cd guacinator
-
Get latest guacinator release:
OS="$(uname | python3 -c 'print(open(0).read().lower().strip())')" ARCH="$(uname -a | awk '{ print $NF }')" gh release download -p "*${OS}_${ARCH}.tar.gz" tar -xvf *tar.gz
-
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
-
Install and use asdf plugins to manage go, python, and ruby for this project:
source .asdf
Alternatively, you can pick and choose which plugins to install:
# Employ asdf for this project's python: source .asdf python
-
python3 -m pip install --upgrade pip python3 -m pip install pre-commit
-
go install github.com/magefile/mage@latest
-
Compile guacinator (if not using downloaded release):
go build
-
Create a new VNC connection in Guacamole:
GUAC_URL=https://guacamole.techvomit.xyz CONNECTION_NAME=test-connection GUAC_USER=guacadmin GUAC_PW=guacadmin VNC_IP="$(kubectl get service -o wide | grep ubuntu-vnc | awk '{print $3}')" VNC_PW="$(kubectl exec -it deployments/ubuntu -- zsh -c 'vncpwd \ /home/ubuntu/.vnc/passwd' | awk -F ' ' '{print $2}')" ./guacinator guacamole -u "${GUAC_USER}" -p "${GUAC_PW}" -l "${GUAC_URL}" \ --connection "${CONNECTION_NAME}" --vnc-ip "${VNC_IP}" --vnc-pw "${VNC_PW}"
-
Update the
guacadmin
user's password in Guacamole:GUAC_URL=https://guacamole.techvomit.xyz GUAC_USER=guacadmin # Default unless changed GUAC_PW=guacadmin NEW_GUAC_PW=s1cknewpassword ./guacinator guacamole -u "${GUAC_USER}" -p "${GUAC_PW}" -l "${GUAC_URL}" \ --guacadmin-pw "${NEW_GUAC_PW}"
-
Create a new Guacamole admin user:
GUAC_URL=https://guacamole.techvomit.xyz GUAC_USER=guacadmin # Default password for the new account will be this: GUAC_PW=guacadmin NEW_GUAC_ADMIN=guacadmindos ./guacinator guacamole -u "${GUAC_USER}" -p "${GUAC_PW}" -l "${GUAC_URL}" \ --new-admin "${NEW_GUAC_ADMIN}"
-
Delete a Guacamole user:
GUAC_URL=https://guacamole.techvomit.xyz GUAC_USER=guacadmin GUAC_PW=guacadmin USER_TO_DELETE=someuser ./guacinator guacamole -u "${GUAC_USER}" -p "${GUAC_PW}" -l "${GUAC_URL}" \ --delete-user "${USER_TO_DELETE}"
If you're a developer or contributor looking to work on Guacinator, follow these additional setup steps:
-
Clone the repository and navigate to the project root:
gh repo clone CowDogMoo/guacinator cd guacinator
-
Install the dependencies:
mage InstallDependencies