$84 GRAYBYTE WORDPRESS FILE MANAGER $37

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/lib/node_modules/npm/lib/config/

HOME
Current File : /lib/node_modules/npm/lib/config//figgy-config.js
'use strict'

const BB = require('bluebird')

const crypto = require('crypto')
const figgyPudding = require('figgy-pudding')
const log = require('npmlog')
const npm = require('../npm.js')
const pack = require('../pack.js')
const path = require('path')

const npmSession = npm.session = crypto.randomBytes(8).toString('hex')
log.verbose('npm-session', npmSession)

const SCOPE_REGISTRY_REGEX = /@.*:registry$/gi
const NpmConfig = figgyPudding({}, {
  other (key) {
    return key.match(SCOPE_REGISTRY_REGEX)
  }
})

let baseConfig

module.exports = mkConfig
function mkConfig (...providers) {
  if (!baseConfig) {
    baseConfig = NpmConfig(npm.config, {
      // Add some non-npm-config opts by hand.
      cache: path.join(npm.config.get('cache'), '_cacache'),
      // NOTE: npm has some magic logic around color distinct from the config
      // value, so we have to override it here
      color: !!npm.color,
      dirPacker: pack.packGitDep,
      hashAlgorithm: 'sha1',
      includeDeprecated: false,
      log,
      'npm-session': npmSession,
      'project-scope': npm.projectScope,
      refer: npm.referer,
      dmode: npm.modes.exec,
      fmode: npm.modes.file,
      umask: npm.modes.umask,
      npmVersion: npm.version,
      tmp: npm.tmp,
      Promise: BB
    })
    const ownerStats = calculateOwner()
    if (ownerStats.uid != null || ownerStats.gid != null) {
      baseConfig = baseConfig.concat(ownerStats)
    }
  }
  let conf = baseConfig.concat(...providers)
  // Adapt some other configs if missing
  if (npm.config.get('prefer-online') === undefined) {
    conf = conf.concat({
      'prefer-online': npm.config.get('cache-max') <= 0
    })
  }
  if (npm.config.get('prefer-online') === undefined) {
    conf = conf.concat({
      'prefer-online': npm.config.get('cache-min') >= 9999
    })
  }
  return conf
}

let effectiveOwner
function calculateOwner () {
  if (!effectiveOwner) {
    effectiveOwner = { uid: 0, gid: 0 }

    // Pretty much only on windows
    if (!process.getuid) {
      return effectiveOwner
    }

    effectiveOwner.uid = +process.getuid()
    effectiveOwner.gid = +process.getgid()

    if (effectiveOwner.uid === 0) {
      if (process.env.SUDO_UID) effectiveOwner.uid = +process.env.SUDO_UID
      if (process.env.SUDO_GID) effectiveOwner.gid = +process.env.SUDO_GID
    }
  }

  return effectiveOwner
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 8.02 AM
root / root
0755
bin-links.js
0.699 KB
10 Mar 2021 9.36 PM
root / root
0644
clear-credentials-by-uri.js
0.413 KB
10 Mar 2021 9.36 PM
root / root
0644
cmd-list.js
2.168 KB
10 Mar 2021 9.36 PM
root / root
0644
core.js
10.897 KB
10 Mar 2021 9.36 PM
root / root
0644
defaults.js
11.45 KB
10 Mar 2021 9.36 PM
root / root
0644
figgy-config.js
2.308 KB
10 Mar 2021 9.36 PM
root / root
0644
gentle-fs.js
0.671 KB
10 Mar 2021 9.36 PM
root / root
0644
get-credentials-by-uri.js
2.158 KB
10 Mar 2021 9.36 PM
root / root
0644
lifecycle.js
0.831 KB
10 Mar 2021 9.36 PM
root / root
0644
load-cafile.js
0.666 KB
10 Mar 2021 9.36 PM
root / root
0644
load-prefix.js
1.3 KB
10 Mar 2021 9.36 PM
root / root
0644
nerf-dart.js
0.46 KB
10 Mar 2021 9.36 PM
root / root
0644
set-credentials-by-uri.js
1.237 KB
10 Mar 2021 9.36 PM
root / root
0644
set-user.js
0.74 KB
10 Mar 2021 9.36 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF