mantis-cli 13.3.1__tar.gz → 14.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mantis-cli-13.3.1/mantis_cli.egg-info → mantis-cli-14.0.1}/PKG-INFO +1 -1
- mantis-cli-14.0.1/mantis/__init__.py +1 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis/crypto.py +3 -8
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis/managers.py +9 -6
- {mantis-cli-13.3.1 → mantis-cli-14.0.1/mantis_cli.egg-info}/PKG-INFO +1 -1
- mantis-cli-13.3.1/mantis/__init__.py +0 -1
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/.gitignore +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/LICENSE +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/MANIFEST.in +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/README.md +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/TODO +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis/__main__.py +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis/command_line.py +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis/environment.py +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis/extensions/__init__.py +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis/extensions/django.py +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis/extensions/nginx.py +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis/extensions/postgres.py +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis/helpers.py +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis/logic.py +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis_cli.egg-info/SOURCES.txt +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis_cli.egg-info/dependency_links.txt +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis_cli.egg-info/entry_points.txt +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis_cli.egg-info/requires.txt +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/mantis_cli.egg-info/top_level.txt +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/setup.cfg +0 -0
- {mantis-cli-13.3.1 → mantis-cli-14.0.1}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = '14.0.1'
|
|
@@ -2,15 +2,12 @@ from base64 import b64encode, b64decode
|
|
|
2
2
|
|
|
3
3
|
try:
|
|
4
4
|
from Crypto.Cipher import AES
|
|
5
|
-
from Crypto.Random import get_random_bytes
|
|
6
5
|
from cryptography.fernet import Fernet
|
|
7
6
|
except ImportError:
|
|
8
7
|
# not using cryptography
|
|
9
|
-
# pip install pycryptodome>=3.11.0
|
|
10
|
-
# TODO: only if using environment encryption!
|
|
11
8
|
raise ImportError('Install pycryptodome and cryptography!')
|
|
12
9
|
|
|
13
|
-
from mantis.helpers import CLI
|
|
10
|
+
from mantis.helpers import CLI, random_string
|
|
14
11
|
|
|
15
12
|
|
|
16
13
|
class Crypto(object):
|
|
@@ -18,10 +15,8 @@ class Crypto(object):
|
|
|
18
15
|
def generate_key(deterministically=False):
|
|
19
16
|
if deterministically:
|
|
20
17
|
# deterministically: length has to be 32, 48 or 64
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return x
|
|
24
|
-
|
|
18
|
+
return random_string(64)
|
|
19
|
+
|
|
25
20
|
return Fernet.generate_key()
|
|
26
21
|
|
|
27
22
|
@staticmethod
|
|
@@ -35,7 +35,7 @@ class BaseManager(object):
|
|
|
35
35
|
self.init_environment()
|
|
36
36
|
|
|
37
37
|
self.KEY = self.read_key()
|
|
38
|
-
self.encrypt_deterministically = self.config.get('
|
|
38
|
+
self.encrypt_deterministically = self.config.get('encryption', {}).get('deterministic', True)
|
|
39
39
|
|
|
40
40
|
@property
|
|
41
41
|
def host(self):
|
|
@@ -118,18 +118,21 @@ class BaseManager(object):
|
|
|
118
118
|
|
|
119
119
|
def init_config(self, config):
|
|
120
120
|
self.config = config
|
|
121
|
-
self.
|
|
121
|
+
self.config_file_path = path.normpath(path.join(self.config_file, os.pardir))
|
|
122
|
+
self.key_path = self.config.get('encryption', {}).get('folder', '<MANTIS>').replace('<MANTIS>', self.config_file_path)
|
|
123
|
+
self.configs_path = self.config.get('configs', {}).get('folder', '<MANTIS>/configs').replace('<MANTIS>', self.config_file_path)
|
|
124
|
+
self.environment_path = self.config.get('environment', {}).get('folder', '<MANTIS>/environments').replace('<MANTIS>', self.config_file_path)
|
|
125
|
+
self.compose_path = self.config.get('compose', {}).get('folder', '<MANTIS>/configs/compose').replace('<MANTIS>', self.config_file_path)
|
|
122
126
|
self.compose_command = self.config.get('compose', {}).get('command', 'docker compose')
|
|
123
|
-
self.
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
self.key_file = path.normpath(path.join(self.key_path, 'mantis.key'))
|
|
128
|
+
|
|
126
129
|
# Get environment settings
|
|
127
130
|
self.PROJECT_NAME = self.config['project_name']
|
|
128
131
|
|
|
129
132
|
def init_environment(self):
|
|
130
133
|
self.env = Environment(
|
|
131
134
|
environment_id=self.environment_id,
|
|
132
|
-
folder=self.
|
|
135
|
+
folder=self.environment_path,
|
|
133
136
|
)
|
|
134
137
|
|
|
135
138
|
# connection
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = '13.3.1'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|