-
Notifications
You must be signed in to change notification settings - Fork 0
/
help-functions
42 lines (36 loc) · 1.2 KB
/
help-functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
cmd-tailscale-help() {
declare desc="help command"
declare CMD="$1"
local plugin_name="tailscale"
local plugin_description="Run tailscale sidecar for an app"
local plugin_description_long="$(cat <<desc
Run tailscale sidecar for an app
This plugin expects global configuration values set for the oauth key:
dokku config:set --global TS_AUTHKEY=tskey-client-00000000000000000-000000000000000000000000000000000
If adding to an existing app, you will need to restart the app after running tailscale:up.
desc
)"
if [[ "$CMD" == "${plugin_name}:help" ]]; then
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
echo ''
echo "$plugin_description_long"
echo ''
echo 'Additional commands:'
fn-help-content | sort | column -c2 -t -s,
else
cat <<help_desc
$plugin_name, $plugin_description
help_desc
fi
}
fn-help-content() {
declare desc="return help content"
cat <<help_content
tailscale:up <app>, Starts the tailscale machine with the name of the app
tailscale:down <app>, Stops the tailscale sidecar
tailscale:serve <app> [<port>|stop], Starts or stops serving the provided port over https
help_content
}