from pathlib import Path

# TODO: we can do something nice with a fugue.conf file, or env vars, or
# defaults or something


class Config:
    def __init__(self, wg_root: Path):
        self.WG_ROOT: Path = wg_root.absolute()
        self.FUGUE_ROOT: Path = wg_root.absolute()
        self.FUGUE_INTERFACES_ROOT: Path = Path(self.FUGUE_ROOT, ".interfaces")
        self.FUGUE_PEERS_ROOT: Path = Path(self.FUGUE_ROOT, ".peers")
        self.FUGUE_TUNNELS_ROOT: Path = Path(self.FUGUE_ROOT, "tunnels")
        self.FUGUE_HUBS_ROOT: Path = Path(self.FUGUE_ROOT, "hubs")


CONFIG = Config(wg_root=Path("/etc/wireguard"))


# TODO: reinstate when ready
# NGINX_ROOT: str = "/etc/nginx"
# NGINX_NUANCE_SERVERS_AVAILABLE_ROOT: str = os.path.abspath(Path(NGINX_ROOT, "nuance-servers-available"))
# NGINX_NUANCE_SERVERS_ENABLED_ROOT: str = os.path.abspath(Path(NGINX_ROOT, "nuance-servers-enabled"))


def show(config: Config):
    print(f"WG_ROOT: {config.WG_ROOT}")
    print(f"FUGUE_ROOT: {config.FUGUE_ROOT}")
    print(f"FUGUE_INTERFACES_ROOT: {config.FUGUE_INTERFACES_ROOT}")
    print(f"FUGUE_PEERS_ROOT: {config.FUGUE_PEERS_ROOT}")
    print(f"FUGUE_TUNNELS_ROOT: {config.FUGUE_TUNNELS_ROOT}")
    print(f"FUGUE_HUBS_ROOT: {config.FUGUE_HUBS_ROOT}")
