README.md 6.42 KB
Newer Older
1 2
Ethertoff
=========
3

eric's avatar
eric committed
4 5 6 7 8 9
![](http://osp.kitchen/api/osp.tools.ethertoff/raw/iceberg/ethertoff-write-read-print.gif)

Ethertoff is a simple collaborative web platform, much resembling a wiki but featuring
realtime editing thanks to Etherpad. Its output is constructed with equal love for print
and web.

10 11 12 13 14 15
> Just a question: I thought it was ethertopff and not ethertoff but I don't
> remember why. What is the actual name?
>
> Well someone misspelled ethertopdf as ethertopf which sounds like römertopf
> and than somebody else understood ethertoff like chokotoff and chokotoff
> being Bruxellois I thought it might be the best of all these references
OSP's avatar
OSP committed
16

17 18

Ethertoff has been initially developed for the OSP 2013 Summerschool bearing the name ‘Relearn’.
OSP's avatar
OSP committed
19 20 21

<http://relearn.be/>

22
Ethertoff is structured as a wiki where each page constitutes an Etherpad.
23

24
The pad is available to logged in users (‘write-mode’).
25 26
The text of the pad is available to everyone (‘read-mode’).

27
Ethertoff is a shell for an Etherpad installation hosted on the same domain.
28 29 30 31 32 33 34
This integration is based on Sofian Benaissa’s bridge between Django and Etherpad,
originally created for THINK WE MUST/CON-VOCATION a performance during Promiscuous
Infrastructures entrelacées, an exhibition by the collective Artivistic at SKOL.

-  <https://github.com/sfyn/django-etherpad-lite>
-  <http://www.riotnrrd.info/tech/etherpad-lite-performances-ongoing-saga>
-  <http://www.thinkwemust.org/?page_id=6>
35 36 37 38 39

- - -

## Installation instructions

svilayphiou's avatar
svilayphiou committed
40
Requires Django 2.0 and python 3, pip.
41 42 43 44 45 46 47 48
First create and install a virtual environment in the repository. 

    cd tools.ethertoff 
    sudo apt install virtualenv
    virtualenv -p python3 venv
    source venv/bin/activate

Then:
gijs's avatar
gijs committed
49

svilayphiou's avatar
svilayphiou committed
50
    sudo aptitude install python-dev libxml2-dev libxslt-dev libz-dev
svilayphiou's avatar
svilayphiou committed
51
    pip install -r requirements.txt
52
    pip install https://github.com/devjones/PyEtherpadLite/archive/master.zip
stdin's avatar
stdin committed
53
    pip install https://github.com/aleray/markdown-figures/archive/master.zip
54

55
    cd ethertoff
eric's avatar
eric committed
56
    cp local_settings.py.example local_settings.py
svilayphiou's avatar
svilayphiou committed
57
    # OPTIONAL: Change database details in local_settings.py
eric's avatar
eric committed
58
    cd ..
59
    python manage.py migrate 
60

61 62 63 64 65 66 67
Change the info of your domain name and website name in the Sites section on
<http://localhost:8000/admin>. **Do not add "http://" in your domain name,
otherwise the Re-index function won't work.**

### If you have the error "Site matching query does not exist"

Open the python shell
68 69 70

    python manage.py shell

71
And then do the following (replace the "domain" and "name" with your own info):
72 73 74 75

    from django.contrib.sites.models import Site
    site = Site.objects.create(domain='example.com', name='example.com')
    site.save()
76
    
77 78 79


## Install Etherpad-lite
80 81 82 83 84
    
    mkdir -p ~/src
    cd ~/src
    git clone https://github.com/ether/etherpad-lite.git
    
85
## --> install node js
svilayphiou's avatar
svilayphiou committed
86 87 88 89
Install Make:

    sudo aptitude install build-essentials

90
Linux Binaries (.tar.gz) from http://nodejs.org/download/
ludi's avatar
ludi committed
91

92 93 94 95


## Launch Etherpad-lite

96
run Etherpad with:
97 98 99
    
    ~/src/etherpad-lite/bin/run.sh
    
100
Your Etherpad is running at http://127.0.0.1:9001/
101
    
svilayphiou's avatar
merge  
svilayphiou committed
102
In Etherpad’s folder, you will find a file called APIKEY.txt
103
you need its contents later 
104 105 106 107 108



## Launch Ethertoff

109
Run the server:
110
    python manage.py runserver
111 112 113 114 115

visit the admin at: http://127.0.0.1:800/admin/
you can login with the superuser you created when you synced the database
Now, on the Django admin:

116
    Etherpadlite > Servers > Add
117 118 119 120
        # if local
        url: http://127.0.0.1:9001/
        # if on a server
        url: http://domainname/ether/
121
        api_key: the contents of the file APIKEY.txt in Etherpad files
122 123 124 125

Go back to the admin home, and then add a new group:
    Auth > Groups > Add
    
126
Go back to the admin home, and then add the superuser (and all needed users) to the group you just created
127 128 129 130
    Auth > Users

Go back to the admin home, and then create an Etherpad Group based upon the group and the server you just created.
    Etherpadlite > Groups > Add
131
    
132
Now Ethertoff is served at http://127.0.0.1:8000/ locally, or on your domain name on a server.
133

134
You can set the site name, that appears on the header, in the ‘sites’ app in the admin.
135 136


137
# Extra challenge! Installing on a server.
138 139 140 141 142 143 144

Some extra challenges. Basically we can split it up like:

example.com /        -> django
            /ether/  -> etherpad
            /static/ -> django static files

145 146 147
To test if everything is working, you can use screen to run gunicorn and Etherpad scripts at the same time, and then use a daemon like Supervisor to run them in the background.


148 149 150

## MYSQL

151
    # pip install "distribute>0.6.24"
svilayphiou's avatar
svilayphiou committed
152
    sudo aptitude install default-libmysqlclient-dev python-dev
153
    pip install MySQL-python mysqlclient
154 155 156


## DJANGO
157 158 159 160 161 162 163 164 165
The django application runs through mod_wsgi (Apache) or gunicorn
(nginx), or whatever way you prefer to run your wsgi python apps.
You map it to the root of your domain.

For django, we need to set up some folder where the static files
are collected. You do this with the command: `python manage.py collectstatic`
This folder we then serve through nginx or apache, and map to the
folder /static/.

166 167 168 169
    sudo aptitude install nginx
    pip install gunicorn
    cd /etc/nginx/sites-available/
    # (edit nginx config file)
170
    sudo vim ethertoff.conf
171
    cd ../sites-enabled/
172 173
    sudo ln -s ../sites-available/ethertoff
    cd ethertoff_directory/
174 175 176 177 178 179 180 181 182
    # (edit gunicorn config file)
    vim run.sh 
    chmod +x run.sh
    sudo service nginx start
    # Run the server
    ./run.sh

To run the server in the background, use Supervisor daemon.

183 184


185
## ETHERPAD
186 187 188 189 190 191
Etherpad, finally, runs as its own server. You probably need to use
a supervisor such as supervisord to make sure it keeps running.
You will also need to set up a database, because its default database
is not intended for use on servers. Finally, you will need to reverse
proxy the Etherpad process from your main web server, mapping it to
a folder such as /ether/.
192

193 194


195 196 197 198 199
## SUPERVISOR
To run django and etherpad in the background.

    sudo aptitude install supervisor
    # Edit specific config file for each application in /etc/supervisor/conf.d/
svilayphiou's avatar
svilayphiou committed
200 201

### Example of config file
202 203 204 205 206 207 208 209 210 211 212 213 214

    [program:pads]
    directory = /absolute/path/to/etherpad-lite/bin/
    user = username
    command = /absolute/path/to/etherpad-lite/bin/run.sh
    stopwaitsecs=60

    stdout_logfile = /absolute/path/to/etherpad-lite/logfile.log
    stderr_logfile = /absolute/path/to/etherpad-lite/logfile.log

    # Then run the apps daemon
    supervisord
    supervisorctl start app_name