修改后台权限
This commit is contained in:
15
node_modules/is-in-ssh/index.d.ts
generated
vendored
Normal file
15
node_modules/is-in-ssh/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
Check if the process is running in an SSH session.
|
||||
|
||||
@example
|
||||
```
|
||||
import isInSsh from 'is-in-ssh';
|
||||
|
||||
if (isInSsh) {
|
||||
console.log('Running in an SSH session');
|
||||
}
|
||||
```
|
||||
*/
|
||||
declare const isInSsh: boolean;
|
||||
|
||||
export default isInSsh;
|
||||
7
node_modules/is-in-ssh/index.js
generated
vendored
Normal file
7
node_modules/is-in-ssh/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import process from 'node:process';
|
||||
|
||||
const isInSsh = Boolean(process.env.SSH_CONNECTION
|
||||
|| process.env.SSH_CLIENT
|
||||
|| process.env.SSH_TTY);
|
||||
|
||||
export default isInSsh;
|
||||
9
node_modules/is-in-ssh/license
generated
vendored
Normal file
9
node_modules/is-in-ssh/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
43
node_modules/is-in-ssh/package.json
generated
vendored
Normal file
43
node_modules/is-in-ssh/package.json
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "is-in-ssh",
|
||||
"version": "1.0.0",
|
||||
"description": "Check if the process is running in an SSH session",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/is-in-ssh",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"types": "./index.d.ts",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && node --test"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"ssh",
|
||||
"detect",
|
||||
"detection",
|
||||
"session",
|
||||
"remote",
|
||||
"connection",
|
||||
"environment",
|
||||
"check",
|
||||
"is"
|
||||
],
|
||||
"devDependencies": {
|
||||
"xo": "^1.2.3"
|
||||
}
|
||||
}
|
||||
43
node_modules/is-in-ssh/readme.md
generated
vendored
Normal file
43
node_modules/is-in-ssh/readme.md
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# is-in-ssh
|
||||
|
||||
> Check if the process is running in an SSH session
|
||||
|
||||
Useful for determining if your Node.js process is being executed over SSH, which can affect how you handle operations like opening files, browsers, or using system-specific commands.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install is-in-ssh
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import isInSsh from 'is-in-ssh';
|
||||
|
||||
if (isInSsh) {
|
||||
console.log('Running in an SSH session');
|
||||
}
|
||||
```
|
||||
|
||||
## How it works
|
||||
|
||||
The package detects SSH sessions by checking for the presence of standard SSH environment variables:
|
||||
|
||||
- `SSH_CONNECTION`
|
||||
- `SSH_CLIENT`
|
||||
- `SSH_TTY`
|
||||
|
||||
These variables are automatically set by SSH servers when establishing a connection.
|
||||
|
||||
## Limitations
|
||||
|
||||
- The detection relies on environment variables, which could theoretically be spoofed or cleared
|
||||
- May return `true` for `ssh localhost` connections (which are technically SSH sessions)
|
||||
- Environment variables might not be inherited by all child processes or after privilege escalation (e.g., `sudo`)
|
||||
|
||||
## Related
|
||||
|
||||
- [is-wsl](https://github.com/sindresorhus/is-wsl) - Check if the process is running inside Windows Subsystem for Linux
|
||||
- [is-docker](https://github.com/sindresorhus/is-docker) - Check if the process is running inside a Docker container
|
||||
- [is-inside-container](https://github.com/sindresorhus/is-inside-container) - Check if the process is running inside a container
|
||||
Reference in New Issue
Block a user