Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/note.picotech.app/public_html/seeders/ drwxr-xr-x | |
| Viewing file: Select action/file-type: const { ApiKey } = require('../src/models');
module.exports = {
async up (queryInterface, Sequelize) {
// Note: In production, API keys should be set via environment variables or secure key management
// This seeder creates placeholder entries that should be populated with real keys
const apiKeys = [
{
service_name: 'openai',
key_type: 'api_key',
key_value: ApiKey.encryptKeyValue(process.env.OPENAI_API_KEY || 'your-openai-key-here'),
is_active: !!process.env.OPENAI_API_KEY,
metadata: JSON.stringify({
rate_limit_max: 1000,
rate_limit_window: 60000 // 1 minute
})
},
{
service_name: 'anthropic',
key_type: 'api_key',
key_value: ApiKey.encryptKeyValue(process.env.ANTHROPIC_API_KEY || 'your-anthropic-key-here'),
is_active: !!process.env.ANTHROPIC_API_KEY,
metadata: JSON.stringify({
rate_limit_max: 50,
rate_limit_window: 60000 // 1 minute
})
},
{
service_name: 'google_oauth',
key_type: 'client_id',
key_value: ApiKey.encryptKeyValue(process.env.GOOGLE_CLIENT_ID || 'your-google-client-id'),
is_active: !!process.env.GOOGLE_CLIENT_ID,
metadata: JSON.stringify({})
},
{
service_name: 'microsoft_oauth',
key_type: 'client_id',
key_value: ApiKey.encryptKeyValue(process.env.MICROSOFT_CLIENT_ID || 'your-microsoft-client-id'),
is_active: !!process.env.MICROSOFT_CLIENT_ID,
metadata: JSON.stringify({})
},
{
service_name: 'sentry',
key_type: 'api_key',
key_value: ApiKey.encryptKeyValue(process.env.SENTRY_DSN || 'your-sentry-dsn'),
is_active: !!process.env.SENTRY_DSN,
metadata: JSON.stringify({})
},
{
service_name: 'bugsnag',
key_type: 'api_key',
key_value: ApiKey.encryptKeyValue(process.env.BUGSNAG_API_KEY || 'your-bugsnag-key'),
is_active: !!process.env.BUGSNAG_API_KEY,
metadata: JSON.stringify({})
}
];
await queryInterface.bulkInsert('api_keys', apiKeys, {});
},
async down (queryInterface, Sequelize) {
await queryInterface.bulkDelete('api_keys', null, {});
}
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0031 ]-- |