Skip to content

Commit c97b8a3

Browse files
committed
Some auto formatting changes suggested by ide
1 parent ed1d90e commit c97b8a3

File tree

11 files changed

+41
-41
lines changed

11 files changed

+41
-41
lines changed

backend/lib/utils.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
const _ = require('lodash');
2-
const exec = require('child_process').exec;
3-
const execFile = require('child_process').execFile;
2+
const exec = require('node:child_process').exec;
3+
const execFile = require('node:child_process').execFile;
44
const { Liquid } = require('liquidjs');
55
const logger = require('../logger').global;
66
const error = require('./error');
77

88
module.exports = {
99

10-
exec: async function(cmd, options = {}) {
10+
exec: async (cmd, options = {}) => {
1111
logger.debug('CMD:', cmd);
1212

1313
const { stdout, stderr } = await new Promise((resolve, reject) => {
@@ -31,11 +31,11 @@ module.exports = {
3131
* @param {Array} args
3232
* @returns {Promise}
3333
*/
34-
execFile: function (cmd, args) {
34+
execFile: (cmd, args) => {
3535
// logger.debug('CMD: ' + cmd + ' ' + (args ? args.join(' ') : ''));
3636

3737
return new Promise((resolve, reject) => {
38-
execFile(cmd, args, function (err, stdout, /*stderr*/) {
38+
execFile(cmd, args, (err, stdout, /*stderr*/) => {
3939
if (err && typeof err === 'object') {
4040
reject(err);
4141
} else {
@@ -51,7 +51,7 @@ module.exports = {
5151
* @param {Array} omissions
5252
* @returns {Function}
5353
*/
54-
omitRow: function (omissions) {
54+
omitRow: (omissions) => {
5555
/**
5656
* @param {Object} row
5757
* @returns {Object}
@@ -67,7 +67,7 @@ module.exports = {
6767
* @param {Array} omissions
6868
* @returns {Function}
6969
*/
70-
omitRows: function (omissions) {
70+
omitRows: (omissions) => {
7171
/**
7272
* @param {Array} rows
7373
* @returns {Object}
@@ -83,9 +83,9 @@ module.exports = {
8383
/**
8484
* @returns {Object} Liquid render engine
8585
*/
86-
getRenderEngine: function () {
86+
getRenderEngine: () => {
8787
const renderEngine = new Liquid({
88-
root: __dirname + '/../templates/'
88+
root: `${__dirname}/../templates/`
8989
});
9090

9191
/**

test/cypress/e2e/api/Certificates.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('Certificates endpoints', () => {
1010
});
1111
});
1212

13-
it('Validate custom certificate', function() {
13+
it('Validate custom certificate', () => {
1414
cy.task('backendApiPostFiles', {
1515
token: token,
1616
path: '/api/nginx/certificates/validate',
@@ -25,7 +25,7 @@ describe('Certificates endpoints', () => {
2525
});
2626
});
2727

28-
it('Custom certificate lifecycle', function() {
28+
it('Custom certificate lifecycle', () => {
2929
// Create custom cert
3030
cy.task('backendApiPost', {
3131
token: token,
@@ -73,7 +73,7 @@ describe('Certificates endpoints', () => {
7373
});
7474
});
7575

76-
it('Request Certificate - CVE-2024-46256/CVE-2024-46257', function() {
76+
it('Request Certificate - CVE-2024-46256/CVE-2024-46257', () => {
7777
cy.task('backendApiPost', {
7878
token: token,
7979
path: '/api/nginx/certificates',

test/cypress/e2e/api/Dashboard.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('Dashboard endpoints', () => {
99
});
1010
});
1111

12-
it('Should be able to get host counts', function() {
12+
it('Should be able to get host counts', () => {
1313
cy.task('backendApiGet', {
1414
token: token,
1515
path: '/api/reports/hosts'

test/cypress/e2e/api/FullCertProvision.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('Full Certificate Provisions', () => {
99
});
1010
});
1111

12-
it('Should be able to create new http certificate', function() {
12+
it('Should be able to create new http certificate', () => {
1313
cy.task('backendApiPost', {
1414
token: token,
1515
path: '/api/nginx/certificates',
@@ -32,7 +32,7 @@ describe('Full Certificate Provisions', () => {
3232
});
3333
});
3434

35-
it('Should be able to create new DNS certificate with Powerdns', function() {
35+
it('Should be able to create new DNS certificate with Powerdns', () => {
3636
cy.task('backendApiPost', {
3737
token: token,
3838
path: '/api/nginx/certificates',

test/cypress/e2e/api/Health.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference types="cypress" />
22

33
describe('Basic API checks', () => {
4-
it('Should return a valid health payload', function () {
4+
it('Should return a valid health payload', () => {
55
cy.task('backendApiGet', {
66
path: '/api/',
77
}).then((data) => {
@@ -10,9 +10,9 @@ describe('Basic API checks', () => {
1010
});
1111
});
1212

13-
it('Should return a valid schema payload', function () {
13+
it('Should return a valid schema payload', () => {
1414
cy.task('backendApiGet', {
15-
path: '/api/schema?ts=' + Date.now(),
15+
path: `/api/schema?ts=${Date.now()}`,
1616
}).then((data) => {
1717
expect(data.openapi).to.be.equal('3.1.0');
1818
});

test/cypress/e2e/api/Ldap.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/// <reference types="cypress" />
22

33
describe('LDAP with Authentik', () => {
4-
let token;
4+
let _token;
55
if (Cypress.env('skipStackCheck') === 'true' || Cypress.env('stack') === 'postgres') {
66

77
before(() => {
88
cy.getToken().then((tok) => {
9-
token = tok;
9+
_token = tok;
1010

1111
// cy.task('backendApiPut', {
1212
// token: token,
@@ -45,7 +45,7 @@ describe('LDAP with Authentik', () => {
4545
});
4646
});
4747

48-
it.skip('Should log in with LDAP', function() {
48+
it.skip('Should log in with LDAP', () => {
4949
// cy.task('backendApiPost', {
5050
// token: token,
5151
// path: '/api/auth',

test/cypress/e2e/api/OAuth.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/// <reference types="cypress" />
22

33
describe('OAuth with Authentik', () => {
4-
let token;
4+
let _token;
55
if (Cypress.env('skipStackCheck') === 'true' || Cypress.env('stack') === 'postgres') {
66

77
before(() => {
88
cy.getToken().then((tok) => {
9-
token = tok;
9+
_token = tok;
1010

1111
// cy.task('backendApiPut', {
1212
// token: token,
@@ -47,7 +47,7 @@ describe('OAuth with Authentik', () => {
4747
});
4848
});
4949

50-
it.skip('Should log in with OAuth', function() {
50+
it.skip('Should log in with OAuth', () => {
5151
// cy.task('backendApiGet', {
5252
// path: '/oauth/login?redirect_base=' + encodeURI(Cypress.config('baseUrl')),
5353
// }).then((data) => {

test/cypress/e2e/api/ProxyHosts.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('Proxy Hosts endpoints', () => {
99
});
1010
});
1111

12-
it('Should be able to create a http host', function() {
12+
it('Should be able to create a http host', () => {
1313
cy.task('backendApiPost', {
1414
token: token,
1515
path: '/api/nginx/proxy-hosts',

test/cypress/e2e/api/Settings.cy.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('Settings endpoints', () => {
99
});
1010
});
1111

12-
it('Get all settings', function() {
12+
it('Get all settings', () => {
1313
cy.task('backendApiGet', {
1414
token: token,
1515
path: '/api/settings',
@@ -19,7 +19,7 @@ describe('Settings endpoints', () => {
1919
});
2020
});
2121

22-
it('Get default-site setting', function() {
22+
it('Get default-site setting', () => {
2323
cy.task('backendApiGet', {
2424
token: token,
2525
path: '/api/settings/default-site',
@@ -30,7 +30,7 @@ describe('Settings endpoints', () => {
3030
});
3131
});
3232

33-
it('Default Site congratulations', function() {
33+
it('Default Site congratulations', () => {
3434
cy.task('backendApiPut', {
3535
token: token,
3636
path: '/api/settings/default-site',
@@ -46,7 +46,7 @@ describe('Settings endpoints', () => {
4646
});
4747
});
4848

49-
it('Default Site 404', function() {
49+
it('Default Site 404', () => {
5050
cy.task('backendApiPut', {
5151
token: token,
5252
path: '/api/settings/default-site',
@@ -62,7 +62,7 @@ describe('Settings endpoints', () => {
6262
});
6363
});
6464

65-
it('Default Site 444', function() {
65+
it('Default Site 444', () => {
6666
cy.task('backendApiPut', {
6767
token: token,
6868
path: '/api/settings/default-site',
@@ -78,7 +78,7 @@ describe('Settings endpoints', () => {
7878
});
7979
});
8080

81-
it('Default Site redirect', function() {
81+
it('Default Site redirect', () => {
8282
cy.task('backendApiPut', {
8383
token: token,
8484
path: '/api/settings/default-site',
@@ -100,7 +100,7 @@ describe('Settings endpoints', () => {
100100
});
101101
});
102102

103-
it('Default Site html', function() {
103+
it('Default Site html', () => {
104104
cy.task('backendApiPut', {
105105
token: token,
106106
path: '/api/settings/default-site',

test/cypress/e2e/api/Streams.cy.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('Streams', () => {
3333
cy.exec('rm -f /test/results/testssl.json');
3434
});
3535

36-
it('Should be able to create TCP Stream', function() {
36+
it('Should be able to create TCP Stream', () => {
3737
cy.task('backendApiPost', {
3838
token: token,
3939
path: '/api/nginx/streams',
@@ -65,7 +65,7 @@ describe('Streams', () => {
6565
});
6666
});
6767

68-
it('Should be able to create UDP Stream', function() {
68+
it('Should be able to create UDP Stream', () => {
6969
cy.task('backendApiPost', {
7070
token: token,
7171
path: '/api/nginx/streams',
@@ -92,7 +92,7 @@ describe('Streams', () => {
9292
});
9393
});
9494

95-
it('Should be able to create TCP/UDP Stream', function() {
95+
it('Should be able to create TCP/UDP Stream', () => {
9696
cy.task('backendApiPost', {
9797
token: token,
9898
path: '/api/nginx/streams',
@@ -124,7 +124,7 @@ describe('Streams', () => {
124124
});
125125
});
126126

127-
it('Should be able to create SSL TCP Stream', function() {
127+
it('Should be able to create SSL TCP Stream', () => {
128128
let certID = 0;
129129

130130
// Create custom cert
@@ -184,7 +184,7 @@ describe('Streams', () => {
184184
cy.exec('/testssl/testssl.sh --quiet --add-ca="$(/bin/mkcert -CAROOT)/rootCA.pem" --jsonfile=/test/results/testssl.json website1.example.com:1503', {
185185
timeout: 120000, // 2 minutes
186186
}).then((result) => {
187-
cy.task('log', '[testssl.sh] ' + result.stdout);
187+
cy.task('log', `[testssl.sh] ${result.stdout}`);
188188

189189
const allowedSeverities = ["INFO", "OK", "LOW", "MEDIUM"];
190190
const ignoredIDs = [
@@ -210,7 +210,7 @@ describe('Streams', () => {
210210
});
211211
});
212212

213-
it('Should be able to List Streams', function() {
213+
it('Should be able to List Streams', () => {
214214
cy.task('backendApiGet', {
215215
token: token,
216216
path: '/api/nginx/streams?expand=owner,certificate',

0 commit comments

Comments
 (0)