Compare commits
15 Commits
a53ac10daa
...
5f6ba4a480
Author | SHA1 | Date |
---|---|---|
dependabot[bot] | 5f6ba4a480 | |
adnan29979 | 3ce2fd92c0 | |
adnan29979 | eb27334b82 | |
si458 | 414d9b9561 | |
si458 | 1747ff7550 | |
si458 | f39b6f8859 | |
Simon Smith | ca868afdd1 | |
Simon Smith | 410c84c30b | |
Attocode1 | 18b731fd36 | |
si458 | 832e618602 | |
si458 | 7b8cf85740 | |
si458 | 1dca9e2235 | |
Simon Smith | 30d570f28b | |
si458 | f854c80421 | |
dependabot[bot] | 83af487168 |
38
db.js
38
db.js
|
@ -733,22 +733,34 @@ module.exports.CreateDB = function (parent, func) {
|
|||
});
|
||||
} else if (parent.args.mariadb || parent.args.mysql) {
|
||||
var connectinArgs = (parent.args.mariadb) ? parent.args.mariadb : parent.args.mysql;
|
||||
var dbname = (connectinArgs.database != null) ? connectinArgs.database : 'meshcentral';
|
||||
if (typeof connectinArgs == 'string') {
|
||||
const parts = connectinArgs.split(/[:@/]+/);
|
||||
var connectionObject = {
|
||||
"user": parts[1],
|
||||
"password": parts[2],
|
||||
"host": parts[3],
|
||||
"port": parts[4],
|
||||
"database": parts[5]
|
||||
};
|
||||
var dbname = (connectionObject.database != null) ? connectionObject.database : 'meshcentral';
|
||||
} else {
|
||||
var dbname = (connectinArgs.database != null) ? connectinArgs.database : 'meshcentral';
|
||||
|
||||
// Including the db name in the connection obj will cause a connection faliure if it does not exist
|
||||
var connectionObject = Clone(connectinArgs);
|
||||
delete connectionObject.database;
|
||||
// Including the db name in the connection obj will cause a connection faliure if it does not exist
|
||||
var connectionObject = Clone(connectinArgs);
|
||||
delete connectionObject.database;
|
||||
|
||||
try {
|
||||
if (connectinArgs.ssl) {
|
||||
if (connectinArgs.ssl.dontcheckserveridentity == true) { connectionObject.ssl.checkServerIdentity = function (name, cert) { return undefined; } };
|
||||
if (connectinArgs.ssl.cacertpath) { connectionObject.ssl.ca = [require('fs').readFileSync(connectinArgs.ssl.cacertpath, 'utf8')]; }
|
||||
if (connectinArgs.ssl.clientcertpath) { connectionObject.ssl.cert = [require('fs').readFileSync(connectinArgs.ssl.clientcertpath, 'utf8')]; }
|
||||
if (connectinArgs.ssl.clientkeypath) { connectionObject.ssl.key = [require('fs').readFileSync(connectinArgs.ssl.clientkeypath, 'utf8')]; }
|
||||
try {
|
||||
if (connectinArgs.ssl) {
|
||||
if (connectinArgs.ssl.dontcheckserveridentity == true) { connectionObject.ssl.checkServerIdentity = function (name, cert) { return undefined; } };
|
||||
if (connectinArgs.ssl.cacertpath) { connectionObject.ssl.ca = [require('fs').readFileSync(connectinArgs.ssl.cacertpath, 'utf8')]; }
|
||||
if (connectinArgs.ssl.clientcertpath) { connectionObject.ssl.cert = [require('fs').readFileSync(connectinArgs.ssl.clientcertpath, 'utf8')]; }
|
||||
if (connectinArgs.ssl.clientkeypath) { connectionObject.ssl.key = [require('fs').readFileSync(connectinArgs.ssl.clientkeypath, 'utf8')]; }
|
||||
}
|
||||
} catch (ex) {
|
||||
console.log('Error loading SQL Connector certificate: ' + ex);
|
||||
process.exit();
|
||||
}
|
||||
} catch (ex) {
|
||||
console.log('Error loading SQL Connector certificate: ' + ex);
|
||||
process.exit();
|
||||
}
|
||||
|
||||
if (parent.args.mariadb) {
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -0,0 +1,56 @@
|
|||
# Contribute to MeshCentral
|
||||
|
||||
## Contributing to MeshCentral via GitHub Pull Request
|
||||
|
||||
If you're looking to contribute beyond translations, such as updating documentation or enhancing the software by adding features or fixing bugs, the process involves several key steps:
|
||||
|
||||
1. **Fork the Repository:** Start by forking the [MeshCentral](https://github.com/Ylianst/MeshCentral) repository on GitHub. This creates a copy of the repository under your own GitHub account, allowing you to make changes without affecting the original project.
|
||||
|
||||
2. **Make Your Changes**
|
||||
- In your forked repository, create a new branch to keep your changes organized. This helps in managing different contributions separately.
|
||||
- Make the necessary changes in your repository. This could involve updating documentation files or modifying code to add new features or fix bugs.
|
||||
|
||||
3. **Review Your Changes:** Before submitting your work, carefully review the changes you’ve made. Check the "Files Changed" section on GitHub to ensure that all modifications are intended and correctly implemented.
|
||||
|
||||
4. **Submit a Pull Request**
|
||||
- Once your changes are ready and reviewed, submit a pull request (PR) from your branch to the `master` branch of the main MeshCentral repository.
|
||||
- When creating the pull request, provide a clear and detailed description of what changes have been made and why. This helps maintainers understand the purpose of your contributions.
|
||||
|
||||
5. **Wait for Review:** After submitting your pull request, wait for a project maintainer to review your contribution. Review time can vary depending on the complexity of the changes and the availability of the maintainers.
|
||||
|
||||
6. **Respond to Feedback:** The maintainer may request further modifications or provide feedback on your pull request. Be prepared to make additional changes based on their suggestions to ensure that your contribution meets the project’s standards and requirements.
|
||||
|
||||
7. **Final Steps:** Once your pull request is approved and merged by a maintainer, your contributions will be incorporated into the MeshCentral project. Congratulations, and thank you for helping improve MeshCentral!
|
||||
|
||||
---
|
||||
|
||||
## Contribute to MeshCentral's Multilingual Support
|
||||
|
||||
To make MeshCentral multilingual, your contributions are crucial. Follow these steps to translate the interface into various languages.
|
||||
|
||||
1. **Remove Local Translations:** Delete `translate.json` from your `meshcentral-data` folder. This file contains your local copy of translations, which may become outdated as new features and texts are added.
|
||||
|
||||
2. **Access MeshCentral:** Ensure you are logged into MeshCentral.
|
||||
3. **Open Translation Tool:** Visit `https://YOURMESHCENTRALSERVER.COM/translator.htm` to access the translation interface.
|
||||
4. **Choose a Language:** Select the language you wish to translate from the list provided.
|
||||
|
||||
5. **Translate Text:** Use the search function or scroll through the list to find text segments you want to translate. Utilize the "show no translations only" checkbox to filter untranslated texts.
|
||||
6. **Enter Translations:** For each text segment, enter your translation in the bottom box (not the top one) and click `SET (F1)`.
|
||||
7. **Repeat Translation:** Continue translating by repeating steps 5 and 6 for other texts as desired.
|
||||
|
||||
8. **Save and Apply Translations**
|
||||
- Click `SAVE TO SERVER (F3)` to save your translations to `meshcentral-data/translate.json` locally in your MeshCentral server.
|
||||
- Optionally, click `SAVE TO FILE (F4)` to download the `translate.json` file for offline review or sharing.
|
||||
|
||||
9. **Deploy Translations:** Click `TRANSLATE SERVER` and allow some time for the process to complete (approximately 5-15 minutes depending on server specifications). This command line output will indicate when the translation is complete.
|
||||
![](images/translation-msg-output.png)
|
||||
|
||||
10. **Finalize Changes:** It’s crucial to restart MeshCentral to ensure that the translated files are picked up correctly.
|
||||
11. **Share your translations:** Once a language translation is complete, take the latest `translation.json` and share it by emailing it to the maintainer (Ylianst, `ylianst@gmail.com`) or by submitting it to the MeshCentral GitHub repository via a pull request.
|
||||
|
||||
---
|
||||
|
||||
#### Additional Information:
|
||||
- If you make any changes to `default.handlebars`, run the translate server to propagate these modifications to the language-specific handlebar files located in `node_modules/meshcentral/views/translations`.
|
||||
|
||||
By following these steps, you help MeshCentral support any language you choose, making it more accessible worldwide. By sharing your translations with us, you also help make these languages available to other users, improving the community and extending the software's reach.
|
|
@ -895,7 +895,7 @@ The last line will run MeshCentral manually and allow it to install any missing
|
|||
|
||||
```
|
||||
sudo chown -R meshcentral:meshcentral /opt/meshcentral
|
||||
sudo chmod 755 –R /opt/meshcentral/meshcentral-*
|
||||
sudo chmod -R 755 /opt/meshcentral/meshcentral-*
|
||||
```
|
||||
|
||||
To make this work, you will need to make MeshCentral work with MongoDB because the /meshcentral-data folder will be read-only. In addition, MeshCentral will not be able to update itself since the account does not have write access to the /node_modules files, so the update will have to be manual. First used systemctl to stop the MeshCentral server process, than use this:
|
||||
|
@ -912,7 +912,7 @@ This will perform the update to the latest server on NPM and re-set the permissi
|
|||
MeshCentral allows users to upload and download files stores in the server’s `meshcentral-files` folder. In an increased security setup, we still want the server to be able to read and write files to this folder and we can allow this with:
|
||||
|
||||
```
|
||||
sudo chmod 755 –R /opt/meshcentral/meshcentral-files
|
||||
sudo chmod -R 755 /opt/meshcentral/meshcentral-files
|
||||
```
|
||||
|
||||
If you plan on using the increased security installation along with MeshCentral built-in Let’s Encrypt support you will need to type the following commands to make the `letsencrypt` folder in `meshcentral-data` writable.
|
||||
|
@ -920,7 +920,7 @@ If you plan on using the increased security installation along with MeshCentral
|
|||
```
|
||||
sudo mkdir /opt/meshcentral/meshcentral-data
|
||||
sudo mkdir /opt/meshcentral/meshcentral-data/letsencrypt
|
||||
sudo chmod 755 –R /opt/meshcentral/meshcentral-data/letsencrypt
|
||||
sudo chmod -R 755 /opt/meshcentral/meshcentral-data/letsencrypt
|
||||
```
|
||||
|
||||
This will allow the server to get and periodically update its Let’s Encrypt certificate. If this is not done, the server will generate an `ACCES: permission denied` exception.
|
||||
|
|
|
@ -317,7 +317,12 @@ The password recovery flow when “Reset Account” is triggered at the login pa
|
|||
|
||||
![](images/2022-05-19-00-00-18.png)
|
||||
|
||||
Both account verification and password recovery are triggered automatically once SMTP mail server configuration is included into the config.json file. Update the config.json with “smtp” section as shown below and restart the server.
|
||||
Both account verification and password recovery are triggered automatically once SMTP mail server configuration is included into the config.json file.
|
||||
|
||||
#### SMTP: User/Pass
|
||||
##### Normal Server
|
||||
|
||||
Update the config.json with “smtp” section as shown below and restart the server.
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -325,9 +330,9 @@ Both account verification and password recovery are triggered automatically once
|
|||
"host": "smtp.server.com",
|
||||
"port": 25,
|
||||
"from": "myaddress@server.com",
|
||||
"user": "myaddress@server.com", Optional
|
||||
"pass": "mypassword", Optional
|
||||
"tls": false Optional, default false
|
||||
"user": "myaddress@server.com", # Optional
|
||||
"pass": "mypassword", # Optional
|
||||
"tls": false # Optional, default false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -336,7 +341,6 @@ Please map the host, port values to connect to the right host that provides this
|
|||
|
||||
Some SMTP servers will require a valid username and password to login to the mail server. This is to prevent unauthorized e-mail correspondence. TLS option can be set to ‘true’ if the SMTP server requires TLS.
|
||||
|
||||
#### SMTP: User/Pass
|
||||
##### Gmail
|
||||
|
||||
One option is to configure MeshCentral work with Google Gmail by setting “host” with smtp.gmail.com, and “port” with 587. In the config.json file, use user’s Gmail address for both “from” and “user” and Gmail password in the “pass” value. You will also need to enable “Less secure app access” in for this Google account. It’s in the account settings, security section:
|
||||
|
@ -548,14 +552,14 @@ To make this happen, we will be using the following command line options from Me
|
|||
| --dblistconfigfiles | List the names and size of all configuration files in the database. |
|
||||
| --dbshowconfigfile (filename) | Show the content of a specified filename from the database. --configkey is required. |
|
||||
| --dbdeleteconfigfiles | Delete all configuration files from the database. |
|
||||
| --dbpushconfigfiles (*) or (folder path) | Push a set of configuration files into the database, removing any existing files in the process. When * is specified, the “meshcentral-data” folder up pushed into the database. --configkey is required. |
|
||||
| --dbpushconfigfiles '*' or (folder path) | Push a set of configuration files into the database, removing any existing files in the process. When * is specified, the “meshcentral-data” folder up pushed into the database. --configkey is required. |
|
||||
| --dbpullconfigfiles (folder path) | Get all of the configuration files from the database and place them in the specified folder. Files in the target folder may be overwritten. --configkey is required. |
|
||||
| --loadconfigfromdb (key) | Runs MeshCentral server using the configuration files found in the database. The configkey may be specified with this command or --configkey can be used. |
|
||||
|
||||
Once we have MeshCentral running as expected using the “meshcentral-data” folder, we can simply push that configuration into the database and run using the database alone like this:
|
||||
|
||||
```
|
||||
node ./node_modules/meshcentral --dbpushconfigfiles * --configkey mypassword
|
||||
node ./node_modules/meshcentral --dbpushconfigfiles '*' --configkey mypassword
|
||||
|
||||
node ./node_modules/meshcentral --loadconfigfromdb mypassword --mongodb "mongodb://127.0.0.1:27017/meshcentral"
|
||||
```
|
||||
|
|
|
@ -38,6 +38,9 @@ nav:
|
|||
- Intel AMT:
|
||||
- intelamt/index.md
|
||||
|
||||
- How to Contribute:
|
||||
- how-to-contribute/index.md
|
||||
|
||||
- Other:
|
||||
- other/adfs_sso_guide.md
|
||||
- other/meshcentral_satellite.md
|
||||
|
|
|
@ -2677,7 +2677,7 @@
|
|||
"name": {
|
||||
"type": "string",
|
||||
"format": "hostname",
|
||||
"description": "Optional hostname of the client, this defaults to the hostname of the machine. This is useful for SMTP relays."
|
||||
"description": "Optional hostname of the client, this defaults to the hostname of the machine. This is useful for SMTP relays. This can also be set to \"console\" for console output debugging."
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
|
@ -2688,18 +2688,32 @@
|
|||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 65535,
|
||||
"description": "SMTP server port number."
|
||||
"default": 587,
|
||||
"description": "SMTP server port number. This defaults to 587 if \"tls\" is false or 465 if \"tls\" is true)"
|
||||
},
|
||||
"from": {
|
||||
"type": "string",
|
||||
"format": "email",
|
||||
"description": "Email address used in the messages from field."
|
||||
},
|
||||
"user": {
|
||||
"type": "string",
|
||||
"format": "string",
|
||||
"description": "SMTP username."
|
||||
},
|
||||
"pass": {
|
||||
"type": "string",
|
||||
"format": "string",
|
||||
"description": "SMTP password."
|
||||
},
|
||||
"tls": {
|
||||
"type": "boolean"
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Set SMTP to use TLS on connections, the default is false"
|
||||
},
|
||||
"auth": {
|
||||
"type": "object",
|
||||
"description": "This is used for OAuth2 authentication",
|
||||
"properties": {
|
||||
"clientId": {
|
||||
"type": "string"
|
||||
|
@ -2709,6 +2723,11 @@
|
|||
},
|
||||
"refreshToken": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"default": "login",
|
||||
"description": "Setting this indicates the authetication type, 'login' as default or 'oauth2'"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -2735,7 +2754,10 @@
|
|||
}
|
||||
},
|
||||
"required": [
|
||||
"from"
|
||||
"host",
|
||||
"port",
|
||||
"from",
|
||||
"tls"
|
||||
]
|
||||
},
|
||||
"sendmail": {
|
||||
|
@ -3558,22 +3580,67 @@
|
|||
"description": "Connects MeshCentral to a SMTP email server, allows MeshCentral to send email messages for 2FA or user notification.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"format": "hostname",
|
||||
"description": "Optional hostname of the client, this defaults to the hostname of the machine. This is useful for SMTP relays. This can also be set to \"console\" for console output debugging."
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"format": "hostname"
|
||||
"format": "hostname",
|
||||
"description": "Hostname of the SMTP server."
|
||||
},
|
||||
"port": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 65535
|
||||
"maximum": 65535,
|
||||
"default": 587,
|
||||
"description": "SMTP server port number. This defaults to 587 if \"tls\" is false or 465 if \"tls\" is true)"
|
||||
},
|
||||
"from": {
|
||||
"type": "string",
|
||||
"format": "email",
|
||||
"description": "Email address used in the messages from field."
|
||||
},
|
||||
"user": {
|
||||
"type": "string",
|
||||
"format": "string",
|
||||
"description": "SMTP username."
|
||||
},
|
||||
"pass": {
|
||||
"type": "string",
|
||||
"format": "string",
|
||||
"description": "SMTP password."
|
||||
},
|
||||
"tls": {
|
||||
"type": "boolean"
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Set SMTP to use TLS on connections, the default is false"
|
||||
},
|
||||
"auth": {
|
||||
"type": "object",
|
||||
"description": "This is used for OAuth2 authentication",
|
||||
"properties": {
|
||||
"clientId": {
|
||||
"type": "string"
|
||||
},
|
||||
"clientSecret": {
|
||||
"type": "string"
|
||||
},
|
||||
"refreshToken": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"default": "login",
|
||||
"description": "Setting this indicates the authetication type, 'login' as default or 'oauth2'"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"clientId",
|
||||
"clientSecret",
|
||||
"refreshToken"
|
||||
]
|
||||
},
|
||||
"tlscertcheck": {
|
||||
"type": "boolean"
|
||||
|
@ -3585,6 +3652,11 @@
|
|||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "When set to false, the email format and DNS MX record are not checked."
|
||||
},
|
||||
"emailDelaySeconds": {
|
||||
"type": "integer",
|
||||
"default": 300,
|
||||
"description": "Time to wait before sending a device connection/disconnection notification email. If many events occur, they will be merged into a single email."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -3594,6 +3666,36 @@
|
|||
"tls"
|
||||
]
|
||||
},
|
||||
"sendmail": {
|
||||
"title": "Send email using the sendmail command",
|
||||
"description": "Makes MeshCentral send emails using the Unix sendmail command. Allows MeshCentral to send email messages for 2FA or user notification.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"newline": {
|
||||
"type": "string",
|
||||
"default": "unix",
|
||||
"description": "Possible values are unix or windows"
|
||||
},
|
||||
"path": {
|
||||
"type": "string",
|
||||
"default": "sendmail",
|
||||
"description": "Path to the sendmail command"
|
||||
},
|
||||
"args": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": null,
|
||||
"description": "Array or arguments to pass to sendmail"
|
||||
},
|
||||
"emailDelaySeconds": {
|
||||
"type": "integer",
|
||||
"default": 300,
|
||||
"description": "Time to wait before sending a device connection/disconnection notification email. If many events occur, they will be merged into a single email."
|
||||
}
|
||||
}
|
||||
},
|
||||
"sms": {
|
||||
"title": "SMS provider",
|
||||
"description": "Connects MeshCentral to a SMS text messaging provider, allows MeshCentral to send SMS messages for 2FA or user notification.",
|
||||
|
|
|
@ -139,9 +139,11 @@ function CreateMeshCentralServer(config, args) {
|
|||
try { require('./pass').hash('test', function () { }, 0); } catch (ex) { console.log('Old version of node, must upgrade.'); return; } // TODO: Not sure if this test works or not.
|
||||
|
||||
// Check for invalid arguments
|
||||
const validArguments = ['_', 'user', 'port', 'aliasport', 'mpsport', 'mpsaliasport', 'redirport', 'rediraliasport', 'cert', 'mpscert', 'deletedomain', 'deletedefaultdomain', 'showall', 'showusers', 'showitem', 'listuserids', 'showusergroups', 'shownodes', 'showallmeshes', 'showmeshes', 'showevents', 'showsmbios', 'showpower', 'clearpower', 'showiplocations', 'help', 'exactports', 'xinstall', 'xuninstall', 'install', 'uninstall', 'start', 'stop', 'restart', 'debug', 'filespath', 'datapath', 'noagentupdate', 'launch', 'noserverbackup', 'mongodb', 'mongodbcol', 'wanonly', 'lanonly', 'nousers', 'mpspass', 'ciralocalfqdn', 'dbexport', 'dbexportmin', 'dbimport', 'dbmerge', 'dbfix', 'dbencryptkey', 'selfupdate', 'tlsoffload', 'usenodedefaulttlsciphers', 'tlsciphers', 'userallowedip', 'userblockedip', 'swarmallowedip', 'agentallowedip', 'agentblockedip', 'fastcert', 'swarmport', 'logintoken', 'logintokenkey', 'logintokengen', 'mailtokengen', 'admin', 'unadmin', 'sessionkey', 'sessiontime', 'minify', 'minifycore', 'dblistconfigfiles', 'dbshowconfigfile', 'dbpushconfigfiles', 'dbpullconfigfiles', 'dbdeleteconfigfiles', 'vaultpushconfigfiles', 'vaultpullconfigfiles', 'vaultdeleteconfigfiles', 'configkey', 'loadconfigfromdb', 'npmpath', 'serverid', 'recordencryptionrecode', 'vault', 'token', 'unsealkey', 'name', 'log', 'dbstats', 'translate', 'createaccount', 'setuptelegram', 'resetaccount', 'pass', 'removesubdomain', 'adminaccount', 'domain', 'email', 'configfile', 'maintenancemode', 'nedbtodb', 'removetestagents', 'agentupdatetest', 'hashpassword', 'hashpass', 'indexmcrec', 'mpsdebug', 'dumpcores', 'dev'];
|
||||
const validArguments = ['_', 'user', 'port', 'aliasport', 'mpsport', 'mpsaliasport', 'redirport', 'rediraliasport', 'cert', 'mpscert', 'deletedomain', 'deletedefaultdomain', 'showall', 'showusers', 'showitem', 'listuserids', 'showusergroups', 'shownodes', 'showallmeshes', 'showmeshes', 'showevents', 'showsmbios', 'showpower', 'clearpower', 'showiplocations', 'help', 'exactports', 'xinstall', 'xuninstall', 'install', 'uninstall', 'start', 'stop', 'restart', 'debug', 'filespath', 'datapath', 'noagentupdate', 'launch', 'noserverbackup', 'mongodb', 'mongodbcol', 'wanonly', 'lanonly', 'nousers', 'mpspass', 'ciralocalfqdn', 'dbexport', 'dbexportmin', 'dbimport', 'dbmerge', 'dbfix', 'dbencryptkey', 'selfupdate', 'tlsoffload', 'usenodedefaulttlsciphers', 'tlsciphers', 'userallowedip', 'userblockedip', 'swarmallowedip', 'agentallowedip', 'agentblockedip', 'fastcert', 'swarmport', 'logintoken', 'logintokenkey', 'logintokengen', 'mailtokengen', 'admin', 'unadmin', 'sessionkey', 'sessiontime', 'minify', 'minifycore', 'dblistconfigfiles', 'dbshowconfigfile', 'dbpushconfigfiles', 'dbpullconfigfiles', 'dbdeleteconfigfiles', 'vaultpushconfigfiles', 'vaultpullconfigfiles', 'vaultdeleteconfigfiles', 'configkey', 'loadconfigfromdb', 'npmpath', 'serverid', 'recordencryptionrecode', 'vault', 'token', 'unsealkey', 'name', 'log', 'dbstats', 'translate', 'createaccount', 'setuptelegram', 'resetaccount', 'pass', 'removesubdomain', 'adminaccount', 'domain', 'email', 'configfile', 'maintenancemode', 'nedbtodb', 'removetestagents', 'agentupdatetest', 'hashpassword', 'hashpass', 'indexmcrec', 'mpsdebug', 'dumpcores', 'dev', 'mysql', 'mariadb'];
|
||||
for (var arg in obj.args) { obj.args[arg.toLocaleLowerCase()] = obj.args[arg]; if (validArguments.indexOf(arg.toLocaleLowerCase()) == -1) { console.log('Invalid argument "' + arg + '", use --help.'); return; } }
|
||||
if (obj.args.mongodb == true) { console.log('Must specify: --mongodb [connectionstring] \r\nSee https://docs.mongodb.com/manual/reference/connection-string/ for MongoDB connection string.'); return; }
|
||||
if (obj.args.mysql == true) { console.log('Must specify: --mysql [connectionstring] \r\nExample mysql://user:password@127.0.0.1:3306/database'); return; }
|
||||
if (obj.args.mariadb == true) { console.log('Must specify: --mariadb [connectionstring] \r\nExample mariadb://user:password@127.0.0.1:3306/database'); return; }
|
||||
for (i in obj.config.settings) { obj.args[i] = obj.config.settings[i]; } // Place all settings into arguments, arguments have already been placed into settings so arguments take precedence.
|
||||
|
||||
if ((obj.args.help == true) || (obj.args['?'] == true)) {
|
||||
|
@ -220,6 +222,12 @@ function CreateMeshCentralServer(config, args) {
|
|||
translateEngine.startEx(['', '', 'translateall', translationFile]);
|
||||
translateEngine.startEx(['', '', 'extractall', translationFile]);
|
||||
didSomething = true;
|
||||
} else {
|
||||
// Translate all of the default files
|
||||
translateEngine.startEx(['', '', 'minifyall']);
|
||||
translateEngine.startEx(['', '', 'translateall']);
|
||||
translateEngine.startEx(['', '', 'extractall']);
|
||||
didSomething = true;
|
||||
}
|
||||
|
||||
// Check if "meshcentral-web" exists, if so, translate all pages in that folder.
|
||||
|
@ -235,11 +243,34 @@ function CreateMeshCentralServer(config, args) {
|
|||
files = obj.fs.readdirSync(obj.webViewsOverridePath);
|
||||
for (var i in files) {
|
||||
var file = obj.path.join(obj.webViewsOverridePath, files[i]);
|
||||
if (file.endsWith('.handlebars') || file.endsWith('-min.handlebars')) {
|
||||
if (file.endsWith('.handlebars') && !file.endsWith('-min.handlebars')) {
|
||||
translateEngine.startEx(['', '', 'translate', '*', translationFile, file, '--subdir:translations']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check domains and see if "meshcentral-web-DOMAIN" exists, if so, translate all pages in that folder
|
||||
for (i in obj.config.domains) {
|
||||
if (i == "") continue;
|
||||
var path = obj.path.join(obj.datapath, '..', 'meshcentral-web-' + i, 'views');
|
||||
if (require('fs').existsSync(path)) {
|
||||
didSomething = true;
|
||||
var files = obj.fs.readdirSync(path);
|
||||
for (var a in files) {
|
||||
var file = obj.path.join(path, files[a]);
|
||||
if (file.endsWith('.handlebars') && !file.endsWith('-min.handlebars')) {
|
||||
translateEngine.startEx(['', '', 'minify', file]);
|
||||
}
|
||||
}
|
||||
files = obj.fs.readdirSync(path);
|
||||
for (var a in files) {
|
||||
var file = obj.path.join(path, files[a]);
|
||||
if (file.endsWith('.handlebars') && !file.endsWith('-min.handlebars')) {
|
||||
translateEngine.startEx(['', '', 'translate', '*', translationFile, file, '--subdir:translations']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (obj.webPublicOverridePath != null) {
|
||||
didSomething = true;
|
||||
|
@ -254,6 +285,7 @@ function CreateMeshCentralServer(config, args) {
|
|||
*/
|
||||
|
||||
if (didSomething == false) { console.log("Nothing to do."); }
|
||||
console.log('Finished Translating.')
|
||||
process.exit();
|
||||
return;
|
||||
}
|
||||
|
@ -4012,6 +4044,7 @@ function mainStart() {
|
|||
|| ((Math.floor(nodeVersion) == 14) && (nodeVersion >= 14.15))
|
||||
|| ((Math.floor(nodeVersion) == 12) && (nodeVersion >= 12.19))) {
|
||||
passport.push('openid-client');
|
||||
passport.push('connect-flash');
|
||||
} else {
|
||||
addServerWarning('This NodeJS version does not support OpenID Connect on MeshCentral.', 25);
|
||||
delete config.domains[i].authstrategies.oidc;
|
||||
|
|
|
@ -1117,7 +1117,7 @@ function performConfigOperations(args) {
|
|||
if (fs.existsSync(configFile) == false) { console.log("Unable to find config.json."); return; }
|
||||
var config = null;
|
||||
try { config = fs.readFileSync(configFile).toString('utf8'); } catch (ex) { console.log("Error: Unable to read config.json"); return; }
|
||||
try { config = require(configFile); } catch (e) { console.log('ERROR: Unable to parse ' + configFilePath + '.'); return null; }
|
||||
try { config = JSON.parse(fs.readFileSync(configFile)); } catch (e) { console.log('ERROR: Unable to parse ' + configFile + '.'); return null; }
|
||||
if (args.adddomain != null) {
|
||||
didSomething++;
|
||||
if (config.domains == null) { config.domains = {}; }
|
||||
|
|
|
@ -5793,13 +5793,6 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||
return;
|
||||
}
|
||||
|
||||
for(var x in parent.users) {
|
||||
if(parent.users[x].email==command.email){
|
||||
displayNotificationMessage("Email address already in use", "New Account", "ServerNotify");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if we exceed the maximum number of user accounts
|
||||
db.isMaxType(newuserdomain.limits.maxuseraccounts, 'user', newuserdomain.id, function (maxExceed) {
|
||||
if (maxExceed) {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -42,7 +42,7 @@
|
|||
"cbor": "5.2.0",
|
||||
"compression": "1.7.4",
|
||||
"cookie-session": "2.0.0",
|
||||
"express": "4.18.2",
|
||||
"express": "4.19.2",
|
||||
"express-handlebars": "5.3.5",
|
||||
"express-ws": "4.0.0",
|
||||
"ipcheck": "0.1.0",
|
||||
|
|
|
@ -60,32 +60,204 @@
|
|||
<input id="SaveServerButton" title="Ctrl-S" type=button value="Save to Server (F3)" onclick="saveServerTranslations()">
|
||||
<input id="SaveFileButton" title="Ctrl-Shift-S" type=button value="Save to File (F4)" onclick="saveToFile()">
|
||||
<select id="langSelector" onchange="langSelectorChange()">
|
||||
<option value="ar">Arabic (ar)</option>
|
||||
<option value="af">Afrikaans (af)</option>
|
||||
<option value="sq">Albanian (sq)</option>
|
||||
<option value="ar">Arabic (Standard) (ar)</option>
|
||||
<option value="ar-dz">Arabic (Algeria) (ar-dz)</option>
|
||||
<option value="ar-bh">Arabic (Bahrain) (ar-bh)</option>
|
||||
<option value="ar-eg">Arabic (Egypt) (ar-eg)</option>
|
||||
<option value="ar-iq">Arabic (Iraq) (ar-iq)</option>
|
||||
<option value="ar-jo">Arabic (Jordan) (ar-jo)</option>
|
||||
<option value="ar-kw">Arabic (Kuwait) (ar-kw)</option>
|
||||
<option value="ar-lb">Arabic (Lebanon) (ar-lb)</option>
|
||||
<option value="ar-ly">Arabic (Libya) (ar-ly)</option>
|
||||
<option value="ar-ma">Arabic (Morocco) (ar-ma)</option>
|
||||
<option value="ar-om">Arabic (Oman) (ar-om)</option>
|
||||
<option value="ar-qa">Arabic (Qatar) (ar-qa)</option>
|
||||
<option value="ar-sa">Arabic (Saudi Arabia) (ar-sa)</option>
|
||||
<option value="ar-sy">Arabic (Syria) (ar-sy)</option>
|
||||
<option value="ar-tn">Arabic (Tunisia) (ar-tn)</option>
|
||||
<option value="ar-ae">Arabic (U.A.E.) (ar-ae)</option>
|
||||
<option value="ar-ye">Arabic (Yemen) (ar-ye)</option>
|
||||
<option value="an">Aragonese (an)</option>
|
||||
<option value="hy">Armenian (hy)</option>
|
||||
<option value="as">Assamese (as)</option>
|
||||
<option value="ast">Asturian (ast)</option>
|
||||
<option value="az">Azerbaijani (az)</option>
|
||||
<option value="eu">Basque (eu)</option>
|
||||
<option value="bg">Bulgarian (bg)</option>
|
||||
<option value="be">Belarusian (be)</option>
|
||||
<option value="bn">Bengali (bn)</option>
|
||||
<option value="bs">Bosnian (bs)</option>
|
||||
<option value="hr">Croatian (hr)</option>
|
||||
<option value="da">Danish (da)</option>
|
||||
<option value="fi">Finnish (fi)</option>
|
||||
<option value="fr">French (fr)</option>
|
||||
<option value="cs">Czech (cs)</option>
|
||||
<option value="de">German (de)</option>
|
||||
<option value="el">Greek (el)</option>
|
||||
<option value="he">Hebrew (he)</option>
|
||||
<option value="hi">Hindi (hi)</option>
|
||||
<option value="it">Italian (it)</option>
|
||||
<option value="ja">Japanese (ja)</option>
|
||||
<option value="ko">Korean (ko)</option>
|
||||
<option value="nl">Dutch (nl)</option>
|
||||
<option value="pl">Polish (pl)</option>
|
||||
<option value="pt">Portuguese (pt)</option>
|
||||
<option value="pt-br">Portuguese Brazil (pt-br)</option>
|
||||
<option value="ru">Russian (ru)</option>
|
||||
<option value="ro">Romanian (ro)</option>
|
||||
<option value="br">Breton (br)</option>
|
||||
<option value="my">Burmese (my)</option>
|
||||
<option value="ca">Catalan (ca)</option>
|
||||
<option value="ch">Chamorro (ch)</option>
|
||||
<option value="ce">Chechen (ce)</option>
|
||||
<option value="zh">Chinese (zh)</option>
|
||||
<option value="zh-hk">Chinese (Hong Kong) (zh-hk)</option>
|
||||
<option value="zh-cn">Chinese (PRC) (zh-cn)</option>
|
||||
<option value="zh-sg">Chinese (Singapore) (zh-sg)</option>
|
||||
<option value="zh-tw">Chinese (Taiwan) (zh-tw)</option>
|
||||
<option value="zh-CHS">Simplified Chinese (zh-CHS)</option>
|
||||
<option value="zh-CHT">Traditional Chinese (zh-CHT)</option>
|
||||
<option value="cv">Chuvash (cv)</option>
|
||||
<option value="co">Corsican (co)</option>
|
||||
<option value="cr">Cree (cr)</option>
|
||||
<option value="hr">Croatian (hr)</option>
|
||||
<option value="cs">Czech (cs)</option>
|
||||
<option value="da">Danish (da)</option>
|
||||
<option value="nl">Dutch (Standard) (nl)</option>
|
||||
<option value="nl-be">Dutch (Belgian) (nl-be)</option>
|
||||
<option value="en">English (en)</option>
|
||||
<option value="en-au">English (Australia) (en-au)</option>
|
||||
<option value="en-bz">English (Belize) (en-bz)</option>
|
||||
<option value="en-ca">English (Canada) (en-ca)</option>
|
||||
<option value="en-ie">English (Ireland) (en-ie)</option>
|
||||
<option value="en-jm">English (Jamaica) (en-jm)</option>
|
||||
<option value="en-nz">English (New Zealand) (en-nz)</option>
|
||||
<option value="en-ph">English (Philippines) (en-ph)</option>
|
||||
<option value="en-za">English (South Africa) (en-za)</option>
|
||||
<option value="en-tt">English (Trinidad & Tobago) (en-tt)</option>
|
||||
<option value="en-gb">English (United Kingdom) (en-gb)</option>
|
||||
<option value="en-us">English (United States) (en-us)</option>
|
||||
<option value="en-zw">English (Zimbabwe) (en-zw)</option>
|
||||
<option value="eo">Esperanto (eo)</option>
|
||||
<option value="et">Estonian (et)</option>
|
||||
<option value="fo">Faeroese (fo)</option>
|
||||
<option value="fa">Farsi (Persian) (fa)</option>
|
||||
<option value="fj">Fijian (fj)</option>
|
||||
<option value="fi">Finnish (fi)</option>
|
||||
<option value="fr">French (Standard) (fr)</option>
|
||||
<option value="fr-be">French (Belgium) (fr-be)</option>
|
||||
<option value="fr-ca">French (Canada) (fr-ca)</option>
|
||||
<option value="fr-fr">French (France) (fr-fr)</option>
|
||||
<option value="fr-lu">French (Luxembourg) (fr-lu)</option>
|
||||
<option value="fr-mc">French (Monaco) (fr-mc)</option>
|
||||
<option value="fr-ch">French (Switzerland) (fr-ch)</option>
|
||||
<option value="fy">Frisian (fy)</option>
|
||||
<option value="fur">Friulian (fur)</option>
|
||||
<option value="gd">Gaelic (Scots) (gd)</option>
|
||||
<option value="gd-ie">Gaelic (Irish) (gd-ie)</option>
|
||||
<option value="gl">Galacian (gl)</option>
|
||||
<option value="ka">Georgian (ka)</option>
|
||||
<option value="de">German (Standard) (de)</option>
|
||||
<option value="de-at">German (Austria) (de-at)</option>
|
||||
<option value="de-de">German (Germany) (de-de)</option>
|
||||
<option value="de-li">German (Liechtenstein) (de-li)</option>
|
||||
<option value="de-lu">German (Luxembourg) (de-lu)</option>
|
||||
<option value="de-ch">German (Switzerland) (de-ch)</option>
|
||||
<option value="el">Greek (el)</option>
|
||||
<option value="gu">Gujurati (gu)</option>
|
||||
<option value="ht">Haitian (ht)</option>
|
||||
<option value="he">Hebrew (he)</option>
|
||||
<option value="hi">Hindi (hi)</option>
|
||||
<option value="hu">Hungarian (hu)</option>
|
||||
<option value="is">Icelandic (is)</option>
|
||||
<option value="id">Indonesian (id)</option>
|
||||
<option value="iu">Inuktitut (iu)</option>
|
||||
<option value="ga">Irish (ga)</option>
|
||||
<option value="it">Italian (Standard) (it)</option>
|
||||
<option value="it-ch">Italian (Switzerland) (it-ch)</option>
|
||||
<option value="ja">Japanese (ja)</option>
|
||||
<option value="kn">Kannada (kn)</option>
|
||||
<option value="ks">Kashmiri (ks)</option>
|
||||
<option value="kk">Kazakh (kk)</option>
|
||||
<option value="km">Khmer (km)</option>
|
||||
<option value="ky">Kirghiz (ky)</option>
|
||||
<option value="tlh">Klingon (tlh)</option>
|
||||
<option value="ko">Korean (ko)</option>
|
||||
<option value="ko-kp">Korean (North Korea) (ko-kp)</option>
|
||||
<option value="ko-kr">Korean (South Korea) (ko-kr)</option>
|
||||
<option value="la">Latin (la)</option>
|
||||
<option value="lv">Latvian (lv)</option>
|
||||
<option value="lt">Lithuanian (lt)</option>
|
||||
<option value="lb">Luxembourgish (lb)</option>
|
||||
<option value="mk">FYRO Macedonian (mk)</option>
|
||||
<option value="ms">Malay (ms)</option>
|
||||
<option value="ml">Malayalam (ml)</option>
|
||||
<option value="mt">Maltese (mt)</option>
|
||||
<option value="mi">Maori (mi)</option>
|
||||
<option value="mr">Marathi (mr)</option>
|
||||
<option value="mo">Moldavian (mo)</option>
|
||||
<option value="nv">Navajo (nv)</option>
|
||||
<option value="ng">Ndonga (ng)</option>
|
||||
<option value="ne">Nepali (ne)</option>
|
||||
<option value="no">Norwegian (no)</option>
|
||||
<option value="nb">Norwegian (Bokmal) (nb)</option>
|
||||
<option value="nn">Norwegian (Nynorsk) (nn)</option>
|
||||
<option value="oc">Occitan (oc)</option>
|
||||
<option value="or">Oriya (or)</option>
|
||||
<option value="om">Oromo (om)</option>
|
||||
<option value="fa-ir">Persian/Iran (fa-ir)</option>
|
||||
<option value="pl">Polish (pl)</option>
|
||||
<option value="pt">Portuguese (pt)</option>
|
||||
<option value="pt-br">Portuguese (Brazil) (pt-br)</option>
|
||||
<option value="pa">Punjabi (pa)</option>
|
||||
<option value="pa-in">Punjabi (India) (pa-in)</option>
|
||||
<option value="pa-pk">Punjabi (Pakistan) (pa-pk)</option>
|
||||
<option value="qu">Quechua (qu)</option>
|
||||
<option value="rm">Rhaeto-Romanic (rm)</option>
|
||||
<option value="ro">Romanian (ro)</option>
|
||||
<option value="ro-mo">Romanian (Moldavia) (ro-mo)</option>
|
||||
<option value="ru">Russian (ru)</option>
|
||||
<option value="ru-mo">Russian (Moldavia) (ru-mo)</option>
|
||||
<option value="sz">Sami (Lappish) (sz)</option>
|
||||
<option value="sg">Sango (sg)</option>
|
||||
<option value="sa">Sanskrit (sa)</option>
|
||||
<option value="sc">Sardinian (sc)</option>
|
||||
<option value="sd">Sindhi (sd)</option>
|
||||
<option value="si">Singhalese (si)</option>
|
||||
<option value="sr">Serbian (sr)</option>
|
||||
<option value="sk">Slovak (sk)</option>
|
||||
<option value="sl">Slovenian (sl)</option>
|
||||
<option value="so">Somani (so)</option>
|
||||
<option value="sb">Sorbian (sb)</option>
|
||||
<option value="es">Spanish (es)</option>
|
||||
<option value="es-ar">Spanish (Argentina) (es-ar)</option>
|
||||
<option value="es-bo">Spanish (Bolivia) (es-bo)</option>
|
||||
<option value="es-cl">Spanish (Chile) (es-cl)</option>
|
||||
<option value="es-co">Spanish (Colombia) (es-co)</option>
|
||||
<option value="es-cr">Spanish (Costa Rica) (es-cr)</option>
|
||||
<option value="es-do">Spanish (Dominican Republic) (es-do)</option>
|
||||
<option value="es-ec">Spanish (Ecuador) (es-ec)</option>
|
||||
<option value="es-sv">Spanish (El Salvador) (es-sv)</option>
|
||||
<option value="es-gt">Spanish (Guatemala) (es-gt)</option>
|
||||
<option value="es-hn">Spanish (Honduras) (es-hn)</option>
|
||||
<option value="es-mx">Spanish (Mexico) (es-mx)</option>
|
||||
<option value="es-ni">Spanish (Nicaragua) (es-ni)</option>
|
||||
<option value="es-pa">Spanish (Panama) (es-pa)</option>
|
||||
<option value="es-py">Spanish (Paraguay) (es-py)</option>
|
||||
<option value="es-pe">Spanish (Peru) (es-pe)</option>
|
||||
<option value="es-pr">Spanish (Puerto Rico) (es-pr)</option>
|
||||
<option value="es-es">Spanish (Spain) (es-es)</option>
|
||||
<option value="es-uy">Spanish (Uruguay) (es-uy)</option>
|
||||
<option value="es-ve">Spanish (Venezuela) (es-ve)</option>
|
||||
<option value="sx">Sutu (sx)</option>
|
||||
<option value="sw">Swahili (sw)</option>
|
||||
<option value="sv">Swedish (sv)</option>
|
||||
<option value="sv-fi">Swedish (Finland) (sv-fi)</option>
|
||||
<option value="sv-sv">Swedish (Sweden) (sv-sv)</option>
|
||||
<option value="ta">Tamil (ta)</option>
|
||||
<option value="tt">Tatar (tt)</option>
|
||||
<option value="te">Teluga (te)</option>
|
||||
<option value="th">Thai (th)</option>
|
||||
<option value="tig">Tigre (tig)</option>
|
||||
<option value="ts">Tsonga (ts)</option>
|
||||
<option value="tn">Tswana (tn)</option>
|
||||
<option value="tr">Turkish (tr)</option>
|
||||
<option value="tk">Turkmen (tk)</option>
|
||||
<option value="uk">Ukrainian (uk)</option>
|
||||
<option value="hsb">Upper Sorbian (hsb)</option>
|
||||
<option value="ur">Urdu (ur)</option>
|
||||
<option value="ve">Venda (ve)</option>
|
||||
<option value="vi">Vietnamese (vi)</option>
|
||||
<option value="vo">Volapuk (vo)</option>
|
||||
<option value="wa">Walloon (wa)</option>
|
||||
<option value="cy">Welsh (cy)</option>
|
||||
<option value="xh">Xhosa (xh)</option>
|
||||
<option value="ji">Yiddish (ji)</option>
|
||||
<option value="zu">Zulu (zu)</option>
|
||||
</select>
|
||||
<input id="searchInput" type="text" placeholder="Search" onchange="onSearchChanged()" onkeyup="onSearchChanged()">
|
||||
<label><input id="showLocCheck" type="checkbox" onchange="onLocChanged()"> Show Location</label>
|
||||
|
@ -544,4 +716,4 @@
|
|||
start();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -3,7 +3,7 @@ You can help translate MeshCentral into other languages pretty easily. In this f
|
|||
|
||||
Download the following Windows tool to open the "translate.json" file and edit strings.
|
||||
|
||||
https://info.meshcentral.com/downloads/MeshCentral2/ResourceTranslator.zip
|
||||
https://meshcentral.com/tools/ResourceTranslator.zip
|
||||
|
||||
Once done, save the file back and run this:
|
||||
|
||||
|
|
Loading…
Reference in New Issue