Fix incorrect schema issue

This commit is contained in:
Maks Snegov 2020-08-25 21:16:05 +03:00
parent ebf7574bde
commit e35cf0efa5
4 changed files with 4 additions and 8 deletions

View File

@ -14,7 +14,6 @@ services:
environment: environment:
- LIBRARY_ID=<your-library-id-here> - LIBRARY_ID=<your-library-id-here>
- SERVER_HOST=<server-host> - SERVER_HOST=<server-host>
- SERVER_PORT=<server-port>
- USERNAME=<username> - USERNAME=<username>
- PASSWORD=<password> - PASSWORD=<password>
- DATA_DIR=<directory-path-to-sync> - DATA_DIR=<directory-path-to-sync>
@ -26,8 +25,7 @@ services:
## Environment variables: ## Environment variables:
- `LIBRARY_ID=<your-library-id-here>` ID of library to sync; multiple libraries could be separated by colon `:` - `LIBRARY_ID=<your-library-id-here>` ID of library to sync; multiple libraries could be separated by colon `:`
- `SERVER_HOST=<server-host>` Hostname of your seafile server, eg: seafile.example.com - `SERVER_HOST=<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
- `SERVER_PORT=<server-port>` Which port the server is hosted on: usually 443 (https) or 80 (http)
- `USERNAME=<username>` Seafile account username - `USERNAME=<username>` Seafile account username
- `PASSWORD=<password>` Seafile account password - `PASSWORD=<password>` Seafile account password
- `DATA_DIR=<directory-path-to-sync>` The path where to put the files - `DATA_DIR=<directory-path-to-sync>` The path where to put the files

View File

@ -7,7 +7,6 @@ services:
environment: environment:
- LIBRARY_ID=<your-library-id-here> - LIBRARY_ID=<your-library-id-here>
- SERVER_HOST=<server-host> - SERVER_HOST=<server-host>
- SERVER_PORT=<server-port>
- USERNAME=<username> - USERNAME=<username>
- PASSWORD=<password> - PASSWORD=<password>
- DATA_DIR=<directory-path-to-sync> - DATA_DIR=<directory-path-to-sync>

View File

@ -14,8 +14,8 @@ logging.basicConfig(format="%(asctime)s %(message)s",
class SeafileClient: class SeafileClient:
def __init__(self, host: str, port: int, user: str, passwd: str): def __init__(self, host: str, user: str, passwd: str):
self.url = f"https://{host}:{port}" self.url = requests.get(f"http://{host}").url
self.user = user self.user = user
self.password = passwd self.password = passwd
self.__token = None self.__token = None

View File

@ -15,7 +15,6 @@ def main():
parser.add_argument("--gid", default=os.getenv("SEAFILE_GID"), type=int) parser.add_argument("--gid", default=os.getenv("SEAFILE_GID"), type=int)
parser.add_argument("--data-dir", default=os.getenv("DATA_DIR")) parser.add_argument("--data-dir", default=os.getenv("DATA_DIR"))
parser.add_argument("--host", default=os.getenv("SERVER_HOST")) 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("--username", default=os.getenv("USERNAME"))
parser.add_argument("--password", default=os.getenv("PASSWORD")) parser.add_argument("--password", default=os.getenv("PASSWORD"))
parser.add_argument("--libs", default=os.getenv("LIBRARY_ID")) parser.add_argument("--libs", default=os.getenv("LIBRARY_ID"))
@ -24,7 +23,7 @@ def main():
setup_uid(args.uid, args.gid) setup_uid(args.uid, args.gid)
start_seaf_daemon() start_seaf_daemon()
create_dir(args.data_dir) 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=":"): for lib_id in args.libs.split(sep=":"):
client.sync_lib(lib_id, args.data_dir) client.sync_lib(lib_id, args.data_dir)
client.watch_status() client.watch_status()