Commit Graph

32 Commits

Author SHA1 Message Date
oliverch
874d27158d feat: add /robots.txt (#1355)
* feat: add /robots.txt

* disallow all crawler by default.
2019-09-16 16:21:08 -05:00
Bob Maertz
994810324e Fix Mongo initialization to use environment variables for db/coll names (#1331)
* Updated mongo init to use db name env variable.

* Updated mongo init to use coll name env var.

* Fixed merge conflict.

* Updated formatting in mongo_test.
2019-08-14 21:41:21 -07:00
jhawk28
ba9dc5470e add support for a host in ensurePortFormat (#1342)
* add support for an host in ensurePortFormat
using a host enables the ability to bind to a specific interface

* add support for an host in ensurePortFormat
using a host enables the ability to bind to a specific interface
2019-08-14 14:46:32 -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
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
c11212ba16 pkg/config: ensure port format (#1187)
* pkg/config: ensure port format

* fix tests
2019-04-14 11:21:45 -04:00
Marwan Sulaiman
71aeca7f30 config: accept PORT env + ensure colon (#1181)
* config: accept PORT env + ensure colon

* ensure precedence
2019-04-08 12:54:25 -07:00
Pontus Leitzler
d9e0df8643 Config improvements - rename file & remove default (#1103)
* Rename config.dev.toml to config-example.toml

* Updating helm docs to point to the new helm chart repository (#1102)

* Updating helm docs to point to the new helm chart repository

Fixes https://github.com/gomods/athens/issues/1099
Follow-up to https://github.com/gomods/athens/pull/1097/files

* fixes

* Helm chart: Fix ingress setup (#1086)

* Helm chart: Fix ingress setup

The ingress part of the Helm chart contained references to
not-existing templates and values. Additionally, the deployment used
some no longer available health-check URLs which prevented it from
being marked as ready.

* Make readiness and liveness paths depend on the image.tag

* Add read from .athens.toml (from pwd, then home)

* Remove config lookup from HOME

* Revert "Rename config.dev.toml to config-example.toml"

This reverts commit 9c02956406.

* Fix comment
2019-03-26 16:56:18 -04: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
3525cdaa4a pkg/config: make sure envconfig doesn't override config values for port (#1074)
Fixes #1037.

envconfig can't actually support that use case, and because athens was
using the `default:` tag only for the port field, handling this manually
is the easiest and functional solution.
2019-02-19 12:11:33 -05:00
marpio
831b5616b5 Check code defaults and config.toml defaults are the same (#1073)
* rm TraceExporterURL and StatsExporter default vals

* add test

* fix test

* revert TraceExporterURL and StatsExporter changes

* improve test error msg

* ignore GoEnv since it's set in CI and dev differently
2019-02-19 07:46:29 -08:00
Chris Mills
2cf10c3ead Allow mgo.ParseURL to set [/database] (#997)
* Allow mgo.ParseURL to set [/database]

As per Michael's solution we need to be able to set the database from
either the parsed connection string, or fallback to athens if not set.

Signed-off-by: Chris M <me@christophermills.co.uk>

* Remove TimeoutDuration which was removed #928

Signed-off-by: Chris M <me@christophermills.co.uk>

* Correct conf_test to accommodate for changes

I'd missed out the addition of DefaultDBName from the test, this has now
been corrected

Signed-off-by: Chris M <me@christophermills.co.uk>

* Make sure gofmt runs automatically on this machine

Y'know simple stuff.

Signed-off-by: Chris M <me@christophermills.co.uk>
2019-02-14 10:21:34 -08:00
Marwan Sulaiman
aa3fb3389c pkg/config: Update GoGetWorkers default/docs (#1052)
* pkg/config: Update GoGetWorkers default/docs

* fix tests
2019-02-11 11:51:38 -05:00
Marwan Sulaiman
5870aeee8d Remove Buffalo (#1010)
* Remove Buffalo

* gofmt

* pr fixes

* fix subrouter

* bring back secure middleware + pr fixes

* better place for subrouter

* vendor
2018-12-22 20:24:25 -05:00
Marwan Sulaiman
36aba5915c Revert TraceExporter Default (#1012)
* Revert TraceExporter Default

* fix tests
2018-12-22 11:52:02 -05:00
Tomasz Tomalak
fb696b2d84 Add prometheus metrics collectors for http handlers (#958)
* Add prometheus metrics exporter for http handlers

* Use prometheus from opencensus

* Add comment to unused func() param

* Add package names to operation description in observ package

* Sort exported/unexported functions
2018-12-20 10:19:22 +01: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
Manu Gupta
66cb01e668 Add tracing defaults for jaeger (#934)
* Add tracing defaults for jaeger

* Fix tests

* Add comment in config file as well
2018-11-29 10:44:34 -05:00
Yorman
b92a642f1a Add error checks in a few test files and fix misspelled words (#919)
* Remove inefficient assignment of variable cxt in pkg/storage/fs

* Remove inefficient assignment of variable cxt in pkg/storage/minio

* Remove inefficient assignment of variable cxt in pkg/storage/mongo

* Fix commonly misspelled English words successfully and accessible

* Remove inefficient assignment of variable cxt in pkg/download

* Remove inefficient assignment of variable cxt in pkg/module

* Add missing error checks in a few unit-test files

* Revert removal of inefficient assignment of variable cxt

The variable, although is not being used, it maintains the readability
in the functions where it’s being assigned. The removal of `cxt` in
these files may introduce errors when a new function taking these
values is called. Two other contributors agree that it’s easy to miss
this detail when passing the variable to other functions and the traces
are not being recorded.

* Modify unit-test error reporting for the config package

* Modify config test to exit when ioutil.TempFile or os.Chmod fail
2018-11-21 20:16:05 +01:00
Manu Gupta
ff99d30bc2 skip test for chmod on windows (#938)
* add logs

* apples and oranges

* apples and oranges

* Fix bug

* stringify mode

* fix stuff

* figure out why chmod does not work

* see what happens outside the temp folder

* Does it have a long path

* check if proper runtimes are called

* Skip tests for windows

* clean up
2018-11-21 06:23:23 -05:00
Manu Gupta
c11212601b Checks for windows permissions (#902)
* Checks for windows permissions

* Fix bug

* fix test

* Update perms

* Fix perms
2018-11-20 20:56:35 +01:00
azure-pipelines[bot]
1984dbdaaf Set up CI with Azure Pipelines (#862)
* Set up CI with Azure Pipelines

* trial & error

* use robocopy

* fix slash

* handle robocopy exit code

* rm goroot

* build proxy

* build & test proxy

* Skip Test_checkFilePerms on Win until issue resolved

* start minio and mongo

* do not create a new network on win 2016

* use win docker img for mongo

* download and start minio since there is no win docker img

* fix minio download & exec

* add minio access key and secret

* use new mongodb img

* fix docker-compose mongo

* trying to fix mongo tests

* ipconfig

* lets try that

* use docker inspect to get the container ip

* echo mongo container ip

* debuging docker inspect ipaddress

* set mongo env var to internal addr

* debug

* quotation is difficult

* without docker

* pass db dir

* split steps

* add some echos to know what takes so long

* cleanup

* add downloadURL var for minio and mongo

* rm windows docker compose file
2018-11-18 09:04:42 -05:00
marpio
4785e9c2b3 Remove storage timeouts (#928)
* remove storage timeouts

* fix tests
2018-11-16 16:00:08 -05:00
Tomasz Tomalak
61ddb907c1 Add support for DigitalOcean Spaces storage (#847)
* Add Region value to Minio configuration, Allow to use minio for DigitalOcean Spaces

* Remove unnecessary Region value setter
2018-11-05 15:24:44 -05:00
marpio
54f92c55d6 Config cleanup (#860)
* add default env vars

* del setRuntimeDefaults

* replace cdn conf with azure config and remove baseURL
2018-11-05 09:04:38 +01:00
Marwan Sulaiman
21dcd5a388 config: flatten Proxy struct (#846)
* config: flatten Proxy struct

* fix mw_test

* gofmt

* add line
2018-11-01 17:21:42 -04:00
Nathaniel Ward
ed05805db6 change env var for port to ATHENS_PORT (#839)
* use sys env ATHENS_PORT instead of PORT

* add default port

* validate is not needed since we default a port now. add test for default port
2018-10-31 22:24:54 -04:00
Manu Gupta
8f4e3dc3c0 Remove FilterOff from the env var (#837)
* Remove FilterOff from the env var

* Remove test

* Turn off filter by default

* Fix test
2018-10-31 17:37:44 -04:00
Manu Gupta
b600753926 Check for file perms as provided in the conf module (#784)
* Check for file perms as provided in the conf module

* Fix whitespace

* Check for file permissions

* Use only Lstat for error handling and continue if file does not exist

* Update comments to make sure that the todo is more understandable

* conflicts resolved
2018-10-26 12:53:05 -07:00
Marwan Sulaiman
2d589f1945 Remove CSRF option from config (#814) 2018-10-24 10:59:33 +02:00