? Editing: Post:21.body Save Delete Cancel
Content changed Sign & Publish new content

BinChan's ZeroNotes

Messy Notes about using ZeroNet and other things
All code published here are under CC-BY-SA licence, if not compatible, then MIT license X)

Follow in NewsfeedFollowing

TOC by date
TOC by tag
View in light theme

Latest comments:

Add new post


21 hours ago · 2 min read ·

Read more

Not found

ZeroNet on a Raspberry Pi 2

on Dec 20, 2016
tag: raspi zeronet

My ZeroNet Node (Version 0.5.1 rev1781) is on a raspberry pi 2, system ArchlinuxARM (been long time not update), run quite smooth. I also tried to install it on a pi 1, but failed. Why? Not interested in looking into those logs anymore ~ Because I have a working machine now :3

I start zeronet from tmux with $ python2 /path/to/zeronet/zeronet.py --ui_ip MY_Local_static_ip
To setup a static ip, I also go to router control panel to lock the ip for my pi.

Try to add --ui_restrict argument, but failed, log said "too few arguments".

  • setup temporary python2 env, start with $ /path/to/zeronet/zeronet.py, failed.
  • $ grep -rin /path/to/zeronet/src/ -e ui_restr, the argument mainly locates at /Ui/UiRequest.py:45: and /Config.py:144:.
    The culprit seems from Config.py: nargs='*'. Add --trackers arguments report same problem. Reference official docs,
    add #!/usr/bin/env python at the top of Config.py, same,
    change nargs='*' to nargs='+', same ...
    delete nargs='*', ok, now I can add one restricted ip. But I have multiple devices.
    So finally I directly added my ips in /Ui/UiRequest.py:

    -if config.ui_restrict and self.env['REMOTE_ADDR'] not in config.ui_restrict:
    +if self.env['REMOTE_ADDR'] not in [ip1, ip2, ip3]:

    delete /Ui/UiRequest.pycand restart zeronet, guess it work ~

PS: Finally find a perfect solution, 'too few arguments' is because that last argument should not be multi-parameter. So changing the command to $ python2 /path/to/zeronet/zeronet.py --ui_retrict ip1 ip2 --ui_ip MY_Local_static_ip does the magic \o/

Other Issues:

  1. Port 15441 shows 'Close' on ZeroHello, re-check opened port failed, log also reported failed. But... UPnP successfully open a 15441 port for ZeroNet and my pi ip,
    using port forwarding, same.
    $ netstat -tuplen:
    tcp 0 0* LISTEN 1000 4065805 17384/python2.7
    Anyway, I can seed my local website to clearnet proxy, so, enough ...

    • PS: someone mentioned that the port may be forbidden at ISP level.
  2. ZeroMail always has one file that updates failed.
    Solution: from ZeroMail zite Control panel (drag the right menu icon to left to open it) or from file /path/to/zeronet/data/sites.json, I can find the corrupted file name, in my case it's $MAIL_ZITE_PATH/data/users/1DSKBQLWoFjHWt922n6ez2PxYTb3CvfeRJ/content.json, the file doesn't exist in my local storage, but there is data.json, so I directly delete the folder 1DSKBQLWoFjHWt922n6ez2PxYTb3CvfeRJ, check files of and update ZeroMail, and it works ~ Interestingly in NullPaste there is also a file that fails to update. It's a data.json file and in local only a content.json file exists. The method above works again ~ Guess that's enough to tell something.

    • PS: someone mentioned that deleting part of the zite will corrupt the database. I need further study about it.
    • PS2: For own zite, a solution from someone:

      Those 1 file errors are annoying. The most effective way I found to get rid of them is going to the content.json and removing all the file links with sha512 (resetting to "files": {},). Afterwards I resign and boom the error goes away. :D

  3. Enable UiPassword plugin, but with --ui_password ZeroBlog didn't render correctly, ZeroHello later totally didn't show anything. Maybe had something to do with browser cache. Didn't test further ...

    • PS: weakish mentioned that password is transferred over insecure HTTP protocol, so it's not secure. He also mentioned a better solution:

      Alternatively, you can just start ZeroNet on remote machine as normal, without --ui_ip, UiPassword, reverse proxy, SSL, etc.
      And run this command at local machine:
      ssh -L 43110: -N username@remote
      Then you can just access on your local machine, securely.

  4. ... (forget, maybe add later^TM)

0 Comment:

user_name1 day ago
Select user
  • Welcome to ZeroMessage!
This page is a snapshot of ZeroNet. Start your own ZeroNet for complete experience. Learn More