diff --git a/app.py b/app.py index 92d2d2c..c1d3eaf 100644 --- a/app.py +++ b/app.py @@ -908,24 +908,24 @@ def delete_remote(tid): def test_remote(tid): + import tempfile, os as _os remote = _remote_name(tid) - # 1. Verbindung prüfen (Verzeichnis auflisten) + # 1. Verbindung prüfen r = _rclone('lsd', f'{remote}:', timeout=20) if r.returncode != 0: err = r.stderr.strip().splitlines()[-1] if r.stderr.strip() else 'Verbindung fehlgeschlagen' return False, f'Verbindung: {err}' - # 2. Schreibzugriff prüfen (Test-Datei schreiben und löschen) - test_file = f'{remote}:picopy_writetest_{int(time.time())}.tmp' - import tempfile, os as _os + # 2. Schreibzugriff prüfen: temporäres Verzeichnis + Datei, dann wieder löschen + test_dir = f'{remote}:.picopy_writetest' with tempfile.NamedTemporaryFile(mode='w', suffix='.tmp', delete=False) as tf: tf.write('PiCopy write test') tmp_path = tf.name try: - rw = _rclone('copyto', tmp_path, test_file, timeout=20) + rw = _rclone('copy', tmp_path, test_dir, timeout=20) if rw.returncode != 0: err = rw.stderr.strip().splitlines()[-1] if rw.stderr.strip() else 'Schreiben fehlgeschlagen' return False, f'Kein Schreibzugriff: {err}' - _rclone('deletefile', test_file, timeout=10) + _rclone('purge', test_dir, timeout=10) finally: try: _os.unlink(tmp_path) except Exception: pass @@ -2290,8 +2290,6 @@ async function saveAP(){ } // -- Upload-Ziele -------------------------------------------------------------- -const UT_ICONS={smb:'🖧',onedrive:'☁',drive:'📄',dropbox:'📦'}; -const UT_LABELS={smb:'SMB/NAS',onedrive:'OneDrive',drive:'Google Drive',dropbox:'Dropbox'}; let utTargets=[], _utConn={}; async function loadUTs(){utTargets=await api('/upload/targets');renderUTs();} diff --git a/version.txt b/version.txt index 64a736b..fff1fac 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.34 \ No newline at end of file +1.0.35 \ No newline at end of file