feat: implement security, discovery, history, file transfer, web UI (P0-P3)
This commit is contained in:
+16
-14
@@ -8,7 +8,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
REPO="https://git.dracodev.net/Projets/clip-sync"
|
||||
VERSION="${CLIP_SYNC_VERSION:-latest}"
|
||||
VERSION="${CLIP_SYNC_VERSION:-v0.2.0}"
|
||||
BINARY="clip-sync"
|
||||
INSTALL_DIR="${HOME}/.local/bin"
|
||||
CONFIG_DIR="${HOME}/.config/clip-sync"
|
||||
@@ -46,14 +46,7 @@ detect_platform() {
|
||||
download_binary() {
|
||||
local platform="$1"
|
||||
local bin_name="${BINARY}-${platform}"
|
||||
local download_url
|
||||
|
||||
if [ "$VERSION" = "latest" ]; then
|
||||
# Try latest release
|
||||
download_url="${REPO}/releases/download/latest/${bin_name}"
|
||||
else
|
||||
download_url="${REPO}/releases/download/${VERSION}/${bin_name}"
|
||||
fi
|
||||
local download_url="${REPO}/releases/download/${VERSION}/${bin_name}"
|
||||
|
||||
# Windows binary has .exe extension
|
||||
if [[ "$platform" == windows-* ]]; then
|
||||
@@ -61,16 +54,18 @@ download_binary() {
|
||||
download_url="${download_url}.exe"
|
||||
fi
|
||||
|
||||
local out_path="${INSTALL_DIR}/${bin_name}"
|
||||
|
||||
echo "clip-sync: downloading ${download_url}..."
|
||||
|
||||
|
||||
if command -v curl &>/dev/null; then
|
||||
curl -fSL --progress-bar -o "${INSTALL_DIR}/${BINARY}" "${download_url}" || {
|
||||
curl -fSL --progress-bar -o "${out_path}" "${download_url}" || {
|
||||
echo "clip-sync: download failed. Try building from source:"
|
||||
echo " git clone ${REPO} && cd clip-sync && make install"
|
||||
exit 1
|
||||
}
|
||||
elif command -v wget &>/dev/null; then
|
||||
wget -q --show-progress -O "${INSTALL_DIR}/${BINARY}" "${download_url}" || {
|
||||
wget -q --show-progress -O "${out_path}" "${download_url}" || {
|
||||
echo "clip-sync: download failed. Try building from source:"
|
||||
echo " git clone ${REPO} && cd clip-sync && make install"
|
||||
exit 1
|
||||
@@ -80,8 +75,8 @@ download_binary() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
chmod +x "${INSTALL_DIR}/${BINARY}"
|
||||
echo "clip-sync: installed to ${INSTALL_DIR}/${BINARY}"
|
||||
chmod +x "${out_path}"
|
||||
echo "clip-sync: installed to ${out_path}"
|
||||
}
|
||||
|
||||
# ── Create default config ──────────────────────────────────────────────
|
||||
@@ -100,10 +95,17 @@ create_config() {
|
||||
# Environment overrides:
|
||||
# CLIP_SYNC_PORT=9137 override daemon.port
|
||||
# CLIP_SYNC_POLL_MS=500 override daemon.poll_interval_ms
|
||||
# CLIP_SYNC_KEY=... override security.shared_key
|
||||
|
||||
[daemon]
|
||||
port = 9137
|
||||
poll_interval_ms = 500
|
||||
# discovery = true # enable mDNS auto-discovery of peers
|
||||
# notify = true # enable desktop notifications
|
||||
# receive_files = true # accept incoming file transfers
|
||||
|
||||
[security]
|
||||
# shared_key = "..." # generate with: clip-sync --generate-key
|
||||
|
||||
# Add your peers here:
|
||||
# [[peers]]
|
||||
|
||||
Reference in New Issue
Block a user