optools/net/ssh/hostkeymanager/app/templates/usage.html

2.9 KiB

{% extends "base.html" %}{% block title %}r00t^2 Client Info Revealer || Usage{% endblock %}{% block body %}

Usage

Parameters

You can control how this page displays/renders. By default it will try to "guess" what you want; e.g. if you access it in Chrome, it will display this page but if you fetch via Curl, you'll get raw JSON. The following parameters control this behavior.

Note: "Enabled" parameter values can be one of y, yes, 1, or true. "Disabled" parameter values can be one of n, no, 0, or false. The parameter names are case-sensitive but the values are not.

  • json: Force rendering in JSON format
    • It will display it nicely if you're in a browser, otherwise it will return raw/plaintext JSON.
    • Use raw if you want to force raw plaintext JSON output.
  • html: Force rendering in HTML
    • It will render HTML in clients that would normally render as JSON (e.g. curl, wget).
  • raw: Force output into a raw JSON string
    • Pure JSON instead of HTML or formatted JSON. This is suitable for API usages if your client is detected wrongly (or you just want to get the raw JSON).
    • Overrides all other tags.
    • Has no effect for clients that would normally render as JSON (curl, wget, etc.).
  • tabs: Indentation for JSON output
    • Accepts a positive integer.
    • Default is 4 for "desktop" browsers (if json is enabled), and no indentation otherwise.

Examples

{% set scheme = 'https' if request.is_secure else 'http'%}

URL Behavior
{{ scheme }}://{{ request.headers['host'] }}/ Displays HTML and "Human" formatting if in a graphical browser, otherwise returns a raw, unformatted JSON string.
{{ scheme }}://{{ request.headers['host'] }}/?raw=1 Renders a raw, unformatted JSON string if in a graphical browser, otherwise no effect. All other parameters ignored (if in a graphical browser).
{{ scheme }}://{{ request.headers['host'] }}/?html=1 Forces HTML rendering on non-graphical clients.
{{ scheme }}://{{ request.headers['host'] }}/?json=1&tabs=4 Returns JSON indented by 4 spaces for each level (you can leave "json=1" off if it's in a non-graphical browser, unless you specified "html=1").

{% endblock %}