Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added websock upgrade option for base proxy host locations
- Loading branch information
Showing
8 changed files
with
115 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" == "" ]; then | ||
echo "Error: migrate name must be specified as first arg" | ||
exit 1 | ||
else | ||
# Code path | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
if hash realpath 2>/dev/null; then | ||
export CODEBASE=$(realpath $SCRIPT_DIR/..) | ||
elif hash grealpath 2>/dev/null; then | ||
export CODEBASE=$(grealpath $SCRIPT_DIR/..) | ||
else | ||
export CODEBASE=$(readlink -e $SCRIPT_DIR/..) | ||
fi | ||
|
||
if [ -z "$CODEBASE" ]; then | ||
echo "Unable to determine absolute codebase directory" | ||
exit 1 | ||
fi | ||
|
||
cd "$CODEBASE" | ||
|
||
sudo /usr/local/bin/docker-compose run --rm --no-deps app node node_modules/knex/bin/cli.js migrate:make "$1" | ||
exit $? | ||
fi |
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,37 @@ | ||
'use strict'; | ||
|
||
const migrate_name = 'websockets'; | ||
const logger = require('../logger').migrate; | ||
|
||
/** | ||
* Migrate | ||
* | ||
* @see http://knexjs.org/#Schema | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.up = function (knex/*, Promise*/) { | ||
logger.info('[' + migrate_name + '] Migrating Up...'); | ||
|
||
return knex.schema.table('proxy_host', function (proxy_host) { | ||
proxy_host.integer('allow_websocket_upgrade').notNull().unsigned().defaultTo(0); | ||
}) | ||
.then(() => { | ||
logger.info('[' + migrate_name + '] proxy_host Table altered'); | ||
}); | ||
|
||
}; | ||
|
||
/** | ||
* Undo Migrate | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.down = function (knex, Promise) { | ||
logger.warn('[' + migrate_name + '] You can\'t migrate down this one.'); | ||
return Promise.resolve(true); | ||
}; |
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
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