https://github.com/houseme/url-shortenter

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.

https://github.com/houseme/url-shortenter

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.2%) to scientific vocabulary

Keywords

api authorization console golang productivity screenshot short short-link short-urls shortener shorturl shorturl-services statistics url-shortener urlshortener
Last synced: 5 months ago · JSON representation

Repository

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.

Basic Info
Statistics
  • Stars: 15
  • Watchers: 5
  • Forks: 3
  • Open Issues: 1
  • Releases: 3
Topics
api authorization console golang productivity screenshot short short-link short-urls shortener shorturl shorturl-services statistics url-shortener urlshortener
Created over 3 years ago · Last pushed 6 months ago
Metadata Files
Readme Funding License Code of conduct Security

README-ZH.md

URL-Shortenter

English|中文文档

Go Reference Url-Shortenter CI License GitHub go.mod Go version (branch)

A short link service system suitable for small and medium-sized community websites.

Support short link production, query and 302 redirection, and have its own click statistics, independent IP statistics, access log query.

快速使用

shell go install -u -v github.com/houseme/url-shortenter@latest

Console 后台默认帐号

默认帐号:shortenter
默认密码:B9Mazv5M2J6%1zU2@nxC

数据库中存储的是加密后的密码,在 document\structure.sql 中标有注释,如果需要自定义其他密码,可以修改这里

加密规则 utility/helper.go

go func (u *utilHelper) PasswordBase58Hash(password string) (string, error) { data, err := u.Sha256OfShort(password) if err != nil { err = gerror.Wrap(err, "utilHelper PasswordBase58Hash Sha256OfShort error") return "", err } return u.Base58Encode(data), nil }

HTTP API 支持

/api 接口权限说明

所有 /console/api/* 接口需要通过 Bearer Token 方式验证权限,亦即:每个请求 Header 须携带

shell Authorization: Bearer {sha256_of_password}

1. 新增短链接 POST /api/url

短链接生产过程相关代码

所在文件 utility/helper.go

go func (u *utilHelper) GenerateShortLink(ctx context.Context, url string) (string, error) { var ( err error urlHash []byte logger = u.Logger(ctx) ) g.Log(logger).Debug(ctx, "utilHelper GenerateShortLink url:", url) if urlHash, err = u.Sha256OfShort(url); err != nil { err = gerror.Wrap(err, "utilHelper GenerateShortLink Sha256OfShort err") return "", err } // number := new(big.Int).SetBytes(urlHash).Uint64() // str := u.Base58Encode(gconv.Bytes(number)) str := u.Base58Encode(urlHash) g.Log(logger).Debug(ctx, "utilHelper GenerateShortLink str:", str, " number:", number) return str[:8], nil }

License

URL-Shortenter is licensed under the MIT License, 100% free and open-source, forever.

Thinks

JetBrains

Owner

  • Name: houseme
  • Login: houseme
  • Kind: user
  • Location: Beijing

open source houseme Contact mail

GitHub Events

Total
  • Watch event: 1
  • Delete event: 348
  • Issue comment event: 235
  • Push event: 196
  • Pull request review event: 4
  • Pull request event: 685
  • Fork event: 1
  • Create event: 343
Last Year
  • Watch event: 1
  • Delete event: 348
  • Issue comment event: 235
  • Push event: 196
  • Pull request review event: 4
  • Pull request event: 685
  • Fork event: 1
  • Create event: 343

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 454
  • Total Committers: 3
  • Avg Commits per committer: 151.333
  • Development Distribution Score (DDS): 0.211
Top Committers
Name Email Commits
dependabot[bot] 4****]@u****m 358
houseme h****n@g****m 88
houseme q****7@1****m 8
Committer Domains (Top 20 + Academic)
163.com: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 9
  • Total pull requests: 1,148
  • Average time to close issues: 2 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.89
  • Average comments per pull request: 0.74
  • Merged pull requests: 269
  • Bot issues: 8
  • Bot pull requests: 1,116
Past Year
  • Issues: 4
  • Pull requests: 572
  • Average time to close issues: 4 days
  • Average time to close pull requests: 1 day
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.68
  • Merged pull requests: 159
  • Bot issues: 4
  • Bot pull requests: 571
Top Authors
Issue Authors
  • dependabot[bot] (8)
  • cyrusx (1)
Pull Request Authors
  • dependabot[bot] (1,116)
  • houseme (32)
Top Labels
Issue Labels
dependencies (8) go (8)
Pull Request Labels
dependencies (1,116) go (1,090) github_actions (26)

Dependencies

go.mod go
  • github.com/BurntSushi/toml v1.2.0
  • github.com/PuerkitoBio/goquery v1.8.0
  • github.com/VividCortex/gohistogram v1.0.0
  • github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704
  • github.com/aliyun/aliyun-oss-go-sdk v2.2.4+incompatible
  • github.com/andybalholm/cascadia v1.3.1
  • github.com/antchfx/htmlquery v1.2.5
  • github.com/antchfx/xmlquery v1.3.11
  • github.com/antchfx/xpath v1.2.1
  • github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f
  • github.com/beorn7/perks v1.0.1
  • github.com/bits-and-blooms/bitset v1.3.0
  • github.com/btcsuite/btcd/btcutil v1.1.1
  • github.com/cespare/xxhash/v2 v2.1.2
  • github.com/chromedp/cdproto v0.0.0-20220725225757-5988d9195a6c
  • github.com/chromedp/chromedp v0.8.3
  • github.com/chromedp/sysutil v1.0.0
  • github.com/chyroc/go-ptr v1.6.0
  • github.com/chyroc/lark v0.0.97
  • github.com/clbanning/mxj/v2 v2.5.6
  • github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f
  • github.com/fatih/color v1.13.0
  • github.com/fsnotify/fsnotify v1.5.4
  • github.com/geziyor/geziyor v0.0.0-20220429000531-738852f9321d
  • github.com/go-kit/kit v0.12.0
  • github.com/go-logr/logr v1.2.3
  • github.com/go-logr/stdr v1.2.2
  • github.com/go-redis/redis/v8 v8.11.5
  • github.com/go-sql-driver/mysql v1.6.0
  • github.com/gobwas/glob v0.2.3
  • github.com/gobwas/httphead v0.1.0
  • github.com/gobwas/pool v0.2.1
  • github.com/gobwas/ws v1.1.0
  • github.com/gocolly/colly/v2 v2.1.1-0.20220706081359-947eeead97b3
  • github.com/gogf/gf/contrib/drivers/mysql/v2 v2.1.2
  • github.com/gogf/gf/v2 v2.1.2
  • github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
  • github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
  • github.com/golang/protobuf v1.5.2
  • github.com/gorilla/websocket v1.5.0
  • github.com/grokify/html-strip-tags-go v0.0.1
  • github.com/houseme/gocrypto v1.0.0
  • github.com/houseme/snowflake v1.6.5
  • github.com/jmespath/go-jmespath v0.4.0
  • github.com/josharian/intern v1.0.0
  • github.com/json-iterator/go v1.1.12
  • github.com/kennygrant/sanitize v1.2.4
  • github.com/magiconair/properties v1.8.6
  • github.com/mailru/easyjson v0.7.7
  • github.com/mattn/go-colorable v0.1.12
  • github.com/mattn/go-isatty v0.0.14
  • github.com/mattn/go-runewidth v0.0.13
  • github.com/matttproud/golang_protobuf_extensions v1.0.1
  • github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
  • github.com/modern-go/reflect2 v1.0.2
  • github.com/mojocn/base64Captcha v1.3.5
  • github.com/nlnwa/whatwg-url v0.1.2
  • github.com/olekukonko/tablewriter v0.0.5
  • github.com/prometheus/client_golang v1.12.2
  • github.com/prometheus/client_model v0.2.0
  • github.com/prometheus/common v0.37.0
  • github.com/prometheus/procfs v0.8.0
  • github.com/rivo/uniseg v0.3.1
  • github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca
  • github.com/satori/go.uuid v1.2.0
  • github.com/temoto/robotstxt v1.1.2
  • github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.451
  • github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ims v1.0.451
  • go.opentelemetry.io/otel v1.8.0
  • go.opentelemetry.io/otel/exporters/jaeger v1.8.0
  • go.opentelemetry.io/otel/sdk v1.8.0
  • go.opentelemetry.io/otel/trace v1.8.0
  • golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
  • golang.org/x/image v0.0.0-20220722155232-062f8c9fd539
  • golang.org/x/net v0.0.0-20220728211354-c7608f3a8462
  • golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
  • golang.org/x/sys v0.0.0-20220730100132-1609e554cd39
  • golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2
  • golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9
  • google.golang.org/appengine v1.6.7
  • google.golang.org/protobuf v1.28.1
  • gopkg.in/ini.v1 v1.66.6
  • gopkg.in/yaml.v3 v3.0.1
go.sum go
  • 911 dependencies
.github/workflows/codeql-analysis.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/go.yml actions
  • actions/checkout v3 composite
  • actions/setup-go v3 composite
  • golangci/golangci-lint-action v3.4.0 composite
  • morphy2k/revive-action v2 composite
app/console/manifest/docker/Dockerfile docker
  • loads/alpine 3.8 build
app/front/manifest/docker/Dockerfile docker
  • loads/alpine 3.8 build
app/schedule/manifest/docker/Dockerfile docker
  • loads/alpine 3.8 build