URLs after setup, colors, status page, downloadable files

This commit is contained in:
kexkey
2018-12-18 15:04:19 -05:00
parent f6a7b6c28a
commit a338d17fc7
6 changed files with 37 additions and 23 deletions

View File

@@ -4,18 +4,11 @@
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
trace=true;
function log() {
if (trace) {
console.log(arguments.callee.caller.name, arguments.callee.caller.arguments);
}
}
$(function() {
installation_status();
});
function httpget(url) {
log();
return fetch(url, { method: "GET" })
.catch(err => {
console.log('HTTP GET Error: ' + err.message + ' :: STACK : ' + err.stack);
@@ -36,7 +29,6 @@
}
function installation_status() {
log();
httpget("installation.json")
.then(result => {
$("#result").text(result);
@@ -46,8 +38,21 @@
</script>
</head>
<body>
<button onclick="installation_status();">Installation Status</button>
<p/>
<pre lang="xml" id="result" style="white-space: pre-wrap"></pre>
<div id="hello">
<h1>Hello World from Cyphernode!</h1>
<h2>If you are here, it means you successfully deployed Cyphernode. Congratulations, fellow Cyphernode Operator!</h2>
</div>
<hr/>
<div id="files">
<h2>The following files have been encrypted with your configuration passphrase and your client keys passphrase, respectively:</h2>
<ul>
<li><a href="config.7z">Download your Cyphernode <b>configurations</b>, can be used for another Cyphernode deployment</a></li>
<li><a href="client.7z">Download Client <b>API ID's and keys</b>, needed in your client apps</a></li>
</ul>
</div>
<div id="Status">
<h2>This is the status of Cyphernode's installation and running components</h2>
<pre lang="xml" id="result" style="white-space: pre-wrap"></pre>
</div>
</body>
</html>

View File

@@ -2,7 +2,7 @@
"features": "What <font color='#00ff00'>optional</font> <font underline='true'>features</font> do you want me to activate? Select multiple choices using the space bar.",
"net": "You want Cyphernode to run on what Bitcoin <font underline='true'>network</font>?",
"run_as_different_user": "We recommend running Cyphernode as a <font underline='true'>different user</font> when possible. Using your current user would give Cyphernode your current access rights, which could be a security issue especially if you are a sudoer.",
"username": "Run Cyphernode as <font underline='true'>what user</font>? We recommend user <font color='#00ff00'>cyphernode</font>. If the user does not exist, I will create it for you.",
"username": "Run Cyphernode as <font underline='true'>what user</font>? We recommend user <font color='#ff33ff'>cyphernode</font>. If the user does not exist, I will create it for you.",
"use_xpub": "Cyphernode can <font color='#00ff00'>derive</font> Bitcoin addresses from an xPub and the derivation path you want. If you want, you can provide your xPub and derivation path right now and call 'derive' with only the index instead of having to pass your xPub and derivation path on each call.",
"xpub": "Cyphernode can <font color='#00ff00'>derive</font> addresses from your <font underline='true'>default xPub key</font>. With that functionality, you don't have to provide your xPub every time you call the derivation endpoints.",
"derivation_path": "Cyphernode can <font color='#00ff00'>derive</font> addresses from your <font underline='true'>default derivation path</font>. With that functionality, you don't have to provide your derivation path every time you call the derivation endpoints.",
@@ -16,20 +16,20 @@
"gatekeeper_apiproperties": "You are about to edit the api.properties file. The format of the file is pretty simple: for each action, you will find what access group can access it. <font color='#00ff00'>Admin</font> group can do what <font color='#00ff00'>Spender</font> group can, and <font color='#00ff00'>Spender</font> group can do what <font color='#00ff00'>Watcher</font> group can. <font color='#00ff00'>Internal</font> group is for the endpoints accessible only within the Docker Swarm, like the backoffice tasks used by the Cron container. The access groups for each API id/key are found in the <font color='#00ff00'>keys.properties</font> file.",
"gatekeeper_sslcert": "** gatekeeper_sslcert **",
"gatekeeper_sslkey": "** gatekeeper_sslkey **",
"gatekeeper_cns": "<font underline='true'>Domain names</font> and/or <font underline='true'>IP addresses</font> used when calling Cyphernode. Used to create valid TLS certificates. For example, if https://cyphernodehost/getbestblockhash and https://192.168.7.44/getbestblockhash will be used, provide cyphernodehost,192.168.7.44 as a possible domains. '127.0.0.1,localhost' will be added automatically. Make sure the provided domain names are in your DNS or client's hosts file and is reachable.",
"gatekeeper_cns": "<font underline='true'>Domain names</font> and/or <font underline='true'>IP addresses</font> used when calling Cyphernode. Used to create valid TLS certificates. For example, if <font color='#ff33ff'>https://cyphernodehost/getbestblockhash</font> and <font color='#ff33ff'>https://192.168.7.44/getbestblockhash</font> will be used, provide <font color='#ff33ff'>cyphernodehost,192.168.7.44</font> as a possible domains. <font color='#ff33ff'>127.0.0.1,localhost,gatekeeper</font> will be automatically added to your list. Make sure the provided domain names are in your DNS or client's hosts file and is reachable.",
"bitcoin_mode": "Cyphernode can spawn a new <font underline='true'>Bitcoin Core</font> full node for its own use. But if you already have a Bitcoin Core node running, Cyphernode can use it.",
"bitcoin_node_ip": "Cyphernode uses <font color='#00ff00'>Bitcoin Core</font> RPC interface for its tasks. Please provide the <font underline='true'>IP address</font> of your current Bitcoin Core node.",
"bitcoin_rpcuser": "Bitcoin Core's <font underline='true'>RPC username</font> used by Cyphernode when calling the node.",
"bitcoin_rpcpassword": "Bitcoin Core's <font underline='true'>RPC password</font> used by Cyphernode when calling the node.",
"bitcoin_prune": "If you don't have at least 350GB of disk space, you should run Bitcoin Core in <font underline='true'>prune mode</font>. <font color='#ff0000'>NOTE</font>: when running Bitcoin Core in prune mode, the incoming transactions' fees cannot be computed by Cyphernode and won't be part of the addresses watching's callbacks payload.",
"bitcoin_prune_size": "Minimum <font underline='true'>size</font> is 550 MB. Is the number of MB Bitcoin Core will allot for raw block & undo data.",
"bitcoin_prune_size": "Minimum <font underline='true'>size</font> is <font color='#ff33ff'>550</font> MB. Is the number of MB Bitcoin Core will allot for raw block & undo data.",
"bitcoin_uacomment": "<font underline='true'>User Agent</font> string used by Bitcoin Core.",
"bitcoin_datapath": "<font underline='true'>Path name</font> to where Bitcoin Core's data files (blockchain data, wallets, configs, etc.) are stored. Will be mounted in the Bitcoin node's container. If you already have a sync'ed node, you can copy data there to be used by the node, instead of resyncing everything. <font color='#ff0000'>NOTE</font>: only copy chainstate/ and blocks/ contents.",
"bitcoin_expose": "By default, Bitcoin node ports (RPC and protocol) won't be <font underline='true'>published</font> outside of Docker. Do you want to expose them so that your node can be accessed from outside of the Docker network?",
"lightning_implementation": "Multiple <font underline='true'>LN implementations</font> exist. Please choose the one you want to use with Cyphernode.",
"lightning_external_ip": "If you want you LN node to be accessible from the Internet, provide the <font underline='true'>IP address</font> that other LN nodes will use to connect to it. <font color='#ff0000'>NOTE</font>: That won't make your router forward needed LN ports; you still have the responsability to configure and manage that part.",
"lightning_external_ip": "If you want you LN node to be accessible from the Internet, provide the <font underline='true'>IP address</font> that other LN nodes will use to connect to it. This is usually your router's public IP. <font color='#ff0000'>NOTE</font>: That won't make your router forward needed LN ports; you still have the responsability to configure and manage that part.",
"lightning_nodename": "LN nodes have names. Choose the <font underline='true'>name you want</font> for yours.",
"lightning_nodecolor": "LN nodes have colors. Choose the <font underline='true'>color you want</font> for yours in RGB format (RRGGBB). For example, pure red would be FF0000.",
"lightning_nodecolor": "LN nodes have colors. Choose the <font underline='true'>color you want</font> for yours in RGB format (RRGGBB). For example, pure red would be <font color='#ff33ff'>ff0000</font>.",
"lightning_datapath": "<font underline='true'>Path name</font> to where LN's data files are stored. Will be mounted in the LN node's container.",
"lightning_expose": "By default, LN node ports won't be <font underline='true'>published</font> outside of Docker. Do you want to expose them so that your node can be accessed from outside of the Docker network?",
"otsclient_datapath": "<font underline='true'>Full path</font> where the OTS files will be stored. This path will be mounted to the otsclient container which will create the OTS files when <font color='#00ff00'>stamping</font> and update them when <font color='#00ff00'>upgrading</font> stamps. It will also be mounted to the proxy container so that it can serve the <font color='#00ff00'>ots_getfile</font> and send the OTS files to clients.",

View File

@@ -288,6 +288,12 @@ module.exports = class extends Generator {
if( result.code === 0 ) {
this.props.gatekeeper_sslkey = result.key.toString();
this.props.gatekeeper_sslcert = result.cert.toString();
// Total array of cns, used to create Cyphernode's URLs
this.props.cns = []
result.cns.forEach(e => {
this.props.cns.push(e)
})
} else {
console.log(chalk.bold.red( 'error! Gatekeeper cert was not created' ));
}

View File

@@ -105,7 +105,8 @@ module.exports = class Cert {
return {
code: code,
key: key,
cert: cert
cert: cert,
cns: cns
}
}

View File

@@ -15,6 +15,8 @@ services:
- "<%= gatekeeper_datapath %>/api.properties:/etc/nginx/conf.d/api.properties"
- "<%= gatekeeper_datapath %>/htpasswd:/etc/nginx/conf.d/status/htpasswd"
- "<%= gatekeeper_datapath %>/installation.json:/etc/nginx/conf.d/status/installation.json"
- "<%= gatekeeper_datapath %>/client.7z:/etc/nginx/conf.d/status/client.7z"
- "<%= gatekeeper_datapath %>/config.7z:/etc/nginx/conf.d/status/config.7z"
command: $USER
# deploy:

View File

@@ -18,6 +18,6 @@ docker run --rm -it -v $current_path/testfeatures.sh:/testfeatures.sh \
-v <%= gatekeeper_datapath %>:/gatekeeper \
--network cyphernodenet alpine:3.8 /testfeatures.sh
echo "Point your favorite browser to one of the following URLs to access Cyphernode's status page:"
echo
echo
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"