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.21k stars 566 forks source link

Issue updating 0.7.37 to 0.9.99 #3778

Closed killmasta93 closed 2 years ago

killmasta93 commented 2 years ago

Hi Currently trying to update meshcentral on ubuntu 18.04 on node 8.1.0

when i try to update i keep getting 504 NGINX bad gateway

image

after a while it loads the login screen but does not update to the correct version

Thank you

killmasta93 commented 2 years ago

I was able to solve the issue, if this happens do the following


curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt -y install nodejs

then

npm install meshcentral

killmasta93 commented 2 years ago

Out of curiosity i see that there are many updates that were implemented would i need to change differently my config?

root@remote:~# cat  /root/meshcentral-data/config.json
{
  "__comment__" : "This is a sample configuration file, edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
  "settings": {
  "Cert": "remote.domain.com",
  "trustedproxy": "CloudFlare",
    "MongoDb": "mongodb://127.0.0.1:27017/meshcentral",
    "_MongoDbName": "meshcentral",
    "_MongoDbChangeStream": true,
    "WANonly": true,
    "_LANonly": true,
    "_Minify": 1,
    "_SessionTime": 30,
    "_SessionKey": "MyReallySecretPassword1",
    "_DbEncryptKey": "MyReallySecretPassword2",
    "_DbExpire": {
      "events": 1728000,
      "powerevents": 864000
    },
    "Port": 4430,
    "RedirPort": 800,
    "AliasPort": 443,
    "_AllowLoginToken": true,
    "_AllowFraming": true,
    "_WebRTC": false,
    "_ClickOnce": false,
    "_SelfUpdate": true,
    "_AgentPing": 60,
    "_AgentPong": 60,
    "_AgentIdleTimeout": 150,
    "MeshErrorLogPath": "/var/log/mesh.log",
    "NpmPath": "/usr/bin/node /usr/bin/npm",
    "_NpmProxy": "http://1.2.3.4:80",
    "_AllowHighQualityDesktop": true,
    "_UserAllowedIP": "127.0.0.1,192.168.1.0/24",
    "_UserBlockedIP": "127.0.0.1,::1,192.168.0.100",
    "_AgentAllowedIP": "192.168.0.100/24",
    "_AgentBlockedIP": "127.0.0.1,::1",
    "_LocalDiscovery": {
      "name": "Local server name",
      "info": "Information about this server"
    },
    "TlsOffload": "127.0.0.1",
     "BrowserPong": 20,
    "AgentPong": 20,
    "_MpsTlsOffload": true,
    "_No2FactorAuth": true,
    "_WebRtConfig": {
      "iceServers": [
        { "urls": "stun:stun.services.mozilla.com" },
        { "urls": "stun:stun.l.google.com:19302" }
      ]
    },
    "_AutoBackup": {
      "backupIntervalHours": 24,
      "keepLastDaysBackup": 10,
      "zipPassword": "MyReallySecretPassword3",
      "_backupPath": "C:\\backups"
    },
    "_Redirects": {
      "meshcommander": "https://www.meshcommander.com/"
    }
  },
  "domains": {
    "": {
      "Title": "mesh",
      "Title2": "central",
      "TitlePicture": "photo.png",
      "WelcomePicture": "photo.png",
      "_UserQuota": 1048576,
      "_MeshQuota": 248576,
      "_NewAccounts": true,
      "_UserNameIsEmail": true,
      "_NewAccountEmailDomains": [ "sample.com" ],
      "_NewAccountsRights": [ "nonewgroups", "notools" ],
      "_Footer": "<a href='https://twitter.com/mytwitter'>Twitter</a>",
      "CertUrl": "https://remote.domain.com:443/",
      "_PasswordRequirements": { "min": 8, "max": 128, "upper": 1, "lower": 1, "numeric": 1, "nonalpha": 1, "reset": 90, "force2factor": true },
      "_AgentNoProxy": true,
      "_GeoLocation": true,
      "_UserAllowedIP": "127.0.0.1,192.168.1.0/24",
      "_UserBlockedIP": "127.0.0.1,::1,192.168.0.100",
      "_AgentAllowedIP": "192.168.0.100/24",
      "_AgentBlockedIP": "127.0.0.1,::1",
      "___UserSessionIdleTimeout__" : "Number of user idle minutes before auto-disconnect",
      "_UserSessionIdleTimeout" : 30,
      "__UserConsentFlags__" : "Set to: 1 for desktop, 2 for terminal, 3 for files, 7 for all",
      "_UserConsentFlags" : 7,
        "_Limits": {
        "_MaxDevices": 100,
        "_MaxUserAccounts": 100,
        "_MaxUserSessions": 100,
        "_MaxAgentSessions": 100,
        "MaxSingleUserSessions": 10
     },
      "_AmtAcmActivation": {
        "log": "amtactivation.log",
        "certs": {
          "mycertname": {
            "certfiles": [ "amtacm-leafcert.crt", "amtacm-intermediate1.crt", "amtacm-intermediate2.crt", "amtacm-rootcert.crt" ],
            "keyfile": "amtacm-leafcert.key"
          }
        }
      },
      "_Redirects": {
       "meshcommander": "https://www.meshcommander.com/"
      },
      "_yubikey": { "id": "0000", "secret": "xxxxxxxxxxxxxxxxxxxxx", "_proxy": "http://myproxy.domain.com:80" },
      "_httpheaders": { "Strict-Transport-Security": "max-age=360000" },
      "_agentConfig": [ "webSocketMaskOverride=1" ]
    },
    "_customer1": {
      "DNS": "customer1.myserver.com",
      "Title": "Customer1",
      "Title2": "TestServer",
      "NewAccounts": 1,
      "Auth": "sspi",
      "Footer": "Test",
      "_CertUrl": "https://192.168.2.106:443/"
    },
    "info": {
      "share": "C:\\ExtraWebSite"
    }
  },
  "_letsencrypt": {
    "__comment__": "Go to https://letsdebug.net/ first before trying Let's Encrypt.",
    "email": "gerencia@domain.com",
    "names": "remote.domain.com",
    "rsaKeySize": 3072,
    "production": false
  },
  "_peers": {
    "serverId": "server1",
    "servers": {
      "server1": { "url": "wss://192.168.2.133:443/" },
      "server2": { "url": "wss://192.168.1.106:443/" }
    }
  },
  "smtp": {
    "host": "mail.domain.com.co",
    "port": 465,
    "from": "noreply@domain.com.co",
     "user": "noreply",
     "pass": "thepass",
     "tls": true
  }
}
Ylianst commented 2 years ago

You can run your config.json thru a JSON Lint tool to make it look nice, also because everything that starts with a _ is ignored, your config.json looks like this:

{
  "settings": {
    "Cert": "remote.domain.com",
    "trustedproxy": "CloudFlare",
    "MongoDb": "mongodb://127.0.0.1:27017/meshcentral",
    "WANonly": true,
    "Port": 4430,
    "RedirPort": 800,
    "AliasPort": 443,
    "MeshErrorLogPath": "/var/log/mesh.log",
    "NpmPath": "/usr/bin/node /usr/bin/npm",
    "TlsOffload": "127.0.0.1",
    "BrowserPong": 20,
    "AgentPong": 20
  },
  "domains": {
    "": {
      "Title": "mesh",
      "Title2": "central",
      "TitlePicture": "photo.png",
      "WelcomePicture": "photo.png",
      "CertUrl": "https://remote.domain.com:443/"
    },
    "info": {
      "share": "C:\\ExtraWebSite"
    }
  },
  "smtp": {
    "host": "mail.domain.com.co",
    "port": 465,
    "from": "noreply@domain.com.co",
    "user": "noreply",
    "pass": "thepass",
    "tls": true
  }
}

Your config.json looks good, I would not change anything, expect, are you really using the /info site that points to "C:\ExtraWebSite"? If not, remove that.

killmasta93 commented 2 years ago

Thank you so much