{"id":21009004,"url":"https://github.com/avin/ssh-delivery","last_synced_at":"2025-04-24T01:20:46.403Z","repository":{"id":65692882,"uuid":"503327210","full_name":"avin/ssh-delivery","owner":"avin","description":"Do fast files deploy with SFTP. Support servers chain.","archived":false,"fork":false,"pushed_at":"2025-02-13T14:45:52.000Z","size":251,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T10:12:31.548Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-14T11:18:53.000Z","updated_at":"2025-02-13T14:45:57.000Z","dependencies_parsed_at":"2024-02-20T09:24:34.379Z","dependency_job_id":"300744bf-bf91-485d-9e2b-0cc0ebaeaafb","html_url":"https://github.com/avin/ssh-delivery","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"cc56ab7f77f95de0c0b91e6090b4630ffe2449b7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fssh-delivery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fssh-delivery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fssh-delivery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fssh-delivery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avin","download_url":"https://codeload.github.com/avin/ssh-delivery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250541582,"owners_count":21447544,"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-11-19T09:15:09.033Z","updated_at":"2025-04-24T01:20:46.383Z","avatar_url":"https://github.com/avin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSH-Delivery\n\nDo fast files deploy with SFTP. Support servers chain.\n\n## Install\n\n```sh\nnpm install -g ssh-delivery\n```\n\n## Configure\n\nCreate config with tasks and servers declaration. Default config file names :\n\n```\n.deliveryrc\n.deliveryrc.js\n.delivery.config.js\ndelivery.config.js\n```\n\n```js\nconst fs = require('fs');\nconst path = require('path');\n\nmodule.exports = {\n  // SSH servers (all server options see at https://github.com/mscdex/ssh2#client-methods `connect` method)\n  // Upload destination servers should support SFTP. Gateway servers should support port forwarding.\n  servers: {\n    gate: {\n      alias: 'gate',\n      host: 'gate.myweb.com',\n      username: 'root',\n      password: 'secret',\n      // Optional: Socks5 proxy settings for connecting to the first SSH server in the chain\n      socksProxyHost: '127.0.0.1',\n      socksProxyPort: 1080,\n      // socksProxyUsername and socksProxyPassword are optional if your proxy requires authentication\n      // socksProxyUsername: 'proxyUser',\n      // socksProxyPassword: 'proxyPass',\n    },\n    web: {\n      host: 'myweb.com',\n      port: 41022,\n      username: 'root',\n      privateKey: fs.readFileSync(path.resolve(os.homedir(), '.ssh', 'id_rsa')),\n      passphrase: 'secret',\n      via: 'gate', // Connection to this server will be made via 'gate' server\n    },\n  },\n\n  // Delivery tasks\n  tasks: {\n    deployToWebServer: {\n      // Commands before uploading\n      before: {\n        run: ['npm run build'],\n      },\n\n      // Files to upload\n      src: {\n        path: './build/',\n      },\n\n      // Where should upload\n      dst: {\n        server: 'web', // server name from servers-section\n        path: '/var/www/html', // path on remote server\n      },\n\n      // Commands after uploading\n      after: {\n        run: ['rm -rf ./build'],\n      },\n    },\n  },\n};\n```\n\nYou can keep servers options secure in your home directory. Create `$HOME/.delivery.js` with content like this:\n\n```js\nconst fs = require('fs');\nconst os = require('os');\nconst path = require('path');\n\nmodule.exports = {\n  servers: {\n    gate: {\n      alias: 'gate',\n      host: 'gate.myweb.com',\n      username: 'root',\n      password: 'secret',\n      // Optional Socks5 proxy settings:\n      // socksProxyHost: '127.0.0.1',\n      // socksProxyPort: 1080,\n      // socksProxyUsername: 'proxyUser',\n      // socksProxyPassword: 'proxyPass',\n    },\n    web: {\n      host: 'myweb.com',\n      port: 41022,\n      username: 'root',\n      privateKey: fs.readFileSync(path.resolve(os.homedir(), '.ssh', 'id_rsa')),\n      passphrase: 'secret',\n      via: 'gate', // Connection to this server will be made via 'gate' server\n    },\n  },\n}\n```\n\nand use serves `gate` and `web` in your separate configs without redeclaration.\n\n## Run\n\nRun `static` task with\n\n```sh\ndelivery deployToWebServer\n```\n\nor with custom config path\n\n```sh\ndelivery deployToWebServer -c ./custom-config.js\n```\n\nYou can keep servers options with credentials in separate config\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favin%2Fssh-delivery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favin%2Fssh-delivery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favin%2Fssh-delivery/lists"}