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

**SweetTooth-Web** is a Django-powered web application that, in co-operation
Yuri Konotopov's avatar
Yuri Konotopov committed
6 7 8 9
with some GNOME Shell integration helper (`NPAPI plugin`_ or `Browser extension`_)
allows users to install, upgrade and enable/disable their own Shell Extensions.
All operations with the Shell are done through a special helper which proxies
over to the Shell by DBus.
Jasper St. Pierre's avatar
Jasper St. Pierre committed
10 11 12 13

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

Yuri Konotopov's avatar
Yuri Konotopov committed
14 15
.. _NPAPI plugin: http://git.gnome.org/browse/gnome-shell/tree/browser-plugin
.. _Browser extension: https://git.gnome.org/browse/chrome-gnome-shell/
Jasper St. Pierre's avatar
Jasper St. Pierre committed
16

17 18 19
Getting Started
---------------

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

Yuri Konotopov's avatar
Yuri Konotopov committed
22
  $ git clone https://git.gnome.org/browse/extensions-web
Yuri Konotopov's avatar
Yuri Konotopov committed
23
  $ cd extensions-web
Yuri Konotopov's avatar
Yuri Konotopov committed
24
  $ virtualenv --system-site-packages ./venv
25

26 27
I use `--system-site-packages` because we require Xapian, which doesn't have
its Python bindings in PyPI.
Yuri Konotopov's avatar
Yuri Konotopov committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
::

  $ . ./venv/bin/activate
  $ pip install -r ../requirements.txt
  $ python manage.py syncdb

You should be asked to create superuser account. Provide some login and password.
::

  $ python manage.py migrate

After above steps your database should be initialized and almost ready to run.
You should manualy specify your site's domain with SQL update::

  UPDATE `django_site`
  SET `domain` = 'your.domain.name',
      `name` = 'your.domain.name'
  WHERE `django_site`.`id` = 1;

Create file "local_settings.py" with line "Debug = True". Then start your website:
::

  $ python manage.py runserver
51

Yuri Konotopov's avatar
Yuri Konotopov committed
52
Log in using superuser account. You should be able to upload and review extensions.
53 54 55 56

.. _virtualenv: http://www.virtualenv.org/
.. _pip: http://www.pip-installer.org/

57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
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
72 73 74 75 76 77
  $ 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
78
  $ chmod 600 extensions.gnome.org.key
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

  # 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
101 102 103 104 105
Requirements
------------

  * django_
  * django-autoslug_
106
  * Pygments_
107
  * django-registration_
108
  * xapian_
Yuri Konotopov's avatar
Yuri Konotopov committed
109
  * pillow_
Jasper St. Pierre's avatar
Jasper St. Pierre committed
110 111 112

.. _django: http://www.djangoproject.com/
.. _django-autoslug: http://packages.python.org/django-autoslug/
113
.. _Pygments: http://www.pygments.org/
114
.. _south: http://south.aeracode.org/
115
.. _django-registration: http://pypi.python.org/pypi/django-registration
116
.. _xapian: http://www.xapian.org/
Yuri Konotopov's avatar
Yuri Konotopov committed
117
.. _pillow: https://github.com/python-pillow/Pillow