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.09k stars 549 forks source link

WebRDP Disconnects at whatever "AgentPong" or "AgentPing" is set #5851

Closed K-O-K closed 7 months ago

K-O-K commented 7 months ago

Describe the bug When "AgentPong" or "AgentPing" is set in the config.json file, WebRDP connections are closed after the amounts of seconds specified.

To Reproduce Steps to reproduce the behavior:

  1. Go to config.json file in the MeshCentral Server and set "AgentPong" or "AgentPing" to whatever amount of seconds you want or need.
  2. Restart the MeshCentral service and connect to a Windows PC using the RDP Connect button in the Desktop tab.
  3. Do something or do nothing on the remote PC over the Web RDP session and it will disconnect after the amount of seconds you specified in "AgentPong" or "AgentPing" setting.

Expected behavior the WebRDP session to stay connected until the Disconnect button is clicked.

Screenshots image

image

Server Software (please complete the following information):

Client Device (please complete the following information):

Remote Device (please complete the following information):

Your config.json file

{
"$schema": "http://info.meshcentral.com/downloads/meshcentral-config-schema.json",
"__comment1__": "This is a simple configuration file, all values and sections that start with underscore (_) are ignored. Edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
"__comment2__": "See node_modules/meshcentral/sample-config-advanced.json for a more advanced example.",
    "settings": {
        "_MongoDb": "mongodb://127.0.0.1:27017/meshcentral",
        "mariaDB":{
            "host": "xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.rds.amazonaws.com",
            "user": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                "awsrds": true,
            "port": 3306,
            "password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "database": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "_ssl": true
        },
        "dbExpire": {
            "events": 3888000,
            "powerevents": 3888000,
            "statsevents": 3888000
        },
        "cert": "xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxx",
        "WANonly": true,
        "_LANonly": true,
        "_sessionKey": "MyReallySecretPassword1",
        "_cleanNpmCacheOnUpdate": true,
        "authLog": "/xxxxxxx/xxxxxxxxxxxxxxxx/meshcentral-data/AuthLog.log",
        "maxInvalidLogin": {
            "time": X,
            "count": xx,
            "coolofftime": xxxx
        },
        "port": 443,
        "agentPortTls": false,
        "_aliasPort": 443,
        "_redirPort": 80,
        "_redirAliasPort": 80,
        "_relayPort": 453,
        "relayDNS": [ "relay0.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxx",
            "relay1.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxx",
            "relay2.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxx",
            "relay3.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxx",
            "relay4.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxx" ],
        "_desktopMultiplex": true,
        "AgentPong": 45,
        "_BrowserPong": 5,
        "_AgentPing": 30,
        "_BrowserPing": 35,
        "Compression": true,
        "WsCompression": true,
        "AgentWsCompression": true,
        "WebRTC": true,
        "ExactPorts": true,
        "_ClickOnce": true,
        "TlsOffload": "xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx.xxx",
        "trustedproxy": "xxx.xxx.xxx.xxx/23",
        "CookieEncoding": "hex",
        "Cookieipcheck": "none",
        "autoBackup": {
            "_mysqlDumpPath": "/usr/bin/mysqldump",
            "backupIntervalHours": 6,
            "keepLastDaysBackup": 20,
            "_zipPassword": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "backupPath": "/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx/Backup/"
        },
        "plugins": {
            "enabled": true
        }
    },
    "domains": {
        "": {
            "ManageAllDeviceGroups" : [ "xxxxxxxxxxxxxxxx", "~azure:xxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxx.xxx" ],
            "manageCrossDomain" : [ "xxxxxxxxxxxxxxxx", "~azure:xxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxx.xxx" ],
            "_maxDeviceView": 200,
            "title": "xxxxxxxxxxxxxxxx",
            "_title2": "MeshCentral - xxxxxxxxxxxxxxxx",
            "TitlePicture": "/xxxxxxx/xxxxxxxxxxxxxxxx/meshcentral-data/customization/xxxxxxxxxxxxxxxx-Top-logo.png",
            "LoginPicture": "/xxxxxxx/xxxxxxxxxxxxxxxx/meshcentral-data/customization/xxxxxxxxxxxxxxxx-login-logo.png",
            "WelcomePicture": "/xxxxxxx/xxxxxxxxxxxxxxxx/meshcentral-data/customization/xx-Welcome-Logo-small3.png",
            "_welcomePictureFullScreen": true,
            "meshMessengerTitle": "xxxxxxxxxxxxxxxxChat",
            "meshMessengerPicture": "/xxxxxxx/xxxxxxxxxxxxxxxx/meshcentral-data/customization/xxxxxxxxxxxx-ChatLogo.png",
            "nightMode": 1,
            "hide": 4,
            "Minify": true,
            "NewAccounts": false,
            "userNameIsEmail": true,
            "_geoLocation": true,
            "ssh": true,
            "scp": true,
            "_rdp": true,
            "terminal": {
                "linuxshell": "any",
                "launchCommand": {
                    "linux": " cd /\n clear\n",
                    "_darwin": "clear\necho \"Hello MacOS\"\n",
                    "_freebsd": "clear\necho \"Hello FreeBSD\"\n"
                }
            },
            "authStrategies": {
                "azure": {
                    "callbackurl": "https://xxxxxxxxxxxxxxxx.xxxxxx.xxxxxx.com/auth-azure-callback",
                    "newAccounts": true,
                    "newAccountsRights": [ "nonewgroups", "nonewdevices", "notools" ],
                    "clientid": "xxxxxxxxxxxxxxxx-xxxxxxxxx-xxxxxxxx-xxxxxxx-xxxxxxxxxxxxxxxx",
                    "clientsecret": "xxxxxxxxxxxxxxxxxxxxxx",
                    "tenantid": "xxxxxxxxxxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxxxxxxxxxx"
                }
            },
            "agentCustomization": {
                "displayName": "xxxxxxxxxxxxxxxx",
                "description": "xxxxxxxxxxxxxxxx",
                "companyName": "xxxxxxxxxxxxxxxx",
                "serviceName": "xxxxxxxxxxxxxxxx",
                "fileName": "xxxxxxxxxxxxxxxx"
            },
            "consentMessages": {
                "title": "xxxxxxxxxxxxxxxx",
                "desktop": "{0} xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. ¿xxxxxxxxxxxxxxxx?",
                "terminal": "{0} xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. ¿xxxxxxxxxxxxxxxx?",
                "files": "{0} xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. ¿xxxxxxxxxxxxxxxx?"
            },
            "desktopPrivacyBarText": "xxxxxxxxxxxxxxxx",
            "sessionRecording": {
                "onlySelectedUsers": true,
                "onlySelectedUserGroups": true,
                "onlySelectedDeviceGroups": true,
                "filepath": "/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx/SessionRecordings",
                "index": true,
                "maxRecordings": 10,
                "maxRecordingSizeMegabytes": 4000,
                "protocols": [ 1, 2, 5, 100, 101, 200 ]
            },
            "PasswordRequirements": {
                "force2factor":false,
                "twoFactorTimeout": 3000,
                "min": 32,
                "max": 128,
                "upper": 6,
                "lower": 6,
                "numeric": 4,
                "nonalpha": 5,
                "banCommonPasswords": true,
                "oldPasswordBan": 3
            },
            "_PreconfiguredRemoteInput": [
                { "name": "Name1", "value": "https://help.mycompany.com/" },
                { "name": "Name2", "value": "Any text" },
                { "name": "Name3", "value": "Default welcome text" }
            ],
            "_myServer": {
                "_Backup": true,
                "_Restore": false,
                "_Upgrade": false,
                "_ErrorLog": true,
                "_Console": true,
                "_Trace": false
            },
            "_urlSwitching": false,
            "novnc": true,
            "mstsc": true,
            "certURL": "https://xxxxxxxxxxxxxxxx.xxx.xxxxxx.com:443"
        }
    },
    "smtp": {
        "host": "smtp.office365.com",
        "port": 587,
        "from": "xxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxx.xxx",
        "user": "xxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxxx.xxx",
        "pass": "xxxxxxxxxxxxxxxx"
    }
}
si458 commented 7 months ago

this has been fixed in 1.1.21 please update https://github.com/Ylianst/MeshCentral/commit/6f78f9e2764109bfa783eabc396512dcb4a72baa https://github.com/Ylianst/MeshCentral/commit/15ff7d12a1e4e5d78936b473ea207b7e02b8ff26

OR download and replace apprelays.js from the master and restart meshcentral

i discovered this issue while fixing another web-rdp issue and it was bugging me, so i spent the day working out why haha

K-O-K commented 7 months ago

Thank you @si458 I can confirm that updating the apprelays.js file solved the problem!

I think I'm going to open another issue because after upgrading the version from 1.1.20 to 1.1.21, I couldn't access the web interface anymore, I had to recover from a full snapshot-based backup.

Thanks again!

si458 commented 7 months ago

@K-O-K glad it fixed it and hmmm yeh open another issue over that. I think I know what that will be straight away!