-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,717 additions
and
477 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,7 +107,7 @@ HttpConduit.enforceProperty(function fingerprint() { | |
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 0.3.3 | ||
* @version 1.3.1 | ||
* @version 1.4.0 | ||
* | ||
* @param {IncomingMessage} req | ||
* @param {ServerResponse} res | ||
|
@@ -133,7 +133,7 @@ HttpConduit.setMethod(async function initHttp(req, res, router) { | |
return; | ||
} | ||
|
||
if (alchemy.settings.debug || alchemy.settings.environment != 'live') { | ||
if (alchemy.settings.debugging.debug || alchemy.settings.environment != 'live') { | ||
this.setHeader('X-Robots-Tag', 'none'); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,7 +162,7 @@ SocketConduit.setMethod(function parseRequest() { | |
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 0.2.0 | ||
* @version 1.1.0 | ||
* @version 1.4.0 | ||
* | ||
* @param {Object} data | ||
*/ | ||
|
@@ -182,7 +182,7 @@ SocketConduit.setMethod(function parseAnnouncement() { | |
// Tell the client we're ready | ||
this.websocket.emit('ready'); | ||
|
||
if (alchemy.settings.debug) { | ||
if (alchemy.settings.debugging.debug) { | ||
log.info('Established websocket connection to', this.ip, 'using', this.useragent.family, this.useragent.major); | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,12 +90,12 @@ Info.setMethod(function setInfoVariables() { | |
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 0.2.0 | ||
* @version 1.0.0 | ||
* @version 1.4.0 | ||
*/ | ||
Info.setAction(function info(conduit, name) { | ||
|
||
// Don't show the page if info_page is false | ||
if (!alchemy.settings.info_page) { | ||
if (!alchemy.settings.debugging.info_page) { | ||
return conduit.notFound(); | ||
} | ||
|
||
|
@@ -110,11 +110,11 @@ Info.setAction(function info(conduit, name) { | |
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.0.7 | ||
* @version 1.0.7 | ||
* @version 1.4.0 | ||
*/ | ||
Info.setAction(async function appcache(conduit) { | ||
|
||
if (!alchemy.settings.offline_clients) { | ||
if (!alchemy.settings.frontend.appcache) { | ||
return conduit.notFound(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ Router.setProperty(function current_route() { | |
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.3.0 | ||
* @version 1.3.0 | ||
* @version 1.4.0 | ||
* | ||
* @param {String|RURL} url | ||
* | ||
|
@@ -89,9 +89,9 @@ Router.setMethod(function isLocalUrl(url) { | |
return true; | ||
} | ||
|
||
if (Blast.isNode && alchemy.settings.url) { | ||
if (Blast.isNode && alchemy.settings.network.main_url) { | ||
// @TODO: Would be nice to not have to parse this every time | ||
let server_url = RURL.parse(alchemy.settings.url); | ||
let server_url = RURL.parse(alchemy.settings.network.main_url); | ||
|
||
if (server_url.hostname == url.hostname) { | ||
return true; | ||
|
@@ -375,7 +375,7 @@ Router.setMethod(function routeConfig(name, socket_route) { | |
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 0.2.0 | ||
* @version 1.3.10 | ||
* @version 1.4.0 | ||
* | ||
* @param {String} name | ||
* @param {Object} parameters | ||
|
@@ -528,7 +528,7 @@ Router.setMethod(function routeUrl(name, parameters, options) { | |
if (Blast.isBrowser) { | ||
base_url = RURL.parse(window.location); | ||
} else { | ||
base_url = RURL.parse(alchemy.settings.url); | ||
base_url = RURL.parse(alchemy.settings.network.main_url); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -324,7 +324,7 @@ Controller.setMethod(function end(message) { | |
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 0.2.0 | ||
* @version 1.3.0 | ||
* @version 1.4.0 | ||
* | ||
* @param {String} name The name of the action to execute | ||
* @param {Array} args Arguments to apply to the action | ||
|
@@ -362,8 +362,8 @@ Controller.setMethod(async function doAction(name, args) { | |
// @TODO: Add support for objects with language keys | ||
let title = route.options.title; | ||
|
||
if (alchemy.settings && alchemy.settings.title_suffix) { | ||
title += alchemy.settings.title_suffix; | ||
if (alchemy.settings && alchemy.settings.frontend.title_suffix) { | ||
title += alchemy.settings.frontend.title_suffix; | ||
} | ||
|
||
this.setTitle(title); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/** | ||
* The Alchemy Setting model: | ||
* Contains all the system settings of Alchemy. | ||
* | ||
* @constructor | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
* @version 1.4.0 | ||
*/ | ||
const AlchemySetting = Function.inherits('Alchemy.Model.App', 'AlchemySetting'); | ||
|
||
/** | ||
* Constitute the class wide schema | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
* @version 1.4.0 | ||
*/ | ||
AlchemySetting.constitute(function addTaskFields() { | ||
|
||
this.addField('setting_id', 'Enum', { | ||
description: 'The setting id', | ||
values : Classes.Alchemy.Setting.SYSTEM.createEnumMap(), | ||
}); | ||
|
||
this.addField('configuration', 'Schema', { | ||
description: 'The actual configuration of the setting', | ||
schema : 'setting_id', | ||
}); | ||
}); | ||
|
||
/** | ||
* Configure the default chimera fieldsets | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
* @version 1.4.0 | ||
*/ | ||
AlchemySetting.constitute(function chimeraConfig() { | ||
|
||
if (!this.chimera) { | ||
return; | ||
} | ||
|
||
// Get the list group | ||
let list = this.chimera.getActionFields('list'); | ||
|
||
list.addField('setting_id'); | ||
|
||
// Get the edit group | ||
let edit = this.chimera.getActionFields('edit'); | ||
|
||
edit.addField('setting_id'); | ||
edit.addField('configuration') | ||
}); | ||
|
||
/** | ||
* Do something before saving the record | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
* @version 1.4.0 | ||
* | ||
* @param {Document.AlchemyTask} doc | ||
*/ | ||
AlchemySetting.setMethod(function beforeSave(doc) { | ||
|
||
}); | ||
|
||
/** | ||
* Update the schedules after saving | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
* @version 1.4.0 | ||
* | ||
* @param {Object} main | ||
* @param {Object} info | ||
*/ | ||
AlchemySetting.setMethod(function afterSave(main, info) { | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
'use strict'; | ||
|
||
var libpath = require('path'), | ||
starting; | ||
const libpath = require('path'); | ||
let starting; | ||
|
||
/** | ||
* Calling dynamic `import()` from certain places in the codebase actually | ||
|
@@ -29,6 +29,26 @@ require('protoblast')(); | |
*/ | ||
require('./init/constants'); | ||
|
||
/** | ||
* Alchemy's Base class (from which all other classes inherit) | ||
*/ | ||
require('./core/base'); | ||
|
||
/** | ||
* Alchemy's Client Base class | ||
*/ | ||
require('./core/client_base'); | ||
|
||
/** | ||
* Load the setting class | ||
*/ | ||
require(libpath.resolve(PATH_CORE, 'core', 'setting.js')); | ||
|
||
/** | ||
* Load the actual settings | ||
*/ | ||
require(libpath.resolve(PATH_CORE, 'init', 'settings.js')); | ||
|
||
/** | ||
* Define alchemy class and instance | ||
*/ | ||
|
@@ -59,30 +79,8 @@ require('./init/requirements'); | |
*/ | ||
require('./init/devwatch'); | ||
|
||
/** | ||
* Alchemy's Base class | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 0.3.0 | ||
* @version 0.3.0 | ||
*/ | ||
require('./core/base'); | ||
|
||
/** | ||
* Alchemy's Client Base class | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.0.0 | ||
* @version 1.0.0 | ||
*/ | ||
require('./core/client_base'); | ||
|
||
/** | ||
* The migration class | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.2.0 | ||
* @version 1.2.0 | ||
*/ | ||
require('./class/migration'); | ||
|
||
|
@@ -276,7 +274,7 @@ Alchemy.setMethod(function start(options, callback) { | |
|
||
// If silent is true, don't output anything | ||
if (options.silent == true) { | ||
this.settings.silent = true; | ||
this.setSetting('debugging.silent', true); | ||
} | ||
|
||
if (starting) { | ||
|
@@ -288,18 +286,18 @@ Alchemy.setMethod(function start(options, callback) { | |
} | ||
|
||
if (options.client_mode) { | ||
this.settings.client_mode = true; | ||
this.setSetting('client_mode', true); | ||
} else { | ||
if (this.settings.no_default_file) { | ||
log.warn('Could not find default settings file at "' + this.settings.no_default_file + '.js"'); | ||
if (alchemy.settings.no_default_file) { | ||
log.warn('Could not find default settings file at "' + alchemy.settings.no_default_file + '.js"'); | ||
} | ||
|
||
if (this.settings.no_local_file) { | ||
if (alchemy.settings.no_local_file) { | ||
log.warn('Could not find local settings file'); | ||
} | ||
|
||
if (this.settings.no_env_file) { | ||
log.warn('Could not find environment settings file at "' + this.settings.no_env_file + '.js"'); | ||
if (alchemy.settings.no_env_file) { | ||
log.warn('Could not find environment settings file at "' + alchemy.settings.no_env_file + '.js"'); | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.