{"id":13626572,"url":"https://github.com/tw4452852/barn","last_synced_at":"2026-01-26T07:16:04.364Z","repository":{"id":39334967,"uuid":"504734211","full_name":"tw4452852/barn","owner":"tw4452852","description":":milky_way: A mirror root of your local directory","archived":false,"fork":false,"pushed_at":"2023-08-15T09:16:13.000Z","size":19,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-08T16:44:34.024Z","etag":null,"topics":["fuse","linux","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tw4452852.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":"2022-06-18T03:28:40.000Z","updated_at":"2024-05-29T09:13:29.000Z","dependencies_parsed_at":"2024-01-14T07:20:18.380Z","dependency_job_id":null,"html_url":"https://github.com/tw4452852/barn","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tw4452852%2Fbarn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tw4452852%2Fbarn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tw4452852%2Fbarn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tw4452852%2Fbarn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tw4452852","download_url":"https://codeload.github.com/tw4452852/barn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249250832,"owners_count":21237961,"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":["fuse","linux","zig"],"created_at":"2024-08-01T21:02:24.069Z","updated_at":"2026-01-26T07:16:04.351Z","avatar_url":"https://github.com/tw4452852.png","language":"Zig","funding_links":[],"categories":["Zig"],"sub_categories":[],"readme":"# Barn\n\nBarn is a tool to mirror your local directory on a remote machine.\n\n## demo\n\n[![asciicast](https://asciinema.org/a/ZDBRvZRtip7ZFiNF7xG5q4liR.svg)](https://asciinema.org/a/ZDBRvZRtip7ZFiNF7xG5q4liR)\n\n### Prerequisite\n\nMake sure the remote machine's kernel has enabled `CONFIG_FUSE_FS`.\nThis is the only dependency, no others!\n\n## Usage\n\n1. Start server on the remote machine:\n\n```\n# barn server\n```\n\nBy default, it will select a unused port to listen on. Of course you could specify the port with `--port` option:\n\n```\n# barn server --port=xxx\n```\n\n2. Connect to the server from your local machine:\n\n```\n# barn client --remote=\u003cremote machine's ip address\u003e --port=\u003cthe listenning port\u003e\n```\n\n3. Once the initialization is done between server and client,\nyou should see the mirror directory like this on server's output:\n\n```\nserving from \u003cip\u003e:\u003cport\u003e, the mirror root directory: /tmp/barn_xxx\n```\n\nHowever, you could also find the location through mount point:\n\n```\n# mount\n...\n/dev/fuse on /tmp/barn_xxx type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0)\n```\n\n4. Now, everything is set successfully, you could do whatever you want in the mirror directory,\neverything there is a mirror of your local root directory.\nYou could even `chroot` into that directory:\n\n```\n# chroot /tmp/barn_xxx /bin/bash\n```\n\nHave fun!\n\n## Installation\n\nYou could either download the [prebuilt binary](https://github.com/tw4452852/barn/releases/latest) or build from source.\n\n### How to build\n\n**Zig version:** 0.11.0\n\n```\ngit clone https://github.com/tw4452852/barn\ncd barn\nzig build -Dtarget=x86_64-linux-musl\n```\n\nIf everything is ok, the binary will be located in `./zig-out/bin/barn`.\n\n## Inspiration\n\nThis tool is heavily inspired by the [u-root's cpu](https://github.com/u-root/cpu)\nwhich is an implementation of [plan9's cpu](http://man.cat-v.org/plan_9/1/cpu).\nThere is [an excellant article](https://book.linuxboot.org/cpu/) to talk about it.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftw4452852%2Fbarn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftw4452852%2Fbarn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftw4452852%2Fbarn/lists"}