110 lines
2.6 KiB
Markdown
110 lines
2.6 KiB
Markdown
# mctl
|
|
mctl is a terminal-friendly remote console client
|
|
|
|
# Index
|
|
1. [Installation](#installation)
|
|
2. [Use](#use)
|
|
4. [Security](#security)
|
|
5. [Development](#development)
|
|
|
|
<br />
|
|
|
|
# Installation
|
|
Install mctl using golang
|
|
```bash
|
|
go install code.jakeyoungdev.com/jake/mctl@main
|
|
```
|
|
|
|
<br />
|
|
|
|
# Use
|
|
### Configuring mctl
|
|
mctl requires a one-time setup via the 'init' command before using any other commands
|
|
```bash
|
|
mctl init
|
|
```
|
|
|
|
<br />
|
|
|
|
### Add a server
|
|
To communicate with servers, they must be first added to the server list
|
|
```bash
|
|
mctl server add
|
|
Server alias: home
|
|
Server address: x.x.x.x
|
|
Server port: 61695
|
|
Password:
|
|
```
|
|
|
|
<br />
|
|
|
|
### Activating a server
|
|
Servers can be activated to be used as the default server for mctl operations, the server alias must be
|
|
provided to activate it
|
|
```bash
|
|
mctl server activate <name>
|
|
```
|
|
|
|
<br />
|
|
|
|
### Login to server
|
|
To login to the activated server and start sending commands
|
|
```bash
|
|
mctl login
|
|
```
|
|
The -s flag can be set to login to a non-activated server
|
|
```bash
|
|
mctl login -s <name>
|
|
```
|
|
|
|
<br />
|
|
|
|
### Savind a command
|
|
Commands can be saved to be run later
|
|
```bash
|
|
mctl command add
|
|
Command alias: seed
|
|
Command: seed
|
|
```
|
|
|
|
The command saved can then be run with the following command, this will run the 'seed' command on the activated
|
|
server, or a different server using the -s flag
|
|
```bash
|
|
mctl command run seed
|
|
```
|
|
|
|
Commands can contain placeholders to be filled in at runtime
|
|
```bash
|
|
#created the 'placeholder' command which runs the 'kill' command
|
|
mctl command add
|
|
Command alias: placeholder
|
|
Command: kill %s
|
|
```
|
|
```bash
|
|
#runs the 'kill' command on 'player'
|
|
mctl command run placeholder kill player
|
|
```
|
|
Running the placeholder command with the arg 'player' will run 'kill player' on the server
|
|
|
|
<br />
|
|
|
|
### Clearing database
|
|
The mctl database can be cleared with the destoy command. WARNING, this command will delete any saved servers or commands completely resetting mctl
|
|
```bash
|
|
mctl destroy
|
|
```
|
|
|
|
### CRUD Commands
|
|
Other create, read, update, and delete versions of subcommands are available. Use the -h flag for more information
|
|
|
|
<br />
|
|
|
|
# Security
|
|
RCon is an inherently insecure protocol, passwords are sent in plaintext and, if possible, the port should not be exposed to the internet. It is best to keep these connections local or over a VPN.
|
|
|
|
mctl utilizes [govulncheck](https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck) and [gosec](https://github.com/securego/gosec) in workflows to ensure quality, secure code is being pushed. These workflow steps must pass before a PR will be accepted
|
|
|
|
<br />
|
|
|
|
# Development
|
|
this repo is currently in development and may encounter breaking changes, use a tag to prevent any surprises |