!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/local/lib/node_modules/strapi/node_modules/strapi-generate-new/lib/utils/   drwxr-xr-x
Free 12.97 GB of 57.97 GB (22.37%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     parse-db-arguments.js (1.58 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
'use strict';

const chalk = require('chalk');
const stopProcess = require('./stop-process');

const DB_ARGS = [
  'dbclient',
  'dbhost',
  'dbport',
  'dbname',
  'dbusername',
  'dbpassword',
];

const VALID_CLIENTS = ['sqlite', 'mysql', 'postgres', 'mongo'];

module.exports = function parseDatabaseArguments({ scope, args }) {
  const argKeys = Object.keys(args);
  const matchingArgs = DB_ARGS.filter(key => argKeys.includes(key));
  const missingArgs = DB_ARGS.filter(key => !argKeys.includes(key));

  if (matchingArgs.length === 0) return;

  if (matchingArgs.length !== DB_ARGS.length && args.dbclient !== 'sqlite') {
    return stopProcess(
      `Required database arguments are missing: ${missingArgs.join(', ')}.`
    );
  }

  if (!VALID_CLIENTS.includes(args.dbclient)) {
    return stopProcess(
      `Invalid client ${chalk.yellow(
        args.dbclient
      )}. Possible choices: ${VALID_CLIENTS.join(', ')}.`
    );
  }

  scope.dbforce = args.dbforce !== undefined;

  const database = {
    settings: {
      client: args.dbclient,
      host: args.dbhost,
      srv: args.dbsrv,
      port: args.dbport,
      database: args.dbname,
      username: args.dbusername,
      password: args.dbpassword,
      filename: args.dbfile,
    },
    options: {},
  };

  if (args.dbauth !== undefined) {
    database.options.authenticationDatabase = args.dbauth;
  }

  if (args.dbssl !== undefined) {
    if (args.dbclient === 'mongo') {
      database.options.ssl = args.dbssl === 'true';
    } else {
      database.settings.ssl = args.dbssl === 'true';
    }
  }

  scope.database = database;
};

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0056 ]--