From d98868080355a9390b48378d3981754ffae2aefb Mon Sep 17 00:00:00 2001 From: Zsolt Ero Date: Fri, 29 Dec 2023 18:04:02 +0100 Subject: [PATCH] work --- init-server.py | 9 +-------- ssh_lib/__init__.py | 10 ++++++++++ ssh_lib/benchmark.py | 2 +- ssh_lib/config.py | 12 ------------ ssh_lib/kernel.py | 2 +- ssh_lib/nginx.py | 6 +++++- ssh_lib/planetiler.py | 2 +- 7 files changed, 19 insertions(+), 24 deletions(-) delete mode 100644 ssh_lib/config.py diff --git a/init-server.py b/init-server.py index 202195c..00a552f 100755 --- a/init-server.py +++ b/init-server.py @@ -5,15 +5,8 @@ import click from dotenv import dotenv_values from fabric import Config, Connection +from ssh_lib import CONFIG_DIR, HTTP_HOST_BIN, OFM_DIR, REMOTE_CONFIG, SCRIPTS_DIR, TILE_GEN_BIN from ssh_lib.benchmark import c1000k -from ssh_lib.config import ( - CONFIG_DIR, - HTTP_HOST_BIN, - OFM_DIR, - REMOTE_CONFIG, - SCRIPTS_DIR, - TILE_GEN_BIN, -) from ssh_lib.kernel import setup_kernel_settings from ssh_lib.nginx import certbot, nginx from ssh_lib.pkg_base import pkg_base, pkg_upgrade diff --git a/ssh_lib/__init__.py b/ssh_lib/__init__.py index e69de29..b2194f0 100644 --- a/ssh_lib/__init__.py +++ b/ssh_lib/__init__.py @@ -0,0 +1,10 @@ +from pathlib import Path + + +CONFIG_DIR = Path(__file__).parent.parent / 'config' +SCRIPTS_DIR = Path(__file__).parent.parent / 'scripts' +ASSETS_DIR = Path(__file__).parent / 'assets' +OFM_DIR = '/data/ofm' +REMOTE_CONFIG = '/data/ofm/config' +TILE_GEN_BIN = '/data/ofm/tile_gen/bin' +HTTP_HOST_BIN = '/data/ofm/http_host/bin' diff --git a/ssh_lib/benchmark.py b/ssh_lib/benchmark.py index 5f89bb9..8df7e62 100644 --- a/ssh_lib/benchmark.py +++ b/ssh_lib/benchmark.py @@ -1,4 +1,4 @@ -from ssh_lib.config import SCRIPTS_DIR +from ssh_lib import SCRIPTS_DIR from ssh_lib.utils import apt_get_install, exists, put diff --git a/ssh_lib/config.py b/ssh_lib/config.py deleted file mode 100644 index 8510d71..0000000 --- a/ssh_lib/config.py +++ /dev/null @@ -1,12 +0,0 @@ -from pathlib import Path - - -CONFIG_DIR = Path(__file__).parent.parent / 'config' -SCRIPTS_DIR = Path(__file__).parent.parent / 'scripts' -ASSETS_DIR = Path(__file__).parent / 'assets' - - -OFM_DIR = '/data/ofm' -REMOTE_CONFIG = '/data/ofm/config' -TILE_GEN_BIN = '/data/ofm/tile_gen/bin' -HTTP_HOST_BIN = '/data/ofm/http_host/bin' diff --git a/ssh_lib/kernel.py b/ssh_lib/kernel.py index c7a1e58..84ae0ed 100644 --- a/ssh_lib/kernel.py +++ b/ssh_lib/kernel.py @@ -1,4 +1,4 @@ -from ssh_lib.config import ASSETS_DIR +from ssh_lib import ASSETS_DIR from ssh_lib.utils import put diff --git a/ssh_lib/nginx.py b/ssh_lib/nginx.py index a5da223..97fc1cf 100644 --- a/ssh_lib/nginx.py +++ b/ssh_lib/nginx.py @@ -1,4 +1,4 @@ -from ssh_lib.config import ASSETS_DIR +from ssh_lib import ASSETS_DIR from ssh_lib.utils import ( apt_get_install, apt_get_purge, @@ -53,6 +53,10 @@ def nginx(c): c.sudo('service nginx restart') +def mime_types(c): + pass + + def certbot(c): apt_get_install(c, 'snapd') diff --git a/ssh_lib/planetiler.py b/ssh_lib/planetiler.py index 60f112f..2ee5886 100644 --- a/ssh_lib/planetiler.py +++ b/ssh_lib/planetiler.py @@ -1,4 +1,4 @@ -from ssh_lib.config import TILE_GEN_BIN +from ssh_lib import TILE_GEN_BIN from ssh_lib.utils import apt_get_install, apt_get_update