mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-10-07 05:10:09 +00:00
Compare commits
9 Commits
v2.12.3
...
a262ad132b
Author | SHA1 | Date | |
---|---|---|---|
|
a262ad132b | ||
|
e4c10131f0 | ||
|
d3526debe6 | ||
|
207dbb2f37 | ||
|
ae1255df27 | ||
|
7307515eed | ||
|
1d3d5be588 | ||
|
0cf7ed9d82 | ||
|
b8b80d3e80 |
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@@ -128,7 +128,7 @@ pipeline {
|
|||||||
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
|
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
|
||||||
}
|
}
|
||||||
unstable {
|
unstable {
|
||||||
dir(path: 'test/results') {
|
dir(path: 'testing/results') {
|
||||||
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml')
|
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ pipeline {
|
|||||||
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
|
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
|
||||||
}
|
}
|
||||||
unstable {
|
unstable {
|
||||||
dir(path: 'test/results') {
|
dir(path: 'testing/results') {
|
||||||
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml')
|
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ pipeline {
|
|||||||
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
|
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
|
||||||
}
|
}
|
||||||
unstable {
|
unstable {
|
||||||
dir(path: 'test/results') {
|
dir(path: 'testing/results') {
|
||||||
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml')
|
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://nginxproxymanager.com/github.png">
|
<img src="https://nginxproxymanager.com/github.png">
|
||||||
<br><br>
|
<br><br>
|
||||||
<img src="https://img.shields.io/badge/version-2.12.3-green.svg?style=for-the-badge">
|
<img src="https://img.shields.io/badge/version-2.12.2-green.svg?style=for-the-badge">
|
||||||
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
|
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
|
||||||
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
|
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
|
||||||
</a>
|
</a>
|
||||||
|
@@ -258,7 +258,6 @@ const internalAccessList = {
|
|||||||
})
|
})
|
||||||
.where('access_list.is_deleted', 0)
|
.where('access_list.is_deleted', 0)
|
||||||
.andWhere('access_list.id', data.id)
|
.andWhere('access_list.id', data.id)
|
||||||
.groupBy('access_list.id')
|
|
||||||
.allowGraph('[owner,items,clients,proxy_hosts.[certificate,access_list.[clients,items]]]')
|
.allowGraph('[owner,items,clients,proxy_hosts.[certificate,access_list.[clients,items]]]')
|
||||||
.first();
|
.first();
|
||||||
|
|
||||||
@@ -508,13 +507,8 @@ const internalAccessList = {
|
|||||||
if (typeof item.password !== 'undefined' && item.password.length) {
|
if (typeof item.password !== 'undefined' && item.password.length) {
|
||||||
logger.info('Adding: ' + item.username);
|
logger.info('Adding: ' + item.username);
|
||||||
|
|
||||||
utils.execFile('openssl', ['passwd', '-apr1', item.password])
|
utils.execFile('/usr/bin/htpasswd', ['-b', htpasswd_file, item.username, item.password])
|
||||||
.then((res) => {
|
.then((/*result*/) => {
|
||||||
try {
|
|
||||||
fs.appendFileSync(htpasswd_file, item.username + ':' + res + '\n', {encoding: 'utf8'});
|
|
||||||
} catch (err) {
|
|
||||||
reject(err);
|
|
||||||
}
|
|
||||||
next();
|
next();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
@@ -313,9 +313,6 @@ const internalCertificate = {
|
|||||||
.where('is_deleted', 0)
|
.where('is_deleted', 0)
|
||||||
.andWhere('id', data.id)
|
.andWhere('id', data.id)
|
||||||
.allowGraph('[owner]')
|
.allowGraph('[owner]')
|
||||||
.allowGraph('[proxy_hosts]')
|
|
||||||
.allowGraph('[redirection_hosts]')
|
|
||||||
.allowGraph('[dead_hosts]')
|
|
||||||
.first();
|
.first();
|
||||||
|
|
||||||
if (access_data.permission_visibility !== 'all') {
|
if (access_data.permission_visibility !== 'all') {
|
||||||
@@ -467,9 +464,6 @@ const internalCertificate = {
|
|||||||
.where('is_deleted', 0)
|
.where('is_deleted', 0)
|
||||||
.groupBy('id')
|
.groupBy('id')
|
||||||
.allowGraph('[owner]')
|
.allowGraph('[owner]')
|
||||||
.allowGraph('[proxy_hosts]')
|
|
||||||
.allowGraph('[redirection_hosts]')
|
|
||||||
.allowGraph('[dead_hosts]')
|
|
||||||
.orderBy('nice_name', 'ASC');
|
.orderBy('nice_name', 'ASC');
|
||||||
|
|
||||||
if (access_data.permission_visibility !== 'all') {
|
if (access_data.permission_visibility !== 'all') {
|
||||||
|
@@ -9,7 +9,7 @@ const internalHost = require('./host');
|
|||||||
const {castJsonIfNeed} = require('../lib/helpers');
|
const {castJsonIfNeed} = require('../lib/helpers');
|
||||||
|
|
||||||
function omissions () {
|
function omissions () {
|
||||||
return ['is_deleted', 'owner.is_deleted', 'certificate.is_deleted'];
|
return ['is_deleted'];
|
||||||
}
|
}
|
||||||
|
|
||||||
const internalStream = {
|
const internalStream = {
|
||||||
@@ -20,7 +20,7 @@ const internalStream = {
|
|||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
create: (access, data) => {
|
create: (access, data) => {
|
||||||
const create_certificate = data.certificate_id === 'new';
|
let create_certificate = data.certificate_id === 'new';
|
||||||
|
|
||||||
if (create_certificate) {
|
if (create_certificate) {
|
||||||
delete data.certificate_id;
|
delete data.certificate_id;
|
||||||
@@ -96,7 +96,7 @@ const internalStream = {
|
|||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
update: (access, data) => {
|
update: (access, data) => {
|
||||||
const create_certificate = data.certificate_id === 'new';
|
let create_certificate = data.certificate_id === 'new';
|
||||||
|
|
||||||
if (create_certificate) {
|
if (create_certificate) {
|
||||||
delete data.certificate_id;
|
delete data.certificate_id;
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
const db = require('../db');
|
const db = require('../db');
|
||||||
const helpers = require('../lib/helpers');
|
const helpers = require('../lib/helpers');
|
||||||
const Model = require('objection').Model;
|
const Model = require('objection').Model;
|
||||||
|
const User = require('./user');
|
||||||
const now = require('./now_helper');
|
const now = require('./now_helper');
|
||||||
|
|
||||||
Model.knex(db);
|
Model.knex(db);
|
||||||
@@ -67,11 +68,6 @@ class Certificate extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static get relationMappings () {
|
static get relationMappings () {
|
||||||
const ProxyHost = require('./proxy_host');
|
|
||||||
const DeadHost = require('./dead_host');
|
|
||||||
const User = require('./user');
|
|
||||||
const RedirectionHost = require('./redirection_host');
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
owner: {
|
owner: {
|
||||||
relation: Model.HasOneRelation,
|
relation: Model.HasOneRelation,
|
||||||
@@ -83,39 +79,6 @@ class Certificate extends Model {
|
|||||||
modify: function (qb) {
|
modify: function (qb) {
|
||||||
qb.where('user.is_deleted', 0);
|
qb.where('user.is_deleted', 0);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
proxy_hosts: {
|
|
||||||
relation: Model.HasManyRelation,
|
|
||||||
modelClass: ProxyHost,
|
|
||||||
join: {
|
|
||||||
from: 'certificate.id',
|
|
||||||
to: 'proxy_host.certificate_id'
|
|
||||||
},
|
|
||||||
modify: function (qb) {
|
|
||||||
qb.where('proxy_host.is_deleted', 0);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dead_hosts: {
|
|
||||||
relation: Model.HasManyRelation,
|
|
||||||
modelClass: DeadHost,
|
|
||||||
join: {
|
|
||||||
from: 'certificate.id',
|
|
||||||
to: 'dead_host.certificate_id'
|
|
||||||
},
|
|
||||||
modify: function (qb) {
|
|
||||||
qb.where('dead_host.is_deleted', 0);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
redirection_hosts: {
|
|
||||||
relation: Model.HasManyRelation,
|
|
||||||
modelClass: RedirectionHost,
|
|
||||||
join: {
|
|
||||||
from: 'certificate.id',
|
|
||||||
to: 'redirection_host.certificate_id'
|
|
||||||
},
|
|
||||||
modify: function (qb) {
|
|
||||||
qb.where('redirection_host.is_deleted', 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -1,14 +1,16 @@
|
|||||||
const Model = require('objection').Model;
|
// Objection Docs:
|
||||||
|
// http://vincit.github.io/objection.js/
|
||||||
|
|
||||||
const db = require('../db');
|
const db = require('../db');
|
||||||
const helpers = require('../lib/helpers');
|
const helpers = require('../lib/helpers');
|
||||||
|
const Model = require('objection').Model;
|
||||||
const User = require('./user');
|
const User = require('./user');
|
||||||
const Certificate = require('./certificate');
|
|
||||||
const now = require('./now_helper');
|
const now = require('./now_helper');
|
||||||
|
const Certificate = require('./certificate');
|
||||||
|
|
||||||
Model.knex(db);
|
Model.knex(db);
|
||||||
|
|
||||||
const boolFields = [
|
const boolFields = [
|
||||||
'enabled',
|
|
||||||
'is_deleted',
|
'is_deleted',
|
||||||
'tcp_forwarding',
|
'tcp_forwarding',
|
||||||
'udp_forwarding',
|
'udp_forwarding',
|
||||||
|
@@ -19,7 +19,9 @@
|
|||||||
"incoming_port": {
|
"incoming_port": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"minimum": 1,
|
"minimum": 1,
|
||||||
"maximum": 65535
|
"maximum": 65535,
|
||||||
|
"if": {"properties": {"tcp_forwarding": {"const": true}}},
|
||||||
|
"then": {"not": {"oneOf": [{"const": 80}, {"const": 443}]}}
|
||||||
},
|
},
|
||||||
"forwarding_host": {
|
"forwarding_host": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
@@ -50,18 +52,12 @@
|
|||||||
"udp_forwarding": {
|
"udp_forwarding": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"enabled": {
|
"domain_names": {
|
||||||
"$ref": "../common.json#/properties/enabled"
|
"$ref": "../common.json#/properties/domain_names"
|
||||||
},
|
},
|
||||||
"certificate_id": {
|
"certificate_id": {
|
||||||
"$ref": "../common.json#/properties/certificate_id"
|
"$ref": "../common.json#/properties/certificate_id"
|
||||||
},
|
},
|
||||||
"meta": {
|
|
||||||
"type": "object"
|
|
||||||
},
|
|
||||||
"owner": {
|
|
||||||
"$ref": "./user-object.json"
|
|
||||||
},
|
|
||||||
"certificate": {
|
"certificate": {
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
{
|
{
|
||||||
@@ -71,6 +67,12 @@
|
|||||||
"$ref": "./certificate-object.json"
|
"$ref": "./certificate-object.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"enabled": {
|
||||||
|
"$ref": "../common.json#/properties/enabled"
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"type": "object"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,9 +5,10 @@
|
|||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
"expires": {
|
"expires": {
|
||||||
"description": "Token Expiry ISO Time String",
|
"description": "Token Expiry Unix Time",
|
||||||
"example": "2025-02-04T20:40:46.340Z",
|
"example": 1566540249,
|
||||||
"type": "string"
|
"minimum": 1,
|
||||||
|
"type": "number"
|
||||||
},
|
},
|
||||||
"token": {
|
"token": {
|
||||||
"description": "JWT Token",
|
"description": "JWT Token",
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
"description": "Expansions",
|
"description": "Expansions",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["owner", "certificate"]
|
"enum": ["access_list", "owner", "certificate"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -40,8 +40,7 @@
|
|||||||
"nginx_online": true,
|
"nginx_online": true,
|
||||||
"nginx_err": null
|
"nginx_err": null
|
||||||
},
|
},
|
||||||
"enabled": true,
|
"enabled": true
|
||||||
"certificate_id": 0
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -32,6 +32,9 @@
|
|||||||
"udp_forwarding": {
|
"udp_forwarding": {
|
||||||
"$ref": "../../../components/stream-object.json#/properties/udp_forwarding"
|
"$ref": "../../../components/stream-object.json#/properties/udp_forwarding"
|
||||||
},
|
},
|
||||||
|
"domain_names": {
|
||||||
|
"$ref": "../../../components/stream-object.json#/properties/domain_names"
|
||||||
|
},
|
||||||
"certificate_id": {
|
"certificate_id": {
|
||||||
"$ref": "../../../components/stream-object.json#/properties/certificate_id"
|
"$ref": "../../../components/stream-object.json#/properties/certificate_id"
|
||||||
},
|
},
|
||||||
@@ -77,7 +80,8 @@
|
|||||||
"avatar": "",
|
"avatar": "",
|
||||||
"roles": ["admin"]
|
"roles": ["admin"]
|
||||||
},
|
},
|
||||||
"certificate_id": 0
|
"certificate_id": 0,
|
||||||
|
"certificate": null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -40,8 +40,7 @@
|
|||||||
"nginx_online": true,
|
"nginx_online": true,
|
||||||
"nginx_err": null
|
"nginx_err": null
|
||||||
},
|
},
|
||||||
"enabled": true,
|
"enabled": true
|
||||||
"certificate_id": 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -44,6 +44,9 @@
|
|||||||
"udp_forwarding": {
|
"udp_forwarding": {
|
||||||
"$ref": "../../../../components/stream-object.json#/properties/udp_forwarding"
|
"$ref": "../../../../components/stream-object.json#/properties/udp_forwarding"
|
||||||
},
|
},
|
||||||
|
"domain_names": {
|
||||||
|
"$ref": "../../../../components/stream-object.json#/properties/domain_names"
|
||||||
|
},
|
||||||
"certificate_id": {
|
"certificate_id": {
|
||||||
"$ref": "../../../../components/stream-object.json#/properties/certificate_id"
|
"$ref": "../../../../components/stream-object.json#/properties/certificate_id"
|
||||||
},
|
},
|
||||||
@@ -64,8 +67,8 @@
|
|||||||
"default": {
|
"default": {
|
||||||
"value": {
|
"value": {
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"created_on": "2024-10-09T02:33:45.000Z",
|
"created_on": "2024-10-08T23:23:03.000Z",
|
||||||
"modified_on": "2024-10-09T02:33:45.000Z",
|
"modified_on": "2024-10-08T23:26:37.000Z",
|
||||||
"owner_user_id": 1,
|
"owner_user_id": 1,
|
||||||
"incoming_port": 9090,
|
"incoming_port": 9090,
|
||||||
"forwarding_host": "router.internal",
|
"forwarding_host": "router.internal",
|
||||||
@@ -79,17 +82,18 @@
|
|||||||
"enabled": true,
|
"enabled": true,
|
||||||
"owner": {
|
"owner": {
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"created_on": "2024-10-09T02:33:16.000Z",
|
"created_on": "2024-10-07T22:43:55.000Z",
|
||||||
"modified_on": "2024-10-09T02:33:16.000Z",
|
"modified_on": "2024-10-08T12:52:54.000Z",
|
||||||
"is_deleted": false,
|
"is_deleted": false,
|
||||||
"is_disabled": false,
|
"is_disabled": false,
|
||||||
"email": "admin@example.com",
|
"email": "admin@example.com",
|
||||||
"name": "Administrator",
|
"name": "Administrator",
|
||||||
"nickname": "Admin",
|
"nickname": "some guy",
|
||||||
"avatar": "",
|
"avatar": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?default=mm",
|
||||||
"roles": ["admin"]
|
"roles": ["admin"]
|
||||||
},
|
},
|
||||||
"certificate_id": 0
|
"certificate": null,
|
||||||
|
"access_list": null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
"examples": {
|
"examples": {
|
||||||
"default": {
|
"default": {
|
||||||
"value": {
|
"value": {
|
||||||
"expires": "2025-02-04T20:40:46.340Z",
|
"expires": 1566540510,
|
||||||
"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
|
"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
"default": {
|
"default": {
|
||||||
"value": {
|
"value": {
|
||||||
"result": {
|
"result": {
|
||||||
"expires": "2025-02-04T20:40:46.340Z",
|
"expires": 1566540510,
|
||||||
"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
|
"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,10 +22,6 @@ services:
|
|||||||
test: ["CMD", "/usr/bin/check-health"]
|
test: ["CMD", "/usr/bin/check-health"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
expose:
|
|
||||||
- '80-81/tcp'
|
|
||||||
- '443/tcp'
|
|
||||||
- '1500-1503/tcp'
|
|
||||||
networks:
|
networks:
|
||||||
fulltest:
|
fulltest:
|
||||||
aliases:
|
aliases:
|
||||||
@@ -44,7 +40,7 @@ services:
|
|||||||
- ca.internal
|
- ca.internal
|
||||||
|
|
||||||
pdns:
|
pdns:
|
||||||
image: pschiffe/pdns-mysql:4.8
|
image: pschiffe/pdns-mysql
|
||||||
volumes:
|
volumes:
|
||||||
- '/etc/localtime:/etc/localtime:ro'
|
- '/etc/localtime:/etc/localtime:ro'
|
||||||
environment:
|
environment:
|
||||||
@@ -101,7 +97,7 @@ services:
|
|||||||
HTTP_PROXY: 'squid:3128'
|
HTTP_PROXY: 'squid:3128'
|
||||||
HTTPS_PROXY: 'squid:3128'
|
HTTPS_PROXY: 'squid:3128'
|
||||||
volumes:
|
volumes:
|
||||||
- 'cypress_logs:/test/results'
|
- 'cypress_logs:/results'
|
||||||
- './dev/resolv.conf:/etc/resolv.conf:ro'
|
- './dev/resolv.conf:/etc/resolv.conf:ro'
|
||||||
- '/etc/localtime:/etc/localtime:ro'
|
- '/etc/localtime:/etc/localtime:ro'
|
||||||
command: cypress run --browser chrome --config-file=cypress/config/ci.js
|
command: cypress run --browser chrome --config-file=cypress/config/ci.js
|
||||||
|
@@ -132,7 +132,7 @@ services:
|
|||||||
- 8128:3128
|
- 8128:3128
|
||||||
|
|
||||||
pdns:
|
pdns:
|
||||||
image: pschiffe/pdns-mysql:4.8
|
image: pschiffe/pdns-mysql
|
||||||
container_name: npm2dev.pdns
|
container_name: npm2dev.pdns
|
||||||
volumes:
|
volumes:
|
||||||
- '/etc/localtime:/etc/localtime:ro'
|
- '/etc/localtime:/etc/localtime:ro'
|
||||||
|
@@ -8,7 +8,7 @@ BLUE='\E[1;34m'
|
|||||||
GREEN='\E[1;32m'
|
GREEN='\E[1;32m'
|
||||||
RESET='\E[0m'
|
RESET='\E[0m'
|
||||||
|
|
||||||
S6_OVERLAY_VERSION=3.2.0.2
|
S6_OVERLAY_VERSION=3.1.5.0
|
||||||
TARGETPLATFORM=${1:-linux/amd64}
|
TARGETPLATFORM=${1:-linux/amd64}
|
||||||
|
|
||||||
# Determine the correct binary file for the architecture given
|
# Determine the correct binary file for the architecture given
|
||||||
|
@@ -1065,9 +1065,9 @@ vfile@^6.0.0:
|
|||||||
vfile-message "^4.0.0"
|
vfile-message "^4.0.0"
|
||||||
|
|
||||||
vite@^5.4.8:
|
vite@^5.4.8:
|
||||||
version "5.4.14"
|
version "5.4.8"
|
||||||
resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.14.tgz#ff8255edb02134df180dcfca1916c37a6abe8408"
|
resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.8.tgz#af548ce1c211b2785478d3ba3e8da51e39a287e8"
|
||||||
integrity sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==
|
integrity sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
esbuild "^0.21.3"
|
esbuild "^0.21.3"
|
||||||
postcss "^8.4.43"
|
postcss "^8.4.43"
|
||||||
|
@@ -26,7 +26,7 @@ module.exports = {
|
|||||||
* Users
|
* Users
|
||||||
*/
|
*/
|
||||||
showUsers: function () {
|
showUsers: function () {
|
||||||
const controller = this;
|
let controller = this;
|
||||||
if (Cache.User.isAdmin()) {
|
if (Cache.User.isAdmin()) {
|
||||||
require(['./main', './users/main'], (App, View) => {
|
require(['./main', './users/main'], (App, View) => {
|
||||||
controller.navigate('/users');
|
controller.navigate('/users');
|
||||||
@@ -93,7 +93,8 @@ module.exports = {
|
|||||||
* Dashboard
|
* Dashboard
|
||||||
*/
|
*/
|
||||||
showDashboard: function () {
|
showDashboard: function () {
|
||||||
const controller = this;
|
let controller = this;
|
||||||
|
|
||||||
require(['./main', './dashboard/main'], (App, View) => {
|
require(['./main', './dashboard/main'], (App, View) => {
|
||||||
controller.navigate('/');
|
controller.navigate('/');
|
||||||
App.UI.showAppContent(new View());
|
App.UI.showAppContent(new View());
|
||||||
@@ -105,7 +106,7 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
showNginxProxy: function () {
|
showNginxProxy: function () {
|
||||||
if (Cache.User.isAdmin() || Cache.User.canView('proxy_hosts')) {
|
if (Cache.User.isAdmin() || Cache.User.canView('proxy_hosts')) {
|
||||||
const controller = this;
|
let controller = this;
|
||||||
|
|
||||||
require(['./main', './nginx/proxy/main'], (App, View) => {
|
require(['./main', './nginx/proxy/main'], (App, View) => {
|
||||||
controller.navigate('/nginx/proxy');
|
controller.navigate('/nginx/proxy');
|
||||||
@@ -145,7 +146,8 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
showNginxRedirection: function () {
|
showNginxRedirection: function () {
|
||||||
if (Cache.User.isAdmin() || Cache.User.canView('redirection_hosts')) {
|
if (Cache.User.isAdmin() || Cache.User.canView('redirection_hosts')) {
|
||||||
const controller = this;
|
let controller = this;
|
||||||
|
|
||||||
require(['./main', './nginx/redirection/main'], (App, View) => {
|
require(['./main', './nginx/redirection/main'], (App, View) => {
|
||||||
controller.navigate('/nginx/redirection');
|
controller.navigate('/nginx/redirection');
|
||||||
App.UI.showAppContent(new View());
|
App.UI.showAppContent(new View());
|
||||||
@@ -184,7 +186,8 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
showNginxStream: function () {
|
showNginxStream: function () {
|
||||||
if (Cache.User.isAdmin() || Cache.User.canView('streams')) {
|
if (Cache.User.isAdmin() || Cache.User.canView('streams')) {
|
||||||
const controller = this;
|
let controller = this;
|
||||||
|
|
||||||
require(['./main', './nginx/stream/main'], (App, View) => {
|
require(['./main', './nginx/stream/main'], (App, View) => {
|
||||||
controller.navigate('/nginx/stream');
|
controller.navigate('/nginx/stream');
|
||||||
App.UI.showAppContent(new View());
|
App.UI.showAppContent(new View());
|
||||||
@@ -223,7 +226,8 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
showNginxDead: function () {
|
showNginxDead: function () {
|
||||||
if (Cache.User.isAdmin() || Cache.User.canView('dead_hosts')) {
|
if (Cache.User.isAdmin() || Cache.User.canView('dead_hosts')) {
|
||||||
const controller = this;
|
let controller = this;
|
||||||
|
|
||||||
require(['./main', './nginx/dead/main'], (App, View) => {
|
require(['./main', './nginx/dead/main'], (App, View) => {
|
||||||
controller.navigate('/nginx/404');
|
controller.navigate('/nginx/404');
|
||||||
App.UI.showAppContent(new View());
|
App.UI.showAppContent(new View());
|
||||||
@@ -274,7 +278,8 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
showNginxAccess: function () {
|
showNginxAccess: function () {
|
||||||
if (Cache.User.isAdmin() || Cache.User.canView('access_lists')) {
|
if (Cache.User.isAdmin() || Cache.User.canView('access_lists')) {
|
||||||
const controller = this;
|
let controller = this;
|
||||||
|
|
||||||
require(['./main', './nginx/access/main'], (App, View) => {
|
require(['./main', './nginx/access/main'], (App, View) => {
|
||||||
controller.navigate('/nginx/access');
|
controller.navigate('/nginx/access');
|
||||||
App.UI.showAppContent(new View());
|
App.UI.showAppContent(new View());
|
||||||
@@ -313,7 +318,8 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
showNginxCertificates: function () {
|
showNginxCertificates: function () {
|
||||||
if (Cache.User.isAdmin() || Cache.User.canView('certificates')) {
|
if (Cache.User.isAdmin() || Cache.User.canView('certificates')) {
|
||||||
const controller = this;
|
let controller = this;
|
||||||
|
|
||||||
require(['./main', './nginx/certificates/main'], (App, View) => {
|
require(['./main', './nginx/certificates/main'], (App, View) => {
|
||||||
controller.navigate('/nginx/certificates');
|
controller.navigate('/nginx/certificates');
|
||||||
App.UI.showAppContent(new View());
|
App.UI.showAppContent(new View());
|
||||||
@@ -377,7 +383,7 @@ module.exports = {
|
|||||||
* Audit Log
|
* Audit Log
|
||||||
*/
|
*/
|
||||||
showAuditLog: function () {
|
showAuditLog: function () {
|
||||||
const controller = this;
|
let controller = this;
|
||||||
if (Cache.User.isAdmin()) {
|
if (Cache.User.isAdmin()) {
|
||||||
require(['./main', './audit-log/main'], (App, View) => {
|
require(['./main', './audit-log/main'], (App, View) => {
|
||||||
controller.navigate('/audit-log');
|
controller.navigate('/audit-log');
|
||||||
@@ -405,7 +411,7 @@ module.exports = {
|
|||||||
* Settings
|
* Settings
|
||||||
*/
|
*/
|
||||||
showSettings: function () {
|
showSettings: function () {
|
||||||
const controller = this;
|
let controller = this;
|
||||||
if (Cache.User.isAdmin()) {
|
if (Cache.User.isAdmin()) {
|
||||||
require(['./main', './settings/main'], (App, View) => {
|
require(['./main', './settings/main'], (App, View) => {
|
||||||
controller.navigate('/settings');
|
controller.navigate('/settings');
|
||||||
|
@@ -24,7 +24,7 @@ module.exports = Mn.View.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
templateContext: function () {
|
templateContext: function () {
|
||||||
const view = this;
|
let view = this;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
getUserName: function () {
|
getUserName: function () {
|
||||||
@@ -48,7 +48,8 @@ module.exports = Mn.View.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onRender: function () {
|
onRender: function () {
|
||||||
const view = this;
|
let view = this;
|
||||||
|
|
||||||
if (typeof view.stats.hosts === 'undefined') {
|
if (typeof view.stats.hosts === 'undefined') {
|
||||||
Api.Reports.getHostStats()
|
Api.Reports.getHostStats()
|
||||||
.then(response => {
|
.then(response => {
|
||||||
@@ -71,7 +72,8 @@ module.exports = Mn.View.extend({
|
|||||||
|
|
||||||
// calculate the available columns based on permissions for the objects
|
// calculate the available columns based on permissions for the objects
|
||||||
// and store as a variable
|
// and store as a variable
|
||||||
const perms = ['proxy_hosts', 'redirection_hosts', 'streams', 'dead_hosts'];
|
//let view = this;
|
||||||
|
let perms = ['proxy_hosts', 'redirection_hosts', 'streams', 'dead_hosts'];
|
||||||
|
|
||||||
perms.map(perm => {
|
perms.map(perm => {
|
||||||
this.columns += Cache.User.isAdmin() || Cache.User.canView(perm) ? 1 : 0;
|
this.columns += Cache.User.isAdmin() || Cache.User.canView(perm) ? 1 : 0;
|
||||||
|
@@ -33,13 +33,6 @@
|
|||||||
<td class="<%- isExpired() ? 'text-danger' : '' %>">
|
<td class="<%- isExpired() ? 'text-danger' : '' %>">
|
||||||
<%- formatDbDate(expires_on, 'Do MMMM YYYY, h:mm a') %>
|
<%- formatDbDate(expires_on, 'Do MMMM YYYY, h:mm a') %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<% if (active_domain_names().length > 0) { %>
|
|
||||||
<span class="status-icon bg-success"></span> <%- i18n('certificates', 'in-use') %>
|
|
||||||
<% } else { %>
|
|
||||||
<span class="status-icon bg-danger"></span> <%- i18n('certificates', 'inactive') %>
|
|
||||||
<% } %>
|
|
||||||
</td>
|
|
||||||
<% if (canManage) { %>
|
<% if (canManage) { %>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
<div class="item-action dropdown">
|
<div class="item-action dropdown">
|
||||||
@@ -55,13 +48,6 @@
|
|||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<% } %>
|
<% } %>
|
||||||
<a href="#" class="delete dropdown-item"><i class="dropdown-icon fe fe-trash-2"></i> <%- i18n('str', 'delete') %></a>
|
<a href="#" class="delete dropdown-item"><i class="dropdown-icon fe fe-trash-2"></i> <%- i18n('str', 'delete') %></a>
|
||||||
<% if (active_domain_names().length > 0) { %>
|
|
||||||
<div class="dropdown-divider"></div>
|
|
||||||
<span class="dropdown-header"><%- i18n('certificates', 'active-domain_names') %></span>
|
|
||||||
<% active_domain_names().forEach(function(host) { %>
|
|
||||||
<a href="https://<%- host %>" class="dropdown-item" target="_blank"><%- host %></a>
|
|
||||||
<% }); %>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@@ -44,24 +44,14 @@ module.exports = Mn.View.extend({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
templateContext: function () {
|
templateContext: {
|
||||||
return {
|
|
||||||
canManage: App.Cache.User.canManage('certificates'),
|
canManage: App.Cache.User.canManage('certificates'),
|
||||||
isExpired: function () {
|
isExpired: function () {
|
||||||
return moment(this.expires_on).isBefore(moment());
|
return moment(this.expires_on).isBefore(moment());
|
||||||
},
|
},
|
||||||
dns_providers: dns_providers,
|
dns_providers: dns_providers
|
||||||
active_domain_names: function () {
|
|
||||||
const { proxy_hosts = [], redirect_hosts = [], dead_hosts = [] } = this;
|
|
||||||
return [...proxy_hosts, ...redirect_hosts, ...dead_hosts].reduce((acc, host) => {
|
|
||||||
acc.push(...(host.domain_names || []));
|
|
||||||
return acc;
|
|
||||||
}, []);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
this.listenTo(this.model, 'change', this.render);
|
this.listenTo(this.model, 'change', this.render);
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
<th><%- i18n('str', 'name') %></th>
|
<th><%- i18n('str', 'name') %></th>
|
||||||
<th><%- i18n('all-hosts', 'cert-provider') %></th>
|
<th><%- i18n('all-hosts', 'cert-provider') %></th>
|
||||||
<th><%- i18n('str', 'expires') %></th>
|
<th><%- i18n('str', 'expires') %></th>
|
||||||
<th><%- i18n('str', 'status') %></th>
|
|
||||||
<% if (canManage) { %>
|
<% if (canManage) { %>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
@@ -74,7 +74,7 @@ module.exports = Mn.View.extend({
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let query = this.ui.query.val();
|
let query = this.ui.query.val();
|
||||||
|
|
||||||
this.fetch(['owner','proxy_hosts', 'dead_hosts', 'redirection_hosts'], query)
|
this.fetch(['owner'], query)
|
||||||
.then(response => this.showData(response))
|
.then(response => this.showData(response))
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.showError(err);
|
this.showError(err);
|
||||||
@@ -89,7 +89,7 @@ module.exports = Mn.View.extend({
|
|||||||
onRender: function () {
|
onRender: function () {
|
||||||
let view = this;
|
let view = this;
|
||||||
|
|
||||||
view.fetch(['owner','proxy_hosts', 'dead_hosts', 'redirection_hosts'])
|
view.fetch(['owner'])
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (!view.isDestroyed()) {
|
if (!view.isDestroyed()) {
|
||||||
if (response && response.length) {
|
if (response && response.length) {
|
||||||
|
@@ -208,10 +208,7 @@
|
|||||||
"reachability-other": "There is a server found at this domain but it returned an unexpected status code {code}. Is it the NPM server? Please make sure your domain points to the IP where your NPM instance is running.",
|
"reachability-other": "There is a server found at this domain but it returned an unexpected status code {code}. Is it the NPM server? Please make sure your domain points to the IP where your NPM instance is running.",
|
||||||
"download": "Download",
|
"download": "Download",
|
||||||
"renew-title": "Renew Let's Encrypt Certificate",
|
"renew-title": "Renew Let's Encrypt Certificate",
|
||||||
"search": "Search Certificate…",
|
"search": "Search Certificate…"
|
||||||
"in-use" : "In use",
|
|
||||||
"inactive": "Inactive",
|
|
||||||
"active-domain_names": "Active domain names"
|
|
||||||
},
|
},
|
||||||
"access-lists": {
|
"access-lists": {
|
||||||
"title": "Access Lists",
|
"title": "Access Lists",
|
||||||
|
@@ -161,11 +161,11 @@
|
|||||||
},
|
},
|
||||||
"domainoffensive": {
|
"domainoffensive": {
|
||||||
"name": "DomainOffensive (do.de)",
|
"name": "DomainOffensive (do.de)",
|
||||||
"package_name": "certbot-dns-domainoffensive",
|
"package_name": "certbot-dns-do",
|
||||||
"version": "~=2.0.0",
|
"version": "~=0.31.0",
|
||||||
"dependencies": "",
|
"dependencies": "",
|
||||||
"credentials": "dns_do_api_token = YOUR_DO_DE_AUTH_TOKEN",
|
"credentials": "dns_do_api_token = YOUR_DO_DE_AUTH_TOKEN",
|
||||||
"full_plugin_name": "dns-domainoffensive"
|
"full_plugin_name": "dns-do"
|
||||||
},
|
},
|
||||||
"domeneshop": {
|
"domeneshop": {
|
||||||
"name": "Domeneshop",
|
"name": "Domeneshop",
|
||||||
@@ -364,7 +364,7 @@
|
|||||||
"package_name": "certbot-dns-mijn-host",
|
"package_name": "certbot-dns-mijn-host",
|
||||||
"version": "~=0.0.4",
|
"version": "~=0.0.4",
|
||||||
"dependencies": "",
|
"dependencies": "",
|
||||||
"credentials": "dns_mijn_host_api_key=0123456789abcdef0123456789abcdef",
|
"credentials": "dns-mijn-host-credentials = /etc/letsencrypt/mijnhost-credentials.ini",
|
||||||
"full_plugin_name": "dns-mijn-host"
|
"full_plugin_name": "dns-mijn-host"
|
||||||
},
|
},
|
||||||
"namecheap": {
|
"namecheap": {
|
||||||
@@ -534,13 +534,5 @@
|
|||||||
"dependencies": "",
|
"dependencies": "",
|
||||||
"credentials": "edgedns_client_secret = as3d1asd5d1a32sdfsdfs2d1asd5=\nedgedns_host = sdflskjdf-dfsdfsdf-sdfsdfsdf.luna.akamaiapis.net\nedgedns_access_token = kjdsi3-34rfsdfsdf-234234fsdfsdf\nedgedns_client_token = dkfjdf-342fsdfsd-23fsdfsdfsdf",
|
"credentials": "edgedns_client_secret = as3d1asd5d1a32sdfsdfs2d1asd5=\nedgedns_host = sdflskjdf-dfsdfsdf-sdfsdfsdf.luna.akamaiapis.net\nedgedns_access_token = kjdsi3-34rfsdfsdf-234234fsdfsdf\nedgedns_client_token = dkfjdf-342fsdfsd-23fsdfsdfsdf",
|
||||||
"full_plugin_name": "edgedns"
|
"full_plugin_name": "edgedns"
|
||||||
},
|
|
||||||
"zoneedit": {
|
|
||||||
"name": "ZoneEdit",
|
|
||||||
"package_name": "certbot-dns-zoneedit",
|
|
||||||
"version": "~=0.3.2",
|
|
||||||
"dependencies": "--no-deps dnspython",
|
|
||||||
"credentials": "dns_zoneedit_user = <login-user-id>\ndns_zoneedit_token = <dyn-authentication-token>",
|
|
||||||
"full_plugin_name": "dns-zoneedit"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,22 +1,11 @@
|
|||||||
FROM cypress/included:14.0.1
|
FROM cypress/included:13.9.0
|
||||||
|
|
||||||
|
COPY --chown=1000 ./test /test
|
||||||
|
|
||||||
# Disable Cypress CLI colors
|
# Disable Cypress CLI colors
|
||||||
ENV FORCE_COLOR=0
|
ENV FORCE_COLOR=0
|
||||||
ENV NO_COLOR=1
|
ENV NO_COLOR=1
|
||||||
|
|
||||||
# testssl.sh and mkcert
|
|
||||||
RUN wget "https://github.com/testssl/testssl.sh/archive/refs/tags/v3.2rc4.tar.gz" -O /tmp/testssl.tgz -q \
|
|
||||||
&& tar -xzf /tmp/testssl.tgz -C /tmp \
|
|
||||||
&& mv /tmp/testssl.sh-3.2rc4 /testssl \
|
|
||||||
&& rm /tmp/testssl.tgz \
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y bsdmainutils curl dnsutils \
|
|
||||||
&& apt-get clean \
|
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& wget "https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-linux-amd64" -O /bin/mkcert \
|
|
||||||
&& chmod +x /bin/mkcert
|
|
||||||
|
|
||||||
COPY --chown=1000 ./test /test
|
|
||||||
WORKDIR /test
|
WORKDIR /test
|
||||||
RUN yarn install && yarn cache clean
|
RUN yarn install && yarn cache clean
|
||||||
ENTRYPOINT []
|
ENTRYPOINT []
|
||||||
|
@@ -1,213 +0,0 @@
|
|||||||
/// <reference types="cypress" />
|
|
||||||
|
|
||||||
describe('Streams', () => {
|
|
||||||
let token;
|
|
||||||
|
|
||||||
before(() => {
|
|
||||||
cy.getToken().then((tok) => {
|
|
||||||
token = tok;
|
|
||||||
// Set default site content
|
|
||||||
cy.task('backendApiPut', {
|
|
||||||
token: token,
|
|
||||||
path: '/api/settings/default-site',
|
|
||||||
data: {
|
|
||||||
value: 'html',
|
|
||||||
meta: {
|
|
||||||
html: '<p>yay it works</p>'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}).then((data) => {
|
|
||||||
cy.validateSwaggerSchema('put', 200, '/settings/{settingID}', data);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a custom cert pair
|
|
||||||
cy.exec('mkcert -cert-file=/test/cypress/fixtures/website1.pem -key-file=/test/cypress/fixtures/website1.key.pem website1.example.com').then((result) => {
|
|
||||||
expect(result.code).to.eq(0);
|
|
||||||
// Install CA
|
|
||||||
cy.exec('mkcert -install').then((result) => {
|
|
||||||
expect(result.code).to.eq(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
cy.exec('rm -f /test/results/testssl.json');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should be able to create TCP Stream', function() {
|
|
||||||
cy.task('backendApiPost', {
|
|
||||||
token: token,
|
|
||||||
path: '/api/nginx/streams',
|
|
||||||
data: {
|
|
||||||
incoming_port: 1500,
|
|
||||||
forwarding_host: '127.0.0.1',
|
|
||||||
forwarding_port: 80,
|
|
||||||
certificate_id: 0,
|
|
||||||
meta: {
|
|
||||||
dns_provider_credentials: "",
|
|
||||||
letsencrypt_agree: false,
|
|
||||||
dns_challenge: true
|
|
||||||
},
|
|
||||||
tcp_forwarding: true,
|
|
||||||
udp_forwarding: false
|
|
||||||
}
|
|
||||||
}).then((data) => {
|
|
||||||
cy.validateSwaggerSchema('post', 201, '/nginx/streams', data);
|
|
||||||
expect(data).to.have.property('id');
|
|
||||||
expect(data.id).to.be.greaterThan(0);
|
|
||||||
expect(data).to.have.property('enabled', true);
|
|
||||||
expect(data).to.have.property('tcp_forwarding', true);
|
|
||||||
expect(data).to.have.property('udp_forwarding', false);
|
|
||||||
|
|
||||||
cy.exec('curl --noproxy -- http://website1.example.com:1500').then((result) => {
|
|
||||||
expect(result.code).to.eq(0);
|
|
||||||
expect(result.stdout).to.contain('yay it works');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should be able to create UDP Stream', function() {
|
|
||||||
cy.task('backendApiPost', {
|
|
||||||
token: token,
|
|
||||||
path: '/api/nginx/streams',
|
|
||||||
data: {
|
|
||||||
incoming_port: 1501,
|
|
||||||
forwarding_host: '127.0.0.1',
|
|
||||||
forwarding_port: 80,
|
|
||||||
certificate_id: 0,
|
|
||||||
meta: {
|
|
||||||
dns_provider_credentials: "",
|
|
||||||
letsencrypt_agree: false,
|
|
||||||
dns_challenge: true
|
|
||||||
},
|
|
||||||
tcp_forwarding: false,
|
|
||||||
udp_forwarding: true
|
|
||||||
}
|
|
||||||
}).then((data) => {
|
|
||||||
cy.validateSwaggerSchema('post', 201, '/nginx/streams', data);
|
|
||||||
expect(data).to.have.property('id');
|
|
||||||
expect(data.id).to.be.greaterThan(0);
|
|
||||||
expect(data).to.have.property('enabled', true);
|
|
||||||
expect(data).to.have.property('tcp_forwarding', false);
|
|
||||||
expect(data).to.have.property('udp_forwarding', true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should be able to create TCP/UDP Stream', function() {
|
|
||||||
cy.task('backendApiPost', {
|
|
||||||
token: token,
|
|
||||||
path: '/api/nginx/streams',
|
|
||||||
data: {
|
|
||||||
incoming_port: 1502,
|
|
||||||
forwarding_host: '127.0.0.1',
|
|
||||||
forwarding_port: 80,
|
|
||||||
certificate_id: 0,
|
|
||||||
meta: {
|
|
||||||
dns_provider_credentials: "",
|
|
||||||
letsencrypt_agree: false,
|
|
||||||
dns_challenge: true
|
|
||||||
},
|
|
||||||
tcp_forwarding: true,
|
|
||||||
udp_forwarding: true
|
|
||||||
}
|
|
||||||
}).then((data) => {
|
|
||||||
cy.validateSwaggerSchema('post', 201, '/nginx/streams', data);
|
|
||||||
expect(data).to.have.property('id');
|
|
||||||
expect(data.id).to.be.greaterThan(0);
|
|
||||||
expect(data).to.have.property('enabled', true);
|
|
||||||
expect(data).to.have.property('tcp_forwarding', true);
|
|
||||||
expect(data).to.have.property('udp_forwarding', true);
|
|
||||||
|
|
||||||
cy.exec('curl --noproxy -- http://website1.example.com:1502').then((result) => {
|
|
||||||
expect(result.code).to.eq(0);
|
|
||||||
expect(result.stdout).to.contain('yay it works');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should be able to create SSL TCP Stream', function() {
|
|
||||||
let certID = 0;
|
|
||||||
|
|
||||||
// Create custom cert
|
|
||||||
cy.task('backendApiPost', {
|
|
||||||
token: token,
|
|
||||||
path: '/api/nginx/certificates',
|
|
||||||
data: {
|
|
||||||
provider: "other",
|
|
||||||
nice_name: "Custom Certificate for SSL Stream",
|
|
||||||
},
|
|
||||||
}).then((data) => {
|
|
||||||
cy.validateSwaggerSchema('post', 201, '/nginx/certificates', data);
|
|
||||||
expect(data).to.have.property('id');
|
|
||||||
certID = data.id;
|
|
||||||
|
|
||||||
// Upload files
|
|
||||||
cy.task('backendApiPostFiles', {
|
|
||||||
token: token,
|
|
||||||
path: `/api/nginx/certificates/${certID}/upload`,
|
|
||||||
files: {
|
|
||||||
certificate: 'website1.pem',
|
|
||||||
certificate_key: 'website1.key.pem',
|
|
||||||
},
|
|
||||||
}).then((data) => {
|
|
||||||
cy.validateSwaggerSchema('post', 200, '/nginx/certificates/{certID}/upload', data);
|
|
||||||
expect(data).to.have.property('certificate');
|
|
||||||
expect(data).to.have.property('certificate_key');
|
|
||||||
|
|
||||||
// Create the stream
|
|
||||||
cy.task('backendApiPost', {
|
|
||||||
token: token,
|
|
||||||
path: '/api/nginx/streams',
|
|
||||||
data: {
|
|
||||||
incoming_port: 1503,
|
|
||||||
forwarding_host: '127.0.0.1',
|
|
||||||
forwarding_port: 80,
|
|
||||||
certificate_id: certID,
|
|
||||||
meta: {
|
|
||||||
dns_provider_credentials: "",
|
|
||||||
letsencrypt_agree: false,
|
|
||||||
dns_challenge: true
|
|
||||||
},
|
|
||||||
tcp_forwarding: true,
|
|
||||||
udp_forwarding: false
|
|
||||||
}
|
|
||||||
}).then((data) => {
|
|
||||||
cy.validateSwaggerSchema('post', 201, '/nginx/streams', data);
|
|
||||||
expect(data).to.have.property('id');
|
|
||||||
expect(data.id).to.be.greaterThan(0);
|
|
||||||
expect(data).to.have.property("enabled", true);
|
|
||||||
expect(data).to.have.property('tcp_forwarding', true);
|
|
||||||
expect(data).to.have.property('udp_forwarding', false);
|
|
||||||
expect(data).to.have.property('certificate_id', certID);
|
|
||||||
|
|
||||||
// Check the ssl termination
|
|
||||||
cy.task('log', '[testssl.sh] Running ...');
|
|
||||||
cy.exec('/testssl/testssl.sh --quiet --add-ca="$(/bin/mkcert -CAROOT)/rootCA.pem" --jsonfile=/test/results/testssl.json website1.example.com:1503', {
|
|
||||||
timeout: 120000, // 2 minutes
|
|
||||||
}).then((result) => {
|
|
||||||
cy.task('log', '[testssl.sh] ' + result.stdout);
|
|
||||||
|
|
||||||
const allowedSeverities = ["INFO", "OK", "LOW", "MEDIUM"];
|
|
||||||
const ignoredIDs = [
|
|
||||||
'cert_chain_of_trust',
|
|
||||||
'cert_extlifeSpan',
|
|
||||||
'cert_revocation',
|
|
||||||
'overall_grade',
|
|
||||||
];
|
|
||||||
|
|
||||||
cy.readFile('/test/results/testssl.json').then((data) => {
|
|
||||||
// Parse each array item
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
|
||||||
const item = data[i];
|
|
||||||
if (ignoredIDs.includes(item.id)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
expect(item.severity).to.be.oneOf(allowedSeverities);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
@@ -4,18 +4,18 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jc21/cypress-swagger-validation": "^0.3.2",
|
"@jc21/cypress-swagger-validation": "^0.3.1",
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.7.7",
|
||||||
"cypress": "^14.0.1",
|
"cypress": "^13.15.0",
|
||||||
"cypress-multi-reporters": "^2.0.5",
|
"cypress-multi-reporters": "^1.6.4",
|
||||||
"cypress-wait-until": "^3.0.2",
|
"cypress-wait-until": "^3.0.2",
|
||||||
"eslint": "^9.19.0",
|
"eslint": "^9.12.0",
|
||||||
"eslint-plugin-align-assignments": "^1.1.2",
|
"eslint-plugin-align-assignments": "^1.1.2",
|
||||||
"eslint-plugin-chai-friendly": "^1.0.1",
|
"eslint-plugin-chai-friendly": "^1.0.1",
|
||||||
"eslint-plugin-cypress": "^4.1.0",
|
"eslint-plugin-cypress": "^3.5.0",
|
||||||
"form-data": "^4.0.1",
|
"form-data": "^4.0.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mocha": "^11.1.0",
|
"mocha": "^10.7.3",
|
||||||
"mocha-junit-reporter": "^2.2.1"
|
"mocha-junit-reporter": "^2.2.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Reference in New Issue
Block a user