MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / auth_setup

Function auth_setup

webapp_modern.py:4587–4612  ·  view source on GitHub ↗

Initial authentication setup - creates user, encrypts DB, generates recovery codes.

()

Source from the content-addressed store, hash-verified

4585 return True
4586
4587 normalized = timestamp.replace('Z', '+00:00')
4588 try:
4589 parsed = datetime.fromisoformat(normalized)
4590 except ValueError:
4591 logger.debug(f"Unable to parse Pwnagotchi installer timestamp: {timestamp}")
4592 return True
4593
4594 age = datetime.now(timezone.utc) - parsed
4595 return age.total_seconds() > max_age_seconds
4596
4597
4598def _read_pwn_log_chunk(cursor: Optional[int] = None, tail_bytes: int = 4096, max_bytes: int = 8192):
4599 """Return a slice of the installer log starting at cursor or tail bytes from end."""
4600 status = _build_pwnagotchi_status(persist=False)
4601 log_file = status.get('log_file')
4602
4603 if not log_file or not os.path.exists(log_file):
4604 return status, None, 0, []
4605
4606 try:
4607 file_size = os.path.getsize(log_file)
4608 except OSError:
4609 return status, None, 0, []
4610
4611 if cursor is None or cursor < 0:
4612 tail_bytes = max(0, min(tail_bytes, 65536))
4613 start = max(file_size - tail_bytes, 0)
4614 else:
4615 start = max(0, min(cursor, file_size))

Callers

nothing calls this directly

Calls 3

setupMethod · 0.80
is_configuredMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected