mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-01-31 18:24:26 +01:00
added gatekeeper port option to config tool
This commit is contained in:
@@ -11,7 +11,7 @@ RUN apk add --update --no-cache \
|
||||
su-exec
|
||||
|
||||
COPY auth.sh /etc/nginx/conf.d/
|
||||
COPY default-ssl.conf /etc/nginx/conf.d/default.conf
|
||||
COPY default.conf /etc/nginx/conf.d/default.conf
|
||||
COPY statuspage.html /etc/nginx/conf.d/status/
|
||||
COPY entrypoint.sh entrypoint.sh
|
||||
COPY trace.sh /etc/nginx/conf.d/
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name localhost;
|
||||
|
||||
#include /etc/nginx/conf.d/ip-whitelist.conf;
|
||||
|
||||
ssl_certificate /etc/ssl/certs/cert.pem;
|
||||
ssl_certificate_key /etc/ssl/private/key.pem;
|
||||
|
||||
location /status {
|
||||
auth_basic "status";
|
||||
auth_basic_user_file conf.d/status/htpasswd;
|
||||
root /etc/nginx/conf.d;
|
||||
index statuspage.html;
|
||||
}
|
||||
|
||||
location /v0/ {
|
||||
auth_request /auth;
|
||||
proxy_pass http://proxy:8888/;
|
||||
}
|
||||
|
||||
location /auth {
|
||||
internal;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME /etc/nginx/conf.d/auth.sh;
|
||||
fastcgi_pass unix:/var/run/fcgiwrap.socket;
|
||||
}
|
||||
|
||||
#error_page 404 /404.html;
|
||||
|
||||
# redirect server error pages to the static page /50x.html
|
||||
#
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,19 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen 443 ssl;
|
||||
server_name localhost;
|
||||
|
||||
#include /etc/nginx/conf.d/ip-whitelist.conf;
|
||||
|
||||
ssl_certificate /etc/ssl/certs/cert.pem;
|
||||
ssl_certificate_key /etc/ssl/private/key.pem;
|
||||
|
||||
location /status {
|
||||
auth_basic "status";
|
||||
auth_basic_user_file conf.d/status/htpasswd;
|
||||
root /etc/nginx/conf.d;
|
||||
index statuspage.html;
|
||||
}
|
||||
|
||||
location /v0/ {
|
||||
auth_request /auth;
|
||||
proxy_pass http://proxy:8888/;
|
||||
|
||||
@@ -406,6 +406,7 @@ module.exports = class extends Generator {
|
||||
bitcoin_mode: 'internal',
|
||||
bitcoin_expose: false,
|
||||
lightning_expose: true,
|
||||
gatekeeper_port: 443,
|
||||
gatekeeper_apiproperties: defaultAPIProperties,
|
||||
gatekeeper_ipwhitelist: '',
|
||||
gatekeeper_keys: { configEntries: [], clientInformation: [] },
|
||||
|
||||
@@ -39,62 +39,72 @@ module.exports = {
|
||||
filter: utils._trimFilter,
|
||||
validate: utils._notEmptyValidator
|
||||
},
|
||||
{
|
||||
when: function( props ) {
|
||||
// hacky hack
|
||||
password = props.gatekeeper_clientkeyspassword;
|
||||
return true;
|
||||
},
|
||||
type: 'password',
|
||||
name: 'gatekeeper_clientkeyspassword_c',
|
||||
default: utils._getDefault( 'gatekeeper_clientkeyspassword_c' ),
|
||||
message: prefix()+'Confirm your client keys password.'+utils._getHelp('gatekeeper_clientkeyspassword_c'),
|
||||
filter: utils._trimFilter,
|
||||
validate: function( input ) {
|
||||
if(input !== password) {
|
||||
throw new Error( 'Client keys passwords do not match' );
|
||||
}
|
||||
return true;
|
||||
{
|
||||
when: function( props ) {
|
||||
// hacky hack
|
||||
password = props.gatekeeper_clientkeyspassword;
|
||||
return true;
|
||||
},
|
||||
type: 'password',
|
||||
name: 'gatekeeper_clientkeyspassword_c',
|
||||
default: utils._getDefault( 'gatekeeper_clientkeyspassword_c' ),
|
||||
message: prefix()+'Confirm your client keys password.'+utils._getHelp('gatekeeper_clientkeyspassword_c'),
|
||||
filter: utils._trimFilter,
|
||||
validate: function( input ) {
|
||||
if(input !== password) {
|
||||
throw new Error( 'Client keys passwords do not match' );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
name: 'gatekeeper_port',
|
||||
default: utils._getDefault( 'gatekeeper_port' ),
|
||||
message: prefix()+'The port gatekeeper will listen on for requests'+utils._getHelp('gatekeeper_port'),
|
||||
filter: utils._trimFilter,
|
||||
validate: function( port ) {
|
||||
return utils._notEmptyValidator( port ) && !isNaN( parseInt(port) )
|
||||
}
|
||||
},
|
||||
{
|
||||
when: function() { return hasAuthKeys( utils.props ); },
|
||||
type: 'confirm',
|
||||
name: 'gatekeeper_recreatekeys',
|
||||
default: false,
|
||||
message: prefix()+'Recreate gatekeeper keys?'+utils._getHelp('gatekeeper_recreatekeys')
|
||||
},
|
||||
{
|
||||
when: function() { return hasCert( utils.props ); },
|
||||
type: 'confirm',
|
||||
name: 'gatekeeper_recreatecert',
|
||||
default: false,
|
||||
message: prefix()+'Recreate gatekeeper certificate?'+utils._getHelp('gatekeeper_recreatecert')
|
||||
},
|
||||
{
|
||||
when: function(props) { return !hasCert( utils.props ) || props.gatekeeper_recreatecert },
|
||||
type: 'input',
|
||||
name: 'gatekeeper_cns',
|
||||
default: utils._getDefault( 'gatekeeper_cns' ),
|
||||
message: prefix()+'Gatekeeper cert CNS (ips, domains, wildcard domains seperated by comma)?'+utils._getHelp('gatekeeper_cns')
|
||||
},
|
||||
{
|
||||
type: 'confirm',
|
||||
name: 'gatekeeper_edit_apiproperties',
|
||||
default: false,
|
||||
message: prefix()+'Edit API properties?'+utils._getHelp('gatekeeper_edit_apiproperties')
|
||||
},
|
||||
{
|
||||
when: function( props ) {
|
||||
const r = props.gatekeeper_edit_apiproperties;
|
||||
delete props.gatekeeper_edit_apiproperties;
|
||||
return r;
|
||||
},
|
||||
{
|
||||
when: function() { return hasAuthKeys( utils.props ); },
|
||||
type: 'confirm',
|
||||
name: 'gatekeeper_recreatekeys',
|
||||
default: false,
|
||||
message: prefix()+'Recreate gatekeeper keys?'+utils._getHelp('gatekeeper_recreatekeys')
|
||||
},
|
||||
{
|
||||
when: function() { return hasCert( utils.props ); },
|
||||
type: 'confirm',
|
||||
name: 'gatekeeper_recreatecert',
|
||||
default: false,
|
||||
message: prefix()+'Recreate gatekeeper certificate?'+utils._getHelp('gatekeeper_recreatecert')
|
||||
},
|
||||
{
|
||||
when: function(props) { return !hasCert( utils.props ) || props.gatekeeper_recreatecert },
|
||||
type: 'input',
|
||||
name: 'gatekeeper_cns',
|
||||
default: utils._getDefault( 'gatekeeper_cns' ),
|
||||
message: prefix()+'Gatekeeper cert CNS (ips, domains, wildcard domains seperated by comma)?'+utils._getHelp('gatekeeper_cns')
|
||||
},
|
||||
{
|
||||
type: 'confirm',
|
||||
name: 'gatekeeper_edit_apiproperties',
|
||||
default: false,
|
||||
message: prefix()+'Edit API properties?'+utils._getHelp('gatekeeper_edit_apiproperties')
|
||||
},
|
||||
{
|
||||
when: function( props ) {
|
||||
const r = props.gatekeeper_edit_apiproperties;
|
||||
delete props.gatekeeper_edit_apiproperties;
|
||||
return r;
|
||||
},
|
||||
type: 'editor',
|
||||
name: 'gatekeeper_apiproperties',
|
||||
message: utils._getHelp('gatekeeper_apiproperties')||' ',
|
||||
default: utils._getDefault( 'gatekeeper_apiproperties' )
|
||||
}];
|
||||
type: 'editor',
|
||||
name: 'gatekeeper_apiproperties',
|
||||
message: utils._getHelp('gatekeeper_apiproperties')||' ',
|
||||
default: utils._getDefault( 'gatekeeper_apiproperties' )
|
||||
}];
|
||||
},
|
||||
templates: function( props ) {
|
||||
return [ 'keys.properties', 'api.properties', 'cert.pem', 'key.pem', 'htpasswd' ];
|
||||
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
- "TRACING=1"
|
||||
image: cyphernode/gatekeeper:<%= gatekeeper_version %>
|
||||
ports:
|
||||
- "443:443"
|
||||
- "<%= gatekeeper_port %>:443"
|
||||
volumes:
|
||||
- "<%= gatekeeper_datapath %>/certs:/etc/ssl/certs"
|
||||
- "<%= gatekeeper_datapath %>/private:/etc/ssl/private"
|
||||
|
||||
@@ -46,5 +46,5 @@ fi
|
||||
|
||||
printf "\r\n\033[0;92mDepending on your current location and DNS settings, point your favorite browser to one of the following URLs to access Cyphernode's status page:\r\n"
|
||||
printf "\r\n"
|
||||
printf "\033[0;95m<% cns.forEach(cn => { %><%= ('https://' + cn + '/status/\\r\\n') %><% }) %>\033[0m\r\n"
|
||||
printf "\033[0;95m<% cns.forEach(cn => { %><%= ('https://' + cn + ':'+ gatekeeper_port + '/status/\\r\\n') %><% }) %>\033[0m\r\n"
|
||||
printf "\033[0;92mUse 'admin' as the username with the configuration password you selected at the beginning of the configuration process.\r\n\r\n\033[0m"
|
||||
|
||||
Reference in New Issue
Block a user