* support setting pypiBaseUrl by environment variables
* Add support for pypiBaseUrl configuration
* Update Pypi services to include pypiBaseUrl parameter
* change package name example to a more well-known package
* Update custom-environment-variables.yml
* Update Pypi services to include pypiBaseUrl parameter
* fix openapi mismatch
* Update doc/server-secrets.md
---------
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
* allow user to set dockerhub credentials
* add withJwtAuth function to AuthHelper
* use withJwtAuth in DockerHub badges
* add unit tests for JWT auth
* use auth when calling docker cloud
* refactor and assert fetch helpers call withJwtAuth
* store token for a max duration (defaults to 1 hour)
* tangent: update test example
* [OpenCollective] update opencollective to api v2 (#9346)
* update opencollective to api v2
* fix tests
* fix: do not filter by accountType for opencollective/all
* remove 404
* remove required in schema
* cnt -> count
* keep by-tier code as-is
---------
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* allow calling OpenCollective api with an auth token
* add test for opencollective auth
* cache OpenCollective badges for longer
---------
Co-authored-by: xxchan <xxchan22f@gmail.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* send X-GitHub-Api-Version when calling GitHub v3 API
* TODO: invesitgate
* read baseUrl from config.service.baseUri
* add workflow to check for new GH api releases on schedule
* format config/default.yml to match yaml.dump() format
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* expose fetchLimitBytes/userAgent in got-config module
* export a function not a factory
* send better user-agent values
- add userAgentBase setting
- send short SHA in user agent on heroku
- set a version (tag or short SHA) in Dockefile and use
it to report server version in UA for docker users
* add a comment explaining fileSize
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* feat: support authentication on Libraries.io requests
* feat: wire up libraries.io config and api provider instantiation
* feat: create libraries.io and bower base classes
* refactor: tweak libraries/bower service classes and tests
* rename request fetcher function/arg
* throw exception when no tokens available
* cleanup old value
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* service: add obs service
* service: obs: replaced replaceAll with replace and global regex
* service: obs: added space between class members
* service: obs: support for multiple instances
* service: obs: removed user prefix from auth vars
obs_userName is now called obs_user and obs_userPass is called obs_pass
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
* service: obs: removed constructor hack in favour of serviceKey
* service: obs: apply suggestions from @calebcartwright
* service: obs: remove unneccesary http status mappings
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* Added GitLab Tag service
* Added prettyMessage for when repo has no tags
* Added pretty message for repo not found
* core: esm-ify gitlab tag service
* feat: support gitlab auth
* feat: support custom gitlab url on tag badges
* tests: add auth test for gitlab
* docs: fix gitlab config key references
* feat: support gitlab tag sorting options
* docs: add custom gitlab instance example for tags badge
* use v in gitlab route
* fix: gitlab tag examples
Co-authored-by: Ideotec <guille@ideotec.es>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This is the code part of #3027, following [this article](https://www.viget.com/articles/heroku-cloudflare-the-right-way/) and using [this middleware](https://github.com/clive-io/cloudflare-middleware).
I pulled in the `addHandlerAtIndex()` function @chris48s wrote for #5574.
The middleware isn't perfect for scoutcamp, since it relies on `req.ip` which is something set by Express. However, the other solutions I found were either explicitly deprecated ([cloudflare-ip](https://www.npmjs.com/package/cloudflare-ip)) or relied on dynamically fetching the list of Cloudflare hosts ([cloudflare-ips](https://www.npmjs.com/package/cloudflare-ips)), which seems unnecessary as this list has not changed in several years.
I've left this off to start, so we can test it in production using an env var before we make it the production default.
* Migrate [Discord] implementation to use bot token
* Rework authorization field creation
* Revert "Rework authorization field creation"
This reverts commit caf65bde5d.
* Add LGTM exclusion for hardcoded credentials
* prom-client JSON to InfluxDB line protocol converter
* Converts a metric with separate names
* prom-client JSON to InfluxDB line protocol (version 2) converter
* Server has instance id
* Read the instance id from an environment variable
* More unit tests for instance-metadata
* Log instance id
* Push influx metrics
* INSTANCE_ID with dyno metadata
* Prepare influx metrics in one place
* Influx metrics endpoint should return metrics
* More readable tests
* Env added to instance metadata
* hostname as an instance label value
* HEROKU_DYNO_ID as an instance id for heroku
* Instance env can be set by env variable
* HEROKU_APP_NAME as an instance env
* Log instance metadata as a JSON
* Typo fix
* Code refactoring in tests
* wait-for-expect dev dependency added
* Test for pushing metrics
* Test for pushing metrics
* Use basic authentication for pushing metrics
* intervalSeconds=2 for development env
* Using existing methods
* TODOs removed
* Schema for influx credentials
* Influx config removed from config files
* Require username and password when influx metrics are enabled
* Unused args removed
* pushing component should log errors
* Speed up tests
* should log error responses
* InstanceMetadata class replaces by simple object
* Influx metrics can be configuredd by env variables
* Use application label name instead of service
* Unused code removed
* Integration test for prom-client and converter
* metrics.influx.enabled configuration option added
* Improved influx configuration schema
* instanceMetadata validation
* Typo fix
* Default value for env
* metrics.infux.hostnameAsAInstanceId added
* should add hostname as an instance label when hostnameAsAInstanceId is enabled
* Default values for influx configuration
* flatMap is not available in Node.js 9.4
* Env vars removed from Procfile
* Better instance metadata values in tests
* Typo fix
* lodash.groupby added to prod dependencies
* Allow other keys in private config
* Missing test - should allow other private keys when influx metrics are enabled
* Missing test - should require private metrics config when influx configuration is enabled
* log.error instead of console.log
* metrics.influx.uri -> metrics.influx.url
* Unused arguments removed
* async removed
* promisify sendMetrics
* Allow to disable prometheus metrics
* Create test server with custom config
* 'metrics-influx' resource removed
* 'metrics-influx' resource removed
* Private config schema flattened out
* Extra code removed in Prometheus tests
* promisify moved outside of the class
* Do not throw errors from got in a specific test
* hostnameAliases added
* instanceIdFrom added
* instanceIdEnvVarName added
* envLabel added to schema
* instanceMetadata is not used by InfluxMetrics
* Instance metadata removed
* hostnameAsAnInstanceId removed
* A comment added
* waitForExpect removed
* Unused code removed
* Make it easier to benchmark and profile the code
* Remove unnecessary escape
* Clarify that the backend server is started without the frontend
* Add missing NODE_CONFIG_ENV environment variable
* Add error message when user has not included console.time statements
* Fix lint issue
* Handle multiple console.time statements
* Switch NODE_CONFIG_ENV to test
* Switch to const as variable never re-assigned
* Add drone build badge based on travis
* Fix wrong mocked endpoint for done builder
* Refactor service tester using helper method
* Add missing failure status to red statuses
* Remove extraneous invalid svg test from drone
* Test on failure red status in build status spec
* refactor(drone): use json service instead of svg
* refactor(drone): remove status text and extraneous build path in test
* refactor(drone): allow defining self-hosted drone instances
* fix(drone): use proper urls in drone examples
* fix(drone): add drone token authorization for self-hosted instances
* refactor(drone): call render build status badge directly instead of render
* refactor(drone): use server query parameter for self-hosted instances
* fix(drone): separate url and query params in example
* fix(drone): use actual build status message in examples
* fix(drone): add missing message for status code 401
Co-Authored-By: byCedric <me@bycedric.com>
* refactor(drone): remove color from drone tests
* refactor(drone): remove extraneous comments from drone tests
* refactor(drone): remove unused static preview method
* refactor(drone): remove unused static render method
* refactor(drone): reuse render build status badge helper in static previews
* fix(drone): test inaccessible repos on new message
* Tweak Docker initialization
1. Set NODE_ENV=production in Docker.
2. When NODE_ENV is production, bind to all interfaces. This seems like a
sensible default.
3. Exclude Dockerfile from container to improve layer cacheability when
modifying the dockerfile.
Ref #3165
* Rm obsolete comment
This implements the configuration mechanism I described in #2621. The heavy lifting is delegated to [node-config](https://github.com/lorenwest/node-config) with a minor assist from [dotenv](https://github.com/motdotla/dotenv).
`private/secret.json` has been replaced with environment variables and/or `config/local.yml`. See `doc/server-secrets.md`.