From 337f63406412c7d7271210a8313232473394a005 Mon Sep 17 00:00:00 2001 From: silversword411 Date: Mon, 14 Feb 2022 23:30:38 -0500 Subject: [PATCH] docs - Initial framework and layout --- docs/docs/design/index.md | 9 +++ docs/docs/downloads.md | 0 docs/docs/index.md | 14 ++-- docs/docs/install/index.md | 24 +++++++ docs/docs/intelamt/index.md | 9 +++ docs/docs/meshcentral/debugging.md | 105 +++++++++++++++++++++++++++++ docs/docs/meshcentral/index.md | 9 +++ docs/docs/meshcmd/index.md | 9 +++ docs/docs/meshctrl/index.md | 9 +++ docs/docs/meshrouter/index.md | 9 +++ docs/docs/stylesheets/extra.css | 14 ++++ docs/mkdocs.yml | 24 +++++++ 12 files changed, 225 insertions(+), 10 deletions(-) create mode 100644 docs/docs/design/index.md create mode 100644 docs/docs/downloads.md create mode 100644 docs/docs/install/index.md create mode 100644 docs/docs/intelamt/index.md create mode 100644 docs/docs/meshcentral/debugging.md create mode 100644 docs/docs/meshcentral/index.md create mode 100644 docs/docs/meshcmd/index.md create mode 100644 docs/docs/meshctrl/index.md create mode 100644 docs/docs/meshrouter/index.md diff --git a/docs/docs/design/index.md b/docs/docs/design/index.md new file mode 100644 index 00000000..e8a2817b --- /dev/null +++ b/docs/docs/design/index.md @@ -0,0 +1,9 @@ +# Design and Architecture + +[Design and Architecture Guide](https://meshcentral.com/info/docs/MeshCentral2DesignArchitecture.pdf) + +## Video Walkthru + +
+ +
diff --git a/docs/docs/downloads.md b/docs/docs/downloads.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/docs/index.md b/docs/docs/index.md index 075e3126..c9b2b71b 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -1,13 +1,4 @@ -# MeshCentral2 Documentation - -## Table of Contents - -[About](install.md#About) -Social Media -[Documentation](install.md#Documentation) -Video Tutorials -[Feedback](install.md#Feedback) -[License](install.md#License) +# MeshCentral Documentation ## About @@ -20,8 +11,11 @@ For more information, [visit MeshCentral.com](https://www.meshcentral.com/). ## Social Media [YouTube](https://www.youtube.com/channel/UCJWz607A8EVlkilzcrb-GKg/videos) + [Reddit](https://www.reddit.com/r/MeshCentral/) + [Twitter](https://twitter.com/MeshCentral) + [BlogSpot](https://meshcentral2.blogspot.com/) ## Documentation diff --git a/docs/docs/install/index.md b/docs/docs/install/index.md new file mode 100644 index 00000000..13f27f06 --- /dev/null +++ b/docs/docs/install/index.md @@ -0,0 +1,24 @@ +# Installation + +Getting started is easy. If you don't have it already, install NodeJS. Then, create an empty folder and do this: + +```bash +npm install meshcentral +node node_modules/meshcentral +``` + +That's it. MeshCentral will set itself up and start managing computers on your local network. By default it will be setup in LAN mode and agents you install will multicast on the local network to find the server. To setup the server so that agents use a well known DNS name and to start customizing your server, go in the "meshcentral-data" folder and edit the config.json file. The configuration file must be valid JSON, you can use this link to validate the file format. + +For Windows users, you can download the MeshCentral Installer that will automate installation of NodeJS and provide basic configuration of the server. This option is not recommended for advanced users. + +[Win32 MeshCentral Installer](https://meshcentral.com/info/tools/MeshCentralInstaller.exe) + +By default, MeshCentral will use NeDB as this is the built-in database. For more advanced users, it's recommended to switch to using MongoDB. MeshCentral can be installed on a very small server. A [Raspberry Pi](https://www.raspberrypi.org/) or [AWS t3.nano running Amazon Linux 2 instance](https://aws.amazon.com/ec2/pricing/on-demand/) for 5$ a month will do just fine for managing up to a few hundred devices. + +You can run the MeshCentral Server with --help to get options for background installation. + +# Configuration + +Once you get MeshCentral installed, the first user account that is created will be the server administrator. So, don't delay and navigate to the login page and create a new account. You can then start using your server right away. A lot of the fun with MeshCentral is the 100's of configuration options that are available in the config.json file. You can put your own branding on the web pages, setup a STMP email server, SMS services and much more. + +You can look [here for simple config.json](https://raw.githubusercontent.com/Ylianst/MeshCentral/master/sample-config.json), [here for a more advanced configuration](https://raw.githubusercontent.com/Ylianst/MeshCentral/master/sample-config-advanced.json) and [here for all possible configuration options](https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json). You can also take a look at the [MeshCentral User's Guide](https://meshcentral.com/info/docs/MeshCentral2InstallGuide.pdf) and [tutorial videos](https://meshcentral.com/info/tutorials.html) for additional help. \ No newline at end of file diff --git a/docs/docs/intelamt/index.md b/docs/docs/intelamt/index.md new file mode 100644 index 00000000..fed91515 --- /dev/null +++ b/docs/docs/intelamt/index.md @@ -0,0 +1,9 @@ +# Intel AMT + +[Intel AMT Guide](https://github.com/Ylianst/MeshCentral/blob/master/docs/MeshCentral2%20Intel%20AMT%20Guide%20v0.0.1.odt) + +## Video Walkthru + +
+ +
diff --git a/docs/docs/meshcentral/debugging.md b/docs/docs/meshcentral/debugging.md new file mode 100644 index 00000000..0c93a338 --- /dev/null +++ b/docs/docs/meshcentral/debugging.md @@ -0,0 +1,105 @@ +Youtube video about websockets: https://youtu.be/3vI4URd3VzU + +`Trace=1` as a parameter in chrome dev tools for debugging + + +To log all database queries, change log_statement in /etc/postgresql/13/main/postgresql.conf + +``` +# CUSTOM +log_statement = 'all' # none, ddl, mod, all +``` + +The stacktrace was logged to `stdout/journalctl`. Supposedly, you can enable debug logging for node modules by adding `DEBUG=` to the environment. + +Adding this to `/etc/systemd/system/meshcentral.service` should do it but it didn't seem to do anything. + +I think that's because Mesh uses the trace logging in the browser instead of logging things in the server logs. + +``` +Environment=DEBUG=mesh* +``` + +If you want to change node to meshcentral in journalctl, add this to /etc/systemd/system/meshcentral.service. + +``` +SyslogIdentifier=meshcentral +``` + +## Logging it all + +To log everything that's possible, prepare the log directory. + +``` +mkdir /meshcentral/meshcentral-logs/ +chown tactical:tactical logs +ln -s ../meshcentral-logs/log.txt /meshcentral/meshcentral-data/log.txt +``` + +And then add this to your config. + +```json + "meshErrorLogPath": "/meshcentral/meshcentral-logs/", + "authLog": "/meshcentral/meshcentral-logs/auth.log", + "log": [ + "cookie", + "dispatch", + "main", + "peer", + "web", + "webrequest", + "relay", + "webrelaydata", + "webrelay", + "mps", + "mpscmd", + "swarm", + "swarmcmd", + "agentupdate", + "agent", + "cert", + "db", + "email", + "amt", + "httpheaders", + "websocket" + ], +``` + +You'll then have 3 files: + +```bash +-rw-rw-r-- 1 tactical tactical 2593 Feb 2 12:22 auth.log +-rw-r--r-- 1 tactical tactical 147593 Feb 2 12:31 log.txt +-rw-rw-r-- 1 tactical tactical 381 Feb 2 12:02 mesherrors.txt +``` + +And to make it truly log everything, change the following in meshcentral.js around line 3530. + +Old: +``` +obj.fs.writeSync(obj.xxLogFile, new Date().toLocaleTimeString() + ' - ' + source + ': ' + Array.prototype.slice.call(...args).join('') + '\r\n'); +``` + +New: + +``` +obj.fs.writeSync(obj.xxLogFile, new Date().toLocaleTimeString() + ' - ' + source + ': ' + args.join(' ') + '\r\n'); +``` + +`log.txt` will now log everything in the Trace tab, but not formatted as nice. + +When doing debugging on my development server, I use this line in the settings section to block all agent connections except the agent I want: + +``` +"agentAllowedIp": [ "192.168.2.147" ], +``` + +Of course, this is just for debugging. + + +## Finding system ID types + + + +## General server statistics related \ No newline at end of file diff --git a/docs/docs/meshcentral/index.md b/docs/docs/meshcentral/index.md new file mode 100644 index 00000000..767a17be --- /dev/null +++ b/docs/docs/meshcentral/index.md @@ -0,0 +1,9 @@ +# Meshcentral2 Guide + +[MeshCentral2 Guide](https://meshcentral.com/info/docs/MeshCentral2UserGuide.pdf) + +## Video Walkthru + +
+ +
diff --git a/docs/docs/meshcmd/index.md b/docs/docs/meshcmd/index.md new file mode 100644 index 00000000..ee9cea92 --- /dev/null +++ b/docs/docs/meshcmd/index.md @@ -0,0 +1,9 @@ +# MeshCmd + +[MeshCmd Command Line Tool](https://meshcentral.com/info/docs/MeshCmdUserGuide.pdf) + +## Video Walkthru + +
+ +
diff --git a/docs/docs/meshctrl/index.md b/docs/docs/meshctrl/index.md new file mode 100644 index 00000000..31883a57 --- /dev/null +++ b/docs/docs/meshctrl/index.md @@ -0,0 +1,9 @@ +# MeshCtrl + +[MeshCtrl Command Line Tool](https://github.com/Ylianst/MeshCentral/blob/master/docs/MeshCentral2%20Intel%20AMT%20Guide%20v0.0.1.odt) + +## Video Walkthru + +
+ +
diff --git a/docs/docs/meshrouter/index.md b/docs/docs/meshrouter/index.md new file mode 100644 index 00000000..f47d6110 --- /dev/null +++ b/docs/docs/meshrouter/index.md @@ -0,0 +1,9 @@ +# MeshCentral Router + +[MeshCentral Router Guide](https://meshcentral.com/info/docs/MeshCentral2RouterUserGuide.pdf) + +## Video Walkthru + +
+ +
diff --git a/docs/docs/stylesheets/extra.css b/docs/docs/stylesheets/extra.css index 27b95321..e1a71e41 100644 --- a/docs/docs/stylesheets/extra.css +++ b/docs/docs/stylesheets/extra.css @@ -25,6 +25,12 @@ .md-nav__link[data-md-state=blur] { color: white; } +.md-tabs { + background-color: #0b3e81; + color: white; +} +.md-tabs__list { +} .md-typeset a { color: whitesmoke; text-decoration: underline; @@ -61,3 +67,11 @@ a:link { .html { background-color: #0b3e81; } +.dlspan { + background-color:gray; + color:black; + font-size:16px; + padding:4px; + border-radius:4px; + box-shadow: 2px 2px 4px black; +} \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index c66ffe93..c3e792cf 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -1,6 +1,28 @@ site_name: "MeshCentral2 Documentation" nav: - Home: index.md + + - Install: + - install/index.md + + - MeshCentral: + - meshcentral/index.md + + - Design and Architecture: + - design/index.md + + - MeshCmd: + - meshcmd/index.md + + - MeshCtrl: + - meshctrl/index.md + + - Mesh Router: + - meshrouter/index.md + + - Intel AMT: + - intelamt/index.md + site_description: "A remote monitoring and management tool" site_author: " Ylianst" site_url: "https://git.meshcentral.com/" @@ -21,6 +43,8 @@ theme: features: extra_css: - stylesheets/extra.css +extra: + generator: false markdown_extensions: - pymdownx.keys