Skip to content

Instantly share code, notes, and snippets.

Avatar

Eser Gozcu EserGozcu

  • Sweden
View GitHub Profile
View finalpart.py
import requests
url_system_status = "http://127.0.0.1:8384/rest/system/config"
headers= {"X-API-Key" : "XXXXXXX"}
contents = open('config_edited.json', 'rb').read()
post_data = requests.post(url_system_status,headers=headers,data=contents)
View gist:c1a6428e41acf20d58b0761e250a6932
version 28
folders [{'id': '99ske-maske', 'label': '1', 'filesystemType': 'basic', 'path': 'R:\\1', 'type': 'readwrite', 'devices': [{'deviceID': 'KEDUFUO-', 'introducedBy': ''}, {'deviceID': 'KW23ASQ-', 'introducedBy': ''}], 'rescanIntervalS': 60, 'fsWatcherEnabled': False, 'fsWatcherDelayS': 10, 'ignorePerms': False, 'autoNormalize': True, 'minDiskFree': {'value': 1, 'unit': '%'}, 'versioning': {'type': '', 'params': {}}, 'copiers': 0, 'pullers': 0, 'hashers': 0, 'order': 'random', 'ignoreDelete': False, 'scanProgressIntervalS': 0, 'pullerPauseS': 0, 'maxConflicts': 10, 'disableSparseFiles': False, 'disableTempIndexes': False, 'paused': False, 'weakHashThresholdPct': 25, 'markerName': '.stfolder'}]
devices [{'deviceID': 'KEDUFUO', 'name': 'LAP1', 'addresses': ['dynamic'], 'compression': 'metadata', 'certName': '', 'introducer': False, 'skipIntroductionRemovals': False, 'introducedBy': '', 'paused': False, 'allowedNetworks': [], 'autoAcceptFolders': False}, {'deviceID': 'KW23ASQ', 'name': '', 'addresses': ['
View gist:3daa5da49eefe11bb052335f637df249
import requests #request library is to send HTTP requests
url_system_status = "http://127.0.0.1:8384/rest/system/config"
#according to the documentation of Syncthing,/rest/system/config exposes configuration details
headers= {"X-API-Key" : "XXXXXXXXXXX"}
"""
headers is for authentication. Syncthing REST API exposes the end points via API Key
API key can be found at Syncthing GUI --> Actions --> Settings
You can’t perform that action at this time.