From e35cf0efa55fe8f342003e6210eb380ac034f20f Mon Sep 17 00:00:00 2001 From: Maks Snegov Date: Tue, 25 Aug 2020 21:16:05 +0300 Subject: [PATCH] Fix incorrect schema issue --- README.md | 4 +--- docker-compose.example.yml | 1 - seafile_client/client.py | 4 ++-- start.py | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2bdbe24..9b00bef 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ services: environment: - LIBRARY_ID= - SERVER_HOST= - - SERVER_PORT= - USERNAME= - PASSWORD= - DATA_DIR= @@ -26,8 +25,7 @@ services: ## Environment variables: - `LIBRARY_ID=` ID of library to sync; multiple libraries could be separated by colon `:` - - `SERVER_HOST=` Hostname of your seafile server, eg: seafile.example.com - - `SERVER_PORT=` Which port the server is hosted on: usually 443 (https) or 80 (http) + - `SERVER_HOST=` Hostname of your seafile server, eg: seafile.example.com. If you're using non-standart port, specify it here, eg: seafile.example.com:8080 - `USERNAME=` Seafile account username - `PASSWORD=` Seafile account password - `DATA_DIR=` The path where to put the files diff --git a/docker-compose.example.yml b/docker-compose.example.yml index a30c702..c4ba9db 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -7,7 +7,6 @@ services: environment: - LIBRARY_ID= - SERVER_HOST= - - SERVER_PORT= - USERNAME= - PASSWORD= - DATA_DIR= diff --git a/seafile_client/client.py b/seafile_client/client.py index 59095c7..4555429 100644 --- a/seafile_client/client.py +++ b/seafile_client/client.py @@ -14,8 +14,8 @@ logging.basicConfig(format="%(asctime)s %(message)s", class SeafileClient: - def __init__(self, host: str, port: int, user: str, passwd: str): - self.url = f"https://{host}:{port}" + def __init__(self, host: str, user: str, passwd: str): + self.url = requests.get(f"http://{host}").url self.user = user self.password = passwd self.__token = None diff --git a/start.py b/start.py index a748175..93a1739 100755 --- a/start.py +++ b/start.py @@ -15,7 +15,6 @@ def main(): parser.add_argument("--gid", default=os.getenv("SEAFILE_GID"), type=int) parser.add_argument("--data-dir", default=os.getenv("DATA_DIR")) parser.add_argument("--host", default=os.getenv("SERVER_HOST")) - parser.add_argument("--port", default=os.getenv("SERVER_PORT"), type=int) parser.add_argument("--username", default=os.getenv("USERNAME")) parser.add_argument("--password", default=os.getenv("PASSWORD")) parser.add_argument("--libs", default=os.getenv("LIBRARY_ID")) @@ -24,7 +23,7 @@ def main(): setup_uid(args.uid, args.gid) start_seaf_daemon() create_dir(args.data_dir) - client = SeafileClient(args.host, args.port, args.username, args.password) + client = SeafileClient(args.host, args.username, args.password) for lib_id in args.libs.split(sep=":"): client.sync_lib(lib_id, args.data_dir) client.watch_status()