73 Commits

Author SHA1 Message Date
south-mer
11d674c8fb feat: GCP checksum (#2052) 2025-08-06 08:24:54 +02:00
south-mer
25b890553a fix: move single-flight to stash (#2050) 2025-07-08 10:00:59 +02:00
south-mer
24895f2a24 Fix no child processes error (#2048) 2025-05-14 13:38:07 +02:00
Nicholas Wiersma
2712e2ef17 fix: go in docker failing (#1989)
Co-authored-by: Matt <matt.ouille@protonmail.com>
2024-10-07 21:22:53 +02:00
Taylor Chen
3856c6feee add timeout to vcsLister.List() (#1986) 2024-09-20 08:19:47 +02:00
Vanes Angelo
900cb4f7c1 Upgrade to AWS SDK v2 (#1938) (#1950)
Upgrades the AWS SDK to v2. AWS S3 bucket urls will now error if they are not prefixed with a schema (example: https://).
2024-04-28 21:38:42 -07:00
wozz
3af0d009a8 singleflight go commands (#1877)
* singleflight go commands

* Apply suggestions from code review

Co-authored-by: Brendan Le Glaunec <brendan@glaulabs.com>

---------

Co-authored-by: michael-wozniak <michael.wozniak@snapchat.com>
Co-authored-by: Brendan Le Glaunec <brendan@glaulabs.com>
2023-12-21 15:37:36 +02:00
Nicholas Wiersma
d932d50232 chore: lint code with golangci-lint (#1828)
* feat: add golangci-lint linting

* chore: fix linter issues

* feat: add linting into the workflow

* docs: update lint docs

* fix: cr suggestions

* fix: remove old formatting and vetting scripts

* fix: add docker make target

* fix: action go caching

* fix: depreciated actions checkout version

* fix: cr suggestion

* fix: cr suggestions

---------

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2023-02-24 20:39:17 -08:00
Ashish Ranjan
3f26845cff move to github actions from drone (#1823)
* add github actions workflow for tag releases

* migrate drone build &test step to github actions

* fix minio service

* fix indentation

* fix dependency syntax

* remove needs keyword

* fix service hostnames, add protectedredis

* update protected redis docker image

* fix too many args error

* exclude vendor dir from gofmt

* fix fmt errors

* fix fmt errors

* rm .drone.yml

* rename workflow name

* break test step

* remove vendor step

* use makefile rule

* use buildx
2023-02-22 22:47:37 -08:00
Nicholas Wiersma
ab64133949 feat: replace ioutil with io and os (#1816) 2023-01-27 20:42:47 +05:30
Aaron Schlesinger
1acdf17a4a Reverting passthrough auth (#1700)
* Reverting PR 1650

https://github.com/gomods/athens/pull/1650 was a big change to the
authentication/authorization code, which we have decided to pull
out and potentially move into a separate process/project

Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>

* removing commented, unused code

Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>

* removing more commented, unused code

Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>

* removing more unused code

Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
2021-03-11 11:28:15 -08: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
ef15c3458b Allow users to specify the module fetcher's temporary directory (#1636) 2020-06-25 17:15:15 -04:00
Aleksandr Razumov
790c74588a pkg/module: set only present environment variables (#1399)
* pkg/module: set only present environment variables

* pkg/module: apply new env variable logic to all keys
2019-10-16 13:13:07 -07:00
psy-core
97a2df4414 fix proxy not work when lower case is unset. (#1332)
* fix proxy not enable when proxy lower is unset.

* Update prepare_env.go

format blankspace
2019-09-26 17:44:40 -05: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
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
Marwan Sulaiman
7519a77bbe pkg/module: return KindNotFound on incorrect mod download (#1300) 2019-07-08 14:36:18 -07:00
marpio
8e5b6981d3 Remove dummy mod dir (#1121) 2019-05-03 22:52:36 +02:00
Mark D
ef3d69ea4a Fix for issue #1192 (#1193)
* adding support for lower case http proxy env variables

* adding in extra blank line
2019-04-22 11:18:27 -07:00
dfinkel
a7aee5b235 pkg/module: include SSH_AUTH_SOCK in go get env (#1184)
* pkg/module: include SSH_AUTH_SOCK in go get env

When running locally, it's convenient to use a user's ssh-agent. For
that to work, we need to propagate SSH_AUTH_SOCK.

* pkg/module: Verify existence for SSH_AUTH_SOCK

SSH_AUTH_SOCK is expected to indicate a unix socket on the local
filesystem. If it isn't a unix socket (after symlink resolution) we can
ignore it. (although ssh will ignore it as well)
2019-04-09 14:54:47 -07:00
Marwan Sulaiman
16c6b029ac pkg/module: include SSH environments (#1164) 2019-03-28 13:54:36 -04:00
Federico Paolinelli
04c6bbed90 Filter (#1075)
* Working tests

* More tests, a bugfix (yay tests) and docs

* Changed filter description adding v prefix to versions

* Updated docs to be more precise

* More robust, changed docs

* Fixed copy paste bug
2019-03-18 22:07:27 -07:00
Chad Kunde
7811524c22 Version filtering (#1050)
* extend filtering logic and configuration to include version lists

Module filtering is very useful, but many deployments will need to
satisfy even more granular constrainsts.  Enterprises may need
approved lists specific down to the minor (or patch) version element.

Version filtering logic is similar to the module filtering, in that
it's a prefix match of the version requested against each entry in the
version filter list.

Closes #1045

* include version filtering in documentation with example

* allow filtering when version is missing

Endpoints that do not specify a version, such as "@v/list", only need
to be filtered by module rules.
2019-02-05 09:04:09 +01:00
Marwan Sulaiman
f0e931311b pkg/stash: allow nonsemver requests to be resolved properly (#1015) 2019-01-07 20:51:22 -05:00
Manu Gupta
5eba6f2e47 File permissions on config files allow more restrictive setting (#966)
* File permissions on config files allow more restrictive setting

* Make the tests a bit more readable

* Bring back the tests dude

* Update error message

* remove else

* Add more test cases

* Change Lstat to Stat

* Add note for umask

* Make sure the permissions are 0600 or lower

* Update config file

* Do not check for windows

* Fix CI errors

* Fix CI test
2018-12-18 16:26:04 +01:00
Pontus Leitzler
5ab820de96 Propagate HOME env to go command execution (#960) 2018-12-06 11:12:24 -08:00
Michal Pristas
f53ab92503 Filter: fixing after refactoring (#867)
* added some clarity

* no need to handle pseudo versions

* gofmt

* tests ok

* reshuffled again
2018-11-06 00:18:18 -05:00
Tomasz Tomalak
f2f3bac51b Remove unused Download method (Olympus cleanup) (#849) 2018-11-02 08:44:23 -04:00
Manu Gupta
9cca0ada44 Filter file configuration set up (#840)
* When the filter file is missing throw a fatal

* Ignore path when file is not specified

* Fix build failure on ci

* Remove logs

* Fix propagate and handle errors

* Fix build error

* Actually check filter file

* Check for errors in the test suite as well

* Improve test coverage

* Add more tests

* Simplify NewFilter function

* Make file format rules pretty stringent

* Fix test failure

* Show line numbers on errors as well

* Fix typo

* Fix typo again
2018-11-01 13:51:12 +01:00
Manu Gupta
657c9d04a3 If a filter file is not found and is in config, throw an error (#788)
* When the filter file is missing throw a fatal

* Ignore path when file is not specified

* Fix build failure on ci

* Remove logs

* Fix propagate and handle errors

* Fix build error

* Actually check filter file

* Check for errors in the test suite as well

* Improve test coverage

* Add more tests

* Simplify NewFilter function

* Address review comments
2018-10-31 10:08:15 -07:00
marpio
bc4e533d49 Use go mod download -json (#710)
* use go mod download -json

* annotate json, fix build

* add comment

* address review feedback
2018-10-01 20:53:17 +02:00
Zachary Romero
e5b307354c Patch points of test flag leakage (#667) 2018-09-29 19:26:19 +02:00
marpio
bcc896f226 rename example to dev and rm test config (#691) 2018-09-20 16:38:08 -04:00
Marwan Sulaiman
5dcaeb8ab8 Trace stash operations (#682)
* Trace stash operations

* fix build
2018-09-20 10:59:42 -04:00
Marwan Sulaiman
8174795715 Fix module.ClearFiles operation name (#685) 2018-09-20 08:57:33 +02:00
Don McNamara
3db7a667f0 Clean up error operation names to match function names. (#614) 2018-09-19 23:43:09 -04:00
tnextday
d4c1363d9c Add HTTP_PROXY environment variable to go_get_fetcher (#668)
* Add HTTP_PROXY env to go_get_fetcher

* gofmt
2018-09-17 20:28:42 +02:00
marpio
f25c427239 Fix for Windows 10 (#648)
* ps: add cdefault conf

* init - add config

* add required env vars for win10

* update test_e2e.ps1 to use go build -mod=vendor
2018-09-13 13:57:37 -07:00
Rohan Chakravarthy
0e470d0294 Plumb config - Latest (#627)
* switch proxy to config file

pull in single flight changes

* changes for single-flight

* intermediate stage. All tests passing. pkg still has env refs

* remove all env references

* delete config/env entirely

* fix failing tests

* create the config.toml file as part of dev setup

* create config file only if it doesn't exist

* update Dockerfiles to use config file

* move composing elements to the top

* verbose parameter naming

* newline

* add flag for config file path

* update docs with config file flag

* remove unnecessary nil check

* use filepath.join

* rename redis port to address

* fix path.join

* fix issues after merge

* add vendor dir
2018-09-11 15:04:20 -07:00
Manu Gupta
bb250437da Instrumenting observability with opencensus (#604)
* Initial chanages for observability

* Fix some panics to start testing

* Export tracing properly

* First example of child spans using opencensus

* Add spans to download protocol

* Add url to traces

* Remove opentracing

* Remove gopkg.* files

* Start deprecating opentracing

* Resolve stupid build errors

* Use observability package

* Fix test errors

* Convert buffalo spans to observercontext

* change package name

* defer flush to the end of the app execution

* Change op names to the correct package

* Rename pkg/observability to pkg/observ

* Show traces for the package

* Keep tracing in the earlier way

* Add info from request headers

* Remove whitespace

* Move exporter url to env var

* Add to env file for documentation

* Remove opentracing stuff

* Use stdlib

* Shorten service name

* Add a service name to olympus as well

* Add test to test if there is a recursion or not

* Add Ops Suite

* Move around code

* Make sure the service is not instantiated if the exporter is not found
2018-09-11 10:31:20 -07:00
Tobias Klauser
ec2748ecc3 Remove unused file in pkg/module and clean up dependencies (#625)
* pkg/module: Remove unused file parser.go

PR #618 removed the last remaining user of the functions/types defined
in parser.go

* go.mod: update

The last user of github.com/sabhiram/go-gitignore was removed. Run 'go
mod tidy' to remove the dependency.

* vendor: remove unused dependency

The last user of github.com/sabhiram/go-gitignore was removed. Remove
the vendored copy as well by running 'go mod vendor'.
2018-09-07 02:04:23 -04:00
Marwan Sulaiman
ea96158f8f Athens: introduce Single Flight (#573)
* Athens: introduce singleflight

* fix ci

* small fixes

* Remove unnecessary method

* simplify folder structure

* dcoument stasher iface

* fixes

* Fix olympus

* Remove Version from Download Protocol

* fix olympus

* refactor fetcher

* consolodate wrapping styles

* fix olympus

* Further refactoring

* fix typo
2018-09-03 16:31:13 -04:00
Marwan Sulaiman
249a1a6e4e Remove unused stuff (#618) 2018-09-01 14:34:21 -04:00
Marwan Sulaiman
4a618990a2 pkg/download/goget: ensure each List func gets its own GOPATH (#559)
* pkg/download/goget: ensure each List func gets its own GOPATH

* Add list tests

* fix diskref tests
2018-08-24 10:19:17 -04:00
marpio
76121fb5cb Fix running the athens proxy on windows (#554)
* use parent env

* rename

* use only required vars

* review feedback

* add windows env vars

* ups

* fix

* rm op
2018-08-24 01:55:55 -04:00
Marwan Sulaiman
889de448dc Fetcher: switch to mod download (#448) 2018-08-15 12:33:00 -04:00
Marwan Sulaiman
78687a7948 pkg/module: fix comment (#485) 2018-08-14 17:03:16 -07:00
Michal Pristas
327fecaedd rename Private to Direct (#481) 2018-08-14 11:13:36 +02:00