-
-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored silex startup script to make it possible to add custom uni…
…file services
- Loading branch information
Showing
10 changed files
with
159 additions
and
88 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
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,58 @@ | ||
////////////////////////////////////////////////// | ||
// Silex, live web creation | ||
// http://projects.silexlabs.org/?/silex/ | ||
// | ||
// Copyright (c) 2012 Silex Labs | ||
// http://www.silexlabs.org/ | ||
// | ||
// Silex is available under the GPL license | ||
// http://www.silexlabs.org/silex/silex-licensing/ | ||
////////////////////////////////////////////////// | ||
|
||
// server options | ||
const serverOptions = {}; | ||
serverOptions.port = process.env.PORT || 6805; // 6805 is the date of sexual revolution started in paris france 8-) | ||
serverOptions.rootUrl = process.env.SERVER_URL || `http://localhost:${serverOptions.port}`; | ||
serverOptions.sessionSecret = process.env.SILEX_SESSION_SECRET || 'test session secret'; | ||
serverOptions.cePath = '/ce'; | ||
|
||
// electron app | ||
const electronOptions = { | ||
enabled: process.env.SILEX_ELECTRON || false, | ||
} | ||
|
||
// SSL options | ||
const sslOptions = { | ||
forceHttps: process.env.SILEX_FORCE_HTTPS, | ||
trustXFPHeader: process.env.SILEX_FORCE_HTTPS_TRUST_XFP_HEADER, | ||
privateKey: process.env.SILEX_SSL_PRIVATE_KEY, | ||
certificate: process.env.SILEX_SSL_CERTIFICATE, | ||
sslPort: process.env.SSL_PORT || 443, | ||
}; | ||
|
||
// cloud explorer options | ||
const ceOptions = { | ||
enableFtp: process.env.ENABLE_FTP, | ||
enableSftp: process.env.ENABLE_SFTP, | ||
enableWebdav: process.env.ENABLE_WEBDAV, | ||
githubClientId: process.env.GITHUB_CLIENT_ID, | ||
githubClientSecret: process.env.GITHUB_CLIENT_SECRET, | ||
dropboxClientId: process.env.DROPBOX_CLIENT_ID, | ||
dropboxClientSecret: process.env.DROPBOX_CLIENT_SECRET, | ||
enableFs: process.env.SILEX_DEBUG || process.env.SILEX_ELECTRON || process.env.ENABLE_FS, | ||
fsRoot: process.env.FS_ROOT, | ||
rootUrl: serverOptions.rootUrl, | ||
}; | ||
|
||
const publisherOptions = { | ||
rootUrl: serverOptions.rootUrl, | ||
port: serverOptions.port, | ||
} | ||
|
||
module.exports = { | ||
ceOptions: ceOptions, | ||
serverOptions: serverOptions, | ||
publisherOptions: publisherOptions, | ||
electronOptions: electronOptions, | ||
sslOptions: sslOptions, | ||
}; |
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
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,22 @@ | ||
////////////////////////////////////////////////// | ||
// Silex, live web creation | ||
// http://projects.silexlabs.org/?/silex/ | ||
// | ||
// Copyright (c) 2012 Silex Labs | ||
// http://www.silexlabs.org/ | ||
// | ||
// Silex is available under the GPL license | ||
// http://www.silexlabs.org/silex/silex-licensing/ | ||
////////////////////////////////////////////////// | ||
|
||
'use strict'; | ||
|
||
const SilexServer = require('./index'); | ||
const config = require('./EnvVarsConfig'); | ||
|
||
const silex = new SilexServer(config); | ||
// here you can change routers config, | ||
// e.g. add unifile services `silex.ceRouter.addService(unifileConnector)` | ||
// and use `silex.app.get(...)` to add callbacks | ||
// @see https://github.com/silexlabs/Silex/wiki/Silex-Developer-Guide#add-unifile-services-eg-for-hosting-companies | ||
|
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