Skip to content

Commit

Permalink
fix warehouse initialization with TUF
Browse files Browse the repository at this point in the history
Fix some required paramenters for running the development environment.
Fix bug on LocalKeyStorage

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
  • Loading branch information
Kairo de Araujo committed Jun 25, 2022
1 parent 4d87c88 commit d2212da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions dev/environment
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ TWOFACTORMANDATE_AVAILABLE=true
TWOFACTORMANDATE_ENABLED=true
OIDC_ENABLED=true

TUF_URL="http://{request.domain}:9001/metadata"
TUF_KEY_BACKEND=warehouse.tuf.services.LocalKeyService key.path=/opt/warehouse/src/dev
TUF_STORAGE_BACKEND=warehouse.tuf.services.LocalStorageService
TUF_REPO_BACKEND=warehouse.tuf.services.LocalRepositoryService repo.path=/opt/warehouse/src/warehouse/tuf/dist
TUF_REPOSITORY_BACKEND=warehouse.tuf.services.RepositoryService repo.path=/var/opt/warehouse/tuf_metadata
TUF_ROOT_SECRET="an insecure private key password"
TUF_SNAPSHOT_SECRET="an insecure private key password"
TUF_TARGETS_SECRET="an insecure private key password"
TUF_TIMESTAMP_SECRET="an insecure private key password"
TUF_BINS_SECRET="an insecure private key password"
TUF_BIN_N_SECRET="an insecure private key password"
TUF_BIN_N_SECRET="an insecure private key password"
1 change: 1 addition & 0 deletions warehouse/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ def configure(settings=None):
coercer=int,
default=21600, # 6 hours
)
maybe_set(settings, "tuf.url", "TUF_URL")
maybe_set(settings, "tuf.root.secret", "TUF_ROOT_SECRET")
maybe_set(settings, "tuf.snapshot.secret", "TUF_SNAPSHOT_SECRET")
maybe_set(settings, "tuf.targets.secret", "TUF_TARGETS_SECRET")
Expand Down
2 changes: 1 addition & 1 deletion warehouse/tuf/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get(self, rolename):
"""
Returns Key objects for passed TUF role name from configured TUF key path.
"""
privkey_path = os.path.join(self._key_path, f"{rolename}*")
privkey_path = os.path.join(self._key_path, "tufkeys", f"{rolename}*")
role_keys = glob.glob(privkey_path)
keys_sslib = [
import_ed25519_privatekey_from_file(
Expand Down

0 comments on commit d2212da

Please sign in to comment.