{"id":16884420,"url":"https://github.com/yerkopalma/dsh","last_synced_at":"2025-04-11T12:24:11.430Z","repository":{"id":72770474,"uuid":"148535871","full_name":"YerkoPalma/dsh","owner":"YerkoPalma","description":":globe_with_meridians: Remotelly run commands using Dat","archived":false,"fork":false,"pushed_at":"2018-09-14T16:43:10.000Z","size":28,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T08:42:46.227Z","etag":null,"topics":["dat-protocol"],"latest_commit_sha":null,"homepage":"","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/YerkoPalma.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":"2018-09-12T20:09:13.000Z","updated_at":"2020-05-19T03:22:07.000Z","dependencies_parsed_at":"2023-03-06T17:45:39.197Z","dependency_job_id":null,"html_url":"https://github.com/YerkoPalma/dsh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YerkoPalma%2Fdsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YerkoPalma%2Fdsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YerkoPalma%2Fdsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YerkoPalma%2Fdsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YerkoPalma","download_url":"https://codeload.github.com/YerkoPalma/dsh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401434,"owners_count":21097328,"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":["dat-protocol"],"created_at":"2024-10-13T16:27:54.858Z","updated_at":"2025-04-11T12:24:11.418Z","avatar_url":"https://github.com/YerkoPalma.png","language":"JavaScript","readme":"# `dsh`\nRemotelly run commands using Dat.\n\n![demo-dsh](https://user-images.githubusercontent.com/5105812/45563501-ed55f600-b823-11e8-8165-9edb770e0bdf.gif)\n\n## How it works\nCreates a folder (`.datsrc`) with the following content\n\n```\n.dsrc/\n├── .dat/\n├── .dshell\n├── .key\n└── .datignore\n```\n\nThe dat folder is created by Dat, so there's nothing to explain here. The \n`.dshell` file is the main file. This is the only file shared through dat to the \nremote peer. It contains the commands to be executed remotely. \n\nThe logic is simple: Once connected to the shell, running `run \u003ccommand\u003e` will \nwrite to the local `.dshell` file the command, and replicate it through dat to \nthe remote machine. Previously, in the remote machine there should have started \nthe listener process `dshd`, this process get the public key of the original \nprocess as a parameter, and return a second key. This is because we are using \ntwo dats for bidirectional communication. This should change with multiwriter \nsupport. The second key is copied in the original machine.\n\nThis whole connection process whould happen only once in the original machine, \nand everytime the process start in the remote machine (althought is supposed to \nstart once only). \n\nSo, when the remote machine gets an update in the `dshell`file replicated from \nthe original one, it will read its content and executed as a child process, the \nwill write `stdout` and `stderr` to `.stdout` and `.stderr` to the second Dat \nthats used to replicate output to the originall machine. Finally, the original \nmachine will listen to the output update and print it to the console.\n\n## The client (original) process\n```bash\n$ dsh\ndsh \u003e help\n\n  Commands:\n\n    start              Start the Dat connections\n    exit               Exits application.\n    run [commands...]  Run commands when connected to a Dat\n    close              Close connection to Dat\n    help [command...]  Provides help for a given command.\n```\n\n```bash\n$ dsh\ndsh \u003e start\nDat link is: dat://2f1e21edde3fae6d62b5b124e03ded374d2717d3398bb20de57700f4348946d6\nEnter remote Dat key?\n```\n## The daemon process\n```bash\n$ dshd \u003ckey\u003e\nDat link is: dat://2f1e21edde3fae6d62b5b124e03ded374d2717d3398bb20de57700f4348946d6\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyerkopalma%2Fdsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyerkopalma%2Fdsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyerkopalma%2Fdsh/lists"}