Skip to content
Snippets Groups Projects
constants.py 556 B
Newer Older
Nico's avatar
Nico committed
# Copyright (c) 2019 Nico Alt
# SPDX-License-Identifier: AGPL-3.0-only
# License-Filename: LICENSE.md

from os.path import join
from pathlib import Path
from urllib.parse import urljoin

Nico's avatar
Nico committed
_BRIAR_DIR_NAME = ".briar"
_HOME = str(Path.home())
_BRIAR_DIR = join(_HOME, _BRIAR_DIR_NAME)
Nico's avatar
Nico committed

_HOST = "%s://localhost:7000"
_VERSION_SUFFIX = "v1/"
Nico's avatar
Nico committed

Nico's avatar
Nico committed
BRIAR_AUTH_TOKEN = join(_BRIAR_DIR, "auth_token")
BRIAR_DB = join(_BRIAR_DIR, "db", "db.mv.db")
Nico's avatar
Nico committed

BASE_HTTP_URL = urljoin(_HOST % "http", _VERSION_SUFFIX)
WEBSOCKET_URL = urljoin(_HOST % "ws", "%s/ws" % _VERSION_SUFFIX)