{"id":23523008,"url":"https://github.com/umi0410/rd","last_synced_at":"2025-05-14T04:16:07.794Z","repository":{"id":103908536,"uuid":"567860458","full_name":"umi0410/rd","owner":"umi0410","description":"a simple personal redirection server","archived":false,"fork":false,"pushed_at":"2023-12-07T15:57:53.000Z","size":446,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T00:14:41.316Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/umi0410.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}},"created_at":"2022-11-18T18:54:23.000Z","updated_at":"2023-04-17T05:32:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"f26dc36c-a097-4594-ad0d-aac70fe23be4","html_url":"https://github.com/umi0410/rd","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/umi0410%2Frd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umi0410%2Frd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umi0410%2Frd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umi0410%2Frd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umi0410","download_url":"https://codeload.github.com/umi0410/rd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254070141,"owners_count":22009560,"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-25T17:18:48.711Z","updated_at":"2025-05-14T04:16:07.754Z","avatar_url":"https://github.com/umi0410.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rd\n\nrd is a simple personal redirection server.\n\nYou can set aliases for destinations that you want to be redirected in a very convenient way!\n\nTry setting aliases of the urls where your everyday and be free from using a mouse.\n\n## Use cases (To be updated)\n\n## Getting Started\n\nIf you are hesitating to use rd, just try it with CLI. You don't have to use browsers always.\n\n```shell\n# start running rd\ndocker run --rm -p 18080:18080 umi0410/rd\n```\n\n```shell\n# open a new terminal and try alias \"rd\" to be redirect to README.md of rd.\ncurl -sL localhost:18080/goto?alias=rd | head -n 3\n```\n\n## How to use\n\n* [chrome](#Chrome)\n\n### Chrome\n\n1. Visit [chrome://settings/searchEngines](chrome://settings/searchEngines).\n2. Add your rd server as a new search engine.\n  ![](./assets/chrome-add-to-site-search-engine.png)\n3. In your site search list, Please click `...` button of the rd server and set it as the default search engine.\n4. 🎉 Please open a new tab and enjoy rd.\n\nDon't worry about not using Google as the default search console. rd will try Google as a fallback when\nthere is no matching alias you input.\n\n## Development\n\nThe initial structure of the project was written by [cobra-cli](https://github.com/spf13/cobra-cli/).\n\n```shell\n# Setup cobra-cli\nexport GOPATH=${HOME}/go\ngo install github.com/spf13/cobra-cli@latest\necho \"author: Jinsu Park \u003cdev.umijs@gmail.com\u003e\nlicense: apache\nuseViper: true\" \u003e ~/.cobra.yaml\n```\n\n```shell\n# Initiate the project\ncobra-cli init\ncobra-cli add create\ncobra-cli add delete\ncobra-cli add list\ncobra-cli add reload\ncobra-cli add run \n```\n\nYou can use rd with docker with the following commands.\n\n```shell\ndocker build . -t umi0410/rd\ndocker run --rm -p 18080:18080 -v ${HOME}/.config/rd/local.yaml:/app/config/local.yaml \\\n  -e RD_CONFIG_NAME=local \\\n  umi0410/rd run\n```\n\nIf you decided to use rd, please run rd with the following commands to run it always.\n\n```shell\ndocker run --name rd -p 18080:18080 -v ${HOME}/.config/rd/local.yaml:/app/config/local.yaml \\\n  -e RD_CONFIG_NAME=local \\\n  -d --restart=always \\\n  umi0410/rd run\n```\n\n## Statistics\n\n![](./assets/stat-datadog.png)\n\n```shell\n$ curl http://localhost:18090/metrics -s | grep rd_redirection\n# HELP rd_redirection_count The total number of redirections.\n# TYPE rd_redirection_count counter\nrd_redirection_count{alias=\"blog\",destination=\"https://umi0410.github.io\"} 18\n# if destionation is empty, it means the alias is not registered\n# and forwarded to Google search.\nrd_redirection_count{alias=\"guitar\",destination=\"\"} 33\n...\n```\n\nYou can export OpenMetrics about redirections by rd and of course, can connect them \nwith DataDog and other monitoring tools.\n\nLater, it might be automated to register aliases which you frequently use but not registered.\n\n### How to collect statistics\n\n```shell\n# Run a datadog-agent to collect metrics from your rd server\ndocker run --cgroupns host --pid host \\\n--rm --name dd-agent \\\n-v /var/run/docker.sock:/var/run/docker.sock:ro \\\n-v /proc/:/host/proc/:ro \\\n-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro  \\\n-e DD_API_KEY=\u003c\u003cREPLACE THIS WITH YOUR API KEY\u003e\u003e \\\n-e DD_SITE=datadoghq.com \\\ngcr.io/datadoghq/agent:latest\n```\n\n```shell\ndocker run --rm --name rd -p 18080:18080 -p 18090:18090 \\\n  -v ${HOME}/.config/rd/local.yaml:/app/config/local.yaml \\\n  -e RD_CONFIG_NAME=local \\\n  -l com.datadoghq.ad.check_names='[\"openmetrics\"]' \\\n  -l com.datadoghq.ad.init_configs='[{}]' \\\n  -l com.datadoghq.ad.instances='[{\"openmetrics_endpoint\":\"http://%%host%%:%%port%%/metrics\",\"metrics\":[{\"rd_redirection_count\":\"rd_redirection_count\"}]}]' \\\n  umi0410/rd run\n```\n\nDocumentation from datadog: https://docs.datadoghq.com/containers/docker/prometheus/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumi0410%2Frd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumi0410%2Frd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumi0410%2Frd/lists"}