{"_id":"@accellence/run-remote-task","_rev":"2-e2dc5e82e2fefae7af19dbe7f626f1a7","name":"@accellence/run-remote-task","dist-tags":{"latest":"1.0.2"},"versions":{"0.5.0":{"name":"@accellence/run-remote-task","version":"0.5.0","description":"Adapted version of the \"run-remote-task\" package, created by antelle. Orig-Src: https://github.com/antelle/run-remote-task\r Extended with support for local path, e.g. when the WebDAV repro is running on the same machine as the server instance.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"accellence"},"license":"MIT","bin":{"run-remote-task":"cli.js"},"repository":{"type":"git","url":"git+https://github.com/accellence/run-remote-task.git"},"devDependencies":{"babel-eslint":"^10.1.0","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-plugin-import":"^2.20.2","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-standard":"^4.0.1","prettier":"^2.0.2"},"dependencies":{"@google-cloud/storage":"^5.0.1","aws-sdk":"^2.688.0","minimist":"^1.2.5","npmrc":"^1.1.1"},"bugs":{"url":"https://github.com/accellence/run-remote-task/issues"},"homepage":"https://github.com/accellence/run-remote-task#readme","directories":{"doc":"docs"},"_id":"@accellence/run-remote-task@0.5.0","gitHead":"15504fccadd80eadf8d757f8776c239adee25286","_nodeVersion":"20.5.1","_npmVersion":"9.8.0","dist":{"integrity":"sha512-j0yim+EJk4U0DTqf//f+hGojDCPqQ5nakJ/LfLfyvZNZ5VuM5uBLyZSXK1es4Q61Ur4UvKovEOjqdsGZYeKvPQ==","shasum":"7e94e5f381a43a16f2cfc0f544c6aa4c289feac4","tarball":"https://registry.npmjs.org/@accellence/run-remote-task/-/run-remote-task-0.5.0.tgz","fileCount":5,"unpackedSize":28893,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHMOkP6WrsIdoLCQ3k+I5z2d1nwepkl69QPxyEFPa5JoAiEArz3pR/c4unFFMXBaRLywa2TDf5nHYZDOW5WUGcCs1Bw="}]},"_npmUser":{"name":"acx.lilienthal","email":"lilienthal@accellence.de"},"maintainers":[{"name":"acx.lilienthal","email":"lilienthal@accellence.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/run-remote-task_0.5.0_1692785038061_0.6306340809631923"},"_hasShrinkwrap":false},"1.0.1":{"name":"@accellence/run-remote-task","version":"1.0.1","description":"Adapted version of \"antelle/run-remote-task\" package, with some improvements and extended support for local path, e.g. when the WebDAV repro is running on the same machine as the server instance.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"accellence"},"license":"MIT","bin":{"run-remote-task":"cli.js"},"devDependencies":{"babel-eslint":"^10.1.0","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-plugin-import":"^2.20.2","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-standard":"^4.0.1","prettier":"^2.0.2"},"dependencies":{"@google-cloud/storage":"^5.0.1","aws-sdk":"^2.688.0","minimist":"^1.2.5"},"directories":{"doc":"docs"},"repository":{"type":"git","url":"git+https://github.com/accellence/run-remote-task.git"},"bugs":{"url":"https://github.com/accellence/run-remote-task/issues"},"homepage":"https://github.com/accellence/run-remote-task#readme","_id":"@accellence/run-remote-task@1.0.1","gitHead":"f549a1fc3320394f2c0e95893d3bfa8f82c6739d","_nodeVersion":"20.5.1","_npmVersion":"9.8.0","dist":{"integrity":"sha512-pM1f2lmfZOvfB9iV2rYitgV41HbgO8UssjnFoO0hSyX5FW650LlfagV/9aAuCw8i0rmpzX7RudDBcuoi4dGEgQ==","shasum":"913255267b0f885df522c7855b2c31c400edeb25","tarball":"https://registry.npmjs.org/@accellence/run-remote-task/-/run-remote-task-1.0.1.tgz","fileCount":5,"unpackedSize":29474,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAr4c3ffeglr9Y943dbvEGHV9QOkVljzCohGpKCOx4uEAiEAwJosB2mXjW5Xz6dXIWCVmAAWQWvn6X5706z9mROAkpw="}]},"_npmUser":{"name":"acx.lilienthal","email":"lilienthal@accellence.de"},"maintainers":[{"name":"acx.lilienthal","email":"lilienthal@accellence.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/run-remote-task_1.0.1_1692814356177_0.5392645612409703"},"_hasShrinkwrap":false},"1.0.2":{"name":"@accellence/run-remote-task","version":"1.0.2","description":"Adapted version of \"antelle/run-remote-task\" package, with some improvements and extended support for local path, e.g. when the WebDAV repro is running on the same machine as the server instance.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"accellence"},"license":"MIT","bin":{"run-remote-task":"cli.js"},"devDependencies":{"babel-eslint":"^10.1.0","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-plugin-import":"^2.20.2","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-standard":"^4.0.1","prettier":"^2.0.2"},"dependencies":{"@google-cloud/storage":"^5.0.1","aws-sdk":"^2.688.0","minimist":"^1.2.5"},"directories":{"doc":"docs"},"repository":{"type":"git","url":"git+https://github.com/accellence/run-remote-task.git"},"bugs":{"url":"https://github.com/accellence/run-remote-task/issues"},"homepage":"https://github.com/accellence/run-remote-task#readme","_id":"@accellence/run-remote-task@1.0.2","gitHead":"4fc09d3b61ed3b97c85d14e94f25c04de6f90685","_nodeVersion":"20.5.1","_npmVersion":"9.8.0","dist":{"integrity":"sha512-ZEDUWwnuoOIFkNeUiA9+fmI+hIkRAMitc9VqALcc+Edg2uWOxotUlR1Z75Qk84HWGFND9BHt83JjZsWsyBWrNA==","shasum":"72e65f4a5018c740187fa7ca0396c9679f2eb5fa","tarball":"https://registry.npmjs.org/@accellence/run-remote-task/-/run-remote-task-1.0.2.tgz","fileCount":5,"unpackedSize":29476,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1nuCydjlWtQFj7lB7Q3vyHdMT3VvRc0KCy+3H+poPcAIgOSdtykq9iyXndhtS0IoDr5JZ6xRYwwJyxOUpamGvDPk="}]},"_npmUser":{"name":"acx.lilienthal","email":"lilienthal@accellence.de"},"maintainers":[{"name":"acx.lilienthal","email":"lilienthal@accellence.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/run-remote-task_1.0.2_1692815077467_0.6548721956412193"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-23T10:03:57.925Z","0.5.0":"2023-08-23T10:03:58.330Z","modified":"2023-08-23T18:24:38.008Z","1.0.1":"2023-08-23T18:12:36.545Z","1.0.2":"2023-08-23T18:24:37.613Z"},"maintainers":[{"name":"acx.lilienthal","email":"lilienthal@accellence.de"}],"description":"Adapted version of \"antelle/run-remote-task\" package, with some improvements and extended support for local path, e.g. when the WebDAV repro is running on the same machine as the server instance.","homepage":"https://github.com/accellence/run-remote-task#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/accellence/run-remote-task.git"},"author":{"name":"accellence"},"bugs":{"url":"https://github.com/accellence/run-remote-task/issues"},"license":"MIT","readme":"# Run remote task\r\nAdapted version of \\\"@antelle/run-remote-task\\\", with some improvements and extended support for local path, e.g. when the WebDAV repro is running on the same machine as the server instance.\r\n\r\n===\r\nRuns tasks on a remote machine with communication over a WebDAV server.\r\n\r\nAll messages are signed, which means you can use it even if you don't trust the WebDAV server. \r\nIf data is modified in between, the task won't be executed or the result won't be accepted.\r\nIt's also fine to use HTTP, unless you're concerned about data being accessible to someone else.\r\n\r\n## How it works\r\n\r\nThis diagram explains the interaction without going too deep into details:\r\n\r\n<img src=\"docs/diagram.png\" width=\"589\" />\r\n\r\n## Usage\r\n\r\n1. Generate two keypairs:\r\n\r\n    ```sh\r\n    openssl genrsa -out private-key-client.pem 2048\r\n    openssl rsa -in private-key-client.pem -outform PEM -pubout -out public-key-client.pem\r\n    \r\n    openssl genrsa -out private-key-server.pem 2048\r\n    openssl rsa -in private-key-server.pem -outform PEM -pubout -out public-key-server.pem\r\n    ```\r\n\r\n2. Upload the keys:\r\n\r\n    * to client boxes:\r\n        * `private-key-client.pem`\r\n        * `public-key-client.pem`\r\n        * `public-key-server.pem`\r\n    * to the server box:\r\n        * `private-key-server.pem`\r\n        * `public-key-client.pem`\r\n        * `public-key-server.pem`\r\n\r\n3. Create a json config:\r\n\r\n    ```json\r\n    {\r\n        \"server\": \"http://your-webdav-server/with-path/\",\r\n        \"user\": \"webdav-user\",\r\n        \"password\": \"webdav-password\",\r\n        \"clientPublicKey\": \"path/to/public-key-client.pem\",\r\n        \"serverPublicKey\": \"path/to/public-key-server.pem\",\r\n        \"clientPrivateKey\": \"path/to/private-key-client.pem\",\r\n        \"serverPrivateKey\": \"path/to/private-key-server.pem\",\r\n        \"pollMillis\": 5000,\r\n        \"taskExpirationMillis\": 600000,\r\n        \"command\": \"run_task.sh\",\r\n        \"commandRetries\": 10\r\n    }\r\n    ```\r\n\r\n   If you're using Google Cloud Storage:\r\n   ```json\r\n   {\r\n       \"gcp\": {\r\n           \"projectId\": \"my-project\",\r\n           \"bucketName\": \"my-bucket\",\r\n           \"credentials\": {\r\n               \"client_email\": \"...\",\r\n               \"private_key\": \"...\"\r\n           }\r\n       },\r\n       \"clientPublicKey\": \"path/to/public-key-client.pem\",\r\n       \"serverPublicKey\": \"path/to/public-key-server.pem\",\r\n       \"clientPrivateKey\": \"path/to/private-key-client.pem\",\r\n       \"serverPrivateKey\": \"path/to/private-key-server.pem\",\r\n       \"pollMillis\": 5000,\r\n       \"taskExpirationMillis\": 600000,\r\n       \"command\": \"run_task.sh\",\r\n       \"commandRetries\": 10\r\n   }\r\n   ```\r\n   \r\n   If you're using AWS S3:\r\n   ```json\r\n   {\r\n       \"aws\": {\r\n           \"accessKeyId\": \"...\",\r\n           \"secretAccessKey\": \"...\",\r\n           \"region\": \"eu-central-1\",\r\n           \"bucket\": \"my-bucket\"\r\n       },\r\n       \"clientPublicKey\": \"path/to/public-key-client.pem\",\r\n       \"serverPublicKey\": \"path/to/public-key-server.pem\",\r\n       \"clientPrivateKey\": \"path/to/private-key-client.pem\",\r\n       \"serverPrivateKey\": \"path/to/private-key-server.pem\",\r\n       \"pollMillis\": 5000,\r\n       \"taskExpirationMillis\": 600000,\r\n       \"command\": \"run_task.sh\",\r\n       \"commandRetries\": 10\r\n   }\r\n   ```\r\n   \r\n   If you like to use local storage:\r\n   ```json\r\n   {\r\n       \"path\": \"path/to/data/directory\",\r\n       \"clientPublicKey\": \"path/to/public-key-client.pem\",\r\n       \"serverPublicKey\": \"path/to/public-key-server.pem\",\r\n       \"clientPrivateKey\": \"path/to/private-key-client.pem\",\r\n       \"serverPrivateKey\": \"path/to/private-key-server.pem\",\r\n       \"pollMillis\": 5000,\r\n       \"taskExpirationMillis\": 600000,\r\n       \"command\": \"run_task.sh\",\r\n       \"commandRetries\": 10\r\n   }\r\n   ```\r\n   \r\n   Upload this config to both server and clients.\r\n\r\n4. Write your task in `run_task.sh`. Your task receives two environment variables: \r\n    * `INPUT`: file with input data received from the client\r\n    * `OUTPUT`: expected output file name that will be sent back\r\n\r\n    Here's a hello world example:\r\n    \r\n    ```sh\r\n    name=$(<$INPUT); echo \"Hello, $name!\">$OUTPUT\r\n    ```\r\n\r\n5. Run the server:\r\n\r\n    ```sh\r\n    npx @accellence/run-remote-task --config=config.json --server\r\n    ```\r\n\r\n6. Test the client:\r\n\r\n    ```sh\r\n   npx @accellence/run-remote-task --config=config.json --client --input=input.txt --output=output.txt\r\n    ```\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}