Skip to content

Latest commit

 

History

History
191 lines (95 loc) · 3.64 KB

File metadata and controls

191 lines (95 loc) · 3.64 KB

Structure of content.json

Every ZeroNet site will have a content.json file. (Example content.json file)

This file will carry, amont other things, a list of all files on your site and a signature created with your private key. This is done to avoid file tampering (ie: only you, or people you trust, can update the site content).

Here is a list of supported keys:


address

Your site address

Example: 1TaLk3zM7ZRskJvrh3ZNCDVGXvkJusPKQ


background-color

Background color of the wrapper

Example: #F5F5F5


description

Description of your site, displayed under site title on ZeroHello.

Example: Decentralized forum demo


domain

Domain name of your site. ZeroHello will link to this if the user has Zeroname plugin enabled.

Example: Blog.ZeroNetwork.bit


files

Size and sha512 hash of all files contained in your site. Automatically added by the command zeronet.py siteSign siteaddress privatekey.

Example:

    "css/all.css": {
      "sha1": "f2b14758210163f0cb38a865aa67797a4ed92837", # Only for backward compatibility, will be removed soon
      "sha512": "869b09328f07bac538c313c4702baa5276544346418378199fa5cef644c139e8",
      "size": 148208

ignore

Ignore files from signing matching this preg pattern

Example: ((js|css)/(?!all.(js|css))|data/users/.*) (ignore all js and css files except all.js and all.css and don't add anything from data/users/ directory)


includes

Include an another content.json

Example:

{
  "data/users/content.json": {
    "signers": [ # Possible signers address for the file
      "1LSxsKfC9S9TVXGGNSM3vPHjyW82jgCX5f"
    ],
    "signers_required": 1 # Valid signs required to accept the file (Multisig possibility),
    "files_allowed": "data.json", # Preg pattern for the allowed files in the include file
    "includes_allowed": false, # Nested includes allowed or not
    "max_size": 10000, # Max sum filesize allowed in the include (in bytes)
  }
}

modified

Time when the content.json was generated.

Example: 1425857522.076


sign (deprecated)

ECDSA sign of the content.json file content. (keys sorted, without whitespace and the sign and signers_sign nodes). For backward compatibility, will be removed soon.

Example:

  "sign": [
    43117356513690007125104018825100786623580298637039067305407092800990252156956,
    94139380599940414070721501960181245022427741524702752954181461080408625270000
  ],

signers_sign

Possible signers address for the root content.json signed using the site address private key. (Multisig possibility)

Format of the signed string: [signers_required]:[signer address],[signer address]

Example: HKNDz9IUHcBc/l2Jm2Bl70XQDL9HYHhJ2hUdg8AMyunACLgxyXBr7EW1/ME4hGkaFZSFmIxlInmxH+BrMVXbnLw=


signs

ECDSA signs for the the content.json file content. (keys sorted, without whitespace and the sign and signers_sign nodes).

Example:

  "signs": {
    "1TaLk3zM7ZRskJvrh3ZNCDVGXvkJusPKQ": "G6/QXFKvACPQ7LhoZG4fgqmeOSK99vGM2arVWkm9pV/WPCfc2ulv6iuQnuzw4v5z82qWswcRq907VPdBsdb9VRo="
  },

signs_required

Valid signs required to accept the file (Multisig possibility)

Example: 1


title

Site's title, visible in browser title and on ZeroHello.

Example: ZeroTalk


viewport

Content for the viewport meta tag. (Used for mobile-friendly pages)

Example: width=device-width, initial-scale=1.0


zeronet_version

ZeroNet version used to generate content.json file.

Example: 0.2.5