README.rst 3.52 KB
Newer Older
Jasper St. Pierre's avatar
Jasper St. Pierre committed
1 2 3 4 5 6 7
==============
SweetTooth-Web
==============

**SweetTooth-Web** is a Django-powered web application that, in co-operation
with some co-horts in GNOME Shell and other places, allows users to install,
upgrade and enable/disable their own Shell Extensions. All operations with
8 9
the Shell are done through a special NPAPI plugin, sweettooth-plugin_, which
proxies over to the Shell by DBus.
Jasper St. Pierre's avatar
Jasper St. Pierre committed
10 11 12 13 14 15

Since extensions can be dangerous, all extensions uploaded to the repository
must go through code review and testing.

.. _sweettooth-plugin: https://github.com/magcius/sweettooth-plugin

16 17 18
Getting Started
---------------

19 20
You can get started developing the website with::

21 22 23 24 25 26
  $ git clone git://github.com/magcius/sweettooth.git
  $ cd sweettooth
  $ virtualenv_ --no-site-packages ./venv
  $ . ./venv/bin/activate
  $ pip_ install -r requirements.txt
  $ # ... Database setup...
27
  $ python sweettooth/manage.py `runserver_plus`_
28 29 30 31 32

Create a superuser, and log in. You should be able to upload extensions and
review extensions. There isn't a link to the code review UI, but it's hidden
at /review/.

33
.. _runserver_plus: http://packages.python.org/django-extensions/
34 35 36
.. _virtualenv: http://www.virtualenv.org/
.. _pip: http://www.pip-installer.org/

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
Testing with the Shell
======================

If you have GNOME Shell, and you want to test the installation system, you're
going to have to hack your system. For security reasons, the browser plugin and
GNOME Shell both ping the URL https://extensions.gnome.org directly. The
easiest way to get around this is to make a development environment with the
proper things that it needs. Since the Django development server doesn't
natively support SSL connections, we need to install Apache. Follow the
instructions above to get a proper SweetTooth checkout, and then::

  # Install Apache
  $ sudo yum install httpd mod_wsgi mod_ssl

  # Generate a self-signed cert
52 53 54 55 56 57
  $ openssl req -new -nodes -out ego.csr -keyout extensions.gnome.org.key
  # Answer questions. The only one required is the Common Name. You must put
  # extensions.gnome.org -- the hostname -- as the answer.

  $ openssl x509 -req -in ego.csr -signkey extensions.gnome.org.key -out extensions.gnome.org.crt
  $ rm ego.csr
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

  # Install it on your system.
  $ sudo cp extensions.gnome.org.crt /etc/pki/tls/certs/
  $ sudo cp --preserve=mode extensions.gnome.org.key /etc/pki/tls/private/

  # The shell will look for a special file called 'extensions.gnome.org.crt',
  # for development purposes. Otherwise it will use your system's CA bundle.
  $ mkdir -p ~/.local/share/gnome-shell
  $ cp extensions.gnome.org.crt ~/.local/share/gnome-shell/

  # Configure Apache.
  $ cp etc/sweettooth.wsgi.example ./sweettooth.wsgi
  $ $EDITOR ./sweettooth.wsgi

  $ cp etc/sweettooth.httpd.conf.example ./sweettooth.httpd.conf
  $ $EDITOR ./sweettooth.httpd.conf
  $ sudo cp sweettooth.httpd.conf /etc/httpd/conf.d/sweettooth.conf

  # Edit /etc/hosts
  $ sudo tee -a /etc/hosts <<< 'extensions.gnome.org 127.0.0.1'


Jasper St. Pierre's avatar
Jasper St. Pierre committed
80 81 82 83 84 85
Requirements
------------

  * django_
  * django-autoslug_
  * django-tagging_
86
  * Pygments_
87
  * sorl-thumbnail_
88
  * south_
Jasper St. Pierre's avatar
Jasper St. Pierre committed
89

90 91
I develop with PostgreSQL_ at home, but Django should be able to use SQLite_,
MySQL_, and others. South_ is used for migrations.
Jasper St. Pierre's avatar
Jasper St. Pierre committed
92 93 94

.. _django: http://www.djangoproject.com/
.. _django-autoslug: http://packages.python.org/django-autoslug/
95
.. _Pygments: http://www.pygments.org/
96
.. _sorl-thumbnail: http://thumbnail.sorl.net/
Jasper St. Pierre's avatar
Jasper St. Pierre committed
97 98 99
.. _PostgreSQL: http://www.postgresql.org/
.. _SQLite: http://www.sqlite.org/
.. _MySQL: http://www.mysql.com/
100
.. _south: http://south.aeracode.org/