Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
4.26k stars 569 forks source link

Server actions moved from default domain to defined domain #3972

Closed b8two closed 2 years ago

b8two commented 2 years ago

Hi,

On the My Server page, the default "domain" had always shown the "Server actions".

I tried updating my config.json to include the latest improvments and now a specified "domain" contains the "Server actions" and the default "domain" has no options.

Are there parameters that only work in the default domain and not the specified domains?

Ylianst commented 2 years ago

Not sure I understand your request. Can you send that parts of you config look like and screen shots? MeshCentral is big software, lots of "Server actions" all over the place.

b8two commented 2 years ago

Default domain; image

Additional domain:

image

The server actions previously appeared only under the default domain and now are only on the additional domain.

  "domains": {
    "": {
      "title": "b8two Mesh",
      "siteStyle": 2,
      "title2": "",
      "title1": "",
      "titlePicture": "b8two.svg",
      "loginPicture": "b8two.svg",
      "userQuota": 1048576,

      "certUrl": "https://b8.two:443/",

      "footer": "b8two",

      "newAccounts": true,

      "minify": true,
      "meshQuota": 248576,
      "myServer": {
        "Backup": false,
        "Restore": false,
        "Upgrade": false,
        "ErrorLog": false,
        "Console": false,
        "Trace": false
      },
      "PreconfiguredRemoteInput": [
        {
          "name": "CompagnyUrl",
          "value": "https://help.mycompany.com/"
        },
        {
          "name": "Any Text",
          "value": "Any text\r"
        },
        {
          "name": "Welcome",
          "value": "Default welcome text"
        }
      ],
      "deviceMeshRouterLinks": {
        "rdp": true,
        "ssh": true,
        "scp": true,
        "extralinks": [
          {
            "name": "HTTP",
            "protocol": "http",
            "port": 80,
            "_ip": "192.168.1.100",
            "_filter": [
              "mesh/(domainid)/(meshid)",
              "node/(domainid)/(nodeid)"
            ]
          },
          {
            "name": "HTTPS",
            "protocol": "https",
            "port": 443
          },
          {
            "name": "Portainer",
            "protocol": "phttp",
            "port": 9000,
            "ip": "192.168.1.100",
            "filter": [
              "mesh/b8two/o9t6cyB8KntO6bPnAQNULEgFJj6xLsYOAtpmCcJ8YfupbvcY1PvOm0gYb9bbjJ5D"
            ]
          }
        ]
      },
      "passwordRequirements": {
        "min": 8,
        "max": 128,
        "upper": 1,
        "lower": 1,
        "numeric": 1,
        "nonalpha": 1,
        "reset": 90,
        "force2factor": false,
        "skip2factor": "127.0.0.1,192.168.2.0/24",
        "oldPasswordBan": 5,
        "banCommonPasswords": false,
        "twoFactorTimeout": 300
      },
      "_assistantCustomization": {
        "title": "Company® Product™",
        "image": "assistant-logo.png",
        "fileName": "compagny"
      },
      "_agentCustomization": {
        "displayName": "Company® Product™",
        "description": "Company® Product™ agent for remote monitoring, management and assistance.",
        "companyName": "Company®",
        "serviceName": "companyagent",
        "image": "agent-logo.png",
        "fileName": "compagnyagent"
      },

      "mstsc": true,

      "twoFactorCookieDurationDays": 90,

      },
      "_sessionRecording": {
        "_onlySelectedUsers": true,
        "_onlySelectedUserGroups": true,
        "_onlySelectedDeviceGroups": true,
        "_filepath": "C:\\temp",
        "_index": true,
        "_maxRecordings": 10,
        "_maxRecordingDays": 15,
        "_maxRecordingSizeMegabytes": 3,
        "__protocols__": "Is an array: 1 = Terminal, 2 = Desktop, 5 = Files, 100 = Intel AMT WSMAN, 101 = Intel AMT Redirection, 200 = Messenger",
        "protocols": [
          1,
          2,
          101
        ]
      },

      "userConsentFlags": {
        "desktopnotify": false,
        "terminalnotify": false,
        "filenotify": false,
        "desktopprompt": false,
        "terminalprompt": false,
        "fileprompt": false,
        "desktopprivacybar": false
      },

      "androidCustomization": {
        "title": "b8two® b8two™",
        "subtitle": "Mesh™",
        "image": "b8two.svg"
      }

    "b8two": {
      "title": "b8two",
      "title2": "Mesh Server",
      "title1": "b8two Mesh",
      "footer": "b8two",
      "certUrl": "https://b8.two:443/"
    },

  },

Above was edited to remove defaults (with _ ) and dropped the actual configuration items with my "b8two" handle.

It behaved normally before I tried to make use of deviceMeshRouterLinks and androidCustomization I wanted to have the custom domain with additional links but this change occured, then I tried to put the section back to the default domain and in regards to "Portainer" specified the other domain, however it has not reverted the changes. Perhaps it is the androidCustomization that needs to be in the default domain only.

Ylianst commented 2 years ago

The first issue here is the config.json must be a valid JSON file. The config.json you have above has many issues, like the "userConsentFlags" and "androidCustomization" section are domains. So you have 4 domains.

If you are having problems with JSON, take a look at this video.

Your config.json should look like this:

{
  "settings": {},
  "domains": {
    "": {
      "title": "b8two Mesh",
      "siteStyle": 2,
      "title2": "",
      "title1": "",
      "titlePicture": "b8two.svg",
      "loginPicture": "b8two.svg",
      "userQuota": 1048576,
      "certUrl": "https://b8.two:443/",
      "footer": "b8two",
      "newAccounts": true,
      "minify": true,
      "meshQuota": 248576,
      "mstsc": true,
      "twoFactorCookieDurationDays": 90,
      "myServer": {
        "Backup": false,
        "Restore": false,
        "Upgrade": false,
        "ErrorLog": false,
        "Console": false,
        "Trace": false
      },
      "PreconfiguredRemoteInput": [
        {
          "name": "CompagnyUrl",
          "value": "https://help.mycompany.com/"
        },
        {
          "name": "Any Text",
          "value": "Any text\r"
        },
        {
          "name": "Welcome",
          "value": "Default welcome text"
        }
      ],
      "deviceMeshRouterLinks": {
        "rdp": true,
        "ssh": true,
        "scp": true,
        "extralinks": [
          {
            "name": "HTTP",
            "protocol": "http",
            "port": 80,
            "_ip": "192.168.1.100",
            "_filter": [
              "mesh/(domainid)/(meshid)",
              "node/(domainid)/(nodeid)"
            ]
          },
          {
            "name": "HTTPS",
            "protocol": "https",
            "port": 443
          },
          {
            "name": "Portainer",
            "protocol": "phttp",
            "port": 9000,
            "ip": "192.168.1.100",
            "filter": [
              "mesh/b8two/o9t6cyB8KntO6bPnAQNULEgFJj6xLsYOAtpmCcJ8YfupbvcY1PvOm0gYb9bbjJ5D"
            ]
          }
        ]
      },
      "passwordRequirements": {
        "min": 8,
        "max": 128,
        "upper": 1,
        "lower": 1,
        "numeric": 1,
        "nonalpha": 1,
        "reset": 90,
        "force2factor": false,
        "skip2factor": "127.0.0.1,192.168.2.0/24",
        "oldPasswordBan": 5,
        "banCommonPasswords": false,
        "twoFactorTimeout": 300
      },
      "userConsentFlags": {
        "desktopnotify": false,
        "terminalnotify": false,
        "filenotify": false,
        "desktopprompt": false,
        "terminalprompt": false,
        "fileprompt": false,
        "desktopprivacybar": false
      },
      "androidCustomization": {
        "title": "b8two® b8two™",
        "subtitle": "Mesh™",
        "image": "b8two.svg"
      }
    },
    "b8two": {
      "title": "b8two",
      "title2": "Mesh Server",
      "title1": "b8two Mesh",
      "footer": "b8two",
      "certUrl": "https://b8.two:443/"
    }
  }
`}`

Next, notice this section:

      "myServer": {
        "Backup": false,
        "Restore": false,
        "Upgrade": false,
        "ErrorLog": false,
        "Console": false,
        "Trace": false
      },

This turns off features in the "MyServer" tab. You indicated that in the default domain you want all these features turned off. Since this section is not in your other domain, the feature are present in your 3 other domains.

Let me know if this helps.

b8two commented 2 years ago

I may have ruined the manual json editing for the post, but my config file looks okay. I found this online tool that allows comparing JSON files as an expandable tree and it only finds the defaults plus my additional one. image

yes, I think that the "myServer" section was the reason.

When I started with Meshcentral, I had used the advanced config example file but with so many improvments there was a large difference between what I was running and the latest, so I compared my file with the latest advanced config example and moved my changes to the new version and that is where the new defaults of "myServer" crept in and I that is why I thought it was linked to a couple of new features I wanted to enable.

Thankyou for your help.