Skip to content

Commit

Permalink
Remove anonymizer support
Browse files Browse the repository at this point in the history
Initially implemented in #104,
these were mostly meant to strip the `Referer` header.
But we have long been specifying `rel="noreferer"` on links,
which achieved the same effect without going through a questionable
third-party website that usually messed up the viewed web page.

For better privacy, web browser extensions like NoScript or uBlock Origin
and Tor or a VPN provider are probably much better anyway.

Closes: #612
  • Loading branch information
jtojnar committed Sep 29, 2022
1 parent 36f1a9e commit 1b25717
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 42 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
- Search button is now always on the screen, avoiding the need to scroll to top to be able to use it. ([#1231](https://github.com/fossar/selfoss/issues/1231))
- Button for opening articles, tags, sources and filters in the sidebar, as well as the source and tag links in articles are now real links, allowing to open them in a new tab by middle-clicking them. ([#1216](https://github.com/fossar/selfoss/issues/1216), [#695](https://github.com/fossar/selfoss/issues/695))
- Configuration is no longer managed by F3 framework. ([#1261](https://github.com/fossar/selfoss/pull/1261))
- Removed `anonymizer` configuration option. ([#1358](https://github.com/fossar/selfoss/pull/1358))


## 2.182018-03-05
Expand Down
18 changes: 0 additions & 18 deletions assets/js/selfoss-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,24 +381,6 @@ var selfoss = {
},


/**
* anonymize links
*
* @return void
* @param parent element
*/
anonymize: function(parent) {
var anonymizer = selfoss.config.anonymizer;
if (anonymizer !== null) {
parent.querySelectorAll('a').forEach((link) => {
if (typeof link.getAttribute('href') !== 'undefined' && !link.getAttribute('href').startsWith(anonymizer)) {
link.setAttribute('href', anonymizer + link.getAttribute('href'));
}
});
}
},


/**
* Setup fancyBox image viewer
* @param content element
Expand Down
19 changes: 5 additions & 14 deletions assets/js/templates/Item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import { forceReload, makeEntriesLink, makeEntriesLinkLocation } from '../helper
import * as icons from '../icons';
import { LocalizationContext } from '../helpers/i18n';

function anonymize(url) {
return (selfoss.config.anonymizer ?? '') + url;
}

function stopPropagation(event) {
event.stopPropagation();
}
Expand Down Expand Up @@ -294,11 +290,6 @@ export default function Item({ currentTime, item, selected, expanded, setNavExpa
});
}
}

if (firstExpansion) {
// anonymize
selfoss.anonymize(contentBlock.current);
}
} else {
// No longer expanded.

Expand Down Expand Up @@ -392,7 +383,7 @@ export default function Item({ currentTime, item, selected, expanded, setNavExpa

{/* icon */}
<a
href={anonymize(item.link)}
href={item.link}
className="entry-icon"
tabIndex="-1"
rel="noreferrer"
Expand Down Expand Up @@ -451,7 +442,7 @@ export default function Item({ currentTime, item, selected, expanded, setNavExpa

{/* datetime */}
<a
href={anonymize(item.link)}
href={item.link}
className={classNames({'entry-datetime': true, timestamped: relDate === null})}
target="_blank"
rel="noreferrer"
Expand All @@ -471,7 +462,7 @@ export default function Item({ currentTime, item, selected, expanded, setNavExpa
{/* thumbnail */}
{item.thumbnail && item.thumbnail.trim().length > 0 ?
<div className={classNames({'entry-thumbnail': true, 'entry-thumbnail-always-visible': selfoss.config.showThumbnails})}>
<a href={anonymize(item.link)} target="_blank" rel="noreferrer">
<a href={item.link} target="_blank" rel="noreferrer">
<img src={`thumbnails/${item.thumbnail}`} alt={item.strippedTitle} />
</a>
</div>
Expand All @@ -485,7 +476,7 @@ export default function Item({ currentTime, item, selected, expanded, setNavExpa
<ul aria-label={_('article_actions')}>
<li>
<a
href={anonymize(item.link)}
href={item.link}
className="entry-newwindow"
target="_blank"
rel="noreferrer"
Expand Down Expand Up @@ -540,7 +531,7 @@ export default function Item({ currentTime, item, selected, expanded, setNavExpa
}
<li>
<a
href={anonymize(item.link)}
href={item.link}
className="entry-newwindow"
target="_blank"
rel="noreferrer"
Expand Down
6 changes: 0 additions & 6 deletions docs/content/docs/administration/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,6 @@ set `0` or leave empty for auto detection (browser language) or use one of the f
* Ukrainian: `uk`
</div>

### `anonymizer`
<div class="config-option">

Set here your anonymizer service url. e.g.: `anonymizer=https://anonym.to/?`
</div>

### `allow_public_update_access`
<div class="config-option">

Expand Down
1 change: 0 additions & 1 deletion src/controllers/About.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public function about() {
'apiversion' => SELFOSS_API_VERSION,
'configuration' => [
'homepage' => $this->configuration->homepage ? $this->configuration->homepage : 'newest', // string
'anonymizer' => $this->configuration->anonymizer, // ?string
'share' => $this->configuration->share, // string
'wallabag' => $wallabag, // ?array
'wordpress' => $this->configuration->wordpress, // ?string
Expand Down
3 changes: 0 additions & 3 deletions src/helpers/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ class Configuration {
/** @var bool */
public $openInBackgroundTab = false;

/** @var ?string */
public $anonymizer = null;

/** @var string */
public $share = 'atfpde';

Expand Down

0 comments on commit 1b25717

Please # to comment.