HelloZeroNet / ZeroNet

ZeroNet - Decentralized websites using Bitcoin crypto and BitTorrent network
https://zeronet.io
Other
18.36k stars 2.27k forks source link

ZeroBundle does not work on OSX 10.8 #363

Closed HelloZeroNet closed 7 years ago

HelloZeroNet commented 8 years ago

The error: can't open the application ZeroNet because the classic environment is no longer supported.

I have no access to 10.8 Mac, so need suggestions how to make better .app. (currently its a bash script: https://github.com/HelloZeroNet/ZeroBundle/blob/master/ZeroNet.app)

An icon also would be nice.

gsmiro commented 8 years ago

I run a macosx and I'm getting the error. Now I'm trying to understand the rationale behind the scripts. Why do they call Python from Python/Python? Is Python assumed to be installed? Any pointers would help.

HelloZeroNet commented 8 years ago

the zerobundle package has the required python with the dependencies, so we don't use the system python, but the packed one: https://github.com/HelloZeroNet/ZeroBundle/releases/download/0.1.1/ZeroBundle-mac-v0.1.1.zip

Can you try to open a terminal and run it with bash ZeroNet.app?

gsmiro commented 8 years ago

Both bash ZeroNet.app and open ZeroNet.app worked with the release above. Double clicking the app does nothing though.

gsmiro commented 8 years ago

Wouldn't it be better to package the app as a proper Application bundle, with Info.plist and the folder structure as pointed here?

HelloZeroNet commented 8 years ago

thanks for testing, yeah a proper Application bundle would help, I will try ti when I have Mac access, or if you could try to create one and test it that would be great.

gsmiro commented 8 years ago

Ok. I'll look into it as soon as I can. Can you point me out to the ZeroNet build instructions, or how you guys package it into one single download file? If it's automated I'll need to look into it.

HelloZeroNet commented 8 years ago

The ZeroBundle package contains the Python binaries with every dependency. When you first time start zeronet it downloads the latest version from github, unpacks it to ZeroNet directory and starts it. There is a semi-auto update method in ZeroNet which is - when requested - it is re-downloads the latest source code, overwrite the files in ZeroNet dir and and restarts itself.

So I think - to keep the built-in update method working - the best would be to convert ZeroNet.app bash script to proper application bundle end leave the rest as it is.

attilagyorffy commented 8 years ago

FYI: I just ran into the same "classic environment no longer supported" issue on 10.9.5 (using the download through the site)

drjmedulla commented 8 years ago

Downloaded Zeronet per https://zeronet.io/ started up and worked great. Tried to re-start the Zeronet Desktop App after my laptop went to sleep. [Mac OS 10.11.3] This is what I get:

**Server error

Err: Exception: File not allowed: data/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D/index.html in UiServer.py line 81 > UiRequest.py line 82 > UiRequest.py line 209 > UiRequest.py line 282 > SiteStorage.py line 230 > SiteStorage.py line 251

Please report it if you think this an error.

Details:**

{ "GATEWAY_INTERFACE": "CGI/1.1", "HTTPACCEPT": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/_;q=0.8", "HTTP_ACCEPT_ENCODING": "gzip, deflate, sdch", "HTTP_ACCEPT_LANGUAGE": "en-US,en;q=0.8", "HTTP_CONNECTION": "keep-alive", "HTTP_HOST": "127.0.0.1:43110", "HTTP_UPGRADE_INSECURE_REQUESTS": "1", "HTTP_USER_AGENT": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36", "PATH_INFO": "/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D", "QUERY_STRING": "", "REMOTE_ADDR": "127.0.0.1", "REMOTE_PORT": "61010", "REQUEST_METHOD": "GET", "SCRIPT_NAME": "", "SERVER_NAME": "1.0.0.127.in-addr.arpa", "SERVER_PORT": "43110", "SERVER_PROTOCOL": "HTTP/1.1", "SERVER_SOFTWARE": "gevent/1.0 Python/2.7", "arguments": { "action": "main", "batch": false, "coffeescript_compiler": null, "config_file": "zeronet.conf", "connected_limit": 15, "data_dir": "data", "debug": false, "debug_gevent": false, "debug_socket": false, "disable_encryption": false, "disable_sslcompression": true, "disable_udp": false, "fileserver_ip": "*", "fileserver_port": 15441, "homepage": "1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D", "ip_external": null, "keep_ssl_cert": false, "log_dir": "log", "max_files_opened": 2048, "msgpack_purepython": true, "open_browser": "default_browser", "proxy": null, "size_limit": 10, "stream_downloads": false, "tor": "enable", "tor_controller": "127.0.0.1:9051", "tor_proxy": "127.0.0.1:9050", "trackers": [ "zero://boot3rdez4rzn36x.onion:15441", "zero://boot.zeronet.io#f36ca555bee6ba216b14d10f38c16f7769ff064e0e37d887603548cc2e64191d:15441", "udp://tracker.coppersurfer.tk:6969", "udp://tracker.leechers-paradise.org:6969", "udp://9.rarbg.com:2710", "http://tracker.aletorrenty.pl:2710/announce", "http://explodie.org:6969/announce", "http://torrent.gresille.org/announce" ], "trackers_file": false, "ui_ip": "127.0.0.1", "ui_port": 43110, "ui_restrict": false, "use_openssl": true, "use_tempfiles": false, "verbose": false }, "plugins": [ "AnnounceZero", "CryptMessage", "Newsfeed", "Sidebar", "Stats", "Trayicon", "Zeroname" ], "version_gevent": "1.0.2", "version_python": "2.7.11 |Anaconda 2.5.0 (x86_64)| (default, Dec 6 2015, 18:57:58) \n[GCC 4.2.1 (Apple Inc. build 5577)]", "version_zeronet": "0.3.6 r1038", "wsgi.url_scheme": "http" }

HelloZeroNet commented 8 years ago

@drjmedulla Do you have any special (non-english) character in the directory where you unpacked it? Please open ZeroNet/log/debug.log file, search for not in allowed dir and paste the line here.

drjmedulla commented 8 years ago

1st Question: No, I do not have any special (non-english) characters in the directory.

I searched not in allowed dir and did not find any associated code.

Here is the closest I found: [2016-03-18 20:59:33,542] ERROR Site:1Name2..hM9F Content.json not exist: data/1Name2NXVi1RDPDgf5617UoW7xA6YrhM9F/content.json

HelloZeroNet commented 8 years ago

@drjmedulla Can you check if ZeroNet is not running twice? (eg via taskmanager, search for python.exe) If not helps please send your log files (debug.log and debug-last.log) to hello@zeronet.io

drjmedulla commented 8 years ago

Python 2.7 is only running once. I attached a screenshot of Python running as well as the log files Zipped.

screen shot 2016-03-19 at 8 30 07 am

Archive.zip

HelloZeroNet commented 8 years ago

The log file says: [2016-03-18 21:12:51,207] ERROR Ui.UiServer Web interface bind error, must be running already, exiting.... [Errno 48] Address already in use: ('127.0.0.1', 43110) Which means something is running on port 43110, please try to kill the python process and try again.

stman commented 8 years ago

Hello. If you need some help to investigate the case, do not hesitate to ask me. I am an experienced Mac OS X "Objective-C" and "C" experienced developer.

HelloZeroNet commented 8 years ago

We need a proper way to pack a bash script into an .app @drjmedulla's problem is probably not related to this

probably this helps, but i have no mac access atm to try ti: https://mathiasbynens.be/notes/shell-script-mac-apps

stman commented 8 years ago

You are experiencing the exact same problem as most P2P developpers porting their code to Mac OS X : YaCy had it, Twister has it, you have it.

What I recommand is to build a little native Mac OS X app to launch all necessary processes your application needs, but also that could be used, with a GUI (Menu, Icon in task bar) to configure the daemon and the options so that users don't have to edit text files and so on.

Regarding the libraries, I recommand to include all dependant libraries in an already compiled format (*.a) in a true Mac OS X Application bundle, with the little native app.

The "Linux" way of doing things (Recompiling the source code of each library) is not recommanded to create easy to install Mac OS X Application bundles : Application Bundle where created / engineered to have all the libraries already compiled.

I am going to do this work for Twister, but I would be really glad to do it for ZeroNet too :-)

You can count on my active cooperation to solving this little issue, it will be an honor for me.

Kind regards,

Stman.

HelloZeroNet commented 8 years ago

I was able to make it work on 10.8, but now it's not working on 10.11 :( (Unidentified developer error)

I have uploaded it here, if anyone would able to confirm if its working or not that would be nice: https://github.com/HelloZeroNet/ZeroBundle/releases/download/0.1.1/ZeroBundle-mac-osx-10.8-v0.1.1.zip

Other possibility:

#!/bin/bash
osascript -e "tell application \"System Events\" to set visible of application process \"Terminal\" to false"

cd "$(dirname "$0")/../ZeroNet"
bash ../Python/python start.py "$@"

But this will keep the terminal icon on dock, any workaround?

HelloZeroNet commented 8 years ago

I'm not familiar with OS X app ecosystem, but if we manage to sign the ZeroNet.app, then it would work without any errors (Unidentified developer error) on every platform or do we need to submit it to appstore?

stman commented 8 years ago

If you are a registered Developper, one can publish either on the MacAppStore, but in that case the application must meet Apple requirements, and the rules for the MacAppStore are more open than those applying to iOS Apps,

OR

One can make the binary, signed with his Dev account, on any "custom server" .

Both solutions would end this issue "Un-identifyed" developer.

HelloZeroNet commented 8 years ago

So can anyone sign the https://github.com/HelloZeroNet/ZeroBundle/tree/master/ZeroNet.app/Contents application please?

stman commented 8 years ago

With pleasure....

ghost commented 7 years ago

So, there a mac app signed now ? Problem solved ?

HelloZeroNet commented 7 years ago

Yep, it should work now