From: Chocobozzz Date: Fri, 5 Jan 2018 13:15:32 +0000 (+0100) Subject: Fix tls and account bug X-Git-Tag: v0.0.1-alpha~48 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=6b467fd54e58edb77dade400380581485a484434;p=github%2FChocobozzz%2FPeerTube.git Fix tls and account bug --- diff --git a/server.ts b/server.ts index 05fc39acb..a52c47083 100644 --- a/server.ts +++ b/server.ts @@ -1,3 +1,6 @@ +// FIXME: https://github.com/nodejs/node/pull/16853 +require('tls').DEFAULT_ECDH_CURVE = 'auto' + import { isTestInstance } from './server/helpers/core-utils' if (isTestInstance()) { diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 1f18b4401..f8e6b52d7 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -9,7 +9,7 @@ import { isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core // --------------------------------------------------------------------------- -const LAST_MIGRATION_VERSION = 155 +const LAST_MIGRATION_VERSION = 160 // --------------------------------------------------------------------------- diff --git a/server/initializers/migrations/0160-account-route.ts b/server/initializers/migrations/0160-account-route.ts new file mode 100644 index 000000000..cab4c72f1 --- /dev/null +++ b/server/initializers/migrations/0160-account-route.ts @@ -0,0 +1,42 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize +}): Promise { + { + const toReplace = ':443' + const by = '' + const replacer = column => `replace("${column}", '${toReplace}', '${by}')` + + const query = ` + UPDATE actor SET url = ${replacer('url')}, "inboxUrl" = ${replacer('inboxUrl')}, "outboxUrl" = ${replacer('outboxUrl')}, + "sharedInboxUrl" = ${replacer('sharedInboxUrl')}, "followersUrl" = ${replacer('followersUrl')}, + "followingUrl" = ${replacer('followingUrl')} + ` + await utils.sequelize.query(query) + } + + { + const toReplace = '/account/' + const by = '/accounts/' + const replacer = column => `replace("${column}", '${toReplace}', '${by}')` + + const query = ` + UPDATE actor SET url = ${replacer('url')}, "inboxUrl" = ${replacer('inboxUrl')}, "outboxUrl" = ${replacer('outboxUrl')}, + "sharedInboxUrl" = ${replacer('sharedInboxUrl')}, "followersUrl" = ${replacer('followersUrl')}, + "followingUrl" = ${replacer('followingUrl')} + ` + await utils.sequelize.query(query) + } +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +}