Add 127.0.0.1 localhost to container /etc/hosts

This commit is contained in:
Disassembler 2020-05-03 21:52:16 +02:00
parent ede631b8e1
commit 021bac46b3
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
2 changed files with 4 additions and 1 deletions

View File

@ -29,8 +29,9 @@ def load_leases():
leases = {ip: hostname for ip, hostname in leases}
mtime = file_mtime
except FileNotFoundError:
# If the file doesn't exist, create it with localhost and container host as default records
interface = get_bridge_interface()
leases = {str(interface.ip): 'host'}
leases = {'127.0.0.1': 'localhost', str(interface.ip): 'host'}
@locked(config.HOSTS_LOCK_FILE)
def save_leases():

View File

@ -94,6 +94,7 @@ def unpack_archive(archive_path, destination, expected_hash, observer):
data = None
def load(force=False):
# Download package manifest and signature and verify
global data
if not data or force:
with requests.Session() as session:
@ -103,6 +104,7 @@ def load(force=False):
resource = session.get(config.ONLINE_SIG_URL, timeout=5)
resource.raise_for_status()
packages_sig = resource.content
# Raises cryptography.exceptions.InvalidSignature on verification failure
get_public_key().verify(packages_sig, packages, ec.ECDSA(hashes.SHA512()))
data = json.loads(packages.decode())