fix(mikrotikConfigRoutes, mikrotikApplyService): update default port for MikroTik API connections from 443 to 80 to align with REST API standards
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m59s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m59s
This commit is contained in:
@@ -57,8 +57,8 @@ function getMikrotikCredentials(server) {
|
||||
const host = server.mikrotikHost || server.ip || server.dns;
|
||||
if (!host) return null;
|
||||
const port = server.mikrotikPort;
|
||||
// REST API: порт 80 (HTTP, www) или 443 (HTTPS, www-ssl). Если 8728 (старый API) — по умолчанию 443
|
||||
const restPort = (port === 80 || port === 443 || port === 8443) ? port : 443;
|
||||
// REST API: порт 80 (HTTP, www) или 443 (HTTPS, www-ssl). По умолчанию 80
|
||||
const restPort = (port === 80 || port === 443 || port === 8443) ? port : 80;
|
||||
const user = server.mikrotikUser || 'admin';
|
||||
let password = '';
|
||||
if (server.encryptedMikrotikPassword) {
|
||||
@@ -171,7 +171,7 @@ async function testMikrotikConnection(req, res) {
|
||||
} else if (host && user !== undefined) {
|
||||
creds = {
|
||||
host,
|
||||
port: port || 443,
|
||||
port: port || 80,
|
||||
user,
|
||||
password: password || '',
|
||||
secure: false,
|
||||
|
||||
@@ -14,7 +14,7 @@ const https = require('https');
|
||||
* @returns {object} client с методами print, add, set, remove, command
|
||||
*/
|
||||
function createRosClient(opts) {
|
||||
const { host, port = 443, user, password, secure = false } = opts;
|
||||
const { host, port = 80, user, password, secure = false } = opts;
|
||||
const useHttp = port === 80;
|
||||
const protocol = useHttp ? http : https;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user