Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #1538 from jc21/adds-http-challenge-test
Adds buttons to test availability of server from public internet
- Loading branch information
Showing
with
348 additions
and 7 deletions.
- +90 −0 backend/internal/certificate.js
- +50 −0 backend/migrations/20211108145214_regenerate_default_host.js
- +26 −1 backend/routes/api/nginx/certificates.js
- +11 −0 backend/schema/endpoints/certificates.json
- +10 −0 frontend/js/app/api.js
- +13 −0 frontend/js/app/controller.js
- +8 −0 frontend/js/app/nginx/certificates/form.ejs
- +26 −1 frontend/js/app/nginx/certificates/form.js
- +3 −0 frontend/js/app/nginx/certificates/list/item.ejs
- +11 −5 frontend/js/app/nginx/certificates/list/item.js
- +15 −0 frontend/js/app/nginx/certificates/test.ejs
- +75 −0 frontend/js/app/nginx/certificates/test.js
- +10 −0 frontend/js/i18n/messages.json
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,50 @@ | ||
const migrate_name = 'stream_domain'; | ||
const logger = require('../logger').migrate; | ||
const internalNginx = require('../internal/nginx'); | ||
|
||
async function regenerateDefaultHost(knex) { | ||
const row = await knex('setting').select('*').where('id', 'default-site').first(); | ||
|
||
if (!row) { | ||
return Promise.resolve(); | ||
} | ||
|
||
return internalNginx.deleteConfig('default') | ||
.then(() => { | ||
return internalNginx.generateConfig('default', row); | ||
}) | ||
.then(() => { | ||
return internalNginx.test(); | ||
}) | ||
.then(() => { | ||
return internalNginx.reload(); | ||
}); | ||
} | ||
|
||
/** | ||
* Migrate | ||
* | ||
* @see http://knexjs.org/#Schema | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.up = function (knex) { | ||
logger.info('[' + migrate_name + '] Migrating Up...'); | ||
|
||
return regenerateDefaultHost(knex); | ||
}; | ||
|
||
/** | ||
* Undo Migrate | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.down = function (knex) { | ||
logger.info('[' + migrate_name + '] Migrating Down...'); | ||
|
||
return regenerateDefaultHost(knex); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,15 @@ | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title"><%- i18n('certificates', 'reachability-title') %></h5> | ||
</div> | ||
<div class="modal-body"> | ||
<div class="waiting text-center"> | ||
<%= i18n('str', 'please-wait') %> | ||
</div> | ||
<div class="alert alert-danger error" role="alert"></div> | ||
<div class="alert alert-success success" role="alert"></div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary cancel" disabled><%- i18n('str', 'close') %></button> | ||
</div> | ||
</div> |
Oops, something went wrong.