mirror of
https://github.com/jeffcaldwellca/mkcertWeb.git
synced 2026-05-03 04:50:57 -05:00
bugfixes for certificate upload retrieval
This commit is contained in:
+5
-5
@@ -1177,7 +1177,7 @@ async function uploadFiles(files) {
|
||||
// Update progress
|
||||
updateProgress(25, 'Uploading files...');
|
||||
|
||||
const response = await fetch('/api/certificates/upload', {
|
||||
const response = await fetch('/api/upload', {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
credentials: 'same-origin'
|
||||
@@ -1415,22 +1415,22 @@ async function downloadFile(url, filename) {
|
||||
}
|
||||
|
||||
function downloadCert(folderParam, filename) {
|
||||
const url = API_BASE + '/download/cert/' + folderParam + '/' + filename;
|
||||
const url = API_BASE + '/api/download/cert/' + folderParam + '/' + filename;
|
||||
downloadFile(url, filename);
|
||||
}
|
||||
|
||||
function downloadKey(folderParam, filename) {
|
||||
const url = API_BASE + '/download/key/' + folderParam + '/' + filename;
|
||||
const url = API_BASE + '/api/download/key/' + folderParam + '/' + filename;
|
||||
downloadFile(url, filename);
|
||||
}
|
||||
|
||||
function downloadBundle(folderParam, certname) {
|
||||
const url = API_BASE + '/download/bundle/' + folderParam + '/' + certname;
|
||||
const url = API_BASE + '/api/download/bundle/' + folderParam + '/' + certname;
|
||||
downloadFile(url, certname + '.zip');
|
||||
}
|
||||
|
||||
function downloadRootCA() {
|
||||
const url = API_BASE + '/download/rootca';
|
||||
const url = API_BASE + '/api/download/rootca';
|
||||
downloadFile(url, 'mkcert-rootCA.pem');
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,11 @@ const { createSCEPRoutes } = require('./src/routes/scep');
|
||||
// Import notification routes and services
|
||||
const createNotificationRoutes = require('./src/routes/notifications');
|
||||
|
||||
// Import certificate, system, and settings routes
|
||||
// Import certificate, system, settings, and file routes
|
||||
const { createCertificateRoutes } = require('./src/routes/certificates');
|
||||
const { createSystemRoutes } = require('./src/routes/system');
|
||||
const createSettingsRoutes = require('./src/routes/settings');
|
||||
const { createFileRoutes } = require('./src/routes/files');
|
||||
|
||||
const config = require('./src/config');
|
||||
const { EmailService } = require('./src/services/emailService');
|
||||
@@ -282,6 +283,9 @@ app.use(createNotificationRoutes(config, rateLimiters, requireAuth, emailService
|
||||
// Mount certificate routes
|
||||
app.use(createCertificateRoutes(config, rateLimiters, requireAuth));
|
||||
|
||||
// Mount file routes (upload/download)
|
||||
app.use(createFileRoutes(config, rateLimiters, requireAuth));
|
||||
|
||||
// Mount SCEP routes (must be before system routes to avoid catch-all)
|
||||
app.use(createSCEPRoutes(config, rateLimiters, requireAuth));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user