{"id":16800799,"url":"https://github.com/houseme/url-shortenter","last_synced_at":"2025-10-04T17:06:07.840Z","repository":{"id":47096227,"uuid":"515844432","full_name":"houseme/url-shortenter","owner":"houseme","description":"A short link service system suitable for small and medium-sized community websites. supports short link production, query and 302 redirection, and comes with click statistics, independent IP statistics and access logs.","archived":false,"fork":false,"pushed_at":"2025-04-10T03:34:45.000Z","size":3954,"stargazers_count":13,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-10T04:34:45.412Z","etag":null,"topics":["api","authorization","console","golang","productivity","screenshot","short","short-link","short-urls","shortener","shorturl","shorturl-services","statistics","url-shortener","urlshortener"],"latest_commit_sha":null,"homepage":"https://houseme.github.io/url-shortenter/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/houseme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":"houseme","issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://paypal.me/houseme"]}},"created_at":"2022-07-20T05:23:28.000Z","updated_at":"2025-04-10T03:34:47.000Z","dependencies_parsed_at":"2023-02-16T03:45:29.235Z","dependency_job_id":"e052c3ec-61e4-4dc6-97d0-3d01bbdfcaaa","html_url":"https://github.com/houseme/url-shortenter","commit_stats":{"total_commits":454,"total_committers":3,"mean_commits":"151.33333333333334","dds":"0.21145374449339205","last_synced_commit":"427b2804b2acb46254b78717a46ce32a5cb9d5f4"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Furl-shortenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Furl-shortenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Furl-shortenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Furl-shortenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houseme","download_url":"https://codeload.github.com/houseme/url-shortenter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322301,"owners_count":21084334,"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":["api","authorization","console","golang","productivity","screenshot","short","short-link","short-urls","shortener","shorturl","shorturl-services","statistics","url-shortener","urlshortener"],"created_at":"2024-10-13T09:35:06.842Z","updated_at":"2025-10-04T17:06:07.809Z","avatar_url":"https://github.com/houseme.png","language":"Go","funding_links":["https://liberapay.com/houseme","https://paypal.me/houseme"],"categories":[],"sub_categories":[],"readme":"# URL-Shortenter \n\nEnglish｜[中文文档](README-ZH.md)\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/houseme/url-shortenter.svg)](https://pkg.go.dev/github.com/houseme/url-shortenter)\n[![Url-Shortenter CI](https://github.com/houseme/url-shortenter/actions/workflows/go.yml/badge.svg)](https://github.com/houseme/url-shortenter/actions/workflows/go.yml)\n[![License](https://img.shields.io/github/license/houseme/url-shortenter.svg?style=flat)](https://github.com/houseme/url-shortenter)\n![GitHub go.mod Go version (branch)](https://img.shields.io/github/go-mod/go-version/houseme/url-shortenter/main)\n\nA short link service system suitable for small and medium-sized community websites.\n\nSupports short link generation, query, 302 redirection, click statistics, independent IP statistics, and access log query.\n\n## Quick Start\n\n```shell\ngo install -u -v github.com/houseme/url-shortenter@latest\n```\n\n## Console Default Account\n\nDefault account: `shortenter`  \nDefault password: `B9Mazv5M2J6%1zU2@nxC`\n\nThe database stores encrypted passwords, which are annotated in `document\\structure.sql`. If you need to customize other passwords, you can modify them here.\n\nEncryption rules are in `utility/helper.go`.\n\n```go\nfunc (u *utilHelper) PasswordBase58Hash(password string) (string, error) {\n\tdata, err := u.Sha256OfShort(password)\n\tif err != nil {\n\t\terr = gerror.Wrap(err, \"utilHelper PasswordBase58Hash Sha256OfShort error\")\n\t\treturn \"\", err\n\t}\n\treturn u.Base58Encode(data), nil\n}\n```\n\n## HTTP API Support\n\n### `/api` Interface Permission Description\n\nAll `/console/api/*` interfaces require `Bearer Token` authentication. That is, each request header must include:\n\n```shell\n Authorization: Bearer {sha256_of_password}\n```\n\n### 1. Add Short Link `POST /api/url`\n\n## Short Link Generation Code\n\nLocated in `utility/helper.go`.\n\n```go\nfunc (u *utilHelper) GenerateShortLink(ctx context.Context, url string) (string, error) {\n\tvar (\n\t\terr     error\n\t\turlHash []byte\n\t\tlogger  = u.Logger(ctx)\n\t)\n\tg.Log(logger).Debug(ctx, \"utilHelper GenerateShortLink url:\", url)\n\tif urlHash, err = u.Sha256OfShort(url); err != nil {\n\t\terr = gerror.Wrap(err, \"utilHelper GenerateShortLink Sha256OfShort err\")\n\t\treturn \"\", err\n\t}\n\t// number := new(big.Int).SetBytes(urlHash).Uint64()\n\t// str := u.Base58Encode(gconv.Bytes(number))\n    str := u.Base58Encode(urlHash)\n\tg.Log(logger).Debug(ctx, \"utilHelper GenerateShortLink str:\", str, \" number:\", number)\n\treturn str[:8], nil\n}\n```\n\n## License\n\n`URL-Shortenter` is licensed under the [MIT License](LICENSE), 100% free and open-source, forever.\n\n## Thanks\n\n\u003ca href=\"https://www.jetbrains.com/?from=URL-Shortenter\"\u003e\u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains-training-partner.png\" height=\"120\" alt=\"JetBrains\"/\u003e\u003c/a\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhouseme%2Furl-shortenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhouseme%2Furl-shortenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhouseme%2Furl-shortenter/lists"}