-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1667 from jc21/develop
v2.9.13
- Loading branch information
Showing
18 changed files
with
353 additions
and
19 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 |
---|---|---|
@@ -1 +1 @@ | ||
2.9.12 | ||
2.9.13 |
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
50 changes: 50 additions & 0 deletions
50
backend/migrations/20211108145214_regenerate_default_host.js
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,50 @@ | ||
const migrate_name = 'stream_domain'; | ||
const logger = require('../logger').migrate; | ||
const internalNginx = require('../internal/nginx'); | ||
|
||
async function regenerateDefaultHost(knex) { | ||
const row = await knex('setting').select('*').where('id', 'default-site').first(); | ||
|
||
if (!row) { | ||
return Promise.resolve(); | ||
} | ||
|
||
return internalNginx.deleteConfig('default') | ||
.then(() => { | ||
return internalNginx.generateConfig('default', row); | ||
}) | ||
.then(() => { | ||
return internalNginx.test(); | ||
}) | ||
.then(() => { | ||
return internalNginx.reload(); | ||
}); | ||
} | ||
|
||
/** | ||
* Migrate | ||
* | ||
* @see http://knexjs.org/#Schema | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.up = function (knex) { | ||
logger.info('[' + migrate_name + '] Migrating Up...'); | ||
|
||
return regenerateDefaultHost(knex); | ||
}; | ||
|
||
/** | ||
* Undo Migrate | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.down = function (knex) { | ||
logger.info('[' + migrate_name + '] Migrating Down...'); | ||
|
||
return regenerateDefaultHost(knex); | ||
}; |
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
set $targetUri $forward_scheme://$server:$port$request_uri; | ||
add_header X-Served-By $host; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-Scheme $scheme; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header X-Forwarded-For $remote_addr; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_pass $targetUri; | ||
proxy_pass $forward_scheme://$server:$port$request_uri; | ||
|
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
Oops, something went wrong.