Esempio n. 1
0
and then notify the owner about it (opt-in, of course)."""

bugreport_optin_text = """ZPUI has built-in bugreport facilities to ensure error-free operation. \
These allow to automatically send somewhat-anonymized logs to ZeroPhone servers \
whenever some kind of exception happens in ZPUI (either core or apps), \
so that the bug that caused the exception can be fixed.
Your logs, once submitted, will be handled with care, processed quickly \
and fully deleted as soon as possible. You can read more  (and change your choice) \
in the Settings=>Bugreport menu."""

default_config = '{"uuid":"", "last_choices":"", "autosend":false}'
config_filename = "bugreport_config.json"

local_path = local_path_gen(__name__)
config = read_or_create_config(local_path(config_filename), default_config, "Bugreport app")
save_config = save_config_gen(local_path(config_filename))

logger = setup_logger(__name__, "info")

log_options = [
["ZPUI logs", "zpui_logs"],
["ZPUI info (config, git info)", "zpui_info"],
["ZPUI threads", "zpui_threads"],
["ZPUI screenshots", "zpui_screenshots"],
#["ZPUI contexts", "zpui_contexts"],
["dmesg output", "dmesg"],
["/var/log/ contents", "var_log"],
["Processes", "ps"],
["Custom files", "custom"]
]
Esempio n. 2
0
menu_name = "2FA TOTP"

import pyotp

from ui import Menu, PrettyPrinter as Printer, UniversalInput, Canvas, Refresher, DialogBox
from helpers import read_or_create_config, local_path_gen, save_config_gen

local_path = local_path_gen(__name__)
config_path = local_path("config.json")
config = read_or_create_config(config_path, '{"secrets":[]}', menu_name)
save_config = save_config_gen(config_path)

i = None
o = None


def init_app(input, output):
    global i, o
    i = input
    o = output


# Showing TOTP entries


def show_totp(name, secret):
    display_func = lambda: render_totp(name, secret)
    r = Refresher(display_func, i, o, 1)
    delete_func = lambda: delete_config_entry(name, secret, r)
    r.set_keymap({"KEY_RIGHT": delete_func})
    r.activate()