GithubHelp home page GithubHelp logo

mozilla-services / tuxedo Goto Github PK

View Code? Open in Web Editor NEW
19.0 23.0 14.0 1.29 MB

An improved version of Mozilla's download load balancer Bouncer, with a user interface written in Django/Python.

Home Page: https://wiki.mozilla.org/Bouncer

Python 73.39% Shell 0.27% CSS 2.12% JavaScript 11.48% HTML 12.46% Dockerfile 0.28%

tuxedo's Introduction

tuxedo

An improved version of the Bouncer mirror management software.

Bouncer is a Mozilla project. The new admin backend was originally written by Frederic Wenzel ([email protected]).

Getting Started

Python

You need Python 2.6. Also, you probably want to run this application in a virtualenv environment.

Run easy_install pip followed by pip install -r requirements.txt to install the required Python libraries.

git submodules

The list of known languages is provided by languages.json in the directory inc/product-details/json and imported as a git submodule. The source of the data is the Mozilla product-details library.

To initialize the submodule (or pull updates from it), run this from the tuxedo root directory:

git submodule update --init

Initial Database Setup

If you're installing a new copy of Bouncer, run ./manage.py syncdb followed by ./manage.py migrate (see "Database Migrations" below).

Database Migrations

I am using South to keep track of database migrations. ./manage.py migrate will apply these migrations when necessary.

Upgrading an older version of Bouncer

If you are upgrading from an earlier version of Bouncer that isn't locale- aware yet, apply sql/bouncer-add-lang.sql first.

Then, apply sql/incremental.sql to bring the DB up to date.

Finally, run the following steps to initialize Django and South:

./manage.py syncdb   # initialize django
# (answer "no" to the "add a new admin?" question)
./manage.py migrate mirror 0001 --fake   # initialize South
./manage.py migrate   # apply all existing migrations

Tuxedo API and mod_wsgi

There are multiple ways to deploy a Django project on a web server. If you want to use Apache with mod_wsgi, make sure to set it up so it passes HTTP Basic Auth credentials on to the application, otherwise the Tuxedo API won't work.

Why "tuxedo"?

In my silly mind, I chose to interpret "Bouncer" as "doorman" and subsequently decided that its new version should be codenamed like what fancy bouncers wear: a tuxedo.

Licensing

This software is licensed under the Mozilla Tri-License:

***** BEGIN LICENSE BLOCK *****
Version: MPL 1.1/GPL 2.0/LGPL 2.1

The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.

The Original Code is tuxedo.

The Initial Developer of the Original Code is Mozilla.
Portions created by the Initial Developer are Copyright (C) 2010
the Initial Developer. All Rights Reserved.

Contributor(s):
  Frederic Wenzel <[email protected]>

Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.

***** END LICENSE BLOCK *****

tuxedo's People

Contributors

bhearsum avatar brandonsavage avatar lauraxt avatar nthomas-mozilla avatar oremj avatar rhelmer avatar rik avatar superawesome avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tuxedo's Issues

Remove "php" app

The "php" django app only exists for the tests it contains, but the tests are highly data dependent and are somewhat unlikely to still pass (I didn't try).

I suggest removing them.

Migrate to CircleCI 2

I recently got an email from "The CircleCI Team" saying:

Last month, we pointed you toward resources to help you migrate active projects from CircleCI 1.0 to 2.0 with the Migration Center.

With only 30 days left until CircleCI 1.0 sunsets, we want to ensure you have everything you need to help you with any active projects that still need to migrate to 2.0. Our team has been busy creating resources and new features to help make it easier:

More info in the CircleCI Blog at https://circleci.com/blog/sunsetting-1-0/ and https://circleci.com/docs/2.0/migration-intro/

I also found https://circleci.com/docs/2.0/local-cli/ which points to a handy CircleCI v2 config validator (using something like $ circleci config validate -c .circleci/config.yml).

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)

Possible Posting Issue

The following error was observed by a SeaMonkey build script posting to the API

/d/sources/users/Callek_gmail.com/tools/release /d/sources/braindump/releases-related
Adding product: SeaMonkey-2.15b3
Server response:
<?xml version="1.0" encoding="utf-8"?><products><product id="2190" name="SeaMonkey-2.15b3"/></products>
Adding product: SeaMonkey-2.15b3-Complete
Server response:
<?xml version="1.0" encoding="utf-8"?><products><product id="2191" name="SeaMonkey-2.15b3-Complete"/></products>
Adding product: SeaMonkey-2.15b3-Partial-2.15b2
Server response:
<?xml version="1.0" encoding="utf-8"?><products><product id="2192" name="SeaMonkey-2.15b3-Partial-2.15b2"/></prod
ucts>
Adding location for SeaMonkey-2.15b3, linux: /seamonkey/releases/2.15b3/linux-i686/:lang/seamonkey-2.15b3.tar.bz2

Adding location for SeaMonkey-2.15b3-Complete, linux: /seamonkey/releases/2.15b3/update/linux-i686/:lang/seamonke
y-2.15b3.complete.mar
Adding location for SeaMonkey-2.15b3-Partial-2.15b2, linux: /seamonkey/releases/2.15b3/update/linux-i686/:lang/se
amonkey-2.15b2-2.15b3.partial.mar
Adding location for SeaMonkey-2.15b3, osx: /seamonkey/releases/2.15b3/mac/:lang/SeaMonkey%202.15b3.dmg
Adding location for SeaMonkey-2.15b3-Complete, osx: /seamonkey/releases/2.15b3/update/mac/:lang/seamonkey-2.15b3.
complete.mar
Adding location for SeaMonkey-2.15b3-Partial-2.15b2, osx: /seamonkey/releases/2.15b3/update/mac/:lang/seamonkey-2
.15b2-2.15b3.partial.mar
Adding location for SeaMonkey-2.15b3, win: /seamonkey/releases/2.15b3/win32/:lang/SeaMonkey%20Setup%202.15b3.exe
Adding location for SeaMonkey-2.15b3-Complete, win: /seamonkey/releases/2.15b3/update/win32/:lang/seamonkey-2.15b
3.complete.mar
Adding location for SeaMonkey-2.15b3-Partial-2.15b2, win: /seamonkey/releases/2.15b3/update/win32/:lang/seamonkey
-2.15b2-2.15b3.partial.mar
FAILED: Tuxedo API error. URL: https://bounceradmin.mozilla.com/api/location_add/
POST data: path=%2Fseamonkey%2Freleases%2F2.15b3%2Fupdate%2Fwin32%2F%3Alang%2Fseamonkey-2.15b2-2.15b3.partial.mar
&product=SeaMonkey-2.15b3-Partial-2.15b2&os=win
Traceback (most recent call last):
  File "tuxedo-add.py", line 147, in tuxedoRequest
    return urllib2.urlopen(request).read()
  File "d:\mozilla-build\python\lib\urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "d:\mozilla-build\python\lib\urllib2.py", line 391, in open
    response = self._open(req, data)
  File "d:\mozilla-build\python\lib\urllib2.py", line 409, in _open
    '_open', req)
  File "d:\mozilla-build\python\lib\urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "d:\mozilla-build\python\lib\urllib2.py", line 1169, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "d:\mozilla-build\python\lib\urllib2.py", line 1136, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly r
espond after a period of time, or established connection failed because connected host has failed to respond>

The following traceback was observed being logged on the web server that handled the POST

[Fri Dec 07 14:02:40 2012] [error] [client 10.8.81.216] (70014)End of file found: mod_wsgi (pid=7611): Unable to get bucket brigade for request.
[Fri Dec 07 14:02:40 2012] [debug] mod_headers.c(768): headers: ap_headers_error_filter()
[Fri Dec 07 14:02:40 2012] [error] ERROR:django.request:Internal Server Error: /api/location_add/
[Fri Dec 07 14:02:40 2012] [error] Traceback (most recent call last):
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/vendor/lib/python/django/core/handlers/base.py", line 111, in get_response
[Fri Dec 07 14:02:40 2012] [error]     response = callback(request, *callback_args, **callback_kwargs)
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/vendor/lib/python/django/views/decorators/http.py", line 41, in inner
[Fri Dec 07 14:02:40 2012] [error]     return func(request, *args, **kwargs)
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/vendor/lib/python/django/views/decorators/csrf.py", line 77, in wrapped_view
[Fri Dec 07 14:02:40 2012] [error]     return view_func(*args, **kwargs)
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/apps/api/decorators.py", line 63, in wrapper
[Fri Dec 07 14:02:40 2012] [error]     realm, *args, **kwargs)
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/apps/api/decorators.py", line 103, in _view_or_basicauth
[Fri Dec 07 14:02:40 2012] [error]     return view(request, *args, **kwargs)
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/apps/api/views.py", line 305, in location_add
[Fri Dec 07 14:02:40 2012] [error]     prodname = request.POST.get('product', None)
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/vendor/lib/python/django/core/handlers/wsgi.py", line 180, in _get_post
[Fri Dec 07 14:02:40 2012] [error]     self._load_post_and_files()
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/vendor/lib/python/django/http/__init__.py", line 372, in _load_post_and_files
[Fri Dec 07 14:02:40 2012] [error]     self._post, self._files = QueryDict(self.body, encoding=self._encoding), MultiValueDict()
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/vendor/lib/python/django/http/__init__.py", line 328, in body
[Fri Dec 07 14:02:40 2012] [error]     self._body = self.read()
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/vendor/lib/python/django/http/__init__.py", line 384, in read
[Fri Dec 07 14:02:40 2012] [error]     return self._stream.read(*args, **kwargs)
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/vendor/lib/python/django/core/handlers/wsgi.py", line 98, in read
[Fri Dec 07 14:02:40 2012] [error]     result = self.buffer + self._read_limited()
[Fri Dec 07 14:02:40 2012] [error]   File "/data/www/download.mozilla.org/tuxedo/vendor/lib/python/django/core/handlers/wsgi.py", line 92, in _read_limited
[Fri Dec 07 14:02:40 2012] [error]     result = self.stream.read(size)
[Fri Dec 07 14:02:40 2012] [error] UnreadablePostError: request data read error

This is the only occurrence of this error that is in the logs on the bouncer cluster

I am filing this only as an informational bug, as when the script was rerun it succeeded.

internal server error when adding a new user with incorrect password guidelines

Moved from Bug 1454334.

I was trying to add a new account for our very own RelEng Simon Fraser (sfarser) and bouncer failed me twice with "internal server error". I tried different passwords and eventually I managed to get passed through. After successful addition I've noticed there's a "Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only." guideline.

Would be nice if bouncer did a better job at handling that error and throw an "form input error for password" or so rather than internal server error.

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.