Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
removed sync code as it's probably not going to happen ...
azivner22749f252b3c
diff --git a/config-sample.ini b/config-sample.iniindex 9b07d5da79..30e919f224 100644--- a/config-sample.ini+++ b/config-sample.ini@@ -18,8 +18,3 @@ certKeyPath=cert.keyusername=your_username# This is bcrypt password hash. You can use generate-password.py (in this directory) to hash your passwordpasswordHash=$2b$12$FHT8keXp3BGTfzAV/VnrkuLpkwN8Vpj5iIh4RwCbHTNWYSBI9hGAK--[Sync]-sync-server-url=https://localhost:57201-sync-server-username=syncuser-sync-server-password=password\ No newline at end of filediff --git a/src/sync.py b/src/sync.pydeleted file mode 100644index 186f02ad13..0000000000--- a/src/sync.py+++ /dev/null@@ -1,62 +0,0 @@-import binascii-import hashlib-import os--import configparser-import requests--config = configparser.ConfigParser()-config.read('config.ini')--syncServerUrl = config['Sync']['sync-server-url']-syncServerUsername = config['Sync']['sync-server-username']-syncServerPassword = config['Sync']['sync-server-password']--nonce = binascii.hexlify(bytearray(os.urandom(32)))--print('Nonce: ' + nonce)--authContent = syncServerUsername + ":" + hashlib.sha256(syncServerUsername + ":" + syncServerPassword).hexdigest() + ":" + nonce--print('Auth content: ' + authContent)--# SHA256(user + ":" + SHA256(user + ":" + password) + ":" + nonce) where SHA256 is a hex encoded value-auth = hashlib.sha256(authContent).hexdigest()--response = requests.post(syncServerUrl + "/login", json={- 'user': syncServerUsername,- 'nonce': nonce,- 'auth': auth,- 'protocol': '2'-}, verify=False)--# verify='/home/adam/.notecase/server.pem'--def printResp(resp):- print('Status: ' + str(resp.status_code))-- for key in response.headers:- print(key + ': ' + resp.headers[key])-- print('Body: ' + resp.content)--printResp(response)--session = response.headers['Auth']--response = requests.get(syncServerUrl + "/document/list", headers={- 'Auth': session-}, verify=False)--printResp(response)--response = requests.post(syncServerUrl + "/document/tree", headers={- 'Auth': session-},-json={- 'id': 1,- 'password': ''-},-verify=False)--printResp(response)