mirror of
https://git.isptech.ru/ISPsystem/isp-maintenance.git
synced 2025-02-01 02:50:51 +01:00
180 lines
4.5 KiB
Markdown
180 lines
4.5 KiB
Markdown
# isp-maintenance
|
||
|
||
Maintenance application for quick access, check and resolve issues VM/DCImanager 6 generation
|
||
|
||
### In progress
|
||
|
||
|
||
### See [CONTRIBUTING.md](CONTRIBUTING.md) for a general overview of how to contribute
|
||
|
||
|
||
|
||
## How to use gogo companion:
|
||
|
||
|
||
#### Dependencies
|
||
|
||
ОС: Linux, Mac, Windows
|
||
Shell: bash
|
||
|
||
|
||
#### Installation
|
||
|
||
- download or copy the script from the root of the repository `/scripts/gogo/gogo.sh`
|
||
- to call the script without specifying the full path, put it in the directory that is in $PATH (in the future, I assume that you will have it `~/.local/bin/`)
|
||
|
||
```console
|
||
curl https://git.isptech.ru/ISPsystem/isp-maintenance/raw/branch/main/scripts/gogo/gogo.sh -o ~/.local/bin/gogo && chmod u+x ~/.local/bin/gogo
|
||
```
|
||
|
||
#### Configuration
|
||
|
||
For the script to work, you need a configuration file with settings `~/.config/gogo/gogo.conf`
|
||
|
||
This config contains the following fields that are read every time you start
|
||
|
||
```
|
||
GO_SERVER_ADDR_RUSSIAN=
|
||
GO_SERVER_ADDR_GERMANY=
|
||
GO_SERVER_ADDR_TEST=
|
||
VAULT_SERVER_ADDR=
|
||
SSH_PRIVATE_KEY_USER=
|
||
SSH_PRIVATE_KEY_PATH=
|
||
SSH_PUBLIC_KEY_PATH=
|
||
SSH_CRT_FILE=
|
||
MGRCTL_IMAGE=mois3y/mgrctl:latest
|
||
DEBUG_MODE=false
|
||
```
|
||
|
||
Please fill in the fields with current data, write the path to the keys and certificate in full `/home/username/.ssh/id_ecdsa` and so on.
|
||
For security reasons, server addresses and paths to keys are not indicated here.
|
||
|
||
For your convenience, the config can be filled out interactively
|
||
|
||
```console
|
||
gogo --init
|
||
```
|
||
|
||
|
||
#### Usage
|
||
|
||
- Get a temporary ssh certificate
|
||
|
||
```console
|
||
gogo --crt
|
||
```
|
||
|
||
- Check your connection to test servers in both locations
|
||
|
||
```console
|
||
gogo --test
|
||
```
|
||
|
||
- If the connection is successful, you can use the script. You are beautiful!
|
||
|
||
|
||
#### Examples
|
||
|
||
- Connect to BILLmanager 6 via ssh port 22 and interface port 443
|
||
|
||
```console
|
||
gogo --bill my.example.com
|
||
```
|
||
or
|
||
```console
|
||
gogo --bill my.example.com -p 22 -wp 443
|
||
```
|
||
|
||
- Connect to BILLmanager 6 again without generating an access key to the interface
|
||
|
||
```console
|
||
gogo --bill my.example.com --ssh
|
||
```
|
||
|
||
- Connect to DNSmanager 6 via ssh port 22 and interface port 1501
|
||
|
||
```console
|
||
gogo --dns my.example.com -p 22 -wp 1501
|
||
```
|
||
|
||
- Connect to DCImanager 6 via ssh port 2222 and interface 443 port
|
||
|
||
```console
|
||
gogo --dci vm.example.com -p 2222
|
||
```
|
||
|
||
- Connect to VMmanager 6 via ssh port 2222 and interface port 443
|
||
|
||
```console
|
||
gogo --vm 228.228.228.228 -p 2222
|
||
```
|
||
|
||
- Connect to VMmanager 6 via ssh port 22 and interface port 443, indicating the id of a specific user and generate 3 keys
|
||
|
||
```console
|
||
gogo --vm vm.example.com --mgrctl auth user access --id 1488 --count 1
|
||
```
|
||
|
||
- The same thing, just print the command that is executed on the server side into the console, you can run it later simply by copying it
|
||
|
||
```console
|
||
gogo --vm vm.example.com --tty --mgrctl auth user access --id 1488 --count 1
|
||
```
|
||
|
||
|
||
Connect to VMmanager 6 via ssh port 22 and interface port 443 via DE go3 server
|
||
|
||
```console
|
||
gogo --vm vm.example.com -p 22 --de
|
||
```
|
||
|
||
Connect to DCImanager 6 via ssh port 22 and interface port 443 via the old go method
|
||
|
||
```console
|
||
gogo --dci dci.example.com -p 22 --go
|
||
```
|
||
|
||
##### There are also examples in `help`
|
||
|
||
```console
|
||
gogo --help
|
||
|
||
Usage: gogo [options [parameters]]
|
||
|
||
Examples:
|
||
|
||
gogo --init | init config file
|
||
gogo --crt | get ssh certificate for go3 connections
|
||
gogo --test | check go3 connection availability
|
||
|
||
gogo --bill my.example.com
|
||
gogo --vm my.example.com --de | connect throw DE go3 server
|
||
gogo --vm 0.0.0.0 --ssh | only ssh access
|
||
gogo --vm 0.0.0.0 --tty | use mgrctl interactive
|
||
|
||
gogo --dci 0.0.0.0 --mgrctl auth user access --id 3 --count 5
|
||
gogo --dci 0.0.0.0 --mgrctl auth user ls --admins
|
||
gogo --vm 0.0.0.0 --port 22122 --mgrctl auth user ls --admins
|
||
gogo --vm 0.0.0.0 --tty --mgrctl auth user ls --admins
|
||
gogo --dns ns1.example.com --web-port 1501
|
||
gogo --dns ns1.example.com --port 22122 --web-port 1501
|
||
gogo --bill my.example.com --port 22 --web-port 1501
|
||
|
||
Options:
|
||
|
||
--vm[dci|bill|dns|ip] expected ip_addr required
|
||
--port | -p ssh port, default 22
|
||
--web-port | -wp web port, default 443
|
||
--go/--go3 go version, default go3
|
||
--de connect throw DE go3 server
|
||
--ssh open only ssh session
|
||
--tty for vm6/dci6 echo cmd for run container
|
||
--mgrctl [args] for vm6/dci6 customize access params
|
||
|
||
Single options:
|
||
--init | -i generate configuration
|
||
--crt | -c generate ssh cert
|
||
--test | -t check go3 connection availability
|
||
--version | -v print version
|
||
--help | -h print this message and exit
|
||
``` |