wrolpi/app/src/components/admin/ExtensionInstallSuggestion.js
lrnselfreliance 2c3300b8b0
Torrents over a fail-closed VPN (#1026)
Torrents reach the Internet only through a fail-closed VPN (WireGuard or
OpenVPN, any provider), so peers never see a WROLPi's own address.

- A network namespace (Pi/Debian) or the vpn container (Docker) with an
  nftables kill switch; NAT-PMP or fixed port forwarding.
- qBittorrent inside it, sandboxed; torrents kept in config/torrents/.
- Torrent download form, Torrents page, Share as torrent, nav warning, and
  VPN settings in both Controller UIs.
- Help docs: Torrents, and The VPN for Torrents.

QA'd on a Raspberry Pi with a real provider over WireGuard and OpenVPN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 14:26:24 -07:00

43 lines
1.8 KiB
JavaScript

import React from "react";
import {Link} from "react-router";
import {Button, Message} from "../ui";
import {useLocalStorage} from "../Common";
import {useExtensionInstalled} from "../../hooks/customHooks";
import {isExtensionSupportedBrowser} from "./browserDetect";
// Top-of-dashboard nudge for users who don't yet have the WROLPi browser
// extension installed (or installed but haven't added this WROLPi as a
// destination). Hidden once the user installs+configures, or dismisses it.
// Only shown on Chromium / Firefox — Safari and other browsers cannot run
// the extension.
//
// Detection is via a meta tag injected by the extension's content script.
// The extension only injects on configured destination origins, so seeing
// the marker here means "extension is installed AND knows about this WROLPi".
export function ExtensionInstallSuggestion() {
const installed = useExtensionInstalled();
const [dismissed, setDismissed] = useLocalStorage(
'wrolpi-extension-banner-dismissed', false,
);
// installed === null means "still checking" — render nothing rather
// than flashing the banner before the content-script race resolves.
// Also skip on browsers that cannot install the extension (e.g. Safari).
if (installed !== false || dismissed || !isExtensionSupportedBrowser()) return null;
return <Message
kind='info'
icon='puzzle piece'
title='Install the WROLPi browser extension'
onDismiss={() => setDismissed(true)}
>
<p>
Send pages, videos, and feeds to this WROLPi straight from any
tab. Open-source and not distributed via the official browser
stores.
</p>
<Button component={Link} to='/extension' role='primary' size='xs'>
Open install page
</Button>
</Message>;
}