{"id":13778154,"url":"https://github.com/maestrano/webshell-server","last_synced_at":"2025-06-25T20:13:21.449Z","repository":{"id":143928535,"uuid":"52134385","full_name":"maestrano/webshell-server","owner":"maestrano","description":"Web based shell with configurable authentication","archived":false,"fork":false,"pushed_at":"2016-04-03T05:00:58.000Z","size":148,"stargazers_count":15,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-20T04:37:53.934Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maestrano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-02-20T03:29:41.000Z","updated_at":"2023-09-04T02:14:08.000Z","dependencies_parsed_at":"2024-01-15T08:06:52.640Z","dependency_job_id":null,"html_url":"https://github.com/maestrano/webshell-server","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/maestrano/webshell-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maestrano%2Fwebshell-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maestrano%2Fwebshell-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maestrano%2Fwebshell-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maestrano%2Fwebshell-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maestrano","download_url":"https://codeload.github.com/maestrano/webshell-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maestrano%2Fwebshell-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260898286,"owners_count":23079230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T18:00:51.640Z","updated_at":"2025-06-25T20:13:21.429Z","avatar_url":"https://github.com/maestrano.png","language":"JavaScript","funding_links":[],"categories":["\u003ca id=\"faa91844951d2c29b7b571c6e8a3eb54\"\u003e\u003c/a\u003e新添加"],"sub_categories":[],"readme":"Webshell Server\n-----------------\n\nTerminal over HTTP and HTTPS. Outrageously inspired from the excellent [Wetty](https://github.com/krishnasrinivas/wetty) - adapted to support web based authentication.\n\nNot production ready.\n\nInstall\n-------\n```bash\ngit clone https://github.com/maestrano/webshell-server\ncd webshell-server\nnpm install\n```\n\nRun:\n-----------\n\n```bash\nnode app.js -p 3000\n```\n\nConfiguration - Example accessing docker containers\n-----------------------------------------------------\nEdit the config.js file in the project directory to specify how authentication should be handled and what shell command should be run at startup.\n\nE.g.\n```js\nvar config = {};\n\n// Session Configuration\nconfig.session = {\n  key: 'webshell',\n  secret: 'a-session-secret-that-you-should-change',\n};\n\n// Uses passport under the hood\n// Best option here is to make a REST API call to some authentication\n// endpoint of your own\n//\n// Here we authorise user with login \"foo\" and password \"bar\"\nconfig.authFn = function(req, username, password, cb) {\n  if (username == \"foo\" \u0026\u0026 password == \"bar\" \u0026\u0026 req.body.resource_id) {\n    return cb(null, { id: username, resource_id: req.body.resource_id });\n  } else {\n    return cb(null, false, { message: 'Invalid credentials' });\n  }\n}\n\n// Which command to run upon user authentication\n// Here we attach to a docker container\nconfig.shellEntrypoint = function(req) {\n  return {\n    script: '/usr/local/bin/docker',\n    args: ['exec', '-it', req.user.resource_id, '/bin/bash'],\n  };\n}\n\nmodule.exports = config;\n```\n\n**Run your application:**  \n```bash\nnode app.js -p 3000\n```\n\n**Login using foo/bar:**  \nhttp://localhost:3000/login?rid=my-container-name-or-id\n\nYou should be inside your docker container.\n\nRun webshell as a service daemon\n-----------------------------\n\nInstall webshell-server globally with -g option:\n\n```bash\nsudo npm install webshell-server -g\nsudo cp /usr/local/lib/node_modules/webshell-server/bin/webshell-server.conf /etc/init\nsudo start webshell-server\n```\n\nThis will start webshell-server on port 9443.\n\nWebshell configuration can be edited at /etc/webshell/config.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaestrano%2Fwebshell-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaestrano%2Fwebshell-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaestrano%2Fwebshell-server/lists"}