mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
Use model for db defaults as sqlite doesn't support them
This commit is contained in:
parent
e7f7be2a2b
commit
a91dcb144d
@ -17,7 +17,7 @@ exports.up = function (knex/*, Promise*/) {
|
|||||||
proxy_host.integer('openidc_enabled').notNull().unsigned().defaultTo(0);
|
proxy_host.integer('openidc_enabled').notNull().unsigned().defaultTo(0);
|
||||||
proxy_host.text('openidc_redirect_uri').notNull().defaultTo('');
|
proxy_host.text('openidc_redirect_uri').notNull().defaultTo('');
|
||||||
proxy_host.text('openidc_discovery').notNull().defaultTo('');
|
proxy_host.text('openidc_discovery').notNull().defaultTo('');
|
||||||
proxy_host.text('openidc_auth_method').notNull().defaultTo('client_secret_post');
|
proxy_host.text('openidc_auth_method').notNull().defaultTo('');
|
||||||
proxy_host.text('openidc_client_id').notNull().defaultTo('');
|
proxy_host.text('openidc_client_id').notNull().defaultTo('');
|
||||||
proxy_host.text('openidc_client_secret').notNull().defaultTo('');
|
proxy_host.text('openidc_client_secret').notNull().defaultTo('');
|
||||||
})
|
})
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
const migrate_name = 'openid_default_values';
|
|
||||||
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.raw('ALTER TABLE proxy_host ALTER openidc_redirect_uri SET DEFAULT \'\'')
|
|
||||||
.then(() => knex.schema.raw('ALTER TABLE proxy_host ALTER openidc_discovery SET DEFAULT \'\''))
|
|
||||||
.then(() => knex.schema.raw('ALTER TABLE proxy_host ALTER openidc_auth_method SET DEFAULT \'client_secret_post\''))
|
|
||||||
.then(() => knex.schema.raw('ALTER TABLE proxy_host ALTER openidc_client_id SET DEFAULT \'\''))
|
|
||||||
.then(() => knex.schema.raw('ALTER TABLE proxy_host ALTER openidc_client_secret SET DEFAULT \'\''))
|
|
||||||
.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);
|
|
||||||
};
|
|
@ -30,6 +30,11 @@ class ProxyHost extends Model {
|
|||||||
this.meta = {};
|
this.meta = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Openidc defaults
|
||||||
|
if (typeof this.openidc_auth_method === 'undefined') {
|
||||||
|
this.openidc_auth_method = 'client_secret_post';
|
||||||
|
}
|
||||||
|
|
||||||
this.domain_names.sort();
|
this.domain_names.sort();
|
||||||
this.openidc_allowed_users.sort();
|
this.openidc_allowed_users.sort();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user