{"id":20778551,"url":"https://github.com/caoxiaolin/lua-shorturl","last_synced_at":"2025-12-27T06:30:41.819Z","repository":{"id":95998705,"uuid":"86323935","full_name":"caoxiaolin/lua-shorturl","owner":"caoxiaolin","description":"A ShortURL Service Written by LUA","archived":false,"fork":false,"pushed_at":"2017-09-18T07:58:27.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-18T08:36:10.685Z","etag":null,"topics":["lua","shorturl"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/caoxiaolin.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":"2017-03-27T10:48:01.000Z","updated_at":"2018-04-13T02:50:54.000Z","dependencies_parsed_at":"2023-04-18T19:08:07.085Z","dependency_job_id":null,"html_url":"https://github.com/caoxiaolin/lua-shorturl","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/caoxiaolin%2Flua-shorturl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caoxiaolin%2Flua-shorturl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caoxiaolin%2Flua-shorturl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caoxiaolin%2Flua-shorturl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caoxiaolin","download_url":"https://codeload.github.com/caoxiaolin/lua-shorturl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243119539,"owners_count":20239321,"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":["lua","shorturl"],"created_at":"2024-11-17T13:23:00.985Z","updated_at":"2025-12-27T06:30:41.813Z","avatar_url":"https://github.com/caoxiaolin.png","language":"Lua","readme":"# lua-shorturl\nShortURL Service Written by LUA\n\nUsing nginx + lua + redis + mysql, redis as a cache, mysql persistent data\n\nmysql存储原始url，自增ID转62进制作为短链，redis缓存url，时效性1天，redis连接池提高吞吐，mysql读写分离。\n\n支持IP白名单，用于生成短链权限控制，debug模式可直接输出url，而不是跳转\n\n对原始URL不判重，即同样的URL，会生成新的短链，这样效率更高，有一些ID浪费，可以接受\n\n# e.g.\n\n* 生成一个短链，原始链接：http://www.taobao.com\n\n      caoxl@debian:~$ curl -d \"url=http://www.taobao.com\" \"http://www.shorturl.com/\"\n      http://www.shorturl.com/1\n\n* 打开短链接，直接跳转到原始链接\n\n      caoxl@debian:~$ curl \"http://www.shorturl.com/1\"\n      \u003chtml\u003e\n      \u003chead\u003e\u003ctitle\u003e302 Found\u003c/title\u003e\u003c/head\u003e\n      \u003cbody bgcolor=\"white\"\u003e\n      \u003ccenter\u003e\u003ch1\u003e302 Found\u003c/h1\u003e\u003c/center\u003e\n      \u003chr\u003e\u003ccenter\u003enginx\u003c/center\u003e\n      \u003c/body\u003e\n      \u003c/html\u003e\n\n* debug模式，输出原始链接\n\n      caoxl@debian:~$ curl \"http://www.shorturl.com/1\" -b \"debug=1\"\n      http://www.taobao.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaoxiaolin%2Flua-shorturl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaoxiaolin%2Flua-shorturl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaoxiaolin%2Flua-shorturl/lists"}