Code Monkey home page Code Monkey logo

go-bouncer's Introduction

go-bouncer CircleCI GoDoc

A Go port of the user facing portion as part of the Bouncer project.

Environment Variables

BOUNCER_PINNED_BASEURL_HTTP

If this is a unset, bouncer will randomly pick a healthy mirror from the database and return its base url. If this option is set, the mirror table is completely ignored and BOUNCER_PINNED_BASEURL_HTTP will be returned instead.

This option acts on non ssl only products.

Example: BOUNCER_PINNED_BASEURL=download-sha1.cdn.mozilla.net/pub

BOUNCER_PINNED_BASEURL_HTTPS

This option is exactly the same as BOUNCER_PINNED_BASEURL_HTTP but acts on ssl only products.

BOUNCER_STUB_ROOT_URL

If set, bouncer will redirect requests with attribution_sig and attribution_code parameters to BOUNCER_STUB_ROOT_URL?product=PRODUCT&os=OS&lang=LANG&attribution_sig=ATTRIBUTION_SIG&attribution_code=ATTRIBUTION_CODE.

Example: BOUNCER_STUB_ROOT_URL=https://stubdownloader.services.mozilla.com/

go-bouncer's People

Contributors

bhearsum avatar davehunt avatar dependabot[bot] avatar hneiva avatar jayfk avatar jbuck avatar jcristau avatar jgmize avatar moz-astults avatar mozilla-github-standards avatar oremj avatar pyup-bot avatar stephendonner avatar willdurand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-bouncer's Issues

Travis CI free usage ends Dec 3; mozilla repos should switch to other CI platforms

We're opening this issue because your project has used Travis CI within the last 6 months. If you have already migrated off it, you can close and ignore this issue.

Travis CI is ending free builds on public repositories. travis-ci.com stopped providingthem in early November, and travis-ci.org will stop after December 31, 2020. To avoid disruptions to your workflows, you must migrate to another CI service.

For production use cases, we recommend switching to CircleCI. This service is already widely used within Mozilla. There is a guide to migrating from Travis CI to CircleCI available here.

For non production use cases, we recommend either CircleCI or Github Actions. There is a guide to migrating from Travis CI to Github Actions available here. Github Actions usage within Mozilla is new, and you will have to work with our github administrators to enable specific actions following this process.

If you have any questions, reach out in #github-admin:mozilla.org on matrix.

e2e tests - add product-details and ship-it sync verification + cleanup

From time to time product-details and ship-it get have been known to accidentally get out of sync, at a test for this.

  • Add a test for ship-it and product details that asserts firefox_versions.json are in sync
  • Remove _extract_windows_version_num(), this method isn't used by any of the tests.
  • Update docstings, s/:arg/:param/

Fix: remove conftest

Conftest.py adds a '--productoption that is being used bytest_stub_installer_redirect_for_en_us_and_win`.

I believe we designed it this way with the thought that we might want hand test, in a bestoke artisanal way, individual products. Not just firefox-stub.

I don't see a reason to keep this complexity in the code. Remove this and hard-code firefox-stub directly to the test.

  • Remove conftest.py
  • Update stub test to use firefox-stub alias
  • Update stub test to use the cdn list

Update IE6 tests to expect firefox-52.0.2esr.exe

A new ESR build for IE6 has dropped, `firefox-52.0.2esr.exe'. Update the test to reflect this and xfail the effected tests that redirecting to the incorrect product.

The following need to be xfailed:

  • firefox-38.5.1esr
  • firefox-38.5.2esr
  • firefox-38.5.3esr
  • firefox-38.6.3esr
  • firefox-40.0.0esr
  • firefox-beta-latest
  • firefox-49.0b8
  • firefox-49.0b10
  • firefox-49.0b37

throw error if incomplete parameters are provided rather than serving windows installer

(Originally filed as https://bugzilla.mozilla.org/show_bug.cgi?id=1878168)

Right now, incomplete URLs such as https://download.mozilla.org/?product=firefox-latest redirect to the Windows stub installer. Unless there's a very a good reason we're doing this, we should stop. Bouncer is essentially an API, so it's best to require complete requests rather than making assumptions.

If there are places where we're providing incomplete links for some reason, we should fix those.

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please reach out to [email protected].

(Message COC001)

pyup config

Configure pyup to initiate pull requests only on security releases

Datadog integration

Add option for datadog (statsd) integration.

bouncer.download counter with tags: product, os, language.

Bug 1422844 - Bouncer shouldn't downgrade requests from https to http

Requests for certain products or aliases like 'firefox-latest' can be done via either http or https, depending on context. Our stub installer requests the installer via http and does independent verification of the installer.

Most other requests of 'firefox-latest' are done initially via https to download.mozilla.org. However, bouncer at this point redirects them to an http location.

I'd like to change how bouncer works in this case. When a request is originally done via https, the redirect should always be to an https location. We should never downgrade from https to http.

Use Go 1.20

We are using Go 1.14 at the moment (apparently), that is a bit old now.

[tests/e2e] TypeError: 'NoneType' object has no attribute '__getitem__' in pipenv install

@davehunt my brain is mush at this point - helpful pointers, if you would?

https://qa-preprod-master.fxtest.jenkins.stage.mozaws.net/job/go-bouncer.adhoc/137/ (and even running locally, for me, against master) yields:

02:40:48 Step 4 : COPY requirements.txt /src
02:40:48  ---> Using cache
02:40:48  ---> 5bf630fc453d
02:40:48 Step 5 : RUN pip install pipenv
02:40:48  ---> Using cache
02:40:48  ---> 85735dd5b5ef
02:40:48 Step 6 : RUN pipenv install --system -r requirements.txt --skip-lock --deploy
02:40:49  ---> Running in b738bc7afcb4
02:40:50 Creating a Pipfile for this project…
02:40:50 Traceback (most recent call last):
<snip>
TypeError: 'NoneType' object has no attribute '__getitem__'

Fuller output below:

02:40:48 Checking out Revision 58acc2ca54237e19299a7e616fb87212746e269f (origin/pyup-update-pytest-3.4.1-to-3.4.2)
02:40:48  > git config core.sparsecheckout # timeout=10
02:40:48  > git checkout -f 58acc2ca54237e19299a7e616fb87212746e269f
02:40:48 Commit message: "Update pytest from 3.4.1 to 3.4.2"
[Pipeline] withEnv
[Pipeline] {
[Pipeline] readFile
[Pipeline] sh
02:40:48 [go-bouncer.adhoc@2] Running shell script
02:40:48 + docker build -t a8cf67e9f83d680ef17c18ffab414241b9ded0e2 -f tests/e2e/Dockerfile tests/e2e
02:40:48 Sending build context to Docker daemon  72.7 kB

02:40:48 Step 1 : FROM python:2.7-alpine
02:40:48  ---> 3e4f5b6dfb77
02:40:48 Step 2 : RUN apk add --update gcc libffi-dev musl-dev openssl-dev python-dev
02:40:48  ---> Using cache
02:40:48  ---> 944e88cd23b8
02:40:48 Step 3 : WORKDIR /src
02:40:48  ---> Using cache
02:40:48  ---> 40ba2f4b58b5
02:40:48 Step 4 : COPY requirements.txt /src
02:40:48  ---> Using cache
02:40:48  ---> 5bf630fc453d
02:40:48 Step 5 : RUN pip install pipenv
02:40:48  ---> Using cache
02:40:48  ---> 85735dd5b5ef
02:40:48 Step 6 : RUN pipenv install --system -r requirements.txt --skip-lock --deploy
02:40:49  ---> Running in b738bc7afcb4
02:40:50 Creating a Pipfile for this project…
02:40:50 Traceback (most recent call last):
02:40:50   File "/usr/local/bin/pipenv", line 11, in <module>
02:40:50     sys.exit(cli())
02:40:50   File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
02:40:50     return self.main(*args, **kwargs)
02:40:50   File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
02:40:50     rv = self.invoke(ctx)
02:40:50   File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
02:40:50     return _process_result(sub_ctx.command.invoke(sub_ctx))
02:40:50   File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
02:40:50     return ctx.invoke(self.callback, **ctx.params)
02:40:50   File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
02:40:50     return callback(*args, **kwargs)
02:40:50   File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 197, in install
02:40:50     selective_upgrade=selective_upgrade
02:40:50   File "/usr/local/lib/python2.7/site-packages/pipenv/core.py", line 1722, in do_install
02:40:50     ensure_project(three=three, python=python, system=system, warn=True, deploy=deploy, skip_requirements=skip_requirements)
02:40:50   File "/usr/local/lib/python2.7/site-packages/pipenv/core.py", line 653, in ensure_project
02:40:50     ensure_pipfile(validate=validate, skip_requirements=skip_requirements)
02:40:50   File "/usr/local/lib/python2.7/site-packages/pipenv/core.py", line 343, in ensure_pipfile
02:40:50     project.create_pipfile(python=python)
02:40:50   File "/usr/local/lib/python2.7/site-packages/pipenv/project.py", line 435, in create_pipfile
02:40:50     data[u'requires'] = {'python_version': python_version(self.which('python'))[:len('2.7')]}
02:40:50 TypeError: 'NoneType' object has no attribute '__getitem__'
02:40:50 The command '/bin/sh -c pipenv install --system -r requirements.txt --skip-lock --deploy' returned a non-zero code: 1

Stop sending OSX 10.9/10/11 to ESR alias

The intention was to send users on old OSX to ESR78 installers; that worked while the esr-next aliases pointed at esr78, but that has not been the case for several years now, so this code stopped working with the initial esr91 release.

Add Codecov

Let's configure Codecov to get code coverage reports.

Stub attribution redirect

If the attribution_code parameter is set, redirect to the stub downloader service with the product, os, lang and attribution_code parameters set.

@pmac

Tests: fix incorrect try/except in base.py

Line 89, response.url is referenced but response is never assigned when an exception is thrown.

try:
    response = requests.head(url, headers=headers, verify=False, timeout=15, params=params, allow_redirects=True)
    except requests.RequestException as e:
        request_url = '%s/?%s' % (url, urlencode(params))
        raise AssertionError('Failing URL: %s redirected to %s Error message: %s' % (request_url, response.url, e))

Update winxp tests

        'stub',
        'latest',
        'sha1',
        'esr-latest',
        'esr-sha1',
        'esr-stub',
        'beta',
        'beta-latest',
        'beta-sha',
        'beta-stub',
        '38.5.1esr',
        '40.0.0esr',
        '58.0.0esr',
        '42.0',
        '43.0.1',
        '49.0b8',
        '49.0b8-ssl',
        '100.0',
        'cats'
    ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.