Fixes for upgraded debian trixie

- Adds request logging in debug mode for some endpoints
- Moves certbot version determination to the startup scripts and removes
  bash script encapsulation when installing plugins
- Revert loose domain validation, which was there for a specific reason
  addressing CVE's
- Fix Cypress suite for cert generation
- Adds Cypress test that iterates over the entire certbot plugins list
  and installs each one, ensuring at the very least that the install
  works
- Fixed some plugins based on this
- (!) Still some work to do on this, hostinger is still broken at least
- Improved cypress tests for custom certs; they will generate on each
  run instead of being baked in. The baked ones were due to expire soon
This commit is contained in:
Jamie Curnow
2026-05-25 07:37:24 +10:00
parent c354238c35
commit 03c70e3902
19 changed files with 197 additions and 49 deletions
+28
View File
@@ -0,0 +1,28 @@
/// <reference types="cypress" />
// Only tested once in the sqlite stack
describe('CertbotPlugins', () => {
it('Should install all certbot plugins', () => {
cy.env(['stack']).then(({ stack }) => {
cy.log(`CertbotPlugins.cy.js - Running tests for stack: ${stack}`);
if (stack === 'sqlite') {
cy.task('backendApiGet', {
path: '/api/ci/certbot-plugins',
}).then((data) => {
expect(data).to.be.an('object');
// Install each plugin
for (const plugin of Object.keys(data)) {
cy.log(`Installing plugin: ${plugin}`);
cy.task('backendApiPost', {
path: `/api/ci/certbot-plugins/${plugin}`,
}).then((result) => {
expect(result).to.be.true;
});
}
});
}
});
});
});
+13 -5
View File
@@ -4,8 +4,16 @@ describe('Certificates endpoints', () => {
let token;
let certID;
const certFile = 'test.example.com.pem';
const keyFile = 'test.example.com-key.pem';
before(() => {
cy.createCustomCerts();
cy.createCustomCerts({
domain: 'test.example.com',
certFile,
keyFile,
})
cy.resetUsers();
cy.getToken().then((tok) => {
token = tok;
@@ -17,8 +25,8 @@ describe('Certificates endpoints', () => {
token: token,
path: '/api/nginx/certificates/validate',
files: {
certificate: 'test.example.com.pem',
certificate_key: 'test.example.com-key.pem',
certificate: certFile,
certificate_key: keyFile,
},
}).then((data) => {
cy.validateSwaggerSchema('post', 200, '/nginx/certificates/validate', data);
@@ -46,8 +54,8 @@ describe('Certificates endpoints', () => {
token: token,
path: `/api/nginx/certificates/${certID}/upload`,
files: {
certificate: 'test.example.com.pem',
certificate_key: 'test.example.com-key.pem',
certificate: certFile,
certificate_key: keyFile,
},
}).then((data) => {
cy.validateSwaggerSchema('post', 200, '/nginx/certificates/{certID}/upload', data);
+11 -13
View File
@@ -3,7 +3,16 @@
describe('Streams', () => {
let token;
const certFile = 'website1.pem';
const keyFile = 'website1.key.pem';
before(() => {
cy.createCustomCerts({
domain: 'website1.example.com',
certFile,
keyFile,
})
cy.resetUsers();
cy.getToken().then((tok) => {
token = tok;
@@ -22,17 +31,6 @@ describe('Streams', () => {
});
});
// Create a custom cert pair
cy.task('getFixturesFolder').then((fixturesFolder) => {
cy.exec(`mkcert -cert-file=${fixturesFolder}/website1.pem -key-file=${fixturesFolder}/website1.key.pem website1.example.com`).then((result) => {
expect(result.exitCode).to.eq(0);
// Install CA
cy.exec('mkcert -install').then((result) => {
expect(result.exitCode).to.eq(0);
});
});
});
cy.exec('rm -f /test/results/testssl.json');
});
@@ -136,8 +134,8 @@ describe('Streams', () => {
token: token,
path: `/api/nginx/certificates/${certID}/upload`,
files: {
certificate: 'website1.pem',
certificate_key: 'website1.key.pem',
certificate: certFile,
certificate_key: keyFile,
},
}).then((data) => {
cy.validateSwaggerSchema('post', 200, '/nginx/certificates/{certID}/upload', data);