typo squashing

silversword411 committed Sep 7, 2022 at 10:40 UTC 597c67bb1f085c236fe051a9dbbab917a8170a52
2 files changed +403 -22
.vscode/settings.json
+382 -1
@@ -1,7 +1,11 @@
1 {
2 "cSpell.words": [
3 "abcdf",
4 + "accountchange",
5 + "accountcreate",
6 "accountid",
7 + "accountremove",
8 + "acmd",
9 "acmepath",
10 "actiontype",
11 "adddevicegroup",
@@ -16,17 +20,30 @@
20 "addusertousergroup",
21 "adminaccount",
22 "adminname",
23 + "agentaliasdns",
24 + "agentaliasport",
25 "agentallowedip",
26 + "agentapp",
27 "agentblockedip",
28 "agentconfig",
29 "agentconsole",
30 + "agentcoredump",
31 + "agentcoredumpusers",
32 "agentcustomization",
33 "agentdownload",
34 "agenterrorlogs",
35 + "agentid",
36 "agentidletimeout",
37 + "agentinfo",
38 + "agentinvite",
39 + "agentinvitecodes",
40 "agentkey",
41 "Agentless",
42 "agentnoproxy",
43 + "agentport",
44 + "agentportbind",
45 + "agentporttls",
46 + "agenttransfer",
47 "agenttype",
48 "agentupdateblocksize",
49 "agentupdatetest",
@@ -34,57 +51,97 @@
51 "aliasport",
52 "allevents",
53 "allowaccountreset",
54 + "allowframing",
55 "allowfullscreen",
56 + "allowhighqualitydesktop",
57 + "allowsavingdevicecredentials",
58 + "allusers",
59 "alreadyinstalled",
60 "amtacmactivation",
61 + "amtevents",
62 + "amthost",
63 "amtmanager",
64 "amtoff",
65 "amton",
66 "amtonly",
67 + "amtpass",
68 "amtreset",
69 "amtscanner",
70 + "amtscanoptions",
71 + "anewaccountcaptcha",
72 + "apassword",
73 + "apasswordhint",
74 "apikey",
75 + "apos",
76 "appmetrics",
77 + "apprelays",
78 "ashx",
79 + "assistantconfig",
80 + "assistantcustomization",
81 + "assistantnoproxy",
82 "atag",
83 "authcookie",
84 "authenticode",
85 + "authfail",
86 "authlog",
87 "authlogfile",
88 "Authn",
89 + "authorizationurl",
90 + "authstr",
91 + "authstrategies",
92 "autofido",
93 "awsrds",
94 + "backgroundcolor",
95 "backgroundonly",
96 "backupcode",
97 "backuppath",
98 + "badargs",
99 + "badtlscert",
100 + "bancommonpasswords",
101 + "batchupload",
102 "bitmask",
103 + "Bounser",
104 "callbackurl",
105 + "captchaargs",
106 "ccmp",
107 "Centralv",
108 "certbot",
109 "certfiles",
110 + "certhash",
111 + "certkeyhash",
112 "certpfx",
113 "certpfxpass",
114 "certurl",
115 "cfile",
116 "changedevice",
117 "changenode",
118 + "changepassword",
119 "chatnotify",
120 + "checkemail",
121 + "checkmail",
122 + "chnl",
123 "CIRA",
124 + "ciraconn",
125 "ciralocalfqdn",
126 "ckey",
127 "clearpower",
128 "clientid",
129 "clientsecret",
130 + "clipboardget",
131 + "clipboardset",
132 + "cmdoptions",
133 "cmds",
134 + "cnonce",
135 "companyname",
136 "configfile",
137 "configfiles",
138 "configkey",
139 "connectionstring",
140 + "Consts",
141 "cookieipcheck",
142 "cookiesamesite",
143 "coolofftime",
144 + "coredump",
145 "coredumps",
146 "createaccount",
147 "createmesh",
@@ -92,8 +149,14 @@
149 "crowdsec",
150 "crypted",
151 "cscli",
152 + "curloptionshttp",
153 + "curloptionshttps",
154 "cuser",
155 + "cuserid",
156 + "customui",
157 + "datafile",
158 "datapath",
159 + "datas",
160 "datastr",
161 "dbconfig",
162 "dbdeleteconfigfiles",
@@ -107,67 +170,119 @@
170 "dbpulldatafiles",
171 "dbpushconfigfiles",
172 "dbshowconfigfile",
173 + "debuglevel",
174 "defaultuserwebstate",
175 + "deldump",
176 + "deleteaccount",
177 "deletedefaultdomain",
178 "deletedomain",
179 "deletemesh",
180 "deleteuser",
181 "deleteusergroup",
182 + "deluser",
183 + "deluserpath",
184 + "DESKLIMITEDINPUT",
185 + "desktopmultiplex",
186 "desktopnotify",
187 "desktopprivacybar",
188 "desktopprompt",
189 + "desktoprelays",
190 "desktopviewonly",
191 "devbox",
192 + "devicefile",
193 "deviceid",
194 "deviceinfo",
195 "deviceinfocount",
196 "devicemessage",
197 "deviceopenurl",
198 "devicepower",
199 + "devicepowerevents",
200 + "devicesearchbarserverandclientname",
201 + "deviceshare",
202 "devicesharing",
203 "devicetoast",
204 "devid",
205 + "Digesthash",
206 + "disablerequestedauthncontext",
207 "displayname",
208 + "dlccore",
209 + "dlcore",
210 + "dldump",
211 + "dnscount",
212 "dnssuffix",
213 "domaindefaults",
214 "domainid",
215 + "domainname",
216 + "domainurl",
217 + "domainx",
218 "dont",
219 "dontlognull",
220 + "downloadfile",
221 "dumpcores",
222 + "dumpfile",
223 "editdevice",
224 "editdevicegroup",
225 "editgroup",
226 "editmesh",
227 "edituser",
228 + "emailaddress",
229 + "emailcheck",
230 + "emaildomain",
231 "emailexists",
232 + "emailok",
233 + "emailvalidation",
234 + "emailvalidationrequired",
235 "emailverified",
236 "entityid",
237 "entrypoints",
238 + "errdesc",
239 "errlogpath",
240 "esversion",
241 "etype",
242 "eventlogger",
243 "exactport",
244 "exactports",
245 + "exphbs",
246 "extractall",
247 + "extrakey",
248 "extralinks",
249 + "extrascriptsrc",
250 + "factorauth",
251 + "factorwarning",
252 + "fadev",
253 + "fahold",
254 + "fasent",
255 "fastcert",
256 + "fchallenge",
257 "fileaccess",
258 + "filedata",
259 + "filefullpath",
260 "filenotify",
261 "fileprompt",
262 + "filesize",
263 "filespath",
264 + "filestats",
265 + "fileurl",
266 "filteredusers",
267 "filterid",
268 "firebaserelay",
269 "firstname",
270 "forceduserwebstate",
271 + "foregroundcolor",
272 + "forwardclient",
273 "forwardfor",
274 + "forwardwrite",
275 + "forwardwsocket",
276 + "fpath",
277 "Freemonitoring",
278 "frontends",
279 + "ftarget",
280 + "fullpath",
281 "fullrights",
282 "fullscreen",
283 "gatewaymac",
284 "generateinvitelink",
285 + "geourl",
286 "getnetworkinfo",
287 "getsysinfo",
288 "getwspass",
@@ -175,49 +290,85 @@
290 "gotodevicename",
291 "gotonode",
292 "groupid",
293 + "guestdevicesharing",
294 "guestname",
295 + "GUESTSHARING",
296 + "hashhex",
297 "Hashi",
298 "hashpass",
299 "hashpasssplit",
300 "hashpassword",
301 + "Hashs",
302 "healthcheck",
303 "Hilaire",
304 + "hkey",
305 "httpheaders",
306 "httplog",
307 + "httpport",
308 + "hwchallenge",
309 + "hwotp",
310 + "hwstate",
311 + "hwtoken",
312 + "Ider",
313 "idexists",
314 "idhex",
315 "idpurl",
316 + "idsplit",
317 "iframe",
318 "ignoreagenthashcheck",
319 + "iishash",
320 + "imagebase",
321 + "imagefile",
322 "indexagenterrorlog",
323 "indexmcrec",
324 + "installflags",
325 + "installsize",
326 "installtext",
327 "intelamt",
328 "interactiveonly",
329 "interuser",
330 "invitecodes",
331 + "ipaddr",
332 + "ipblockeduserredirect",
333 + "ipcheck",
334 + "ipex",
335 "ipkvm",
336 "iplayer",
337 "ipranges",
338 + "isaml",
339 "Jitsi",
340 "jumpcloud",
341 "keyfile",
342 + "keygrip",
343 + "keyid",
344 "lanonly",
345 "LAPI",
346 "lastaddr",
347 "lastconnect",
348 "lastname",
349 "ldapauth",
350 + "ldapobj",
351 "ldapoptions",
352 + "ldapsaveusertofile",
353 + "ldapsyncwithusergroups",
354 "ldapuserbinarykey",
355 "ldapuseremail",
356 + "ldapusergroups",
357 + "ldapuserimage",
358 + "ldapuserkey",
359 "ldapusername",
360 + "ldapuserphonenumber",
361 + "ldapuserrealname",
362 + "ldapuserrequiredgroupmembership",
363 "ldapusers",
364 "leok",
365 "letsencrypt",
366 + "lightgray",
367 "limiteddesktop",
368 "limitedevents",
369 + "LIMITEVENTS",
370 "Linaro",
371 + "linuxpath",
372 "listdevicegroups",
373 "listdevices",
374 "listdomains",
@@ -228,56 +379,93 @@
379 "listusersessions",
380 "listusersofdevicegroup",
381 "loadconfigfromdb",
382 + "localdiscovery",
383 "localfile",
384 "localpath",
385 + "localrelay",
386 + "localsessionrecording",
387 "localurl",
388 "lockagentdownload",
389 "locksettings",
390 + "logfile",
391 + "logincodeb",
392 "logindomain",
393 "loginfooter",
394 "loginkey",
395 "loginkeyfile",
396 + "loginlogo",
397 + "loginmode",
398 "loginpass",
399 + "loginpicture",
400 + "loginscreen",
401 "logintoken",
402 "logintokengen",
403 "logintokenkey",
404 "logintokens",
405 "loginuser",
406 "logoback",
407 + "logoutcontrols",
408 "logouturl",
409 + "macrouter",
410 + "magenturl",
411 "mailserver",
412 "mailtokengen",
413 "maintenancemode",
414 + "mainwelcome",
415 + "MANAGECOMPUTERS",
416 "managedevices",
417 "manageusers",
418 + "markcoredump",
419 "maxfidokeys",
420 "maxlen",
421 + "maxuseraccounts",
422 "mcpath",
423 "mcrdesktop",
424 "mcrec",
425 "mcrfiles",
426 + "mcrouter",
427 "Mebx",
428 + "meshaction",
429 "meshadmin",
430 "meshagent",
431 "meshagents",
432 "meshauth",
433 "meshcentral",
434 "meshcentralhost",
435 + "meshchange",
436 "meshcmd",
437 "meshcommander",
438 + "meshcookie",
439 "meshcore",
440 "meshctrl",
441 + "meshdesktopmultiplex",
442 + "meshdevicefile",
443 + "mesherrorlogpath",
444 "mesherrors",
445 + "meshfilename",
446 "meshid",
447 + "meshidhex",
448 "meshidname",
449 + "meshinstall",
450 "meshmail",
451 + "meshmessenger",
452 + "meshmessengerid",
453 + "meshmessengerpicture",
454 + "meshmessengertitle",
455 "meshname",
456 + "meshosxagent",
457 "meshquota",
458 "meshrelay",
459 + "MESHRIGHT",
460 "meshrights",
461 "meshscanner",
462 + "meshserver",
463 + "meshsettings",
464 + "meshsettingslines",
465 "meshtype",
466 + "meshuser",
467 "Messagebox",
468 + "messageid",
469 "Messenging",
470 "minfo",
471 "minifyall",
@@ -287,17 +475,25 @@
475 "mongorestore",
476 "moutput",
477 "movetodevicegroup",
478 + "mpkg",
479 "mpsaliasport",
480 "mpscert",
481 "mpsdebug",
482 + "mpspass",
483 "mpsport",
484 "mpsserver",
485 "mpsservers",
486 "MPSSSL",
487 + "mpstlsoffload",
488 "mqttbroker",
489 "MSCHA",
490 + "msgid",
491 "mstsc",
492 + "mstscrelay",
493 + "mtype",
494 + "multiplexor",
495 "multiresponse",
496 + "multivalued",
497 "myaccountname",
498 "mycompany",
499 "mydomain",
@@ -309,13 +505,19 @@
505 "netif",
506 "newaccountemaildomains",
507 "newaccountname",
508 + "newaccountrealms",
509 "newaccounts",
510 + "newaccountscaptcha",
511 "newaccountspass",
512 "newaccountsrights",
513 + "newaccountsusergroups",
514 "newgroupname",
515 "newobj",
516 + "newpass",
517 "newpassword",
518 "NGNIX",
519 + "nightmode",
520 + "noact",
521 "noagentupdate",
522 "noamt",
523 "noauth",
@@ -324,47 +526,91 @@
526 "nodecount",
527 "nodeid",
528 "nodeids",
529 + "nodeidsplit",
530 "nodeinfo",
531 + "nodekey",
532 "nodepath",
533 + "NODESKTOP",
534 "nodewindows",
535 "nofiles",
536 "nofirewall",
537 + "nolog",
538 + "nologout",
539 + "NOMESHCMD",
540 "nominify",
541 "nonalpha",
542 + "NONEWDEVICES",
543 "nonewgroups",
544 + "noproxy",
545 + "noredirect",
546 + "nosniff",
547 "noterminal",
548 "notools",
549 + "nouser",
550 "nousers",
551 "novnc",
552 "npmjs",
553 "npmpath",
554 "npmproxy",
555 "npmtag",
556 + "objid",
557 "ODELAY",
558 "offloader",
559 "offloaders",
560 "oidc",
561 + "oldpassword",
562 + "oldpasswordban",
563 + "oldpasswords",
564 + "oneclickrecovery",
565 + "onlyselecteddevicegroups",
566 + "onlyselectedusers",
567 + "openidconnect",
568 + "openstreetmap",
569 "openurl",
570 "orphanagentuser",
571 "osdesc",
572 "osinfo",
573 + "otpdev",
574 + "otpekey",
575 + "otpemail",
576 "otphkeys",
577 "otpkeys",
578 + "otplib",
579 + "otppush",
580 "otpsecret",
581 + "otpsms",
582 "parentpath",
583 + "passchange",
584 + "passhint",
585 + "passlogin",
586 + "passrequirementstr",
587 + "passtype",
588 "passwordrequirements",
589 + "passwordrequirementsstr",
590 + "pastlogin",
591 + "pathx",
592 + "peinfo",
593 + "phonenumber",
594 "PKCK",
595 "plivo",
596 + "pluginadmin",
597 "plusplus",
598 + "portbind",
599 + "postflight",
600 "poweraction",
601 "powerevents",
602 "Proto",
603 "publicid",
604 + "pushlogin",
605 + "pushrelay",
606 + "pushrelayserver",
607 + "qport",
608 "randompass",
609 "Raritan",
610 "rauth",
611 "rawdata",
612 "rcookie",
613 + "rdpport",
614 "realname",
615 "recordencryptionrecode",
616 "recordpath",
@@ -373,11 +619,21 @@
619 "redirections",
620 "redirport",
621 "redirserver",
622 + "refreshtoken",
623 + "relayaliasport",
624 "relaydns",
625 + "relayid",
626 "relayport",
627 + "relayserver",
628 + "relaysession",
629 + "remembertoken",
630 + "remoteaddr",
631 + "remoteaddrport",
632 + "REMOTECOMMAND",
633 "remotecontrol",
634 "remotefile",
635 "remotepath",
636 + "REMOTEVIEWONLY",
637 "removeallusersfromusergroup",
638 "removedevicegroup",
639 "removedomain",
@@ -392,11 +648,20 @@
648 "removeuserfromusergroup",
649 "removeusergroup",
650 "resetaccount",
651 + "RESETOFF",
652 "resetpass",
653 "responseid",
654 + "restoreserver",
655 "rightsstr",
656 "rname",
657 "rnamel",
658 + "rootcert",
659 + "rootredirect",
660 + "rpassword",
661 + "rpasswordhint",
662 + "rport",
663 + "rtpass",
664 + "rtuser",
665 "runasuser",
666 "runasuseronly",
667 "runcommand",
@@ -404,23 +669,43 @@
669 "runmode",
670 "runonservererror",
671 "runonserverupdated",
672 + "ruserid",
673 + "sameorigin",
674 "selfupdate",
675 + "selfurl",
676 "senderid",
677 "sendgrid",
678 "sendinviteemail",
679 + "serialtunnel",
680 + "SERVERBACKUP",
681 + "serverfeatures",
682 "serverfiles",
683 + "serverhttps",
684 "serverid",
685 + "serveridhex",
686 "serverinfo",
687 "serverkey",
688 "servername",
689 + "servernoproxy",
690 + "serverpath",
691 + "serverpic",
692 + "serverport",
693 + "SERVERRESTORE",
694 + "servertlshash",
695 "serverupdate",
696 "servicename",
697 "servicepath",
698 + "sessioncode",
699 "sessionkey",
700 "sessionrecording",
701 + "sessionsamesite",
702 "sessiontime",
703 + "setbad",
704 + "SETNOTES",
705 "settodomain",
706 + "sftpconnect",
707 "shareid",
708 + "showagents",
709 "showall",
710 "showallmeshes",
711 "showevents",
@@ -428,20 +713,31 @@
713 "showitem",
714 "showmeshes",
715 "shownodes",
716 + "showpasswordlogin",
717 "showpower",
718 "showsmbios",
719 "showusergroups",
720 "showusers",
721 + "showversion",
722 "siteadmin",
723 + "SITERIGHT",
724 "sitestyle",
725 "smsserver",
726 "specificupdate",
727 "splitip",
728 + "splitpath",
729 + "spliturl",
730 "srights",
731 + "sshconnect",
732 + "sshfilesrelay",
733 + "sshport",
734 + "sshrelay",
735 + "sshterminalrelay",
736 "ssid",
737 "sspi",
738 "startack",
739 "statsevents",
740 + "stricttransportsecurity",
741 "Strs",
742 "subdir",
743 "swarmallowedip",
@@ -451,86 +747,171 @@
747 "syslogauth",
748 "syslogjson",
749 "syslogtcp",
750 + "tcpport",
751 "telnyx",
752 + "temail",
753 "tenantid",
754 "terminalnotify",
755 "terminalprompt",
756 "termsize",
757 + "timedoc",
758 + "titleid",
759 "titlepicture",
760 "tkip",
761 "tlscertcheck",
762 + "tlshash",
763 + "tlsock",
764 "tlsoffload",
765 + "tlsoptions",
766 "tlsrootcert",
767 "tlsstrict",
768 + "tmpdl",
769 + "tokenemail",
770 + "tokenlogin",
771 + "tokenpassword",
772 + "tokenpush",
773 "tokenrequired",
774 + "tokensms",
775 + "tokenurl",
776 + "tokenuserid",
777 + "tokenusername",
778 + "totalsize",
779 + "tpass",
780 + "tpassword",
781 + "tpush",
782 "traefik",
783 "translateall",
784 "translationpath",
785 "trustedcert",
786 "trustedproxy",
787 + "tsms",
788 "TTLS",
789 "tunnelws",
790 "tunnelwsstate",
791 + "tuser",
792 + "tuserid",
793 + "tusername",
794 + "twofactor",
795 + "twofactorcookiedurationdays",
796 + "twofactortimeout",
797 "tzoffset",
798 + "uaparser",
799 + "ucookie",
800 "ugroup",
801 "ugroups",
802 "ugrp",
803 "ugrpid",
804 "uicustomevent",
805 "unadmin",
806 + "unknownuserrootredirect",
807 "unsealkey",
808 + "updatefiles",
809 "uploadack",
810 "uploaderror",
811 + "uploadfile",
812 + "uploadfilebatch",
813 + "uploadmeshcorefile",
814 "uploadstart",
815 + "urlpath",
816 + "urlswitching",
817 "useid",
818 "userallowedip",
819 "userblockedip",
820 "userbroadcast",
821 "userconsentflags",
822 "usercount",
823 + "userex",
824 + "userfiles",
825 + "usergroupchange",
826 "usergroups",
827 "userid",
828 "userids",
829 + "userimage",
830 + "userinfourl",
831 "usernameisemail",
832 "userquota",
833 + "userrequiredhttpheader",
834 "Usersessionidletimeout",
835 + "usersid",
836 + "usersplit",
837 "vaultdeleteconfigfiles",
838 "vaultpullconfigfiles",
839 "vaultpushconfigfiles",
840 "verifyemail",
841 "Viewmode",
842 "viewonly",
843 + "WAKEDEVICE",
844 "wakedevices",
845 "Walkthru",
846 "wanonly",
847 + "Webauthn",
848 + "webcerthash",
849 + "webdefault",
850 "webemailspath",
851 + "webider",
852 "webpublicpath",
853 "webpush",
854 + "webrelay",
855 + "webrelaydata",
856 "webrelayserver",
857 + "webrequest",
858 "webrtc",
859 "webrtconfig",
860 "webserver",
861 "websockets",
862 "WEBSSL",
863 + "webstate",
864 "webviewspath",
865 + "WELCOMEMSG",
866 "welcomepicture",
867 + "welcomepicturefullscreen",
868 "welcometext",
869 + "wgetoptionshttp",
870 + "wgetoptionshttps",
871 + "wildleek",
872 + "winassistant",
873 + "winpath",
874 + "winrouter",
875 "winservice",
876 + "wsagents",
877 "wscompression",
878 + "wsrelays",
879 "wssessioncount",
880 "wssessions",
881 + "xarg",
882 + "xbytes",
883 + "xcmd",
884 + "xdomain",
885 "xdomains",
886 "xenv",
887 + "xevents",
888 + "xfile",
889 + "xfilelen",
890 + "xfilepath",
891 + "xflags",
892 + "xforwardedhost",
893 "xinstall",
894 "xjslint",
895 "xmeshes",
896 "xpad",
897 + "xpassword",
898 + "xrelay",
899 "xrestart",
900 + "xstate",
901 + "xtls",
902 + "xtransport",
903 "xuninstall",
904 + "xuserid",
905 + "xusername",
906 + "xxdata",
907 "xxprocess",
908 "xxurl",
909 + "xxuser",
910 "xxxprocess",
911 "Ylian",
534 - "yubikey"
912 + "yubikey",
913 + "yubikeyotp",
914 + "zdata",
915 + "zipfile"
916 ]
917 }
\ No newline at end of file
webserver.js
+21 -21
@@ -199,7 +199,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
199 obj.wsPeerSessions3 = {}; // ServerId --> UserId --> [ SessionId ]
200 obj.sessionsCount = {}; // Merged session counters, used when doing server peering. UserId --> SessionCount
201 obj.wsrelays = {}; // Id -> Relay
202 - obj.desktoprelays = {}; // Id -> Desktop Multiplexor Relay
202 + obj.desktoprelays = {}; // Id -> Desktop Multiplexer Relay
203 obj.wsPeerRelays = {}; // Id -> { ServerId, Time }
204 var tlsSessionStore = {}; // Store TLS session information for quick resume.
205 var tlsSessionStoreCount = 0; // Number of cached TLS session information in store.
@@ -239,7 +239,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
239 for (i in docs) { var u = obj.users[docs[i]._id] = docs[i]; domainUserCount[u.domain]++; }
240 for (i in parent.config.domains) {
241 if ((parent.config.domains[i].share == null) && (domainUserCount[i] == 0)) {
242 - // If newaccounts is set to no new accounts, but no accounts exists, temporarly allow account creation.
242 + // If newaccounts is set to no new accounts, but no accounts exists, temporarily allow account creation.
243 //if ((parent.config.domains[i].newaccounts === 0) || (parent.config.domains[i].newaccounts === false)) { parent.config.domains[i].newaccounts = 2; }
244 console.log('Server ' + ((i == '') ? '' : (i + ' ')) + 'has no users, next new account will be site administrator.');
245 }
@@ -431,7 +431,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
431 if (!user) { fn(new Error('cannot find user')); return; }
432 if ((user.siteadmin) && (user.siteadmin != 0xFFFFFFFF) && (user.siteadmin & 32) != 0) { fn('locked'); return; }
433
434 - // Succesful login token authentication
434 + // Successful login token authentication
435 var loginOptions = { tokenName: loginToken.name, tokenUser: loginToken.tokenUser };
436 if (loginToken.expire != 0) { loginOptions.expire = loginToken.expire; }
437 return fn(null, user._id, null, loginOptions);
@@ -519,9 +519,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
519
520 // Get the email address for this LDAP user
521 var email = null;
522 - if (domain.ldapuseremail) { email = xxuser[domain.ldapuseremail]; } else if (xxuser['mail']) { email = xxuser['mail']; } // Use given feild name or default
522 + if (domain.ldapuseremail) { email = xxuser[domain.ldapuseremail]; } else if (xxuser['mail']) { email = xxuser['mail']; } // Use given field name or default
523 if (Array.isArray(email)) { email = email[0]; } // Mail may be multivalued in LDAP in which case, answer is an array. Use the 1st value.
524 - if (email) { email = email.toLowerCase(); } // it seems some code elsewhere also lowercase the emailaddress, so let's be consistant.
524 + if (email) { email = email.toLowerCase(); } // it seems some code elsewhere also lowercase the emailaddress, so let's be consistent.
525
526 // Get the real name for this LDAP user
527 var realname = null;
@@ -846,7 +846,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
846 function checkUserOneTimePasswordSkip(domain, user, req, loginOptions) {
847 if (parent.config.settings.no2factorauth == true) return null;
848
849 - // If this login occured using a login token, no 2FA needed.
849 + // If this login occurred using a login token, no 2FA needed.
850 if ((loginOptions != null) && (typeof loginOptions.tokenName === 'string')) { return { twoFactorType: 'tokenlogin' }; }
851
852 // Check if we can skip 2nd factor auth because of the source IP address
@@ -859,7 +859,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
859 const cookies = req.headers.cookie.split('; ');
860 for (var i in cookies) {
861 if (cookies[i].startsWith('twofactor=')) {
862 - var twoFactorCookie = obj.parent.decodeCookie(decodeURIComponent(cookies[i].substring(10)), obj.parent.loginCookieEncryptionKey, (30 * 24 * 60)); // If the cookies does not have an expire feild, assume 30 day timeout.
862 + var twoFactorCookie = obj.parent.decodeCookie(decodeURIComponent(cookies[i].substring(10)), obj.parent.loginCookieEncryptionKey, (30 * 24 * 60)); // If the cookies does not have an expire field, assume 30 day timeout.
863 if ((twoFactorCookie != null) && ((twoFactorCookie.ip == null) || checkCookieIp(twoFactorCookie.ip, req.clientIp)) && (twoFactorCookie.userid == user._id)) { return { twoFactorType: 'cookie' }; }
864 }
865 }
@@ -870,7 +870,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
870
871 // Return true if this user has 2-step auth active
872 function checkUserOneTimePasswordRequired(domain, user, req, loginOptions) {
873 - // If this login occured using a login token, no 2FA needed.
873 + // If this login occurred using a login token, no 2FA needed.
874 if ((loginOptions != null) && (typeof loginOptions.tokenName === 'string')) { return false; }
875
876 // Check if we can skip 2nd factor auth because of the source IP address
@@ -883,7 +883,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
883 const cookies = req.headers.cookie.split('; ');
884 for (var i in cookies) {
885 if (cookies[i].startsWith('twofactor=')) {
886 - var twoFactorCookie = obj.parent.decodeCookie(decodeURIComponent(cookies[i].substring(10)), obj.parent.loginCookieEncryptionKey, (30 * 24 * 60)); // If the cookies does not have an expire feild, assume 30 day timeout.
886 + var twoFactorCookie = obj.parent.decodeCookie(decodeURIComponent(cookies[i].substring(10)), obj.parent.loginCookieEncryptionKey, (30 * 24 * 60)); // If the cookies does not have an expire field, assume 30 day timeout.
887 if ((twoFactorCookie != null) && ((twoFactorCookie.ip == null) || checkCookieIp(twoFactorCookie.ip, req.clientIp)) && (twoFactorCookie.userid == user._id)) { return false; }
888 }
889 }
@@ -910,7 +910,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
910
911 // Check 2FA login cookie
912 if ((token != null) && (token.startsWith('cookie='))) {
913 - var twoFactorCookie = obj.parent.decodeCookie(decodeURIComponent(token.substring(7)), obj.parent.loginCookieEncryptionKey, (30 * 24 * 60)); // If the cookies does not have an expire feild, assume 30 day timeout.
913 + var twoFactorCookie = obj.parent.decodeCookie(decodeURIComponent(token.substring(7)), obj.parent.loginCookieEncryptionKey, (30 * 24 * 60)); // If the cookies does not have an expire field, assume 30 day timeout.
914 if ((twoFactorCookie != null) && ((twoFactorCookie.ip == null) || checkCookieIp(twoFactorCookie.ip, req.clientIp)) && (twoFactorCookie.userid == user._id)) { func(true, { twoFactorType: 'cookie' }); return; }
915 }
916
@@ -1863,7 +1863,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
1863 // Check is email already exists
1864 obj.db.GetUserWithVerifiedEmail(domain.id, email, function (err, docs) {
1865 if ((err != null) || ((docs.length > 0) && (docs.find(function (u) { return (u._id === req.session.cuserid); }) < 0))) {
1866 - // Email already exitst
1866 + // Email already exists
1867 req.session.messageid = 102; // Existing account with this email address.
1868 } else {
1869 // Update the user and notify of user email address change
@@ -2515,8 +2515,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
2515 });
2516 }
2517
2518 - // Called when a strategy login occured
2519 - // This is called after a succesful Oauth to Twitter, Google, GitHub...
2518 + // Called when a strategy login occurred
2519 + // This is called after a successful Oauth to Twitter, Google, GitHub...
2520 function handleStrategyLogin(req, res) {
2521 const domain = checkUserIpAddress(req, res);
2522 const authStrategy = req.user.strategy
@@ -2817,7 +2817,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
2817 setSessionRandom(req);
2818 } else if (req.query.login && (obj.parent.loginCookieEncryptionKey != null)) {
2819 var loginCookie = obj.parent.decodeCookie(req.query.login, obj.parent.loginCookieEncryptionKey, 60); // 60 minute timeout
2820 - //if ((loginCookie != null) && (loginCookie.ip != null) && !checkCookieIp(loginCookie.ip, req.clientIp)) { loginCookie = null; } // If the cookie if binded to an IP address, check here.
2820 + //if ((loginCookie != null) && (loginCookie.ip != null) && !checkCookieIp(loginCookie.ip, req.clientIp)) { loginCookie = null; } // If the cookie is bound to an IP address, check here.
2821 if ((loginCookie != null) && (loginCookie.a == 3) && (loginCookie.u != null) && (loginCookie.u.split('/')[1] == domain.id)) {
2822 // If a login cookie was provided, setup the session here.
2823 parent.debug('web', 'handleRootRequestEx: cookie auth ok.');
@@ -3942,7 +3942,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
3942 if ((err != null) || (docs == null) || (docs.length != 1)) { res.sendStatus(404); return; }
3943 const doc = docs[0];
3944
3945 - // If this is a recurrent share, check if we are at the currect time to make use of it
3945 + // If this is a recurrent share, check if we are at the correct time to make use of it
3946 if (typeof doc.recurring == 'number') {
3947 const now = Date.now();
3948 if (now >= doc.startTime) { // We don't want to move the validity window before the start time
@@ -4567,7 +4567,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
4567 tlsock.setEncoding('binary');
4568 tlsock.on('error', function (err) { parent.debug('webrelay', "CIRA TLS Connection Error", err); });
4569
4570 - // Decrypted tunnel from TLS communcation to be forwarded to websocket
4570 + // Decrypted tunnel from TLS communication to be forwarded to websocket
4571 tlsock.on('data', function (data) {
4572 // AMT/TLS ---> WS
4573 if (ws.interceptor) { data = ws.interceptor.processAmtData(data); } // Run data thru interceptor
@@ -4615,7 +4615,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
4615 ws.forwardclient.onData = function (ciraconn, data) {
4616 //parent.debug('webrelaydata', 'Relay CIRA data to WS', data.length);
4617
4618 - // Run data thru interceptorp
4618 + // Run data thru interceptor
4619 if (ws.interceptor) { data = ws.interceptor.processAmtData(data); }
4620
4621 //console.log('AMT --> WS', Buffer.from(data, 'binary').toString('hex'));
@@ -4633,7 +4633,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
4633 ws.forwardclient.onSendOk = function (ciraconn) { };
4634 }
4635
4636 - // When data is received from the web socket, forward the data into the associated CIRA cahnnel.
4636 + // When data is received from the web socket, forward the data into the associated CIRA channel.
4637 // If the CIRA connection is pending, the CIRA channel has built-in buffering, so we are ok sending anyway.
4638 ws.on('message', function (data) {
4639 //parent.debug('webrelaydata', 'Relay WS data to CIRA', data.length);
@@ -6703,7 +6703,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
6703 const urlCookie = obj.parent.decodeCookie(req.query.c, parent.loginCookieEncryptionKey, 32); // Allow cookies up to 32 minutes old. The web page will renew this cookie every 30 minutes.
6704 if (urlCookie == null) { res.sendStatus(404); return; }
6705
6706 - // Decode the incomign cookie
6706 + // Decode the incoming cookie
6707 if ((urlCookie.ruserid != null) && (urlCookie.x != null)) {
6708 if (parent.webserver.destroyedSessions[urlCookie.ruserid + '/' + urlCookie.x] != null) { res.sendStatus(404); return; }
6709
@@ -6853,7 +6853,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
6853
6854 // Indicates to ExpressJS that the override public folder should be used to serve static files.
6855 if (parent.config.domains[i].webpublicpath != null) {
6856 - // Use domain public pathe
6856 + // Use domain public path
6857 obj.app.use(url, obj.express.static(parent.config.domains[i].webpublicpath));
6858 } else if (obj.parent.webPublicOverridePath != null) {
6859 // Use override path
@@ -7154,7 +7154,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
7154 // The web relay session is valid, use it
7155 relaySession.handleRequest(req, res);
7156 } else {
7157 - // No web relay ession with this relay identifier, close the HTTP request.
7157 + // No web relay session with this relay identifier, close the HTTP request.
7158 res.sendStatus(404);
7159 }
7160 } else {