diff --git a/.idea/kiwi-scp.iml b/.idea/kiwi-scp.iml index d3e64c5..a74c05f 100644 --- a/.idea/kiwi-scp.iml +++ b/.idea/kiwi-scp.iml @@ -5,7 +5,7 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 6d2139f..bd89605 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/Pipfile.lock b/Pipfile.lock index 94a7e7e..30dd482 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -18,20 +18,38 @@ "default": { "pyyaml": { "hashes": [ - "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97", - "sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76", - "sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2", - "sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648", - "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf", - "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f", - "sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2", - "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee", - "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d", - "sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c", - "sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a" + "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf", + "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696", + "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393", + "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77", + "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922", + "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5", + "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8", + "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10", + "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc", + "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018", + "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e", + "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253", + "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347", + "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183", + "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541", + "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb", + "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185", + "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc", + "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db", + "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa", + "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46", + "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122", + "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b", + "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63", + "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df", + "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc", + "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247", + "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6", + "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0" ], "index": "pypi", - "version": "==5.3.1" + "version": "==5.4.1" } }, "develop": {} diff --git a/example/kiwi.yml b/example/kiwi.yml index f89e075..ff10127 100644 --- a/example/kiwi.yml +++ b/example/kiwi.yml @@ -2,7 +2,7 @@ # kiwi-scp instance configuration # ################################### -version: '0.1.5' +version: '0.1.6' runtime: storage: /tmp/kiwi diff --git a/install.sh b/install.sh index f4a3b06..13ce687 100755 --- a/install.sh +++ b/install.sh @@ -5,7 +5,7 @@ ############# # default installation directory -INSTALL_DIR_DEFAULT="/usr/local/bin" +INSTALL_DIR_DEFAULT="/usr/local/sbin" # URI of "kiwi" launcher script KIWI_URI="https://raw.githubusercontent.com/ldericher/kiwi-scp/master/kiwi" diff --git a/kiwi b/kiwi index f03783d..ff64118 100755 --- a/kiwi +++ b/kiwi @@ -25,7 +25,7 @@ KIWI_VERSION="master" KIWI_URI="https://raw.githubusercontent.com/ldericher/kiwi-scp/master/kiwi" INSTALLER_URI="https://raw.githubusercontent.com/ldericher/kiwi-scp/master/install.sh" # canary file: limit curl requests -CANARY_FILENAME="/tmp/kiwi-scp.canary" +CANARY_FILENAME="/tmp/kiwi-scp-$(id -u).canary" CANARY_MAX_AGE=600 ################### diff --git a/src/etc/version_tag b/src/etc/version_tag index 9faa1b7..c946ee6 100644 --- a/src/etc/version_tag +++ b/src/etc/version_tag @@ -1 +1 @@ -0.1.5 +0.1.6 diff --git a/src/kiwi/_constants.py b/src/kiwi/_constants.py index 8c33fed..be0ab6d 100644 --- a/src/kiwi/_constants.py +++ b/src/kiwi/_constants.py @@ -1,7 +1,6 @@ # system import os - ############# # ENVIRONMENT @@ -10,7 +9,6 @@ KIWI_ROOT = os.getenv('KIWI_ROOT', ".") # default name of kiwi-scp file KIWI_CONF_NAME = os.getenv('KIWI_CONF_NAME', "kiwi.yml") - ############ # FILE NAMES @@ -27,7 +25,6 @@ CONF_DIRECTORY_NAME = 'conf' # location for auxiliary Dockerfiles IMAGES_DIRECTORY_NAME = f"{KIWI_ROOT}/images" - #################### # DOCKER IMAGE NAMES diff --git a/src/kiwi/misc.py b/src/kiwi/misc.py index 221b9c3..ed91da9 100644 --- a/src/kiwi/misc.py +++ b/src/kiwi/misc.py @@ -1,6 +1,6 @@ def _surround(string, bang): midlane = f"{bang * 3} {string} {bang * 3}" - sidelane = bang*len(midlane) + sidelane = bang * len(midlane) return f"{sidelane}\n{midlane}\n{sidelane}" diff --git a/src/kiwi/project.py b/src/kiwi/project.py index 7a11fc0..60a3fbd 100644 --- a/src/kiwi/project.py +++ b/src/kiwi/project.py @@ -1,10 +1,9 @@ import logging import os -from .executable import Executable - from ._constants import CONF_DIRECTORY_NAME from .config import LoadedConfig +from .executable import Executable class Project: diff --git a/src/kiwi/subcommands/_hidden.py b/src/kiwi/subcommands/_hidden.py index 28ce50d..d3e0901 100644 --- a/src/kiwi/subcommands/_hidden.py +++ b/src/kiwi/subcommands/_hidden.py @@ -4,11 +4,11 @@ import subprocess # local from .._constants import CONF_DIRECTORY_NAME -from ..executable import Executable -from ..subcommand import SubCommand from ..config import LoadedConfig +from ..executable import Executable from ..projects import Projects from ..rootkit import Rootkit, prefix_path_mnt +from ..subcommand import SubCommand class ConfCopyCommand(SubCommand): diff --git a/src/kiwi/subcommands/down.py b/src/kiwi/subcommands/down.py index 9c4032f..b0a1147 100644 --- a/src/kiwi/subcommands/down.py +++ b/src/kiwi/subcommands/down.py @@ -4,10 +4,10 @@ import subprocess # local from ._hidden import _find_net -from ..subcommand import ServiceCommand from ..config import LoadedConfig from ..executable import Executable from ..misc import are_you_sure +from ..subcommand import ServiceCommand class DownCommand(ServiceCommand): diff --git a/src/kiwi/subcommands/init.py b/src/kiwi/subcommands/init.py index d5174be..1ca9c6a 100644 --- a/src/kiwi/subcommands/init.py +++ b/src/kiwi/subcommands/init.py @@ -4,8 +4,8 @@ import os # local from .._constants import KIWI_CONF_NAME -from ..subcommand import SubCommand from ..config import DefaultConfig, LoadedConfig +from ..subcommand import SubCommand class InitCommand(SubCommand): @@ -42,7 +42,6 @@ class InitCommand(SubCommand): # check force switch if args.force and os.path.isfile(KIWI_CONF_NAME): - logging.warning(f"Overwriting existing '{KIWI_CONF_NAME}'!") config = DefaultConfig.get() diff --git a/src/kiwi/subcommands/purge.py b/src/kiwi/subcommands/purge.py index 2200302..86cd372 100644 --- a/src/kiwi/subcommands/purge.py +++ b/src/kiwi/subcommands/purge.py @@ -4,10 +4,10 @@ import subprocess # local from ._hidden import _find_net -from ..subcommand import SubCommand from ..config import LoadedConfig from ..executable import Executable from ..misc import are_you_sure +from ..subcommand import SubCommand class PurgeCommand(SubCommand): diff --git a/src/kiwi/subcommands/restart.py b/src/kiwi/subcommands/restart.py index d8856c9..86fce22 100644 --- a/src/kiwi/subcommands/restart.py +++ b/src/kiwi/subcommands/restart.py @@ -1,6 +1,6 @@ # local -from ..subcommand import ServiceCommand from ..misc import are_you_sure +from ..subcommand import ServiceCommand class RestartCommand(ServiceCommand): diff --git a/src/kiwi/subcommands/shell.py b/src/kiwi/subcommands/shell.py index 6ae4a0f..7547ced 100644 --- a/src/kiwi/subcommands/shell.py +++ b/src/kiwi/subcommands/shell.py @@ -2,9 +2,9 @@ import logging import subprocess +from ..config import LoadedConfig # local from ..subcommand import ServiceCommand -from ..config import LoadedConfig def _service_has_executable(project, service, exe_name): @@ -52,7 +52,7 @@ def _find_shell(args, project, service): elif i + 1 < len(shells): # try next in list - logging.info(f"Shell '{shell}' not found in container, trying '{shells[i+1]}'") + logging.info(f"Shell '{shell}' not found in container, trying '{shells[i + 1]}'") elif args.shell: # not found, user suggestion provided diff --git a/src/kiwi/subcommands/show.py b/src/kiwi/subcommands/show.py index 23ee8ce..d8e7a34 100644 --- a/src/kiwi/subcommands/show.py +++ b/src/kiwi/subcommands/show.py @@ -3,10 +3,10 @@ import logging import os import yaml -# local -from ..subcommand import ServiceCommand from ..project import Project from ..projects import Projects +# local +from ..subcommand import ServiceCommand def _print_list(strings): diff --git a/src/kiwi/subcommands/update.py b/src/kiwi/subcommands/update.py index 0440cdc..35bc6dd 100644 --- a/src/kiwi/subcommands/update.py +++ b/src/kiwi/subcommands/update.py @@ -1,6 +1,6 @@ # local -from ..subcommand import ServiceCommand from ..misc import are_you_sure +from ..subcommand import ServiceCommand class UpdateCommand(ServiceCommand): @@ -8,7 +8,7 @@ class UpdateCommand(ServiceCommand): def __init__(self): super().__init__( - 'update', num_projects='?', num_services='*', + 'update', num_projects='?', num_services='*', action="Updating", description="Update the whole instance, a project or service(s) inside a project" )