Skip to content

Commit 81f139f

Browse files
author
crondog
committed
Merge remote-tracking branch 'upstream/master' into changes
2 parents f376a9d + 80115f4 commit 81f139f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+3036
-1858
lines changed

.htaccess

Lines changed: 78 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -37,45 +37,90 @@ RewriteRule (.*) public/$1 [L]
3737

3838
# Default expires header if none specified (stay in browser cache for 7 days)
3939
<IfModule mod_expires.c>
40-
ExpiresActive On
41-
ExpiresDefault A604800
42-
43-
ExpiresByType application/javascript "access plus 2 hours"
44-
ExpiresByType application/x-javascript "access plus 2 hours"
45-
ExpiresByType text/javascript "access plus 2 hours"
46-
ExpiresByType text/x-javascript "access plus 2 hours"
47-
ExpiresByType text/css "access plus 2 hours"
48-
ExpiresByType image/gif "access plus 2 hours"
49-
ExpiresByType image/jpg "access plus 2 hours"
50-
ExpiresByType image/png "access plus 2 hours"
51-
ExpiresByType image/x-icon "access plus 2 hours"
52-
</IfModule>
5340

54-
# set compression
55-
<IfModule mod_header.c>
56-
<IfModule mod_deflate.c>
57-
# Insert filter
58-
SetOutputFilter DEFLATE
41+
ExpiresActive on
42+
ExpiresDefault "access plus 1 week"
43+
44+
# CSS
45+
ExpiresByType text/css "access plus 1 year"
46+
47+
# Data interchange
48+
ExpiresByType application/json "access plus 0 seconds"
49+
ExpiresByType application/xml "access plus 0 seconds"
50+
ExpiresByType text/xml "access plus 0 seconds"
51+
52+
# Favicon (cannot be renamed!)
53+
ExpiresByType image/x-icon "access plus 1 week"
5954

60-
# Netscape 4.x has some problems...
61-
BrowserMatch ^Mozilla/4 gzip-only-text/html
55+
# HTML components (HTCs)
56+
ExpiresByType text/x-component "access plus 1 month"
6257

63-
# Netscape 4.06-4.08 have some more problems
64-
BrowserMatch ^Mozilla/4\.0[678] no-gzip
58+
# HTML
59+
ExpiresByType text/html "access plus 0 seconds"
6560

66-
# MSIE masquerades as Netscape, but it is fine
67-
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
61+
# JavaScript
62+
ExpiresByType application/javascript "access plus 1 year"
6863

69-
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
70-
# the above regex won't work. You can use the following
71-
# workaround to get the desired effect:
72-
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
64+
# Manifest files
65+
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
66+
ExpiresByType text/cache-manifest "access plus 0 seconds"
7367

74-
# Don't compress images
75-
SetEnvIfNoCase Request_URI \
76-
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
68+
# Media
69+
ExpiresByType audio/ogg "access plus 1 month"
70+
ExpiresByType image/gif "access plus 1 month"
71+
ExpiresByType image/jpeg "access plus 1 month"
72+
ExpiresByType image/png "access plus 1 month"
73+
ExpiresByType video/mp4 "access plus 1 month"
74+
ExpiresByType video/ogg "access plus 1 month"
75+
ExpiresByType video/webm "access plus 1 month"
7776

78-
# Make sure proxies don't deliver the wrong content
79-
Header append Vary User-Agent env=!dont-vary
77+
# Web feeds
78+
ExpiresByType application/atom+xml "access plus 1 hour"
79+
ExpiresByType application/rss+xml "access plus 1 hour"
80+
81+
# Web fonts
82+
ExpiresByType application/font-woff "access plus 1 month"
83+
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
84+
ExpiresByType application/x-font-ttf "access plus 1 month"
85+
ExpiresByType font/opentype "access plus 1 month"
86+
ExpiresByType image/svg+xml "access plus 1 month"
87+
88+
</IfModule>
89+
90+
91+
<IfModule mod_deflate.c>
92+
93+
# Force compression for mangled headers.
94+
# http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
95+
<IfModule mod_setenvif.c>
96+
<IfModule mod_headers.c>
97+
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
98+
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
99+
</IfModule>
80100
</IfModule>
101+
102+
# Compress all output labeled with one of the following MIME-types
103+
# (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
104+
# and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines
105+
# as `AddOutputFilterByType` is still in the core directives).
106+
<IfModule mod_filter.c>
107+
AddOutputFilterByType DEFLATE application/atom+xml \
108+
application/javascript \
109+
application/json \
110+
application/rss+xml \
111+
application/vnd.ms-fontobject \
112+
application/x-font-ttf \
113+
application/x-web-app-manifest+json \
114+
application/xhtml+xml \
115+
application/xml \
116+
font/opentype \
117+
image/svg+xml \
118+
image/x-icon \
119+
text/css \
120+
text/html \
121+
text/plain \
122+
text/x-component \
123+
text/xml
124+
</IfModule>
125+
81126
</IfModule>

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ selfoss
44
Copyright (c) 2013 Tobias Zeising, tobias.zeising@aditu.de
55
http://selfoss.aditu.de
66
Licensed under the GPLv3 license
7-
Version 2.7-SNAPSHOT
7+
Version 2.8-SNAPSHOT
88

99

1010
INSTALLATION
1111
------------
1212

1313
1. Upload all files of this folder (IMPORTANT: also upload the invisible .htaccess files)
1414
2. Make the directories data/cache, data/favicons, data/logs, data/thumbnails, data/sqlite and public/ writeable
15-
3. Insert database access data in config.ini (see below -- you have not to change anything if you would like to use sqlite)
15+
3. Insert database access data in config.ini (see below -- you don't have to change anything if you want to use sqlite)
1616
3. You don't have to install the database, it will be created automatically
1717
4. Create cronjob for updating feeds and point it to http://yourselfossurl.com/update via wget or curl. You can also execute the update.php from commandline.
1818

@@ -50,7 +50,19 @@ Visit the page http://yourselfossurl.com/opml for importing your OPML File. If y
5050
CHANGELOG
5151
---------
5252

53-
Version 2.7-SNAPSHOT
53+
Version 2.8-SNAPSHOT
54+
* new Polish translation (thanks a lot to Piotr Dymacz)
55+
* improved Expires section and Compression in .htaccess (thanks a lot to S Anand)
56+
* make api item listing, tags and sources stats accessible for non loggedin users in public mode
57+
* update fat free php framework version 3.0.8
58+
* new configuration parameter for default readability api key
59+
* new configuration parameter for allowing unauthorized access for the update job
60+
* new delicious support (thanks a lot to bbeardsley)
61+
* support ssl proxy (thanks a lot to zajad)
62+
* new readability support (thanks a lot to hayk)
63+
* pass original url to external sites except for opening the anonymized url (thanks a lot to bbeardsley)
64+
65+
Version 2.7
5466
* new spout for instapaper (thanks a lot to janeczku)
5567
* new Hungarian translation (thanks a lot to Sancho)
5668
* fix keyboard shortcut on some browsers
@@ -59,6 +71,17 @@ Version 2.7-SNAPSHOT
5971
* fix bug on removing search terms (thanks a lot to ochristi)
6072
* translation for login page (thanks a lot to jicho)
6173
* new japanese language file (thanks a lot to wowo)
74+
* new shortcuts (thanks a lot to jicho)
75+
* fix issues with refreshing the items list and slow ajax requests (thanks a lot to Sean Rand)
76+
* don't leave behind sp-container divs when refreshing the tags (thanks a lot to Sean Rand)
77+
* clean up orphaned items of deleted sources (thanks a lot to Sean Rand)
78+
* update fat free php framework to newest versoin 3.0.6
79+
* only allow update for localhost or loggedin users (thanks a lot to Tiouss)
80+
* added Facebook page feed (thanks a lot to Thomas Muguet)
81+
* fix memory bug on icon generation (thanks a lot to Matthieu Codron)
82+
* new opml export (thanks a lot to Sean Rand)
83+
* new norwegian translation (thanks a lot to Kjetil Elde)
84+
* set default title if no one was given by the feed
6285

6386
Version 2.6
6487
* fixed OPML import for other formats (thanks a lot to Remy Gardette)

_docs/website/favicon.ico

1.12 KB
Binary file not shown.

_docs/website/feed.php

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,20 @@
55
$username = "ssilence";
66
$repo_name = "selfoss";
77

8+
// use cache?
89
$cacheFile = "rss.cache";
9-
if(file_exists($cacheFile) && (time() - filemtime($cacheFile) < 3600)) {
10-
header("Content-Type: text/xml");
11-
echo file_get_contents($cacheFile);
12-
return;
10+
if(!file_exists($cacheFile))
11+
touch($cacheFile);
12+
$maxTimestampValidity = 5400; // 1.5 hours
13+
$cacheFileContent = file_get_contents($cacheFile);
14+
if(strlen($cacheFileContent)>0) {
15+
$cacheFileContent = json_decode($cacheFileContent, true);
16+
if($cacheFileContent['timestamp'] + $maxTimestampValidity < time()) {
17+
unlink($cacheFile);
18+
} else {
19+
header("Content-Type: application/xml;");
20+
die($cacheFileContent['feed']);
21+
}
1322
}
1423

1524
function status_ok($curl) {
@@ -22,13 +31,14 @@ function status_ok($curl) {
2231

2332
$curl = curl_init();
2433
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
34+
curl_setopt($curl, CURLOPT_USERAGENT, 'selfoss.aditu.de/feed.php (tobias.zeising@aditu.de)');
2535

2636
curl_setopt($curl, CURLOPT_URL, $repo_url);
2737
$response = curl_exec($curl);
2838

2939
if(!status_ok($curl)) {
3040
header("HTTP/1.1 404 Not Found");
31-
exit("Repository doesn't exist or is private.");
41+
exit("Repository doesn't exist or is private." . $response);
3242
}
3343

3444
$repo = json_decode($response, true);
@@ -102,6 +112,10 @@ function escape(&$var) {
102112
$content = ob_get_contents();
103113
ob_end_clean();
104114
header("Content-Type: text/xml");
105-
file_put_contents($cacheFile, $content);
115+
$cacheFileContent = json_encode(array(
116+
"timestamp" => time(),
117+
"feed" => $content
118+
));
119+
file_put_contents($cacheFile, $cacheFileContent);
106120
echo $content;
107121
?>

_docs/website/index.html

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h1 id="header-name"><span>selfoss</span></h1>
2828
<li class="documentation">documentation</li>
2929
<li class="about">about</li>
3030
<li class="forum"><a href="/forum">forum</a></li>
31-
<li class="download"><a href="selfoss-2.6.zip">download</a></li>
31+
<li class="download"><a href="selfoss-2.7.zip">download</a></li>
3232
</ul>
3333

3434
<a id="header-fork" href="https://github.com/SSilence/selfoss"></a>
@@ -37,7 +37,7 @@ <h1 id="header-name"><span>selfoss</span></h1>
3737

3838
<div id="header-just-updated"></div>
3939

40-
<a id="header-download" href="selfoss-2.6.zip"><span>download selfoss 2.6</span></a>
40+
<a id="header-download" href="selfoss-2.7.zip"><span>download selfoss 2.7</span></a>
4141

4242
<a id="header-donate" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LR67F3T9DMSC8"><span>donate</span></a>
4343

@@ -265,6 +265,14 @@ <h2>Configuration</h2>
265265
<td class="documentation-first-column">use_system_font</td>
266266
<td>set use_system_font=1 if you have problems with special characters. Then instead of Open Sans the font Arial will be used.</td>
267267
</tr>
268+
<tr>
269+
<td class="documentation-first-column">readability</td>
270+
<td>default API key for all feeds fetched by readability spout. You can also enter the readability API key in the spout parameters for every single feed.</td>
271+
</tr>
272+
<tr>
273+
<td class="documentation-first-column">allow_public_update_access</td>
274+
<td>set allow_public_update_access=1 for allowing public access for /update (anybody can access and start the update job).</td>
275+
</tr>
268276
</table>
269277
</div>
270278

@@ -329,6 +337,10 @@ <h2>Shortcuts</h2>
329337
<td class="documentation-first-column">v</td>
330338
<td>open url of current entry in new tab/window</td>
331339
</tr>
340+
<tr>
341+
<td class="documentation-first-column">Shift + v</td>
342+
<td>open url of current entry in new tab/window and mark read</td>
343+
</tr>
332344
<tr>
333345
<td class="documentation-first-column">Ctrl + m</td>
334346
<td>mark all as read</td>
@@ -339,7 +351,23 @@ <h2>Shortcuts</h2>
339351
</tr>
340352
<tr>
341353
<td class="documentation-first-column">o</td>
342-
<td>open current item</td>
354+
<td>open / close current item</td>
355+
</tr>
356+
<tr>
357+
<td class="documentation-first-column">shift + o</td>
358+
<td>close all open items</td>
359+
</tr>
360+
<tr>
361+
<td class="documentation-first-column">shift + n</td>
362+
<td>open newest items page</td>
363+
</tr>
364+
<tr>
365+
<td class="documentation-first-column">shift + u</td>
366+
<td>open unread items page</td>
367+
</tr>
368+
<tr>
369+
<td class="documentation-first-column">shift + s</td>
370+
<td>open starred items page</td>
343371
</tr>
344372
</table>
345373
</div>
@@ -490,7 +518,7 @@ <h2 id="about">About</h2>
490518
|
491519
<a href="http://www.aditu.de">About me</a>
492520
|
493-
<a href="http://blog.aditu.de">Blog</a>
521+
<a href="http://www.aditu.de//#filter=.blog">Blog</a>
494522
|
495523
logo by <a href="http://blog.artcore-illustrations.de/aicons/">ArtCore</a>
496524
</p>

controllers/Index.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,17 @@ public function logout() {
176176
* @return void
177177
*/
178178
public function update() {
179+
// only allow access for localhost and loggedin users
180+
if (\F3::get('allow_public_update_access')!=1
181+
&& $_SERVER['REMOTE_ADDR'] !== $_SERVER['SERVER_ADDR']
182+
&& $_SERVER['REMOTE_ADDR'] !== "127.0.0.1"
183+
&& \F3::get('auth')->isLoggedin() != 1)
184+
die("unallowed access");
185+
186+
// update feeds
179187
$loader = new \helpers\ContentLoader();
180188
$loader->update();
189+
181190
echo "finished";
182191
}
183192

0 commit comments

Comments
 (0)