relay requesting (and maybe verifying) to the user

This commit is contained in:
2025-04-30 18:03:56 +03:00
parent 991a4f29a6
commit 92fd491194
22 changed files with 968 additions and 222 deletions

View File

@@ -18,7 +18,7 @@ export function up(pgm) {
password: {type: 'varchar(32)'}
});
pgm.addColumn('captchas', {proxy_id: {type: 'integer', references: 'proxies(id)'}})
pgm.addColumn('captchas', {proxy_id: {type: 'integer', references: 'proxies(id)'}});
}
/**

View File

@@ -0,0 +1,46 @@
export const shorthands = undefined;
/**
* @param pgm {import('node-pg-migrate').MigrationBuilder}
* @param run {() => void | undefined}
* @returns {Promise<void> | void}
*/
export function up(pgm) {
pgm.createTable('users', {
id: 'id',
username: {type:"varchar(32)", notNull: true},
password: {type:"char(60)", notNull: true}
})
pgm.addColumn('captchas', {
submitter: {type: 'integer', references: 'users(id)'}
});
pgm.dropType('protocol_type', {cascade: true});
pgm.dropTable('proxies', {cascade: true});
pgm.dropColumn('captchas', 'proxy_id', {cascade: true});
}
/**
* @param pgm {import('node-pg-migrate').MigrationBuilder}
* @param run {() => void | undefined}
* @returns {Promise<void> | void}
*/
export function down(pgm) {
pgm.dropTable('users');
pgm.dropColumn('captchas', 'submitter');
pgm.createType('protocol_type', ['http', 'https']);
pgm.createTable('proxies', {
id: 'id',
proto: {type: 'protocol_type', notNull: true},
claimed: {type: 'boolean', default: false},
host: {type: 'inet', notNull: true},
port: {type: 'smallint', notNull: true},
username: {type: 'varchar(16)'},
password: {type: 'varchar(32)'}
});
pgm.addColumn('captchas', {proxy_id: {type: 'integer', references: 'proxies(id)'}});
}