diff --git a/boot/master.js b/boot/master.js index 7aec33a..20fc674 100644 --- a/boot/master.js +++ b/boot/master.js @@ -9,6 +9,7 @@ console.info('arch:', process.arch); console.info('platform:', process.platform); console.info('\n\n\n[MASTER] Welcome to WALNUT!'); +var path = require('path'); var cluster = require('cluster'); //var minWorkers = 2; var numCores = 2; // Math.max(minWorkers, require('os').cpus().length); @@ -38,7 +39,10 @@ function fork() { cluster.on('online', function (worker) { // TODO XXX Should these be configurable? If so, where? - var certPaths = config.certPaths; + var certPaths = [ + path.join(__dirname, 'certs', 'live') + , path.join(__dirname, 'letsencrypt', 'live') + ]; var info; conf.ddns = config.ddns; conf.redirects = config.redirects; diff --git a/etc/letsencrypt/live/.gitkeep b/etc/letsencrypt/live/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/etc/letsencrypt/live/www.example.com/fullchain.pem b/etc/letsencrypt/live/www.example.com/fullchain.pem new file mode 100644 index 0000000..3845f76 --- /dev/null +++ b/etc/letsencrypt/live/www.example.com/fullchain.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDSTCCAjECCQCyFV5BDXN2ADANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJV +UzENMAsGA1UECBMEVXRhaDEOMAwGA1UEBxMFUHJvdm8xIzAhBgNVBAoTGkFDTUUg +U2lnbmluZyBBdXRob3JpdHkgSW5jMRQwEgYDVQQDEwtleGFtcGxlLmNvbTAeFw0x +NTAxMjgwMjQyMjNaFw0xODAxMjcwMjQyMjNaMGYxCzAJBgNVBAYTAlVTMQ0wCwYD +VQQIEwRVdGFoMQ4wDAYDVQQHEwVQcm92bzEVMBMGA1UEChMMQUNNRSBTZXJ2aWNl +MSEwHwYDVQQDExhsb2NhbC5oZWxsb3dvcmxkMzAwMC5jb20wggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQDIRtMZnPXfMT8ejvdndHUx0pBh0ToOyLgtXP6q +PlziXUN8GJoQ1mxT2QNtkFHDoB5Nl2g3HDtEAGxNXlm8qMFrsbL772qidUN45oz0 +8dqOgOxENAwVqeA70YqqLdDhqW1qe8aRG5QyA43WGTiv18xZUZ6YG4lgHloqwNfK +7KObACzTA5i8zuhl7z1eHm5va06pkXIdAbxNQwk9YLVM71B2pOF2jqIcsBZ/qrvD +TdKQsXLIy9NBMHykNuD6uPTNuBnOxzo59RqlQMzaVxqHYzCkWszlXLC05I+Xhcg5 +JKXbnvl1A+aMqEnqjY8H2t4S6bDfeA1v6z1oL77/t6S4u2LhAgMBAAEwDQYJKoZI +hvcNAQEFBQADggEBAAOlX8d05CbPjVeS91zfQBz8Ev0sXjdIElm6DMEmX9OzCuk+ ++j5Ptn3g3bFraFqcDO9U9lgbYooiulCnlrYX46eyuCNfojF0Q1lGu3OGK1TYKmmK +DUTLcZ/5NL3azhZJ4iOFw8Kv0OvwTvGRBoKM+VsRkX+wtTLyY9b5+C4ON4htu6Qm +V0Tm25qRZQZx/kVZQolfYiR9mL2RBr+sQfJ4mfZJoFu+m99LPKgAc5qcbS1MmwNq +l2INMkFtPxPWXzt1INdLtLHfA7LpMZBLsBfj7mPcr1xLBLpiFBT+Pvsgc+Y+LrGz +QruRjat3F7YKt/M5Y1jSanvvyAKZNhTZoJeVQhI= +-----END CERTIFICATE----- diff --git a/etc/letsencrypt/live/www.example.com/privkey.pem b/etc/letsencrypt/live/www.example.com/privkey.pem new file mode 100644 index 0000000..0d6a52b --- /dev/null +++ b/etc/letsencrypt/live/www.example.com/privkey.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAyEbTGZz13zE/Ho73Z3R1MdKQYdE6Dsi4LVz+qj5c4l1DfBia +ENZsU9kDbZBRw6AeTZdoNxw7RABsTV5ZvKjBa7Gy++9qonVDeOaM9PHajoDsRDQM +FangO9GKqi3Q4altanvGkRuUMgON1hk4r9fMWVGemBuJYB5aKsDXyuyjmwAs0wOY +vM7oZe89Xh5ub2tOqZFyHQG8TUMJ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ea0489jxXD5wDRZZ7c+ +7REYirZOdR+o69VunjNRoP5yc8iYh90OFm1uTLy0qAtUWxd4EVDuspbumG/GsX/I +sQHE/GImWc0U3lPp6K1Sq2hewgTvqgnEsOIu2TLTZxZ2rVNevlnArNk1OtXl5W5A +L+8YUmUCgYAHavun7/NKAoydxI/2/Uok4/eQ6BlwtfDG2Tlz1GZctkD3wju2ongA +WFLckyZ1Y4eV77NgyxiVRzSDY6rGLtK/INK+GrP6D9AqWMS/JKVhwZYe5rz9TWuO +ZwkbdVr+uwLwP+3DQltHev0yuVtRa+qLUssQdW6VRJZgQ2T9ue4MzQ== +-----END RSA PRIVATE KEY----- diff --git a/install.sh b/install.sh index 0a5f50f..f91b31e 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -sudo mkdir -p /srv/walnut/{certs,core,lib} +sudo mkdir -p /srv/walnut/{certs,core,letsencrypt,lib} sudo mkdir -p /srv/walnut/packages/{api,pages,services} sudo chown -R $(whoami):$(whoami) /srv/walnut @@ -10,6 +10,7 @@ git clone https://github.com/Daplie/walnut.git /srv/walnut/core pushd /srv/walnut/core npm install sudo rsync -av /srv/walnut/core/etc/init/walnut.conf /etc/init/walnut.conf +rsync -av /srv/walnut/core/etc/letsencrypt/ /srv/walnut/certs/ popd mv /srv/walnut/core/node_modules /srv/walnut