Added option to specify traefik port

This commit is contained in:
SKP
2019-07-03 21:33:45 +02:00
committed by kexkey
parent 5b7fceebe2
commit 138dea305e
2 changed files with 32 additions and 3 deletions

View File

@@ -2,12 +2,41 @@ const chalk = require('chalk');
const name = 'traefik';
const capitalise = function( txt ) {
return txt.charAt(0).toUpperCase() + txt.substr(1);
};
const prefix = function() {
return chalk.green(capitalise(name)+': ');
};
module.exports = {
name: function() {
return name;
},
prompts: function( utils ) {
return [];
return [
{
type: 'input',
name: 'traefik_http_port',
default: utils.getDefault( 'traefik_http_port' ),
message: prefix()+'The HTTP port your apps will be accessible to the internet on.'+utils.getHelp('traefik_http_port'),
filter: utils.trimFilter,
validate: function( port ) {
return utils.notEmptyValidator( port ) && !isNaN( parseInt(port) )
}
},
{
type: 'input',
name: 'traefik_https_port',
default: utils.getDefault( 'traefik_https_port' ),
message: prefix()+'The HTTPS port your apps will be accessible to the internet on.'+utils.getHelp('traefik_https_port'),
filter: utils.trimFilter,
validate: function( port ) {
return utils.notEmptyValidator( port ) && !isNaN( parseInt(port) )
}
}
];
},
templates: function( props ) {
return [ 'acme.json', 'traefik.toml', 'htpasswd' ];

View File

@@ -5,11 +5,11 @@ defaultEntryPoints = ["https","http"]
[entryPoints]
[entryPoints.http]
address = ":80"
address = ":<%= traefik_http_port %>"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
address = ":<%= traefik_https_port %>"
[entryPoints.https.tls]
[retry]