1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
gLifestream -- INSTALL
Copyright (C) 2009-2015 Wojciech Polak
gLifestream requirements
========================
- Django 1.7 or later -- a Python Web framework (https://www.djangoproject.com/)
- A database supported by Django (e.g. MySQL, PostgreSQL).
- Universal Feed Parser (https://pypi.python.org/pypi/feedparser)
Optional (but recommended):
- Pillow -- Python Imaging Library
https://pypi.python.org/pypi/Pillow
- workerpool -- a multithreaded job distribution module
https://pypi.python.org/pypi/workerpool
- requests-oauthlib -- OAuthlib authentication support for Requests
https://pypi.python.org/pypi/requests-oauthlib
- python-markdown -- a text-to-HTML converter
http://pypi.python.org/pypi/Markdown/
- Beautiful Soup -- an HTML parser
https://pypi.python.org/pypi/beautifulsoup4
- Sphinx -- a free open-source SQL full-text search engine
http://www.sphinxsearch.com/
Optional:
- Facebook Python SDK
https://github.com/pythonforfacebook/facebook-sdk
- python-openid -- OpenID support for servers and consumers.
https://pypi.python.org/pypi/python-openid (Python 2.x)
https://pypi.python.org/pypi/python3-openid (Python 3.x)
Installation instructions
=========================
1. Change the current working directory into the `glifestream` directory.
2. Copy `settings-sample.py` to `settings.py` and edit your local site
configuration.
3. Run `python manage.py syncdb`
4. Run `python manage.py compilemessages` (if you have 'gettext' installed)
5. Run `./worker.py --init-files-dirs`
Make sure that `static/thumbs/*` and `static/upload` directories exist
and all have write permissions by your webserver.
Use `glifestream/worker.py` to automatically fetch external streams
(via cron), list available streams or remove old entries. See
`worker.py --help`.
The development/test server
---------------------------
Change the current working directory into the `glifestream` directory
and run the command `python manage.py runserver`. You will see
the following output:
Performing system checks...
System check identified no issues (0 silenced).
March 09, 2015 - 17:54:57
Django version 1.7.6, using settings 'glifestream.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Production server with mod_wsgi
-------------------------------
Apache configuration:
```
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /usr/local/django/glifestream/wsgi.py
Alias /static "/usr/local/django/glifestream/static"
Alias /admin_static "/usr/local/django/contrib/admin/media"
<Directory "/usr/local/django/glifestream/">
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript text/css text/html
</IfModule>
AllowOverride All
Options None
Order allow,deny
Allow from all
</Directory>
```
More detailed information is available at:
http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
See https://docs.djangoproject.com/en/dev/howto/deployment/
for usual Django applications deployment.
The search functionality via Sphinx
===================================
To use the search functionality in GLS via Sphinx, you must add the
following configuration to your `/etc/sphinx/sphinx.conf` (replace the
`DATABASE_*` values with the proper ones from your `settings.py`):
```
source glifestream
{
type = mysql
sql_host = DATABASE_HOST
sql_user = DATABASE_USER
sql_pass = DATABASE_PASSWORD
sql_db = DATABASE_NAME
sql_port = 3306
sql_query = \
SELECT stream_entry.id, stream_entry.title, stream_entry.content, \
UNIX_TIMESTAMP(stream_entry.date_published) AS date_published, \
stream_entry.friends_only, stream_service.public FROM stream_entry \
INNER JOIN stream_service ON stream_entry.service_id=stream_service.id \
WHERE stream_entry.active=1 AND stream_entry.draft=0
sql_attr_timestamp = date_published
sql_attr_bool = public
sql_attr_bool = friends_only
}
index glifestream
{
source = glifestream
path = /var/lib/sphinx/glifestream
docinfo = extern
charset_type = utf-8
html_strip = 1
}
```
Receive postings via e-mail
===========================
To allow for posts sent by e-mail, create a secret mail alias,
by extending `/etc/mail/aliases` file:
`
gls.secret.address: "|/usr/local/django/glifestream/worker.py --email2post"
`
|