# keyvalue

key: links
value:
- [Source code](https://github.com/HelloZeroNet)
- [Create new blog](?Post:3:How+to+have+a+blog+like+this)


# post

title: Changelog: May 31, 2015
body:
 - rev194
 - Ugly OpenSSL memory leak fix
 - Added Docker and Vargant files (thanks to n3r0-ch)

ZeroBlog
 - Comment editing, Deleting, Replying added

New official site: http://zeronet.io/


title: Trusted authorization providers
body:
What is it good for?

 - It allows you to have multi-user sites without need of a bot that listen to new user registration requests.
 - You can use the same username across sites
 - The site owner can give you (or revoke)  permissions based on your ZeroID username

How does it works?

 - You visit an authorization provider site (eg zeroid.bit)
 - You enter the username you want to register and sent the request to the authorization provider site owner (zeroid supports bitmessage and simple http request).
 - The authorization provider process your request and it he finds everything all right (unique username, other anti-spam methods) he sends you a certificate for the username registration.
 - If a site trust your authorization provider you can post your own content (comments, topics, upvotes, etc.) using this certificate without ever contacting the site owner.

What sites currently supports ZeroID?

 - You can post comments to ZeroBlog using your ZeroID
 - Later, if everyone is updated to 0.3.0 a new ZeroTalk is also planned that supports ZeroID certificates

Why is it necessary?

 - To have some kind of control over the users of your site. (eg. remove misbehaving users)

Other info

 - ZeroID is a standard site, anyone can clone it and have his/her own one
 - You can stop seeding ZeroID site after you got your cert


title: Changelog: May 25, 2015
body:
- Version 0.3.0, rev187
- Trusted authorization provider support: Easier multi-user sites by allowing site owners to define tusted third-party user certificate signers. (more info about it in the next days)
- `--publish` option to siteSign to publish automatically after the new files signed.
- `cryptSign` command line command to sign message using private key.
- New, more stable OpenSSL layer that also works on OSX.
- New json table format support.
- DbCursor SELECT parameters bugfix.
- Faster multi-threaded peer discovery from trackers.
- New http trackers added.
- Wait for dbschema.json file to execute query.
- Handle json import errors.
- More compact json writeJson storage command output.
- Workaround to make non target=_top links work.
- Cleaner UiWebsocket command router.
- Notify other local users on local file changes.
- Option to wait file download before execute query.
- fileRules, certAdd, certSelect, certSet websocket API commands.
- Allow more file errors on big sites.
- On stucked downloads skip worker's current file instead of stopping it.
- NoParallel parameter bugfix.
- RateLimit interval bugfix.
- Updater skips non-writeable files.
- Try to close OpenSSL dll before update.

ZeroBlog:
- Rewritten to use SQL database
- Commenting on posts (**Please note: The comment publishing and distribution can be slow until most of the clients is not updated to version 0.3.0**)

![comments](data/img/zeroblog-comments.png)

ZeroID
- Sample Trusted authorization provider site with Bitmessage registration support

![comments](data/img/zeroid.png)


title: Status report: Trusted authorization providers
body:
Currently working on a new feature that allows to create multi-user sites more easily. For example it will allows us to have comments on ZeroBlog (without contacting the site owner).

Current status:

 - Sign/verification process: 90%
 - Sample trusted authorization provider site: 70%
 - ZeroBlog modifications: 30%
 - Authorization UI enhacements: 10%
 - Total progress: 60%
 
Eta.: 1-2weeks

### Update: May 18, 2015:

Things left:
 - More ZeroBlog modifications on commenting interface
 - Bitmessage support in Sample trusted authorization provider site
 - Test everything on multiple platform/browser and machine
 - Total progress: 80%

If no major flaw discovered it should be out this week.


title: Changelog: May 3, 2015
body:
 - rev134
 - Removed ZeroMQ dependencies and support (if you are on pre 0.2.0 version please, upgrade)
 - Save CPU and memory on file requests by streaming content directly to socket without loading to memory and encoding with msgpack.
 - Sites updates without re-download all content.json by querying the modified files from peers.
 - Fix urllib memory leak
 - SiteManager testsuite
 - Fix UiServer security testsuite
 - Announce to tracker on site resume

ZeroBoard:

 - Only last 100 messages loaded by default
 - Typo fix


title: Changelog: Apr 29, 2015
body:
 - rev126
 - You can install the "127.0.0.1:43110-less" extension from [Chrome Web Store](https://chrome.google.com/webstore/detail/zeronet-protocol/cpkpdcdljfbnepgfejplkhdnopniieop). (thanks to g0ld3nrati0!)
 - You can disable the use of openssl using `--use_openssl False`
 - OpenSSL disabled on OSX because of possible segfault. You can enable it again using `zeronet.py --use_openssl True`,<br> please [give your feedback](https://github.com/HelloZeroNet/ZeroNet/issues/94)!
 - Update on non existent file bugfix
 - Save 20% memory using Python slots

![Memory save](data/img/slots_memory.png)


title: Changelog: Apr 27, 2015
body:
 - Revision 122
 - 40x faster signature verification by using OpenSSL if available
 - Added OpenSSL benchmark: beat my CPU at http://127.0.0.1:43110/Benchmark :)
 - Fixed UiServer socket memory leak


title: Slides about ZeroNet
body:
Topics:
 - ZeroNet cryptography
 - How site downloading works
 - Site updates
 - Multi-user sites
 - Current status of the project / Future plans

<a href="https://docs.google.com/presentation/d/1_2qK1IuOKJ51pgBvllZ9Yu7Au2l551t3XBgyTSvilew/pub?start=false&loop=false&delayms=3000&slide=id.g9a1cce9ee_0_4"><img src="data/img/slides.png"/></a>

[Any feedback is  welcome!](http://127.0.0.1:43110/Talk.ZeroNetwork.bit/?Topic:18@2/Presentation+about+how+ZeroNet+works) 

Thanks! :)


title: Changelog: Apr 24, 2014
body:
 - Revision 120
 - Batched publishing to avoid update flood: Only send one update in every 7 seconds
 - Protection against update flood by adding update queue: Only allows 1 update in every 10 second for the same file
 - Fix stucked notification icon
 - Fix websocket error when writing to not-owned sites


title: Changelog: Apr 20, 2014
body:
 - Revision 115
 - For faster pageload times allow browser cache on css/js/font files
 - Support for experimental chrome extension that allows to browse zeronet sites using `http://talk.zeronetwork.bit` and/or `http://zero/1Name2NXVi1RDPDgf5617UoW7xA6YrhM9F`
 - Allow to browse memory content in /Stats
 - Peers uses Site's logger to save some memory
 - Give not-that-good peers on initial PEX if required
 - Allows more than one `--ui_restrict` ip address
 - Disable ssl monkey patching to avoid ssl error in Debian Jessie
 - Fixed websocket error when writing not-allowed files
 - Fixed bigsite file not found error
 - Fixed loading screen stays on screen even after index.html loaded

ZeroHello:

 - Site links converted to 127.0.0.1:43110 -less if using chrome extension

![direct domains](data/img/direct_domains.png)


title: Changelog: Apr 17, 2014
body:
 - Revision 101
 - Revision numbering between version
 - Allow passive publishing
 - Start Zeronet when Windows starts option to system tray icon
 - Add peer ping time to publish timeout
 - Passive connected peers always get the updates
 - Pex count bugfix
 - Changed the topright button hamburger utf8 character to more supported one and removed click anim
 - Passive peers only need 3 connection
 - Passive connection store on tracker bugfix
 - Not exits file bugfix
 - You can compare your computer speed (bitcoin crypto, sha512, sqlite access) to mine: http://127.0.0.1:43110/Benchmark :)

ZeroTalk:

 - Only quote the last message
 - Message height bugfix

ZeroHello:

 - Changed the burger icon to more supported one
 - Added revision display


title: Changelog: Apr 16, 2015
body:
Apr 15:

 - Version 0.2.9
 - To get rid of dead ips only send peers over pex that messaged within 2 hour
 - Only ask peers from 2 sources using pex every 20 min
 - Fixed mysterious notification icon disappearings
 - Mark peers as bad if publish is timed out (5s+)


title: Changelog: Apr 15, 2015
body:
 - Sexy system tray icon with statistics instead of ugly console. (sorry, Windows only yet)
 - Total sent/received bytes stats
 - Faster connections and publishing by don't send passive peers using PEX and don't store them on trackers

![Tray icon](data/img/trayicon.png)


title: Changelog: Apr 14, 2015
body:
 - Experimental socks proxy support (Tested using Tor)
 - Tracker-less peer exchange between peers
 - Http bittorrent tracker support
 - Option to disable udp connections (udp tracker)
 - Other stability/security fixes

To use ZeroNet over Tor network start it with `zeronet.py --proxy 127.0.0.1:9050 --disable_udp`

It's still an experimental feature, there is lot work/fine tuning needed to make it work better and more secure (eg. by supporting hidden service peer addresses to allow connection between Tor clients). 
In this mode you can only access to sites where there is at least one peer with peer exchange support. (client updated to latest commit)

If no more bug found i'm going to tag it as 0.2.9 in the next days.


title: Changelog: Apr 9, 2015
body:
 - Packaged windows dependencies for windows to make it easier to install: [ZeroBundle](https://github.com/HelloZeroNet/ZeroBundle)
 - ZeroName site downloaded at startup, so first .bit domain access is faster.
 - Fixed updater bug. (argh)


title: Changelog: Apr 7, 2015
body:
 - Fix for big sites confirmation display
 - Total objects in memory stat
 - Memory optimizations
 - Retry bad files in every 20min
 - Load files to db when executing external siteSign command
 - Fix for endless reconnect bug
 
ZeroTalk:
 
 - Added experimental P2P new bot
 - Bumped size limit to 20k for every user :)
 - Reply button

Experimenting/researching possibilities of i2p/tor support (probably using DHT)

Any help/suggestion/idea greatly welcomed: [github issue](https://github.com/HelloZeroNet/ZeroNet/issues/60)


title: Changelog: Apr 2, 2015
body:
 - Better passive mode by making sure to keep 5 active connections
 - Site connection and msgpack unpacker stats
 - No more sha1 hash added to content.json (it was only for backward compatibility with old clients)
 - Keep connection logger object to prevent some exception
 - Retry upnp port opening 3 times
 - Publish received content updates to more peers to make sure the better distribution

ZeroTalk:  

 - Changed edit icon to more clear pencil
 - Single line breaks also breaks the line


title: Changelog: Mar 29, 2015
body:
 - Version 0.2.8
 - Namecoin (.bit) domain support!
 - Possible to disable backward compatibility with old version to save some memory
 - Faster content publishing (commenting, posting etc.)
 - Display error on internal server errors
 - Better progress bar
 - Crash and bugfixes
 - Removed coppersurfer tracker (its down atm), added eddie4
 - Sorry, the auto updater broken for this version: please overwrite your current `update.py` file with the [latest one from github](https://raw.githubusercontent.com/HelloZeroNet/ZeroNet/master/update.py), run it and restart ZeroNet.
 - Fixed updater

![domain](data/img/domain.png)

ZeroName

 - New site for resolving namecoin domains and display registered ones

![ZeroName](data/img/zeroname.png)
ZeroHello

 - Automatically links to site's domain names if its specificed in content.json `domain` field


title: Changelog: Mar 23, 2015
body:
 - Version 0.2.7
 - Plugin system: Allows extend ZeroNet without modify the core source
 - Comes with 3 plugin:
   - Multiuser: User login/logout based on BIP32 master seed, generate new master seed on visit (disabled by default to enable it just remove the disabled- from the directory name)
   - Stats: /Stats url moved to separate plugin for demonstration reasons
   - DonationMessage: Puts a little donation link to the bottom of every page (disabled by default)
 - Reworked module import system
 - Lazy user auth_address generatation
 - Allow to send prompt dialog to user from server-side
 - Update script remembers plugins enabled/disabled status
 - Multiline notifications
 - Cookie parser

ZeroHello in multiuser mode:

 - Logout button
 - Identicon generated based on logined user xpub address

![Multiuser](data/img/multiuser.png)


title: Changelog: Mar 19, 2015
body:
 - Version 0.2.6
 - SQL database support that allows easier site development and faster page load times
 - Updated [ZeroFrame API Reference](http://zeronet.readthedocs.org/en/latest/site_development/zeroframe_api_reference/)
 - Added description of new [dbschema.json](http://zeronet.readthedocs.org/en/latest/site_development/dbschema_json/) file
 - SiteStorage class for file operations
 - Incoming connection firstchar errorfix
 - dbRebuild and dbQuery commandline actions
 - [Goals donation page](http://zeronet.readthedocs.org/en/latest/zeronet_development/donate/)

ZeroTalk

 - Rewritten to use SQL queries (falls back nicely to use json files on older version)


title: Changelog: Mar 14, 2015
body:
 - Save significant amount of memory by remove unused msgpack unpackers
 - Log unhandled exceptions
 - Connection checker error bugfix
 - Working on database support, you can follow the progress on [reddit](http://www.reddit.com/r/zeronet/comments/2yq7e8/a_json_caching_layer_for_quicker_development_and/)

![memory usage](data/img/memory.png)


title: Changelog: Mar 10, 2015
body:
 - Fixed ZeroBoard and ZeroTalk registration: It was down last days, sorry, I haven't tested it after recent modifications, but I promise I will from now :)
 - Working hard on documentations, after trying some possibilities, I chosen readthedocs.org: http://zeronet.readthedocs.org
 - The API reference is now up-to-date, documented demo sites working method and also updated other parts

[Please, tell me what you want to see in the docs, Thanks!](/1TaLk3zM7ZRskJvrh3ZNCDVGXvkJusPKQ/?Topic:14@2/New+ZeroNet+documentation)


title: Changelog: Mar 8, 2015
body:
 - [Better uPnp Puncher](https://github.com/HelloZeroNet/ZeroNet/blob/master/src/util/UpnpPunch.py), if you have problems with port opening please try this.

ZeroTalk:  
 - Comment upvoting
 - Topic groups, if you know any other article about ZeroNet please, post [here](/1TaLk3zM7ZRskJvrh3ZNCDVGXvkJusPKQ/?Topics:8@2/Articles+about+ZeroNet)


title: Changelog: Mar 5, 2015
body:
 - Connection pinging and timeout
 - Request timeout
 - Verify content at signing (size, allowed files)
 - Smarter coffeescript recompile
 - More detailed stats

ZeroTalk:  
 - Topic upvote
 - Even more source code realign

![ZeroTalk upvote](data/img/zerotalk-upvote.png)


title: Changelog: Mar 1, 2015
body:
ZeroTalk:  
 - Reordered source code to allow more more feature in the future
 - Links starting with http://127.0.0.1:43110/ automatically converted to relative links (proxy support)
 - Comment reply (by clicking on comment's creation date)


title: Changelog: Feb 25, 2015
body:
 - Version 0.2.5
 - Pure-python upnp port opener (Thanks to sirMackk!)
 - Site download progress bar
 - We are also on [Gitter chat](https://gitter.im/HelloZeroNet/ZeroNet)
 - More detailed connection statistics (ping, buff, idle, delay, sent, received)
 - First char failed bugfix
 - Webebsocket disconnect on slow connection bugfix
 - Faster site update

![Progressbar](data/img/progressbar.png)

ZeroTalk:  

 - Sort after 100ms idle
 - Colored usernames
 - Limit reload rate to 500ms

ZeroHello

 - [iframe render fps test](/1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr/test/render.html) ([more details on ZeroTalk](/1TaLk3zM7ZRskJvrh3ZNCDVGXvkJusPKQ/?Topic:7@2/Slow+rendering+in+Chrome))


title: Changelog: Feb 24, 2015
body:
 - Version 0.2.4
 - New, experimental network code and protocol
 - peerPing and peerGetFile commands
 - Connection share and reuse between sites
 - Don't retry bad file more than 3 times in 20 min
 - Multi-threaded include file download
 - Really shuffle peers before publish
 - Simple internal stats page: http://127.0.0.1:43110/Stats
 - Publish bugfix for sites with more then 10 peers

_If someone on very limited resources its recommended to wait some time until most of the peers is updates to new network code, because the backward compatibility is a little bit tricky and using more memory._


title: Changelog: Feb 19, 2015
body:
 - Version 0.2.3
 - One click source code download from github, auto unpack and restart 
 - Randomize peers before publish and work start
 - Switched to upnpc-shared.exe it has better virustotal reputation (4/53 vs 19/57)

![Autoupdate](data/img/autoupdate.png)

ZeroTalk:

 - Topics also sorted by topic creation date

_New content and file changes propagation is a bit broken yet. Already working on better network code that also allows passive content publishing. It will be out in 1-2 weeks._


title: Changelog: Feb 16, 2015
body:
Feb 16:  
 - Version 0.2.2
 - LocalStorage support using WrapperAPI
 - Bugfix in user management

ZeroTalk:  
 - Topics ordered by date of last post
 - Mark updated topics since your last visit

![Mark](data/img/zerotalk-mark.png)


title: Changelog: Feb 14, 2015
body:
 - Version 0.2.1
 - Site size limit: Default 10MB, asks permission to store more, test it here: [ZeroNet windows requirement](/1ZeroPYmW4BGwmT6Z54jwPgTWpbKXtTra)
 - Browser open wait until UiServer started
 - Peer numbers stored in sites.json for faster warmup
 - Silent WSGIHandler error
 - siteSetLimit WrapperAPI command
 - Grand ADMIN permission to wrapperframe

ZeroHello:  

 - Site modify time also include sub-file changes (ZeroTalk last comment)
 - Better changetime date format


title: Changelog: Feb 11, 2015
body:
ZeroTalk:
 - Link-type posts
 - You can Edit or Delete your previous Comments and Topics
 - [Uploaded source code to github](https://github.com/HelloZeroNet/ZeroTalk)


title: Changelog: Feb 10, 2015
body:
 - Progressive publish timeout based on file size
 - Better tracker error log
 - Viewport support in content.json and ZeroFrame API to allow better mobile device layout
 - Escape ZeroFrame notification messages to avoid js injection
 - Allow select all data in QueryJson

ZeroTalk:
 - Display topic's comment number and last comment time (requires ZeroNet today's commits from github)
 - Mobile device optimized layout


title: Changelog: Feb 9, 2015
body:
 - Version 0.2.0
 - New bitcoin ECC lib (pybitcointools)
 - Hide notify errors
 - Include support for content.json
 - File permissions (signer address, filesize, allowed filenames)
 - Multisig ready, new, Bitcoincore compatible sign format
 - Faster, multi threaded content publishing
 - Multiuser, ready, BIP32 based site auth using bitcoin address/privatekey
 - Simple json file query language
 - Websocket api fileGet support

ZeroTalk:  
 - [Decentralized forum demo](/1TaLk3zM7ZRskJvrh3ZNCDVGXvkJusPKQ/?Home)
 - Permission request/username registration
 - Everyone has an own file that he able to modify, sign and publish decentralized way, without contacting the site owner
 - Topic creation
 - Per topic commenting

![ZeroTalk screenshot](data/img/zerotalk.png)


title: Changelog: Jan 29, 2015
body:
The default tracker (tracker.pomf.se) is down since yesterday and its resulting some warning messages. To make it disappear please update to latest version from [GitHub](https://github.com/HelloZeroNet/ZeroNet).

ZeroNet:
- Added better tracker error handling
- Updated alive [trackers list](https://github.com/HelloZeroNet/ZeroNet/blob/master/src/Site/SiteManager.py) (if anyone have more, please [let us know](http://www.reddit.com/r/zeronet/comments/2sgjsp/changelog/co5y07h))

If you want to stay updated about the project status: <br>
We have created a [@HelloZeronet](https://twitter.com/HelloZeroNet) Twitter account


title: Changelog: Jan 27, 2015
body:
ZeroNet
* You can use `start.py` to start zeronet and open in browser automatically
* Send timeout 50sec (workaround for some strange problems until we rewrite the network code without zeromq)
* Reworked Websocket API to make it unified and allow named and unnamed parameters
* Reload `content.json` when changed using fileWrite API command
* Some typo fix

ZeroBlog
* Allow edit post on mainpage
* Also change blog title in `content.json` when modified using inline editor

ZeroHello
* Update failed warning changed to No peers found when seeding own site.


title: Changelog: Jan 25, 2015
body:
ZeroNet
- Utf-8 site titles fixed
- Changes in DebugMedia merger to allow faster, node.js based coffeescript compiler

ZeroBlog
- Inline editor rewritten to simple textarea, so copy/paste, undo/redo now working correctly
- Read more button to folded posts with `---`
- ZeroBlog running in demo mode, so anyone can try the editing tools
- Base html tag fixed
- Markdown cheat-sheet
- Confirmation if you want to close the browser tab while editing

How to update your running blog?
- Backup your `content.json` and `data.json` files
- Copy the files in the `data/1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8` directory to your site.


title: How to have a blog like this
body:
* Stop ZeroNet
* Create a new site using `python zeronet.py siteCreate` command
* Copy all file from **data/1BLogC9LN4oPDcruNz3qo1ysa133E9AGg8** to **data/[Your new site address displayed when executed siteCreate]** directory
* Delete **data** directory and rename **data-default** to **data** to get a clean, empty site
* Rename **data/users/content-default.json** file to **data/users/content.json**
* Execute `zeronet.py siteSign [yoursiteaddress] --inner_path data/users/content.json` to sign commenting rules
* Start ZeroNet
* Add/Modify content
* Click on the `Sign & Publish new content` button
* Congratulations! Your site is ready to access.

_Note: You have to start commands with `..\python\python zeronet.py...` if you downloaded ZeroBundle package_


title: Changelog: Jan 24, 2015
body:
* Version 0.1.6
* Only serve .html files with wrapper frame
* Http parameter support in url
* Customizable background-color for wrapper in content.json
* New Websocket API commands (only allowed on own sites):
  - fileWrite: Modify site's files  in hdd from javascript
  - sitePublish: Sign new content and Publish to peers
* Prompt value support in ZeroFrame (used for prompting privatekey for publishing in ZeroBlog)

---

## Previous changes:

### Jan 20, 2014
- Version 0.1.5
- Detect computer wakeup from sleep and acts as startup (check open port, site changes)
- Announce interval changed from 10min to 20min
- Delete site files command support
- Stop unfinished downloads on pause, delete
- Confirm dialog support to WrapperApi

ZeroHello
- Site Delete menuitem
- Browser back button doesn't jumps to top

### Jan 19, 2014:
- Version 0.1.4
- WIF compatible new private addresses
- Proper bitcoin address verification, vanity address support: http://127.0.0.1:43110/1ZEro9ZwiZeEveFhcnubFLiN3v7tDL4bz
- No hash error on worker kill
- Have you secured your private key? confirmation

### Jan 18, 2014:
- Version 0.1.3
- content.json hashing changed from sha1 to sha512 (trimmed to 256bits) for better security, keep hasing to sha1 for backward compatiblility yet
- Fixed fileserver_port argument parsing
- Try to ping peer before asking any command if no communication for 20min
- Ping timeout / retry
- Reduce websocket bw usage
- Separate wrapper_key for websocket auth and auth_key to identify user
- Removed unnecessary from wrapper iframe url

ZeroHello:
- Compatiblilty with 0.1.3 websocket changes while maintaining backward compatibility
- Better error report on file update fail

ZeroBoard:
- Support for sha512 hashed auth_key, but keeping md5 key support for older versions yet

### Jan 17, 2014:
- Version 0.1.2
- Better error message logging
- Kill workers on download done
- Retry on socket error
- Timestamping console messages

### Jan 16:
- Version to 0.1.1
- Version info to websocket api
- Add publisher's zeronet version to content.json
- Still chasing network publish problems, added more debug info

ZeroHello:
- Your and the latest ZeroNet version added to top right corner (please update if you dont see it)


title: ZeroBlog features
body:
Initial version (Jan 24, 2014):

* Site avatar generated by site address
* Distraction-free inline edit: Post title, date, body, Site title, description, links
* Post format using [markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
* Code block [syntax highlight](#code-highlight-demos) using [highlight.js](https://highlightjs.org/)
* Create & Delete post
* Sign & Publish from web
* Fold blog post: Content after first `---` won't appear at listing
* Shareable, friendly post urls


Todo:

* ~~Better content editor (contenteditable seemed like a good idea, but tricky support of copy/paste makes it more pain than gain)~~
* Image upload to post & blog avatar
* Paging
* Searching
* ~~Quick cheat-sheet using markdown~~

---

## Code highlight demos
### Server-side site publishing (UiWebsocket.py):
```py
def actionSitePublish(self, to, params):
	site = self.site
	if not site.settings["own"]: return self.response(to, "Forbidden, you can only modify your own sites")

	# Signing
	site.loadContent(True) # Reload content.json, ignore errors to make it up-to-date
	signed = site.signContent(params[0]) # Sign using private key sent by user
	if signed:
		self.cmd("notification", ["done", "Private key correct, site signed!", 5000])  # Display message for 5 sec
	else:
		self.cmd("notification", ["error", "Site sign failed: invalid private key."])
		self.response(to, "Site sign failed")
		return
	site.loadContent(True) # Load new content.json, ignore errors

	# Publishing
	if not site.settings["serving"]: # Enable site if paused
		site.settings["serving"] = True
		site.saveSettings()
		site.announce()

	published = site.publish(5) # Publish to 5 peer

	if published>0: # Successfuly published
		self.cmd("notification", ["done", "Site published to %s peers." % published, 5000])
		self.response(to, "ok")
		site.updateWebsocket() # Send updated site data to local websocket clients
	else:
		if len(site.peers) == 0:
			self.cmd("notification", ["info", "No peers found, but your site is ready to access."])
			self.response(to, "No peers found, but your site is ready to access.")
		else:
			self.cmd("notification", ["error", "Site publish failed."])
			self.response(to, "Site publish failed.")
```


### Client-side site publish (ZeroBlog.coffee)
```coffee
# Sign and Publish site
publish: =>
	if not @server_info.ip_external # No port open
		@cmd "wrapperNotification", ["error", "To publish the site please open port <b>#{@server_info.fileserver_port}</b> on your router"]
		return false
	@cmd "wrapperPrompt", ["Enter your private key:", "password"], (privatekey) => # Prompt the private key
		$(".publishbar .button").addClass("loading")
		@cmd "sitePublish", [privatekey], (res) =>
			$(".publishbar .button").removeClass("loading")
			@log "Publish result:", res

	return false # Ignore link default event
```


