-
Notifications
You must be signed in to change notification settings - Fork 9
/
repo_settings.py
36 lines (26 loc) · 1.04 KB
/
repo_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import logging
import pathlib
from tufup.repo import DEFAULT_KEY_MAP, DEFAULT_KEYS_DIR_NAME, DEFAULT_REPO_DIR_NAME
logger = logging.getLogger(__name__)
"""
DISCLAIMER
For convenience, this example uses a single key pair for all TUF roles,
and the private key is unencrypted and stored locally. This approach is *not*
safe and should *not* be used in production.
"""
# Path to directory containing current module
MODULE_DIR = pathlib.Path(__file__).resolve().parent
# For development
DEV_DIR = MODULE_DIR / 'temp_my_app'
PYINSTALLER_DIST_DIR_NAME = 'dist'
DIST_DIR = DEV_DIR / PYINSTALLER_DIST_DIR_NAME
# Local repo path and keys path (would normally be offline)
KEYS_DIR = DEV_DIR / DEFAULT_KEYS_DIR_NAME
REPO_DIR = DEV_DIR / DEFAULT_REPO_DIR_NAME
# Key settings
KEY_NAME = 'my_key'
PRIVATE_KEY_PATH = KEYS_DIR / KEY_NAME
KEY_MAP = {role_name: [KEY_NAME] for role_name in DEFAULT_KEY_MAP.keys()}
ENCRYPTED_KEYS = []
THRESHOLDS = dict(root=1, targets=1, snapshot=1, timestamp=1)
EXPIRATION_DAYS = dict(root=365, targets=7, snapshot=7, timestamp=1)