138 lines
2.9 KiB
Markdown
138 lines
2.9 KiB
Markdown
# dengitool
|
|
|
|
simple but horrible scripting tool focused on microslop bindows servers written in go
|
|
|
|
---
|
|
|
|
## example instalation
|
|
|
|
> `dtool.exe` is portable, you can _use any directory_
|
|
|
|
1. Create folder and copy `dtool.exe`. For example in `C:\dtooll`
|
|
1. Add to env **`PATH`** your folder
|
|
1. That's it! Open a terminal and try to run `dtool -h`
|
|
|
|
## setup app
|
|
|
|
example tree
|
|
|
|
```
|
|
config
|
|
└───<application>
|
|
└───<module>
|
|
└───run
|
|
customscript.ps1
|
|
check.ps1
|
|
config.yml
|
|
fix.ps1
|
|
restart.ps1
|
|
start.ps1
|
|
stop.ps1
|
|
```
|
|
|
|
> **TIP:** you can leave only scripts that you need
|
|
|
|
you can write scripts **in any language you want** which is supported by [built-in script runners](#built-in), OR you can write **your own** [custom runner](#custom-runners)
|
|
|
|
#### check
|
|
|
|
for checkking status you can use either your script or you can write in config.yml `check-url` [(details)](#config)
|
|
|
|
#### restart
|
|
|
|
you can define restart script or it would use start and stop
|
|
|
|
#### config
|
|
|
|
currently there are config for `application`, example:
|
|
|
|
```yaml
|
|
name: my-application
|
|
```
|
|
|
|
and for `module`
|
|
|
|
```yaml
|
|
name: my-module
|
|
#
|
|
check-url: https://example.com
|
|
# or
|
|
check-url: https://example.com 200
|
|
# or even
|
|
check-url: https://example.com 200 Test%20Body%20Text
|
|
# or don't define at all
|
|
#
|
|
```
|
|
|
|
for now that's it.
|
|
|
|
## usage
|
|
|
|
Usage:
|
|
|
|
```
|
|
dtool [application] [action] [module] [flags]
|
|
```
|
|
|
|
Flags:
|
|
|
|
```
|
|
-h, --help help for dtool
|
|
--list list configured applications and modules
|
|
--list-runners list configured script runners
|
|
--silent suppress all output
|
|
--verbose enable debug output
|
|
```
|
|
|
|
you can use `everything` for `application`
|
|
|
|
just `dtool` is alias for `dtool everything check`
|
|
|
|
#### actions
|
|
|
|
| | |
|
|
| ------------------------------ | ------------------------------------------------------ |
|
|
| `check/fix/restart/start/stop` | runs it's script [(or check have url defined)](#check) |
|
|
| `run [script name]` | runs script in `run` subdirectory |
|
|
|
|
## runners
|
|
|
|
dengitool automaticly detects available script extension
|
|
|
|
#### built-in
|
|
|
|
| name | extension |
|
|
| ------------------ | --------- |
|
|
| Windows Executable | `.exe` |
|
|
| PowerShell Script | `.ps1` |
|
|
| Python | `.py` |
|
|
| CMD Batch File | `.bat` |
|
|
| NodeJS | `.js` |
|
|
|
|
#### custom runners
|
|
|
|
you can create your own runners
|
|
|
|
for this, you need to create a .yml file at folder `runners` near dtool.exe
|
|
|
|
you can **override** script for built-in extension
|
|
|
|
**here is an example:**
|
|
|
|
```yaml
|
|
# runners/bun.yml
|
|
name: My Bun Runner
|
|
extension: .ts
|
|
runner: bun run %v
|
|
```
|
|
|
|
> `%v` - absolute script path
|
|
|
|
now you can see it in `dtool --list-runners`
|
|
|
|
---
|
|
|
|
# thanks
|
|
|
|

|