Repository navigation
Expand file tree
/
Copy pathoptions.json
More file actions
165 lines (165 loc) · 18.2 KB
/
Copy pathoptions.json
File metadata and controls
165 lines (165 loc) · 18.2 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
{
"$comment": "The installers' answers contract. Every question quickstart.sh, setup.sh and install/install-native.sh ask, with the variable that answers it in advance, its rule and default. The website's install wizard reads this file at the release tag; tests/installer-answers/run.sh (CI) fails when it and the scripts disagree. Rules are install/lib/answers.sh's (the scripts are authoritative); regex is the same rule for a browser, an ERE that is also a JavaScript RegExp, applied to a non-empty value.",
"schemaVersion": 1,
"answersFile": {
"env": "MDMESH_ANSWERS",
"description": "An absolute path to a file of KEY=VALUE lines (any answer or setting below, by its env name; # comments and blank lines allowed; one pair of surrounding quotes is removed; never sourced). The environment wins over the file. Unknown or repeated keys stop the installer, and so does any file that does not belong to the user running the installer (or root) with no access for anyone else (chmod 600): it chooses what is installed and may hold the tunnel token."
},
"installers": [
{ "id": "quickstart.sh", "path": "quickstart.sh", "title": "Quick start (published images, Docker)", "root": false, "flags": ["--tunnel", "--domain", "--proxy"] },
{ "id": "setup.sh", "path": "setup.sh", "title": "From source (Docker)", "root": false, "flags": ["--update", "--native", "--reset", "--allow-downgrade", "--tunnel", "--domain", "--proxy"], "forwards": { "to": "install-native.sh", "with": "--native", "flags": ["-y", "--yes", "-v", "--verbose"], "description": "With --native, setup.sh hands its other arguments to install/install-native.sh, which takes these." } },
{ "id": "install-native.sh", "path": "install/install-native.sh", "title": "Native (Debian 12/13, Ubuntu 24.04)", "root": true, "flags": ["-y", "--yes", "-v", "--verbose"] }
],
"settings": [
{
"id": "noninteractive", "env": "MDMESH_NONINTERACTIVE", "type": "boolean", "allowed": ["0", "1"], "default": "0",
"installers": ["quickstart.sh", "setup.sh", "install-native.sh"],
"description": "1: never ask. A missing answer with a default takes it; a missing answer without one stops the installer, naming its variable."
},
{
"id": "dry-run", "env": "MDMESH_DRY_RUN", "type": "boolean", "allowed": ["0", "1"], "default": "0",
"installers": ["quickstart.sh", "setup.sh", "install-native.sh"],
"description": "1: check the answers, print the plan (each question: its answer, default, or ?/ask) and exit, before anything on the host is checked or changed. Needs no root, Docker or network."
},
{
"id": "dir", "env": "MDMESH_DIR", "type": "string", "default": "mdmesh", "installers": ["quickstart.sh"],
"description": "The directory the quick start installs into (created; relative to the current directory)."
},
{
"id": "version", "env": "MDMESH_VERSION", "type": "string", "default": null, "regex": "^v?[0-9]+\\.[0-9]+\\.[0-9]+([-+][0-9A-Za-z.+-]+)?$",
"installers": ["quickstart.sh"],
"description": "The release to install (X.Y.Z, 0.5.0 or later). Default: the latest published release of the repo."
},
{
"id": "release-pubkey", "env": "MDMESH_RELEASE_PUBKEY", "type": "string", "default": null, "installers": ["quickstart.sh"],
"description": "A fork's release signing key: the key line (line 2) of its release/minisign.pub."
},
{
"id": "origin-tls", "env": "MDMESH_ORIGIN_TLS", "type": "boolean", "allowed": ["0", "1"], "default": "0",
"installers": ["quickstart.sh", "setup.sh"],
"description": "Behind your own proxy only. 1: MDMesh's edge speaks HTTPS to your proxy, with a certificate for the public hostname from its own CA (for a proxy on another machine; your proxy then trusts that CA). 0: plain HTTP, for a proxy on this machine."
}
],
"options": [
{
"id": "mode", "env": "MDMESH_MODE", "aliases": [], "installers": ["quickstart.sh", "setup.sh"],
"type": "enum", "allowed": ["tunnel", "domain", "proxy"], "synonyms": { "1": "tunnel", "2": "domain", "3": "proxy" },
"flags": { "--tunnel": "tunnel", "--domain": "domain", "--proxy": "proxy" },
"default": null, "required": true, "when": null, "secret": false, "rule": "mode",
"regex": "^(tunnel|domain|proxy|1|2|3)$",
"description": "How phones reach the server: tunnel (Cloudflare Tunnel: no ports to open, a domain on Cloudflare), domain (your own domain: ports 80/443 reach this machine, and Caddy gets a Let's Encrypt certificate) or proxy (behind your own proxy: your nginx, Apache, Caddy or Traefik does HTTPS and forwards to MDMesh, which listens on 127.0.0.1:8080 by default). The flags --tunnel, --domain and --proxy answer it too.",
"prompts": [ { "id": "mode.choose", "text": "Choose [1/2/3]:", "script": "Choose [1/2/3]: " } ],
"examples": { "valid": ["tunnel", "domain", "proxy", "1", "2", "3"], "invalid": ["4", "Domain", "cloudflare", "nginx", " "] }
},
{
"id": "repo", "env": "MDMESH_REPO", "aliases": [], "installers": ["quickstart.sh"],
"type": "string", "default": "MDMesh-app/MDMesh", "emptyMeans": "default",
"required": false, "when": null, "secret": false, "rule": "github-repo",
"regex": "^(\\.?[A-Za-z0-9_-][A-Za-z0-9._-]*|\\.\\.[A-Za-z0-9._-]+)/(\\.?[A-Za-z0-9_-][A-Za-z0-9._-]*|\\.\\.[A-Za-z0-9._-]+)$",
"description": "The GitHub repository whose releases are installed (owner/name).",
"prompts": [ { "id": "repo.ask", "text": "Pull releases from GitHub repo [MDMesh-app/MDMesh]:", "script": "Pull releases from GitHub repo [${REPO}]: " } ],
"examples": { "valid": ["MDMesh-app/MDMesh", "me/my.fork", "a/..b", ""], "invalid": ["MDMesh", "a/b/c", "../x", "a/.", "a b/c", "https://github.com/a/b"] }
},
{
"id": "image-owner", "env": "MDMESH_IMAGE_OWNER", "aliases": [], "installers": ["quickstart.sh"],
"type": "string", "default": "mdmesh-app", "emptyMeans": "default",
"required": false, "when": null, "secret": false, "rule": "image-owner",
"regex": "^[a-z0-9][a-z0-9._-]*$",
"description": "The GHCR owner of the release's images, in lowercase.",
"prompts": [ { "id": "image-owner.ask", "text": "Image owner (GHCR, lowercase) [mdmesh-app]:", "script": "Image owner (GHCR, lowercase) [${IMAGE_OWNER_DEFAULT}]: " } ],
"examples": { "valid": ["mdmesh-app", "me", "a.b_c-d", ""], "invalid": ["MDMesh-app", "-x", "a/b", "ghcr.io/me"] }
},
{
"id": "host", "env": "MDMESH_HOST", "aliases": [], "installers": ["quickstart.sh", "setup.sh"],
"type": "hostname", "default": null, "required": true, "when": null, "secret": false, "rule": "hostname",
"regex": "^(\\[[0-9A-Fa-f:.]*:[0-9A-Fa-f:.]*\\]|[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)*)(:([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$",
"description": "The public hostname devices use (the name only: no https://, path or user@), optionally with :port. The base URL becomes https://<host>. In domain mode its DNS must point at this server; behind your own proxy, the proxy serves it over HTTPS.",
"prompts": [
{ "id": "host.tunnel", "when": { "mode": "tunnel" }, "text": "Public hostname devices will use (e.g. mdm.example.com):", "script": "Public hostname devices will use (e.g. mdm.example.com): " },
{ "id": "host.domain", "when": { "mode": "domain" }, "text": "Your domain (DNS already pointing here, e.g. mdm.example.com):", "script": "Your domain (DNS already pointing here, e.g. mdm.example.com): " },
{ "id": "host.proxy", "when": { "mode": "proxy" }, "text": "Public hostname your proxy serves (e.g. mdm.example.com):", "script": "Public hostname your proxy serves (e.g. mdm.example.com): " }
],
"examples": { "valid": ["mdm.example.com", "localhost", "mdm.example.com:8443", "10.0.0.5", "[::1]"], "invalid": ["", "https://mdm.example.com", "mdm.example.com/x", "admin@mdm.example.com", "-mdm.example.com", "mdm..example.com", "mdm.example.com:0", "mdm.example.com:99999", "mdm example.com"] }
},
{
"id": "tunnel-token", "env": "MDMESH_TUNNEL_TOKEN", "aliases": [], "installers": ["quickstart.sh", "setup.sh"],
"type": "secret", "default": null, "required": true, "when": { "mode": "tunnel" }, "secret": true, "rule": "tunnel-token",
"regex": "^[A-Za-z0-9._=+/-]+$",
"description": "The Cloudflare Tunnel token (Zero Trust → Networks → Tunnels → your tunnel). A secret: answer the question, or put it in an answers file (which must belong to the user running the installer, with mode 600); never on a command line or in export, where shell history and the process list show it. The installers never print it or pass it to another program.",
"prompts": [ { "id": "tunnel-token.ask", "text": "Cloudflare Tunnel token (Zero Trust → Tunnels → your tunnel):", "script": "Cloudflare Tunnel token (Zero Trust → Tunnels → your tunnel): " } ],
"examples": { "valid": ["eyJhIjoiYWJjIn0=", "abc.DEF_123-+/="], "invalid": ["", "abc def", "abc$x", "a\"b"] }
},
{
"id": "acme-email", "env": "MDMESH_ACME_EMAIL", "aliases": [], "installers": ["quickstart.sh", "setup.sh"],
"type": "email", "default": "", "emptyMeans": "default",
"required": false, "when": { "mode": "domain" }, "secret": false, "rule": "email",
"regex": "^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)+$",
"description": "The email Let's Encrypt sends certificate notices to. Empty: none.",
"prompts": [ { "id": "acme-email.ask", "text": "Email for Let's Encrypt:", "script": "Email for Let's Encrypt: " } ],
"examples": { "valid": ["ops@example.com", "a.b+c@mail.example.co.uk", ""], "invalid": ["ops", "ops@example", "@example.com", "a@b@example.com", "ops@example..com", "ops @example.com"] }
},
{
"id": "bind", "env": "MDMESH_BIND", "aliases": [], "installers": ["quickstart.sh", "setup.sh"],
"type": "string", "default": "127.0.0.1:8080", "emptyMeans": "default",
"required": false, "when": { "mode": "proxy" }, "secret": false, "rule": "bind",
"regex": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}|\\[(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|([0-9A-Fa-f]{1,4}:){1,7}:|([0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}|([0-9A-Fa-f]{1,4}:){1,5}(:[0-9A-Fa-f]{1,4}){1,2}|([0-9A-Fa-f]{1,4}:){1,4}(:[0-9A-Fa-f]{1,4}){1,3}|([0-9A-Fa-f]{1,4}:){1,3}(:[0-9A-Fa-f]{1,4}){1,4}|([0-9A-Fa-f]{1,4}:){1,2}(:[0-9A-Fa-f]{1,4}){1,5}|[0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6}|:((:[0-9A-Fa-f]{1,4}){1,7}|:))\\]):([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$",
"description": "Where MDMesh's edge listens for your proxy, IP:port (written to .env as MDMESH_BIND). The default, 127.0.0.1:8080, is for a proxy on this machine. For a proxy on another machine, this machine's address on the network the proxy reaches it by (a private interface rather than 0.0.0.0); keep the port off the internet with a rule in Docker's DOCKER-USER chain (Docker publishes ports past ufw and INPUT rules), and consider MDMESH_ORIGIN_TLS.",
"prompts": [ { "id": "bind.ask", "text": "Address MDMesh listens on for your proxy [127.0.0.1:8080]:", "script": "Address MDMesh listens on for your proxy [127.0.0.1:8080]: " } ],
"examples": { "valid": ["127.0.0.1:8080", "127.0.0.2:8443", "[::1]:8080", ""], "invalid": ["8080", "127.0.0.1", "localhost:8080", "127.0.0.1:0", "256.0.0.1:80", "010.0.0.1:80", "127.0.0.1:08080", "[::1]", "[::ffff:127.0.0.1]:8080", "[1:2:3]:8080", "[12345::1]:8080", "[::1]:extra:8080"] }
},
{
"id": "trusted-proxies", "env": "MDMESH_TRUSTED_PROXIES", "aliases": [], "installers": ["quickstart.sh", "setup.sh"],
"type": "string", "default": "host", "emptyMeans": "default",
"required": false, "when": { "mode": "proxy" }, "secret": false, "rule": "proxies",
"regex": "^(host|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}(/([89]|[12][0-9]|3[0-2]))?|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|([0-9A-Fa-f]{1,4}:){1,7}:|([0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}|([0-9A-Fa-f]{1,4}:){1,5}(:[0-9A-Fa-f]{1,4}){1,2}|([0-9A-Fa-f]{1,4}:){1,4}(:[0-9A-Fa-f]{1,4}){1,3}|([0-9A-Fa-f]{1,4}:){1,3}(:[0-9A-Fa-f]{1,4}){1,4}|([0-9A-Fa-f]{1,4}:){1,2}(:[0-9A-Fa-f]{1,4}){1,5}|[0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6}|:((:[0-9A-Fa-f]{1,4}){1,7}|:))(/(1[6-9]|[2-9][0-9]|1[01][0-9]|12[0-8]))?)([ ,]+(host|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}(/([89]|[12][0-9]|3[0-2]))?|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|([0-9A-Fa-f]{1,4}:){1,7}:|([0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}|([0-9A-Fa-f]{1,4}:){1,5}(:[0-9A-Fa-f]{1,4}){1,2}|([0-9A-Fa-f]{1,4}:){1,4}(:[0-9A-Fa-f]{1,4}){1,3}|([0-9A-Fa-f]{1,4}:){1,3}(:[0-9A-Fa-f]{1,4}){1,4}|([0-9A-Fa-f]{1,4}:){1,2}(:[0-9A-Fa-f]{1,4}){1,5}|[0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6}|:((:[0-9A-Fa-f]{1,4}){1,7}|:))(/(1[6-9]|[2-9][0-9]|1[01][0-9]|12[0-8]))?))*$",
"description": "Your proxy's address as MDMesh's edge sees it, the only peer whose X-Forwarded-For it believes (written to .env as TRUSTED_PROXIES): host (a proxy on this machine; the edge sees it at its Docker network's gateway; only with a loopback MDMESH_BIND, 127.0.0.1 or [::1]; it trusts every program on this machine, so any local user could name any client address: keep it for a machine where only your proxy runs), or IP addresses and ranges, separated by spaces or commas. A range may be no wider than an IPv4 /8 or an IPv6 /16; IPv4-mapped IPv6 addresses are refused (use the IPv4 address).",
"prompts": [ { "id": "trusted-proxies.ask", "text": "Your proxy's IP address as MDMesh sees it (host = a proxy on this machine) [host]:", "script": "Your proxy's IP address as MDMesh sees it (host = a proxy on this machine) [host]: " } ],
"examples": { "valid": ["host", "192.0.2.10", "192.0.2.0/24 2001:db8::1", "10.0.0.0/8,host", "2001:db8::/32", "::1", "fd00::1 192.0.2.10", "2001:db8:0:0:0:0:0:1", "1:2:3:4:5:6:7:8", ""], "invalid": ["0.0.0.0/0", "::/0", "10.0.0.0/7", "2001:db8::/15", "private_ranges", "proxy.example.com", "192.0.2.300", "192.0.2.10/33", "::ffff:10.0.0.1", "::ffff:10.0.0.0/104", "*", "2001:db8:1", "1:2:3", "12345::1", "1::2::3", ":1", "1:", "1::2:3:4:5:6:7:8", "1:2:3:4:5:6:7:8:9"] }
},
{
"id": "base-url", "env": "MDMESH_BASE_URL", "aliases": ["BASE_URL"], "installers": ["install-native.sh"],
"type": "url", "default": null, "emptyMeans": "unset",
"required": "fresh-install", "requiredNote": "On a fresh install. A re-run keeps the install's current base URL unless one is given.",
"when": null, "secret": false, "rule": "base-url",
"regex": "^[Hh][Tt][Tt][Pp][Ss]?://(\\[[0-9A-Fa-f:.]*:[0-9A-Fa-f:.]*\\]|[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)*)(:([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?(/[A-Za-z0-9._:/+=,-]*)?$",
"description": "The public base URL devices and the console use, behind your own TLS proxy (https://…; http:// is accepted too).",
"prompts": [
{ "id": "base-url.fresh", "text": "Public base URL (e.g. https://mdm.example.com):", "script": " Public base URL (e.g. https://mdm.example.com): " },
{ "id": "base-url.current", "text": "Public base URL [<current>]:", "script": " Public base URL [${_cur_url}]: " },
{ "id": "base-url.keep", "text": "Public base URL [keep the current one]:", "script": " Public base URL [keep the current one]: " }
],
"examples": { "valid": ["https://mdm.example.com", "HTTPS://mdm.example.com", "http://10.0.0.5:8080", "https://mdm.example.com/mdm"], "invalid": ["mdm.example.com", "ftp://mdm.example.com", "https://user@mdm.example.com", "https://mdm.example.com/?a=1", "https://mdm.example.com/a b", "https://https://x"] }
},
{
"id": "http-port", "env": "MDMESH_HTTP_PORT", "aliases": ["HTTP_PORT"], "installers": ["install-native.sh"],
"type": "port", "default": "8080", "defaultNote": "A re-run keeps the port the install already uses.", "emptyMeans": "unset",
"required": false, "when": null, "secret": false, "rule": "port",
"regex": "^0*([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$",
"description": "The HTTP port Tomcat listens on (your TLS proxy forwards to it).",
"prompts": [ { "id": "http-port.ask", "text": "HTTP port [8080]:", "script": " HTTP port [${_port_hint}]: " } ],
"examples": { "valid": ["8080", "9090", "1", "65535"], "invalid": ["0", "65536", "80a", "-1", "8080 "] }
},
{
"id": "replace-data", "env": "MDMESH_REPLACE_DATA", "aliases": ["REPLACE_DATA"], "installers": ["install-native.sh"],
"type": "enum", "allowed": ["no", "yes"], "default": "no", "emptyMeans": "unset",
"required": false, "when": null, "secret": false, "rule": "yes-no",
"regex": "^(yes|no)$",
"description": "Asked only when the database already holds data: no keeps it (deploys the new code and runs migrations), yes erases it and starts from an empty seed. This cannot be undone.",
"prompts": [
{ "id": "replace-data.choice", "text": "Choice [K/e]:", "script": " Choice %s[K/e]%s: " },
{ "id": "replace-data.confirm", "text": "Type ERASE to confirm dropping <n> device(s) and <n> user(s):", "script": " %sType ERASE to confirm dropping %s device(s) and %s user(s):%s " }
],
"examples": { "valid": ["no", "yes"], "invalid": ["YES", "y", "erase", "keep"] }
},
{
"id": "assume-yes", "env": "MDMESH_ASSUME_YES", "aliases": ["ASSUME_YES"], "flag": "-y", "installers": ["install-native.sh"],
"type": "boolean", "allowed": ["0", "1"], "default": "0", "emptyMeans": "unset",
"required": true, "requiredNote": "For a run without questions: 1 confirms the changes to this host.",
"when": null, "secret": false, "rule": "flag",
"regex": "^(0|1)$",
"description": "1 (or -y): proceed without typing yes, and take the default for every other question not answered (the current base URL and port on a re-run, 8080 on a fresh install, Keep for existing data).",
"prompts": [ { "id": "assume-yes.confirm", "text": "Type \"yes\" to proceed:", "script": " Type \"yes\" to proceed: " } ],
"examples": { "valid": ["1", "0"], "invalid": ["yes", "true", "2"] }
}
]
}