177 Commits

Author SHA1 Message Date
Marwan Sulaiman
2d3250ffba Init events 2020-07-31 14:43:37 -04:00
Marwan Sulaiman
dfb7887080 Allow Athens to Propagate Authentication to Mod Download (#1650)
* Allow Athens to Propagate Authentication to Mod Download

* update readme

* add pattern matching to auth propagation

* Propagate authentication to pre declared static host

* quote redis test

* fix flaky redis error message

* fix config tests

* fix config tests

* Update config.dev.toml

Co-authored-by: Ted Wexler <ted@stuckinacan.com>

* gofmt

Co-authored-by: Ted Wexler <ted@stuckinacan.com>
2020-07-30 17:06:53 -04:00
Marwan Sulaiman
81906b918f pkg/requestid: add Request ID to Athens requests and logs (#1655)
Co-authored-by: Ted Wexler <ted@stuckinacan.com>
2020-07-27 12:37:36 -04:00
Marwan Sulaiman
408fd74a9c actions: add index handler tests (#1637) 2020-07-03 11:00:24 -04:00
Marwan Sulaiman
ef15c3458b Allow users to specify the module fetcher's temporary directory (#1636) 2020-06-25 17:15:15 -04:00
Marwan Sulaiman
52934cfa46 implement /index endpoint (#1630)
* implement /index endpoint

* rename to Module to Path
2020-06-24 14:29:30 -04:00
Marwan Sulaiman
f01c645305 pkg/middleware: add tracing to ValidationHook (#1627) 2020-06-15 16:34:24 -04:00
Marwan Sulaiman
38a6a6fe0b Add client tracing to external storage requests (#1626) 2020-06-14 11:03:48 -04:00
Elliot Morrison-Reed
c08aa890cb Fix sumdb/* paths when config.PathPrefix is set (#1620)
* Fix sumdb/* paths when config.PathPrefix is set

http.StripPrefix will look at the entire request path when called,
if we do not include config.PathPrefix then the StripPrefix call
will never receive a valid path from the application and the user
will always get a 404 error.

There were no test where I could easily check this regression so
I also added a few endpoint tests, the last test will fail with
a 404 instead of 403 if this change in not applied.

* Update cmd/proxy/actions/app_proxy.go

Co-authored-by: Marwan Sulaiman <marwan-at-work@github.com>

* Update cmd/proxy/actions/app_proxy_test.go

Co-authored-by: Marwan Sulaiman <marwan-at-work@github.com>

* Update cmd/proxy/actions/app_proxy_test.go

Co-authored-by: Marwan Sulaiman <marwan-at-work@github.com>

* Update cmd/proxy/actions/app_proxy_test.go

Co-authored-by: Marwan Sulaiman <marwan-at-work@github.com>

* Removed unneeded import of logrus

Co-authored-by: Marwan Sulaiman <marwan-at-work@github.com>
2020-06-05 12:01:38 -04:00
Chris Mills
05438234ed Fix issue with build arg in drone deployment (#1602)
The ARG before the FROM call in multistage builds is dropped with the
previous container. We need to define it globally

Signed-off-by: Chris M <millscj01@gmail.com>
2020-04-13 15:29:29 -07:00
Aaron Schlesinger
a8467661c2 Adding build arg for the alpine version the docker image is based on (#1585)
* Adding build arg for the alpine version the docker image is based on

* Actually using the arg

* Using Alpine 3.11.5

Co-authored-by: Ted Wexler <ted@stuckinacan.com>
2020-04-07 15:50:02 -04:00
Marwan Sulaiman
3c4db4ce86 pkg/storage: add External implementation (#1587)
* pkg/storage: add External implementation

* fix conflicts

* use newly instantiated client
2020-03-27 13:35:52 -04:00
Aaron Schlesinger
94a97fe9e9 "sumdbPoxy" ==> "sumdbProxy" (#1569)
Co-authored-by: Ted Wexler <ted@stuckinacan.com>
2020-03-20 15:18:51 -04:00
Marwan Sulaiman
0bb95c7351 pkg/storage: make Checker optional in storage.Backend (#1580)
* pkg/storage: make Checker optional in storage.Backend

* pass storage
2020-03-18 19:07:00 -04:00
Ted Wexler
939e695526 Adds redis sentinel support (#1554)
* Adds redis sentinel support

Fixes #1553

* Fix redis-sentinel test hostnames

* Fix redis master name again

* Fix redis sentinel port in tests

* Upgrade the redis client

* Rmoeve accidental config change

* Fix default config

* Addresses review comments

* Add documentation on single flight mechanisms

* Fix spelling issues

* Fix formatting

Co-authored-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
2020-03-17 13:04:37 -07:00
Ted Wexler
53232f726d Update builds for Go 1.14 (#1558)
* Update .drone.yml for Go 1.14

* Update appveyor.yml for Go 1.14

* Update Dockerfile.test for Go 1.14

* Update Dockerfile for Go 1.14

* Update scripts/build-image/Dockerfile
2020-02-26 15:53:12 -08:00
Matthew Plachter
71c57ef7ee add config options for redis password (#1545)
* add config options for redis password

* redis password test and failure test

* changed redis name and made a minimal redis.conf

add drone volume

volume fix

remove volumes from drone.

repoint redis path

Co-authored-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
Co-authored-by: Marwan Sulaiman <marwan.sameer@gmail.com>
2020-02-25 16:18:04 -08:00
Marwan Sulaiman
34f55365a2 always use request logging middleware (#1522)
* always use request logging middleware

* reads better

* rm http-url as it is redundant

* gopls being redundant

* add color name
2020-01-20 18:25:48 -05:00
Marwan Sulaiman
86da1590bc Dockerfile: ensure right perms for production setting (#1530) 2020-01-19 19:14:49 -05:00
Bruno M. Custódio
221c451b6a Read basic auth credentials from a secret. (#1466)
Signed-off-by: Bruno Miguel Custódio <brunomcustodio@gmail.com>
2019-12-02 18:07:54 -08:00
Arne Bahlo
6ee9e0932c Install git-lfs on proxy container (#1455)
For repositories that store some files in git-lfs, the checksum will
differ for clients with and without git-lfs. Clients without git-lfs
will use the git-lfs pointer [0] for calculation, clients with will use
the real files.
This adds git-lfs to the container to match expected behaviour and
resolve checksum mismatches in these cases.

[0] https://github.com/git-lfs/git-lfs/blob/master/docs/spec.md
2019-11-11 13:17:50 -08:00
David Farrell
ab8caa2fc4 Remove G_ENV=production from proxy Dockerfile (#1443) 2019-11-06 19:38:55 -05:00
David Farrell
000d2b92a1 Add GOLANG_VERSION arg support to proxy-docker make target + Dockerfile (#1430)
* Add GOLANG_VERSION arg to proxy-docker

* Set default GOLANG_VERSION to 1.13 in Makefile

* Add note in proxy Dockerfile re: GOLANG_VERSION

* Add GOLANG_VERSION to docker-compose dev target
2019-11-06 11:32:59 -08:00
Rob Prentiss
ed66d85f3f Use glob matching for package paths (#1409)
- Match the behavior of GOPRIVATE/GONOPROXY/GONOSUMDB
2019-10-02 08:45:58 -04:00
Marwan Sulaiman
298c6cd74d cmd/proxy/actions: pass NoSumPatterns to GoGetFetcher (#1391)
* cmd/proxy/actions: pass NoSumPatterns to GoGetFetcher

* add gosum unit tests

* upgrade appveyor to 1.13

* fix test typo

* check appveyor version

* AppVeyor has no 1.13

* use logger
2019-09-23 12:47:40 -04:00
Marwan Sulaiman
68ba75078b proxy/actions/sumdb: copy Go behavior for pattern matching (#1388) 2019-09-20 12:17:03 -04:00
oliverch
874d27158d feat: add /robots.txt (#1355)
* feat: add /robots.txt

* disallow all crawler by default.
2019-09-16 16:21:08 -05:00
Marwan Sulaiman
8db652e04c Upgrade to Go 1.13 (#1377) 2019-09-13 13:48:28 -04:00
Yi Tang
ca10728887 ref: upstream lister and it's impl to module pkg (#1309) 2019-07-25 20:40:03 -04:00
Yi Tang
7de77889ad support goproxy for list/download command (#1304) 2019-07-15 14:07:24 -04:00
Benjamin
e832c83ecd [debug] allow to expose activate via config (#1284)
This CL addresses issue #1177 introducing two new configuration params
allowing to activate pprof.
- `ATHENS_ENABLE_PPROF`
- `ATHENS_PPROF_PORT`

pprof won't be exposed by default.
2019-06-24 20:59:15 +02:00
Marwan Sulaiman
76fb786324 downloadProtocol: support multi-proxy environments with DownloadFile (#1230)
* downloadProtocol: support multi-proxy environments with DownloadFile

* remove debugging lines

* update config tests

* download/mode: add tests for DownloadFile and friends

* add documentation to Download File
2019-06-08 00:30:07 -04:00
Penthaa Patel
f0f046ae09 Removed -mod=vendor from Makefile and docs (#1250)
* removed -mod=vendor from Makefile

* removed -mod=vendor from docs

* Set GOPROXY=https://proxy.golang.org in docs and Makefile

* remove -mod=vendor from Dockerfile; add GOPROXY=https://proxy.golang.org
2019-06-07 15:14:32 -07:00
marpio
d0472f666e Use alpine tini (#1260)
* use alpine tini

* do not COPY tini from the builder
2019-05-31 08:26:27 -04:00
Mike Yusko
c3c062b657 fix: '/catalog' endpoint, which didn't allow fetch URL query parameters (#1247)
* Fix '/catalog' endpoint, which didn't allow fetch URL query parameters

* Fix review comments
2019-05-27 15:34:16 -04:00
Marwan Sulaiman
0cac0edbf1 actions: support proxying sum db urls (#1208)
* actions: support proxying sum db urls

* remove proxy prefix

* add docs for checksum db

* more docs

* typo

* typo

* typo

* typo

* typo

* typo

* typo

* typo

* move checksum db into its own section
2019-05-08 17:09:07 -07:00
Marwan Sulaiman
85bcef5b57 Dockerfile: wrap athens with tini (#1190) 2019-04-22 20:53:13 +02:00
marpio
9974c16093 pkg/stash: Add Azure Blob implementation (#1162)
* add azblob sf stasher

* use http status const

* rm line

* cleanup, comments

* add test

* fix test

* skip test it no account key provided

* fix stash

* introduce stash timeout
2019-04-01 21:53:59 -07:00
Marwan Sulaiman
081ec9126e pkg/stash: Add GCS implementation (#1124)
* pkg/stash: Add GCS implementation

* fix docs
2019-03-13 11:07:07 -07:00
Marwan Sulaiman
fb9437ddff pkg/stash: implement a Redis lock for stashing (#1116)
* pkg/stash: implement a Redis lock for stashing

* fix tests

* fix op
2019-03-11 02:48:04 -04:00
Marwan Sulaiman
5c25be9feb build: switch to go1.12 (#1092)
* build: switch to go1.12

* switch travis to 1.12
2019-02-27 23:06:04 +01:00
Marwan Sulaiman
12ce2a6499 pkg/stash: add Etcd as a SingleFlight backend (#1070)
* pkg/stash: add Etcd as a SingleFlight backend

* fix config tests

* fmt

* pr fixes

* fix conflicts
2019-02-22 11:35:45 -08:00
fsouza
94cbd9a263 Dockerfile: remove redundant call to apk update (#1069)
- ``apk update`` fetches the index and saves it locally
- ``apk add --update`` fetches the index and installs the requested
packages
2019-02-18 11:30:17 -05:00
Marwan Sulaiman
8356831a43 Use Go 1.12rc for Docker Image (#1063)
* Use Go 1.12rc for Docker Image

* generalize rc
2019-02-17 20:38:55 -08:00
marpio
c3d1d14d23 Use default conf values if file not found (#1022)
* default conf if no file provided

* move to the config pkg

* rm default config path

* rm log
2019-02-14 11:32:53 -08:00
Marwan Sulaiman
adb4dbb10f actions: improve basic auth tests (#1043)
* actions: improve basic auth tests

* pr fixes
2019-01-16 14:37:46 -05:00
Pascal Dierich
025fe91c6b cmd/proxy/actions: Add basic unit-tests for some proxy routes. (#1036)
* cmd/proxy/actions: Add basic unit-tests for some proxy routes.

* cmd/proxy/actions: Fail test with t.Fatal in TestHealthHandler

* cmd/actions/proxy: Remove handler tests. Keep authentication test.
2019-01-12 09:20:08 +01:00
Marwan Sulaiman
b19cbcc137 basicauth: log warning on healthz (#1039)
* basicauth: log warning on healthz

* include http path prefix
2019-01-11 13:23:28 -05:00
Marwan Sulaiman
0d94af2503 catalog: clean up unused interfaces (#1027)
* catalog: clean up unused interfaces

* fix op name
2019-01-05 15:04:46 -05:00
Manu Gupta
3b621caa85 Move catalog handler out of download protocol (#1020)
* Move catalog handler out of download protocol

* Bring back logger

* update comment
2019-01-02 21:55:07 -08:00