Closed Bug 610512 Opened 14 years ago Closed 14 years ago

Set up stage environment for SSO

Categories

(mozilla.org Graveyard :: Server Operations, task)

All
Other
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ozten, Assigned: fox2mike)

Details

We need to stage the Secret Squirrel project. 

This is a SSO server for Mozilla web properties.

Details to follow.
Assignee: server-ops → fwenzel
For reference, the source code is here:
- https://github.com/mozilla/secret-squirrel

and the vendor lib is here:
- https://github.com/mozilla/secret-squirrel-lib

Please set up this staging environment like any other Django instance we've staged lately. There's a wsgi entry point available, too.

To start:
- git clone git://github.com/mozilla/secret-squirrel.git
- cd secret-squirrel
- git clone git://github.com/mozilla/secret-squirrel-lib.git vendor
- ./manage.py syncdb

Please create an admin user and tell me / Austin the credentials.

Finally, please have it auto-update its source code by adding a cron job that'll call .../bin/update_staging.sh . The script will take care of updating the vendor lib etc.

Thanks!
Assignee: fwenzel → server-ops
Summary: stage setup SSO environment → Set up stage environment for SSO
Ah, domain-wise, you are pretty free to use whatever. sso.stage.mozilla.org works for me, or if you want to use allizom from now on, sso.allizom.org seems like a good idea to me too.
Assignee: server-ops → jeremy.orem+bugs
I'll take this one from Jeremy
Assignee: jeremy.orem+bugs → shyam
[root@mrapp-stage02 secret-squirrel]# python26 manage.py shell
Traceback (most recent call last):
  File "manage.py", line 6, in <module>
    from django.core.management import execute_manager, setup_environ
ImportError: No module named django.core.management

All the paths are fine? (fwiw, I ran a git submodule update --init too, inside vendor). Ping me on IRC to debug?
Shyam: Sorry about that. Apparently the manage script was not set up to pick up the vendor library :(

http://github.com/mozilla/secret-squirrel/commit/f3fdf48

git pull the main repository again please and try again? Thanks!
Still failing :

[root@mrapp-stage02 secret-squirrel]# python26 manage.py shell
Error: No module named registration
:( A line we removed beforehand accidentally slipped back in. Sorry about that. I now double-checked that it does what it's supposed to and updated the code once again.
Now I get this :

[root@mrapp-stage02 secret-squirrel]# python26 manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 50, in <module>
    execute_manager(settings)
  File "/data/www/sso.stage.mozilla.com/secret-squirrel/vendor/packages/Django/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/data/www/sso.stage.mozilla.com/secret-squirrel/vendor/packages/Django/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/data/www/sso.stage.mozilla.com/secret-squirrel/vendor/packages/Django/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/data/www/sso.stage.mozilla.com/secret-squirrel/vendor/packages/Django/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/data/www/sso.stage.mozilla.com/secret-squirrel/vendor/packages/Django/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/data/www/sso.stage.mozilla.com/secret-squirrel/vendor/packages/Django/django/core/management/commands/syncdb.py", line 52, in handle_noargs
    cursor = connection.cursor()
  File "/data/www/sso.stage.mozilla.com/secret-squirrel/vendor/packages/Django/django/db/backends/__init__.py", line 75, in cursor
    cursor = self._cursor()
  File "/data/www/sso.stage.mozilla.com/secret-squirrel/vendor/packages/Django/django/db/backends/sqlite3/base.py", line 174, in _cursor
    self.connection = Database.connect(**kwargs)
TypeError: 'init_command' is an invalid keyword argument for this function

Does this need a DB? If so, settings_local.py only has an sqlite backend.
Yup, a database comes in handy ;) We're getting closer!

My settings_local looks like this:
---
from settings import *


DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'squirrel',                      # Or path to database file if using sqlite3.
        'USER': '...',                      # Not used with sqlite3.
        'PASSWORD': '...',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
        'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
        'TEST_CHARSET': 'utf8',
        'TEST_COLLATION': 'utf8_general_ci',
    }
}

---


When the Django app is up and running, please also set it up for HTTPS and forward HTTP to HTTPS. As an SSO server (even only on stage), SSL is vital and all parts of the app expect it.
Err, I'm confused. Is it looking for a mysql DB? or an sqlite one? All the sqlite ones are confusing.
MySQL, definitely.
Site is up and configured, admin details sent to you and ozten.

Get a 500 when I hit it though.

[Mon Nov 22 21:57:38 2010] [error] [client 10.2.81.4] mod_wsgi (pid=26011): Target WSGI script '/data/www/sso.stage.mozilla.com/secret-squirrel/wsgi/squirrel.wsgi' cannot be loaded as Python module.
[Mon Nov 22 21:57:38 2010] [error] [client 10.2.81.4] mod_wsgi (pid=26011): Exception occurred processing WSGI script '/data/www/sso.stage.mozilla.com/secret-squirrel/wsgi/squirrel.wsgi'.
[Mon Nov 22 21:57:38 2010] [error] [client 10.2.81.4] Traceback (most recent call last):
[Mon Nov 22 21:57:38 2010] [error] [client 10.2.81.4]   File "/data/www/sso.stage.mozilla.com/secret-squirrel/wsgi/squirrel.wsgi", line 4, in <module>
[Mon Nov 22 21:57:38 2010] [error] [client 10.2.81.4]     import django.core.handlers.wsgi
[Mon Nov 22 21:57:38 2010] [error] [client 10.2.81.4] ImportError: No module named django.core.handlers.wsgi
[Mon Nov 22 21:57:39 2010] [error] [client 10.2.81.4] mod_wsgi (pid=26287): Target WSGI script '/data/www/sso.stage.mozilla.com/secret-squirrel/wsgi/squirrel.wsgi' cannot be loaded as Python module.
[Mon Nov 22 21:57:39 2010] [error] [client 10.2.81.4] mod_wsgi (pid=26287): Exception occurred processing WSGI script '/data/www/sso.stage.mozilla.com/secret-squirrel/wsgi/squirrel.wsgi'.
[Mon Nov 22 21:57:39 2010] [error] [client 10.2.81.4] Traceback (most recent call last):
[Mon Nov 22 21:57:39 2010] [error] [client 10.2.81.4]   File "/data/www/sso.stage.mozilla.com/secret-squirrel/wsgi/squirrel.wsgi", line 4, in <module>
[Mon Nov 22 21:57:39 2010] [error] [client 10.2.81.4]     import django.core.handlers.wsgi
[Mon Nov 22 21:57:39 2010] [error] [client 10.2.81.4] ImportError: No module named django.core.handlers.wsgi
[Mon Nov 22 21:57:40 2010] [error] [client 10.2.81.4] mod_wsgi (pid=25998): Target WSGI script '/data/www/sso.stage.mozilla.com/secret-squirrel/wsgi/squirrel.wsgi' cannot be loaded as Python module.
[Mon Nov 22 21:57:40 2010] [error] [client 10.2.81.4] mod_wsgi (pid=25998): Exception occurred processing WSGI script '/data/www/sso.stage.mozilla.com/secret-squirrel/wsgi/squirrel.wsgi'.
[Mon Nov 22 21:57:40 2010] [error] [client 10.2.81.4] Traceback (most recent call last):
[Mon Nov 22 21:57:40 2010] [error] [client 10.2.81.4]   File "/data/www/sso.stage.mozilla.com/secret-squirrel/wsgi/squirrel.wsgi", line 4, in <module>
[Mon Nov 22 21:57:40 2010] [error] [client 10.2.81.4]     import django.core.handlers.wsgi
[Mon Nov 22 21:57:40 2010] [error] [client 10.2.81.4] ImportError: No module named django.core.handlers.wsgi
Thanks, Shyam! I'll take a look why this is happening, and then we should set up to auto-update.
All right, I also fixed this script by replacing it with the one that Fx Input uses, which we know to work. Please git pull again, and set it up to run bin/update_staging.sh on a cron job. Thanks!
Up and running now, and the cron is setup too.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: mozilla.org → mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.