{"id":23182190,"url":"https://github.com/cbodonnell/tfarm","last_synced_at":"2025-09-14T22:30:17.600Z","repository":{"id":112483811,"uuid":"601889690","full_name":"cbodonnell/tfarm","owner":"cbodonnell","description":"tunnels from behind firewalls to the internet","archived":false,"fork":false,"pushed_at":"2024-08-25T16:04:39.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T11:24:13.468Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/cbodonnell.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":"2023-02-15T03:20:11.000Z","updated_at":"2024-08-25T16:03:28.000Z","dependencies_parsed_at":"2024-01-13T19:04:45.154Z","dependency_job_id":"554a3eb3-5d82-481f-bd79-2ddf8ce19864","html_url":"https://github.com/cbodonnell/tfarm","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbodonnell%2Ftfarm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbodonnell%2Ftfarm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbodonnell%2Ftfarm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbodonnell%2Ftfarm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbodonnell","download_url":"https://codeload.github.com/cbodonnell/tfarm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280255,"owners_count":20912967,"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-12-18T08:19:33.619Z","updated_at":"2025-04-05T03:17:17.407Z","avatar_url":"https://github.com/cbodonnell.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tfarm\n\n`tfarm` is a tool for creating and managing tunnels. It is a wrapper around [frp](https://github.com/fatedier/frp) that provides a simple interface for managing tunnels. It consists of two components: a server and a client. The server is a wrapper around `frpc` that manages tunnels. The client is a CLI for interfacing with the server to create and manage tunnels.\n\n## Installation\n\nIf you are using `go` version 1.17 or later, you can install `frpc` and `tfarm` using the `go install` command.\n```bash\ngo install github.com/fatedier/frp/cmd/frpc@latest\ngo install github.com/cbodonnell/tfarm/cmd/tfarm@latest\n```\n\n*If you are using an older version of `go`, you can install `tfarm` using `go get`.*\n\nOtherwise, you can:\n1. Download the latest release of [frp](https://github.com/fatedier/frp/releases) and [tfarm](https://github.com/cbodonnell/tfarm/releases) for your platform.\n2. Extract the binaries from the archives.\n3. Move the binaries to a directory in your PATH.\n\n## Usage\n\n### Setup the tfarm server\n\n*Note: It is recommended to run the tfarm server using a process manager like `systemd` ([example](https://github.com/cbodonnell/tfarm/blob/main/examples/systemd/tfarm.service)).*\n\n#### Configuration\n\nThe following environment variables can **optionally** be used to configure the tfarm server.\n\nSet the `TFARMD_WORK_DIR` environment variable to the path where you want to store the tfarm server state. By default, it will be the current working directory.\n```bash\nexport TFARMD_WORK_DIR=/path/to/work/dir\n```\n\nSet the `TFARMD_FRPC_BIN_PATH` environment variable to the path of the `frpc` binary. By default, tfarm will search the current users PATH.\n```bash\nexport TFARMD_FRPC_BIN_PATH=/path/to/frpc\n```\n\n#### Start the tfarm server process\n\nStart the tfarmd server.\n\n```bash\ntfarm server start\n```\n\nIn another terminal, create the $HOME/.tfarm directory and copy the server's `client.json` file to it.\n\n```bash\nmkdir -p $HOME/.tfarm\ncp $TFARMD_WORK_DIR/tls/client.json $HOME/.tfarm\n```\n\nCheck the status of the tfarm server.\n\n```bash\ntfarm status\n```\n\nThe next step is to configure the tfarm server as a ranch client.\n\n#### Configure the tfarm server as a ranch client\n\nUse the `tfarm ranch` command to interact with the tfarm ranch. The tfarm ranch is the `frps` server that `frpc` connects to. It provides an identity and access layer for `frps`. By default, tfarm will connect to the `tunnel.farm` ranch.\n\nLogin to the tfarm ranch.\n\n```bash\ntfarm ranch login\n```\n\nCreate a new ranch client and use it to configure the tfarm server.\n\n```bash\ntfarm ranch clients create --credentials | tfarm configure --credentials-stdin\n```\n\n### Manage tunnels with the tfarm CLI\n\nCheck the status of the tfarm server.\n\n```bash\ntfarm status\n```\n\nCreate a tunnel that forwards traffic to local port 8080.\n\n```bash\ntfarm create my-tunnel -p 8080\n```\n\nCheck the status.\n\n```bash\ntfarm status\n```\n\nDelete the tunnel.\n\n```bash\ntfarm delete my-tunnel\n```\n\n## Development\n\n### Dependencies\n\n* Git\n* Make\n* Go\n* Docker\n* frpc\n\n### Configuration\n\nCreate a `.env` file with the following environment variables.\n\n```bash\nTFARMD_FRPC_BIN_PATH=/path/to/frpc\nTFARMD_WORK_DIR=/path/to/work/dir\nTFARMD_LOG_LEVEL=debug\n```\n\n### Build\n\n```bash\nmake tfarm\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbodonnell%2Ftfarm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbodonnell%2Ftfarm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbodonnell%2Ftfarm/lists"}