├── OSSMETADATA ├── pkg ├── metrics │ └── stats │ │ ├── sender_test.go │ │ ├── config.go │ │ └── sender.go ├── history │ ├── hist.go │ └── history.txt ├── repository │ ├── redirect.go │ ├── revinfo.go │ ├── blob.go │ ├── blob_test.go │ ├── parse_test.go │ └── parse.go ├── netservice │ ├── hostname.go │ ├── address.go │ └── address_test.go ├── configutil │ ├── format.go │ ├── format_test.go │ ├── load.go │ └── load_test.go ├── coordinates │ ├── ranges.go │ ├── modules_test.go │ └── modules.go ├── since │ └── since.go ├── webutil │ ├── utils.go │ ├── middleware.go │ └── middleware_test.go ├── clients │ ├── payloads │ │ ├── heartbeat.go │ │ └── configuration.go │ ├── registry │ │ └── modreq.go │ └── zips │ │ ├── client-upstream.go │ │ ├── client-proxy_test.go │ │ ├── rewrite_test.go │ │ └── http.go ├── database │ └── db.go ├── setup │ └── dsn.go └── upstream │ ├── request.go │ ├── request_test.go │ └── go-get.go ├── registry ├── internal │ ├── service │ │ ├── init_test.go │ │ ├── registry.go │ │ └── init.go │ ├── web │ │ ├── common.go │ │ ├── history_test.go │ │ ├── history.go │ │ ├── router_test.go │ │ ├── about_test.go │ │ ├── about.go │ │ ├── blocks.go │ │ ├── redirects.go │ │ ├── v1_registry.go │ │ ├── v1_registry_list_test.go │ │ ├── mods_list.go │ │ ├── v1_startup.go │ │ ├── v1_heartbeat.go │ │ ├── home.go │ │ ├── router.go │ │ ├── mods_show.go │ │ ├── mods_find.go │ │ ├── v1_registry_list.go │ │ └── mods_add.go │ ├── proxies │ │ ├── prune.go │ │ └── prune_test.go │ ├── data │ │ ├── store.go │ │ ├── sql.go │ │ └── pokes.go │ └── tools │ │ └── finder │ │ ├── finder_test.go │ │ ├── github_test.go │ │ ├── finder.go │ │ └── github.go ├── static │ ├── img │ │ └── favicon.ico │ ├── html │ │ ├── blocks.html │ │ ├── redirects.html │ │ ├── mods_list.html │ │ ├── mods_show.html │ │ ├── layout.html │ │ ├── about.html │ │ ├── mods_add.html │ │ ├── navbar.html │ │ └── home.html │ └── css │ │ └── registry.css ├── server.go └── config │ ├── config.go │ └── config_test.go ├── hack ├── sql │ ├── mysql-reg │ │ ├── passwords.sql │ │ └── modproxdb.sql │ └── mysql-prox │ │ └── modproxdb.sql ├── connect-mysql-proxy.sh ├── connect-mysql-registry.sh ├── configs │ ├── registry-local.mysql.json │ └── proxy-local.json └── docker-compose.yaml ├── tools.go ├── .gitignore ├── cmd ├── modprox-proxy │ ├── run-dev.sh │ └── main.go └── modprox-registry │ ├── run-dev.sh │ └── main.go ├── .travis.yml ├── proxy ├── server.go ├── internal │ ├── web │ │ ├── common_test.go │ │ ├── history.go │ │ ├── api_problems.go │ │ ├── mod_file.go │ │ ├── mod_info.go │ │ ├── mod_zip.go │ │ ├── mod_list.go │ │ ├── output │ │ │ └── write.go │ │ ├── common.go │ │ ├── mod_rm.go │ │ └── router.go │ ├── modules │ │ ├── store │ │ │ ├── zipstore.go │ │ │ └── fs.go │ │ ├── get │ │ │ ├── request_test.go │ │ │ ├── request.go │ │ │ └── downloader.go │ │ └── bg │ │ │ └── worker.go │ ├── status │ │ ├── heartbeat │ │ │ ├── loop.go │ │ │ └── sender.go │ │ └── startup │ │ │ ├── sender.go │ │ │ └── sender_test.go │ ├── service │ │ └── proxy.go │ └── problems │ │ ├── tracker_test.go │ │ └── tracker.go └── config │ └── config.go ├── go.mod ├── LICENSE ├── CODE_OF_CONDUCT.md └── README.md /OSSMETADATA: -------------------------------------------------------------------------------- 1 | osslifecycle=active -------------------------------------------------------------------------------- /pkg/metrics/stats/sender_test.go: -------------------------------------------------------------------------------- 1 | package stats 2 | -------------------------------------------------------------------------------- /registry/internal/service/init_test.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | // todo: write tests 4 | -------------------------------------------------------------------------------- /registry/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modprox/mp/HEAD/registry/static/img/favicon.ico -------------------------------------------------------------------------------- /hack/sql/mysql-reg/passwords.sql: -------------------------------------------------------------------------------- 1 | grant all privileges on *.* to 'docker'@'%' with grant option; 2 | flush privileges; 3 | -------------------------------------------------------------------------------- /pkg/history/hist.go: -------------------------------------------------------------------------------- 1 | package history 2 | 3 | //go:generate go run gophers.dev/cmds/petrify/v5/cmd/petrify -pkg history -o generated.go . 4 | -------------------------------------------------------------------------------- /tools.go: -------------------------------------------------------------------------------- 1 | //+build tools 2 | 3 | package modprox 4 | 5 | import ( 6 | _ "github.com/gojuno/minimock/v3" 7 | 8 | _ "gophers.dev/cmds/petrify/v5" 9 | ) 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | cmd/modprox-registry/modprox-registry 2 | cmd/modprox-proxy/modprox-proxy 3 | 4 | **/cover.out 5 | **/generated.go 6 | hack/configs/*indeed.json 7 | /.idea 8 | -------------------------------------------------------------------------------- /pkg/repository/redirect.go: -------------------------------------------------------------------------------- 1 | package repository 2 | 3 | type Redirect struct { 4 | Original string `json:"original"` 5 | Substitution string `json:"substitution"` 6 | } 7 | -------------------------------------------------------------------------------- /pkg/metrics/stats/config.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import "oss.indeed.com/go/modprox/pkg/netservice" 4 | 5 | type Statsd struct { 6 | Agent netservice.Instance `json:"agent"` 7 | } 8 | -------------------------------------------------------------------------------- /hack/connect-mysql-proxy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | mysql \ 6 | --protocol=tcp \ 7 | --host=localhost \ 8 | --port=3307 \ 9 | --user=docker \ 10 | --password=docker \ 11 | --database=modproxdb-prox 12 | -------------------------------------------------------------------------------- /hack/connect-mysql-registry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | mysql \ 6 | --protocol=tcp \ 7 | --host=localhost \ 8 | --port=3306 \ 9 | --user=docker \ 10 | --password=docker \ 11 | --database=modproxdb-reg 12 | -------------------------------------------------------------------------------- /cmd/modprox-proxy/run-dev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | set -x 5 | 6 | go generate 7 | go build 8 | 9 | if [ ${#} -eq 0 ]; then 10 | ./modprox-proxy ../../hack/configs/proxy-local.json 11 | else 12 | ./modprox-proxy "${1}" 13 | fi 14 | -------------------------------------------------------------------------------- /registry/server.go: -------------------------------------------------------------------------------- 1 | package registry 2 | 3 | import ( 4 | "oss.indeed.com/go/modprox/registry/config" 5 | "oss.indeed.com/go/modprox/registry/internal/service" 6 | ) 7 | 8 | func Start(config config.Configuration) { 9 | service.NewRegistry(config).Run() 10 | } 11 | -------------------------------------------------------------------------------- /pkg/netservice/hostname.go: -------------------------------------------------------------------------------- 1 | package netservice 2 | 3 | import ( 4 | "os" 5 | ) 6 | 7 | // Hostname returns the hostname or panics. 8 | func Hostname() string { 9 | hostname, err := os.Hostname() 10 | if err != nil { 11 | panic(err) 12 | } 13 | return hostname 14 | } 15 | -------------------------------------------------------------------------------- /registry/static/html/blocks.html: -------------------------------------------------------------------------------- 1 | {{define "body"}} 2 |
blah blah blah
10 || 12 | {{$k}} 13 | ({{len $v}} versions) 15 | | 16 |
there are none
10 | {{end}} 11 || {{.Source}} | 15 |{{.Version}} | 16 |17 | 23 | | 24 |
11 | The modprox project was created out of a need for a Go Module Proxy 12 | which has first-class support for enterprise Gitlab that has strong 13 | requirements for authenticated access. Existing proxies have/had no 14 | support for this use case, and so this project was started with an 15 | emphasis configurability and adaptability to the more "specialized" 16 | proxy use-cases. 17 |
18 |19 | We think this proxy could be useful for other organizations, 20 | and so the development work has been open-source from the very beginning. 21 | Together, we hope to build a great open source Go Module 22 | Proxy focused on the internal hosting use case. 23 | Documentation for installing, configuring, and managing the 24 | modprox components can be found on 25 | modprox.org. 26 |
27 | 28 |31 | The source code for all of the modprox components is available 32 | on Github. 33 | Contributions are welcome! Particularly if you'd like to add some 34 | significant feature in support of additional "enterprise-y" use cases, 35 | we'd like to work towards getting those features merged! 36 |
37 | 38 |
9 | paste content of go.sum file
10 | paste the require section of go.mod file
11 | common module formats accepted
12 |
| 36 | 37 | {{.Module.Source}} {{.Module.Version}} 38 | 39 | | 40 |=> | 41 |42 | OK 43 | | 44 | {{else}} 45 |46 | 47 | {{.Text}} 48 | 49 | | 50 |=> | 51 |52 | 53 | {{.Err.Error}} 54 | 55 | | 56 | {{end}} 57 |
13 |
|
64 |
65 |
|
74 | ||||||||||||||||||||||