140 lines
6.8 KiB
HTML
140 lines
6.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>clip-sync — documentation</title>
|
|
<style>
|
|
:root {
|
|
--bg: #ffffff; --fg: #1a202c; --muted: #64748b;
|
|
--accent: #0969da; --code-bg: #f6f8fa; --border: #d0d7de;
|
|
}
|
|
* { box-sizing: border-box; }
|
|
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--fg); line-height: 1.6; }
|
|
header { background: #0d1117; color: #fff; padding: 3rem 1rem; }
|
|
header .wrap, main, footer { max-width: 860px; margin: 0 auto; padding: 0 1rem; }
|
|
header h1 { margin: 0 0 .5rem; font-size: 2rem; }
|
|
header p { margin: 0; color: #8b949e; }
|
|
main { padding-bottom: 3rem; }
|
|
h2 { border-bottom: 1px solid var(--border); padding-bottom: .3rem; margin-top: 2.5rem; }
|
|
code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px; padding: .1rem .35rem; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; }
|
|
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: .8rem 1rem; overflow-x: auto; }
|
|
pre code { background: none; border: none; padding: 0; }
|
|
table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
|
|
th, td { border: 1px solid var(--border); padding: .4rem .6rem; text-align: left; font-size: .92rem; }
|
|
th { background: var(--code-bg); }
|
|
.badge { display: inline-block; background: var(--accent); color: #fff; border-radius: 4px; padding: .1rem .5rem; font-size: .75rem; font-weight: 600; }
|
|
footer { color: var(--muted); font-size: .85rem; padding: 1rem; border-top: 1px solid var(--border); }
|
|
a { color: var(--accent); }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="wrap">
|
|
<h1>clip-sync</h1>
|
|
<p>Daemon de synchronisation bidirectionnelle du presse-papiers sur réseau local. Copier sur une machine → coller sur une autre.</p>
|
|
</div>
|
|
</header>
|
|
|
|
<main>
|
|
|
|
<h2>Installation en une ligne</h2>
|
|
<p>Rapide, sans dépendance à compiler : un binaire unique téléchargé puis exécutable.</p>
|
|
|
|
<h3>Linux / macOS</h3>
|
|
<pre><code>curl -fsSL https://git.dracodev.net/Projets/clip-sync/raw/branch/main/install.sh | bash</code></pre>
|
|
|
|
<h3>Windows (PowerShell)</h3>
|
|
<pre><code>irm https://git.dracodev.net/Projets/clip-sync/raw/branch/main/install.ps1 | iex</code></pre>
|
|
|
|
<p>Le script détecte OS + architecture, télécharge le binaire, l'installe dans
|
|
votre répertoire utilisateur et crée une configuration par défaut. Pour choisir
|
|
une version précise : <code>CLIP_SYNC_VERSION=v0.2.0</code> (Linux/macOS) ou
|
|
<code>$env:CLIP_SYNC_VERSION='v0.2.0'</code> (Windows).</p>
|
|
|
|
<h2>Démarrage rapide</h2>
|
|
<ol>
|
|
<li>Éditez <code>~/.config/clip-sync/peers.toml</code> et ajoutez vos machines (voir ci-dessous).</li>
|
|
<li>Lancez <code>clip-sync</code> sur chaque machine.</li>
|
|
<li>Copiez du texte ou une image (Ctrl+C), collez sur l'autre machine (Ctrl+V).</li>
|
|
</ol>
|
|
|
|
<h3>Configuration minimale</h3>
|
|
<pre><code># ~/.config/clip-sync/peers.toml
|
|
[daemon]
|
|
port = 9137
|
|
poll_interval_ms = 500
|
|
|
|
[[peers]]
|
|
name = "portable"
|
|
addr = "192.168.1.20:9137"</code></pre>
|
|
|
|
<p>Sur l'autre machine, inversez l'adresse. Vous pouvez aussi activer la
|
|
découverte automatique (<code>discovery = true</code>) pour ne plus configurer
|
|
d'adresse du tout.</p>
|
|
|
|
<h2>Commandes</h2>
|
|
<table>
|
|
<tr><th>Commande</th><th>Description</th></tr>
|
|
<tr><td><code>clip-sync</code></td><td>Lancer le daemon</td></tr>
|
|
<tr><td><code>clip-sync --config <path></code></td><td>Config personnalisée</td></tr>
|
|
<tr><td><code>clip-sync --version</code></td><td>Afficher la version</td></tr>
|
|
<tr><td><code>clip-sync history</code></td><td>Afficher l'historique local</td></tr>
|
|
<tr><td><code>clip-sync --one-shot [text]</code></td><td>Envoyer le presse-papiers (ou texte) une fois</td></tr>
|
|
<tr><td><code>clip-sync send-file <path></code></td><td>Envoyer un fichier aux pairs</td></tr>
|
|
<tr><td><code>clip-sync --generate-key</code></td><td>Générer une clé partagée</td></tr>
|
|
<tr><td><code>clip-sync --generate-cert</code></td><td>Générer un certificat TLS auto-signé</td></tr>
|
|
</table>
|
|
|
|
<h2>Configuration</h2>
|
|
<table>
|
|
<tr><th>Clé</th><th>Défaut</th><th>Description</th></tr>
|
|
<tr><td><code>daemon.port</code></td><td><code>9137</code></td><td>Port d'écoute HTTP(S)</td></tr>
|
|
<tr><td><code>daemon.poll_interval_ms</code></td><td><code>500</code></td><td>Intervalle de scrutation (ms)</td></tr>
|
|
<tr><td><code>daemon.max_body_bytes</code></td><td><code>10485760</code></td><td>Taille max d'une requête</td></tr>
|
|
<tr><td><code>daemon.history_size</code></td><td><code>50</code></td><td>Entrées d'historique conservées</td></tr>
|
|
<tr><td><code>daemon.discovery</code></td><td><code>false</code></td><td>Découverte mDNS des pairs</td></tr>
|
|
<tr><td><code>daemon.notify</code></td><td><code>false</code></td><td>Notifications desktop</td></tr>
|
|
<tr><td><code>daemon.sync_images</code></td><td><code>false</code></td><td>Sync d'images (PNG)</td></tr>
|
|
<tr><td><code>daemon.receive_files</code></td><td><code>false</code></td><td>Accepter les transferts de fichiers</td></tr>
|
|
<tr><td><code>security.shared_key</code></td><td>—</td><td>Clé partagée (Bearer token)</td></tr>
|
|
<tr><td><code>security.allowed_origins</code></td><td>—</td><td>Hôtes autorisés</td></tr>
|
|
<tr><td><code>security.tls</code></td><td><code>false</code></td><td>Chiffrement TLS entre pairs</td></tr>
|
|
</table>
|
|
|
|
<p>Variables d'environnement : <code>CLIP_SYNC_PORT</code>,
|
|
<code>CLIP_SYNC_POLL_MS</code>, <code>CLIP_SYNC_KEY</code>,
|
|
<code>CLIP_SYNC_MAX_BODY_BYTES</code>.</p>
|
|
|
|
<h2>Sécurité</h2>
|
|
<p>Sur un réseau partagé, activez au minimum une clé partagée :</p>
|
|
<pre><code>clip-sync --generate-key # copier la clé sur toutes les machines</code></pre>
|
|
<pre><code>[security]
|
|
shared_key = "LA_CLÉ_GÉNÉRÉE"</code></pre>
|
|
<p>Pour chiffrer le trafic, générez un certificat (<code>clip-sync --generate-cert</code>),
|
|
copiez <code>cert.pem</code>/<code>key.pem</code> sur chaque machine, puis
|
|
<code>tls = true</code> et <code>insecure_skip_verify = true</code>.</p>
|
|
|
|
<h2>Fonctionnalités</h2>
|
|
<ul>
|
|
<li>Sync bidirectionnelle (texte + images PNG)</li>
|
|
<li>Anti-boucle (hash SHA-256 + timestamp + origine)</li>
|
|
<li>Clé partagée, validation d'origine, TLS optionnel</li>
|
|
<li>Découverte mDNS, historique, transfert de fichiers</li>
|
|
<li>Interface web locale : <code>http://localhost:9137/</code></li>
|
|
<li>Linux (X11/Wayland), Windows, macOS — binaire unique, zéro runtime</li>
|
|
</ul>
|
|
|
|
<h2>Service au démarrage</h2>
|
|
<p><strong>Linux (systemd)</strong> : voir le fichier <code>clip-sync.service</code>.
|
|
<strong>Windows</strong> : utiliser NSSM. <strong>macOS</strong> : un LaunchAgent
|
|
(voir le README pour les détails complets).</p>
|
|
|
|
</main>
|
|
|
|
<footer>
|
|
<div class="wrap">clip-sync — MIT · <a href="https://git.dracodev.net/Projets/clip-sync">Code source</a></div>
|
|
</footer>
|
|
</body>
|
|
</html>
|