Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zeronet.py siteSign ... is not working to sign user's content.json file #212

Open
slrslr opened this issue Apr 28, 2023 · 1 comment
Open

Comments

@slrslr
Copy link

slrslr commented Apr 28, 2023

Step 1: Please describe your environment

  • ZeroNet version: ZeroNetX (0.8.5 r4625) and Zeronet-Conservancy (0.7.8.1+ r5041)
  • Operating system: Linux Debian
  • Web browser: Firefox
  • Tor status: available

Step 2: Describe the problem:

Last hour, i was trying to use both ZeroNetX (0.8.5 r4625) and ZeronetC. (0.7.8.1+ r5041) command to sign content.json file of one user of my ZeroTalk clone site. -> inside user's content.json file is "modified" variable and it does not change after signing command is executed.

Steps to reproduce:

  1. open your user contributed site like zeroblog/zerotalk (in my case it is zerotalk++ clone and find some topic which first/leading post you want to modify. Copy that user public key from address bar.
  2. go to that user directory, for example: cd /home/you/zeronet/data/yoursite/data/users/userpubkey/
  3. optionally make small edit in the text of the user post by editing data.json
  4. note the modification time of the users's content.json file: grep mod content.json
  5. now try to sign and publish that:
    python3 /home/you/zeronet/core/zeronet.py siteSign YourSiteAddress YourSitePrivateKey --inner_path content.json --publish
  6. check content.json modification time again to compare with previous state: grep mod content.json

some errors spotted during the task:

ZNX: WebSocket receive error: cancel_wait_ex: [Errno 9] File descriptor was closed in another greenlet in UiWebsocket.py line 72 > lib/gevent_ws/init.py line 80 > 86 > 48 > 105 > 125 > 156 > /_socket3.py line 454 > ...

ZNC: WebSocket receive error: ConnectionResetError: [Errno 104] Connection reset by peer in UiWebsocket.py line 74 > lib/gevent_ws/init.py line 80 > 86 > 48 > 105 > 125 > 156 > /_socketcommon.py line 657

In case you can reproduce it, it is important to fix this as i am not aware about other way site admin can automate spam removal. If there is such way and you will not fix this issue without big delay, then, please instruct how to automate other way. Thank You.

@slrslr
Copy link
Author

slrslr commented Apr 30, 2023

siteSign is working, yet it does not accept all paths. Apparently accepted paths are:

--inner_path /data/users/useraddr/content.json
--inner_path data/users/useraddr/content.json

Though on Linux, I am used to the practice that when utility wants file path, i can enter absolute path or relative path to current directory i am at, but unfortunately Zeronet does not seem to work that way, which is wrong IMO.

Full path and relative path (cd zeronet;./zeronet.py siteSign ... --inner_path ./data/siteaddr/data/users/content.json) cause it to say:

  • Sign error: VerifyError: No rules in main.py line 228 > ContentManager.py line 771 > 887 > 898

Can you please allow user to define absolute/full and relative path to json file?

Beside that, please consider changing "zeronet.py siteSign -h" output from:

--inner_path inner_path
File you want to sign (default: content.json)

to something like

--inner_path inner_path
File you want to sign. You can not use absolute or relative path, but only input content.json or data/users/content.json ... (default: content.json)

i was unable to find "File you want to sign" phrase inside this repository code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant