Skip to content

FireProx fails when system time is out of sync with AWS. Please add a system time check to avoid false 'Unable to load AWS credentials' errors. #54

@Lokii-git

Description

@Lokii-git

import datetime
import subprocess

def check_system_time():
try:
local_time = datetime.datetime.utcnow()
aws_time = subprocess.check_output("curl -s --head http://google.com | grep '^date:' | cut -d' ' -f3-6", shell=True).decode().strip()
if aws_time:
aws_time = datetime.datetime.strptime(aws_time, "%d %b %Y %H:%M:%S")
time_diff = abs((aws_time - local_time).total_seconds())
if time_diff > 300: # More than 5 minutes difference
print(f"⚠️ WARNING: System clock is out of sync! (Drift: {int(time_diff)} seconds)")
print("🔥 FireProx may fail due to AWS signature expiration. Run sudo timedatectl set-ntp on to fix.")
except Exception as e:
print(f"⚠️ Could not verify system time: {e}")

check_system_time()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions