Skip to content

All services need a manifest.json #4

Open
@micahflee

Description

@micahflee

If there will be non-Tor Browser clients, then every service should have a machine-readable manifest at /manifest.json that the clients can read.

The manifests will describe to the client the relevant general settings, and the relevant mode settings, for each mode. This is what the mode settings object looks like: https://github.com/onionshare/onionshare/blob/develop/cli/onionshare_cli/mode_settings.py#L37-L60

Here's what they should look like for each mode:

Share mode:

{
    "version": 1,
    "mode": "share",
    "data": {
        "title": "Custom title",
        "autostop_sharing": true,
        "files": [
            { "name": "/filename1.txt", "size": 1024 },
            { "name": "/filename2.txt", "size": 42 },
            { "name": "/Documents/" },
            { "name": "/Documents/nested_file.txt", "size": 15360 },
            { "name": "/Documents/Empty Folder/" }
        ]
    }
}

The reason the autostop_sharing setting should be exposed is so the client knows if it can download individual files or not. If this is false, the client's only option is to download all files as a zip. If it's true, it can download individual files.

Filenames that end in a trailing slash are directories.

Receive mode:

{
    "version": 1,
    "mode": "receive",
    "data": {
        "title": "Custom title",
        "disable_text": false,
        "disable_files": false
    }
}

Receive mode should expose disable_text and disable_files to allow the client to know what data it can submit.

Website mode:

Website mode doesn't need a manifest.

Chat mode:

{
    "version": 1,
    "mode": "chat",
    "data": {
        "title": "Custom title"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions