{"_id":"@bytelab.studio/ksm-proxy","_rev":"1-20284cdb401e8aa76d27cf13ad78bb0b","name":"@bytelab.studio/ksm-proxy","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@bytelab.studio/ksm-proxy","version":"1.0.0","keywords":["proxy","reverse-proxy","ksm"],"author":{"name":"Christoph Koschel"},"license":"MIT","_id":"@bytelab.studio/ksm-proxy@1.0.0","maintainers":[{"name":"koschel-christoph","email":"christoph.koschel86@gmail.com"}],"dist":{"shasum":"13b6462c8d589f1ac380d50304b004348a49e3d7","tarball":"https://registry.npmjs.org/@bytelab.studio/ksm-proxy/-/ksm-proxy-1.0.0.tgz","fileCount":11,"integrity":"sha512-nhUAIeKipCdYwRJIcen0ND9HjD6Z5eY8iNNtjGyL3nUe8KrPB5nrLzAcGa0bJIB10xF5Ec30zjeKuQzqzdVVtw==","signatures":[{"sig":"MEYCIQDbNI/m6j6y3qPeVjRIsRxkmzFKH2g/w8QOR0VzM/18SwIhAJzcmUqisJMyw/+Kw/kIwrhLomm94VbCMTRBTvTBWv+m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22003},"main":"","gitHead":"082029edc61e2e4ac740af36f75e6e7bb040ddf8","scripts":{"test":"echo \"Error: no test specified\" && exit 0","preinstall":"node ./scripts/preinstall.js","postinstall":"node ./scripts/postinstall.js","preuninstall":"node scripts/preuninstall.js"},"_npmUser":{"name":"koschel-christoph","email":"christoph.koschel86@gmail.com"},"_npmVersion":"8.19.4","description":"A reverse proxy for ksm","directories":{},"_nodeVersion":"16.20.2","dependencies":{"express":"^4.21.0","http-proxy":"^1.18.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/express":"^5.0.0","@types/http-proxy":"^1.17.15"},"_npmOperationalInternal":{"tmp":"tmp/ksm-proxy_1.0.0_1728370315583_0.257078325143689","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@bytelab.studio/ksm-proxy","version":"1.1.0","description":"A reverse proxy for ksm","main":"","author":{"name":"Christoph Koschel"},"license":"MIT","keywords":["proxy","reverse-proxy","ksm"],"scripts":{"test":"echo \"Error: no test specified\" && exit 0","preinstall":"node ./scripts/preinstall.js","postinstall":"node ./scripts/postinstall.js","preuninstall":"node scripts/preuninstall.js"},"dependencies":{"http-proxy":"^1.18.1"},"devDependencies":{"@types/http-proxy":"^1.17.15"},"gitHead":"a66a0a006106ac7b75f00c9c3312893e0698261a","_id":"@bytelab.studio/ksm-proxy@1.1.0","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-DjbQNJ5Zv1/+uIRveFnWq4i4Uk5eUXP3v3c4wueExZGXGYPiZe6AWkjkiR48Zc0PtPQ27cGTeNNFkqoA5pvaOw==","shasum":"04ef5a75058620f76a576482797602e4a8dad109","tarball":"https://registry.npmjs.org/@bytelab.studio/ksm-proxy/-/ksm-proxy-1.1.0.tgz","fileCount":11,"unpackedSize":25107,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGl9twaf8XpC1Q/Ees1ArZNL2AwXo8RnlxYjLNfiPUY8AiAc/YrCqgUBBHuvQh7IRxYvV7+gk5/llz0ZRVddiv9sbg=="}]},"_npmUser":{"name":"koschel-christoph","email":"christoph.koschel86@gmail.com"},"directories":{},"maintainers":[{"name":"koschel-christoph","email":"christoph.koschel86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ksm-proxy_1.1.0_1728585862247_0.8030894435718472"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-08T06:51:55.453Z","modified":"2024-10-10T18:44:22.609Z","1.0.0":"2024-10-08T06:51:55.775Z","1.1.0":"2024-10-10T18:44:22.424Z"},"author":{"name":"Christoph Koschel"},"license":"MIT","keywords":["proxy","reverse-proxy","ksm"],"description":"A reverse proxy for ksm","maintainers":[{"name":"koschel-christoph","email":"christoph.koschel86@gmail.com"}],"readme":"# KSM Proxy\n\nA proxy extension for the [KSM](https://github.com/bytelab-studio/ksm) project.\n\n## Installation\n\n```shell\nnpm install -g @bytelab.studio/ksm-proxy\n```\n\n> The installation requires root privileges. Also, KSM must be pre-installed before the extension can be added.\n\n## Configuration\n\n```typescript\n// Extension configuration\nexport interface ServerDomain {\n    domain: string;\n    regex: boolean;\n    regexFlags: string;\n}\n\ninterface ProxyConfig {\n    enable: boolean;\n    domains: ServerDomain[];\n    security: {\n        \"ip-blacklist\": string[];\n        \"ip-whitelist\": string[];\n        \"block-by-default\": boolean;\n    }\n}\n\n// Base configuration\ninterface ServerConfig {\n    proxy: ProxyConfig;\n    cwd: string;\n    ports: {\n        http: number;\n        https: number;\n    }\n    env: Record<string, string | boolean | number>;\n    command: string[];\n}\n```\n\nWhen installed the server config can be further configured with proxy information in the `proxy` field.\n\n### Sample configuration\n\nAn extended example configuration for an express.js app\n\n```json\n{\n    \"proxy\": {\n        \"enable\": true,\n        \"domains\": [\n            {\n                \"domain\": \"foo.example.com\",\n                \"regex\": false,\n                \"regexFlags\": \"\"\n            },\n            {\n                \"domain\": \"bar.*\\\\.example\\\\.com\",\n                \"regex\": true,\n                \"regexFlags\": \"i\"\n            }\n        ],\n        \"security\": {\n            \"ip-blacklist\": [\"8.8.8.8\"],\n            \"ip-whitelist\": [],\n            \"block-by-default\": false\n        }\n    },\n    \"cwd\": \".\",\n    \"ports\": {\n        \"http\": 2000,\n        \"https\": 2001\n    },\n    \"env\": {\n        \"debug\": false\n    },\n    \"command\": [\n        \"node\",\n        \"./app/main.js\"\n    ]\n}\n```\n\nWhen added the server can be called by the domains via the proxy server.\n\n### Template configuration\n\n```json\n{\n    \"proxy\": {\n        \"enable\": true,\n        \"domains\": [],\n        \"security\": {\n            \"ip-blacklist\": [],\n            \"ip-whitelist\": [],\n            \"block-by-default\": false\n        }\n    },\n    \"cwd\": \".\",\n    \"ports\": {\n        \"http\": 0,\n        \"https\": 0\n    },\n    \"env\": {},\n    \"command\": []\n}\n```\n\n### Base configuration\n\nKSM Proxy extends the base configuration located at `/etc/ksm/config.json` with the `proxy` property.\n\n```json\n{\n    \"proxy\": {\n        \"enable\": false,\n        \"security\": {\n            \"cert\": {\n                \"public\": \"\",\n                \"private\": \"\"\n            }\n        }\n    },\n    \"env\": {\n        \"KSM_CONFIG\": \"/etc/ksm/config.json\",\n        \"KSM_SERVERLIST\": \"/etc/ksm/serverlist\"\n    }\n}\n```\n\n### Advance configuration\n\nKSM Proxy is an advance KSM server, so ports and other things can be configured in the `ksm.json` file, located at\nthe `ksm-proxy` npm package installation location.\n\n## Contribution\n\nContributions are welcome! If you'd like to help improve KSM, feel free to submit a pull request or open an issue.\nWhether it's bug fixes, new features, or documentation improvements, all contributions are appreciated.\n","readmeFilename":"README.md"}