mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-05-01 11:32:28 +00:00
Compare commits
3 Commits
6e820a36ac
...
aa15052eea
Author | SHA1 | Date | |
---|---|---|---|
|
aa15052eea | ||
|
c556b8acef | ||
|
4d60876394 |
@ -25,6 +25,7 @@ COPY scripts /scripts
|
||||
COPY backend /app
|
||||
WORKDIR /app
|
||||
|
||||
ARG ARG TARGETPLATFORM
|
||||
RUN mkdir -p /dist \
|
||||
&& /scripts/go-multiarch-wrapper /dist/server /dist/ipranges
|
||||
|
||||
@ -61,6 +62,7 @@ RUN apt-get update \
|
||||
&& rm -rf /var/lib/apt/lists/* /etc/fail2ban
|
||||
|
||||
# s6 overlay
|
||||
ARG TARGETPLATFORM
|
||||
COPY scripts/install-s6 /tmp/install-s6
|
||||
RUN /tmp/install-s6 "${TARGETPLATFORM}" && rm -rf /tmp/*
|
||||
|
||||
|
Binary file not shown.
@ -1,6 +1,10 @@
|
||||
# WARNING: This is a CI docker-compose file used for building and testing of the entire app, it should not be used for production.
|
||||
services:
|
||||
|
||||
cypress:
|
||||
environment:
|
||||
CYPRESS_stack: 'mysql'
|
||||
|
||||
fullstack:
|
||||
environment:
|
||||
NPM_DB_DRIVER: 'mysql'
|
||||
|
@ -1,6 +1,10 @@
|
||||
# WARNING: This is a CI docker-compose file used for building and testing of the entire app, it should not be used for production.
|
||||
services:
|
||||
|
||||
cypress:
|
||||
environment:
|
||||
CYPRESS_stack: 'postgres'
|
||||
|
||||
fullstack:
|
||||
environment:
|
||||
NPM_DB_DRIVER: 'postgres'
|
||||
|
@ -83,6 +83,7 @@ services:
|
||||
dockerfile: test/cypress/Dockerfile
|
||||
environment:
|
||||
CYPRESS_baseUrl: 'http://fullstack:81'
|
||||
CYPRESS_stack: 'sqlite'
|
||||
volumes:
|
||||
- 'cypress_logs:/results'
|
||||
- './dev/resolv.conf:/etc/resolv.conf:ro'
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM cypress/included:13.9.0
|
||||
FROM cypress/included:13.15.1
|
||||
|
||||
COPY --chown=1000 ./test /test
|
||||
|
||||
|
71
test/cypress/e2e/api/Ldap.cy.js
Normal file
71
test/cypress/e2e/api/Ldap.cy.js
Normal file
@ -0,0 +1,71 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
const { curry } = require("lodash");
|
||||
|
||||
// WIP
|
||||
|
||||
describe('LDAP with Authentik', () => {
|
||||
let token;
|
||||
if (Cypress.env('stack') === 'postgres') {
|
||||
|
||||
before(() => {
|
||||
cy.task('log', 'STACK IS: ' + Cypress.env('stack'));
|
||||
|
||||
cy.resetUsers();
|
||||
cy.getToken().then((tok) => {
|
||||
token = tok;
|
||||
|
||||
cy.task('backendApiPut', {
|
||||
token: token,
|
||||
path: '/api/settings/ldap-auth',
|
||||
data: {
|
||||
value: {
|
||||
host: 'authentik-ldap:3389',
|
||||
base_dn: 'ou=users,DC=ldap,DC=goauthentik,DC=io',
|
||||
user_dn: 'cn={{USERNAME}},ou=users,DC=ldap,DC=goauthentik,DC=io',
|
||||
email_property: 'mail',
|
||||
name_property: 'sn',
|
||||
self_filter: '(&(cn={{USERNAME}})(ak-active=TRUE))',
|
||||
auto_create_user: true
|
||||
}
|
||||
}
|
||||
}).then((data) => {
|
||||
cy.validateSwaggerSchema('put', 200, '/settings/{name}', data);
|
||||
expect(data.result).to.have.property('id');
|
||||
expect(data.result.id).to.be.greaterThan(0);
|
||||
});
|
||||
|
||||
cy.task('backendApiPut', {
|
||||
token: token,
|
||||
path: '/api/settings/auth-methods',
|
||||
data: {
|
||||
value: [
|
||||
'local',
|
||||
'ldap'
|
||||
]
|
||||
}
|
||||
}).then((data) => {
|
||||
cy.validateSwaggerSchema('put', 200, '/settings/{name}', data);
|
||||
expect(data.result).to.have.property('id');
|
||||
expect(data.result.id).to.be.greaterThan(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Should log in with LDAP', function() {
|
||||
cy.task('backendApiPost', {
|
||||
token: token,
|
||||
path: '/api/auth',
|
||||
data: {
|
||||
// Authentik LDAP creds:
|
||||
type: 'ldap',
|
||||
identity: 'cypress',
|
||||
secret: 'fqXBfUYqHvYqiwBHWW7f'
|
||||
}
|
||||
}).then((data) => {
|
||||
cy.validateSwaggerSchema('post', 200, '/auth', data);
|
||||
expect(data.result).to.have.property('token');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
@ -1,4 +1,5 @@
|
||||
const {SwaggerValidation} = require('@jc21/cypress-swagger-validation');
|
||||
const chalk = require('chalk');
|
||||
|
||||
module.exports = (on, config) => {
|
||||
// Replace swaggerFile config var wildcard
|
||||
@ -11,7 +12,7 @@ module.exports = (on, config) => {
|
||||
on('task', require('./backendApi/task')(config));
|
||||
on('task', {
|
||||
log(message) {
|
||||
console.log(message);
|
||||
console.log(chalk.cyan.bold('[') + chalk.blue.bold('LOG') + chalk.cyan.bold(']') + ' ' + chalk.red.bold(message));
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
@ -4,18 +4,18 @@
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@jc21/cypress-swagger-validation": "^0.2.6",
|
||||
"@jc21/cypress-swagger-validation": "^0.3.1",
|
||||
"@jc21/restler": "^3.4.0",
|
||||
"chalk": "^4.1.0",
|
||||
"cypress": "^13.9.0",
|
||||
"cypress-multi-reporters": "^1.6.4",
|
||||
"cypress-wait-until": "^3.0.1",
|
||||
"eslint": "^9.3.0",
|
||||
"cypress": "^13.15.1",
|
||||
"cypress-multi-reporters": "^2.0.4",
|
||||
"cypress-wait-until": "^3.0.2",
|
||||
"eslint": "^9.14.0",
|
||||
"eslint-plugin-align-assignments": "^1.1.2",
|
||||
"eslint-plugin-chai-friendly": "^0.7.4",
|
||||
"eslint-plugin-cypress": "^3.2.0",
|
||||
"eslint-plugin-chai-friendly": "^1.0.1",
|
||||
"eslint-plugin-cypress": "^4.1.0",
|
||||
"lodash": "^4.17.21",
|
||||
"mocha": "^10.4.0",
|
||||
"mocha": "^10.8.2",
|
||||
"mocha-junit-reporter": "^2.2.1"
|
||||
},
|
||||
"scripts": {
|
||||
|
693
test/yarn.lock
693
test/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user