separate core code from data and apps
This commit is contained in:
parent
6d3d334370
commit
b645f5fe09
|
@ -23,8 +23,8 @@ var conf = {
|
||||||
// TODO externalInsecurePort?
|
// TODO externalInsecurePort?
|
||||||
, locked: false // TODO XXX
|
, locked: false // TODO XXX
|
||||||
, ipcKey: null
|
, ipcKey: null
|
||||||
, caddyfilepath: path.join(__dirname, '..', 'Caddyfile')
|
, caddyfilepath: path.join(__dirname, '..', '..', 'Caddyfile')
|
||||||
, sitespath: path.join(__dirname, '..', 'sites-enabled')
|
, sitespath: path.join(__dirname, '..', '..', 'sites-enabled')
|
||||||
};
|
};
|
||||||
var state = {};
|
var state = {};
|
||||||
var caddy;
|
var caddy;
|
||||||
|
@ -42,7 +42,7 @@ function fork() {
|
||||||
cluster.on('online', function (worker) {
|
cluster.on('online', function (worker) {
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
// TODO XXX Should these be configurable? If so, where?
|
// TODO XXX Should these be configurable? If so, where?
|
||||||
var certPaths = [path.join(__dirname, 'certs', 'live')];
|
var certPaths = [path.join(__dirname, '..', 'certs', 'live')];
|
||||||
var info;
|
var info;
|
||||||
|
|
||||||
console.info('[MASTER] Worker ' + worker.process.pid + ' is online');
|
console.info('[MASTER] Worker ' + worker.process.pid + ' is online');
|
||||||
|
@ -79,7 +79,7 @@ cluster.on('online', function (worker) {
|
||||||
info.conf.memstoreSock = conf.memstoreSock;
|
info.conf.memstoreSock = conf.memstoreSock;
|
||||||
info.conf.sqlite3Sock = conf.sqlite3Sock;
|
info.conf.sqlite3Sock = conf.sqlite3Sock;
|
||||||
// TODO get this from db config instead
|
// TODO get this from db config instead
|
||||||
var config = require('../config');
|
var config = require('../../config');
|
||||||
info.conf.primaryNameserver = config.primaryNameserver;
|
info.conf.primaryNameserver = config.primaryNameserver;
|
||||||
info.conf.nameservers = config.nameservers;
|
info.conf.nameservers = config.nameservers;
|
||||||
// TODO get this from db config instead
|
// TODO get this from db config instead
|
||||||
|
|
|
@ -6,6 +6,7 @@ function tplCaddyfile(conf) {
|
||||||
conf.domains.forEach(function (hostname) {
|
conf.domains.forEach(function (hostname) {
|
||||||
var content = "";
|
var content = "";
|
||||||
|
|
||||||
|
// TODO prefix
|
||||||
content+= "https://" + hostname + " {\n"
|
content+= "https://" + hostname + " {\n"
|
||||||
+ " gzip\n"
|
+ " gzip\n"
|
||||||
+ " tls "
|
+ " tls "
|
||||||
|
|
|
@ -16,7 +16,7 @@ module.exports.create = function (webserver, info, state) {
|
||||||
var sqlstores = {};
|
var sqlstores = {};
|
||||||
var models = {};
|
var models = {};
|
||||||
var systemFactory = require('sqlite3-cluster/client').createClientFactory({
|
var systemFactory = require('sqlite3-cluster/client').createClientFactory({
|
||||||
dirname: path.join(__dirname, '..', 'var') // TODO info.conf
|
dirname: path.join(__dirname, '..', '..', 'var') // TODO info.conf
|
||||||
, prefix: 'com.daplie.'
|
, prefix: 'com.daplie.'
|
||||||
//, dbname: 'config'
|
//, dbname: 'config'
|
||||||
, suffix: ''
|
, suffix: ''
|
||||||
|
@ -28,7 +28,7 @@ module.exports.create = function (webserver, info, state) {
|
||||||
algorithm: 'aes'
|
algorithm: 'aes'
|
||||||
, bits: 128
|
, bits: 128
|
||||||
, mode: 'cbc'
|
, mode: 'cbc'
|
||||||
, dirname: path.join(__dirname, '..', 'var') // TODO info.conf
|
, dirname: path.join(__dirname, '..', '..', 'var') // TODO info.conf
|
||||||
, prefix: 'com.daplie.'
|
, prefix: 'com.daplie.'
|
||||||
//, dbname: 'cluster'
|
//, dbname: 'cluster'
|
||||||
, suffix: ''
|
, suffix: ''
|
||||||
|
@ -154,9 +154,9 @@ module.exports.create = function (webserver, info, state) {
|
||||||
// rm -rf /tmp/walnut/; tar xvf -C /tmp/walnut/; mv /srv/walnut /srv/walnut.{{version}}; mv /tmp/walnut /srv/
|
// rm -rf /tmp/walnut/; tar xvf -C /tmp/walnut/; mv /srv/walnut /srv/walnut.{{version}}; mv /tmp/walnut /srv/
|
||||||
// this means that any packages must be outside, perhaps /srv/walnut/{boot,core,packages}
|
// this means that any packages must be outside, perhaps /srv/walnut/{boot,core,packages}
|
||||||
var apiConf = {
|
var apiConf = {
|
||||||
apppath: '../packages/apps/'
|
apppath: path.join(__dirname, '..', '..', 'packages', 'apps') + path.sep
|
||||||
, apipath: '../packages/apis/'
|
, apipath: path.join(__dirname, '..', '..', 'packages', 'apis') + path.sep
|
||||||
, servicespath: path.join(__dirname, '..', 'packages', 'services')
|
, servicespath: path.join(__dirname, '..', '..', 'packages', 'services')
|
||||||
, vhostsMap: vhostsMap
|
, vhostsMap: vhostsMap
|
||||||
, server: webserver
|
, server: webserver
|
||||||
, externalPort: info.conf.externalPort
|
, externalPort: info.conf.externalPort
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Device Locked</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Device Locked</h1>
|
|
||||||
<p>This device is locked and can only be unlocked with the device's encryption key.</p>
|
|
||||||
<!-- TODO QR Code -->
|
|
||||||
<form method="POST" action="/api/unlock-device">
|
|
||||||
<label>Encryption Key</label>
|
|
||||||
<input type="text">
|
|
||||||
<button type="submit">Unlock Device</button>
|
|
||||||
</form>
|
|
||||||
<script src="./scripts/jquery.js">
|
|
||||||
<script src="./scripts/app.js">
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in New Issue