diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..db8c40a5 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://zeronet.io/docs/help_zeronet/donate/ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..6f2a748e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,49 @@ +name: tests + +on: [push] + +jobs: + test: + + runs-on: ubuntu-16.04 + strategy: + max-parallel: 16 + matrix: + python-version: [3.5, 3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v1 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + - name: Prepare for installation + run: | + python3 -m pip install setuptools + python3 -m pip install --upgrade pip wheel + python3 -m pip install --upgrade codecov coveralls flake8 mock pytest==4.6.3 pytest-cov selenium + + - name: Install + run: | + python3 -m pip install --upgrade -r requirements.txt + python3 -m pip list + + - name: Prepare for tests + run: | + openssl version -a + echo 0 | sudo tee /proc/sys/net/ipv6/conf/all/disable_ipv6 + + - name: Test + run: | + catchsegv python3 -m pytest src/Test --cov=src --cov-config src/Test/coverage.ini + export ZERONET_LOG_DIR="log/CryptMessage"; catchsegv python3 -m pytest -x plugins/CryptMessage/Test + export ZERONET_LOG_DIR="log/Bigfile"; catchsegv python3 -m pytest -x plugins/Bigfile/Test + export ZERONET_LOG_DIR="log/AnnounceLocal"; catchsegv python3 -m pytest -x plugins/AnnounceLocal/Test + export ZERONET_LOG_DIR="log/OptionalManager"; catchsegv python3 -m pytest -x plugins/OptionalManager/Test + export ZERONET_LOG_DIR="log/Multiuser"; mv plugins/disabled-Multiuser plugins/Multiuser && catchsegv python -m pytest -x plugins/Multiuser/Test + export ZERONET_LOG_DIR="log/Bootstrapper"; mv plugins/disabled-Bootstrapper plugins/Bootstrapper && catchsegv python -m pytest -x plugins/Bootstrapper/Test + find src -name "*.json" | xargs -n 1 python3 -c "import json, sys; print(sys.argv[1], end=' '); json.load(open(sys.argv[1])); print('[OK]')" + find plugins -name "*.json" | xargs -n 1 python3 -c "import json, sys; print(sys.argv[1], end=' '); json.load(open(sys.argv[1])); print('[OK]')" + flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics --exclude=src/lib/pyaes/ diff --git a/.gitignore b/.gitignore index b3795821..38dd3a34 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,10 @@ __pycache__/ # Hidden files .* +!/.github !/.gitignore !/.travis.yml +!/.gitlab-ci.yml # Temporary files *.bak @@ -28,3 +30,6 @@ tools/phantomjs # ZeroNet config file zeronet.conf + +# ZeroNet log files +log/* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..f3e1ed29 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,48 @@ +stages: + - test + +.test_template: &test_template + stage: test + before_script: + - pip install --upgrade pip wheel + # Selenium and requests can't be installed without a requests hint on Python 3.4 + - pip install --upgrade requests>=2.22.0 + - pip install --upgrade codecov coveralls flake8 mock pytest==4.6.3 pytest-cov selenium + - pip install --upgrade -r requirements.txt + script: + - pip list + - openssl version -a + - python -m pytest -x plugins/CryptMessage/Test --color=yes + - python -m pytest -x plugins/Bigfile/Test --color=yes + - python -m pytest -x plugins/AnnounceLocal/Test --color=yes + - python -m pytest -x plugins/OptionalManager/Test --color=yes + - python -m pytest src/Test --cov=src --cov-config src/Test/coverage.ini --color=yes + - mv plugins/disabled-Multiuser plugins/Multiuser + - python -m pytest -x plugins/Multiuser/Test --color=yes + - mv plugins/disabled-Bootstrapper plugins/Bootstrapper + - python -m pytest -x plugins/Bootstrapper/Test --color=yes + - flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics --exclude=src/lib/pyaes/ + +test:py3.4: + image: python:3.4.3 + <<: *test_template + +test:py3.5: + image: python:3.5.7 + <<: *test_template + +test:py3.6: + image: python:3.6.9 + <<: *test_template + +test:py3.7-openssl1.1.0: + image: python:3.7.0b5 + <<: *test_template + +test:py3.7-openssl1.1.1: + image: python:3.7.4 + <<: *test_template + +test:py3.8: + image: python:3.8.0b3 + <<: *test_template \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d8821001..bdaafa22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,7 @@ python: - 3.5 - 3.6 - 3.7 - - 3.8-dev -dist: xenial + - 3.8 services: - docker cache: pip @@ -25,14 +24,19 @@ before_script: sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'; fi script: - - python -m pytest -x plugins/CryptMessage/Test - - python -m pytest -x plugins/Bigfile/Test - - python -m pytest -x plugins/AnnounceLocal/Test - - python -m pytest -x plugins/OptionalManager/Test - - python -m pytest src/Test --cov=src --cov-config src/Test/coverage.ini - - mv plugins/disabled-Multiuser plugins/Multiuser && python -m pytest -x plugins/Multiuser/Test - - mv plugins/disabled-Bootstrapper plugins/Bootstrapper && python -m pytest -x plugins/Bootstrapper/Test - - flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics --exclude=src/lib/pybitcointools/ + - catchsegv python -m pytest src/Test --cov=src --cov-config src/Test/coverage.ini + - export ZERONET_LOG_DIR="log/CryptMessage"; catchsegv python -m pytest -x plugins/CryptMessage/Test + - export ZERONET_LOG_DIR="log/Bigfile"; catchsegv python -m pytest -x plugins/Bigfile/Test + - export ZERONET_LOG_DIR="log/AnnounceLocal"; catchsegv python -m pytest -x plugins/AnnounceLocal/Test + - export ZERONET_LOG_DIR="log/OptionalManager"; catchsegv python -m pytest -x plugins/OptionalManager/Test + - export ZERONET_LOG_DIR="log/Multiuser"; mv plugins/disabled-Multiuser plugins/Multiuser && catchsegv python -m pytest -x plugins/Multiuser/Test + - export ZERONET_LOG_DIR="log/Bootstrapper"; mv plugins/disabled-Bootstrapper plugins/Bootstrapper && catchsegv python -m pytest -x plugins/Bootstrapper/Test + - find src -name "*.json" | xargs -n 1 python3 -c "import json, sys; print(sys.argv[1], end=' '); json.load(open(sys.argv[1])); print('[OK]')" + - find plugins -name "*.json" | xargs -n 1 python3 -c "import json, sys; print(sys.argv[1], end=' '); json.load(open(sys.argv[1])); print('[OK]')" + - flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics --exclude=src/lib/pyaes/ +after_failure: + - zip -r log.zip log/ + - curl --upload-file ./log.zip https://transfer.sh/log.zip after_success: - codecov - coveralls --rcfile=src/Test/coverage.ini diff --git a/README-zh-cn.md b/README-zh-cn.md index 103194ea..fabdb0e5 100644 --- a/README-zh-cn.md +++ b/README-zh-cn.md @@ -1,51 +1,49 @@ -# ZeroNet [![Build Status](https://travis-ci.org/HelloZeroNet/ZeroNet.svg?branch=master)](https://travis-ci.org/HelloZeroNet/ZeroNet) [![Documentation](https://img.shields.io/badge/docs-faq-brightgreen.svg)](https://zeronet.io/docs/faq/) [![Help](https://img.shields.io/badge/keep_this_project_alive-donate-yellow.svg)](https://zeronet.io/docs/help_zeronet/donate/) +# ZeroNet [![Build Status](https://travis-ci.org/HelloZeroNet/ZeroNet.svg?branch=py3)](https://travis-ci.org/HelloZeroNet/ZeroNet) [![Documentation](https://img.shields.io/badge/docs-faq-brightgreen.svg)](https://zeronet.io/docs/faq/) [![Help](https://img.shields.io/badge/keep_this_project_alive-donate-yellow.svg)](https://zeronet.io/docs/help_zeronet/donate/) [English](./README.md) 使用 Bitcoin 加密和 BitTorrent 网络的去中心化网络 - https://zeronet.io -## 为什么? +## 为什么? -* 我们相信开放,自由,无审查的网络 +* 我们相信开放,自由,无审查的网络和通讯 * 不会受单点故障影响:只要有在线的节点,站点就会保持在线 -* 无托管费用: 站点由访问者托管 -* 无法关闭: 因为节点无处不在 -* 快速并可离线运行: 即使没有互联网连接也可以使用 +* 无托管费用:站点由访问者托管 +* 无法关闭:因为节点无处不在 +* 快速并可离线运行:即使没有互联网连接也可以使用 ## 功能 * 实时站点更新 * 支持 Namecoin 的 .bit 域名 - * 安装方便: 只需解压并运行 + * 安装方便:只需解压并运行 * 一键克隆存在的站点 - * 无需密码、基于 [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) 的认证:用与比特币钱包相同的加密方法用来保护你的账户 -你的账户被使用和比特币钱包相同的加密方法 - * 内建 SQL 服务器和 P2P 数据同步: 让开发更简单并提升加载速度 - * 匿名性: 完整的 Tor 网络支持,支持通过 .onion 隐藏服务相互连接而不是通过IPv4地址连接 + * 无需密码、基于 [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) + 的认证:您的账户被与比特币钱包相同的加密方法保护 + * 内建 SQL 服务器和 P2P 数据同步:让开发更简单并提升加载速度 + * 匿名性:完整的 Tor 网络支持,支持通过 .onion 隐藏服务相互连接而不是通过 IPv4 地址连接 * TLS 加密连接 * 自动打开 uPnP 端口 - * 插件和多用户 (开放式代理) 支持 - * 全平台兼容 + * 多用户(openproxy)支持的插件 + * 适用于任何浏览器 / 操作系统 ## 原理 -* 在你运行`zeronet.py`后你将可以通过`http://127.0.0.1:43110/{zeronet_address}` (比如. -`http://127.0.0.1:43110/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D`)。访问 zeronet 中的站点。 +* 在运行 `zeronet.py` 后,您将可以通过 + `http://127.0.0.1:43110/{zeronet_address}`(例如: + `http://127.0.0.1:43110/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D`)访问 zeronet 中的站点 +* 在您浏览 zeronet 站点时,客户端会尝试通过 BitTorrent 网络来寻找可用的节点,从而下载需要的文件(html,css,js...) +* 您将会储存每一个浏览过的站点 +* 每个站点都包含一个名为 `content.json` 的文件,它储存了其他所有文件的 sha512 散列值以及一个通过站点私钥生成的签名 +* 如果站点的所有者(拥有站点地址的私钥)修改了站点,并且他 / 她签名了新的 `content.json` 然后推送至其他节点, + 那么这些节点将会在使用签名验证 `content.json` 的真实性后,下载修改后的文件并将新内容推送至另外的节点 -* 在你浏览 zeronet 站点时,客户端会尝试通过 BitTorrent 网络来寻找可用的节点,从而下载需要的文件 (html, css, js...) - -* 你将会储存每一个浏览过的站点 -* 每个站点都包含一个名为 `content.json` ,它储存了其他所有文件的 sha512 hash 值 - 和一个通过站点私钥建立的签名 -* 如果站点的所有者 (拥有私钥的那个人) 修改了站点, 并且他/她签名了新的 `content.json` 然后推送至其他节点, -那么所有节点将会在验证 `content.json` 的真实性 (使用签名)后, 下载修改后的文件并推送至其他节点。 - -#### [有关于 ZeroNet 加密, 站点更新, 多用户站点的幻灯片 »](https://docs.google.com/presentation/d/1qBxkroB_iiX2zHEn0dt-N-qRZgyEzui46XS2hEa3AA4/pub?start=false&loop=false&delayms=3000) +#### [关于 ZeroNet 加密,站点更新,多用户站点的幻灯片 »](https://docs.google.com/presentation/d/1_2qK1IuOKJ51pgBvllZ9Yu7Au2l551t3XBgyTSvilew/pub?start=false&loop=false&delayms=3000) #### [常见问题 »](https://zeronet.io/docs/faq/) -#### [ZeroNet开发者文档 »](https://zeronet.io/docs/site_development/getting_started/) +#### [ZeroNet 开发者文档 »](https://zeronet.io/docs/site_development/getting_started/) ## 屏幕截图 @@ -53,123 +51,60 @@ ![Screenshot](https://i.imgur.com/H60OAHY.png) ![ZeroTalk](https://zeronet.io/docs/img/zerotalk.png) -#### [在 ZeroNet 文档里查看更多的屏幕截图 »](https://zeronet.io/docs/using_zeronet/sample_sites/) +#### [ZeroNet 文档中的更多屏幕截图 »](https://zeronet.io/docs/using_zeronet/sample_sites/) -## 如何加入 ? +## 如何加入 -* 下载 ZeroBundle 文件包: - * [Microsoft Windows](https://github.com/HelloZeroNet/ZeroNet-win/archive/dist/ZeroNet-win.zip) - * [Apple macOS](https://github.com/HelloZeroNet/ZeroNet-mac/archive/dist/ZeroNet-mac.zip) - * [Linux 64bit](https://github.com/HelloZeroNet/ZeroBundle/raw/master/dist/ZeroBundle-linux64.tar.gz) - * [Linux 32bit](https://github.com/HelloZeroNet/ZeroBundle/raw/master/dist/ZeroBundle-linux32.tar.gz) -* 解压缩 -* 运行 `ZeroNet.exe` (win), `ZeroNet(.app)` (osx), `ZeroNet.sh` (linux) +### Windows -### Linux 命令行 + - 下载 [ZeroNet-py3-win64.zip](https://github.com/HelloZeroNet/ZeroNet-win/archive/dist-win64/ZeroNet-py3-win64.zip) (18MB) + - 在任意位置解压缩 + - 运行 `ZeroNet.exe` + +### macOS -* `wget https://github.com/HelloZeroNet/ZeroBundle/raw/master/dist/ZeroBundle-linux64.tar.gz` -* `tar xvpfz ZeroBundle-linux64.tar.gz` -* `cd ZeroBundle` -* 执行 `./ZeroNet.sh` 来启动 + - 下载 [ZeroNet-dist-mac.zip](https://github.com/HelloZeroNet/ZeroNet-dist/archive/mac/ZeroNet-dist-mac.zip) (13.2MB) + - 在任意位置解压缩 + - 运行 `ZeroNet.app` + +### Linux (x86-64bit) -在你打开时他将会自动下载最新版本的 ZeroNet 。 + - `wget https://github.com/HelloZeroNet/ZeroNet-linux/archive/dist-linux64/ZeroNet-py3-linux64.tar.gz` + - `tar xvpfz ZeroNet-py3-linux64.tar.gz` + - `cd ZeroNet-linux-dist-linux64/` + - 使用以下命令启动 `./ZeroNet.sh` + - 在浏览器打开 http://127.0.0.1:43110/ 即可访问 ZeroHello 页面 + + __提示:__ 若要允许在 Web 界面上的远程连接,使用以下命令启动 `./ZeroNet.sh --ui_ip '*' --ui_restrict your.ip.address` -#### 在 Debian Linux 中手动安装 +### 从源代码安装 -* `sudo apt-get update` -* `sudo apt-get install msgpack-python python-gevent` -* `wget https://github.com/HelloZeroNet/ZeroNet/archive/master.tar.gz` -* `tar xvpfz master.tar.gz` -* `cd ZeroNet-master` -* 执行 `python2 zeronet.py` 来启动 -* 在你的浏览器中打开 http://127.0.0.1:43110/ - -### [FreeBSD](https://www.freebsd.org/) - -* `pkg install zeronet` 或者 `cd /usr/ports/security/zeronet/ && make install clean` -* `sysrc zeronet_enable="YES"` -* `service zeronet start` -* 在你的浏览器中打开 http://127.0.0.1:43110/ - -### [Vagrant](https://www.vagrantup.com/) - -* `vagrant up` -* 通过 `vagrant ssh` 连接到 VM -* `cd /vagrant` -* 运行 `python2 zeronet.py --ui_ip 0.0.0.0` -* 在你的浏览器中打开 http://127.0.0.1:43110/ - -### [Docker](https://www.docker.com/) -* `docker run -d -v :/root/data -p 26552:26552 -p 43110:43110 nofish/zeronet` -* 这个 Docker 镜像包含了 Tor ,但默认是禁用的,因为一些托管商不允许你在他们的服务器上运行 Tor。如果你希望启用它, -设置 `ENABLE_TOR` 环境变量为 `true` (默认: `false`). E.g.: - - `docker run -d -e "ENABLE_TOR=true" -v :/root/data -p 26552:26552 -p 43110:43110 nofish/zeronet` -* 在你的浏览器中打开 http://127.0.0.1:43110/ - -### [Virtualenv](https://virtualenv.readthedocs.org/en/latest/) - -* `virtualenv env` -* `source env/bin/activate` -* `pip install msgpack gevent` -* `python2 zeronet.py` -* 在你的浏览器中打开 http://127.0.0.1:43110/ + - `wget https://github.com/HelloZeroNet/ZeroNet/archive/py3/ZeroNet-py3.tar.gz` + - `tar xvpfz ZeroNet-py3.tar.gz` + - `cd ZeroNet-py3` + - `sudo apt-get update` + - `sudo apt-get install python3-pip` + - `sudo python3 -m pip install -r requirements.txt` + - 使用以下命令启动 `python3 zeronet.py` + - 在浏览器打开 http://127.0.0.1:43110/ 即可访问 ZeroHello 页面 ## 现有限制 -* ~~没有类似于 BitTorrent 的文件拆分来支持大文件~~ (已添加大文件支持) -* ~~没有比 BitTorrent 更好的匿名性~~ (已添加内置的完整 Tor 支持) -* 传输文件时没有压缩~~和加密~~ (已添加 TLS 支持) +* ~~没有类似于 torrent 的文件拆分来支持大文件~~ (已添加大文件支持) +* ~~没有比 BitTorrent 更好的匿名性~~ (已添加内置的完整 Tor 支持) +* 传输文件时没有压缩~~和加密~~ (已添加 TLS 支持) * 不支持私有站点 -## 如何创建一个 ZeroNet 站点? +## 如何创建一个 ZeroNet 站点? + * 点击 [ZeroHello](http://127.0.0.1:43110/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D) 站点的 **⋮** > **「新建空站点」** 菜单项 + * 您将被**重定向**到一个全新的站点,该站点只能由您修改 + * 您可以在 **data/[您的站点地址]** 目录中找到并修改网站的内容 + * 修改后打开您的网站,将右上角的「0」按钮拖到左侧,然后点击底部的**签名**并**发布**按钮 -如果 zeronet 在运行,把它关掉 -执行: -```bash -$ zeronet.py siteCreate -... -- Site private key: 23DKQpzxhbVBrAtvLEc2uvk7DZweh4qL3fn3jpM3LgHDczMK2TtYUq -- Site address: 13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2 -... -- Site created! -$ zeronet.py -... -``` - -你已经完成了! 现在任何人都可以通过 -`http://localhost:43110/13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2` -来访问你的站点 - -下一步: [ZeroNet 开发者文档](https://zeronet.io/docs/site_development/getting_started/) - - -## 我要如何修改 ZeroNet 站点? - -* 修改位于 data/13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2 的目录. - 在你改好之后: - -```bash -$ zeronet.py siteSign 13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2 -- Signing site: 13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2... -Private key (input hidden): -``` - -* 输入你在创建站点时获得的私钥 - -```bash -$ zeronet.py sitePublish 13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2 -... -Site:13DNDk..bhC2 Publishing to 3/10 peers... -Site:13DNDk..bhC2 Successfuly published to 3 peers -- Serving files.... -``` - -* 就是这样! 你现在已经成功的签名并推送了你的更改。 - +接下来的步骤:[ZeroNet 开发者文档](https://zeronet.io/docs/site_development/getting_started/) ## 帮助这个项目 @@ -178,11 +113,11 @@ Site:13DNDk..bhC2 Successfuly published to 3 peers ### 赞助商 -* 在 OSX/Safari 下 [BrowserStack.com](https://www.browserstack.com) 带来更好的兼容性 +* [BrowserStack.com](https://www.browserstack.com) 使更好的 macOS/Safari 兼容性成为可能 -#### 感谢! +#### 感谢您! -* 更多信息, 帮助, 变更记录和 zeronet 站点: https://www.reddit.com/r/zeronet/ -* 在: [#zeronet @ FreeNode](https://kiwiirc.com/client/irc.freenode.net/zeronet) 和我们聊天,或者使用 [gitter](https://gitter.im/HelloZeroNet/ZeroNet) +* 更多信息,帮助,变更记录和 zeronet 站点:https://www.reddit.com/r/zeronet/ +* 前往 [#zeronet @ FreeNode](https://kiwiirc.com/client/irc.freenode.net/zeronet) 或 [gitter](https://gitter.im/HelloZeroNet/ZeroNet) 和我们聊天 * [这里](https://gitter.im/ZeroNet-zh/Lobby)是一个 gitter 上的中文聊天室 -* Email: hello@noloop.me +* Email: hello@zeronet.io (PGP: [960F FF2D 6C14 5AA6 13E8 491B 5B63 BAE6 CB96 13AE](https://zeronet.io/files/tamas@zeronet.io_pub.asc)) diff --git a/README.md b/README.md index 4b981863..f48d7c32 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ZeroNet [![Build Status](https://travis-ci.org/HelloZeroNet/ZeroNet.svg?branch=master)](https://travis-ci.org/HelloZeroNet/ZeroNet) [![Documentation](https://img.shields.io/badge/docs-faq-brightgreen.svg)](https://zeronet.io/docs/faq/) [![Help](https://img.shields.io/badge/keep_this_project_alive-donate-yellow.svg)](https://zeronet.io/docs/help_zeronet/donate/) +# ZeroNet [![Build Status](https://travis-ci.org/HelloZeroNet/ZeroNet.svg?branch=py3)](https://travis-ci.org/HelloZeroNet/ZeroNet) [![Documentation](https://img.shields.io/badge/docs-faq-brightgreen.svg)](https://zeronet.io/docs/faq/) [![Help](https://img.shields.io/badge/keep_this_project_alive-donate-yellow.svg)](https://zeronet.io/docs/help_zeronet/donate/) Decentralized websites using Bitcoin crypto and the BitTorrent network - https://zeronet.io @@ -66,40 +66,32 @@ Decentralized websites using Bitcoin crypto and the BitTorrent network - https:/ - Download [ZeroNet-py3-win64.zip](https://github.com/HelloZeroNet/ZeroNet-win/archive/dist-win64/ZeroNet-py3-win64.zip) (18MB) - Unpack anywhere - Run `ZeroNet.exe` + +### macOS -### Other platforms: Install from source + - Download [ZeroNet-dist-mac.zip](https://github.com/HelloZeroNet/ZeroNet-dist/archive/mac/ZeroNet-dist-mac.zip) (13.2MB) + - Unpack anywhere + - Run `ZeroNet.app` + +### Linux (x86-64bit) + - `wget https://github.com/HelloZeroNet/ZeroNet-linux/archive/dist-linux64/ZeroNet-py3-linux64.tar.gz` + - `tar xvpfz ZeroNet-py3-linux64.tar.gz` + - `cd ZeroNet-linux-dist-linux64/` + - Start with: `./ZeroNet.sh` + - Open the ZeroHello landing page in your browser by navigating to: http://127.0.0.1:43110/ + + __Tip:__ Start with `./ZeroNet.sh --ui_ip '*' --ui_restrict your.ip.address` to allow remote connections on the web interface. -Fetch and extract the source: +### Install from source - wget https://github.com/HelloZeroNet/ZeroNet/archive/py3/ZeroNet-py3.tar.gz - tar xvpfz ZeroNet-py3.tar.gz - cd ZeroNet-py3 - -Install Python module dependencies either: - -* (Option A) into a [virtual env](https://virtualenv.readthedocs.org/en/latest/) - - ``` - virtualenv zeronet - source zeronet/bin/activate - python -m pip install -r requirements.txt - ``` - -* (Option B) into the system (requires root), for example, on Debian/Ubuntu: - - ``` - sudo apt-get update - sudo apt-get install python3-pip - sudo python3 -m pip install -r requirements.txt - ``` - -Start Zeronet: - - python3 zeronet.py - -Open the ZeroHello landing page in your browser by navigating to: - - http://127.0.0.1:43110/ + - `wget https://github.com/HelloZeroNet/ZeroNet/archive/py3/ZeroNet-py3.tar.gz` + - `tar xvpfz ZeroNet-py3.tar.gz` + - `cd ZeroNet-py3` + - `sudo apt-get update` + - `sudo apt-get install python3-pip` + - `sudo python3 -m pip install -r requirements.txt` + - Start with: `python3 zeronet.py` + - Open the ZeroHello landing page in your browser by navigating to: http://127.0.0.1:43110/ ## Current limitations @@ -111,49 +103,13 @@ Open the ZeroHello landing page in your browser by navigating to: ## How can I create a ZeroNet site? -Shut down zeronet if you are running it already - -```bash -$ zeronet.py siteCreate -... -- Site private key: 23DKQpzxhbVBrAtvLEc2uvk7DZweh4qL3fn3jpM3LgHDczMK2TtYUq -- Site address: 13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2 -... -- Site created! -$ zeronet.py -... -``` - -Congratulations, you're finished! Now anyone can access your site using -`http://localhost:43110/13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2` + * Click on **⋮** > **"Create new, empty site"** menu item on the site [ZeroHello](http://127.0.0.1:43110/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D). + * You will be **redirected** to a completely new site that is only modifiable by you! + * You can find and modify your site's content in **data/[yoursiteaddress]** directory + * After the modifications open your site, drag the topright "0" button to left, then press **sign** and **publish** buttons on the bottom Next steps: [ZeroNet Developer Documentation](https://zeronet.io/docs/site_development/getting_started/) - -## How can I modify a ZeroNet site? - -* Modify files located in data/13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2 directory. - After you're finished: - -```bash -$ zeronet.py siteSign 13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2 -- Signing site: 13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2... -Private key (input hidden): -``` - -* Enter the private key you got when you created the site, then: - -```bash -$ zeronet.py sitePublish 13DNDkMUExRf9Xa9ogwPKqp7zyHFEqbhC2 -... -Site:13DNDk..bhC2 Publishing to 3/10 peers... -Site:13DNDk..bhC2 Successfuly published to 3 peers -- Serving files.... -``` - -* That's it! You've successfully signed and published your modifications. - - ## Help keep this project alive - Bitcoin: 1QDhxQ6PraUZa21ET5fYUCPgdrwBomnFgX @@ -167,4 +123,4 @@ Site:13DNDk..bhC2 Successfuly published to 3 peers * More info, help, changelog, zeronet sites: https://www.reddit.com/r/zeronet/ * Come, chat with us: [#zeronet @ FreeNode](https://kiwiirc.com/client/irc.freenode.net/zeronet) or on [gitter](https://gitter.im/HelloZeroNet/ZeroNet) -* Email: hello@zeronet.io (PGP: CB9613AE) +* Email: hello@zeronet.io (PGP: [960F FF2D 6C14 5AA6 13E8 491B 5B63 BAE6 CB96 13AE](https://zeronet.io/files/tamas@zeronet.io_pub.asc)) diff --git a/plugins/AnnounceBitTorrent/AnnounceBitTorrentPlugin.py b/plugins/AnnounceBitTorrent/AnnounceBitTorrentPlugin.py index ae674c00..fab7bb1f 100644 --- a/plugins/AnnounceBitTorrent/AnnounceBitTorrentPlugin.py +++ b/plugins/AnnounceBitTorrent/AnnounceBitTorrentPlugin.py @@ -3,7 +3,7 @@ import urllib.request import struct import socket -import bencode +import lib.bencode_open as bencode_open from lib.subtl.subtl import UdpTrackerClient import socks import sockshandler @@ -133,9 +133,7 @@ class SiteAnnouncerPlugin(object): # Decode peers try: - peer_data = bencode.decode(response)["peers"] - if type(peer_data) is not bytes: - peer_data = peer_data.encode() + peer_data = bencode_open.loads(response)[b"peers"] response = None peer_count = int(len(peer_data) / 6) peers = [] diff --git a/plugins/AnnounceBitTorrent/plugin_info.json b/plugins/AnnounceBitTorrent/plugin_info.json new file mode 100644 index 00000000..824749ee --- /dev/null +++ b/plugins/AnnounceBitTorrent/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "AnnounceBitTorrent", + "description": "Discover new peers using BitTorrent trackers.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/AnnounceLocal/AnnounceLocalPlugin.py b/plugins/AnnounceLocal/AnnounceLocalPlugin.py index 0919762a..b9225966 100644 --- a/plugins/AnnounceLocal/AnnounceLocalPlugin.py +++ b/plugins/AnnounceLocal/AnnounceLocalPlugin.py @@ -120,12 +120,11 @@ class LocalAnnouncer(BroadcastServer.BroadcastServer): @PluginManager.registerTo("FileServer") class FileServerPlugin(object): def __init__(self, *args, **kwargs): - res = super(FileServerPlugin, self).__init__(*args, **kwargs) + super(FileServerPlugin, self).__init__(*args, **kwargs) if config.broadcast_port and config.tor != "always" and not config.disable_udp: self.local_announcer = LocalAnnouncer(self, config.broadcast_port) else: self.local_announcer = None - return res def start(self, *args, **kwargs): if self.local_announcer: diff --git a/plugins/AnnounceLocal/plugin_info.json b/plugins/AnnounceLocal/plugin_info.json new file mode 100644 index 00000000..2908cbf1 --- /dev/null +++ b/plugins/AnnounceLocal/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "AnnounceLocal", + "description": "Discover LAN clients using UDP broadcasting.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/AnnounceShare/plugin_info.json b/plugins/AnnounceShare/plugin_info.json new file mode 100644 index 00000000..0ad07e71 --- /dev/null +++ b/plugins/AnnounceShare/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "AnnounceShare", + "description": "Share possible trackers between clients.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/AnnounceZero/AnnounceZeroPlugin.py b/plugins/AnnounceZero/AnnounceZeroPlugin.py index dcaa04f0..7f31e052 100644 --- a/plugins/AnnounceZero/AnnounceZeroPlugin.py +++ b/plugins/AnnounceZero/AnnounceZeroPlugin.py @@ -21,6 +21,15 @@ def importHostClasses(): # Process result got back from tracker def processPeerRes(tracker_address, site, peers): added = 0 + + # Onion + found_onion = 0 + for packed_address in peers["onion"]: + found_onion += 1 + peer_onion, peer_port = helper.unpackOnionAddress(packed_address) + if site.addPeer(peer_onion, peer_port, source="tracker"): + added += 1 + # Ip4 found_ipv4 = 0 peers_normal = itertools.chain(peers.get("ip4", []), peers.get("ipv4", []), peers.get("ipv6", [])) @@ -29,13 +38,6 @@ def processPeerRes(tracker_address, site, peers): peer_ip, peer_port = helper.unpackAddress(packed_address) if site.addPeer(peer_ip, peer_port, source="tracker"): added += 1 - # Onion - found_onion = 0 - for packed_address in peers["onion"]: - found_onion += 1 - peer_onion, peer_port = helper.unpackOnionAddress(packed_address) - if site.addPeer(peer_onion, peer_port, source="tracker"): - added += 1 if added: site.worker_manager.onPeers() diff --git a/plugins/AnnounceZero/plugin_info.json b/plugins/AnnounceZero/plugin_info.json new file mode 100644 index 00000000..50e7cf7f --- /dev/null +++ b/plugins/AnnounceZero/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "AnnounceZero", + "description": "Announce using ZeroNet protocol.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/Benchmark/BenchmarkDb.py b/plugins/Benchmark/BenchmarkDb.py new file mode 100644 index 00000000..a767a3f4 --- /dev/null +++ b/plugins/Benchmark/BenchmarkDb.py @@ -0,0 +1,143 @@ +import os +import json +import contextlib +import time + +from Plugin import PluginManager +from Config import config + + +@PluginManager.registerTo("Actions") +class ActionsPlugin: + def getBenchmarkTests(self, online=False): + tests = super().getBenchmarkTests(online) + tests.extend([ + {"func": self.testDbConnect, "num": 10, "time_standard": 0.27}, + {"func": self.testDbInsert, "num": 10, "time_standard": 0.91}, + {"func": self.testDbInsertMultiuser, "num": 1, "time_standard": 0.57}, + {"func": self.testDbQueryIndexed, "num": 1000, "time_standard": 0.84}, + {"func": self.testDbQueryNotIndexed, "num": 1000, "time_standard": 1.30} + ]) + return tests + + + @contextlib.contextmanager + def getTestDb(self): + from Db import Db + path = "%s/benchmark.db" % config.data_dir + if os.path.isfile(path): + os.unlink(path) + schema = { + "db_name": "TestDb", + "db_file": path, + "maps": { + ".*": { + "to_table": { + "test": "test" + } + } + }, + "tables": { + "test": { + "cols": [ + ["test_id", "INTEGER"], + ["title", "TEXT"], + ["json_id", "INTEGER REFERENCES json (json_id)"] + ], + "indexes": ["CREATE UNIQUE INDEX test_key ON test(test_id, json_id)"], + "schema_changed": 1426195822 + } + } + } + + db = Db.Db(schema, path) + + yield db + + db.close() + if os.path.isfile(path): + os.unlink(path) + + def testDbConnect(self, num_run=1): + import sqlite3 + for i in range(num_run): + with self.getTestDb() as db: + db.checkTables() + yield "." + yield "(SQLite version: %s, API: %s)" % (sqlite3.sqlite_version, sqlite3.version) + + def testDbInsert(self, num_run=1): + yield "x 1000 lines " + for u in range(num_run): + with self.getTestDb() as db: + db.checkTables() + data = {"test": []} + for i in range(1000): # 1000 line of data + data["test"].append({"test_id": i, "title": "Testdata for %s message %s" % (u, i)}) + json.dump(data, open("%s/test_%s.json" % (config.data_dir, u), "w")) + db.updateJson("%s/test_%s.json" % (config.data_dir, u)) + os.unlink("%s/test_%s.json" % (config.data_dir, u)) + assert db.execute("SELECT COUNT(*) FROM test").fetchone()[0] == 1000 + yield "." + + def fillTestDb(self, db): + db.checkTables() + cur = db.getCursor() + cur.logging = False + for u in range(100, 200): # 100 user + data = {"test": []} + for i in range(100): # 1000 line of data + data["test"].append({"test_id": i, "title": "Testdata for %s message %s" % (u, i)}) + json.dump(data, open("%s/test_%s.json" % (config.data_dir, u), "w")) + db.updateJson("%s/test_%s.json" % (config.data_dir, u), cur=cur) + os.unlink("%s/test_%s.json" % (config.data_dir, u)) + if u % 10 == 0: + yield "." + + def testDbInsertMultiuser(self, num_run=1): + yield "x 100 users x 100 lines " + for u in range(num_run): + with self.getTestDb() as db: + for progress in self.fillTestDb(db): + yield progress + num_rows = db.execute("SELECT COUNT(*) FROM test").fetchone()[0] + assert num_rows == 10000, "%s != 10000" % num_rows + + def testDbQueryIndexed(self, num_run=1): + s = time.time() + with self.getTestDb() as db: + for progress in self.fillTestDb(db): + pass + yield " (Db warmup done in %.3fs) " % (time.time() - s) + found_total = 0 + for i in range(num_run): # 1000x by test_id + found = 0 + res = db.execute("SELECT * FROM test WHERE test_id = %s" % (i % 100)) + for row in res: + found_total += 1 + found += 1 + del(res) + yield "." + assert found == 100, "%s != 100 (i: %s)" % (found, i) + yield "Found: %s" % found_total + + def testDbQueryNotIndexed(self, num_run=1): + s = time.time() + with self.getTestDb() as db: + for progress in self.fillTestDb(db): + pass + yield " (Db warmup done in %.3fs) " % (time.time() - s) + found_total = 0 + for i in range(num_run): # 1000x by test_id + found = 0 + res = db.execute("SELECT * FROM test WHERE json_id = %s" % i) + for row in res: + found_total += 1 + found += 1 + yield "." + del(res) + if i == 0 or i > 100: + assert found == 0, "%s != 0 (i: %s)" % (found, i) + else: + assert found == 100, "%s != 100 (i: %s)" % (found, i) + yield "Found: %s" % found_total diff --git a/plugins/Benchmark/BenchmarkPack.py b/plugins/Benchmark/BenchmarkPack.py new file mode 100644 index 00000000..6b92e43a --- /dev/null +++ b/plugins/Benchmark/BenchmarkPack.py @@ -0,0 +1,183 @@ +import os +import io +from collections import OrderedDict + +from Plugin import PluginManager +from Config import config +from util import Msgpack + + +@PluginManager.registerTo("Actions") +class ActionsPlugin: + def createZipFile(self, path): + import zipfile + test_data = b"Test" * 1024 + file_name = b"\xc3\x81rv\xc3\xadzt\xc5\xb1r\xc5\x91%s.txt".decode("utf8") + with zipfile.ZipFile(path, 'w') as archive: + for y in range(100): + zip_info = zipfile.ZipInfo(file_name % y, (1980, 1, 1, 0, 0, 0)) + zip_info.compress_type = zipfile.ZIP_DEFLATED + zip_info.create_system = 3 + zip_info.flag_bits = 0 + zip_info.external_attr = 25165824 + archive.writestr(zip_info, test_data) + + def testPackZip(self, num_run=1): + """ + Test zip file creating + """ + yield "x 100 x 5KB " + from Crypt import CryptHash + zip_path = '%s/test.zip' % config.data_dir + for i in range(num_run): + self.createZipFile(zip_path) + yield "." + + archive_size = os.path.getsize(zip_path) / 1024 + yield "(Generated file size: %.2fkB)" % archive_size + + hash = CryptHash.sha512sum(open(zip_path, "rb")) + valid = "cb32fb43783a1c06a2170a6bc5bb228a032b67ff7a1fd7a5efb9b467b400f553" + assert hash == valid, "Invalid hash: %s != %s
" % (hash, valid) + os.unlink(zip_path) + + def testUnpackZip(self, num_run=1): + """ + Test zip file reading + """ + yield "x 100 x 5KB " + import zipfile + zip_path = '%s/test.zip' % config.data_dir + test_data = b"Test" * 1024 + file_name = b"\xc3\x81rv\xc3\xadzt\xc5\xb1r\xc5\x91".decode("utf8") + + self.createZipFile(zip_path) + for i in range(num_run): + with zipfile.ZipFile(zip_path) as archive: + for f in archive.filelist: + assert f.filename.startswith(file_name), "Invalid filename: %s != %s" % (f.filename, file_name) + data = archive.open(f.filename).read() + assert archive.open(f.filename).read() == test_data, "Invalid data: %s..." % data[0:30] + yield "." + + os.unlink(zip_path) + + def createArchiveFile(self, path, archive_type="gz"): + import tarfile + import gzip + + # Monkey patch _init_write_gz to use fixed date in order to keep the hash independent from datetime + def nodate_write_gzip_header(self): + self._write_mtime = 0 + original_write_gzip_header(self) + + test_data_io = io.BytesIO(b"Test" * 1024) + file_name = b"\xc3\x81rv\xc3\xadzt\xc5\xb1r\xc5\x91%s.txt".decode("utf8") + + original_write_gzip_header = gzip.GzipFile._write_gzip_header + gzip.GzipFile._write_gzip_header = nodate_write_gzip_header + with tarfile.open(path, 'w:%s' % archive_type) as archive: + for y in range(100): + test_data_io.seek(0) + tar_info = tarfile.TarInfo(file_name % y) + tar_info.size = 4 * 1024 + archive.addfile(tar_info, test_data_io) + + def testPackArchive(self, num_run=1, archive_type="gz"): + """ + Test creating tar archive files + """ + yield "x 100 x 5KB " + from Crypt import CryptHash + + hash_valid_db = { + "gz": "92caec5121a31709cbbc8c11b0939758e670b055bbbe84f9beb3e781dfde710f", + "bz2": "b613f41e6ee947c8b9b589d3e8fa66f3e28f63be23f4faf015e2f01b5c0b032d", + "xz": "ae43892581d770959c8d993daffab25fd74490b7cf9fafc7aaee746f69895bcb", + } + archive_path = '%s/test.tar.%s' % (config.data_dir, archive_type) + for i in range(num_run): + self.createArchiveFile(archive_path, archive_type=archive_type) + yield "." + + archive_size = os.path.getsize(archive_path) / 1024 + yield "(Generated file size: %.2fkB)" % archive_size + + hash = CryptHash.sha512sum(open("%s/test.tar.%s" % (config.data_dir, archive_type), "rb")) + valid = hash_valid_db[archive_type] + assert hash == valid, "Invalid hash: %s != %s
" % (hash, valid) + + if os.path.isfile(archive_path): + os.unlink(archive_path) + + def testUnpackArchive(self, num_run=1, archive_type="gz"): + """ + Test reading tar archive files + """ + yield "x 100 x 5KB " + import tarfile + + test_data = b"Test" * 1024 + file_name = b"\xc3\x81rv\xc3\xadzt\xc5\xb1r\xc5\x91%s.txt".decode("utf8") + archive_path = '%s/test.tar.%s' % (config.data_dir, archive_type) + self.createArchiveFile(archive_path, archive_type=archive_type) + for i in range(num_run): + with tarfile.open(archive_path, 'r:%s' % archive_type) as archive: + for y in range(100): + assert archive.extractfile(file_name % y).read() == test_data + yield "." + if os.path.isfile(archive_path): + os.unlink(archive_path) + + def testPackMsgpack(self, num_run=1): + """ + Test msgpack encoding + """ + yield "x 100 x 5KB " + binary = b'fqv\xf0\x1a"e\x10,\xbe\x9cT\x9e(\xa5]u\x072C\x8c\x15\xa2\xa8\x93Sw)\x19\x02\xdd\t\xfb\xf67\x88\xd9\xee\x86\xa1\xe4\xb6,\xc6\x14\xbb\xd7$z\x1d\xb2\xda\x85\xf5\xa0\x97^\x01*\xaf\xd3\xb0!\xb7\x9d\xea\x89\xbbh8\xa1"\xa7]e(@\xa2\xa5g\xb7[\xae\x8eE\xc2\x9fL\xb6s\x19\x19\r\xc8\x04S\xd0N\xe4]?/\x01\xea\xf6\xec\xd1\xb3\xc2\x91\x86\xd7\xf4K\xdf\xc2lV\xf4\xe8\x80\xfc\x8ep\xbb\x82\xb3\x86\x98F\x1c\xecS\xc8\x15\xcf\xdc\xf1\xed\xfc\xd8\x18r\xf9\x80\x0f\xfa\x8cO\x97(\x0b]\xf1\xdd\r\xe7\xbf\xed\x06\xbd\x1b?\xc5\xa0\xd7a\x82\xf3\xa8\xe6@\xf3\ri\xa1\xb10\xf6\xd4W\xbc\x86\x1a\xbb\xfd\x94!bS\xdb\xaeM\x92\x00#\x0b\xf7\xad\xe9\xc2\x8e\x86\xbfi![%\xd31]\xc6\xfc2\xc9\xda\xc6v\x82P\xcc\xa9\xea\xb9\xff\xf6\xc8\x17iD\xcf\xf3\xeeI\x04\xe9\xa1\x19\xbb\x01\x92\xf5nn4K\xf8\xbb\xc6\x17e>\xa7 \xbbv' + data = OrderedDict( + sorted({"int": 1024 * 1024 * 1024, "float": 12345.67890, "text": "hello" * 1024, "binary": binary}.items()) + ) + data_packed_valid = b'\x84\xa6binary\xc5\x01\x00fqv\xf0\x1a"e\x10,\xbe\x9cT\x9e(\xa5]u\x072C\x8c\x15\xa2\xa8\x93Sw)\x19\x02\xdd\t\xfb\xf67\x88\xd9\xee\x86\xa1\xe4\xb6,\xc6\x14\xbb\xd7$z\x1d\xb2\xda\x85\xf5\xa0\x97^\x01*\xaf\xd3\xb0!\xb7\x9d\xea\x89\xbbh8\xa1"\xa7]e(@\xa2\xa5g\xb7[\xae\x8eE\xc2\x9fL\xb6s\x19\x19\r\xc8\x04S\xd0N\xe4]?/\x01\xea\xf6\xec\xd1\xb3\xc2\x91\x86\xd7\xf4K\xdf\xc2lV\xf4\xe8\x80\xfc\x8ep\xbb\x82\xb3\x86\x98F\x1c\xecS\xc8\x15\xcf\xdc\xf1\xed\xfc\xd8\x18r\xf9\x80\x0f\xfa\x8cO\x97(\x0b]\xf1\xdd\r\xe7\xbf\xed\x06\xbd\x1b?\xc5\xa0\xd7a\x82\xf3\xa8\xe6@\xf3\ri\xa1\xb10\xf6\xd4W\xbc\x86\x1a\xbb\xfd\x94!bS\xdb\xaeM\x92\x00#\x0b\xf7\xad\xe9\xc2\x8e\x86\xbfi![%\xd31]\xc6\xfc2\xc9\xda\xc6v\x82P\xcc\xa9\xea\xb9\xff\xf6\xc8\x17iD\xcf\xf3\xeeI\x04\xe9\xa1\x19\xbb\x01\x92\xf5nn4K\xf8\xbb\xc6\x17e>\xa7 \xbbv\xa5float\xcb@\xc8\x1c\xd6\xe61\xf8\xa1\xa3int\xce@\x00\x00\x00\xa4text\xda\x14\x00' + data_packed_valid += b'hello' * 1024 + for y in range(num_run): + for i in range(100): + data_packed = Msgpack.pack(data) + yield "." + assert data_packed == data_packed_valid, "%s
!=
%s" % (repr(data_packed), repr(data_packed_valid)) + + def testUnpackMsgpack(self, num_run=1): + """ + Test msgpack decoding + """ + yield "x 5KB " + binary = b'fqv\xf0\x1a"e\x10,\xbe\x9cT\x9e(\xa5]u\x072C\x8c\x15\xa2\xa8\x93Sw)\x19\x02\xdd\t\xfb\xf67\x88\xd9\xee\x86\xa1\xe4\xb6,\xc6\x14\xbb\xd7$z\x1d\xb2\xda\x85\xf5\xa0\x97^\x01*\xaf\xd3\xb0!\xb7\x9d\xea\x89\xbbh8\xa1"\xa7]e(@\xa2\xa5g\xb7[\xae\x8eE\xc2\x9fL\xb6s\x19\x19\r\xc8\x04S\xd0N\xe4]?/\x01\xea\xf6\xec\xd1\xb3\xc2\x91\x86\xd7\xf4K\xdf\xc2lV\xf4\xe8\x80\xfc\x8ep\xbb\x82\xb3\x86\x98F\x1c\xecS\xc8\x15\xcf\xdc\xf1\xed\xfc\xd8\x18r\xf9\x80\x0f\xfa\x8cO\x97(\x0b]\xf1\xdd\r\xe7\xbf\xed\x06\xbd\x1b?\xc5\xa0\xd7a\x82\xf3\xa8\xe6@\xf3\ri\xa1\xb10\xf6\xd4W\xbc\x86\x1a\xbb\xfd\x94!bS\xdb\xaeM\x92\x00#\x0b\xf7\xad\xe9\xc2\x8e\x86\xbfi![%\xd31]\xc6\xfc2\xc9\xda\xc6v\x82P\xcc\xa9\xea\xb9\xff\xf6\xc8\x17iD\xcf\xf3\xeeI\x04\xe9\xa1\x19\xbb\x01\x92\xf5nn4K\xf8\xbb\xc6\x17e>\xa7 \xbbv' + data = OrderedDict( + sorted({"int": 1024 * 1024 * 1024, "float": 12345.67890, "text": "hello" * 1024, "binary": binary}.items()) + ) + data_packed = b'\x84\xa6binary\xc5\x01\x00fqv\xf0\x1a"e\x10,\xbe\x9cT\x9e(\xa5]u\x072C\x8c\x15\xa2\xa8\x93Sw)\x19\x02\xdd\t\xfb\xf67\x88\xd9\xee\x86\xa1\xe4\xb6,\xc6\x14\xbb\xd7$z\x1d\xb2\xda\x85\xf5\xa0\x97^\x01*\xaf\xd3\xb0!\xb7\x9d\xea\x89\xbbh8\xa1"\xa7]e(@\xa2\xa5g\xb7[\xae\x8eE\xc2\x9fL\xb6s\x19\x19\r\xc8\x04S\xd0N\xe4]?/\x01\xea\xf6\xec\xd1\xb3\xc2\x91\x86\xd7\xf4K\xdf\xc2lV\xf4\xe8\x80\xfc\x8ep\xbb\x82\xb3\x86\x98F\x1c\xecS\xc8\x15\xcf\xdc\xf1\xed\xfc\xd8\x18r\xf9\x80\x0f\xfa\x8cO\x97(\x0b]\xf1\xdd\r\xe7\xbf\xed\x06\xbd\x1b?\xc5\xa0\xd7a\x82\xf3\xa8\xe6@\xf3\ri\xa1\xb10\xf6\xd4W\xbc\x86\x1a\xbb\xfd\x94!bS\xdb\xaeM\x92\x00#\x0b\xf7\xad\xe9\xc2\x8e\x86\xbfi![%\xd31]\xc6\xfc2\xc9\xda\xc6v\x82P\xcc\xa9\xea\xb9\xff\xf6\xc8\x17iD\xcf\xf3\xeeI\x04\xe9\xa1\x19\xbb\x01\x92\xf5nn4K\xf8\xbb\xc6\x17e>\xa7 \xbbv\xa5float\xcb@\xc8\x1c\xd6\xe61\xf8\xa1\xa3int\xce@\x00\x00\x00\xa4text\xda\x14\x00' + data_packed += b'hello' * 1024 + for y in range(num_run): + data_unpacked = Msgpack.unpack(data_packed, decode=False) + yield "." + assert data_unpacked == data, "%s
!=
%s" % (data_unpacked, data) + + def testUnpackMsgpackStreaming(self, num_run=1, fallback=False): + """ + Test streaming msgpack decoding + """ + yield "x 1000 x 5KB " + binary = b'fqv\xf0\x1a"e\x10,\xbe\x9cT\x9e(\xa5]u\x072C\x8c\x15\xa2\xa8\x93Sw)\x19\x02\xdd\t\xfb\xf67\x88\xd9\xee\x86\xa1\xe4\xb6,\xc6\x14\xbb\xd7$z\x1d\xb2\xda\x85\xf5\xa0\x97^\x01*\xaf\xd3\xb0!\xb7\x9d\xea\x89\xbbh8\xa1"\xa7]e(@\xa2\xa5g\xb7[\xae\x8eE\xc2\x9fL\xb6s\x19\x19\r\xc8\x04S\xd0N\xe4]?/\x01\xea\xf6\xec\xd1\xb3\xc2\x91\x86\xd7\xf4K\xdf\xc2lV\xf4\xe8\x80\xfc\x8ep\xbb\x82\xb3\x86\x98F\x1c\xecS\xc8\x15\xcf\xdc\xf1\xed\xfc\xd8\x18r\xf9\x80\x0f\xfa\x8cO\x97(\x0b]\xf1\xdd\r\xe7\xbf\xed\x06\xbd\x1b?\xc5\xa0\xd7a\x82\xf3\xa8\xe6@\xf3\ri\xa1\xb10\xf6\xd4W\xbc\x86\x1a\xbb\xfd\x94!bS\xdb\xaeM\x92\x00#\x0b\xf7\xad\xe9\xc2\x8e\x86\xbfi![%\xd31]\xc6\xfc2\xc9\xda\xc6v\x82P\xcc\xa9\xea\xb9\xff\xf6\xc8\x17iD\xcf\xf3\xeeI\x04\xe9\xa1\x19\xbb\x01\x92\xf5nn4K\xf8\xbb\xc6\x17e>\xa7 \xbbv' + data = OrderedDict( + sorted({"int": 1024 * 1024 * 1024, "float": 12345.67890, "text": "hello" * 1024, "binary": binary}.items()) + ) + data_packed = b'\x84\xa6binary\xc5\x01\x00fqv\xf0\x1a"e\x10,\xbe\x9cT\x9e(\xa5]u\x072C\x8c\x15\xa2\xa8\x93Sw)\x19\x02\xdd\t\xfb\xf67\x88\xd9\xee\x86\xa1\xe4\xb6,\xc6\x14\xbb\xd7$z\x1d\xb2\xda\x85\xf5\xa0\x97^\x01*\xaf\xd3\xb0!\xb7\x9d\xea\x89\xbbh8\xa1"\xa7]e(@\xa2\xa5g\xb7[\xae\x8eE\xc2\x9fL\xb6s\x19\x19\r\xc8\x04S\xd0N\xe4]?/\x01\xea\xf6\xec\xd1\xb3\xc2\x91\x86\xd7\xf4K\xdf\xc2lV\xf4\xe8\x80\xfc\x8ep\xbb\x82\xb3\x86\x98F\x1c\xecS\xc8\x15\xcf\xdc\xf1\xed\xfc\xd8\x18r\xf9\x80\x0f\xfa\x8cO\x97(\x0b]\xf1\xdd\r\xe7\xbf\xed\x06\xbd\x1b?\xc5\xa0\xd7a\x82\xf3\xa8\xe6@\xf3\ri\xa1\xb10\xf6\xd4W\xbc\x86\x1a\xbb\xfd\x94!bS\xdb\xaeM\x92\x00#\x0b\xf7\xad\xe9\xc2\x8e\x86\xbfi![%\xd31]\xc6\xfc2\xc9\xda\xc6v\x82P\xcc\xa9\xea\xb9\xff\xf6\xc8\x17iD\xcf\xf3\xeeI\x04\xe9\xa1\x19\xbb\x01\x92\xf5nn4K\xf8\xbb\xc6\x17e>\xa7 \xbbv\xa5float\xcb@\xc8\x1c\xd6\xe61\xf8\xa1\xa3int\xce@\x00\x00\x00\xa4text\xda\x14\x00' + data_packed += b'hello' * 1024 + for i in range(num_run): + unpacker = Msgpack.getUnpacker(decode=False, fallback=fallback) + for y in range(1000): + unpacker.feed(data_packed) + for data_unpacked in unpacker: + pass + yield "." + assert data == data_unpacked, "%s != %s" % (data_unpacked, data) diff --git a/plugins/Benchmark/BenchmarkPlugin.py b/plugins/Benchmark/BenchmarkPlugin.py new file mode 100644 index 00000000..8af140d8 --- /dev/null +++ b/plugins/Benchmark/BenchmarkPlugin.py @@ -0,0 +1,364 @@ +import os +import time +import io +import math +import hashlib +import re +import sys + +from Config import config +from Crypt import CryptHash +from Plugin import PluginManager +from Debug import Debug +from util import helper + +plugin_dir = os.path.dirname(__file__) + +benchmark_key = None + + +@PluginManager.registerTo("UiRequest") +class UiRequestPlugin(object): + @helper.encodeResponse + def actionBenchmark(self): + global benchmark_key + script_nonce = self.getScriptNonce() + if not benchmark_key: + benchmark_key = CryptHash.random(encoding="base64") + self.sendHeader(script_nonce=script_nonce) + + if "Multiuser" in PluginManager.plugin_manager.plugin_names and not config.multiuser_local: + yield "This function is disabled on this proxy" + return + + data = self.render( + plugin_dir + "/media/benchmark.html", + script_nonce=script_nonce, + benchmark_key=benchmark_key, + filter=re.sub("[^A-Za-z0-9]", "", self.get.get("filter", "")) + ) + yield data + + @helper.encodeResponse + def actionBenchmarkResult(self): + global benchmark_key + if self.get.get("benchmark_key", "") != benchmark_key: + return self.error403("Invalid benchmark key") + + self.sendHeader(content_type="text/plain", noscript=True) + + if "Multiuser" in PluginManager.plugin_manager.plugin_names and not config.multiuser_local: + yield "This function is disabled on this proxy" + return + + yield " " * 1024 # Head (required for streaming) + + import main + s = time.time() + + for part in main.actions.testBenchmark(filter=self.get.get("filter", "")): + yield part + + yield "\n - Total time: %.3fs" % (time.time() - s) + + +@PluginManager.registerTo("Actions") +class ActionsPlugin: + def getMultiplerTitle(self, multipler): + if multipler < 0.3: + multipler_title = "Sloooow" + elif multipler < 0.6: + multipler_title = "Ehh" + elif multipler < 0.8: + multipler_title = "Goodish" + elif multipler < 1.2: + multipler_title = "OK" + elif multipler < 1.7: + multipler_title = "Fine" + elif multipler < 2.5: + multipler_title = "Fast" + elif multipler < 3.5: + multipler_title = "WOW" + else: + multipler_title = "Insane!!" + return multipler_title + + def formatResult(self, taken, standard): + if not standard: + return " Done in %.3fs" % taken + + if taken > 0: + multipler = standard / taken + else: + multipler = 99 + multipler_title = self.getMultiplerTitle(multipler) + + return " Done in %.3fs = %s (%.2fx)" % (taken, multipler_title, multipler) + + def getBenchmarkTests(self, online=False): + if hasattr(super(), "getBenchmarkTests"): + tests = super().getBenchmarkTests(online) + else: + tests = [] + + tests.extend([ + {"func": self.testHdPrivatekey, "num": 50, "time_standard": 0.57}, + {"func": self.testSign, "num": 20, "time_standard": 0.46}, + {"func": self.testVerify, "kwargs": {"lib_verify": "sslcrypto_fallback"}, "num": 20, "time_standard": 0.38}, + {"func": self.testVerify, "kwargs": {"lib_verify": "sslcrypto"}, "num": 200, "time_standard": 0.30}, + {"func": self.testVerify, "kwargs": {"lib_verify": "libsecp256k1"}, "num": 200, "time_standard": 0.10}, + + {"func": self.testPackMsgpack, "num": 100, "time_standard": 0.35}, + {"func": self.testUnpackMsgpackStreaming, "kwargs": {"fallback": False}, "num": 100, "time_standard": 0.35}, + {"func": self.testUnpackMsgpackStreaming, "kwargs": {"fallback": True}, "num": 10, "time_standard": 0.5}, + + {"func": self.testPackZip, "num": 5, "time_standard": 0.065}, + {"func": self.testPackArchive, "kwargs": {"archive_type": "gz"}, "num": 5, "time_standard": 0.08}, + {"func": self.testPackArchive, "kwargs": {"archive_type": "bz2"}, "num": 5, "time_standard": 0.68}, + {"func": self.testPackArchive, "kwargs": {"archive_type": "xz"}, "num": 5, "time_standard": 0.47}, + {"func": self.testUnpackZip, "num": 20, "time_standard": 0.25}, + {"func": self.testUnpackArchive, "kwargs": {"archive_type": "gz"}, "num": 20, "time_standard": 0.28}, + {"func": self.testUnpackArchive, "kwargs": {"archive_type": "bz2"}, "num": 20, "time_standard": 0.83}, + {"func": self.testUnpackArchive, "kwargs": {"archive_type": "xz"}, "num": 20, "time_standard": 0.38}, + + {"func": self.testCryptHash, "kwargs": {"hash_type": "sha256"}, "num": 10, "time_standard": 0.50}, + {"func": self.testCryptHash, "kwargs": {"hash_type": "sha512"}, "num": 10, "time_standard": 0.33}, + {"func": self.testCryptHashlib, "kwargs": {"hash_type": "sha3_256"}, "num": 10, "time_standard": 0.33}, + {"func": self.testCryptHashlib, "kwargs": {"hash_type": "sha3_512"}, "num": 10, "time_standard": 0.65}, + + {"func": self.testRandom, "num": 100, "time_standard": 0.08}, + ]) + + if online: + tests += [ + {"func": self.testHttps, "num": 1, "time_standard": 2.1} + ] + return tests + + def testBenchmark(self, num_multipler=1, online=False, num_run=None, filter=None): + """ + Run benchmark on client functions + """ + tests = self.getBenchmarkTests(online=online) + + if filter: + tests = [test for test in tests[:] if filter.lower() in test["func"].__name__.lower()] + + yield "\n" + res = {} + multiplers = [] + for test in tests: + s = time.time() + if num_run: + num_run_test = num_run + else: + num_run_test = math.ceil(test["num"] * num_multipler) + func = test["func"] + func_name = func.__name__ + kwargs = test.get("kwargs", {}) + key = "%s %s" % (func_name, kwargs) + if kwargs: + yield "* Running %s (%s) x %s " % (func_name, kwargs, num_run_test) + else: + yield "* Running %s x %s " % (func_name, num_run_test) + i = 0 + try: + for progress in func(num_run_test, **kwargs): + i += 1 + if num_run_test > 10: + should_print = i % (num_run_test / 10) == 0 or progress != "." + else: + should_print = True + + if should_print: + if num_run_test == 1 and progress == ".": + progress = "..." + yield progress + time_taken = time.time() - s + if num_run: + time_standard = 0 + else: + time_standard = test["time_standard"] * num_multipler + yield self.formatResult(time_taken, time_standard) + yield "\n" + res[key] = "ok" + multiplers.append(time_standard / max(time_taken, 0.001)) + except Exception as err: + res[key] = err + yield "Failed!\n! Error: %s\n\n" % Debug.formatException(err) + + if not res: + yield "! No tests found" + if config.action == "test": + sys.exit(1) + else: + num_failed = len([res_key for res_key, res_val in res.items() if res_val != "ok"]) + num_success = len([res_key for res_key, res_val in res.items() if res_val != "ok"]) + yield "* Result:\n" + yield " - Total: %s tests\n" % len(res) + yield " - Success: %s tests\n" % num_success + yield " - Failed: %s tests\n" % num_failed + if any(multiplers): + multipler_avg = sum(multiplers) / len(multiplers) + multipler_title = self.getMultiplerTitle(multipler_avg) + yield " - Average speed factor: %.2fx (%s)" % (multipler_avg, multipler_title) + if num_failed == 0 and config.action == "test": + sys.exit(1) + + + def testHttps(self, num_run=1): + """ + Test https connection with valid and invalid certs + """ + import urllib.request + import urllib.error + + body = urllib.request.urlopen("https://google.com").read() + assert len(body) > 100 + yield "." + + badssl_urls = [ + "https://expired.badssl.com/", + "https://wrong.host.badssl.com/", + "https://self-signed.badssl.com/", + "https://untrusted-root.badssl.com/" + ] + for badssl_url in badssl_urls: + try: + body = urllib.request.urlopen(badssl_url).read() + https_err = None + except urllib.error.URLError as err: + https_err = err + assert https_err + yield "." + + def testCryptHash(self, num_run=1, hash_type="sha256"): + """ + Test hashing functions + """ + yield "(5MB) " + + from Crypt import CryptHash + + hash_types = { + "sha256": {"func": CryptHash.sha256sum, "hash_valid": "8cd629d9d6aff6590da8b80782a5046d2673d5917b99d5603c3dcb4005c45ffa"}, + "sha512": {"func": CryptHash.sha512sum, "hash_valid": "9ca7e855d430964d5b55b114e95c6bbb114a6d478f6485df93044d87b108904d"} + } + hash_func = hash_types[hash_type]["func"] + hash_valid = hash_types[hash_type]["hash_valid"] + + data = io.BytesIO(b"Hello" * 1024 * 1024) # 5MB + for i in range(num_run): + data.seek(0) + hash = hash_func(data) + yield "." + assert hash == hash_valid, "%s != %s" % (hash, hash_valid) + + def testCryptHashlib(self, num_run=1, hash_type="sha3_256"): + """ + Test SHA3 hashing functions + """ + yield "x 5MB " + + hash_types = { + "sha3_256": {"func": hashlib.sha3_256, "hash_valid": "c8aeb3ef9fe5d6404871c0d2a4410a4d4e23268e06735648c9596f436c495f7e"}, + "sha3_512": {"func": hashlib.sha3_512, "hash_valid": "b75dba9472d8af3cc945ce49073f3f8214d7ac12086c0453fb08944823dee1ae83b3ffbc87a53a57cc454521d6a26fe73ff0f3be38dddf3f7de5d7692ebc7f95"}, + } + + hash_func = hash_types[hash_type]["func"] + hash_valid = hash_types[hash_type]["hash_valid"] + + data = io.BytesIO(b"Hello" * 1024 * 1024) # 5MB + for i in range(num_run): + data.seek(0) + h = hash_func() + while 1: + buff = data.read(1024 * 64) + if not buff: + break + h.update(buff) + hash = h.hexdigest() + yield "." + assert hash == hash_valid, "%s != %s" % (hash, hash_valid) + + def testRandom(self, num_run=1): + """ + Test generating random data + """ + yield "x 1000 x 256 bytes " + for i in range(num_run): + data_last = None + for y in range(1000): + data = os.urandom(256) + assert data != data_last + assert len(data) == 256 + data_last = data + yield "." + + def testHdPrivatekey(self, num_run=2): + """ + Test generating deterministic private keys from a master seed + """ + from Crypt import CryptBitcoin + seed = "e180efa477c63b0f2757eac7b1cce781877177fe0966be62754ffd4c8592ce38" + privatekeys = [] + for i in range(num_run): + privatekeys.append(CryptBitcoin.hdPrivatekey(seed, i * 10)) + yield "." + valid = "5JSbeF5PevdrsYjunqpg7kAGbnCVYa1T4APSL3QRu8EoAmXRc7Y" + assert privatekeys[0] == valid, "%s != %s" % (privatekeys[0], valid) + if len(privatekeys) > 1: + assert privatekeys[0] != privatekeys[-1] + + def testSign(self, num_run=1): + """ + Test signing data using a private key + """ + from Crypt import CryptBitcoin + data = "Hello" * 1024 + privatekey = "5JsunC55XGVqFQj5kPGK4MWgTL26jKbnPhjnmchSNPo75XXCwtk" + for i in range(num_run): + yield "." + sign = CryptBitcoin.sign(data, privatekey) + valid = "G1GXaDauZ8vX/N9Jn+MRiGm9h+I94zUhDnNYFaqMGuOiBHB+kp4cRPZOL7l1yqK5BHa6J+W97bMjvTXtxzljp6w=" + assert sign == valid, "%s != %s" % (sign, valid) + + def testVerify(self, num_run=1, lib_verify="btctools"): + """ + Test verification of generated signatures + """ + from Crypt import CryptBitcoin + CryptBitcoin.loadLib(lib_verify, silent=True) + + data = "Hello" * 1024 + privatekey = "5JsunC55XGVqFQj5kPGK4MWgTL26jKbnPhjnmchSNPo75XXCwtk" + address = CryptBitcoin.privatekeyToAddress(privatekey) + sign = "G1GXaDauZ8vX/N9Jn+MRiGm9h+I94zUhDnNYFaqMGuOiBHB+kp4cRPZOL7l1yqK5BHa6J+W97bMjvTXtxzljp6w=" + + for i in range(num_run): + ok = CryptBitcoin.verify(data, address, sign, lib_verify=lib_verify) + yield "." + assert ok, "does not verify from %s" % address + + def testAll(self): + """ + Run all tests to check system compatibility with ZeroNet functions + """ + for progress in self.testBenchmark(online=not config.offline, num_run=1): + yield progress + + +@PluginManager.registerTo("ConfigPlugin") +class ConfigPlugin(object): + def createArguments(self): + back = super(ConfigPlugin, self).createArguments() + if self.getCmdlineValue("test") == "benchmark": + self.test_parser.add_argument( + '--num_multipler', help='Benchmark run time multipler', + default=1.0, type=float, metavar='num' + ) + self.test_parser.add_argument( + '--filter', help='Filter running benchmark', + default=None, metavar='test name' + ) + return back diff --git a/plugins/Benchmark/__init__.py b/plugins/Benchmark/__init__.py new file mode 100644 index 00000000..76a5ae9c --- /dev/null +++ b/plugins/Benchmark/__init__.py @@ -0,0 +1,3 @@ +from . import BenchmarkPlugin +from . import BenchmarkDb +from . import BenchmarkPack diff --git a/plugins/Benchmark/media/benchmark.html b/plugins/Benchmark/media/benchmark.html new file mode 100644 index 00000000..f308d8ba --- /dev/null +++ b/plugins/Benchmark/media/benchmark.html @@ -0,0 +1,123 @@ + + + + + +

Benchmark

+
+
+ Start benchmark + (It will take around 20 sec) +
+
+ + + + \ No newline at end of file diff --git a/plugins/Benchmark/plugin_info.json b/plugins/Benchmark/plugin_info.json new file mode 100644 index 00000000..f3f57417 --- /dev/null +++ b/plugins/Benchmark/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "Benchmark", + "description": "Test and benchmark database and cryptographic functions related to ZeroNet.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/Bigfile/BigfilePlugin.py b/plugins/Bigfile/BigfilePlugin.py index 60e43693..41506f13 100644 --- a/plugins/Bigfile/BigfilePlugin.py +++ b/plugins/Bigfile/BigfilePlugin.py @@ -21,6 +21,7 @@ with warnings.catch_warnings(): from util import helper from util import Msgpack +from util.Flag import flag import util from .BigfilePiecefield import BigfilePiecefield, BigfilePiecefieldPacked @@ -32,6 +33,7 @@ def importPluginnedClasses(): from Content.ContentManager import VerifyError from Config import config + if "upload_nonces" not in locals(): upload_nonces = {} @@ -59,13 +61,44 @@ class UiRequestPlugin(object): }) self.readMultipartHeaders(self.env['wsgi.input']) # Skip http headers + result = self.handleBigfileUpload(upload_info, self.env['wsgi.input'].read) + return json.dumps(result) + def actionBigfileUploadWebsocket(self): + ws = self.env.get("wsgi.websocket") + + if not ws: + self.start_response("400 Bad Request", []) + return [b"Not a websocket request!"] + + nonce = self.get.get("upload_nonce") + if nonce not in upload_nonces: + return self.error403("Upload nonce error.") + + upload_info = upload_nonces[nonce] + del upload_nonces[nonce] + + ws.send("poll") + + buffer = b"" + def read(size): + nonlocal buffer + while len(buffer) < size: + buffer += ws.receive() + ws.send("poll") + part, buffer = buffer[:size], buffer[size:] + return part + + result = self.handleBigfileUpload(upload_info, read) + ws.send(json.dumps(result)) + + def handleBigfileUpload(self, upload_info, read): site = upload_info["site"] inner_path = upload_info["inner_path"] with site.storage.open(inner_path, "wb", create_dirs=True) as out_file: merkle_root, piece_size, piecemap_info = site.content_manager.hashBigfile( - self.env['wsgi.input'], upload_info["size"], upload_info["piece_size"], out_file + read, upload_info["size"], upload_info["piece_size"], out_file ) if len(piecemap_info["sha512_pieces"]) == 1: # Small file, don't split @@ -104,12 +137,12 @@ class UiRequestPlugin(object): site.content_manager.contents.loadItem(file_info["content_inner_path"]) # reload cache - return json.dumps({ + return { "merkle_root": merkle_root, "piece_num": len(piecemap_info["sha512_pieces"]), "piece_size": piece_size, "inner_path": inner_path - }) + } def readMultipartHeaders(self, wsgi_input): found = False @@ -136,7 +169,7 @@ class UiRequestPlugin(object): @PluginManager.registerTo("UiWebsocket") class UiWebsocketPlugin(object): - def actionBigfileUploadInit(self, to, inner_path, size): + def actionBigfileUploadInit(self, to, inner_path, size, protocol="xhr"): valid_signers = self.site.content_manager.getValidSigners(inner_path) auth_address = self.user.getAuthAddress(self.site.address) if not self.site.settings["own"] and auth_address not in valid_signers: @@ -160,13 +193,31 @@ class UiWebsocketPlugin(object): "piece_size": piece_size, "piecemap": inner_path + ".piecemap.msgpack" } - return { - "url": "/ZeroNet-Internal/BigfileUpload?upload_nonce=" + nonce, - "piece_size": piece_size, - "inner_path": inner_path, - "file_relative_path": file_relative_path - } + if protocol == "xhr": + return { + "url": "/ZeroNet-Internal/BigfileUpload?upload_nonce=" + nonce, + "piece_size": piece_size, + "inner_path": inner_path, + "file_relative_path": file_relative_path + } + elif protocol == "websocket": + server_url = self.request.getWsServerUrl() + if server_url: + proto, host = server_url.split("://") + origin = proto.replace("http", "ws") + "://" + host + else: + origin = "{origin}" + return { + "url": origin + "/ZeroNet-Internal/BigfileUploadWebsocket?upload_nonce=" + nonce, + "piece_size": piece_size, + "inner_path": inner_path, + "file_relative_path": file_relative_path + } + else: + return {"error": "Unknown protocol"} + + @flag.no_multiuser def actionSiteSetAutodownloadBigfileLimit(self, to, limit): permissions = self.getPermissions(to) if "ADMIN" not in permissions: @@ -207,14 +258,14 @@ class ContentManagerPlugin(object): file_info = super(ContentManagerPlugin, self).getFileInfo(inner_path, *args, **kwargs) return file_info - def readFile(self, file_in, size, buff_size=1024 * 64): + def readFile(self, read_func, size, buff_size=1024 * 64): part_num = 0 recv_left = size while 1: part_num += 1 read_size = min(buff_size, recv_left) - part = file_in.read(read_size) + part = read_func(read_size) if not part: break @@ -227,7 +278,7 @@ class ContentManagerPlugin(object): if recv_left <= 0: break - def hashBigfile(self, file_in, size, piece_size=1024 * 1024, file_out=None): + def hashBigfile(self, read_func, size, piece_size=1024 * 1024, file_out=None): self.site.settings["has_bigfile"] = True recv = 0 @@ -240,7 +291,7 @@ class ContentManagerPlugin(object): mt.hash_function = CryptHash.sha512t part = "" - for part in self.readFile(file_in, size): + for part in self.readFile(read_func, size): if file_out: file_out.write(part) @@ -306,7 +357,7 @@ class ContentManagerPlugin(object): return super(ContentManagerPlugin, self).hashFile(dir_inner_path, file_relative_path, optional) self.log.info("- [HASHING] %s" % file_relative_path) - merkle_root, piece_size, piecemap_info = self.hashBigfile(self.site.storage.open(inner_path, "rb"), file_size) + merkle_root, piece_size, piecemap_info = self.hashBigfile(self.site.storage.open(inner_path, "rb").read, file_size) if not hash: hash = merkle_root @@ -338,7 +389,11 @@ class ContentManagerPlugin(object): return piecemap def verifyPiece(self, inner_path, pos, piece): - piecemap = self.getPiecemap(inner_path) + try: + piecemap = self.getPiecemap(inner_path) + except OSError as err: + raise VerifyError("Unable to download piecemap: %s" % err) + piece_i = int(pos / piecemap["piece_size"]) if CryptHash.sha512sum(piece, format="digest") != piecemap["sha512_pieces"][piece_i]: raise VerifyError("Invalid hash") @@ -404,9 +459,7 @@ class SiteStoragePlugin(object): def createSparseFile(self, inner_path, size, sha512=None): file_path = self.getPath(inner_path) - file_dir = os.path.dirname(file_path) - if not os.path.isdir(file_dir): - os.makedirs(file_dir) + self.ensureDir(os.path.dirname(inner_path)) f = open(file_path, 'wb') f.truncate(min(1024 * 1024 * 5, size)) # Only pre-allocate up to 5MB @@ -430,9 +483,7 @@ class SiteStoragePlugin(object): file_path = self.getPath(inner_path) # Create dir if not exist - file_dir = os.path.dirname(file_path) - if not os.path.isdir(file_dir): - os.makedirs(file_dir) + self.ensureDir(os.path.dirname(inner_path)) if not os.path.isfile(file_path): file_info = self.site.content_manager.getFileInfo(inner_path) @@ -751,6 +802,11 @@ class SitePlugin(object): inner_path = inner_path.replace("|all", "") file_info = self.needFileInfo(inner_path) + + # Use default function to download non-optional file + if "piece_size" not in file_info: + return super(SitePlugin, self).needFile(inner_path, *args, **kwargs) + file_size = file_info["size"] piece_size = file_info["piece_size"] diff --git a/plugins/Bigfile/Test/TestBigfile.py b/plugins/Bigfile/Test/TestBigfile.py index 9f67838e..402646a6 100644 --- a/plugins/Bigfile/Test/TestBigfile.py +++ b/plugins/Bigfile/Test/TestBigfile.py @@ -134,7 +134,7 @@ class TestBigfile: peer_client = site_temp.addPeer(file_server.ip, 1544) # Download site - site_temp.download(blind_includes=True).join(timeout=5) + site_temp.download(blind_includes=True, retry_bad_files=False).join(timeout=10) bad_files = site_temp.storage.verifyFiles(quick_check=True)["bad_files"] assert not bad_files @@ -172,7 +172,7 @@ class TestBigfile: site_temp.addPeer(file_server.ip, 1544) # Download site - site_temp.download(blind_includes=True).join(timeout=5) + site_temp.download(blind_includes=True, retry_bad_files=False).join(timeout=10) # Open virtual file assert not site_temp.storage.isFile(inner_path) @@ -255,7 +255,7 @@ class TestBigfile: site_temp.addPeer(file_server.ip, 1544) # Download site - site_temp.download(blind_includes=True).join(timeout=5) + site_temp.download(blind_includes=True, retry_bad_files=False).join(timeout=10) # Download second block with site_temp.storage.openBigfile(inner_path) as f: @@ -380,7 +380,7 @@ class TestBigfile: site_temp.addPeer(file_server.ip, 1544) # Download site - site_temp.download(blind_includes=True).join(timeout=5) + site_temp.download(blind_includes=True, retry_bad_files=False).join(timeout=10) # Open virtual file assert not site_temp.storage.isFile(inner_path) @@ -417,7 +417,7 @@ class TestBigfile: site_temp.addPeer(file_server.ip, 1544) # Download site - site_temp.download(blind_includes=True).join(timeout=5) + site_temp.download(blind_includes=True, retry_bad_files=False).join(timeout=10) # Open virtual file assert not site_temp.storage.isFile(inner_path) @@ -453,7 +453,7 @@ class TestBigfile: site_temp.addPeer(file_server.ip, 1544) # Download site - site_temp.download(blind_includes=True).join(timeout=5) + site_temp.download(blind_includes=True, retry_bad_files=False).join(timeout=10) # Open virtual file assert not site_temp.storage.isFile(inner_path) @@ -482,7 +482,7 @@ class TestBigfile: site_temp.addPeer(file_server.ip, 1544) # Download site - site_temp.download(blind_includes=True).join(timeout=5) + site_temp.download(blind_includes=True, retry_bad_files=False).join(timeout=10) # Open virtual file assert not site_temp.storage.isFile(inner_path) @@ -507,7 +507,7 @@ class TestBigfile: site_temp.addPeer(file_server.ip, 1544) # Download site - site_temp.download(blind_includes=True).join(timeout=5) + site_temp.download(blind_includes=True, retry_bad_files=False).join(timeout=10) with Spy.Spy(FileRequest, "route") as requests: site_temp.needFile("%s|%s-%s" % (inner_path, 0, 1 * self.piece_size)) @@ -529,7 +529,7 @@ class TestBigfile: with Spy.Spy(FileRequest, "route") as requests: site.publish() time.sleep(0.1) - site_temp.download(blind_includes=True).join(timeout=5) # Wait for download + site_temp.download(blind_includes=True, retry_bad_files=False).join(timeout=10) # Wait for download assert len([req[1] for req in requests if req[1] == "streamFile"]) == 0 @@ -563,7 +563,7 @@ class TestBigfile: site_temp.addPeer(file_server.ip, 1544) # Download site - site_temp.download(blind_includes=True).join(timeout=5) + site_temp.download(blind_includes=True, retry_bad_files=False).join(timeout=10) if "piecemap" in site.content_manager.getFileInfo(inner_path): # Bigfile site_temp.needFile(inner_path + "|all") diff --git a/plugins/Chart/ChartCollector.py b/plugins/Chart/ChartCollector.py index 776343af..215c603c 100644 --- a/plugins/Chart/ChartCollector.py +++ b/plugins/Chart/ChartCollector.py @@ -119,6 +119,8 @@ class ChartCollector(object): value = collector(peers) else: value = collector() + except ValueError: + value = None except Exception as err: self.log.info("Collector %s error: %s" % (key, err)) value = None @@ -146,15 +148,14 @@ class ChartCollector(object): s = time.time() cur = self.db.getCursor() - cur.cursor.executemany("INSERT INTO data (type_id, value, date_added) VALUES (?, ?, ?)", values) - cur.close() + cur.executemany("INSERT INTO data (type_id, value, date_added) VALUES (?, ?, ?)", values) self.log.debug("Global collectors inserted in %.3fs" % (time.time() - s)) def collectSites(self, sites, collectors, last_values): now = int(time.time()) s = time.time() values = [] - for address, site in sites.items(): + for address, site in list(sites.items()): site_datas = self.collectDatas(collectors, last_values["site:%s" % address], site) for key, value in site_datas.items(): values.append((self.db.getTypeId(key), self.db.getSiteId(address), value, now)) @@ -163,8 +164,7 @@ class ChartCollector(object): s = time.time() cur = self.db.getCursor() - cur.cursor.executemany("INSERT INTO data (type_id, site_id, value, date_added) VALUES (?, ?, ?, ?)", values) - cur.close() + cur.executemany("INSERT INTO data (type_id, site_id, value, date_added) VALUES (?, ?, ?, ?)", values) self.log.debug("Site collectors inserted in %.3fs" % (time.time() - s)) def collector(self): diff --git a/plugins/Chart/ChartDb.py b/plugins/Chart/ChartDb.py index 9dd4d3db..66a22082 100644 --- a/plugins/Chart/ChartDb.py +++ b/plugins/Chart/ChartDb.py @@ -48,15 +48,15 @@ class ChartDb(Db): def getTypeId(self, name): if name not in self.types: - self.execute("INSERT INTO type ?", {"name": name}) - self.types[name] = self.cur.cursor.lastrowid + res = self.execute("INSERT INTO type ?", {"name": name}) + self.types[name] = res.lastrowid return self.types[name] def getSiteId(self, address): if address not in self.sites: - self.execute("INSERT INTO site ?", {"address": address}) - self.sites[address] = self.cur.cursor.lastrowid + res = self.execute("INSERT INTO site ?", {"address": address}) + self.sites[address] = res.lastrowid return self.sites[address] diff --git a/plugins/Chart/ChartPlugin.py b/plugins/Chart/ChartPlugin.py index ddc1e609..80a4d976 100644 --- a/plugins/Chart/ChartPlugin.py +++ b/plugins/Chart/ChartPlugin.py @@ -5,6 +5,7 @@ import gevent from Config import config from util import helper +from util.Flag import flag from Plugin import PluginManager from .ChartDb import ChartDb from .ChartCollector import ChartCollector @@ -28,10 +29,8 @@ class SiteManagerPlugin(object): @PluginManager.registerTo("UiWebsocket") class UiWebsocketPlugin(object): + @flag.admin def actionChartDbQuery(self, to, query, params=None): - if not "ADMIN" in self.permissions: - return {"error": "No permission"} - if config.debug or config.verbose: s = time.time() rows = [] @@ -49,10 +48,8 @@ class UiWebsocketPlugin(object): self.log.debug("Slow query: %s (%.3fs)" % (query, time.time() - s)) return rows + @flag.admin def actionChartGetPeerLocations(self, to): - if not "ADMIN" in self.permissions: - return {"error": "No permission"} - peers = {} for site in self.server.sites.values(): peers.update(site.peers) diff --git a/plugins/Chart/plugin_info.json b/plugins/Chart/plugin_info.json new file mode 100644 index 00000000..3bdaea8a --- /dev/null +++ b/plugins/Chart/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "Chart", + "description": "Collect and provide stats of client information.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/ContentFilter/ContentFilterPlugin.py b/plugins/ContentFilter/ContentFilterPlugin.py index f6d74e7a..f2f84b49 100644 --- a/plugins/ContentFilter/ContentFilterPlugin.py +++ b/plugins/ContentFilter/ContentFilterPlugin.py @@ -1,17 +1,20 @@ import time import re import html -import hashlib +import os from Plugin import PluginManager from Translate import Translate from Config import config +from util.Flag import flag from .ContentFilterStorage import ContentFilterStorage +plugin_dir = os.path.dirname(__file__) + if "_" not in locals(): - _ = Translate("plugins/ContentFilter/languages/") + _ = Translate(plugin_dir + "/languages/") @PluginManager.registerTo("SiteManager") @@ -21,6 +24,24 @@ class SiteManagerPlugin(object): super(SiteManagerPlugin, self).load(*args, **kwargs) filter_storage = ContentFilterStorage(site_manager=self) + def add(self, address, *args, **kwargs): + should_ignore_block = kwargs.get("ignore_block") or kwargs.get("settings") + if should_ignore_block: + block_details = None + elif filter_storage.isSiteblocked(address): + block_details = filter_storage.getSiteblockDetails(address) + else: + address_hashed = filter_storage.getSiteAddressHashed(address) + if filter_storage.isSiteblocked(address_hashed): + block_details = filter_storage.getSiteblockDetails(address_hashed) + else: + block_details = None + + if block_details: + raise Exception("Site blocked: %s" % html.escape(block_details.get("reason", "unknown reason"))) + else: + return super(SiteManagerPlugin, self).add(address, *args, **kwargs) + @PluginManager.registerTo("UiWebsocket") class UiWebsocketPlugin(object): @@ -33,6 +54,7 @@ class UiWebsocketPlugin(object): filter_storage.changeDbs(auth_address, "remove") self.response(to, "ok") + @flag.no_multiuser def actionMuteAdd(self, to, auth_address, cert_user_id, reason): if "ADMIN" in self.getPermissions(to): self.cbMuteAdd(to, auth_address, cert_user_id, reason) @@ -43,50 +65,73 @@ class UiWebsocketPlugin(object): lambda res: self.cbMuteAdd(to, auth_address, cert_user_id, reason) ) + @flag.no_multiuser def cbMuteRemove(self, to, auth_address): del filter_storage.file_content["mutes"][auth_address] filter_storage.save() filter_storage.changeDbs(auth_address, "load") self.response(to, "ok") + @flag.no_multiuser def actionMuteRemove(self, to, auth_address): if "ADMIN" in self.getPermissions(to): self.cbMuteRemove(to, auth_address) else: + cert_user_id = html.escape(filter_storage.file_content["mutes"][auth_address]["cert_user_id"]) self.cmd( "confirm", - [_["Unmute %s?"] % html.escape(filter_storage.file_content["mutes"][auth_address]["cert_user_id"]), _["Unmute"]], + [_["Unmute %s?"] % cert_user_id, _["Unmute"]], lambda res: self.cbMuteRemove(to, auth_address) ) + @flag.admin def actionMuteList(self, to): - if "ADMIN" in self.getPermissions(to): - self.response(to, filter_storage.file_content["mutes"]) - else: - return self.response(to, {"error": "Forbidden: Only ADMIN sites can list mutes"}) + self.response(to, filter_storage.file_content["mutes"]) # Siteblock + @flag.no_multiuser + @flag.admin + def actionSiteblockIgnoreAddSite(self, to, site_address): + if site_address in filter_storage.site_manager.sites: + return {"error": "Site already added"} + else: + if filter_storage.site_manager.need(site_address, ignore_block=True): + return "ok" + else: + return {"error": "Invalid address"} + + @flag.no_multiuser + @flag.admin def actionSiteblockAdd(self, to, site_address, reason=None): - if "ADMIN" not in self.getPermissions(to): - return self.response(to, {"error": "Forbidden: Only ADMIN sites can add to blocklist"}) filter_storage.file_content["siteblocks"][site_address] = {"date_added": time.time(), "reason": reason} filter_storage.save() self.response(to, "ok") + @flag.no_multiuser + @flag.admin def actionSiteblockRemove(self, to, site_address): - if "ADMIN" not in self.getPermissions(to): - return self.response(to, {"error": "Forbidden: Only ADMIN sites can remove from blocklist"}) del filter_storage.file_content["siteblocks"][site_address] filter_storage.save() self.response(to, "ok") + @flag.admin def actionSiteblockList(self, to): - if "ADMIN" in self.getPermissions(to): - self.response(to, filter_storage.file_content["siteblocks"]) + self.response(to, filter_storage.file_content["siteblocks"]) + + @flag.admin + def actionSiteblockGet(self, to, site_address): + if filter_storage.isSiteblocked(site_address): + res = filter_storage.getSiteblockDetails(site_address) else: - return self.response(to, {"error": "Forbidden: Only ADMIN sites can list blocklists"}) + site_address_hashed = filter_storage.getSiteAddressHashed(site_address) + if filter_storage.isSiteblocked(site_address_hashed): + res = filter_storage.getSiteblockDetails(site_address_hashed) + else: + res = {"error": "Site block not found"} + self.response(to, res) # Include + @flag.no_multiuser def actionFilterIncludeAdd(self, to, inner_path, description=None, address=None): if address: if "ADMIN" not in self.getPermissions(to): @@ -118,6 +163,7 @@ class UiWebsocketPlugin(object): filter_storage.includeAdd(address, inner_path, description) self.response(to, "ok") + @flag.no_multiuser def actionFilterIncludeRemove(self, to, inner_path, address=None): if address: if "ADMIN" not in self.getPermissions(to): @@ -177,7 +223,7 @@ class SiteStoragePlugin(object): @PluginManager.registerTo("UiRequest") class UiRequestPlugin(object): def actionWrapper(self, path, extra_headers=None): - match = re.match("/(?P
[A-Za-z0-9\._-]+)(?P/.*|$)", path) + match = re.match(r"/(?P
[A-Za-z0-9\._-]+)(?P/.*|$)", path) if not match: return False address = match.group("address") @@ -185,15 +231,15 @@ class UiRequestPlugin(object): if self.server.site_manager.get(address): # Site already exists return super(UiRequestPlugin, self).actionWrapper(path, extra_headers) - if self.server.site_manager.isDomain(address): - address = self.server.site_manager.resolveDomain(address) + if self.isDomain(address): + address = self.resolveDomain(address) if address: - address_sha256 = "0x" + hashlib.sha256(address.encode("utf8")).hexdigest() + address_hashed = filter_storage.getSiteAddressHashed(address) else: - address_sha256 = None + address_hashed = None - if filter_storage.isSiteblocked(address) or filter_storage.isSiteblocked(address_sha256): + if filter_storage.isSiteblocked(address) or filter_storage.isSiteblocked(address_hashed): site = self.server.site_manager.get(config.homepage) if not extra_headers: extra_headers = {} @@ -210,7 +256,7 @@ class UiRequestPlugin(object): def actionUiMedia(self, path, *args, **kwargs): if path.startswith("/uimedia/plugins/contentfilter/"): - file_path = path.replace("/uimedia/plugins/contentfilter/", "plugins/ContentFilter/media/") + file_path = path.replace("/uimedia/plugins/contentfilter/", plugin_dir + "/media/") return self.actionFile(file_path) else: return super(UiRequestPlugin, self).actionUiMedia(path) diff --git a/plugins/ContentFilter/ContentFilterStorage.py b/plugins/ContentFilter/ContentFilterStorage.py index 3df0b435..70409d6b 100644 --- a/plugins/ContentFilter/ContentFilterStorage.py +++ b/plugins/ContentFilter/ContentFilterStorage.py @@ -3,12 +3,14 @@ import json import logging import collections import time +import hashlib from Debug import Debug from Plugin import PluginManager from Config import config from util import helper + class ContentFilterStorage(object): def __init__(self, site_manager): self.log = logging.getLogger("ContentFilterStorage") @@ -114,11 +116,33 @@ class ContentFilterStorage(object): else: return False + def getSiteAddressHashed(self, address): + return "0x" + hashlib.sha256(address.encode("ascii")).hexdigest() + def isSiteblocked(self, address): if address in self.file_content["siteblocks"] or address in self.include_filters["siteblocks"]: return True - else: - return False + return False + + def getSiteblockDetails(self, address): + details = self.file_content["siteblocks"].get(address) + if not details: + address_sha256 = self.getSiteAddressHashed(address) + details = self.file_content["siteblocks"].get(address_sha256) + + if not details: + includes = self.file_content.get("includes", {}).values() + for include in includes: + include_site = self.site_manager.get(include["address"]) + if not include_site: + continue + content = include_site.storage.loadJson(include["inner_path"]) + details = content.get("siteblocks").get(address) + if details: + details["include"] = include + break + + return details # Search and remove or readd files of an user def changeDbs(self, auth_address, action): diff --git a/plugins/ContentFilter/media/blocklisted.html b/plugins/ContentFilter/media/blocklisted.html index 9a287b72..c9d201a9 100644 --- a/plugins/ContentFilter/media/blocklisted.html +++ b/plugins/ContentFilter/media/blocklisted.html @@ -62,25 +62,7 @@ class Page extends ZeroFrame { } async updateSiteblockDetails(address) { - var address_sha256 = await sha256hex(address) - var blocks = await this.cmdp("siteblockList") - if (blocks[address] || blocks[address_sha256]) { - block = blocks[address] - } else { - var includes = await this.cmdp("filterIncludeList", {all_sites: true, filters: true}) - for (let include of includes) { - if (include["siteblocks"][address]) { - var block = include["siteblocks"][address] - block["include"] = include - } - if (include["siteblocks"][address_sha256]) { - var block = include["siteblocks"][address_sha256] - block["include"] = include - } - } - } - - this.blocks = blocks + var block = await this.cmdp("siteblockGet", address) var reason = block["reason"] if (!reason) reason = "Unknown reason" var date = new Date(block["date_added"] * 1000) @@ -95,7 +77,7 @@ class Page extends ZeroFrame { document.getElementById("visit").style.opacity = "1" document.getElementById("visit").onclick = () => { if (block["include"]) - this.cmd("siteAdd", address, () => { this.cmd("wrapperReload") }) + this.cmd("siteblockIgnoreAddSite", address, () => { this.cmd("wrapperReload") }) else this.cmd("siteblockRemove", address, () => { this.cmd("wrapperReload") }) } diff --git a/plugins/ContentFilter/plugin_info.json b/plugins/ContentFilter/plugin_info.json new file mode 100644 index 00000000..f63bc984 --- /dev/null +++ b/plugins/ContentFilter/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "ContentFilter", + "description": "Manage site and user block list.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/Cors/CorsPlugin.py b/plugins/Cors/CorsPlugin.py index af501462..a26c5c2b 100644 --- a/plugins/Cors/CorsPlugin.py +++ b/plugins/Cors/CorsPlugin.py @@ -1,11 +1,16 @@ import re import html import copy +import os from Plugin import PluginManager from Translate import Translate + + +plugin_dir = os.path.dirname(__file__) + if "_" not in locals(): - _ = Translate("plugins/Cors/languages/") + _ = Translate(plugin_dir + "/languages/") def getCorsPath(site, inner_path): @@ -27,7 +32,11 @@ class UiWebsocketPlugin(object): if super(UiWebsocketPlugin, self).hasSitePermission(address, cmd=cmd): return True - if not "Cors:%s" % address in self.site.settings["permissions"] or cmd not in ["fileGet", "fileList", "dirList", "fileRules", "optionalFileInfo", "fileQuery", "dbQuery", "userGetSettings", "siteInfo"]: + allowed_commands = [ + "fileGet", "fileList", "dirList", "fileRules", "optionalFileInfo", + "fileQuery", "dbQuery", "userGetSettings", "siteInfo" + ] + if not "Cors:%s" % address in self.site.settings["permissions"] or cmd not in allowed_commands: return False else: return True @@ -99,6 +108,6 @@ class UiRequestPlugin(object): site = self.server.sites[path_parts["address"]] try: path_parts["address"], path_parts["inner_path"] = getCorsPath(site, path_parts["inner_path"]) - except: + except Exception: return None return path_parts diff --git a/plugins/Cors/plugin_info.json b/plugins/Cors/plugin_info.json new file mode 100644 index 00000000..f8af18fa --- /dev/null +++ b/plugins/Cors/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "Cors", + "description": "Cross site resource read.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/CryptMessage/CryptMessage.py b/plugins/CryptMessage/CryptMessage.py index 00c5d7c6..74659404 100644 --- a/plugins/CryptMessage/CryptMessage.py +++ b/plugins/CryptMessage/CryptMessage.py @@ -1,59 +1,58 @@ import hashlib import base64 - -import lib.pybitcointools as btctools - -ecc_cache = {} +import struct +from lib import sslcrypto +from Crypt import Crypt -def eciesEncrypt(data, pubkey, ephemcurve=None, ciphername='aes-256-cbc'): - import pyelliptic - pubkey_openssl = toOpensslPublickey(base64.b64decode(pubkey)) - curve, pubkey_x, pubkey_y, i = pyelliptic.ECC._decode_pubkey(pubkey_openssl) - if ephemcurve is None: - ephemcurve = curve - ephem = pyelliptic.ECC(curve=ephemcurve) - key = hashlib.sha512(ephem.raw_get_ecdh_key(pubkey_x, pubkey_y)).digest() - key_e, key_m = key[:32], key[32:] - pubkey = ephem.get_pubkey() - iv = pyelliptic.OpenSSL.rand(pyelliptic.OpenSSL.get_cipher(ciphername).get_blocksize()) - ctx = pyelliptic.Cipher(key_e, iv, 1, ciphername) - ciphertext = iv + pubkey + ctx.ciphering(data) - mac = pyelliptic.hmac_sha256(key_m, ciphertext) - return key_e, ciphertext + mac +curve = sslcrypto.ecc.get_curve("secp256k1") + + +def eciesEncrypt(data, pubkey, ciphername="aes-256-cbc"): + ciphertext, key_e = curve.encrypt( + data, + base64.b64decode(pubkey), + algo=ciphername, + derivation="sha512", + return_aes_key=True + ) + return key_e, ciphertext + + +@Crypt.thread_pool_crypt.wrap +def eciesDecryptMulti(encrypted_datas, privatekey): + texts = [] # Decoded texts + for encrypted_data in encrypted_datas: + try: + text = eciesDecrypt(encrypted_data, privatekey).decode("utf8") + texts.append(text) + except Exception: + texts.append(None) + return texts + + +def eciesDecrypt(ciphertext, privatekey): + return curve.decrypt(base64.b64decode(ciphertext), curve.wif_to_private(privatekey), derivation="sha512") + + +def decodePubkey(pubkey): + i = 0 + curve = struct.unpack('!H', pubkey[i:i + 2])[0] + i += 2 + tmplen = struct.unpack('!H', pubkey[i:i + 2])[0] + i += 2 + pubkey_x = pubkey[i:i + tmplen] + i += tmplen + tmplen = struct.unpack('!H', pubkey[i:i + 2])[0] + i += 2 + pubkey_y = pubkey[i:i + tmplen] + i += tmplen + return curve, pubkey_x, pubkey_y, i -def eciesDecrypt(encrypted_data, privatekey): - ecc_key = getEcc(privatekey) - return ecc_key.decrypt(base64.b64decode(encrypted_data)) def split(encrypted): iv = encrypted[0:16] - ciphertext = encrypted[16 + 70:-32] + curve, pubkey_x, pubkey_y, i = decodePubkey(encrypted[16:]) + ciphertext = encrypted[16 + i:-32] return iv, ciphertext - - -def getEcc(privatekey=None): - import pyelliptic - global ecc_cache - if privatekey not in ecc_cache: - if privatekey: - publickey_bin = btctools.encode_pubkey(btctools.privtopub(privatekey), "bin") - publickey_openssl = toOpensslPublickey(publickey_bin) - privatekey_openssl = toOpensslPrivatekey(privatekey) - ecc_cache[privatekey] = pyelliptic.ECC(curve='secp256k1', privkey=privatekey_openssl, pubkey=publickey_openssl) - else: - ecc_cache[None] = pyelliptic.ECC() - return ecc_cache[privatekey] - - -def toOpensslPrivatekey(privatekey): - privatekey_bin = btctools.encode_privkey(privatekey, "bin") - return b'\x02\xca\x00\x20' + privatekey_bin - - -def toOpensslPublickey(publickey): - publickey_bin = btctools.encode_pubkey(publickey, "bin") - publickey_bin = publickey_bin[1:] - publickey_openssl = b'\x02\xca\x00 ' + publickey_bin[:32] + b'\x00 ' + publickey_bin[32:] - return publickey_openssl diff --git a/plugins/CryptMessage/CryptMessagePlugin.py b/plugins/CryptMessage/CryptMessagePlugin.py index 6cfb8fc5..150bf8be 100644 --- a/plugins/CryptMessage/CryptMessagePlugin.py +++ b/plugins/CryptMessage/CryptMessagePlugin.py @@ -1,26 +1,26 @@ import base64 import os +import gevent + from Plugin import PluginManager from Crypt import CryptBitcoin, CryptHash -import lib.pybitcointools as btctools +from Config import config +import sslcrypto from . import CryptMessage +curve = sslcrypto.ecc.get_curve("secp256k1") + @PluginManager.registerTo("UiWebsocket") class UiWebsocketPlugin(object): - def eciesDecrypt(self, encrypted, privatekey): - back = CryptMessage.getEcc(privatekey).decrypt(encrypted) - return back.decode("utf8") - # - Actions - # Returns user's public key unique to site # Return: Public key def actionUserPublickey(self, to, index=0): - publickey = self.user.getEncryptPublickey(self.site.address, index) - self.response(to, publickey) + self.response(to, self.user.getEncryptPublickey(self.site.address, index)) # Encrypt a text using the publickey or user's sites unique publickey # Return: Encrypted text using base64 encoding @@ -44,13 +44,7 @@ class UiWebsocketPlugin(object): else: encrypted_texts = [param] - texts = [] # Decoded texts - for encrypted_text in encrypted_texts: - try: - text = CryptMessage.eciesDecrypt(encrypted_text, privatekey).decode("utf8") - texts.append(text) - except Exception as err: - texts.append(None) + texts = CryptMessage.eciesDecryptMulti(encrypted_texts, privatekey) if type(param) == list: self.response(to, texts) @@ -59,23 +53,16 @@ class UiWebsocketPlugin(object): # Encrypt a text using AES # Return: Iv, AES key, Encrypted text - def actionAesEncrypt(self, to, text, key=None, iv=None): - import pyelliptic - + def actionAesEncrypt(self, to, text, key=None): if key: key = base64.b64decode(key) else: - key = os.urandom(32) - - if iv: # Generate new AES key if not definied - iv = base64.b64decode(iv) - else: - iv = pyelliptic.Cipher.gen_IV('aes-256-cbc') + key = sslcrypto.aes.new_key() if text: - encrypted = pyelliptic.Cipher(key, iv, 1, ciphername='aes-256-cbc').ciphering(text.encode("utf8")) + encrypted, iv = sslcrypto.aes.encrypt(text.encode("utf8"), key) else: - encrypted = b"" + encrypted, iv = b"", b"" res = [base64.b64encode(item).decode("utf8") for item in [key, iv, encrypted]] self.response(to, res) @@ -83,8 +70,6 @@ class UiWebsocketPlugin(object): # Decrypt a text using AES # Return: Decrypted text def actionAesDecrypt(self, to, *args): - import pyelliptic - if len(args) == 3: # Single decrypt encrypted_texts = [(args[0], args[1])] keys = [args[2]] @@ -97,9 +82,8 @@ class UiWebsocketPlugin(object): iv = base64.b64decode(iv) text = None for key in keys: - ctx = pyelliptic.Cipher(base64.b64decode(key), iv, 0, ciphername='aes-256-cbc') try: - decrypted = ctx.ciphering(encrypted_text) + decrypted = sslcrypto.aes.decrypt(encrypted_text, iv, base64.b64decode(key)) if decrypted and decrypted.decode("utf8"): # Valid text decoded text = decrypted.decode("utf8") except Exception as err: @@ -126,12 +110,11 @@ class UiWebsocketPlugin(object): # Gets the publickey of a given privatekey def actionEccPrivToPub(self, to, privatekey): - self.response(to, btctools.privtopub(privatekey)) + self.response(to, curve.private_to_public(curve.wif_to_private(privatekey))) # Gets the address of a given publickey def actionEccPubToAddr(self, to, publickey): - address = btctools.pubtoaddr(btctools.decode_pubkey(publickey)) - self.response(to, address) + self.response(to, curve.public_to_address(bytes.fromhex(publickey))) @PluginManager.registerTo("User") @@ -167,6 +150,76 @@ class UserPlugin(object): if "encrypt_publickey_%s" % index not in site_data: privatekey = self.getEncryptPrivatekey(address, param_index) - publickey = btctools.encode_pubkey(btctools.privtopub(privatekey), "bin_compressed") + publickey = curve.private_to_public(curve.wif_to_private(privatekey)) site_data["encrypt_publickey_%s" % index] = base64.b64encode(publickey).decode("utf8") return site_data["encrypt_publickey_%s" % index] + + +@PluginManager.registerTo("Actions") +class ActionsPlugin: + publickey = "A3HatibU4S6eZfIQhVs2u7GLN5G9wXa9WwlkyYIfwYaj" + privatekey = "5JBiKFYBm94EUdbxtnuLi6cvNcPzcKymCUHBDf2B6aq19vvG3rL" + utf8_text = '\xc1rv\xedzt\xfbr\xf5t\xfck\xf6rf\xfar\xf3g\xe9p' + + def getBenchmarkTests(self, online=False): + if hasattr(super(), "getBenchmarkTests"): + tests = super().getBenchmarkTests(online) + else: + tests = [] + + aes_key, encrypted = CryptMessage.eciesEncrypt(self.utf8_text.encode("utf8"), self.publickey) # Warm-up + tests.extend([ + {"func": self.testCryptEciesEncrypt, "kwargs": {}, "num": 100, "time_standard": 1.2}, + {"func": self.testCryptEciesDecrypt, "kwargs": {}, "num": 500, "time_standard": 1.3}, + {"func": self.testCryptEciesDecryptMulti, "kwargs": {}, "num": 5, "time_standard": 0.68}, + {"func": self.testCryptAesEncrypt, "kwargs": {}, "num": 10000, "time_standard": 0.27}, + {"func": self.testCryptAesDecrypt, "kwargs": {}, "num": 10000, "time_standard": 0.25} + ]) + return tests + + def testCryptEciesEncrypt(self, num_run=1): + for i in range(num_run): + aes_key, encrypted = CryptMessage.eciesEncrypt(self.utf8_text.encode("utf8"), self.publickey) + assert len(aes_key) == 32 + yield "." + + def testCryptEciesDecrypt(self, num_run=1): + aes_key, encrypted = CryptMessage.eciesEncrypt(self.utf8_text.encode("utf8"), self.publickey) + for i in range(num_run): + assert len(aes_key) == 32 + decrypted = CryptMessage.eciesDecrypt(base64.b64encode(encrypted), self.privatekey) + assert decrypted == self.utf8_text.encode("utf8"), "%s != %s" % (decrypted, self.utf8_text.encode("utf8")) + yield "." + + def testCryptEciesDecryptMulti(self, num_run=1): + yield "x 100 (%s threads) " % config.threads_crypt + aes_key, encrypted = CryptMessage.eciesEncrypt(self.utf8_text.encode("utf8"), self.publickey) + + threads = [] + for i in range(num_run): + assert len(aes_key) == 32 + threads.append(gevent.spawn( + CryptMessage.eciesDecryptMulti, [base64.b64encode(encrypted)] * 100, self.privatekey + )) + + for thread in threads: + res = thread.get() + assert res[0] == self.utf8_text, "%s != %s" % (res[0], self.utf8_text) + assert res[0] == res[-1], "%s != %s" % (res[0], res[-1]) + yield "." + gevent.joinall(threads) + + def testCryptAesEncrypt(self, num_run=1): + for i in range(num_run): + key = os.urandom(32) + encrypted = sslcrypto.aes.encrypt(self.utf8_text.encode("utf8"), key) + yield "." + + def testCryptAesDecrypt(self, num_run=1): + key = os.urandom(32) + encrypted_text, iv = sslcrypto.aes.encrypt(self.utf8_text.encode("utf8"), key) + + for i in range(num_run): + decrypted = sslcrypto.aes.decrypt(encrypted_text, iv, key).decode("utf8") + assert decrypted == self.utf8_text + yield "." diff --git a/plugins/CryptMessage/Test/TestCrypt.py b/plugins/CryptMessage/Test/TestCrypt.py index 681c4790..25a077d8 100644 --- a/plugins/CryptMessage/Test/TestCrypt.py +++ b/plugins/CryptMessage/Test/TestCrypt.py @@ -18,13 +18,10 @@ class TestCrypt: assert len(aes_key) == 32 # assert len(encrypted) == 134 + int(len(text) / 16) * 16 # Not always true - ecc = CryptMessage.getEcc(self.privatekey) - assert ecc.decrypt(encrypted) == text_repeated + assert CryptMessage.eciesDecrypt(base64.b64encode(encrypted), self.privatekey) == text_repeated def testDecryptEcies(self, user): - encrypted = base64.b64decode(self.ecies_encrypted_text) - ecc = CryptMessage.getEcc(self.privatekey) - assert ecc.decrypt(encrypted) == b"hello" + assert CryptMessage.eciesDecrypt(self.ecies_encrypted_text, self.privatekey) == b"hello" def testPublickey(self, ui_websocket): pub = ui_websocket.testAction("UserPublickey", 0) @@ -47,26 +44,25 @@ class TestCrypt: assert pub1 != pub2 def testEcies(self, ui_websocket): - ui_websocket.actionUserPublickey(0, 0) - pub = ui_websocket.ws.getResult() + pub = ui_websocket.testAction("UserPublickey") - ui_websocket.actionEciesEncrypt(0, "hello", pub) - encrypted = ui_websocket.ws.getResult() + encrypted = ui_websocket.testAction("EciesEncrypt", "hello", pub) assert len(encrypted) == 180 # Don't allow decrypt using other privatekey index - ui_websocket.actionEciesDecrypt(0, encrypted, 123) - decrypted = ui_websocket.ws.getResult() + decrypted = ui_websocket.testAction("EciesDecrypt", encrypted, 123) assert decrypted != "hello" # Decrypt using correct privatekey - ui_websocket.actionEciesDecrypt(0, encrypted) - decrypted = ui_websocket.ws.getResult() + decrypted = ui_websocket.testAction("EciesDecrypt", encrypted) assert decrypted == "hello" + # Decrypt incorrect text + decrypted = ui_websocket.testAction("EciesDecrypt", "baad") + assert decrypted is None + # Decrypt batch - ui_websocket.actionEciesDecrypt(0, [encrypted, "baad", encrypted]) - decrypted = ui_websocket.ws.getResult() + decrypted = ui_websocket.testAction("EciesDecrypt", [encrypted, "baad", encrypted]) assert decrypted == ["hello", None, "hello"] def testEciesUtf8(self, ui_websocket): @@ -91,6 +87,21 @@ class TestCrypt: ui_websocket.actionAesDecrypt(0, base64.b64encode(aes_iv), base64.b64encode(aes_encrypted), aes_key) assert ui_websocket.ws.getResult() == "hello" + def testEciesAesLongpubkey(self, ui_websocket): + privatekey = "5HwVS1bTFnveNk9EeGaRenWS1QFzLFb5kuncNbiY3RiHZrVR6ok" + + ecies_encrypted, aes_key = ["lWiXfEikIjw1ac3J/RaY/gLKACALRUfksc9rXYRFyKDSaxhwcSFBYCgAdIyYlY294g/6VgAf/68PYBVMD3xKH1n7Zbo+ge8b4i/XTKmCZRJvy0eutMKWckYCMVcxgIYNa/ZL1BY1kvvH7omgzg1wBraoLfdbNmVtQgdAZ9XS8PwRy6OB2Q==", "Rvlf7zsMuBFHZIGHcbT1rb4If+YTmsWDv6kGwcvSeMM="] + + # Decrypt using Ecies + ui_websocket.actionEciesDecrypt(0, ecies_encrypted, privatekey) + assert ui_websocket.ws.getResult() == "hello" + + # Decrypt using AES + aes_iv, aes_encrypted = CryptMessage.split(base64.b64decode(ecies_encrypted)) + + ui_websocket.actionAesDecrypt(0, base64.b64encode(aes_iv), base64.b64encode(aes_encrypted), aes_key) + assert ui_websocket.ws.getResult() == "hello" + def testAes(self, ui_websocket): ui_websocket.actionAesEncrypt(0, "hello") key, iv, encrypted = ui_websocket.ws.getResult() diff --git a/plugins/CryptMessage/plugin_info.json b/plugins/CryptMessage/plugin_info.json new file mode 100644 index 00000000..96dfdd89 --- /dev/null +++ b/plugins/CryptMessage/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "CryptMessage", + "description": "Cryptographic functions of ECIES and AES data encryption/decryption.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/FilePack/FilePackPlugin.py b/plugins/FilePack/FilePackPlugin.py index 840961b7..a095c6d4 100644 --- a/plugins/FilePack/FilePackPlugin.py +++ b/plugins/FilePack/FilePackPlugin.py @@ -21,9 +21,6 @@ def openArchive(archive_path, file_obj=None): if archive_path.endswith("tar.gz"): import tarfile archive_cache[archive_path] = tarfile.open(archive_path, fileobj=file_obj, mode="r:gz") - elif archive_path.endswith("tar.bz2"): - import tarfile - archive_cache[archive_path] = tarfile.open(archive_path, fileobj=file_obj, mode="r:bz2") else: import zipfile archive_cache[archive_path] = zipfile.ZipFile(file_obj or archive_path) @@ -48,7 +45,7 @@ class UiRequestPlugin(object): file_obj = None path_parts = self.parsePath(path) file_path = "%s/%s/%s" % (config.data_dir, path_parts["address"], path_parts["inner_path"]) - match = re.match("^(.*\.(?:tar.gz|tar.bz2|zip))/(.*)", file_path) + match = re.match("^(.*\.(?:tar.gz|zip))/(.*)", file_path) archive_path, path_within = match.groups() if archive_path not in archive_cache: site = self.server.site_manager.get(path_parts["address"]) @@ -102,7 +99,7 @@ class UiRequestPlugin(object): class SiteStoragePlugin(object): def isFile(self, inner_path): if ".zip/" in inner_path or ".tar.gz/" in inner_path: - match = re.match("^(.*\.(?:tar.gz|tar.bz2|zip))/(.*)", inner_path) + match = re.match("^(.*\.(?:tar.gz|zip))/(.*)", inner_path) archive_inner_path, path_within = match.groups() return super(SiteStoragePlugin, self).isFile(archive_inner_path) else: @@ -130,7 +127,7 @@ class SiteStoragePlugin(object): def walk(self, inner_path, *args, **kwags): if ".zip" in inner_path or ".tar.gz" in inner_path: - match = re.match("^(.*\.(?:tar.gz|tar.bz2|zip))(.*)", inner_path) + match = re.match("^(.*\.(?:tar.gz|zip))(.*)", inner_path) archive_inner_path, path_within = match.groups() archive = self.openArchive(archive_inner_path) path_within = path_within.lstrip("/") @@ -154,7 +151,7 @@ class SiteStoragePlugin(object): def list(self, inner_path, *args, **kwags): if ".zip" in inner_path or ".tar.gz" in inner_path: - match = re.match("^(.*\.(?:tar.gz|tar.bz2|zip))(.*)", inner_path) + match = re.match("^(.*\.(?:tar.gz|zip))(.*)", inner_path) archive_inner_path, path_within = match.groups() archive = self.openArchive(archive_inner_path) path_within = path_within.lstrip("/") @@ -179,9 +176,9 @@ class SiteStoragePlugin(object): else: return super(SiteStoragePlugin, self).list(inner_path, *args, **kwags) - def read(self, inner_path, mode="rb"): + def read(self, inner_path, mode="rb", **kwargs): if ".zip/" in inner_path or ".tar.gz/" in inner_path: - match = re.match("^(.*\.(?:tar.gz|tar.bz2|zip))(.*)", inner_path) + match = re.match("^(.*\.(?:tar.gz|zip))(.*)", inner_path) archive_inner_path, path_within = match.groups() archive = self.openArchive(archive_inner_path) path_within = path_within.lstrip("/") @@ -192,5 +189,5 @@ class SiteStoragePlugin(object): return archive.extractfile(path_within).read() else: - return super(SiteStoragePlugin, self).read(inner_path, mode) + return super(SiteStoragePlugin, self).read(inner_path, mode, **kwargs) diff --git a/plugins/FilePack/plugin_info.json b/plugins/FilePack/plugin_info.json new file mode 100644 index 00000000..42112f95 --- /dev/null +++ b/plugins/FilePack/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "FilePack", + "description": "Transparent web access for Zip and Tar.gz files.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/MergerSite/MergerSitePlugin.py b/plugins/MergerSite/MergerSitePlugin.py index 36c1dbae..d2c24398 100644 --- a/plugins/MergerSite/MergerSitePlugin.py +++ b/plugins/MergerSite/MergerSitePlugin.py @@ -1,11 +1,13 @@ import re import time import copy +import os from Plugin import PluginManager from Translate import Translate from util import RateLimit from util import helper +from util.Flag import flag from Debug import Debug try: import OptionalManager.UiWebsocketPlugin # To make optioanlFileInfo merger sites compatible @@ -18,8 +20,11 @@ if "merger_db" not in locals().keys(): # To keep merger_sites between module re merged_to_merger = {} # {address: [site1, site2, ...]} cache site_manager = None # Site manager for merger sites + +plugin_dir = os.path.dirname(__file__) + if "_" not in locals(): - _ = Translate("plugins/MergerSite/languages/") + _ = Translate(plugin_dir + "/languages/") # Check if the site has permission to this merger site @@ -74,14 +79,18 @@ class UiWebsocketPlugin(object): def cbMergerSiteAdd(self, to, addresses): added = 0 for address in addresses: - added += 1 - site_manager.need(address) + try: + site_manager.need(address) + added += 1 + except Exception as err: + self.cmd("notification", ["error", _["Adding %s failed: %s"] % (address, err)]) if added: self.cmd("notification", ["done", _["Added %s new site"] % added, 5000]) RateLimit.called(self.site.address + "-MergerSiteAdd") site_manager.updateMergerSites() # Delete a merged site + @flag.no_multiuser def actionMergerSiteDelete(self, to, address): site = self.server.sites.get(address) if not site: @@ -221,7 +230,7 @@ class UiWebsocketPlugin(object): site = self.server.sites.get(address) try: merged_sites.append(site.content_manager.contents.get("content.json").get("title", address)) - except Exception as err: + except Exception: merged_sites.append(address) details = _["Read and write permissions to sites with merged type of %s "] % merger_type @@ -289,6 +298,9 @@ class SiteStoragePlugin(object): # Also notice merger sites on a merged site file change def onUpdated(self, inner_path, file=None): + if inner_path == "content.json": + site_manager.updateMergerSites() + super(SiteStoragePlugin, self).onUpdated(inner_path, file) merged_type = merged_db.get(self.site.address) @@ -333,9 +345,9 @@ class SiteManagerPlugin(object): def updateMergerSites(self): global merger_db, merged_db, merged_to_merger, site_manager s = time.time() - merger_db = {} - merged_db = {} - merged_to_merger = {} + merger_db_new = {} + merged_db_new = {} + merged_to_merger_new = {} site_manager = self if not self.sites: return @@ -347,7 +359,7 @@ class SiteManagerPlugin(object): self.log.error("Error loading site %s: %s" % (site.address, Debug.formatException(err))) continue if merged_type: - merged_db[site.address] = merged_type + merged_db_new[site.address] = merged_type # Update merger sites for permission in site.settings["permissions"]: @@ -361,18 +373,24 @@ class SiteManagerPlugin(object): site.settings["permissions"].remove(permission) continue merger_type = permission.replace("Merger:", "") - if site.address not in merger_db: - merger_db[site.address] = [] - merger_db[site.address].append(merger_type) + if site.address not in merger_db_new: + merger_db_new[site.address] = [] + merger_db_new[site.address].append(merger_type) site_manager.sites[site.address] = site # Update merged to merger if merged_type: for merger_site in self.sites.values(): if "Merger:" + merged_type in merger_site.settings["permissions"]: - if site.address not in merged_to_merger: - merged_to_merger[site.address] = [] - merged_to_merger[site.address].append(merger_site) + if site.address not in merged_to_merger_new: + merged_to_merger_new[site.address] = [] + merged_to_merger_new[site.address].append(merger_site) + + # Update globals + merger_db = merger_db_new + merged_db = merged_db_new + merged_to_merger = merged_to_merger_new + self.log.debug("Updated merger sites in %.3fs" % (time.time() - s)) def load(self, *args, **kwags): diff --git a/plugins/Newsfeed/NewsfeedPlugin.py b/plugins/Newsfeed/NewsfeedPlugin.py index f15d7447..3eb14d6c 100644 --- a/plugins/Newsfeed/NewsfeedPlugin.py +++ b/plugins/Newsfeed/NewsfeedPlugin.py @@ -5,6 +5,7 @@ from Plugin import PluginManager from Db.DbQuery import DbQuery from Debug import Debug from util import helper +from util.Flag import flag @PluginManager.registerTo("UiWebsocket") @@ -27,10 +28,8 @@ class UiWebsocketPlugin(object): feeds = self.user.sites.get(self.site.address, {}).get("follow", {}) self.response(to, feeds) + @flag.admin def actionFeedQuery(self, to, limit=10, day_limit=3): - if "ADMIN" not in self.site.settings["permissions"]: - return self.response(to, "FeedQuery not allowed") - from Site import SiteManager rows = [] stats = [] diff --git a/plugins/OptionalManager/ContentDbPlugin.py b/plugins/OptionalManager/ContentDbPlugin.py index e7945d93..f0f8a877 100644 --- a/plugins/OptionalManager/ContentDbPlugin.py +++ b/plugins/OptionalManager/ContentDbPlugin.py @@ -24,8 +24,8 @@ class ContentDbPlugin(object): self.time_peer_numbers_updated = 0 self.my_optional_files = {} # Last 50 site_address/inner_path called by fileWrite (auto-pinning these files) self.optional_files = collections.defaultdict(dict) - self.optional_files_loading = False - helper.timer(60 * 5, self.checkOptionalLimit) + self.optional_files_loaded = False + self.timer_check_optional = helper.timer(60 * 5, self.checkOptionalLimit) super(ContentDbPlugin, self).__init__(*args, **kwargs) def getSchema(self): @@ -60,9 +60,6 @@ class ContentDbPlugin(object): super(ContentDbPlugin, self).initSite(site) if self.need_filling: self.fillTableFileOptional(site) - if not self.optional_files_loading: - gevent.spawn_later(1, self.loadFilesOptional) - self.optional_files_loading = True def checkTables(self): changed_tables = super(ContentDbPlugin, self).checkTables() @@ -91,7 +88,7 @@ class ContentDbPlugin(object): site_ids_reverse = {val: key for key, val in self.site_ids.items()} for site_id, stats in site_sizes.items(): site_address = site_ids_reverse.get(site_id) - if not site_address: + if not site_address or site_address not in self.sites: self.log.error("Not found site_id: %s" % site_id) continue site = self.sites[site_address] @@ -100,7 +97,7 @@ class ContentDbPlugin(object): total += stats["size_optional"] total_downloaded += stats["optional_downloaded"] - self.log.debug( + self.log.info( "Loaded %s optional files: %.2fMB, downloaded: %.2fMB in %.3fs" % (num, float(total) / 1024 / 1024, float(total_downloaded) / 1024 / 1024, time.time() - s) ) @@ -108,7 +105,7 @@ class ContentDbPlugin(object): if self.need_filling and self.getOptionalLimitBytes() >= 0 and self.getOptionalLimitBytes() < total_downloaded: limit_bytes = self.getOptionalLimitBytes() limit_new = round((float(total_downloaded) / 1024 / 1024 / 1024) * 1.1, 2) # Current limit + 10% - self.log.debug( + self.log.info( "First startup after update and limit is smaller than downloaded files size (%.2fGB), increasing it from %.2fGB to %.2fGB" % (float(total_downloaded) / 1024 / 1024 / 1024, float(limit_bytes) / 1024 / 1024 / 1024, limit_new) ) @@ -142,14 +139,14 @@ class ContentDbPlugin(object): if not user: user = UserManager.user_manager.create() auth_address = user.getAuthAddress(site.address) - self.execute( + res = self.execute( "UPDATE file_optional SET is_pinned = 1 WHERE site_id = :site_id AND inner_path LIKE :inner_path", {"site_id": site_id, "inner_path": "%%/%s/%%" % auth_address} ) self.log.debug( "Filled file_optional table for %s in %.3fs (loaded: %s, is_pinned: %s)" % - (site.address, time.time() - s, num, self.cur.cursor.rowcount) + (site.address, time.time() - s, num, res.rowcount) ) self.filled[site.address] = True @@ -405,3 +402,13 @@ class ContentDbPlugin(object): for file_id in deleted_file_ids: cur.execute("UPDATE file_optional SET is_downloaded = 0, is_pinned = 0, peer = peer - 1 WHERE ?", {"file_id": file_id}) cur.close() + + +@PluginManager.registerTo("SiteManager") +class SiteManagerPlugin(object): + def load(self, *args, **kwargs): + back = super(SiteManagerPlugin, self).load(*args, **kwargs) + if self.sites and not content_db.optional_files_loaded and content_db.conn: + content_db.optional_files_loaded = True + content_db.loadFilesOptional() + return back \ No newline at end of file diff --git a/plugins/OptionalManager/OptionalManagerPlugin.py b/plugins/OptionalManager/OptionalManagerPlugin.py index 909caa31..f01fab65 100644 --- a/plugins/OptionalManager/OptionalManagerPlugin.py +++ b/plugins/OptionalManager/OptionalManagerPlugin.py @@ -17,32 +17,46 @@ def importPluginnedClasses(): def processAccessLog(): + global access_log if access_log: content_db = ContentDbPlugin.content_db + if not content_db.conn: + return False + + s = time.time() + access_log_prev = access_log + access_log = collections.defaultdict(dict) now = int(time.time()) num = 0 - for site_id in access_log: + for site_id in access_log_prev: content_db.execute( "UPDATE file_optional SET time_accessed = %s WHERE ?" % now, - {"site_id": site_id, "inner_path": list(access_log[site_id].keys())} + {"site_id": site_id, "inner_path": list(access_log_prev[site_id].keys())} ) - num += len(access_log[site_id]) - access_log.clear() + num += len(access_log_prev[site_id]) + + content_db.log.debug("Inserted %s web request stat in %.3fs" % (num, time.time() - s)) def processRequestLog(): + global request_log if request_log: content_db = ContentDbPlugin.content_db - cur = content_db.getCursor() + if not content_db.conn: + return False + + s = time.time() + request_log_prev = request_log + request_log = collections.defaultdict(lambda: collections.defaultdict(int)) # {site_id: {inner_path1: 1, inner_path2: 1...}} num = 0 - for site_id in request_log: - for inner_path, uploaded in request_log[site_id].items(): + for site_id in request_log_prev: + for inner_path, uploaded in request_log_prev[site_id].items(): content_db.execute( "UPDATE file_optional SET uploaded = uploaded + %s WHERE ?" % uploaded, {"site_id": site_id, "inner_path": inner_path} ) num += 1 - request_log.clear() + content_db.log.debug("Inserted %s file request stat in %.3fs" % (num, time.time() - s)) if "access_log" not in locals().keys(): # To keep between module reloads @@ -72,12 +86,12 @@ class ContentManagerPlugin(object): return super(ContentManagerPlugin, self).optionalDownloaded(inner_path, hash_id, size, own) def optionalRemoved(self, inner_path, hash_id, size=None): - self.contents.db.execute( + res = self.contents.db.execute( "UPDATE file_optional SET is_downloaded = 0, is_pinned = 0, peer = peer - 1 WHERE site_id = :site_id AND inner_path = :inner_path AND is_downloaded = 1", {"site_id": self.contents.db.site_ids[self.site.address], "inner_path": inner_path} ) - if self.contents.db.cur.cursor.rowcount > 0: + if res.rowcount > 0: back = super(ContentManagerPlugin, self).optionalRemoved(inner_path, hash_id, size) # Re-add to hashfield if we have other file with the same hash_id if self.isDownloaded(hash_id=hash_id, force_check_db=True): diff --git a/plugins/OptionalManager/UiWebsocketPlugin.py b/plugins/OptionalManager/UiWebsocketPlugin.py index 626dc2e1..103bbe84 100644 --- a/plugins/OptionalManager/UiWebsocketPlugin.py +++ b/plugins/OptionalManager/UiWebsocketPlugin.py @@ -1,16 +1,21 @@ import re import time import html +import os import gevent from Plugin import PluginManager from Config import config from util import helper +from util.Flag import flag from Translate import Translate + +plugin_dir = os.path.dirname(__file__) + if "_" not in locals(): - _ = Translate("plugins/OptionalManager/languages/") + _ = Translate(plugin_dir + "/languages/") bigfile_sha512_cache = {} @@ -210,6 +215,7 @@ class UiWebsocketPlugin(object): return "ok" + @flag.no_multiuser def actionOptionalFilePin(self, to, inner_path, address=None): if type(inner_path) is not list: inner_path = [inner_path] @@ -222,6 +228,7 @@ class UiWebsocketPlugin(object): self.cmd("notification", ["done", _["Pinned %s files"] % num_file, 5000]) self.response(to, back) + @flag.no_multiuser def actionOptionalFileUnpin(self, to, inner_path, address=None): if type(inner_path) is not list: inner_path = [inner_path] @@ -234,6 +241,7 @@ class UiWebsocketPlugin(object): self.cmd("notification", ["done", _["Removed pin from %s files"] % num_file, 5000]) self.response(to, back) + @flag.no_multiuser def actionOptionalFileDelete(self, to, inner_path, address=None): if not address: address = self.site.address @@ -271,10 +279,8 @@ class UiWebsocketPlugin(object): # Limit functions + @flag.admin def actionOptionalLimitStats(self, to): - if "ADMIN" not in self.site.settings["permissions"]: - return self.response(to, "Forbidden") - back = {} back["limit"] = config.optional_limit back["used"] = self.site.content_manager.contents.db.getOptionalUsedBytes() @@ -282,10 +288,10 @@ class UiWebsocketPlugin(object): self.response(to, back) + @flag.no_multiuser + @flag.admin def actionOptionalLimitSet(self, to, limit): - if "ADMIN" not in self.site.settings["permissions"]: - return self.response(to, {"error": "Forbidden"}) - config.optional_limit = re.sub("\.0+$", "", limit) # Remove unnecessary digits from end + config.optional_limit = re.sub(r"\.0+$", "", limit) # Remove unnecessary digits from end config.saveValue("optional_limit", limit) self.response(to, "ok") @@ -302,6 +308,7 @@ class UiWebsocketPlugin(object): self.response(to, site.settings.get("optional_help", {})) + @flag.no_multiuser def actionOptionalHelp(self, to, directory, title, address=None): if not address: address = self.site.address @@ -338,6 +345,7 @@ class UiWebsocketPlugin(object): self.response(to, dict(stats)) + @flag.no_multiuser def actionOptionalHelpRemove(self, to, directory, address=None): if not address: address = self.site.address @@ -357,6 +365,7 @@ class UiWebsocketPlugin(object): site.settings["autodownloadoptional"] = value self.response(to, value) + @flag.no_multiuser def actionOptionalHelpAll(self, to, value, address=None): if not address: address = self.site.address diff --git a/plugins/OptionalManager/__init__.py b/plugins/OptionalManager/__init__.py index 1f0ad2dd..77b8c348 100644 --- a/plugins/OptionalManager/__init__.py +++ b/plugins/OptionalManager/__init__.py @@ -1 +1,2 @@ -from . import OptionalManagerPlugin \ No newline at end of file +from . import OptionalManagerPlugin +from . import UiWebsocketPlugin diff --git a/plugins/PeerDb/PeerDbPlugin.py b/plugins/PeerDb/PeerDbPlugin.py index b4c8787b..2ce5e39f 100644 --- a/plugins/PeerDb/PeerDbPlugin.py +++ b/plugins/PeerDb/PeerDbPlugin.py @@ -70,7 +70,7 @@ class ContentDbPlugin(object): def savePeers(self, site, spawn=False): if spawn: # Save peers every hour (+random some secs to not update very site at same time) - gevent.spawn_later(60 * 60 + random.randint(0, 60), self.savePeers, site, spawn=True) + site.greenlet_manager.spawnLater(60 * 60 + random.randint(0, 60), self.savePeers, site, spawn=True) if not site.peers: site.log.debug("Peers not saved: No peers found") return @@ -79,7 +79,7 @@ class ContentDbPlugin(object): cur = self.getCursor() try: cur.execute("DELETE FROM peer WHERE site_id = :site_id", {"site_id": site_id}) - cur.cursor.executemany( + cur.executemany( "INSERT INTO peer (site_id, address, port, hashfield, reputation, time_added, time_found) VALUES (?, ?, ?, ?, ?, ?, ?)", self.iteratePeers(site) ) @@ -89,8 +89,8 @@ class ContentDbPlugin(object): def initSite(self, site): super(ContentDbPlugin, self).initSite(site) - gevent.spawn_later(0.5, self.loadPeers, site) - gevent.spawn_later(60*60, self.savePeers, site, spawn=True) + site.greenlet_manager.spawnLater(0.5, self.loadPeers, site) + site.greenlet_manager.spawnLater(60*60, self.savePeers, site, spawn=True) def saveAllPeers(self): for site in list(self.sites.values()): diff --git a/plugins/PeerDb/plugin_info.json b/plugins/PeerDb/plugin_info.json new file mode 100644 index 00000000..b13915ff --- /dev/null +++ b/plugins/PeerDb/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "PeerDb", + "description": "Save/restore peer list on client restart.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/Sidebar/ConsolePlugin.py b/plugins/Sidebar/ConsolePlugin.py index 72192aa7..15f6a1ba 100644 --- a/plugins/Sidebar/ConsolePlugin.py +++ b/plugins/Sidebar/ConsolePlugin.py @@ -5,6 +5,7 @@ from Plugin import PluginManager from Config import config from Debug import Debug from util import SafeRe +from util.Flag import flag class WsLogStreamer(logging.StreamHandler): @@ -37,10 +38,11 @@ class WsLogStreamer(logging.StreamHandler): @PluginManager.registerTo("UiWebsocket") class UiWebsocketPlugin(object): def __init__(self, *args, **kwargs): - self.admin_commands.update(["consoleLogRead", "consoleLogStream", "consoleLogStreamRemove"]) self.log_streamers = {} return super(UiWebsocketPlugin, self).__init__(*args, **kwargs) + @flag.no_multiuser + @flag.admin def actionConsoleLogRead(self, to, filter=None, read_size=32 * 1024, limit=500): log_file_path = "%s/debug.log" % config.log_dir log_file = open(log_file_path, encoding="utf-8") @@ -56,9 +58,16 @@ class UiWebsocketPlugin(object): assert SafeRe.isSafePattern(filter) filter_re = re.compile(".*" + filter) + last_match = False for line in log_file: - if filter and not filter_re.match(line): + if not line.startswith("[") and last_match: # Multi-line log entry + lines.append(line.replace(" ", " ")) continue + + if filter and not filter_re.match(line): + last_match = False + continue + last_match = True lines.append(line) num_found = len(lines) @@ -74,11 +83,15 @@ class UiWebsocketPlugin(object): logging.getLogger('').addHandler(logger) return logger + @flag.no_multiuser + @flag.admin def actionConsoleLogStream(self, to, filter=None): stream_id = to self.log_streamers[stream_id] = self.addLogStreamer(stream_id, filter) self.response(to, {"stream_id": stream_id}) + @flag.no_multiuser + @flag.admin def actionConsoleLogStreamRemove(self, to, stream_id): try: self.log_streamers[stream_id].stop() diff --git a/plugins/Sidebar/SidebarPlugin.py b/plugins/Sidebar/SidebarPlugin.py index dc6a9e9c..e6087adf 100644 --- a/plugins/Sidebar/SidebarPlugin.py +++ b/plugins/Sidebar/SidebarPlugin.py @@ -11,16 +11,17 @@ import urllib.parse import gevent +import util from Config import config from Plugin import PluginManager from Debug import Debug from Translate import Translate from util import helper +from util.Flag import flag from .ZipStream import ZipStream -plugin_dir = "plugins/Sidebar" +plugin_dir = os.path.dirname(__file__) media_dir = plugin_dir + "/media" -sys.path.append(plugin_dir) # To able to load geoip lib loc_cache = {} if "_" not in locals(): @@ -86,10 +87,6 @@ class UiRequestPlugin(object): @PluginManager.registerTo("UiWebsocket") class UiWebsocketPlugin(object): - def __init__(self, *args, **kwargs): - self.async_commands.add("sidebarGetPeers") - return super(UiWebsocketPlugin, self).__init__(*args, **kwargs) - def sidebarRenderPeerStats(self, body, site): connected = len([peer for peer in list(site.peers.values()) if peer.connection and peer.connection.connected]) connectable = len([peer_id for peer_id in list(site.peers.keys()) if not peer_id.endswith(":0")]) @@ -318,18 +315,20 @@ class UiWebsocketPlugin(object): body.append(_("""
  • - +
    """)) - autodownload_bigfile_size_limit = int(site.settings.get("autodownload_bigfile_size_limit", config.autodownload_bigfile_size_limit)) - body.append(_(""" -
    - - MB - {_[Set]} -
    - """)) + if hasattr(config, "autodownload_bigfile_size_limit"): + autodownload_bigfile_size_limit = int(site.settings.get("autodownload_bigfile_size_limit", config.autodownload_bigfile_size_limit)) + body.append(_(""" +
    + + MB + {_[Set]} + {_[Download previous files]} +
    + """)) body.append("
  • ") def sidebarRenderBadFiles(self, body, site): @@ -485,7 +484,7 @@ class UiWebsocketPlugin(object): def sidebarRenderContents(self, body, site): has_privatekey = bool(self.user.getSiteData(site.address, create=False).get("privatekey")) if has_privatekey: - tag_privatekey = _("{_[Private key saved.]} {_[Forgot]}") + tag_privatekey = _("{_[Private key saved.]} {_[Forget]}") else: tag_privatekey = _("{_[Add saved private key]}") @@ -511,11 +510,8 @@ class UiWebsocketPlugin(object): body.append("") body.append("") + @flag.admin def actionSidebarGetHtmlTag(self, to): - permissions = self.getPermissions(to) - if "ADMIN" not in permissions: - return self.response(to, "You don't have permission to run this command") - site = self.site body = [] @@ -566,7 +562,7 @@ class UiWebsocketPlugin(object): self.log.info("Downloading GeoLite2 City database...") self.cmd("progress", ["geolite-info", _["Downloading GeoLite2 City database (one time only, ~20MB)..."], 0]) db_urls = [ - "https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz", + "https://raw.githubusercontent.com/aemr3/GeoLite2-Database/master/GeoLite2-City.mmdb.gz", "https://raw.githubusercontent.com/texnikru/GeoLite2-Database/master/GeoLite2-City.mmdb.gz" ] for db_url in db_urls: @@ -635,6 +631,7 @@ class UiWebsocketPlugin(object): loc_cache[ip] = loc return loc + @util.Noparallel() def getGeoipDb(self): db_name = 'GeoLite2-City.mmdb' @@ -664,7 +661,6 @@ class UiWebsocketPlugin(object): self.log.debug("Not showing peer locations: no GeoIP database") return False - self.log.info("Loading GeoIP database from: %s" % db_path) geodb = maxminddb.open_database(db_path) peers = list(peers.values()) @@ -706,11 +702,9 @@ class UiWebsocketPlugin(object): return peer_locations - + @flag.admin + @flag.async_run def actionSidebarGetPeers(self, to): - permissions = self.getPermissions(to) - if "ADMIN" not in permissions: - return self.response(to, "You don't have permission to run this command") try: peer_locations = self.getPeerLocations(self.site.peers) globe_data = [] @@ -739,53 +733,41 @@ class UiWebsocketPlugin(object): self.log.debug("sidebarGetPeers error: %s" % Debug.formatException(err)) self.response(to, {"error": str(err)}) + @flag.admin + @flag.no_multiuser def actionSiteSetOwned(self, to, owned): - permissions = self.getPermissions(to) - if "ADMIN" not in permissions: - return self.response(to, "You don't have permission to run this command") - if self.site.address == config.updatesite: return self.response(to, "You can't change the ownership of the updater site") self.site.settings["own"] = bool(owned) self.site.updateWebsocket(owned=owned) + @flag.admin + @flag.no_multiuser def actionUserSetSitePrivatekey(self, to, privatekey): - permissions = self.getPermissions(to) - if "ADMIN" not in permissions: - return self.response(to, "You don't have permission to run this command") - site_data = self.user.sites[self.site.address] site_data["privatekey"] = privatekey self.site.updateWebsocket(set_privatekey=bool(privatekey)) return "ok" + @flag.admin + @flag.no_multiuser def actionSiteSetAutodownloadoptional(self, to, owned): - permissions = self.getPermissions(to) - if "ADMIN" not in permissions: - return self.response(to, "You don't have permission to run this command") - self.site.settings["autodownloadoptional"] = bool(owned) - self.site.bad_files = {} - gevent.spawn(self.site.update, check_files=True) self.site.worker_manager.removeSolvedFileTasks() + @flag.no_multiuser + @flag.admin def actionDbReload(self, to): - permissions = self.getPermissions(to) - if "ADMIN" not in permissions: - return self.response(to, "You don't have permission to run this command") - self.site.storage.closeDb() self.site.storage.getDb() return self.response(to, "ok") + @flag.no_multiuser + @flag.admin def actionDbRebuild(self, to): - permissions = self.getPermissions(to) - if "ADMIN" not in permissions: - return self.response(to, "You don't have permission to run this command") - try: self.site.storage.rebuildDb() except Exception as err: diff --git a/plugins/Sidebar/languages/hu.json b/plugins/Sidebar/languages/hu.json index 40ed8fab..21216825 100644 --- a/plugins/Sidebar/languages/hu.json +++ b/plugins/Sidebar/languages/hu.json @@ -76,7 +76,7 @@ "Delete this site": "Az oldal törlése", "File write error: ": "Fájl írási hiba: ", "Site settings saved!": "Az oldal beállításai elmentve!", - "Enter your private key:": "Add meg a prviát kulcsod:", + "Enter your private key:": "Add meg a privát kulcsod:", " Signed!": " Aláírva!", "WebGL not supported": "WebGL nem támogatott" -} \ No newline at end of file +} diff --git a/plugins/Sidebar/languages/pt-br.json b/plugins/Sidebar/languages/pt-br.json index 44fe06a2..d5659171 100644 --- a/plugins/Sidebar/languages/pt-br.json +++ b/plugins/Sidebar/languages/pt-br.json @@ -62,7 +62,6 @@ "Save site settings": "Salvar definições do site", "Open site directory": "Abrir diretório do site", - "Content publishing": "内容发布", "Content publishing": "Publicação do conteúdo", "Choose": "Escolher", "Sign": "Assinar", @@ -93,5 +92,6 @@ "Site settings saved!": "Definições do site salvas!", "Enter your private key:": "Digite sua chave privada:", " Signed!": " Assinado!", - "WebGL not supported": "WebGL não é suportado" + "WebGL not supported": "WebGL não é suportado", + "Save as .zip": "Salvar como .zip" } diff --git a/plugins/Sidebar/languages/zh.json b/plugins/Sidebar/languages/zh.json index 696084cf..639ac7f6 100644 --- a/plugins/Sidebar/languages/zh.json +++ b/plugins/Sidebar/languages/zh.json @@ -27,8 +27,11 @@ "Optional files": "可选文件", "Downloaded": "已下载", - "Download and help distribute all files": "下载并帮助分发所有文件", + "Help distribute added optional files": "帮助分发新的可选文件", "Auto download big file size limit": "自动下载大文件大小限制", + "Download previous files": "下载之前的文件", + "Optional files download started": "可选文件下载启动", + "Optional files downloaded": "可选文件下载完成", "Total size": "总大小", "Downloaded files": "已下载文件", diff --git a/plugins/Sidebar/media/Console.coffee b/plugins/Sidebar/media/Console.coffee index c8aace1d..724ebb94 100644 --- a/plugins/Sidebar/media/Console.coffee +++ b/plugins/Sidebar/media/Console.coffee @@ -3,6 +3,14 @@ class Console extends Class @tag = null @opened = false @filter = null + @tab_types = [ + {title: "All", filter: ""}, + {title: "Info", filter: "INFO"}, + {title: "Warning", filter: "WARNING"}, + {title: "Error", filter: "ERROR"} + ] + @read_size = 32 * 1024 + @tab_active = "" #@filter = @sidebar.wrapper.site_info.address_short handleMessageWebsocket_original = @sidebar.wrapper.handleMessageWebsocket @sidebar.wrapper.handleMessageWebsocket = (message) => @@ -11,7 +19,11 @@ class Console extends Class else handleMessageWebsocket_original(message) - if window.top.location.hash == "#console" + $(window).on "hashchange", => + if window.top.location.hash == "#ZeroNet:Console" + @open() + + if window.top.location.hash == "#ZeroNet:Console" setTimeout (=> @open()), 10 createHtmltag: -> @@ -20,6 +32,7 @@ class Console extends Class
    +
    Loading...
    @@ -33,6 +46,7 @@ class Console extends Class """) @text = @container.find(".console-text") @text_elem = @text[0] + @tabs = @container.find(".console-tabs") @text.on "mousewheel", (e) => # Stop animation on manual scrolling if e.originalEvent.deltaY < 0 @@ -43,6 +57,12 @@ class Console extends Class @container.appendTo(document.body) @tag = @container.find(".console") + for tab_type in @tab_types + tab = $("", {href: "#", "data-filter": tab_type.filter}).text(tab_type.title) + if tab_type.filter == @tab_active + tab.addClass("active") + tab.on("click", @handleTabClick) + @tabs.append(tab) @container.on "mousedown touchend touchcancel", (e) => if e.target != e.currentTarget @@ -94,26 +114,31 @@ class Console extends Class loadConsoleText: => - @sidebar.wrapper.ws.cmd "consoleLogRead", {filter: @filter}, (res) => + @sidebar.wrapper.ws.cmd "consoleLogRead", {filter: @filter, read_size: @read_size}, (res) => @text.html("") pos_diff = res["pos_end"] - res["pos_start"] size_read = Math.round(pos_diff/1024) size_total = Math.round(res['pos_end']/1024) + @text.append("

    ") @text.append("Displaying #{res.lines.length} of #{res.num_found} lines found in the last #{size_read}kB of the log file. (#{size_total}kB total)
    ") @addLines res.lines, false @text_elem.scrollTop = @text_elem.scrollHeight + if @stream_id + @sidebar.wrapper.ws.cmd "consoleLogStreamRemove", {stream_id: @stream_id} @sidebar.wrapper.ws.cmd "consoleLogStream", {filter: @filter}, (res) => @stream_id = res.stream_id close: => + window.top.location.hash = "" @sidebar.move_lock = "y" @sidebar.startDrag() @sidebar.stopDrag() open: => - @createHtmltag() - @sidebar.fixbutton_targety = @sidebar.page_height - @stopDragY() + @sidebar.startDrag() + @sidebar.moved("y") + @sidebar.fixbutton_targety = @sidebar.page_height - @sidebar.fixbutton_inity - 50 + @sidebar.stopDrag() onOpened: => @sidebar.onClosed() @@ -153,4 +178,20 @@ class Console extends Class if not @opened @onClosed() -window.Console = Console \ No newline at end of file + changeFilter: (filter) => + @filter = filter + if @filter == "" + @read_size = 32 * 1024 + else + @read_size = 5 * 1024 * 1024 + @loadConsoleText() + + handleTabClick: (e) => + elem = $(e.currentTarget) + @tab_active = elem.data("filter") + $("a", @tabs).removeClass("active") + elem.addClass("active") + @changeFilter(@tab_active) + return false + +window.Console = Console diff --git a/plugins/Sidebar/media/Console.css b/plugins/Sidebar/media/Console.css index dc386d70..127d15bf 100644 --- a/plugins/Sidebar/media/Console.css +++ b/plugins/Sidebar/media/Console.css @@ -1,9 +1,19 @@ .console-container { width: 100%; z-index: 998; position: absolute; top: -100vh; padding-bottom: 100%; } .console-container .console { background-color: #212121; height: 100vh; transform: translateY(0px); padding-top: 80px; box-sizing: border-box; } -.console-top { color: white; font-family: Consolas, monospace; font-size: 11px; line-height: 20px; padding: 5px; height: 100%; box-sizing: border-box; letter-spacing: 0.5px;} -.console-text { overflow-y: scroll; height: 100%; color: #DDD; } - +.console-top { color: white; font-family: Consolas, monospace; font-size: 11px; line-height: 20px; height: 100%; box-sizing: border-box; letter-spacing: 0.5px;} +.console-text { overflow-y: scroll; height: calc(100% - 10px); color: #DDD; padding: 5px; margin-top: -36px; overflow-wrap: break-word; } +.console-tabs { + background-color: #41193fad; position: relative; margin-right: 17px; /*backdrop-filter: blur(2px);*/ + box-shadow: -30px 0px 45px #7d2463; background: linear-gradient(-75deg, #591a48ed, #70305e66); border-bottom: 1px solid #792e6473; +} +.console-tabs a { + margin-right: 5px; padding: 5px 15px; text-decoration: none; color: #AAA; + font-size: 11px; font-family: "Consolas"; text-transform: uppercase; border: 1px solid #666; + border-bottom: 0px; display: inline-block; margin: 5px; margin-bottom: 0px; background-color: rgba(0,0,0,0.5); +} +.console-tabs a:hover { color: #FFF } +.console-tabs a.active { background-color: #46223c; color: #FFF } .console-middle {height: 0px; top: 50%; position: absolute; width: 100%; left: 50%; display: none; } .console .mynode { diff --git a/plugins/Sidebar/media/Sidebar.coffee b/plugins/Sidebar/media/Sidebar.coffee index 827e7f65..47c6e7f8 100644 --- a/plugins/Sidebar/media/Sidebar.coffee +++ b/plugins/Sidebar/media/Sidebar.coffee @@ -23,9 +23,9 @@ class Sidebar extends Class @original_set_site_info = @wrapper.setSiteInfo # We going to override this, save the original # Start in opened state for debugging - if false + if window.top.location.hash == "#ZeroNet:OpenSidebar" @startDrag() - @moved() + @moved("x") @fixbutton_targetx = @fixbutton_initx - @width @stopDrag() @@ -204,15 +204,15 @@ class Sidebar extends Class return true } - # Save and forgot privatekey for site signing + # Save and forget privatekey for site signing @tag.find("#privatekey-add").off("click, touchend").on "click touchend", (e) => @wrapper.displayPrompt "Enter your private key:", "password", "Save", "", (privatekey) => @wrapper.ws.cmd "userSetSitePrivatekey", [privatekey], (res) => @wrapper.notifications.add "privatekey", "done", "Private key saved for site signing", 5000 return false - @tag.find("#privatekey-forgot").off("click, touchend").on "click touchend", (e) => - @wrapper.displayConfirm "Remove saved private key for this site?", "Forgot", (res) => + @tag.find("#privatekey-forget").off("click, touchend").on "click touchend", (e) => + @wrapper.displayConfirm "Remove saved private key for this site?", "Forget", (res) => if not res return false @wrapper.ws.cmd "userSetSitePrivatekey", [""], (res) => @@ -372,6 +372,14 @@ class Sidebar extends Class @updateHtmlTag() return false + # Site start download optional files + @tag.find("#button-autodownload_previous").off("click touchend").on "click touchend", => + @wrapper.ws.cmd "siteUpdate", {"address": @wrapper.site_info.address, "check_files": true}, => + @wrapper.notifications.add "done-download_optional", "done", "Optional files downloaded", 5000 + + @wrapper.notifications.add "start-download_optional", "info", "Optional files download started", 5000 + return false + # Database reload @tag.find("#button-dbreload").off("click touchend").on "click touchend", => @wrapper.ws.cmd "dbReload", [], => diff --git a/plugins/Sidebar/media/all.css b/plugins/Sidebar/media/all.css index 7e199620..4921d57f 100644 --- a/plugins/Sidebar/media/all.css +++ b/plugins/Sidebar/media/all.css @@ -1,13 +1,23 @@ -/* ---- plugins/Sidebar/media/Console.css ---- */ +/* ---- Console.css ---- */ .console-container { width: 100%; z-index: 998; position: absolute; top: -100vh; padding-bottom: 100%; } .console-container .console { background-color: #212121; height: 100vh; -webkit-transform: translateY(0px); -moz-transform: translateY(0px); -o-transform: translateY(0px); -ms-transform: translateY(0px); transform: translateY(0px) ; padding-top: 80px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; } -.console-top { color: white; font-family: Consolas, monospace; font-size: 11px; line-height: 20px; padding: 5px; height: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; letter-spacing: 0.5px;} -.console-text { overflow-y: scroll; height: 100%; color: #DDD; } - +.console-top { color: white; font-family: Consolas, monospace; font-size: 11px; line-height: 20px; height: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; letter-spacing: 0.5px;} +.console-text { overflow-y: scroll; height: calc(100% - 10px); color: #DDD; padding: 5px; margin-top: -36px; overflow-wrap: break-word; } +.console-tabs { + background-color: #41193fad; position: relative; margin-right: 17px; /*backdrop-filter: blur(2px);*/ + -webkit-box-shadow: -30px 0px 45px #7d2463; -moz-box-shadow: -30px 0px 45px #7d2463; -o-box-shadow: -30px 0px 45px #7d2463; -ms-box-shadow: -30px 0px 45px #7d2463; box-shadow: -30px 0px 45px #7d2463 ; background: -webkit-linear-gradient(-75deg, #591a48ed, #70305e66);background: -moz-linear-gradient(-75deg, #591a48ed, #70305e66);background: -o-linear-gradient(-75deg, #591a48ed, #70305e66);background: -ms-linear-gradient(-75deg, #591a48ed, #70305e66);background: linear-gradient(-75deg, #591a48ed, #70305e66); border-bottom: 1px solid #792e6473; +} +.console-tabs a { + margin-right: 5px; padding: 5px 15px; text-decoration: none; color: #AAA; + font-size: 11px; font-family: "Consolas"; text-transform: uppercase; border: 1px solid #666; + border-bottom: 0px; display: inline-block; margin: 5px; margin-bottom: 0px; background-color: rgba(0,0,0,0.5); +} +.console-tabs a:hover { color: #FFF } +.console-tabs a.active { background-color: #46223c; color: #FFF } .console-middle {height: 0px; top: 50%; position: absolute; width: 100%; left: 50%; display: none; } .console .mynode { @@ -25,7 +35,7 @@ } -/* ---- plugins/Sidebar/media/Menu.css ---- */ +/* ---- Menu.css ---- */ .menu { @@ -48,7 +58,7 @@ .menu, .menu.visible { position: absolute; left: unset !important; right: 20px; } } -/* ---- plugins/Sidebar/media/Scrollbable.css ---- */ +/* ---- Scrollbable.css ---- */ .scrollable { @@ -97,7 +107,7 @@ } -/* ---- plugins/Sidebar/media/Sidebar.css ---- */ +/* ---- Sidebar.css ---- */ .menu { diff --git a/plugins/Sidebar/media/all.js b/plugins/Sidebar/media/all.js index 0ec96b06..f83a5c5c 100644 --- a/plugins/Sidebar/media/all.js +++ b/plugins/Sidebar/media/all.js @@ -1,5 +1,5 @@ -/* ---- plugins/Sidebar/media/Class.coffee ---- */ +/* ---- Class.coffee ---- */ (function() { @@ -56,7 +56,7 @@ }).call(this); -/* ---- plugins/Sidebar/media/Console.coffee ---- */ +/* ---- Console.coffee ---- */ (function() { @@ -71,6 +71,8 @@ function Console(sidebar) { var handleMessageWebsocket_original; this.sidebar = sidebar; + this.handleTabClick = bind(this.handleTabClick, this); + this.changeFilter = bind(this.changeFilter, this); this.stopDragY = bind(this.stopDragY, this); this.cleanup = bind(this.cleanup, this); this.onClosed = bind(this.onClosed, this); @@ -84,6 +86,23 @@ this.tag = null; this.opened = false; this.filter = null; + this.tab_types = [ + { + title: "All", + filter: "" + }, { + title: "Info", + filter: "INFO" + }, { + title: "Warning", + filter: "WARNING" + }, { + title: "Error", + filter: "ERROR" + } + ]; + this.read_size = 32 * 1024; + this.tab_active = ""; handleMessageWebsocket_original = this.sidebar.wrapper.handleMessageWebsocket; this.sidebar.wrapper.handleMessageWebsocket = (function(_this) { return function(message) { @@ -94,7 +113,14 @@ } }; })(this); - if (window.top.location.hash === "#console") { + $(window).on("hashchange", (function(_this) { + return function() { + if (window.top.location.hash === "#ZeroNet:Console") { + return _this.open(); + } + }; + })(this)); + if (window.top.location.hash === "#ZeroNet:Console") { setTimeout(((function(_this) { return function() { return _this.open(); @@ -104,10 +130,12 @@ } Console.prototype.createHtmltag = function() { + var j, len, ref, tab, tab_type; if (!this.container) { - this.container = $("
    \n
    \n
    \n
    Loading...
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    "); + this.container = $("\n
    "); this.text = this.container.find(".console-text"); this.text_elem = this.text[0]; + this.tabs = this.container.find(".console-tabs"); this.text.on("mousewheel", (function(_this) { return function(e) { if (e.originalEvent.deltaY < 0) { @@ -119,6 +147,19 @@ this.text.is_bottom = true; this.container.appendTo(document.body); this.tag = this.container.find(".console"); + ref = this.tab_types; + for (j = 0, len = ref.length; j < len; j++) { + tab_type = ref[j]; + tab = $("", { + href: "#", + "data-filter": tab_type.filter + }).text(tab_type.title); + if (tab_type.filter === this.tab_active) { + tab.addClass("active"); + } + tab.on("click", this.handleTabClick); + this.tabs.append(tab); + } this.container.on("mousedown touchend touchcancel", (function(_this) { return function(e) { if (e.target !== e.currentTarget) { @@ -194,7 +235,8 @@ Console.prototype.loadConsoleText = function() { this.sidebar.wrapper.ws.cmd("consoleLogRead", { - filter: this.filter + filter: this.filter, + read_size: this.read_size }, (function(_this) { return function(res) { var pos_diff, size_read, size_total; @@ -202,11 +244,17 @@ pos_diff = res["pos_end"] - res["pos_start"]; size_read = Math.round(pos_diff / 1024); size_total = Math.round(res['pos_end'] / 1024); + _this.text.append("

    "); _this.text.append("Displaying " + res.lines.length + " of " + res.num_found + " lines found in the last " + size_read + "kB of the log file. (" + size_total + "kB total)
    "); _this.addLines(res.lines, false); return _this.text_elem.scrollTop = _this.text_elem.scrollHeight; }; })(this)); + if (this.stream_id) { + this.sidebar.wrapper.ws.cmd("consoleLogStreamRemove", { + stream_id: this.stream_id + }); + } return this.sidebar.wrapper.ws.cmd("consoleLogStream", { filter: this.filter }, (function(_this) { @@ -217,15 +265,17 @@ }; Console.prototype.close = function() { + window.top.location.hash = ""; this.sidebar.move_lock = "y"; this.sidebar.startDrag(); return this.sidebar.stopDrag(); }; Console.prototype.open = function() { - this.createHtmltag(); - this.sidebar.fixbutton_targety = this.sidebar.page_height; - return this.stopDragY(); + this.sidebar.startDrag(); + this.sidebar.moved("y"); + this.sidebar.fixbutton_targety = this.sidebar.page_height - this.sidebar.fixbutton_inity - 50; + return this.sidebar.stopDrag(); }; Console.prototype.onOpened = function() { @@ -276,6 +326,26 @@ } }; + Console.prototype.changeFilter = function(filter) { + this.filter = filter; + if (this.filter === "") { + this.read_size = 32 * 1024; + } else { + this.read_size = 5 * 1024 * 1024; + } + return this.loadConsoleText(); + }; + + Console.prototype.handleTabClick = function(e) { + var elem; + elem = $(e.currentTarget); + this.tab_active = elem.data("filter"); + $("a", this.tabs).removeClass("active"); + elem.addClass("active"); + this.changeFilter(this.tab_active); + return false; + }; + return Console; })(Class); @@ -285,7 +355,7 @@ }).call(this); -/* ---- plugins/Sidebar/media/Menu.coffee ---- */ +/* ---- Menu.coffee ---- */ (function() { @@ -368,7 +438,7 @@ }).call(this); -/* ---- plugins/Sidebar/media/RateLimit.coffee ---- */ +/* ---- RateLimit.coffee ---- */ (function() { @@ -397,7 +467,7 @@ }).call(this); -/* ---- plugins/Sidebar/media/Scrollable.js ---- */ +/* ---- Scrollable.js ---- */ /* via http://jsfiddle.net/elGrecode/00dgurnn/ */ @@ -492,7 +562,7 @@ window.initScrollable = function () { return updateHeight; }; -/* ---- plugins/Sidebar/media/Sidebar.coffee ---- */ +/* ---- Sidebar.coffee ---- */ (function() { @@ -534,9 +604,9 @@ window.initScrollable = function () { this.globe = null; this.preload_html = null; this.original_set_site_info = this.wrapper.setSiteInfo; - if (false) { + if (window.top.location.hash === "#ZeroNet:OpenSidebar") { this.startDrag(); - this.moved(); + this.moved("x"); this.fixbutton_targetx = this.fixbutton_initx - this.width; this.stopDrag(); } @@ -744,9 +814,9 @@ window.initScrollable = function () { return false; }; })(this)); - return this.tag.find("#privatekey-forgot").off("click, touchend").on("click touchend", (function(_this) { + return this.tag.find("#privatekey-forget").off("click, touchend").on("click touchend", (function(_this) { return function(e) { - _this.wrapper.displayConfirm("Remove saved private key for this site?", "Forgot", function(res) { + _this.wrapper.displayConfirm("Remove saved private key for this site?", "Forget", function(res) { if (!res) { return false; } @@ -946,6 +1016,18 @@ window.initScrollable = function () { return false; }; })(this)); + this.tag.find("#button-autodownload_previous").off("click touchend").on("click touchend", (function(_this) { + return function() { + _this.wrapper.ws.cmd("siteUpdate", { + "address": _this.wrapper.site_info.address, + "check_files": true + }, function() { + return _this.wrapper.notifications.add("done-download_optional", "done", "Optional files downloaded", 5000); + }); + _this.wrapper.notifications.add("start-download_optional", "info", "Optional files download started", 5000); + return false; + }; + })(this)); this.tag.find("#button-dbreload").off("click touchend").on("click touchend", (function(_this) { return function() { _this.wrapper.ws.cmd("dbReload", [], function() { @@ -1279,7 +1361,7 @@ window.initScrollable = function () { }).call(this); -/* ---- plugins/Sidebar/media/morphdom.js ---- */ +/* ---- morphdom.js ---- */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.morphdom = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o" % (connection_id, peer.reputation, peer.connection_error, time_found, time_added, key) + yield "(#%4s, rep: %2s, err: %s, found: %.1fs min, add: %.1f day) %30s -
    " % (connection_id, peer.reputation, peer.connection_error, time_found, time_added, key) yield "
    " yield "" @@ -479,356 +480,6 @@ class UiRequestPlugin(object): gc.collect() # Implicit grabage collection - @helper.encodeResponse - def actionBenchmark(self): - import sys - import gc - from contextlib import contextmanager - - output = self.sendHeader() - - if "Multiuser" in PluginManager.plugin_manager.plugin_names and not config.multiuser_local: - yield "This function is disabled on this proxy" - return - - @contextmanager - def benchmark(name, standard): - self.log.debug("Benchmark: %s" % name) - s = time.time() - output(b"- %s" % name.encode()) - try: - yield 1 - except Exception as err: - self.log.exception(err) - output(b"
    ! Error: %s
    " % Debug.formatException(err).encode()) - taken = time.time() - s - if taken > 0: - multipler = standard / taken - else: - multipler = 99 - if multipler < 0.3: - speed = "Sloooow" - elif multipler < 0.5: - speed = "Ehh" - elif multipler < 0.8: - speed = "Goodish" - elif multipler < 1.2: - speed = "OK" - elif multipler < 1.7: - speed = "Fine" - elif multipler < 2.5: - speed = "Fast" - elif multipler < 3.5: - speed = "WOW" - else: - speed = "Insane!!" - output(b"%.3fs [x%.2f: %s]
    " % (taken, multipler, speed.encode())) - time.sleep(0.01) - - yield """ - - """ - - yield "Benchmarking ZeroNet %s (rev%s) Python %s on: %s...
    " % (config.version, config.rev, sys.version, sys.platform) - - t = time.time() - - # CryptBitcoin - yield "
    CryptBitcoin:
    " - from Crypt import CryptBitcoin - - # seed = CryptBitcoin.newSeed() - # yield "- Seed: %s
    " % seed - seed = "e180efa477c63b0f2757eac7b1cce781877177fe0966be62754ffd4c8592ce38" - - with benchmark("hdPrivatekey x 10", 0.7): - for i in range(10): - privatekey = CryptBitcoin.hdPrivatekey(seed, i * 10) - yield "." - valid = "5JsunC55XGVqFQj5kPGK4MWgTL26jKbnPhjnmchSNPo75XXCwtk" - assert privatekey == valid, "%s != %s" % (privatekey, valid) - - data = "Hello" * 1024 # 5k - with benchmark("sign x 10", 0.35): - for i in range(10): - yield "." - sign = CryptBitcoin.sign(data, privatekey) - valid = "G1GXaDauZ8vX/N9Jn+MRiGm9h+I94zUhDnNYFaqMGuOiBHB+kp4cRPZOL7l1yqK5BHa6J+W97bMjvTXtxzljp6w=" - assert sign == valid, "%s != %s" % (sign, valid) - - address = CryptBitcoin.privatekeyToAddress(privatekey) - for lib_verify in ["btctools", "openssl", "libsecp256k1"]: - try: - CryptBitcoin.loadLib(lib_verify) - loaded = True - except Exception as err: - yield "- Error loading %s: %s
    " % (lib_verify, err) - loaded = False - if not loaded: - continue - with benchmark("%s verify x 100" % lib_verify, 0.37): - for i in range(100): - if i % 10 == 0: - yield "." - ok = CryptBitcoin.verify(data, address, sign, lib_verify=lib_verify) - assert ok, "does not verify from %s" % address - - # CryptHash - yield "
    CryptHash:
    " - from Crypt import CryptHash - import io - - data = io.BytesIO(b"Hello" * 1024 * 1024) # 5m - with benchmark("sha256 5M x 10", 0.6): - for i in range(10): - data.seek(0) - hash = CryptHash.sha256sum(data) - yield "." - valid = "8cd629d9d6aff6590da8b80782a5046d2673d5917b99d5603c3dcb4005c45ffa" - assert hash == valid, "%s != %s" % (hash, valid) - - data = io.BytesIO(b"Hello" * 1024 * 1024) # 5m - with benchmark("sha512 5M x 10", 0.6): - for i in range(10): - data.seek(0) - hash = CryptHash.sha512sum(data) - yield "." - valid = "9ca7e855d430964d5b55b114e95c6bbb114a6d478f6485df93044d87b108904d" - assert hash == valid, "%s != %s" % (hash, valid) - - with benchmark("os.urandom(256) x 1000", 0.0065): - for i in range(10): - for y in range(100): - data = os.urandom(256) - yield "." - - # Msgpack - from util import Msgpack - yield "
    Msgpack: (version: %s)
    " % ".".join(map(str, Msgpack.msgpack.version)) - binary = b'fqv\xf0\x1a"e\x10,\xbe\x9cT\x9e(\xa5]u\x072C\x8c\x15\xa2\xa8\x93Sw)\x19\x02\xdd\t\xfb\xf67\x88\xd9\xee\x86\xa1\xe4\xb6,\xc6\x14\xbb\xd7$z\x1d\xb2\xda\x85\xf5\xa0\x97^\x01*\xaf\xd3\xb0!\xb7\x9d\xea\x89\xbbh8\xa1"\xa7]e(@\xa2\xa5g\xb7[\xae\x8eE\xc2\x9fL\xb6s\x19\x19\r\xc8\x04S\xd0N\xe4]?/\x01\xea\xf6\xec\xd1\xb3\xc2\x91\x86\xd7\xf4K\xdf\xc2lV\xf4\xe8\x80\xfc\x8ep\xbb\x82\xb3\x86\x98F\x1c\xecS\xc8\x15\xcf\xdc\xf1\xed\xfc\xd8\x18r\xf9\x80\x0f\xfa\x8cO\x97(\x0b]\xf1\xdd\r\xe7\xbf\xed\x06\xbd\x1b?\xc5\xa0\xd7a\x82\xf3\xa8\xe6@\xf3\ri\xa1\xb10\xf6\xd4W\xbc\x86\x1a\xbb\xfd\x94!bS\xdb\xaeM\x92\x00#\x0b\xf7\xad\xe9\xc2\x8e\x86\xbfi![%\xd31]\xc6\xfc2\xc9\xda\xc6v\x82P\xcc\xa9\xea\xb9\xff\xf6\xc8\x17iD\xcf\xf3\xeeI\x04\xe9\xa1\x19\xbb\x01\x92\xf5nn4K\xf8\xbb\xc6\x17e>\xa7 \xbbv' - data = OrderedDict( - sorted({"int": 1024 * 1024 * 1024, "float": 12345.67890, "text": "hello" * 1024, "binary": binary}.items()) - ) - data_packed_valid = b'\x84\xa6binary\xc5\x01\x00fqv\xf0\x1a"e\x10,\xbe\x9cT\x9e(\xa5]u\x072C\x8c\x15\xa2\xa8\x93Sw)\x19\x02\xdd\t\xfb\xf67\x88\xd9\xee\x86\xa1\xe4\xb6,\xc6\x14\xbb\xd7$z\x1d\xb2\xda\x85\xf5\xa0\x97^\x01*\xaf\xd3\xb0!\xb7\x9d\xea\x89\xbbh8\xa1"\xa7]e(@\xa2\xa5g\xb7[\xae\x8eE\xc2\x9fL\xb6s\x19\x19\r\xc8\x04S\xd0N\xe4]?/\x01\xea\xf6\xec\xd1\xb3\xc2\x91\x86\xd7\xf4K\xdf\xc2lV\xf4\xe8\x80\xfc\x8ep\xbb\x82\xb3\x86\x98F\x1c\xecS\xc8\x15\xcf\xdc\xf1\xed\xfc\xd8\x18r\xf9\x80\x0f\xfa\x8cO\x97(\x0b]\xf1\xdd\r\xe7\xbf\xed\x06\xbd\x1b?\xc5\xa0\xd7a\x82\xf3\xa8\xe6@\xf3\ri\xa1\xb10\xf6\xd4W\xbc\x86\x1a\xbb\xfd\x94!bS\xdb\xaeM\x92\x00#\x0b\xf7\xad\xe9\xc2\x8e\x86\xbfi![%\xd31]\xc6\xfc2\xc9\xda\xc6v\x82P\xcc\xa9\xea\xb9\xff\xf6\xc8\x17iD\xcf\xf3\xeeI\x04\xe9\xa1\x19\xbb\x01\x92\xf5nn4K\xf8\xbb\xc6\x17e>\xa7 \xbbv\xa5float\xcb@\xc8\x1c\xd6\xe61\xf8\xa1\xa3int\xce@\x00\x00\x00\xa4text\xda\x14\x00hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello' - with benchmark("pack 5K x 10 000", 0.78): - for i in range(10): - for y in range(1000): - data_packed = Msgpack.pack(data) - yield "." - assert data_packed == data_packed_valid, "%s
    !=
    %s" % (repr(data_packed), repr(data_packed_valid)) - - with benchmark("unpack 5K x 10 000", 1.2): - for i in range(10): - for y in range(1000): - data_unpacked = Msgpack.unpack(data_packed, decode=False) - yield "." - assert data == data_unpacked, "%s != %s" % (data_unpacked, data) - - for fallback in [True, False]: - with benchmark("streaming unpack 5K x 10 000 (fallback: %s)" % fallback, 1.4): - for i in range(10): - unpacker = Msgpack.getUnpacker(decode=False, fallback=fallback) - for y in range(1000): - unpacker.feed(data_packed) - for data_unpacked in unpacker: - pass - yield "." - assert data == data_unpacked, "%s != %s" % (data_unpacked, data) - - # Db - import sqlite3 - yield "
    Db: (version: %s, API: %s)
    " % (sqlite3.sqlite_version, sqlite3.version) - - schema = { - "db_name": "TestDb", - "db_file": "%s/benchmark.db" % config.data_dir, - "maps": { - ".*": { - "to_table": { - "test": "test" - } - } - }, - "tables": { - "test": { - "cols": [ - ["test_id", "INTEGER"], - ["title", "TEXT"], - ["json_id", "INTEGER REFERENCES json (json_id)"] - ], - "indexes": ["CREATE UNIQUE INDEX test_key ON test(test_id, json_id)"], - "schema_changed": 1426195822 - } - } - } - - if os.path.isfile("%s/benchmark.db" % config.data_dir): - os.unlink("%s/benchmark.db" % config.data_dir) - - with benchmark("Open x 10", 0.13): - for i in range(10): - db = Db.Db(schema, "%s/benchmark.db" % config.data_dir) - db.checkTables() - db.close() - yield "." - - db = Db.Db(schema, "%s/benchmark.db" % config.data_dir) - db.checkTables() - import json - - with benchmark("Insert x 10 x 1000", 1.0): - for u in range(10): # 10 user - data = {"test": []} - for i in range(1000): # 1000 line of data - data["test"].append({"test_id": i, "title": "Testdata for %s message %s" % (u, i)}) - json.dump(data, open("%s/test_%s.json" % (config.data_dir, u), "w")) - db.updateJson("%s/test_%s.json" % (config.data_dir, u)) - os.unlink("%s/test_%s.json" % (config.data_dir, u)) - yield "." - - with benchmark("Buffered insert x 100 x 100", 1.3): - cur = db.getCursor() - cur.logging = False - for u in range(100, 200): # 100 user - data = {"test": []} - for i in range(100): # 1000 line of data - data["test"].append({"test_id": i, "title": "Testdata for %s message %s" % (u, i)}) - json.dump(data, open("%s/test_%s.json" % (config.data_dir, u), "w")) - db.updateJson("%s/test_%s.json" % (config.data_dir, u), cur=cur) - os.unlink("%s/test_%s.json" % (config.data_dir, u)) - if u % 10 == 0: - yield "." - - yield " - Total rows in db: %s
    " % db.execute("SELECT COUNT(*) AS num FROM test").fetchone()[0] - - with benchmark("Indexed query x 1000", 0.25): - found = 0 - cur = db.getCursor() - cur.logging = False - for i in range(1000): # 1000x by test_id - res = cur.execute("SELECT * FROM test WHERE test_id = %s" % i) - for row in res: - found += 1 - if i % 100 == 0: - yield "." - - assert found == 20000, "Found: %s != 20000" % found - - with benchmark("Not indexed query x 100", 0.6): - found = 0 - cur = db.getCursor() - cur.logging = False - for i in range(100): # 1000x by test_id - res = cur.execute("SELECT * FROM test WHERE json_id = %s" % i) - for row in res: - found += 1 - if i % 10 == 0: - yield "." - - assert found == 18900, "Found: %s != 18900" % found - - with benchmark("Like query x 100", 1.8): - found = 0 - cur = db.getCursor() - cur.logging = False - for i in range(100): # 1000x by test_id - res = cur.execute("SELECT * FROM test WHERE title LIKE '%%message %s%%'" % i) - for row in res: - found += 1 - if i % 10 == 0: - yield "." - - assert found == 38900, "Found: %s != 11000" % found - - db.close() - if os.path.isfile("%s/benchmark.db" % config.data_dir): - os.unlink("%s/benchmark.db" % config.data_dir) - - gc.collect() # Implicit grabage collection - - # Zip - yield "
    Compression:
    " - import zipfile - test_data = b"Test" * 1024 - file_name = b"\xc3\x81rv\xc3\xadzt\xc5\xb0r\xc5\x91t\xc3\xbck\xc3\xb6r\xc3\xb3g\xc3\xa9p\xe4\xb8\xad\xe5\x8d\x8e%s.txt".decode("utf8") - - with benchmark("Zip pack x 10", 0.12): - for i in range(10): - with zipfile.ZipFile('%s/test.zip' % config.data_dir, 'w') as archive: - for y in range(100): - zip_info = zipfile.ZipInfo(file_name % y, (1980,1,1,0,0,0)) - zip_info.compress_type = zipfile.ZIP_DEFLATED - zip_info.create_system = 3 - zip_info.flag_bits = 0 - zip_info.external_attr = 25165824 - archive.writestr(zip_info, test_data) - yield "." - - hash = CryptHash.sha512sum(open("%s/test.zip" % config.data_dir, "rb")) - valid = "f630fece29fff1cc8dbf454e47a87fea2746a4dbbd2ceec098afebab45301562" - assert hash == valid, "Invalid hash: %s != %s
    " % (hash, valid) - - with benchmark("Zip unpack x 10", 0.2): - for i in range(10): - with zipfile.ZipFile('%s/test.zip' % config.data_dir) as archive: - for y in range(100): - data = archive.open(file_name % y).read() - assert archive.open(file_name % y).read() == test_data, "Invalid data: %s..." % data[0:30] - yield "." - - if os.path.isfile("%s/test.zip" % config.data_dir): - os.unlink("%s/test.zip" % config.data_dir) - - # gz, bz2, xz - import tarfile - import gzip - - # Monkey patch _init_write_gz to use fixed date in order to keep the hash independent from datetime - def nodate_write_gzip_header(self): - self._write_mtime = 0 - original_write_gzip_header(self) - - original_write_gzip_header = gzip.GzipFile._write_gzip_header - gzip.GzipFile._write_gzip_header = nodate_write_gzip_header - - test_data_io = io.BytesIO(b"Test" * 1024) - archive_formats = { - "gz": {"hash": "4704ebd8c987ed6f833059f1de9c475d443b0539b8d4c4cb8b49b26f7bbf2d19", "time_pack": 0.3, "time_unpack": 0.2}, - "bz2": {"hash": "90cba0b4d9abaa37b830bf37e4adba93bfd183e095b489ebee62aaa94339f3b5", "time_pack": 2.0, "time_unpack": 0.5}, - "xz": {"hash": "37abc16d552cfd4a495cb2acbf8b1d5877631d084f6571f4d6544bc548c69bae", "time_pack": 1.4, "time_unpack": 0.2} - } - for ext, format_data in archive_formats.items(): - archive_path = '%s/test.tar.%s' % (config.data_dir, ext) - with benchmark("Tar.%s pack x 10" % ext, format_data["time_pack"]): - for i in range(10): - with tarfile.open(archive_path, 'w:%s' % ext) as archive: - for y in range(100): - test_data_io.seek(0) - tar_info = tarfile.TarInfo(file_name % y) - tar_info.size = 4 * 1024 - archive.addfile(tar_info, test_data_io) - yield "." - - hash = CryptHash.sha512sum(open("%s/test.tar.%s" % (config.data_dir, ext), "rb")) - valid = format_data["hash"] - assert hash == valid, "Invalid hash: %s != %s
    " % (hash, valid) - - archive_size = os.path.getsize(archive_path) / 1024 - with benchmark("Tar.%s unpack (%.2fkB) x 10" % (ext, archive_size), format_data["time_unpack"]): - for i in range(10): - with tarfile.open(archive_path, 'r:%s' % ext) as archive: - for y in range(100): - assert archive.extractfile(file_name % y).read() == test_data - yield "." - - if os.path.isfile(archive_path): - os.unlink(archive_path) - - yield "
    Done. Total: %.2fs" % (time.time() - t) - @helper.encodeResponse def actionGcCollect(self): import gc diff --git a/plugins/Stats/plugin_info.json b/plugins/Stats/plugin_info.json new file mode 100644 index 00000000..1f401a4f --- /dev/null +++ b/plugins/Stats/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "Stats", + "description": "/Stats and /Benchmark pages.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/TranslateSite/TranslateSitePlugin.py b/plugins/TranslateSite/TranslateSitePlugin.py index ccb524ae..d82d0ebe 100644 --- a/plugins/TranslateSite/TranslateSitePlugin.py +++ b/plugins/TranslateSite/TranslateSitePlugin.py @@ -25,6 +25,8 @@ class UiRequestPlugin(object): file_generator = super(UiRequestPlugin, self).actionSiteMedia(path, **kwargs) if "__next__" in dir(file_generator): # File found and generator returned site = self.server.sites.get(path_parts["address"]) + if not site or not site.content_manager.contents.get("content.json"): + return file_generator return self.actionPatchFile(site, path_parts["inner_path"], file_generator) else: return file_generator @@ -44,7 +46,7 @@ class UiRequestPlugin(object): return file_generator def actionPatchFile(self, site, inner_path, file_generator): - content_json = site.content_manager.contents["content.json"] + content_json = site.content_manager.contents.get("content.json") lang_file = "languages/%s.json" % translate.lang lang_file_exist = False if site.settings.get("own"): # My site, check if the file is exist (allow to add new lang without signing) diff --git a/plugins/TranslateSite/plugin_info.json b/plugins/TranslateSite/plugin_info.json new file mode 100644 index 00000000..1d520eda --- /dev/null +++ b/plugins/TranslateSite/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "TranslateSite", + "description": "Transparent support translation of site javascript and html files.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/Trayicon/TrayiconPlugin.py b/plugins/Trayicon/TrayiconPlugin.py index 667a90e5..2dc3a5c6 100644 --- a/plugins/Trayicon/TrayiconPlugin.py +++ b/plugins/Trayicon/TrayiconPlugin.py @@ -8,8 +8,11 @@ from Translate import Translate allow_reload = False # No source reload supported in this plugin + +plugin_dir = os.path.dirname(__file__) + if "_" not in locals(): - _ = Translate("plugins/Trayicon/languages/") + _ = Translate(plugin_dir + "/languages/") @PluginManager.registerTo("Actions") @@ -23,25 +26,20 @@ class ActionsPlugin(object): self.main = main - fs_encoding = sys.getfilesystemencoding() - icon = notificationicon.NotificationIcon( os.path.join(os.path.dirname(os.path.abspath(__file__)), 'trayicon.ico'), "ZeroNet %s" % config.version ) self.icon = icon - if not config.debug: # Hide console if not in debug mode - notificationicon.hideConsole() - self.console = False - else: - self.console = True + self.console = False @atexit.register def hideIcon(): - if not config.debug: - notificationicon.showConsole() - icon.die() + try: + icon.die() + except Exception as err: + print("Error removing trayicon: %s" % err) ui_ip = config.ui_ip if config.ui_ip != "*" else "127.0.0.1" @@ -134,25 +132,30 @@ class ActionsPlugin(object): else: cwd = os.path.dirname(sys.executable) + ignored_args = [ + "--open_browser", "default_browser", + "--dist_type", "bundle_win64" + ] + if sys.platform == 'win32': - args = ['"%s"' % arg for arg in args if arg] + args = ['"%s"' % arg for arg in args if arg and arg not in ignored_args] cmd = " ".join(args) # Dont open browser on autorun - cmd = cmd.replace("start.py", "zeronet.py").replace('"--open_browser"', "").replace('"default_browser"', "").strip() + cmd = cmd.replace("start.py", "zeronet.py").strip() cmd += ' --open_browser ""' - return """ - @echo off - chcp 65001 > nul - set PYTHONIOENCODING=utf-8 - cd /D \"%s\" - start "" %s - """ % (cwd, cmd) + return "\r\n".join([ + '@echo off', + 'chcp 65001 > nul', + 'set PYTHONIOENCODING=utf-8', + 'cd /D \"%s\"' % cwd, + 'start "" %s' % cmd + ]) def isAutorunEnabled(self): path = self.getAutorunPath() - return os.path.isfile(path) and open(path).read() == self.formatAutorun() + return os.path.isfile(path) and open(path, "rb").read().decode("utf8") == self.formatAutorun() def titleAutorun(self): translate = _["Start ZeroNet when Windows starts"] @@ -165,4 +168,4 @@ class ActionsPlugin(object): if self.isAutorunEnabled(): os.unlink(self.getAutorunPath()) else: - open(self.getAutorunPath(), "w").write(self.formatAutorun()) + open(self.getAutorunPath(), "wb").write(self.formatAutorun().encode("utf8")) diff --git a/plugins/Trayicon/languages/pl.json b/plugins/Trayicon/languages/pl.json new file mode 100644 index 00000000..84c14796 --- /dev/null +++ b/plugins/Trayicon/languages/pl.json @@ -0,0 +1,14 @@ +{ + "ZeroNet Twitter": "ZeroNet Twitter", + "ZeroNet Reddit": "ZeroNet Reddit", + "ZeroNet Github": "ZeroNet Github", + "Report bug/request feature": "Zgłoś błąd / propozycję", + "!Open ZeroNet": "!Otwórz ZeroNet", + "Quit": "Zamknij", + "(active)": "(aktywny)", + "(passive)": "(pasywny)", + "Connections: %s": "Połączenia: %s", + "Received: %.2f MB | Sent: %.2f MB": "Odebrano: %.2f MB | Wysłano: %.2f MB", + "Show console window": "Pokaż okno konsoli", + "Start ZeroNet when Windows starts": "Uruchom ZeroNet podczas startu Windows" +} diff --git a/plugins/Trayicon/plugin_info.json b/plugins/Trayicon/plugin_info.json new file mode 100644 index 00000000..d74fa6c1 --- /dev/null +++ b/plugins/Trayicon/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "Trayicon", + "description": "Icon for system tray. (Windows only)", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/UiConfig/UiConfigPlugin.py b/plugins/UiConfig/UiConfigPlugin.py index ae9e6950..81cfe992 100644 --- a/plugins/UiConfig/UiConfigPlugin.py +++ b/plugins/UiConfig/UiConfigPlugin.py @@ -1,18 +1,16 @@ import io +import os from Plugin import PluginManager from Config import config from Translate import Translate +from util.Flag import flag +plugin_dir = os.path.dirname(__file__) + if "_" not in locals(): - _ = Translate("plugins/UiConfig/languages/") - - -@PluginManager.afterLoad -def importPluginnedClasses(): - from Ui import UiWebsocket - UiWebsocket.admin_commands.add("configList") + _ = Translate(plugin_dir + "/languages/") @PluginManager.registerTo("UiRequest") @@ -35,7 +33,7 @@ class UiRequestPlugin(object): def actionUiMedia(self, path, *args, **kwargs): if path.startswith("/uimedia/plugins/uiconfig/"): - file_path = path.replace("/uimedia/plugins/uiconfig/", "plugins/UiConfig/media/") + file_path = path.replace("/uimedia/plugins/uiconfig/", plugin_dir + "/media/") if config.debug and (file_path.endswith("all.js") or file_path.endswith("all.css")): # If debugging merge *.css to all.css and *.js to all.js from Debug import DebugMedia @@ -55,6 +53,7 @@ class UiRequestPlugin(object): @PluginManager.registerTo("UiWebsocket") class UiWebsocketPlugin(object): + @flag.admin def actionConfigList(self, to): back = {} config_values = vars(config.arguments) diff --git a/plugins/UiConfig/languages/pl.json b/plugins/UiConfig/languages/pl.json new file mode 100644 index 00000000..daeba3d8 --- /dev/null +++ b/plugins/UiConfig/languages/pl.json @@ -0,0 +1,62 @@ +{ + "ZeroNet config": "Konfiguracja ZeroNet", + "Web Interface": "Interfejs webowy", + "Open web browser on ZeroNet startup": "Otwórz przeglądarkę podczas uruchomienia ZeroNet", + + "Network": "Sieć", + "Offline mode": "Tryb offline", + "Disable network communication.": "Wyłącz komunikacje sieciową", + "File server network": "Sieć serwera plików", + "Accept incoming peers using IPv4 or IPv6 address. (default: dual)": "Akceptuj połączenia przychodzące używając IPv4 i IPv6. (domyślnie: oba)", + "Dual (IPv4 & IPv6)": "Oba (IPv4 i IPv6)", + "File server port": "Port serwera plików", + "Other peers will use this port to reach your served sites. (default: 15441)": "Inni użytkownicy będą używać tego portu do połączenia się z Tobą. (domyślnie 15441)", + "File server external ip": "Zewnętrzny adres IP serwera plików", + "Detect automatically": "Wykryj automatycznie", + "Your file server is accessible on these ips. (default: detect automatically)": "Twój serwer plików będzie dostępny na tych adresach IP. (domyślnie: wykryj automatycznie)", + + "Disable: Don't connect to peers on Tor network": "Wyłącz: Nie łącz się do użytkowników sieci Tor", + "Enable: Only use Tor for Tor network peers": "Włącz: Łącz się do użytkowników sieci Tor", + "Always: Use Tor for every connections to hide your IP address (slower)": "Zawsze Tor: Użyj Tor dla wszystkich połączeń w celu ukrycia Twojego adresu IP (wolne działanie)", + + "Disable": "Wyłącz", + "Enable": "Włącz", + "Always": "Zawsze Tor", + + "Use Tor bridges": "Użyj Tor bridges", + "Use obfuscated bridge relays to avoid network level Tor block (even slower)": "Użyj obfuskacji, aby uniknąć blokowania Tor na poziomie sieci (jeszcze wolniejsze działanie)", + "Trackers": "Trackery", + "Discover new peers using these adresses": "Wykryj użytkowników korzystając z tych adresów trackerów", + + "Trackers files": "Pliki trackerów", + "Load additional list of torrent trackers dynamically, from a file": "Dynamicznie wczytaj dodatkową listę trackerów z pliku .json", + "Eg.: data/trackers.json": "Np.: data/trackers.json", + + "Proxy for tracker connections": "Serwer proxy dla trackerów", + "Custom": "Własny", + "Custom socks proxy address for trackers": "Adres serwera proxy do łączenia z trackerami", + "Eg.: 127.0.0.1:1080": "Np.: 127.0.0.1:1080", + "Performance": "Wydajność", + "Level of logging to file": "Poziom logowania do pliku", + "Everything": "Wszystko", + "Only important messages": "Tylko ważne wiadomości", + "Only errors": "Tylko błędy", + "Threads for async file system reads": "Wątki asynchroniczne dla odczytu", + "Threads for async file system writes": "Wątki asynchroniczne dla zapisu", + "Threads for cryptographic functions": "Wątki dla funkcji kryptograficznych", + "Threads for database operations": "Wątki dla operacji na bazie danych", + "Sync read": "Synchroniczny odczyt", + "Sync write": "Synchroniczny zapis", + "Sync execution": "Synchroniczne wykonanie", + "1 thread": "1 wątek", + "2 threads": "2 wątki", + "3 threads": "3 wątki", + "4 threads": "4 wątki", + "5 threads": "5 wątków", + "10 threads": "10 wątków", + + " configuration item value changed": " obiekt konfiguracji zmieniony", + "Save settings": "Zapisz ustawienia", + "Some changed settings requires restart": "Niektóre zmiany ustawień wymagają ponownego uruchomienia ZeroNet", + "Restart ZeroNet client": "Uruchom ponownie ZeroNet" +} diff --git a/plugins/UiConfig/languages/pt-br.json b/plugins/UiConfig/languages/pt-br.json index 7595c2f7..6235606e 100644 --- a/plugins/UiConfig/languages/pt-br.json +++ b/plugins/UiConfig/languages/pt-br.json @@ -13,7 +13,7 @@ "Disable": "Desativar", "Enable": "Ativar", - "Sempre": "Mindig", + "Always": "Sempre", "Use Tor bridges": "Usar pontes do Tor", "Use obfuscated bridge relays to avoid network level Tor block (even slower)": "Usar relays de ponte ofuscados para evitar o bloqueio de Tor de nível de rede (ainda mais lento)", @@ -26,8 +26,31 @@ "Proxy for tracker connections": "Proxy para conexões de tracker", - " configuration item value changed": " valor do item de configuração foi alterado", + "configuration item value changed": " valor do item de configuração foi alterado", "Save settings": "Salvar configurações", "Some changed settings requires restart": "Algumas configurações alteradas requrem reinicialização", - "Restart ZeroNet client": "Reiniciar cliente da ZeroNet" + "Restart ZeroNet client": "Reiniciar cliente da ZeroNet", + + "Offline mode": "Modo offline", + "Disable network communication.": "Desativar a comunicação em rede.", + "File server network": "Rede do servidor de arquivos", + "Accept incoming peers using IPv4 or IPv6 address. (default: dual)": "Aceite pontos de entrada usando o endereço IPv4 ou IPv6. (padrão: dual)", + "File server external ip": "IP externo do servidor de arquivos", + "Performance": "Desempenho", + "Level of logging to file": "Nível de registro no arquivo", + "Everything": "Tudo", + "Only important messages": "Apenas mensagens importantes", + "Only errors": "Apenas erros", + + "Threads for async file system reads": "Threads para leituras de sistema de arquivos assíncronas", + "Threads for async file system writes": "Threads para gravações do sistema de arquivos assíncrono", + "Threads for cryptographic functions": "Threads para funções criptográficas", + "Threads for database operations": "Threads para operações de banco de dados", + "Sync execution": "Execução de sincronização", + "Custom": "Personalizado", + "Custom socks proxy address for trackers": "Endereço de proxy de meias personalizadas para trackers", + "Your file server is accessible on these ips. (default: detect automatically)": "Seu servidor de arquivos está acessível nesses ips. (padrão: detectar automaticamente)", + "Detect automatically": "Detectar automaticamente", + " configuration item value changed": " valor do item de configuração alterado" + } diff --git a/plugins/UiConfig/languages/zh.json b/plugins/UiConfig/languages/zh.json index 6d6e9f80..9240b249 100644 --- a/plugins/UiConfig/languages/zh.json +++ b/plugins/UiConfig/languages/zh.json @@ -41,6 +41,19 @@ "Everything": "记录全部", "Only important messages": "仅记录重要信息", "Only errors": "仅记录错误", + "Threads for async file system reads": "文件系统异步读取线程", + "Threads for async file system writes": "文件系统异步写入线程", + "Threads for cryptographic functions": "密码函数线程", + "Threads for database operations": "数据库操作线程", + "Sync read": "同步读取", + "Sync write": "同步写入", + "Sync execution": "同步执行", + "1 thread": "1个线程", + "2 threads": "2个线程", + "3 threads": "3个线程", + "4 threads": "4个线程", + "5 threads": "5个线程", + "10 threads": "10个线程", " configuration item value changed": " 个配置值已经改变", "Save settings": "保存配置", diff --git a/plugins/UiConfig/media/css/Config.css b/plugins/UiConfig/media/css/Config.css index 98291d33..2211758e 100644 --- a/plugins/UiConfig/media/css/Config.css +++ b/plugins/UiConfig/media/css/Config.css @@ -1,8 +1,8 @@ body { background-color: #EDF2F5; font-family: Roboto, 'Segoe UI', Arial, 'Helvetica Neue'; margin: 0px; padding: 0px; backface-visibility: hidden; } h1, h2, h3, h4 { font-family: 'Roboto', Arial, sans-serif; font-weight: 200; font-size: 30px; margin: 0px; padding: 0px } +h1 { background: linear-gradient(33deg,#af3bff,#0d99c9); color: white; padding: 16px 30px; } h2 { margin-top: 10px; } h3 { font-weight: normal } -h1 { background: linear-gradient(33deg,#af3bff,#0d99c9); color: white; padding: 16px 30px; } a { color: #9760F9 } a:hover { text-decoration: none } @@ -53,7 +53,7 @@ a:hover { text-decoration: none } /* Bottom */ .bottom { - width: 100%; text-align: center; background-color: #ffffffde; padding: 25px; bottom: -120px; + width: 100%; text-align: center; background-color: #ffffffde; padding: 25px; bottom: -120px; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); position: fixed; backface-visibility: hidden; box-sizing: border-box; } .bottom-content { max-width: 750px; width: 100%; margin: 0px auto; } @@ -65,4 +65,4 @@ a:hover { text-decoration: none } .animate { transition: all 0.3s ease-out !important; } .animate-back { transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important; } -.animate-inout { transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important; } \ No newline at end of file +.animate-inout { transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important; } diff --git a/plugins/UiConfig/media/css/all.css b/plugins/UiConfig/media/css/all.css index 7bb0087a..2b2991d0 100644 --- a/plugins/UiConfig/media/css/all.css +++ b/plugins/UiConfig/media/css/all.css @@ -1,13 +1,12 @@ - -/* ---- plugins/UiConfig/media/css/Config.css ---- */ +/* ---- Config.css ---- */ body { background-color: #EDF2F5; font-family: Roboto, 'Segoe UI', Arial, 'Helvetica Neue'; margin: 0px; padding: 0px; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -o-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden ; } h1, h2, h3, h4 { font-family: 'Roboto', Arial, sans-serif; font-weight: 200; font-size: 30px; margin: 0px; padding: 0px } +h1 { background: -webkit-linear-gradient(33deg,#af3bff,#0d99c9);background: -moz-linear-gradient(33deg,#af3bff,#0d99c9);background: -o-linear-gradient(33deg,#af3bff,#0d99c9);background: -ms-linear-gradient(33deg,#af3bff,#0d99c9);background: linear-gradient(33deg,#af3bff,#0d99c9); color: white; padding: 16px 30px; } h2 { margin-top: 10px; } h3 { font-weight: normal } -h1 { background: -webkit-linear-gradient(33deg,#af3bff,#0d99c9);background: -moz-linear-gradient(33deg,#af3bff,#0d99c9);background: -o-linear-gradient(33deg,#af3bff,#0d99c9);background: -ms-linear-gradient(33deg,#af3bff,#0d99c9);background: linear-gradient(33deg,#af3bff,#0d99c9); color: white; padding: 16px 30px; } a { color: #9760F9 } a:hover { text-decoration: none } @@ -58,7 +57,7 @@ a:hover { text-decoration: none } /* Bottom */ .bottom { - width: 100%; text-align: center; background-color: #ffffffde; padding: 25px; bottom: -120px; + width: 100%; text-align: center; background-color: #ffffffde; padding: 25px; bottom: -120px; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); -webkit-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); -moz-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); -o-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); -ms-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1) ; position: fixed; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -o-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden ; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; } .bottom-content { max-width: 750px; width: 100%; margin: 0px auto; } @@ -73,7 +72,7 @@ a:hover { text-decoration: none } .animate-inout { -webkit-transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important; -moz-transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important; -o-transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important; -ms-transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important; transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important ; } -/* ---- plugins/UiConfig/media/css/button.css ---- */ +/* ---- button.css ---- */ /* Button */ @@ -90,7 +89,7 @@ a:hover { text-decoration: none } .button.disabled { color: #DDD; background-color: #999; pointer-events: none; border-bottom: 2px solid #666 } -/* ---- plugins/UiConfig/media/css/fonts.css ---- */ +/* ---- fonts.css ---- */ /* Base64 encoder: http://www.motobit.com/util/base64-decoder-encoder.asp */ diff --git a/plugins/UiConfig/media/css/button.css b/plugins/UiConfig/media/css/button.css index 9f46d478..f69021bf 100644 --- a/plugins/UiConfig/media/css/button.css +++ b/plugins/UiConfig/media/css/button.css @@ -9,4 +9,4 @@ color: rgba(0,0,0,0); background: #999 url(../img/loading.gif) no-repeat center center; transition: all 0.5s ease-out ; pointer-events: none; border-bottom: 2px solid #666 } -.button.disabled { color: #DDD; background-color: #999; pointer-events: none; border-bottom: 2px solid #666 } \ No newline at end of file +.button.disabled { color: #DDD; background-color: #999; pointer-events: none; border-bottom: 2px solid #666 } diff --git a/plugins/UiConfig/media/js/ConfigStorage.coffee b/plugins/UiConfig/media/js/ConfigStorage.coffee index 654f0363..9f35a91c 100644 --- a/plugins/UiConfig/media/js/ConfigStorage.coffee +++ b/plugins/UiConfig/media/js/ConfigStorage.coffee @@ -109,7 +109,7 @@ class ConfigStorage extends Class section.items.push title: "Trackers files" key: "trackers_file" - type: "text" + type: "textarea" description: "Load additional list of torrent trackers dynamically, from a file" placeholder: "Eg.: data/trackers.json" value_pos: "fullwidth" @@ -123,6 +123,8 @@ class ConfigStorage extends Class {title: "Tor", value: "tor"} {title: "Disable", value: "disable"} ] + isHidden: -> + Page.values["tor"] == "always" section.items.push title: "Custom socks proxy address for trackers" @@ -147,6 +149,62 @@ class ConfigStorage extends Class {title: "Only errors", value: "ERROR"} ] + section.items.push + key: "threads_fs_read" + title: "Threads for async file system reads" + type: "select" + options: [ + {title: "Sync read", value: 0} + {title: "1 thread", value: 1} + {title: "2 threads", value: 2} + {title: "3 threads", value: 3} + {title: "4 threads", value: 4} + {title: "5 threads", value: 5} + {title: "10 threads", value: 10} + ] + + section.items.push + key: "threads_fs_write" + title: "Threads for async file system writes" + type: "select" + options: [ + {title: "Sync write", value: 0} + {title: "1 thread", value: 1} + {title: "2 threads", value: 2} + {title: "3 threads", value: 3} + {title: "4 threads", value: 4} + {title: "5 threads", value: 5} + {title: "10 threads", value: 10} + ] + + section.items.push + key: "threads_crypt" + title: "Threads for cryptographic functions" + type: "select" + options: [ + {title: "Sync execution", value: 0} + {title: "1 thread", value: 1} + {title: "2 threads", value: 2} + {title: "3 threads", value: 3} + {title: "4 threads", value: 4} + {title: "5 threads", value: 5} + {title: "10 threads", value: 10} + ] + + section.items.push + key: "threads_db" + title: "Threads for database operations" + type: "select" + options: [ + {title: "Sync execution", value: 0} + {title: "1 thread", value: 1} + {title: "2 threads", value: 2} + {title: "3 threads", value: 3} + {title: "4 threads", value: 4} + {title: "5 threads", value: 5} + {title: "10 threads", value: 10} + ] + createSection: (title) => section = {} section.title = title @@ -154,4 +212,4 @@ class ConfigStorage extends Class @items.push(section) return section -window.ConfigStorage = ConfigStorage \ No newline at end of file +window.ConfigStorage = ConfigStorage diff --git a/plugins/UiConfig/media/js/ConfigView.coffee b/plugins/UiConfig/media/js/ConfigView.coffee index a110a17d..64b86e5e 100644 --- a/plugins/UiConfig/media/js/ConfigView.coffee +++ b/plugins/UiConfig/media/js/ConfigView.coffee @@ -118,7 +118,7 @@ class ConfigView extends Class renderValueSelect: (item) => h("select.input-select", {config_key: item.key, oninput: @handleInputChange}, item.options.map (option) => - h("option", {selected: option.value == @values[item.key], value: option.value}, option.title) + h("option", {selected: option.value.toString() == @values[item.key], value: option.value}, option.title) ) window.ConfigView = ConfigView \ No newline at end of file diff --git a/plugins/UiConfig/media/js/all.js b/plugins/UiConfig/media/js/all.js index 99c3a6d8..43a91bc8 100644 --- a/plugins/UiConfig/media/js/all.js +++ b/plugins/UiConfig/media/js/all.js @@ -1,5 +1,5 @@ -/* ---- plugins/UiConfig/media/js/lib/Class.coffee ---- */ +/* ---- lib/Class.coffee ---- */ (function() { @@ -55,8 +55,7 @@ }).call(this); - -/* ---- plugins/UiConfig/media/js/lib/Promise.coffee ---- */ +/* ---- lib/Promise.coffee ---- */ (function() { @@ -159,8 +158,7 @@ }).call(this); - -/* ---- plugins/UiConfig/media/js/lib/Prototypes.coffee ---- */ +/* ---- lib/Prototypes.coffee ---- */ (function() { @@ -186,8 +184,7 @@ }).call(this); - -/* ---- plugins/UiConfig/media/js/lib/maquette.js ---- */ +/* ---- lib/maquette.js ---- */ (function (root, factory) { @@ -962,7 +959,7 @@ })); -/* ---- plugins/UiConfig/media/js/utils/Animation.coffee ---- */ +/* ---- utils/Animation.coffee ---- */ (function() { @@ -1128,8 +1125,7 @@ }).call(this); - -/* ---- plugins/UiConfig/media/js/utils/Dollar.coffee ---- */ +/* ---- utils/Dollar.coffee ---- */ (function() { @@ -1141,8 +1137,7 @@ }).call(this); - -/* ---- plugins/UiConfig/media/js/utils/ZeroFrame.coffee ---- */ +/* ---- utils/ZeroFrame.coffee ---- */ (function() { @@ -1273,8 +1268,7 @@ }).call(this); - -/* ---- plugins/UiConfig/media/js/ConfigStorage.coffee ---- */ +/* ---- ConfigStorage.coffee ---- */ (function() { @@ -1430,7 +1424,7 @@ section.items.push({ title: "Trackers files", key: "trackers_file", - type: "text", + type: "textarea", description: "Load additional list of torrent trackers dynamically, from a file", placeholder: "Eg.: data/trackers.json", value_pos: "fullwidth" @@ -1450,7 +1444,10 @@ title: "Disable", value: "disable" } - ] + ], + isHidden: function() { + return Page.values["tor"] === "always"; + } }); section.items.push({ title: "Custom socks proxy address for trackers", @@ -1467,7 +1464,7 @@ })(this) }); section = this.createSection("Performance"); - return section.items.push({ + section.items.push({ key: "log_level", title: "Level of logging to file", type: "select", @@ -1484,6 +1481,122 @@ } ] }); + section.items.push({ + key: "threads_fs_read", + title: "Threads for async file system reads", + type: "select", + options: [ + { + title: "Sync read", + value: 0 + }, { + title: "1 thread", + value: 1 + }, { + title: "2 threads", + value: 2 + }, { + title: "3 threads", + value: 3 + }, { + title: "4 threads", + value: 4 + }, { + title: "5 threads", + value: 5 + }, { + title: "10 threads", + value: 10 + } + ] + }); + section.items.push({ + key: "threads_fs_write", + title: "Threads for async file system writes", + type: "select", + options: [ + { + title: "Sync write", + value: 0 + }, { + title: "1 thread", + value: 1 + }, { + title: "2 threads", + value: 2 + }, { + title: "3 threads", + value: 3 + }, { + title: "4 threads", + value: 4 + }, { + title: "5 threads", + value: 5 + }, { + title: "10 threads", + value: 10 + } + ] + }); + section.items.push({ + key: "threads_crypt", + title: "Threads for cryptographic functions", + type: "select", + options: [ + { + title: "Sync execution", + value: 0 + }, { + title: "1 thread", + value: 1 + }, { + title: "2 threads", + value: 2 + }, { + title: "3 threads", + value: 3 + }, { + title: "4 threads", + value: 4 + }, { + title: "5 threads", + value: 5 + }, { + title: "10 threads", + value: 10 + } + ] + }); + return section.items.push({ + key: "threads_db", + title: "Threads for database operations", + type: "select", + options: [ + { + title: "Sync execution", + value: 0 + }, { + title: "1 thread", + value: 1 + }, { + title: "2 threads", + value: 2 + }, { + title: "3 threads", + value: 3 + }, { + title: "4 threads", + value: 4 + }, { + title: "5 threads", + value: 5 + }, { + title: "10 threads", + value: 10 + } + ] + }); }; ConfigStorage.prototype.createSection = function(title) { @@ -1504,7 +1617,7 @@ }).call(this); -/* ---- plugins/UiConfig/media/js/ConfigView.coffee ---- */ +/* ---- ConfigView.coffee ---- */ (function() { @@ -1692,7 +1805,7 @@ }, item.options.map((function(_this) { return function(option) { return h("option", { - selected: option.value === _this.values[item.key], + selected: option.value.toString() === _this.values[item.key], value: option.value }, option.title); }; @@ -1707,8 +1820,7 @@ }).call(this); - -/* ---- plugins/UiConfig/media/js/UiConfig.coffee ---- */ +/* ---- UiConfig.coffee ---- */ (function() { @@ -1942,4 +2054,4 @@ window.Page.createProjector(); -}).call(this); +}).call(this); \ No newline at end of file diff --git a/plugins/UiConfig/plugin_info.json b/plugins/UiConfig/plugin_info.json new file mode 100644 index 00000000..01e9dd31 --- /dev/null +++ b/plugins/UiConfig/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "UiConfig", + "description": "Change client settings using the web interface.", + "default": "enabled" +} \ No newline at end of file diff --git a/plugins/UiPluginManager/UiPluginManagerPlugin.py b/plugins/UiPluginManager/UiPluginManagerPlugin.py new file mode 100644 index 00000000..1ab80f53 --- /dev/null +++ b/plugins/UiPluginManager/UiPluginManagerPlugin.py @@ -0,0 +1,221 @@ +import io +import os +import json +import shutil +import time + +from Plugin import PluginManager +from Config import config +from Debug import Debug +from Translate import Translate +from util.Flag import flag + + +plugin_dir = os.path.dirname(__file__) + +if "_" not in locals(): + _ = Translate(plugin_dir + "/languages/") + + +# Convert non-str,int,float values to str in a dict +def restrictDictValues(input_dict): + allowed_types = (int, str, float) + return { + key: val if type(val) in allowed_types else str(val) + for key, val in input_dict.items() + } + + +@PluginManager.registerTo("UiRequest") +class UiRequestPlugin(object): + def actionWrapper(self, path, extra_headers=None): + if path.strip("/") != "Plugins": + return super(UiRequestPlugin, self).actionWrapper(path, extra_headers) + + if not extra_headers: + extra_headers = {} + + script_nonce = self.getScriptNonce() + + self.sendHeader(extra_headers=extra_headers, script_nonce=script_nonce) + site = self.server.site_manager.get(config.homepage) + return iter([super(UiRequestPlugin, self).renderWrapper( + site, path, "uimedia/plugins/plugin_manager/plugin_manager.html", + "Plugin Manager", extra_headers, show_loadingscreen=False, script_nonce=script_nonce + )]) + + def actionUiMedia(self, path, *args, **kwargs): + if path.startswith("/uimedia/plugins/plugin_manager/"): + file_path = path.replace("/uimedia/plugins/plugin_manager/", plugin_dir + "/media/") + if config.debug and (file_path.endswith("all.js") or file_path.endswith("all.css")): + # If debugging merge *.css to all.css and *.js to all.js + from Debug import DebugMedia + DebugMedia.merge(file_path) + + if file_path.endswith("js"): + data = _.translateData(open(file_path).read(), mode="js").encode("utf8") + elif file_path.endswith("html"): + data = _.translateData(open(file_path).read(), mode="html").encode("utf8") + else: + data = open(file_path, "rb").read() + + return self.actionFile(file_path, file_obj=io.BytesIO(data), file_size=len(data)) + else: + return super(UiRequestPlugin, self).actionUiMedia(path) + + +@PluginManager.registerTo("UiWebsocket") +class UiWebsocketPlugin(object): + @flag.admin + def actionPluginList(self, to): + plugins = [] + for plugin in PluginManager.plugin_manager.listPlugins(list_disabled=True): + plugin_info_path = plugin["dir_path"] + "/plugin_info.json" + plugin_info = {} + if os.path.isfile(plugin_info_path): + try: + plugin_info = json.load(open(plugin_info_path)) + except Exception as err: + self.log.error( + "Error loading plugin info for %s: %s" % + (plugin["name"], Debug.formatException(err)) + ) + if plugin_info: + plugin_info = restrictDictValues(plugin_info) # For security reasons don't allow complex values + plugin["info"] = plugin_info + + if plugin["source"] != "builtin": + plugin_site = self.server.sites.get(plugin["source"]) + if plugin_site: + try: + plugin_site_info = plugin_site.storage.loadJson(plugin["inner_path"] + "/plugin_info.json") + plugin_site_info = restrictDictValues(plugin_site_info) + plugin["site_info"] = plugin_site_info + plugin["site_title"] = plugin_site.content_manager.contents["content.json"].get("title") + plugin_key = "%s/%s" % (plugin["source"], plugin["inner_path"]) + plugin["updated"] = plugin_key in PluginManager.plugin_manager.plugins_updated + except Exception: + pass + + plugins.append(plugin) + + return {"plugins": plugins} + + @flag.admin + @flag.no_multiuser + def actionPluginConfigSet(self, to, source, inner_path, key, value): + plugin_manager = PluginManager.plugin_manager + plugins = plugin_manager.listPlugins(list_disabled=True) + plugin = None + for item in plugins: + if item["source"] == source and item["inner_path"] in (inner_path, "disabled-" + inner_path): + plugin = item + break + + if not plugin: + return {"error": "Plugin not found"} + + config_source = plugin_manager.config.setdefault(source, {}) + config_plugin = config_source.setdefault(inner_path, {}) + + if key in config_plugin and value is None: + del config_plugin[key] + else: + config_plugin[key] = value + + plugin_manager.saveConfig() + + return "ok" + + def pluginAction(self, action, address, inner_path): + site = self.server.sites.get(address) + plugin_manager = PluginManager.plugin_manager + + # Install/update path should exists + if action in ("add", "update", "add_request"): + if not site: + raise Exception("Site not found") + + if not site.storage.isDir(inner_path): + raise Exception("Directory not found on the site") + + try: + plugin_info = site.storage.loadJson(inner_path + "/plugin_info.json") + plugin_data = (plugin_info["rev"], plugin_info["description"], plugin_info["name"]) + except Exception as err: + raise Exception("Invalid plugin_info.json: %s" % Debug.formatExceptionMessage(err)) + + source_path = site.storage.getPath(inner_path) + + target_path = plugin_manager.path_installed_plugins + "/" + address + "/" + inner_path + plugin_config = plugin_manager.config.setdefault(site.address, {}).setdefault(inner_path, {}) + + # Make sure plugin (not)installed + if action in ("add", "add_request") and os.path.isdir(target_path): + raise Exception("Plugin already installed") + + if action in ("update", "remove") and not os.path.isdir(target_path): + raise Exception("Plugin not installed") + + # Do actions + if action == "add": + shutil.copytree(source_path, target_path) + + plugin_config["date_added"] = int(time.time()) + plugin_config["rev"] = plugin_info["rev"] + plugin_config["enabled"] = True + + if action == "update": + shutil.rmtree(target_path) + + shutil.copytree(source_path, target_path) + + plugin_config["rev"] = plugin_info["rev"] + plugin_config["date_updated"] = time.time() + + if action == "remove": + del plugin_manager.config[address][inner_path] + shutil.rmtree(target_path) + + def doPluginAdd(self, to, inner_path, res): + if not res: + return None + + self.pluginAction("add", self.site.address, inner_path) + PluginManager.plugin_manager.saveConfig() + + self.cmd( + "confirm", + ["Plugin installed!
    You have to restart the client to load the plugin", "Restart"], + lambda res: self.actionServerShutdown(to, restart=True) + ) + + self.response(to, "ok") + + @flag.no_multiuser + def actionPluginAddRequest(self, to, inner_path): + self.pluginAction("add_request", self.site.address, inner_path) + plugin_info = self.site.storage.loadJson(inner_path + "/plugin_info.json") + warning = "Warning!
    Plugins has the same permissions as the ZeroNet client.
    " + warning += "Do not install it if you don't trust the developer.
    " + + self.cmd( + "confirm", + ["Install new plugin: %s?
    %s" % (plugin_info["name"], warning), "Trust & Install"], + lambda res: self.doPluginAdd(to, inner_path, res) + ) + + @flag.admin + @flag.no_multiuser + def actionPluginRemove(self, to, address, inner_path): + self.pluginAction("remove", address, inner_path) + PluginManager.plugin_manager.saveConfig() + return "ok" + + @flag.admin + @flag.no_multiuser + def actionPluginUpdate(self, to, address, inner_path): + self.pluginAction("update", address, inner_path) + PluginManager.plugin_manager.saveConfig() + PluginManager.plugin_manager.plugins_updated["%s/%s" % (address, inner_path)] = True + return "ok" diff --git a/plugins/UiPluginManager/__init__.py b/plugins/UiPluginManager/__init__.py new file mode 100644 index 00000000..d29ae44b --- /dev/null +++ b/plugins/UiPluginManager/__init__.py @@ -0,0 +1 @@ +from . import UiPluginManagerPlugin diff --git a/plugins/UiPluginManager/media/css/PluginManager.css b/plugins/UiPluginManager/media/css/PluginManager.css new file mode 100644 index 00000000..30f36717 --- /dev/null +++ b/plugins/UiPluginManager/media/css/PluginManager.css @@ -0,0 +1,75 @@ +body { background-color: #EDF2F5; font-family: Roboto, 'Segoe UI', Arial, 'Helvetica Neue'; margin: 0px; padding: 0px; backface-visibility: hidden; } +h1, h2, h3, h4 { font-family: 'Roboto', Arial, sans-serif; font-weight: 200; font-size: 30px; margin: 0px; padding: 0px } +h1 { background: linear-gradient(33deg,#af3bff,#0d99c9); color: white; padding: 16px 30px; } +h2 { margin-top: 10px; } +h3 { font-weight: normal } +h4 { font-size: 19px; font-weight: lighter; margin-right: 100px; margin-top: 30px; } +a { color: #9760F9 } +a:hover { text-decoration: none } + +.link { background-color: transparent; outline: 5px solid transparent; transition: all 0.3s } +.link:active { background-color: #EFEFEF; outline: 5px solid #EFEFEF; transition: none } + +.content { max-width: 800px; margin: auto; background-color: white; padding: 60px 20px; box-sizing: border-box; padding-bottom: 150px; } +.section { margin: 0px 10%; } +.plugins { font-size: 19px; margin-top: 25px; margin-bottom: 75px; } +.plugin { transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); position: relative; padding-bottom: 20px; padding-top: 10px; } +.plugin.hidden { opacity: 0; height: 0px; padding: 0px; } +.plugin .title { display: inline-block; line-height: 36px; } +.plugin .title h3 { font-size: 20px; font-weight: lighter; margin-right: 100px; } +.plugin .title .version { font-size: 70%; margin-left: 5px; } +.plugin .title .version .version-latest { color: #2ecc71; font-weight: normal; } +.plugin .title .version .version-missing { color: #ffa200; font-weight: normal; } +.plugin .title .version .version-update { padding: 0px 15px; margin-left: 5px; line-height: 28px; } +.plugin .description { font-size: 14px; color: #666; line-height: 24px; } +.plugin .description .source { color: #999; font-size: 90%; } +.plugin .description .source a { color: #666; } +.plugin .value { display: inline-block; white-space: nowrap; } +.plugin .value-right { right: 0px; position: absolute; } +.plugin .value-fullwidth { width: 100% } +.plugin .marker { + font-weight: bold; text-decoration: none; font-size: 25px; position: absolute; padding: 2px 15px; line-height: 32px; + opacity: 0; pointer-events: none; transition: all 0.6s; transform: scale(2); color: #9760F9; +} +.plugin .marker.visible { opacity: 1; pointer-events: all; transform: scale(1); } +.plugin .marker.changed { color: #2ecc71; } +.plugin .marker.pending { color: #ffa200; } + + +.input-text, .input-select { padding: 8px 18px; border: 1px solid #CCC; border-radius: 3px; font-size: 17px; box-sizing: border-box; } +.input-text:focus, .input-select:focus { border: 1px solid #3396ff; outline: none; } +.input-textarea { overflow-x: auto; overflow-y: hidden; white-space: pre; line-height: 22px; } + +.input-select { width: initial; font-size: 14px; padding-right: 10px; padding-left: 10px; } + +.value-right .input-text { text-align: right; width: 100px; } +.value-fullwidth .input-text { width: 100%; font-size: 14px; font-family: 'Segoe UI', Arial, 'Helvetica Neue'; } +.value-fullwidth { margin-top: 10px; } + +/* Checkbox */ +.checkbox-skin { background-color: #CCC; width: 50px; height: 24px; border-radius: 15px; transition: all 0.3s ease-in-out; display: inline-block; } +.checkbox-skin:before { + content: ""; position: relative; width: 20px; background-color: white; height: 20px; display: block; border-radius: 100%; margin-top: 2px; margin-left: 2px; + transition: all 0.5s cubic-bezier(0.785, 0.135, 0.15, 0.86); +} +.checkbox { font-size: 14px; font-weight: normal; display: inline-block; cursor: pointer; margin-top: 5px; } +.checkbox .title { display: inline; line-height: 30px; vertical-align: 4px; margin-left: 11px } +.checkbox.checked .checkbox-skin:before { margin-left: 27px; } +.checkbox.checked .checkbox-skin { background-color: #2ECC71 } + +/* Bottom */ + +.bottom { + width: 100%; text-align: center; background-color: #ffffffde; padding: 25px; bottom: -120px; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); + transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); position: fixed; backface-visibility: hidden; box-sizing: border-box; +} +.bottom-content { max-width: 750px; width: 100%; margin: 0px auto; } +.bottom .button { float: right; } +.bottom.visible { bottom: 0px; box-shadow: 0px 0px 35px #dcdcdc; } +.bottom .title { padding: 10px 10px; color: #363636; float: left; text-transform: uppercase; letter-spacing: 1px; } +.bottom .title:before { content: "•"; display: inline-block; color: #2ecc71; font-size: 31px; vertical-align: -7px; margin-right: 8px; line-height: 25px; } +.bottom-restart .title:before { color: #ffa200; } + +.animate { transition: all 0.3s ease-out !important; } +.animate-back { transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important; } +.animate-inout { transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important; } \ No newline at end of file diff --git a/plugins/UiPluginManager/media/css/all.css b/plugins/UiPluginManager/media/css/all.css new file mode 100644 index 00000000..ba72fa0d --- /dev/null +++ b/plugins/UiPluginManager/media/css/all.css @@ -0,0 +1,129 @@ + +/* ---- PluginManager.css ---- */ + + +body { background-color: #EDF2F5; font-family: Roboto, 'Segoe UI', Arial, 'Helvetica Neue'; margin: 0px; padding: 0px; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -o-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden ; } +h1, h2, h3, h4 { font-family: 'Roboto', Arial, sans-serif; font-weight: 200; font-size: 30px; margin: 0px; padding: 0px } +h1 { background: -webkit-linear-gradient(33deg,#af3bff,#0d99c9);background: -moz-linear-gradient(33deg,#af3bff,#0d99c9);background: -o-linear-gradient(33deg,#af3bff,#0d99c9);background: -ms-linear-gradient(33deg,#af3bff,#0d99c9);background: linear-gradient(33deg,#af3bff,#0d99c9); color: white; padding: 16px 30px; } +h2 { margin-top: 10px; } +h3 { font-weight: normal } +h4 { font-size: 19px; font-weight: lighter; margin-right: 100px; margin-top: 30px; } +a { color: #9760F9 } +a:hover { text-decoration: none } + +.link { background-color: transparent; outline: 5px solid transparent; -webkit-transition: all 0.3s ; -moz-transition: all 0.3s ; -o-transition: all 0.3s ; -ms-transition: all 0.3s ; transition: all 0.3s } +.link:active { background-color: #EFEFEF; outline: 5px solid #EFEFEF; -webkit-transition: none ; -moz-transition: none ; -o-transition: none ; -ms-transition: none ; transition: none } + +.content { max-width: 800px; margin: auto; background-color: white; padding: 60px 20px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; padding-bottom: 150px; } +.section { margin: 0px 10%; } +.plugins { font-size: 19px; margin-top: 25px; margin-bottom: 75px; } +.plugin { -webkit-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); -moz-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); -o-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); -ms-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1) ; position: relative; padding-bottom: 20px; padding-top: 10px; } +.plugin.hidden { opacity: 0; height: 0px; padding: 0px; } +.plugin .title { display: inline-block; line-height: 36px; } +.plugin .title h3 { font-size: 20px; font-weight: lighter; margin-right: 100px; } +.plugin .title .version { font-size: 70%; margin-left: 5px; } +.plugin .title .version .version-latest { color: #2ecc71; font-weight: normal; } +.plugin .title .version .version-missing { color: #ffa200; font-weight: normal; } +.plugin .title .version .version-update { padding: 0px 15px; margin-left: 5px; line-height: 28px; } +.plugin .description { font-size: 14px; color: #666; line-height: 24px; } +.plugin .description .source { color: #999; font-size: 90%; } +.plugin .description .source a { color: #666; } +.plugin .value { display: inline-block; white-space: nowrap; } +.plugin .value-right { right: 0px; position: absolute; } +.plugin .value-fullwidth { width: 100% } +.plugin .marker { + font-weight: bold; text-decoration: none; font-size: 25px; position: absolute; padding: 2px 15px; line-height: 32px; + opacity: 0; pointer-events: none; -webkit-transition: all 0.6s; -moz-transition: all 0.6s; -o-transition: all 0.6s; -ms-transition: all 0.6s; transition: all 0.6s ; -webkit-transform: scale(2); -moz-transform: scale(2); -o-transform: scale(2); -ms-transform: scale(2); transform: scale(2) ; color: #9760F9; +} +.plugin .marker.visible { opacity: 1; pointer-events: all; -webkit-transform: scale(1); -moz-transform: scale(1); -o-transform: scale(1); -ms-transform: scale(1); transform: scale(1) ; } +.plugin .marker.changed { color: #2ecc71; } +.plugin .marker.pending { color: #ffa200; } + + +.input-text, .input-select { padding: 8px 18px; border: 1px solid #CCC; -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; -ms-border-radius: 3px; border-radius: 3px ; font-size: 17px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; } +.input-text:focus, .input-select:focus { border: 1px solid #3396ff; outline: none; } +.input-textarea { overflow-x: auto; overflow-y: hidden; white-space: pre; line-height: 22px; } + +.input-select { width: initial; font-size: 14px; padding-right: 10px; padding-left: 10px; } + +.value-right .input-text { text-align: right; width: 100px; } +.value-fullwidth .input-text { width: 100%; font-size: 14px; font-family: 'Segoe UI', Arial, 'Helvetica Neue'; } +.value-fullwidth { margin-top: 10px; } + +/* Checkbox */ +.checkbox-skin { background-color: #CCC; width: 50px; height: 24px; -webkit-border-radius: 15px; -moz-border-radius: 15px; -o-border-radius: 15px; -ms-border-radius: 15px; border-radius: 15px ; -webkit-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; -ms-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out ; display: inline-block; } +.checkbox-skin:before { + content: ""; position: relative; width: 20px; background-color: white; height: 20px; display: block; -webkit-border-radius: 100%; -moz-border-radius: 100%; -o-border-radius: 100%; -ms-border-radius: 100%; border-radius: 100% ; margin-top: 2px; margin-left: 2px; + -webkit-transition: all 0.5s cubic-bezier(0.785, 0.135, 0.15, 0.86); -moz-transition: all 0.5s cubic-bezier(0.785, 0.135, 0.15, 0.86); -o-transition: all 0.5s cubic-bezier(0.785, 0.135, 0.15, 0.86); -ms-transition: all 0.5s cubic-bezier(0.785, 0.135, 0.15, 0.86); transition: all 0.5s cubic-bezier(0.785, 0.135, 0.15, 0.86) ; +} +.checkbox { font-size: 14px; font-weight: normal; display: inline-block; cursor: pointer; margin-top: 5px; } +.checkbox .title { display: inline; line-height: 30px; vertical-align: 4px; margin-left: 11px } +.checkbox.checked .checkbox-skin:before { margin-left: 27px; } +.checkbox.checked .checkbox-skin { background-color: #2ECC71 } + +/* Bottom */ + +.bottom { + width: 100%; text-align: center; background-color: #ffffffde; padding: 25px; bottom: -120px; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); + -webkit-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); -moz-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); -o-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); -ms-transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1); transition: all 0.8s cubic-bezier(0.86, 0, 0.07, 1) ; position: fixed; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -o-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden ; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; +} +.bottom-content { max-width: 750px; width: 100%; margin: 0px auto; } +.bottom .button { float: right; } +.bottom.visible { bottom: 0px; -webkit-box-shadow: 0px 0px 35px #dcdcdc; -moz-box-shadow: 0px 0px 35px #dcdcdc; -o-box-shadow: 0px 0px 35px #dcdcdc; -ms-box-shadow: 0px 0px 35px #dcdcdc; box-shadow: 0px 0px 35px #dcdcdc ; } +.bottom .title { padding: 10px 10px; color: #363636; float: left; text-transform: uppercase; letter-spacing: 1px; } +.bottom .title:before { content: "•"; display: inline-block; color: #2ecc71; font-size: 31px; vertical-align: -7px; margin-right: 8px; line-height: 25px; } +.bottom-restart .title:before { color: #ffa200; } + +.animate { -webkit-transition: all 0.3s ease-out !important; -moz-transition: all 0.3s ease-out !important; -o-transition: all 0.3s ease-out !important; -ms-transition: all 0.3s ease-out !important; transition: all 0.3s ease-out !important ; } +.animate-back { -webkit-transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important; -moz-transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important; -o-transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important; -ms-transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important; transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important ; } +.animate-inout { -webkit-transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important; -moz-transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important; -o-transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important; -ms-transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important; transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1) !important ; } + +/* ---- button.css ---- */ + + +/* Button */ +.button { + background-color: #FFDC00; color: black; padding: 10px 20px; display: inline-block; background-position: left center; + -webkit-border-radius: 2px; -moz-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; border-radius: 2px ; border-bottom: 2px solid #E8BE29; -webkit-transition: all 0.5s ease-out; -moz-transition: all 0.5s ease-out; -o-transition: all 0.5s ease-out; -ms-transition: all 0.5s ease-out; transition: all 0.5s ease-out ; text-decoration: none; +} +.button:hover { border-color: white; border-bottom: 2px solid #BD960C; -webkit-transition: none ; -moz-transition: none ; -o-transition: none ; -ms-transition: none ; transition: none ; background-color: #FDEB07 } +.button:active { position: relative; top: 1px } +.button.loading { + color: rgba(0,0,0,0); background: #999 url(../img/loading.gif) no-repeat center center; + -webkit-transition: all 0.5s ease-out ; -moz-transition: all 0.5s ease-out ; -o-transition: all 0.5s ease-out ; -ms-transition: all 0.5s ease-out ; transition: all 0.5s ease-out ; pointer-events: none; border-bottom: 2px solid #666 +} +.button.disabled { color: #DDD; background-color: #999; pointer-events: none; border-bottom: 2px solid #666 } + +/* ---- fonts.css ---- */ + + +/* Base64 encoder: http://www.motobit.com/util/base64-decoder-encoder.asp */ +/* Generated by Font Squirrel (http://www.fontsquirrel.com) on January 21, 2015 */ + + +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: + local('Roboto'), + url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAGfcABIAAAAAx5wAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABlAAAAEcAAABYB30Hd0dQT1MAAAHcAAAH8AAAFLywggk9R1NVQgAACcwAAACmAAABFMK7zVBPUy8yAAAKdAAAAFYAAABgoKexpmNtYXAAAArMAAADZAAABnjIFMucY3Z0IAAADjAAAABMAAAATCRBBuVmcGdtAAAOfAAAATsAAAG8Z/Rcq2dhc3AAAA+4AAAADAAAAAwACAATZ2x5ZgAAD8QAAE7fAACZfgda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ZhXaHPW+f2f82xRV2tRxyPdxoN90tduvdbnfJvXQBLsmP8Qv9Wr/TH/UX/d0sCRMZsgAAAAABAAABnACPABYAVAAFAAEAAAAAAA4AAAIAAhQABgABeAFdjjN7AwAYhN/a3evuZTAlW2x7im3+/VyM5zPvgCtynHFyfsMJ97DOT3lUtcrP9vrne/kF3zyv80teca3zRxIUidGT7zGWxahQY0KbAkNSVORHNDTp8omRX/4lBok8VtRbZuaDLz9Hf+qMJX0s/ElmS/nVpC8raVpR1WNITdM2DfUqdBlRkf0RwIsdJyHi8j8rFnNKFSE1AAAAeAFjYGYAg/9ZDCkMWAAAKh8B0QB4AdvAo72BQZthEyMfkzbjJn5GILmd38pAVVqAgUObYTujh7WeogiQuZ0pwsNCA8xiDnI2URUDsVjifG20JUEsVjMdJUl+EIutMNbNSBrEYp9YHmOlDGJx1KUHWEqBWJwhrmZq4iAWV1mCt5ksiMXdnOIHUcdzc1NXsg2IxSsiyMvJBmLx2RipywiCHLNJgIsd6FgF19pMCZdNBkKMxZs2iACJABHGkk0NIKJAhLF0E78MUCxfhrEUAOkaMm8AAAA=) format('woff'); +} + +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: bold; + src: + local('Roboto Medium'), + url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAEbcABAAAAAAfQwAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHUE9TAAABbAAABOQAAAv2MtQEeUdTVUIAAAZQAAAAQQAAAFCyIrRQT1MvMgAABpQAAABXAAAAYLorAUBjbWFwAAAG7AAAAI8AAADEj/6wZGN2dCAAAAd8AAAAMAAAADAX3wLxZnBnbQAAB6wAAAE/AAABvC/mTqtnYXNwAAAI7AAAAAwAAAAMAAgAE2dseWYAAAj4AAA2eQAAYlxNsqlBaGVhZAAAP3QAAAA0AAAANve2KKdoaGVhAAA/qAAAAB8AAAAkDRcHFmhtdHgAAD/IAAACPAAAA3CPSUvWbG9jYQAAQgQAAAG6AAABusPVqwRtYXhwAABD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BBGGeRNsK5DYGd8IvM61XFAA=) format('woff'), +} + +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 200; + src: + local('Roboto Light'), + url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAEScABMAAAAAdFQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABqAAAABwAAAAcXzC5yUdERUYAAAHEAAAAHgAAACAAzgAER1BPUwAAAeQAAAVxAAANIkezYOlHU1VCAAAHWAAAACwAAAAwuP+4/k9TLzIAAAeEAAAAVgAAAGC3ouDrY21hcAAAB9wAAAG+AAACioYHy/VjdnQgAAAJnAAAADQAAAA0CnAOGGZwZ20AAAnQAAABsQAAAmVTtC+nZ2FzcAAAC4QAAAAIAAAACAAAABBnbHlmAAALjAAAMaIAAFTUMXgLR2hlYWQAAD0wAAAAMQAAADYBsFYkaGhlYQAAPWQAAAAfAAAAJA7cBhlobXR4AAA9hAAAAeEAAAKEbjk+b2xvY2EAAD9oAAABNgAAAUQwY0cibWF4cAAAQKAAAAAgAAAAIAG+AZluYW1lAABAwAAAAZAAAANoT6qDDHBvc3QAAEJQAAABjAAAAktoPRGfcHJlcAAAQ9wAAAC2AAABI0qzIoZ3ZWJmAABElAAAAAYAAAAGVU1R3QAAAAEAAAAAzD2izwAAAADE8BEuAAAAAM4DBct42mNgZGBg4ANiCQYQYGJgBMIFQMwC5jEAAAsqANMAAHjapZZ5bNRFFMff79dtd7u03UNsORWwKYhWGwFLsRBiGuSKkdIDsBg0kRCVGq6GcpSEFINKghzlMDFBVBITNRpDJEGCBlBBRSEQIQYJyLHd/pA78a99fn6zy3ZbykJxXr7zm3nz5s2b7xy/EUtE/FIiY8SuGDe5SvLeeHlhvfQRD3pRFbc9tWy9/ur8evG5JQOP2Hxt8ds7xLJrjO1AmYxUyiyZLQtlpayRmOWx/FbQGmSVWM9aVdZs6z1rk/WZFbU9dtgutIeCsVivND1dsWSG9JAMKZOeMkrCUi756MI6AN0g3Se1ellm6GlqOXpBx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G8e+hpTcol9JSoCqKIiqI71taCqJCtS3ekIsWARVoUmxrgDaFd2hiTEx0AXVkZ1Q3Edlw0cHEwcEBBv1XlNLfAAnP8slzknNyKGM//56R5Kisg5SJCRNmyrFgxYYdBxVU4qSKamqoxUUdbjzU46WBRprwcYzjnKCZk5yihdOcoZWztHGO81ygnQ4u0sklNHT8dBEgSDcheujlMn1c4SrX6GeAMNe5QYQoMQa5yS1uc4e7DHGPYUYYZYz7PCDOOA+ZYJIpHvGYJ0wzwywJMfOK16zxjlXeSzkrvOUvH/jBHD/5RYrfpMmQY5kCz3nBS7GIVWxiZ4c/7IpDKqRSnFIl1VIjteKSOnGLR+rFyyc2+MIW3/jMJt/5KA1s81UapYk34rOk5gu5tG41FjOapkVKhjVlxDmcNhZTibyxMJ8wlp3ZQy1+qBkHW3Hfv3dQqSv9yi5lQBlUditDyh5lrzJcUld3dd3xNJMy8nPJxFK6NPLHSgZj5qiRzxZLdO+P/+/adfZ42j3OKRLCQBAF0Bkm+0JWE0Ex6LkCksTEUKikiuIGWCwYcHABOEQHReE5BYcJHWjG9fst/n/w/gj8zGpwlk3H+aXtKks1M4jbGvIVHod2ApZaNwyELEGoBRiyvItipL4wEcaUYMnyyUy+ZWQbn9ab4CDsF8FFODeCh3CvBB/hnQgBwq8IISL4V40RofyBQ0TTUkwj7OhEtUMmyHSjGSOTuWY2rI32PdNJPiQZL3TSQq4+STRSagAAAAFR3VVMAAA=) format('woff'); +} \ No newline at end of file diff --git a/plugins/UiPluginManager/media/css/button.css b/plugins/UiPluginManager/media/css/button.css new file mode 100644 index 00000000..9f46d478 --- /dev/null +++ b/plugins/UiPluginManager/media/css/button.css @@ -0,0 +1,12 @@ +/* Button */ +.button { + background-color: #FFDC00; color: black; padding: 10px 20px; display: inline-block; background-position: left center; + border-radius: 2px; border-bottom: 2px solid #E8BE29; transition: all 0.5s ease-out; text-decoration: none; +} +.button:hover { border-color: white; border-bottom: 2px solid #BD960C; transition: none ; background-color: #FDEB07 } +.button:active { position: relative; top: 1px } +.button.loading { + color: rgba(0,0,0,0); background: #999 url(../img/loading.gif) no-repeat center center; + transition: all 0.5s ease-out ; pointer-events: none; border-bottom: 2px solid #666 +} +.button.disabled { color: #DDD; background-color: #999; pointer-events: none; border-bottom: 2px solid #666 } \ No newline at end of file diff --git a/plugins/UiPluginManager/media/css/fonts.css b/plugins/UiPluginManager/media/css/fonts.css new file mode 100644 index 00000000..f5576c5a --- /dev/null +++ b/plugins/UiPluginManager/media/css/fonts.css @@ -0,0 +1,30 @@ +/* Base64 encoder: http://www.motobit.com/util/base64-decoder-encoder.asp */ +/* Generated by Font Squirrel (http://www.fontsquirrel.com) on January 21, 2015 */ + + +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: + local('Roboto'), + url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAGfcABIAAAAAx5wAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABlAAAAEcAAABYB30Hd0dQT1MAAAHcAAAH8AAAFLywggk9R1NVQgAACcwAAACmAAABFMK7zVBPUy8yAAAKdAAAAFYAAABgoKexpmNtYXAAAArMAAADZAAABnjIFMucY3Z0IAAADjAAAABMAAAATCRBBuVmcGdtAAAOfAAAATsAAAG8Z/Rcq2dhc3AAAA+4AAAADAAAAAwACAATZ2x5ZgAAD8QAAE7fAACZfgdaOmpoZG14AABepAAAAJoAAAGo8AnZfGhlYWQAAF9AAAAANgAAADb4RqsOaGhlYQAAX3gAAAAgAAAAJAq6BzxobXR4AABfmAAAA4cAAAZwzpCM0GxvY2EAAGMgAAADKQAAAzowggjbbWF4cAAAZkwAAAAgAAAAIAPMAvluYW1lAABmbAAAAJkAAAEQEG8sqXBvc3QAAGcIAAAAEwAAACD/bQBkcHJlcAAAZxwAAAC9AAAA23Sgj+x4AQXBsQFBMQAFwHvRZg0bgEpnDXukA4AWYBvqv9O/E1RAUQ3NxcJSNM3A2lpsbcXBQZydxdVdPH3Fz1/RZSyZ5Ss9lqE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8B0QB4AdvAo72BQZthEyMfkzbjJn5GILmd38pAVVqAgUObYTujh7WeogiQuZ0pwsNCA8xiDnI2URUDsVjifG20JUEsVjMdJUl+EIutMNbNSBrEYp9YHmOlDGJx1KUHWEqBWJwhrmZq4iAWV1mCt5ksiMXdnOIHUcdzc1NXsg2IxSsiyMvJBmLx2RipywiCHLNJgIsd6FgF19pMCZdNBkKMxZs2iACJABHGkk0NIKJAhLF0E78MUCxfhrEUAOkaMm8AAAA=) format('woff'); +} + +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: bold; + src: + local('Roboto Medium'), + url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAEbcABAAAAAAfQwAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHUE9TAAABbAAABOQAAAv2MtQEeUdTVUIAAAZQAAAAQQAAAFCyIrRQT1MvMgAABpQAAABXAAAAYLorAUBjbWFwAAAG7AAAAI8AAADEj/6wZGN2dCAAAAd8AAAAMAAAADAX3wLxZnBnbQAAB6wAAAE/AAABvC/mTqtnYXNwAAAI7AAAAAwAAAAMAAgAE2dseWYAAAj4AAA2eQAAYlxNsqlBaGVhZAAAP3QAAAA0AAAANve2KKdoaGVhAAA/qAAAAB8AAAAkDRcHFmhtdHgAAD/IAAACPAAAA3CPSUvWbG9jYQAAQgQAAAG6AAABusPVqwRtYXhwAABDwAAAACAAAAAgAwkC3m5hbWUAAEPgAAAAtAAAAU4XNjG1cG9zdAAARJQAAAF3AAACF7VLITZwcmVwAABGDAAAAM8AAAEuQJ9pDngBpJUDrCVbE0ZX9znX1ti2bdu2bU/w89nm1di2bdu2jXjqfWO7V1ajUru2Otk4QCD5qIRbqUqtRoT2aj+oDynwApjhwNN34fbsPKAPobrrDjggvbggAz21cOiHFyjoKeIpwkH3sHvRve4pxWVnojPdve7MdZY7e53zrq+bzL3r5nDzuTXcfm6iJ587Wa5U/lMuekp5hHv9Ge568okijyiFQ0F8CCSITGQhK9nITh7yUkDxQhSmKMUpQSlK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eAFswQOWQgEAAMDZv7Zt27ZtZddTZ+4udYFmBEC5qKCaEjWBQK069Ro0atKsRas27Tp06tKtR68+/QYMGjJsxKgx4yZMmjJtxqw58xYsWrJsxao16zZs2rJtx649+w4cOnLsxKkz5y5cunLtxq079x48evLsxas37z58+vLtx68//0LCIqJi4hKSUtIyshWC4GErEAAAAOAs/3NtI+tluy7Ztm3zZZ6z69yMBuVixBqU50icNMkK1ap48kySXdGy3biVKl+CcYeuFalz786DMo1mTWvy2hsZ3po3Y86yBYuWHHtvzYpVzT64kmnTug0fnTqX6LNPvvjmq+9K/PDLT7/98c9f/wU4EShYkBBhQvUoFSFcpChnLvTZ0qLVtgM72rTr0m1Ch06T4g0ZNvDk+ZMXLo08efk4RnZGDkZOhlQWv1AfH/bSvEwDA0cXEG1kYG7C4lpalM+Rll9apFdcWsBZklGUmgpisZeU54Pp/DwwHwBPQXTqAHgBLc4lXMVQFIDxe5+/Ke4uCXd3KLhLWsWdhvWynugFl7ieRu+dnsb5flD+V44+W03Pqkm96nSsSX3pwfbG8hyVafqKLY53NhRyi8/1/P8l1md6//6SRzsznWXcUiuTXQ3F3NJTfU3V3NRrJp2WrjUzN3sl06/thr54PYV7+IYaQ1++jlly8+AO2iz5W4IT8OEJIqi29NXrGHhwB65DLfxAtSN5HvgQQgRjjiSfQJDDoBz5e4AA3BwJtOVAHgtBBGGeRNsK5DYGd8IvM61XFAA=) format('woff'), +} + +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 200; + src: + local('Roboto Light'), + url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAEScABMAAAAAdFQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABqAAAABwAAAAcXzC5yUdERUYAAAHEAAAAHgAAACAAzgAER1BPUwAAAeQAAAVxAAANIkezYOlHU1VCAAAHWAAAACwAAAAwuP+4/k9TLzIAAAeEAAAAVgAAAGC3ouDrY21hcAAAB9wAAAG+AAACioYHy/VjdnQgAAAJnAA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nFIl1VIjteKSOnGLR+rFyyc2+MIW3/jMJt/5KA1s81UapYk34rOk5gu5tG41FjOapkVKhjVlxDmcNhZTibyxMJ8wlp3ZQy1+qBkHW3Hfv3dQqSv9yi5lQBlUditDyh5lrzJcUld3dd3xNJMy8nPJxFK6NPLHSgZj5qiRzxZLdO+P/+/adfZ42j3OKRLCQBAF0Bkm+0JWE0Ex6LkCksTEUKikiuIGWCwYcHABOEQHReE5BYcJHWjG9fst/n/w/gj8zGpwlk3H+aXtKks1M4jbGvIVHod2ApZaNwyELEGoBRiyvItipL4wEcaUYMnyyUy+ZWQbn9ab4CDsF8FFODeCh3CvBB/hnQgBwq8IISL4V40RofyBQ0TTUkwj7OhEtUMmyHSjGSOTuWY2rI32PdNJPiQZL3TSQq4+STRSagAAAAFR3VVMAAA=) format('woff'); +} \ No newline at end of file diff --git a/plugins/UiPluginManager/media/img/loading.gif b/plugins/UiPluginManager/media/img/loading.gif new file mode 100644 index 00000000..27d0aa81 Binary files /dev/null and b/plugins/UiPluginManager/media/img/loading.gif differ diff --git a/plugins/UiPluginManager/media/js/PluginList.coffee b/plugins/UiPluginManager/media/js/PluginList.coffee new file mode 100644 index 00000000..45e352f0 --- /dev/null +++ b/plugins/UiPluginManager/media/js/PluginList.coffee @@ -0,0 +1,132 @@ +class PluginList extends Class + constructor: (plugins) -> + @plugins = plugins + + savePluginStatus: (plugin, is_enabled) => + Page.cmd "pluginConfigSet", [plugin.source, plugin.inner_path, "enabled", is_enabled], (res) => + if res == "ok" + Page.updatePlugins() + else + Page.cmd "wrapperNotification", ["error", res.error] + + Page.projector.scheduleRender() + + handleCheckboxChange: (e) => + node = e.currentTarget + plugin = node["data-plugin"] + node.classList.toggle("checked") + value = node.classList.contains("checked") + + @savePluginStatus(plugin, value) + + handleResetClick: (e) => + node = e.currentTarget + plugin = node["data-plugin"] + + @savePluginStatus(plugin, null) + + handleUpdateClick: (e) => + node = e.currentTarget + plugin = node["data-plugin"] + node.classList.add("loading") + + Page.cmd "pluginUpdate", [plugin.source, plugin.inner_path], (res) => + if res == "ok" + Page.cmd "wrapperNotification", ["done", "Plugin #{plugin.name} updated to latest version"] + Page.updatePlugins() + else + Page.cmd "wrapperNotification", ["error", res.error] + node.classList.remove("loading") + + return false + + handleDeleteClick: (e) => + node = e.currentTarget + plugin = node["data-plugin"] + if plugin.loaded + Page.cmd "wrapperNotification", ["info", "You can only delete plugin that are not currently active"] + return false + + node.classList.add("loading") + + Page.cmd "wrapperConfirm", ["Delete #{plugin.name} plugin?", "Delete"], (res) => + if not res + node.classList.remove("loading") + return false + + Page.cmd "pluginRemove", [plugin.source, plugin.inner_path], (res) => + if res == "ok" + Page.cmd "wrapperNotification", ["done", "Plugin #{plugin.name} deleted"] + Page.updatePlugins() + else + Page.cmd "wrapperNotification", ["error", res.error] + node.classList.remove("loading") + + return false + + render: -> + h("div.plugins", @plugins.map (plugin) => + if not plugin.info + return + descr = plugin.info.description + plugin.info.default ?= "enabled" + if plugin.info.default + descr += " (default: #{plugin.info.default})" + + tag_version = "" + tag_source = "" + tag_delete = "" + if plugin.source != "builtin" + tag_update = "" + if plugin.site_info?.rev + if plugin.site_info.rev > plugin.info.rev + tag_update = h("a.version-update.button", + {href: "#Update+plugin", onclick: @handleUpdateClick, "data-plugin": plugin}, + "Update to rev#{plugin.site_info.rev}" + ) + + else + tag_update = h("span.version-missing", "(unable to get latest vesion: update site missing)") + + tag_version = h("span.version",[ + "rev#{plugin.info.rev} ", + tag_update, + ]) + + tag_source = h("div.source",[ + "Source: ", + h("a", {"href": "/#{plugin.source}", "target": "_top"}, if plugin.site_title then plugin.site_title else plugin.source), + " /" + plugin.inner_path + ]) + + tag_delete = h("a.delete", {"href": "#Delete+plugin", onclick: @handleDeleteClick, "data-plugin": plugin}, "Delete plugin") + + + enabled_default = plugin.info.default == "enabled" + if plugin.enabled != plugin.loaded or plugin.updated + marker_title = "Change pending" + is_pending = true + else + marker_title = "Changed from default status (click to reset to #{plugin.info.default})" + is_pending = false + + is_changed = plugin.enabled != enabled_default and plugin.owner == "builtin" + + h("div.plugin", {key: plugin.name}, [ + h("div.title", [ + h("h3", [plugin.name, tag_version]), + h("div.description", [descr, tag_source, tag_delete]), + ]) + h("div.value.value-right", + h("div.checkbox", {onclick: @handleCheckboxChange, "data-plugin": plugin, classes: {checked: plugin.enabled}}, h("div.checkbox-skin")) + h("a.marker", { + href: "#Reset", title: marker_title, + onclick: @handleResetClick, "data-plugin": plugin, + classes: {visible: is_pending or is_changed, pending: is_pending} + }, "\u2022") + ) + ]) + ) + + +window.PluginList = PluginList \ No newline at end of file diff --git a/plugins/UiPluginManager/media/js/UiPluginManager.coffee b/plugins/UiPluginManager/media/js/UiPluginManager.coffee new file mode 100644 index 00000000..6a0adee5 --- /dev/null +++ b/plugins/UiPluginManager/media/js/UiPluginManager.coffee @@ -0,0 +1,71 @@ +window.h = maquette.h + +class UiPluginManager extends ZeroFrame + init: -> + @plugin_list_builtin = new PluginList() + @plugin_list_custom = new PluginList() + @plugins_changed = null + @need_restart = null + @ + + onOpenWebsocket: => + @cmd("wrapperSetTitle", "Plugin manager - ZeroNet") + @cmd "serverInfo", {}, (server_info) => + @server_info = server_info + @updatePlugins() + + updatePlugins: (cb) => + @cmd "pluginList", [], (res) => + @plugins_changed = (item for item in res.plugins when item.enabled != item.loaded or item.updated) + + plugins_builtin = (item for item in res.plugins when item.source == "builtin") + @plugin_list_builtin.plugins = plugins_builtin.sort (a, b) -> + return a.name.localeCompare(b.name) + + plugins_custom = (item for item in res.plugins when item.source != "builtin") + @plugin_list_custom.plugins = plugins_custom.sort (a, b) -> + return a.name.localeCompare(b.name) + + @projector.scheduleRender() + cb?() + + createProjector: => + @projector = maquette.createProjector() + @projector.replace($("#content"), @render) + @projector.replace($("#bottom-restart"), @renderBottomRestart) + + render: => + if not @plugin_list_builtin.plugins + return h("div.content") + + h("div.content", [ + h("div.section", [ + if @plugin_list_custom.plugins?.length + [ + h("h2", "Installed third-party plugins"), + @plugin_list_custom.render() + ] + h("h2", "Built-in plugins") + @plugin_list_builtin.render() + ]) + ]) + + handleRestartClick: => + @restart_loading = true + setTimeout ( => + Page.cmd("serverShutdown", {restart: true}) + ), 300 + Page.projector.scheduleRender() + return false + + renderBottomRestart: => + h("div.bottom.bottom-restart", {classes: {visible: @plugins_changed?.length}}, h("div.bottom-content", [ + h("div.title", "Some plugins status has been changed"), + h("a.button.button-submit.button-restart", + {href: "#Restart", classes: {loading: @restart_loading}, onclick: @handleRestartClick}, + "Restart ZeroNet client" + ) + ])) + +window.Page = new UiPluginManager() +window.Page.createProjector() diff --git a/plugins/UiPluginManager/media/js/all.js b/plugins/UiPluginManager/media/js/all.js new file mode 100644 index 00000000..25632862 --- /dev/null +++ b/plugins/UiPluginManager/media/js/all.js @@ -0,0 +1,1606 @@ + +/* ---- lib/Class.coffee ---- */ + + +(function() { + var Class, + slice = [].slice; + + Class = (function() { + function Class() {} + + Class.prototype.trace = true; + + Class.prototype.log = function() { + var args; + args = 1 <= arguments.length ? slice.call(arguments, 0) : []; + if (!this.trace) { + return; + } + if (typeof console === 'undefined') { + return; + } + args.unshift("[" + this.constructor.name + "]"); + console.log.apply(console, args); + return this; + }; + + Class.prototype.logStart = function() { + var args, name; + name = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : []; + if (!this.trace) { + return; + } + this.logtimers || (this.logtimers = {}); + this.logtimers[name] = +(new Date); + if (args.length > 0) { + this.log.apply(this, ["" + name].concat(slice.call(args), ["(started)"])); + } + return this; + }; + + Class.prototype.logEnd = function() { + var args, ms, name; + name = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : []; + ms = +(new Date) - this.logtimers[name]; + this.log.apply(this, ["" + name].concat(slice.call(args), ["(Done in " + ms + "ms)"])); + return this; + }; + + return Class; + + })(); + + window.Class = Class; + +}).call(this); + + +/* ---- lib/Promise.coffee ---- */ + + +(function() { + var Promise, + slice = [].slice; + + Promise = (function() { + Promise.when = function() { + var args, fn, i, len, num_uncompleted, promise, task, task_id, tasks; + tasks = 1 <= arguments.length ? slice.call(arguments, 0) : []; + num_uncompleted = tasks.length; + args = new Array(num_uncompleted); + promise = new Promise(); + fn = function(task_id) { + return task.then(function() { + args[task_id] = Array.prototype.slice.call(arguments); + num_uncompleted--; + if (num_uncompleted === 0) { + return promise.complete.apply(promise, args); + } + }); + }; + for (task_id = i = 0, len = tasks.length; i < len; task_id = ++i) { + task = tasks[task_id]; + fn(task_id); + } + return promise; + }; + + function Promise() { + this.resolved = false; + this.end_promise = null; + this.result = null; + this.callbacks = []; + } + + Promise.prototype.resolve = function() { + var back, callback, i, len, ref; + if (this.resolved) { + return false; + } + this.resolved = true; + this.data = arguments; + if (!arguments.length) { + this.data = [true]; + } + this.result = this.data[0]; + ref = this.callbacks; + for (i = 0, len = ref.length; i < len; i++) { + callback = ref[i]; + back = callback.apply(callback, this.data); + } + if (this.end_promise) { + return this.end_promise.resolve(back); + } + }; + + Promise.prototype.fail = function() { + return this.resolve(false); + }; + + Promise.prototype.then = function(callback) { + if (this.resolved === true) { + callback.apply(callback, this.data); + return; + } + this.callbacks.push(callback); + return this.end_promise = new Promise(); + }; + + return Promise; + + })(); + + window.Promise = Promise; + + + /* + s = Date.now() + log = (text) -> + console.log Date.now()-s, Array.prototype.slice.call(arguments).join(", ") + + log "Started" + + cmd = (query) -> + p = new Promise() + setTimeout ( -> + p.resolve query+" Result" + ), 100 + return p + + back = cmd("SELECT * FROM message").then (res) -> + log res + return "Return from query" + .then (res) -> + log "Back then", res + + log "Query started", back + */ + +}).call(this); + + +/* ---- lib/Prototypes.coffee ---- */ + + +(function() { + String.prototype.startsWith = function(s) { + return this.slice(0, s.length) === s; + }; + + String.prototype.endsWith = function(s) { + return s === '' || this.slice(-s.length) === s; + }; + + String.prototype.repeat = function(count) { + return new Array(count + 1).join(this); + }; + + window.isEmpty = function(obj) { + var key; + for (key in obj) { + return false; + } + return true; + }; + +}).call(this); + + +/* ---- lib/maquette.js ---- */ + + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['exports'], factory); + } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { + // CommonJS + factory(exports); + } else { + // Browser globals + factory(root.maquette = {}); + } +}(this, function (exports) { + 'use strict'; + ; + ; + ; + ; + var NAMESPACE_W3 = 'http://www.w3.org/'; + var NAMESPACE_SVG = NAMESPACE_W3 + '2000/svg'; + var NAMESPACE_XLINK = NAMESPACE_W3 + '1999/xlink'; + // Utilities + var emptyArray = []; + var extend = function (base, overrides) { + var result = {}; + Object.keys(base).forEach(function (key) { + result[key] = base[key]; + }); + if (overrides) { + Object.keys(overrides).forEach(function (key) { + result[key] = overrides[key]; + }); + } + return result; + }; + // Hyperscript helper functions + var same = function (vnode1, vnode2) { + if (vnode1.vnodeSelector !== vnode2.vnodeSelector) { + return false; + } + if (vnode1.properties && vnode2.properties) { + if (vnode1.properties.key !== vnode2.properties.key) { + return false; + } + return vnode1.properties.bind === vnode2.properties.bind; + } + return !vnode1.properties && !vnode2.properties; + }; + var toTextVNode = function (data) { + return { + vnodeSelector: '', + properties: undefined, + children: undefined, + text: data.toString(), + domNode: null + }; + }; + var appendChildren = function (parentSelector, insertions, main) { + for (var i = 0; i < insertions.length; i++) { + var item = insertions[i]; + if (Array.isArray(item)) { + appendChildren(parentSelector, item, main); + } else { + if (item !== null && item !== undefined) { + if (!item.hasOwnProperty('vnodeSelector')) { + item = toTextVNode(item); + } + main.push(item); + } + } + } + }; + // Render helper functions + var missingTransition = function () { + throw new Error('Provide a transitions object to the projectionOptions to do animations'); + }; + var DEFAULT_PROJECTION_OPTIONS = { + namespace: undefined, + eventHandlerInterceptor: undefined, + styleApplyer: function (domNode, styleName, value) { + // Provides a hook to add vendor prefixes for browsers that still need it. + domNode.style[styleName] = value; + }, + transitions: { + enter: missingTransition, + exit: missingTransition + } + }; + var applyDefaultProjectionOptions = function (projectorOptions) { + return extend(DEFAULT_PROJECTION_OPTIONS, projectorOptions); + }; + var checkStyleValue = function (styleValue) { + if (typeof styleValue !== 'string') { + throw new Error('Style values must be strings'); + } + }; + var setProperties = function (domNode, properties, projectionOptions) { + if (!properties) { + return; + } + var eventHandlerInterceptor = projectionOptions.eventHandlerInterceptor; + var propNames = Object.keys(properties); + var propCount = propNames.length; + for (var i = 0; i < propCount; i++) { + var propName = propNames[i]; + /* tslint:disable:no-var-keyword: edge case */ + var propValue = properties[propName]; + /* tslint:enable:no-var-keyword */ + if (propName === 'className') { + throw new Error('Property "className" is not supported, use "class".'); + } else if (propName === 'class') { + if (domNode.className) { + // May happen if classes is specified before class + domNode.className += ' ' + propValue; + } else { + domNode.className = propValue; + } + } else if (propName === 'classes') { + // object with string keys and boolean values + var classNames = Object.keys(propValue); + var classNameCount = classNames.length; + for (var j = 0; j < classNameCount; j++) { + var className = classNames[j]; + if (propValue[className]) { + domNode.classList.add(className); + } + } + } else if (propName === 'styles') { + // object with string keys and string (!) values + var styleNames = Object.keys(propValue); + var styleCount = styleNames.length; + for (var j = 0; j < styleCount; j++) { + var styleName = styleNames[j]; + var styleValue = propValue[styleName]; + if (styleValue) { + checkStyleValue(styleValue); + projectionOptions.styleApplyer(domNode, styleName, styleValue); + } + } + } else if (propName === 'key') { + continue; + } else if (propValue === null || propValue === undefined) { + continue; + } else { + var type = typeof propValue; + if (type === 'function') { + if (propName.lastIndexOf('on', 0) === 0) { + if (eventHandlerInterceptor) { + propValue = eventHandlerInterceptor(propName, propValue, domNode, properties); // intercept eventhandlers + } + if (propName === 'oninput') { + (function () { + // record the evt.target.value, because IE and Edge sometimes do a requestAnimationFrame between changing value and running oninput + var oldPropValue = propValue; + propValue = function (evt) { + evt.target['oninput-value'] = evt.target.value; + // may be HTMLTextAreaElement as well + oldPropValue.apply(this, [evt]); + }; + }()); + } + domNode[propName] = propValue; + } + } else if (type === 'string' && propName !== 'value' && propName !== 'innerHTML') { + if (projectionOptions.namespace === NAMESPACE_SVG && propName === 'href') { + domNode.setAttributeNS(NAMESPACE_XLINK, propName, propValue); + } else { + domNode.setAttribute(propName, propValue); + } + } else { + domNode[propName] = propValue; + } + } + } + }; + var updateProperties = function (domNode, previousProperties, properties, projectionOptions) { + if (!properties) { + return; + } + var propertiesUpdated = false; + var propNames = Object.keys(properties); + var propCount = propNames.length; + for (var i = 0; i < propCount; i++) { + var propName = propNames[i]; + // assuming that properties will be nullified instead of missing is by design + var propValue = properties[propName]; + var previousValue = previousProperties[propName]; + if (propName === 'class') { + if (previousValue !== propValue) { + throw new Error('"class" property may not be updated. Use the "classes" property for conditional css classes.'); + } + } else if (propName === 'classes') { + var classList = domNode.classList; + var classNames = Object.keys(propValue); + var classNameCount = classNames.length; + for (var j = 0; j < classNameCount; j++) { + var className = classNames[j]; + var on = !!propValue[className]; + var previousOn = !!previousValue[className]; + if (on === previousOn) { + continue; + } + propertiesUpdated = true; + if (on) { + classList.add(className); + } else { + classList.remove(className); + } + } + } else if (propName === 'styles') { + var styleNames = Object.keys(propValue); + var styleCount = styleNames.length; + for (var j = 0; j < styleCount; j++) { + var styleName = styleNames[j]; + var newStyleValue = propValue[styleName]; + var oldStyleValue = previousValue[styleName]; + if (newStyleValue === oldStyleValue) { + continue; + } + propertiesUpdated = true; + if (newStyleValue) { + checkStyleValue(newStyleValue); + projectionOptions.styleApplyer(domNode, styleName, newStyleValue); + } else { + projectionOptions.styleApplyer(domNode, styleName, ''); + } + } + } else { + if (!propValue && typeof previousValue === 'string') { + propValue = ''; + } + if (propName === 'value') { + if (domNode[propName] !== propValue && domNode['oninput-value'] !== propValue) { + domNode[propName] = propValue; + // Reset the value, even if the virtual DOM did not change + domNode['oninput-value'] = undefined; + } + // else do not update the domNode, otherwise the cursor position would be changed + if (propValue !== previousValue) { + propertiesUpdated = true; + } + } else if (propValue !== previousValue) { + var type = typeof propValue; + if (type === 'function') { + throw new Error('Functions may not be updated on subsequent renders (property: ' + propName + '). Hint: declare event handler functions outside the render() function.'); + } + if (type === 'string' && propName !== 'innerHTML') { + if (projectionOptions.namespace === NAMESPACE_SVG && propName === 'href') { + domNode.setAttributeNS(NAMESPACE_XLINK, propName, propValue); + } else { + domNode.setAttribute(propName, propValue); + } + } else { + if (domNode[propName] !== propValue) { + domNode[propName] = propValue; + } + } + propertiesUpdated = true; + } + } + } + return propertiesUpdated; + }; + var findIndexOfChild = function (children, sameAs, start) { + if (sameAs.vnodeSelector !== '') { + // Never scan for text-nodes + for (var i = start; i < children.length; i++) { + if (same(children[i], sameAs)) { + return i; + } + } + } + return -1; + }; + var nodeAdded = function (vNode, transitions) { + if (vNode.properties) { + var enterAnimation = vNode.properties.enterAnimation; + if (enterAnimation) { + if (typeof enterAnimation === 'function') { + enterAnimation(vNode.domNode, vNode.properties); + } else { + transitions.enter(vNode.domNode, vNode.properties, enterAnimation); + } + } + } + }; + var nodeToRemove = function (vNode, transitions) { + var domNode = vNode.domNode; + if (vNode.properties) { + var exitAnimation = vNode.properties.exitAnimation; + if (exitAnimation) { + domNode.style.pointerEvents = 'none'; + var removeDomNode = function () { + if (domNode.parentNode) { + domNode.parentNode.removeChild(domNode); + } + }; + if (typeof exitAnimation === 'function') { + exitAnimation(domNode, removeDomNode, vNode.properties); + return; + } else { + transitions.exit(vNode.domNode, vNode.properties, exitAnimation, removeDomNode); + return; + } + } + } + if (domNode.parentNode) { + domNode.parentNode.removeChild(domNode); + } + }; + var checkDistinguishable = function (childNodes, indexToCheck, parentVNode, operation) { + var childNode = childNodes[indexToCheck]; + if (childNode.vnodeSelector === '') { + return; // Text nodes need not be distinguishable + } + var properties = childNode.properties; + var key = properties ? properties.key === undefined ? properties.bind : properties.key : undefined; + if (!key) { + for (var i = 0; i < childNodes.length; i++) { + if (i !== indexToCheck) { + var node = childNodes[i]; + if (same(node, childNode)) { + if (operation === 'added') { + throw new Error(parentVNode.vnodeSelector + ' had a ' + childNode.vnodeSelector + ' child ' + 'added, but there is now more than one. You must add unique key properties to make them distinguishable.'); + } else { + throw new Error(parentVNode.vnodeSelector + ' had a ' + childNode.vnodeSelector + ' child ' + 'removed, but there were more than one. You must add unique key properties to make them distinguishable.'); + } + } + } + } + } + }; + var createDom; + var updateDom; + var updateChildren = function (vnode, domNode, oldChildren, newChildren, projectionOptions) { + if (oldChildren === newChildren) { + return false; + } + oldChildren = oldChildren || emptyArray; + newChildren = newChildren || emptyArray; + var oldChildrenLength = oldChildren.length; + var newChildrenLength = newChildren.length; + var transitions = projectionOptions.transitions; + var oldIndex = 0; + var newIndex = 0; + var i; + var textUpdated = false; + while (newIndex < newChildrenLength) { + var oldChild = oldIndex < oldChildrenLength ? oldChildren[oldIndex] : undefined; + var newChild = newChildren[newIndex]; + if (oldChild !== undefined && same(oldChild, newChild)) { + textUpdated = updateDom(oldChild, newChild, projectionOptions) || textUpdated; + oldIndex++; + } else { + var findOldIndex = findIndexOfChild(oldChildren, newChild, oldIndex + 1); + if (findOldIndex >= 0) { + // Remove preceding missing children + for (i = oldIndex; i < findOldIndex; i++) { + nodeToRemove(oldChildren[i], transitions); + checkDistinguishable(oldChildren, i, vnode, 'removed'); + } + textUpdated = updateDom(oldChildren[findOldIndex], newChild, projectionOptions) || textUpdated; + oldIndex = findOldIndex + 1; + } else { + // New child + createDom(newChild, domNode, oldIndex < oldChildrenLength ? oldChildren[oldIndex].domNode : undefined, projectionOptions); + nodeAdded(newChild, transitions); + checkDistinguishable(newChildren, newIndex, vnode, 'added'); + } + } + newIndex++; + } + if (oldChildrenLength > oldIndex) { + // Remove child fragments + for (i = oldIndex; i < oldChildrenLength; i++) { + nodeToRemove(oldChildren[i], transitions); + checkDistinguishable(oldChildren, i, vnode, 'removed'); + } + } + return textUpdated; + }; + var addChildren = function (domNode, children, projectionOptions) { + if (!children) { + return; + } + for (var i = 0; i < children.length; i++) { + createDom(children[i], domNode, undefined, projectionOptions); + } + }; + var initPropertiesAndChildren = function (domNode, vnode, projectionOptions) { + addChildren(domNode, vnode.children, projectionOptions); + // children before properties, needed for value property of . + if (vnode.text) { + domNode.textContent = vnode.text; + } + setProperties(domNode, vnode.properties, projectionOptions); + if (vnode.properties && vnode.properties.afterCreate) { + vnode.properties.afterCreate(domNode, projectionOptions, vnode.vnodeSelector, vnode.properties, vnode.children); + } + }; + createDom = function (vnode, parentNode, insertBefore, projectionOptions) { + var domNode, i, c, start = 0, type, found; + var vnodeSelector = vnode.vnodeSelector; + if (vnodeSelector === '') { + domNode = vnode.domNode = document.createTextNode(vnode.text); + if (insertBefore !== undefined) { + parentNode.insertBefore(domNode, insertBefore); + } else { + parentNode.appendChild(domNode); + } + } else { + for (i = 0; i <= vnodeSelector.length; ++i) { + c = vnodeSelector.charAt(i); + if (i === vnodeSelector.length || c === '.' || c === '#') { + type = vnodeSelector.charAt(start - 1); + found = vnodeSelector.slice(start, i); + if (type === '.') { + domNode.classList.add(found); + } else if (type === '#') { + domNode.id = found; + } else { + if (found === 'svg') { + projectionOptions = extend(projectionOptions, { namespace: NAMESPACE_SVG }); + } + if (projectionOptions.namespace !== undefined) { + domNode = vnode.domNode = document.createElementNS(projectionOptions.namespace, found); + } else { + domNode = vnode.domNode = document.createElement(found); + } + if (insertBefore !== undefined) { + parentNode.insertBefore(domNode, insertBefore); + } else { + parentNode.appendChild(domNode); + } + } + start = i + 1; + } + } + initPropertiesAndChildren(domNode, vnode, projectionOptions); + } + }; + updateDom = function (previous, vnode, projectionOptions) { + var domNode = previous.domNode; + var textUpdated = false; + if (previous === vnode) { + return false; // By contract, VNode objects may not be modified anymore after passing them to maquette + } + var updated = false; + if (vnode.vnodeSelector === '') { + if (vnode.text !== previous.text) { + var newVNode = document.createTextNode(vnode.text); + domNode.parentNode.replaceChild(newVNode, domNode); + vnode.domNode = newVNode; + textUpdated = true; + return textUpdated; + } + } else { + if (vnode.vnodeSelector.lastIndexOf('svg', 0) === 0) { + projectionOptions = extend(projectionOptions, { namespace: NAMESPACE_SVG }); + } + if (previous.text !== vnode.text) { + updated = true; + if (vnode.text === undefined) { + domNode.removeChild(domNode.firstChild); // the only textnode presumably + } else { + domNode.textContent = vnode.text; + } + } + updated = updateChildren(vnode, domNode, previous.children, vnode.children, projectionOptions) || updated; + updated = updateProperties(domNode, previous.properties, vnode.properties, projectionOptions) || updated; + if (vnode.properties && vnode.properties.afterUpdate) { + vnode.properties.afterUpdate(domNode, projectionOptions, vnode.vnodeSelector, vnode.properties, vnode.children); + } + } + if (updated && vnode.properties && vnode.properties.updateAnimation) { + vnode.properties.updateAnimation(domNode, vnode.properties, previous.properties); + } + vnode.domNode = previous.domNode; + return textUpdated; + }; + var createProjection = function (vnode, projectionOptions) { + return { + update: function (updatedVnode) { + if (vnode.vnodeSelector !== updatedVnode.vnodeSelector) { + throw new Error('The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)'); + } + updateDom(vnode, updatedVnode, projectionOptions); + vnode = updatedVnode; + }, + domNode: vnode.domNode + }; + }; + ; + // The other two parameters are not added here, because the Typescript compiler creates surrogate code for desctructuring 'children'. + exports.h = function (selector) { + var properties = arguments[1]; + if (typeof selector !== 'string') { + throw new Error(); + } + var childIndex = 1; + if (properties && !properties.hasOwnProperty('vnodeSelector') && !Array.isArray(properties) && typeof properties === 'object') { + childIndex = 2; + } else { + // Optional properties argument was omitted + properties = undefined; + } + var text = undefined; + var children = undefined; + var argsLength = arguments.length; + // Recognize a common special case where there is only a single text node + if (argsLength === childIndex + 1) { + var onlyChild = arguments[childIndex]; + if (typeof onlyChild === 'string') { + text = onlyChild; + } else if (onlyChild !== undefined && onlyChild.length === 1 && typeof onlyChild[0] === 'string') { + text = onlyChild[0]; + } + } + if (text === undefined) { + children = []; + for (; childIndex < arguments.length; childIndex++) { + var child = arguments[childIndex]; + if (child === null || child === undefined) { + continue; + } else if (Array.isArray(child)) { + appendChildren(selector, child, children); + } else if (child.hasOwnProperty('vnodeSelector')) { + children.push(child); + } else { + children.push(toTextVNode(child)); + } + } + } + return { + vnodeSelector: selector, + properties: properties, + children: children, + text: text === '' ? undefined : text, + domNode: null + }; + }; + /** + * Contains simple low-level utility functions to manipulate the real DOM. + */ + exports.dom = { + /** + * Creates a real DOM tree from `vnode`. The [[Projection]] object returned will contain the resulting DOM Node in + * its [[Projection.domNode|domNode]] property. + * This is a low-level method. Users wil typically use a [[Projector]] instead. + * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. NOTE: [[VNode]] + * objects may only be rendered once. + * @param projectionOptions - Options to be used to create and update the projection. + * @returns The [[Projection]] which also contains the DOM Node that was created. + */ + create: function (vnode, projectionOptions) { + projectionOptions = applyDefaultProjectionOptions(projectionOptions); + createDom(vnode, document.createElement('div'), undefined, projectionOptions); + return createProjection(vnode, projectionOptions); + }, + /** + * Appends a new childnode to the DOM which is generated from a [[VNode]]. + * This is a low-level method. Users wil typically use a [[Projector]] instead. + * @param parentNode - The parent node for the new childNode. + * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. NOTE: [[VNode]] + * objects may only be rendered once. + * @param projectionOptions - Options to be used to create and update the [[Projection]]. + * @returns The [[Projection]] that was created. + */ + append: function (parentNode, vnode, projectionOptions) { + projectionOptions = applyDefaultProjectionOptions(projectionOptions); + createDom(vnode, parentNode, undefined, projectionOptions); + return createProjection(vnode, projectionOptions); + }, + /** + * Inserts a new DOM node which is generated from a [[VNode]]. + * This is a low-level method. Users wil typically use a [[Projector]] instead. + * @param beforeNode - The node that the DOM Node is inserted before. + * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. + * NOTE: [[VNode]] objects may only be rendered once. + * @param projectionOptions - Options to be used to create and update the projection, see [[createProjector]]. + * @returns The [[Projection]] that was created. + */ + insertBefore: function (beforeNode, vnode, projectionOptions) { + projectionOptions = applyDefaultProjectionOptions(projectionOptions); + createDom(vnode, beforeNode.parentNode, beforeNode, projectionOptions); + return createProjection(vnode, projectionOptions); + }, + /** + * Merges a new DOM node which is generated from a [[VNode]] with an existing DOM Node. + * This means that the virtual DOM and the real DOM will have one overlapping element. + * Therefore the selector for the root [[VNode]] will be ignored, but its properties and children will be applied to the Element provided. + * This is a low-level method. Users wil typically use a [[Projector]] instead. + * @param domNode - The existing element to adopt as the root of the new virtual DOM. Existing attributes and childnodes are preserved. + * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. NOTE: [[VNode]] objects + * may only be rendered once. + * @param projectionOptions - Options to be used to create and update the projection, see [[createProjector]]. + * @returns The [[Projection]] that was created. + */ + merge: function (element, vnode, projectionOptions) { + projectionOptions = applyDefaultProjectionOptions(projectionOptions); + vnode.domNode = element; + initPropertiesAndChildren(element, vnode, projectionOptions); + return createProjection(vnode, projectionOptions); + } + }; + /** + * Creates a [[CalculationCache]] object, useful for caching [[VNode]] trees. + * In practice, caching of [[VNode]] trees is not needed, because achieving 60 frames per second is almost never a problem. + * For more information, see [[CalculationCache]]. + * + * @param The type of the value that is cached. + */ + exports.createCache = function () { + var cachedInputs = undefined; + var cachedOutcome = undefined; + var result = { + invalidate: function () { + cachedOutcome = undefined; + cachedInputs = undefined; + }, + result: function (inputs, calculation) { + if (cachedInputs) { + for (var i = 0; i < inputs.length; i++) { + if (cachedInputs[i] !== inputs[i]) { + cachedOutcome = undefined; + } + } + } + if (!cachedOutcome) { + cachedOutcome = calculation(); + cachedInputs = inputs; + } + return cachedOutcome; + } + }; + return result; + }; + /** + * Creates a {@link Mapping} instance that keeps an array of result objects synchronized with an array of source objects. + * See {@link http://maquettejs.org/docs/arrays.html|Working with arrays}. + * + * @param The type of source items. A database-record for instance. + * @param The type of target items. A [[Component]] for instance. + * @param getSourceKey `function(source)` that must return a key to identify each source object. The result must either be a string or a number. + * @param createResult `function(source, index)` that must create a new result object from a given source. This function is identical + * to the `callback` argument in `Array.map(callback)`. + * @param updateResult `function(source, target, index)` that updates a result to an updated source. + */ + exports.createMapping = function (getSourceKey, createResult, updateResult) { + var keys = []; + var results = []; + return { + results: results, + map: function (newSources) { + var newKeys = newSources.map(getSourceKey); + var oldTargets = results.slice(); + var oldIndex = 0; + for (var i = 0; i < newSources.length; i++) { + var source = newSources[i]; + var sourceKey = newKeys[i]; + if (sourceKey === keys[oldIndex]) { + results[i] = oldTargets[oldIndex]; + updateResult(source, oldTargets[oldIndex], i); + oldIndex++; + } else { + var found = false; + for (var j = 1; j < keys.length; j++) { + var searchIndex = (oldIndex + j) % keys.length; + if (keys[searchIndex] === sourceKey) { + results[i] = oldTargets[searchIndex]; + updateResult(newSources[i], oldTargets[searchIndex], i); + oldIndex = searchIndex + 1; + found = true; + break; + } + } + if (!found) { + results[i] = createResult(source, i); + } + } + } + results.length = newSources.length; + keys = newKeys; + } + }; + }; + /** + * Creates a [[Projector]] instance using the provided projectionOptions. + * + * For more information, see [[Projector]]. + * + * @param projectionOptions Options that influence how the DOM is rendered and updated. + */ + exports.createProjector = function (projectorOptions) { + var projector; + var projectionOptions = applyDefaultProjectionOptions(projectorOptions); + projectionOptions.eventHandlerInterceptor = function (propertyName, eventHandler, domNode, properties) { + return function () { + // intercept function calls (event handlers) to do a render afterwards. + projector.scheduleRender(); + return eventHandler.apply(properties.bind || this, arguments); + }; + }; + var renderCompleted = true; + var scheduled; + var stopped = false; + var projections = []; + var renderFunctions = []; + // matches the projections array + var doRender = function () { + scheduled = undefined; + if (!renderCompleted) { + return; // The last render threw an error, it should be logged in the browser console. + } + renderCompleted = false; + for (var i = 0; i < projections.length; i++) { + var updatedVnode = renderFunctions[i](); + projections[i].update(updatedVnode); + } + renderCompleted = true; + }; + projector = { + scheduleRender: function () { + if (!scheduled && !stopped) { + scheduled = requestAnimationFrame(doRender); + } + }, + stop: function () { + if (scheduled) { + cancelAnimationFrame(scheduled); + scheduled = undefined; + } + stopped = true; + }, + resume: function () { + stopped = false; + renderCompleted = true; + projector.scheduleRender(); + }, + append: function (parentNode, renderMaquetteFunction) { + projections.push(exports.dom.append(parentNode, renderMaquetteFunction(), projectionOptions)); + renderFunctions.push(renderMaquetteFunction); + }, + insertBefore: function (beforeNode, renderMaquetteFunction) { + projections.push(exports.dom.insertBefore(beforeNode, renderMaquetteFunction(), projectionOptions)); + renderFunctions.push(renderMaquetteFunction); + }, + merge: function (domNode, renderMaquetteFunction) { + projections.push(exports.dom.merge(domNode, renderMaquetteFunction(), projectionOptions)); + renderFunctions.push(renderMaquetteFunction); + }, + replace: function (domNode, renderMaquetteFunction) { + var vnode = renderMaquetteFunction(); + createDom(vnode, domNode.parentNode, domNode, projectionOptions); + domNode.parentNode.removeChild(domNode); + projections.push(createProjection(vnode, projectionOptions)); + renderFunctions.push(renderMaquetteFunction); + }, + detach: function (renderMaquetteFunction) { + for (var i = 0; i < renderFunctions.length; i++) { + if (renderFunctions[i] === renderMaquetteFunction) { + renderFunctions.splice(i, 1); + return projections.splice(i, 1)[0]; + } + } + throw new Error('renderMaquetteFunction was not found'); + } + }; + return projector; + }; +})); diff --git a/plugins/UiPluginManager/media/js/utils/Animation.coffee b/plugins/UiPluginManager/media/js/utils/Animation.coffee new file mode 100644 index 00000000..271b88c1 --- /dev/null +++ b/plugins/UiPluginManager/media/js/utils/Animation.coffee @@ -0,0 +1,138 @@ +class Animation + slideDown: (elem, props) -> + if elem.offsetTop > 2000 + return + + h = elem.offsetHeight + cstyle = window.getComputedStyle(elem) + margin_top = cstyle.marginTop + margin_bottom = cstyle.marginBottom + padding_top = cstyle.paddingTop + padding_bottom = cstyle.paddingBottom + transition = cstyle.transition + + elem.style.boxSizing = "border-box" + elem.style.overflow = "hidden" + elem.style.transform = "scale(0.6)" + elem.style.opacity = "0" + elem.style.height = "0px" + elem.style.marginTop = "0px" + elem.style.marginBottom = "0px" + elem.style.paddingTop = "0px" + elem.style.paddingBottom = "0px" + elem.style.transition = "none" + + setTimeout (-> + elem.className += " animate-inout" + elem.style.height = h+"px" + elem.style.transform = "scale(1)" + elem.style.opacity = "1" + elem.style.marginTop = margin_top + elem.style.marginBottom = margin_bottom + elem.style.paddingTop = padding_top + elem.style.paddingBottom = padding_bottom + ), 1 + + elem.addEventListener "transitionend", -> + elem.classList.remove("animate-inout") + elem.style.transition = elem.style.transform = elem.style.opacity = elem.style.height = null + elem.style.boxSizing = elem.style.marginTop = elem.style.marginBottom = null + elem.style.paddingTop = elem.style.paddingBottom = elem.style.overflow = null + elem.removeEventListener "transitionend", arguments.callee, false + + + slideUp: (elem, remove_func, props) -> + if elem.offsetTop > 1000 + return remove_func() + + elem.className += " animate-back" + elem.style.boxSizing = "border-box" + elem.style.height = elem.offsetHeight+"px" + elem.style.overflow = "hidden" + elem.style.transform = "scale(1)" + elem.style.opacity = "1" + elem.style.pointerEvents = "none" + setTimeout (-> + elem.style.height = "0px" + elem.style.marginTop = "0px" + elem.style.marginBottom = "0px" + elem.style.paddingTop = "0px" + elem.style.paddingBottom = "0px" + elem.style.transform = "scale(0.8)" + elem.style.borderTopWidth = "0px" + elem.style.borderBottomWidth = "0px" + elem.style.opacity = "0" + ), 1 + elem.addEventListener "transitionend", (e) -> + if e.propertyName == "opacity" or e.elapsedTime >= 0.6 + elem.removeEventListener "transitionend", arguments.callee, false + remove_func() + + + slideUpInout: (elem, remove_func, props) -> + elem.className += " animate-inout" + elem.style.boxSizing = "border-box" + elem.style.height = elem.offsetHeight+"px" + elem.style.overflow = "hidden" + elem.style.transform = "scale(1)" + elem.style.opacity = "1" + elem.style.pointerEvents = "none" + setTimeout (-> + elem.style.height = "0px" + elem.style.marginTop = "0px" + elem.style.marginBottom = "0px" + elem.style.paddingTop = "0px" + elem.style.paddingBottom = "0px" + elem.style.transform = "scale(0.8)" + elem.style.borderTopWidth = "0px" + elem.style.borderBottomWidth = "0px" + elem.style.opacity = "0" + ), 1 + elem.addEventListener "transitionend", (e) -> + if e.propertyName == "opacity" or e.elapsedTime >= 0.6 + elem.removeEventListener "transitionend", arguments.callee, false + remove_func() + + + showRight: (elem, props) -> + elem.className += " animate" + elem.style.opacity = 0 + elem.style.transform = "TranslateX(-20px) Scale(1.01)" + setTimeout (-> + elem.style.opacity = 1 + elem.style.transform = "TranslateX(0px) Scale(1)" + ), 1 + elem.addEventListener "transitionend", -> + elem.classList.remove("animate") + elem.style.transform = elem.style.opacity = null + + + show: (elem, props) -> + delay = arguments[arguments.length-2]?.delay*1000 or 1 + elem.style.opacity = 0 + setTimeout (-> + elem.className += " animate" + ), 1 + setTimeout (-> + elem.style.opacity = 1 + ), delay + elem.addEventListener "transitionend", -> + elem.classList.remove("animate") + elem.style.opacity = null + elem.removeEventListener "transitionend", arguments.callee, false + + hide: (elem, remove_func, props) -> + delay = arguments[arguments.length-2]?.delay*1000 or 1 + elem.className += " animate" + setTimeout (-> + elem.style.opacity = 0 + ), delay + elem.addEventListener "transitionend", (e) -> + if e.propertyName == "opacity" + remove_func() + + addVisibleClass: (elem, props) -> + setTimeout -> + elem.classList.add("visible") + +window.Animation = new Animation() \ No newline at end of file diff --git a/plugins/UiPluginManager/media/js/utils/Dollar.coffee b/plugins/UiPluginManager/media/js/utils/Dollar.coffee new file mode 100644 index 00000000..7f19f551 --- /dev/null +++ b/plugins/UiPluginManager/media/js/utils/Dollar.coffee @@ -0,0 +1,3 @@ +window.$ = (selector) -> + if selector.startsWith("#") + return document.getElementById(selector.replace("#", "")) diff --git a/plugins/UiPluginManager/media/js/utils/ZeroFrame.coffee b/plugins/UiPluginManager/media/js/utils/ZeroFrame.coffee new file mode 100644 index 00000000..11512d16 --- /dev/null +++ b/plugins/UiPluginManager/media/js/utils/ZeroFrame.coffee @@ -0,0 +1,85 @@ +class ZeroFrame extends Class + constructor: (url) -> + @url = url + @waiting_cb = {} + @wrapper_nonce = document.location.href.replace(/.*wrapper_nonce=([A-Za-z0-9]+).*/, "$1") + @connect() + @next_message_id = 1 + @history_state = {} + @init() + + + init: -> + @ + + + connect: -> + @target = window.parent + window.addEventListener("message", @onMessage, false) + @cmd("innerReady") + + # Save scrollTop + window.addEventListener "beforeunload", (e) => + @log "save scrollTop", window.pageYOffset + @history_state["scrollTop"] = window.pageYOffset + @cmd "wrapperReplaceState", [@history_state, null] + + # Restore scrollTop + @cmd "wrapperGetState", [], (state) => + @history_state = state if state? + @log "restore scrollTop", state, window.pageYOffset + if window.pageYOffset == 0 and state + window.scroll(window.pageXOffset, state.scrollTop) + + + onMessage: (e) => + message = e.data + cmd = message.cmd + if cmd == "response" + if @waiting_cb[message.to]? + @waiting_cb[message.to](message.result) + else + @log "Websocket callback not found:", message + else if cmd == "wrapperReady" # Wrapper inited later + @cmd("innerReady") + else if cmd == "ping" + @response message.id, "pong" + else if cmd == "wrapperOpenedWebsocket" + @onOpenWebsocket() + else if cmd == "wrapperClosedWebsocket" + @onCloseWebsocket() + else + @onRequest cmd, message.params + + + onRequest: (cmd, message) => + @log "Unknown request", message + + + response: (to, result) -> + @send {"cmd": "response", "to": to, "result": result} + + + cmd: (cmd, params={}, cb=null) -> + @send {"cmd": cmd, "params": params}, cb + + + send: (message, cb=null) -> + message.wrapper_nonce = @wrapper_nonce + message.id = @next_message_id + @next_message_id += 1 + @target.postMessage(message, "*") + if cb + @waiting_cb[message.id] = cb + + + onOpenWebsocket: => + @log "Websocket open" + + + onCloseWebsocket: => + @log "Websocket close" + + + +window.ZeroFrame = ZeroFrame diff --git a/plugins/UiPluginManager/media/plugin_manager.html b/plugins/UiPluginManager/media/plugin_manager.html new file mode 100644 index 00000000..321cbbb3 --- /dev/null +++ b/plugins/UiPluginManager/media/plugin_manager.html @@ -0,0 +1,19 @@ + + + + + Settings - ZeroNet + + + + + + +

    ZeroNet plugin manager

    + +
    +
    + + + + \ No newline at end of file diff --git a/plugins/Zeroname/README.md b/plugins/Zeroname/README.md index 8a306789..baa43db5 100644 --- a/plugins/Zeroname/README.md +++ b/plugins/Zeroname/README.md @@ -22,6 +22,7 @@ rpcpassword=your-password rpcport=8336 server=1 txindex=1 +valueencoding=utf8 ``` Don't forget to change the `rpcuser` value and `rpcpassword` value! diff --git a/plugins/Zeroname/SiteManagerPlugin.py b/plugins/Zeroname/SiteManagerPlugin.py index 40088f12..2553a50c 100644 --- a/plugins/Zeroname/SiteManagerPlugin.py +++ b/plugins/Zeroname/SiteManagerPlugin.py @@ -13,7 +13,7 @@ log = logging.getLogger("ZeronamePlugin") @PluginManager.registerTo("SiteManager") class SiteManagerPlugin(object): site_zeroname = None - db_domains = None + db_domains = {} db_domains_modified = None def load(self, *args, **kwargs): @@ -21,21 +21,13 @@ class SiteManagerPlugin(object): if not self.get(config.bit_resolver): self.need(config.bit_resolver) # Need ZeroName site - # Checks if it's a valid address - def isAddress(self, address): - return self.isBitDomain(address) or super(SiteManagerPlugin, self).isAddress(address) - - # Return: True if the address is domain - def isDomain(self, address): - return self.isBitDomain(address) or super(SiteManagerPlugin, self).isDomain(address) - # Return: True if the address is .bit domain def isBitDomain(self, address): return re.match(r"(.*?)([A-Za-z0-9_-]+\.bit)$", address) # Resolve domain # Return: The address or None - def resolveDomain(self, domain): + def resolveBitDomain(self, domain): domain = domain.lower() if not self.site_zeroname: self.site_zeroname = self.need(config.bit_resolver) @@ -44,7 +36,11 @@ class SiteManagerPlugin(object): if not self.db_domains or self.db_domains_modified != site_zeroname_modified: self.site_zeroname.needFile("data/names.json", priority=10) s = time.time() - self.db_domains = self.site_zeroname.storage.loadJson("data/names.json") + try: + self.db_domains = self.site_zeroname.storage.loadJson("data/names.json") + except Exception as err: + log.error("Error loading names.json: %s" % err) + log.debug( "Domain db with %s entries loaded in %.3fs (modification: %s -> %s)" % (len(self.db_domains), time.time() - s, self.db_domains_modified, site_zeroname_modified) @@ -52,33 +48,22 @@ class SiteManagerPlugin(object): self.db_domains_modified = site_zeroname_modified return self.db_domains.get(domain) - # Return or create site and start download site files - # Return: Site or None if dns resolve failed - def need(self, address, *args, **kwargs): - if self.isBitDomain(address): # Its looks like a domain - address_resolved = self.resolveDomain(address) - if address_resolved: - address = address_resolved - else: - return None + # Turn domain into address + def resolveDomain(self, domain): + return self.resolveBitDomain(domain) or super(SiteManagerPlugin, self).resolveDomain(domain) - return super(SiteManagerPlugin, self).need(address, *args, **kwargs) + # Return: True if the address is domain + def isDomain(self, address): + return self.isBitDomain(address) or super(SiteManagerPlugin, self).isDomain(address) - # Return: Site object or None if not found - def get(self, address): - if not self.loaded: # Not loaded yet - self.load() - if self.isBitDomain(address): # Its looks like a domain - address_resolved = self.resolveDomain(address) - if address_resolved: # Domain found - site = self.sites.get(address_resolved) - if site: - site_domain = site.settings.get("domain") - if site_domain != address: - site.settings["domain"] = address - else: # Domain not found - site = self.sites.get(address) - else: # Access by site address - site = super(SiteManagerPlugin, self).get(address) - return site +@PluginManager.registerTo("ConfigPlugin") +class ConfigPlugin(object): + def createArguments(self): + group = self.parser.add_argument_group("Zeroname plugin") + group.add_argument( + "--bit_resolver", help="ZeroNet site to resolve .bit domains", + default="1Name2NXVi1RDPDgf5617UoW7xA6YrhM9F", metavar="address" + ) + + return super(ConfigPlugin, self).createArguments() diff --git a/plugins/Zeroname/UiRequestPlugin.py b/plugins/Zeroname/UiRequestPlugin.py deleted file mode 100644 index b0230524..00000000 --- a/plugins/Zeroname/UiRequestPlugin.py +++ /dev/null @@ -1,30 +0,0 @@ -import re - -from Plugin import PluginManager - - -@PluginManager.registerTo("UiRequest") -class UiRequestPlugin(object): - - def __init__(self, *args, **kwargs): - from Site import SiteManager - self.site_manager = SiteManager.site_manager - super(UiRequestPlugin, self).__init__(*args, **kwargs) - - # Media request - def actionSiteMedia(self, path, **kwargs): - match = re.match(r"/media/(?P
    [A-Za-z0-9-]+\.[A-Za-z0-9\.-]+)(?P/.*|$)", path) - if match: # Its a valid domain, resolve first - domain = match.group("address") - address = self.site_manager.resolveDomain(domain) - if address: - path = "/media/" + address + match.group("inner_path") - return super(UiRequestPlugin, self).actionSiteMedia(path, **kwargs) # Get the wrapper frame output - -@PluginManager.registerTo("ConfigPlugin") -class ConfigPlugin(object): - def createArguments(self): - group = self.parser.add_argument_group("Zeroname plugin") - group.add_argument('--bit_resolver', help='ZeroNet site to resolve .bit domains', default="1Name2NXVi1RDPDgf5617UoW7xA6YrhM9F", metavar="address") - - return super(ConfigPlugin, self).createArguments() diff --git a/plugins/Zeroname/__init__.py b/plugins/Zeroname/__init__.py index cf724069..76826d9a 100644 --- a/plugins/Zeroname/__init__.py +++ b/plugins/Zeroname/__init__.py @@ -1,2 +1 @@ -from . import UiRequestPlugin -from . import SiteManagerPlugin \ No newline at end of file +from . import SiteManagerPlugin diff --git a/plugins/disabled-Bootstrapper/BootstrapperDb.py b/plugins/disabled-Bootstrapper/BootstrapperDb.py index 3c47b76d..0866dc3e 100644 --- a/plugins/disabled-Bootstrapper/BootstrapperDb.py +++ b/plugins/disabled-Bootstrapper/BootstrapperDb.py @@ -79,8 +79,8 @@ class BootstrapperDb(Db.Db): def getHashId(self, hash): if hash not in self.hash_ids: self.log.debug("New hash: %s" % repr(hash)) - self.execute("INSERT OR IGNORE INTO hash ?", {"hash": hash}) - self.hash_ids[hash] = self.cur.cursor.lastrowid + res = self.execute("INSERT OR IGNORE INTO hash ?", {"hash": hash}) + self.hash_ids[hash] = res.lastrowid return self.hash_ids[hash] def peerAnnounce(self, ip_type, address, port=None, hashes=[], onion_signed=False, delete_missing_hashes=False): @@ -100,8 +100,8 @@ class BootstrapperDb(Db.Db): self.log.debug("New peer: %s signed: %s" % (address, onion_signed)) if ip_type == "onion" and not onion_signed: return len(hashes) - self.execute("INSERT INTO peer ?", {"type": ip_type, "address": address, "port": port, "date_announced": now}) - peer_id = self.cur.cursor.lastrowid + res = self.execute("INSERT INTO peer ?", {"type": ip_type, "address": address, "port": port, "date_announced": now}) + peer_id = res.lastrowid # Check user's hashes res = self.execute("SELECT * FROM peer_to_hash WHERE ?", {"peer_id": peer_id}) diff --git a/plugins/disabled-Bootstrapper/BootstrapperPlugin.py b/plugins/disabled-Bootstrapper/BootstrapperPlugin.py index 474f79c1..59e7af7b 100644 --- a/plugins/disabled-Bootstrapper/BootstrapperPlugin.py +++ b/plugins/disabled-Bootstrapper/BootstrapperPlugin.py @@ -150,7 +150,7 @@ class UiRequestPlugin(object): ).fetchall() yield "
    %s (added: %s, peers: %s)
    " % ( - str(hash_row["hash"]).encode("hex"), hash_row["date_added"], len(peer_rows) + str(hash_row["hash"]).encode().hex(), hash_row["date_added"], len(peer_rows) ) for peer_row in peer_rows: - yield " - {ip4: <30} {onion: <30} added: {date_added}, announced: {date_announced}
    ".format(**dict(peer_row)) + yield " - {type} {address}:{port} added: {date_added}, announced: {date_announced}
    ".format(**dict(peer_row)) diff --git a/plugins/disabled-Bootstrapper/Test/pytest.ini b/plugins/disabled-Bootstrapper/Test/pytest.ini index d09210d1..8ee21268 100644 --- a/plugins/disabled-Bootstrapper/Test/pytest.ini +++ b/plugins/disabled-Bootstrapper/Test/pytest.ini @@ -2,4 +2,5 @@ python_files = Test*.py addopts = -rsxX -v --durations=6 markers = + slow: mark a tests as slow. webtest: mark a test as a webtest. \ No newline at end of file diff --git a/plugins/disabled-Bootstrapper/plugin_info.json b/plugins/disabled-Bootstrapper/plugin_info.json new file mode 100644 index 00000000..06915d4d --- /dev/null +++ b/plugins/disabled-Bootstrapper/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "Bootstrapper", + "description": "Add BitTorrent tracker server like features to your ZeroNet client.", + "default": "disabled" +} \ No newline at end of file diff --git a/plugins/disabled-Multiuser/MultiuserPlugin.py b/plugins/disabled-Multiuser/MultiuserPlugin.py index 2406e224..799c3337 100644 --- a/plugins/disabled-Multiuser/MultiuserPlugin.py +++ b/plugins/disabled-Multiuser/MultiuserPlugin.py @@ -6,6 +6,8 @@ from Config import config from Plugin import PluginManager from Crypt import CryptBitcoin from . import UserPlugin +from util.Flag import flag +from Translate import translate as _ # We can only import plugin host clases after the plugins are loaded @PluginManager.afterLoad @@ -101,15 +103,8 @@ class UiRequestPlugin(object): @PluginManager.registerTo("UiWebsocket") class UiWebsocketPlugin(object): def __init__(self, *args, **kwargs): - self.multiuser_denied_cmds = ( - "siteDelete", "configSet", "serverShutdown", "serverUpdate", "siteClone", - "siteSetOwned", "siteSetAutodownloadoptional", "dbReload", "dbRebuild", - "mergerSiteDelete", "siteSetLimit", "siteSetAutodownloadBigfileLimit", - "optionalLimitSet", "optionalHelp", "optionalHelpRemove", "optionalHelpAll", "optionalFilePin", "optionalFileUnpin", "optionalFileDelete", - "muteAdd", "muteRemove", "siteblockAdd", "siteblockRemove", "filterIncludeAdd", "filterIncludeRemove" - ) if config.multiuser_no_new_sites: - self.multiuser_denied_cmds += ("mergerSiteAdd", ) + flag.no_multiuser(self.actionMergerSiteAdd) super(UiWebsocketPlugin, self).__init__(*args, **kwargs) @@ -119,21 +114,21 @@ class UiWebsocketPlugin(object): server_info["multiuser"] = True if "ADMIN" in self.site.settings["permissions"]: server_info["master_address"] = self.user.master_address + is_multiuser_admin = config.multiuser_local or self.user.master_address in local_master_addresses + server_info["multiuser_admin"] = is_multiuser_admin return server_info # Show current user's master seed + @flag.admin def actionUserShowMasterSeed(self, to): - if "ADMIN" not in self.site.settings["permissions"]: - return self.response(to, "Show master seed not allowed") message = "Your unique private key:" message += "
    %s
    " % self.user.master_seed message += "(Save it, you can access your account using this information)" self.cmd("notification", ["info", message]) # Logout user + @flag.admin def actionUserLogout(self, to): - if "ADMIN" not in self.site.settings["permissions"]: - return self.response(to, "Logout not allowed") message = "You have been logged out. Login to another account" self.cmd("notification", ["done", message, 1000000]) # 1000000 = Show ~forever :) @@ -149,6 +144,52 @@ class UiWebsocketPlugin(object): else: self.response(to, "User not found") + @flag.admin + def actionUserSet(self, to, master_address): + user_manager = UserManager.user_manager + user = user_manager.get(master_address) + if not user: + raise Exception("No user found") + + script = "document.cookie = 'master_address=%s;path=/;max-age=2592000;';" % master_address + script += "zeroframe.cmd('wrapperReload', ['login=done']);" + self.cmd("notification", ["done", "Successful login, reloading page..."]) + self.cmd("injectScript", script) + + self.response(to, "ok") + + @flag.admin + def actionUserSelectForm(self, to): + if not config.multiuser_local: + raise Exception("Only allowed in multiuser local mode") + user_manager = UserManager.user_manager + body = "" + "Change account:" + "" + for master_address, user in user_manager.list().items(): + is_active = self.user.master_address == master_address + if user.certs: + first_cert = next(iter(user.certs.keys())) + title = "%s@%s" % (user.certs[first_cert]["auth_user_name"], first_cert) + else: + title = user.master_address + if len(user.sites) < 2 and not is_active: # Avoid listing ad-hoc created users + continue + if is_active: + css_class = "active" + else: + css_class = "noclass" + body += "%s" % (css_class, user.master_address, title) + + script = """ + $(".notification .select.user").on("click", function() { + $(".notification .select").removeClass('active') + zeroframe.response(%s, this.title) + return false + }) + """ % self.next_message_id + + self.cmd("notification", ["ask", body], lambda master_address: self.actionUserSet(to, master_address)) + self.cmd("injectScript", script) + # Show login form def actionUserLoginForm(self, to): self.cmd("prompt", ["Login
    Your private key:", "password", "Login"], self.responseUserLogin) @@ -169,9 +210,10 @@ class UiWebsocketPlugin(object): self.actionUserLoginForm(0) def hasCmdPermission(self, cmd): - cmd = cmd[0].lower() + cmd[1:] - if not config.multiuser_local and self.user.master_address not in local_master_addresses and cmd in self.multiuser_denied_cmds: - self.cmd("notification", ["info", "This function is disabled on this proxy!"]) + flags = flag.db.get(self.getCmdFuncName(cmd), ()) + is_public_proxy_user = not config.multiuser_local and self.user.master_address not in local_master_addresses + if is_public_proxy_user and "no_multiuser" in flags: + self.cmd("notification", ["info", _("This function ({cmd}) is disabled on this proxy!")]) return False else: return super(UiWebsocketPlugin, self).hasCmdPermission(cmd) @@ -213,9 +255,9 @@ class UiWebsocketPlugin(object): """.replace("{master_seed}", master_seed) self.cmd("injectScript", script) - def actionPermissionAdd(self, to, permission): - if permission == "NOSANDBOX": + is_public_proxy_user = not config.multiuser_local and self.user.master_address not in local_master_addresses + if permission == "NOSANDBOX" and is_public_proxy_user: self.cmd("notification", ["info", "You can't disable sandbox on this proxy!"]) self.response(to, {"error": "Denied by proxy"}) return False diff --git a/plugins/disabled-Multiuser/plugin_info.json b/plugins/disabled-Multiuser/plugin_info.json new file mode 100644 index 00000000..e440ed8e --- /dev/null +++ b/plugins/disabled-Multiuser/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "MultiUser", + "description": "Cookie based multi-users support on your ZeroNet web interface.", + "default": "disabled" +} \ No newline at end of file diff --git a/plugins/disabled-UiPassword/UiPasswordPlugin.py b/plugins/disabled-UiPassword/UiPasswordPlugin.py index 944804d7..1962d5e6 100644 --- a/plugins/disabled-UiPassword/UiPasswordPlugin.py +++ b/plugins/disabled-UiPassword/UiPasswordPlugin.py @@ -3,12 +3,15 @@ import random import time import json import re - +import os from Config import config from Plugin import PluginManager from util import helper + +plugin_dir = os.path.dirname(__file__) + if "sessions" not in locals().keys(): # To keep sessions between module reloads sessions = {} @@ -21,6 +24,7 @@ def showPasswordAdvice(password): error_msgs.append("You are using a very short UI password!") return error_msgs + @PluginManager.registerTo("UiRequest") class UiRequestPlugin(object): sessions = sessions @@ -45,7 +49,7 @@ class UiRequestPlugin(object): # Action: Login @helper.encodeResponse def actionLogin(self): - template = open("plugins/UiPassword/login.html").read() + template = open(plugin_dir + "/login.html").read() self.sendHeader() posted = self.getPosted() if posted: # Validate http posted data @@ -108,7 +112,6 @@ class UiRequestPlugin(object): yield "Error: Invalid session id" - @PluginManager.registerTo("ConfigPlugin") class ConfigPlugin(object): def createArguments(self): diff --git a/plugins/disabled-UiPassword/plugin_info.json b/plugins/disabled-UiPassword/plugin_info.json new file mode 100644 index 00000000..d3649a17 --- /dev/null +++ b/plugins/disabled-UiPassword/plugin_info.json @@ -0,0 +1,5 @@ +{ + "name": "UiPassword", + "description": "Password based autentication on the web interface.", + "default": "disabled" +} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 1173d695..83f3c3ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,12 @@ -gevent>=1.1.0 +gevent>=1.1.0; python_version < "3.8" +https://github.com/gevent/gevent/archive/master.zip; python_version >= "3.8" msgpack>=0.4.4 base58 merkletools -pyelliptic==1.5.6 rsa -PySocks +PySocks>=1.6.8 pyasn1 websocket_client -gevent-websocket -bencode.py +gevent-ws coincurve -python-bitcoinlib maxminddb diff --git a/src/Config.py b/src/Config.py index 4613940b..101f1277 100644 --- a/src/Config.py +++ b/src/Config.py @@ -12,22 +12,28 @@ import stat class Config(object): def __init__(self, argv): - self.version = "0.7.0" - self.rev = 4126 + self.version = "0.7.1" + self.rev = 4462 self.argv = argv self.action = None + self.test_parser = None self.pending_changes = {} self.need_restart = False self.keys_api_change_allowed = set([ "tor", "fileserver_port", "language", "tor_use_bridges", "trackers_proxy", "trackers", - "trackers_file", "open_browser", "log_level", "fileserver_ip_type", "ip_external", "offline" + "trackers_file", "open_browser", "log_level", "fileserver_ip_type", "ip_external", "offline", + "threads_fs_read", "threads_fs_write", "threads_crypt", "threads_db" + ]) + self.keys_restart_need = set([ + "tor", "fileserver_port", "fileserver_ip_type", "threads_fs_read", "threads_fs_write", "threads_crypt", "threads_db" ]) - self.keys_restart_need = set(["tor", "fileserver_port", "fileserver_ip_type"]) self.start_dir = self.getStartDir() self.config_file = self.start_dir + "/zeronet.conf" self.data_dir = self.start_dir + "/data" self.log_dir = self.start_dir + "/log" + self.openssl_lib_file = None + self.openssl_bin_file = None self.trackers_file = False self.createParser() @@ -49,7 +55,9 @@ class Config(object): def getStartDir(self): this_file = os.path.abspath(__file__).replace("\\", "/").rstrip("cd") - if this_file.endswith("/Contents/Resources/core/src/Config.py"): + if "--start_dir" in self.argv: + start_dir = self.argv[self.argv.index("--start_dir") + 1] + elif this_file.endswith("/Contents/Resources/core/src/Config.py"): # Running as ZeroNet.app if this_file.startswith("/Application") or this_file.startswith("/private") or this_file.startswith(os.path.expanduser("~/Library")): # Runnig from non-writeable directory, put data to Application Support @@ -74,11 +82,11 @@ class Config(object): "zero://boot3rdez4rzn36x.onion:15441", "zero://zero.booth.moe#f36ca555bee6ba216b14d10f38c16f7769ff064e0e37d887603548cc2e64191d:443", # US/NY "udp://tracker.coppersurfer.tk:6969", # DE - "udp://amigacity.xyz:6969", # US/NY "udp://104.238.198.186:8000", # US/LA - "http://tracker01.loveapp.com:6789/announce", # Google + "udp://retracker.akado-ural.ru:80", # RU + "http://h4.trakx.nibba.trade:80/announce", # US/VA "http://open.acgnxtracker.com:80/announce", # DE - "http://open.trackerlist.xyz:80/announce", # Cloudflare + "http://tracker.bt4g.com:2095/announce", # Cloudflare "zero://2602:ffc5::c5b2:5360:26312" # US/ATL ] # Platform specific @@ -113,6 +121,8 @@ class Config(object): # SiteCreate action = self.subparsers.add_parser("siteCreate", help='Create a new site') + action.register('type', 'bool', self.strToBool) + action.add_argument('--use_master_seed', help="Allow created site's private key to be recovered using the master seed in users.json (default: True)", type="bool", choices=[True, False], default=True) # SiteNeedFile action = self.subparsers.add_parser("siteNeedFile", help='Get a file from site') @@ -201,19 +211,27 @@ class Config(object): action = self.subparsers.add_parser("testConnection", help='Testing') action = self.subparsers.add_parser("testAnnounce", help='Testing') + self.test_parser = self.subparsers.add_parser("test", help='Run a test') + self.test_parser.add_argument('test_name', help='Test name', nargs="?") + # self.test_parser.add_argument('--benchmark', help='Run the tests multiple times to measure the performance', action='store_true') + # Config parameters self.parser.add_argument('--verbose', help='More detailed logging', action='store_true') self.parser.add_argument('--debug', help='Debug mode', action='store_true') - self.parser.add_argument('--silent', help='Disable logging to terminal output', action='store_true') + self.parser.add_argument('--silent', help='Only log errors to terminal output', action='store_true') self.parser.add_argument('--debug_socket', help='Debug socket connections', action='store_true') + self.parser.add_argument('--merge_media', help='Merge all.js and all.css', action='store_true') self.parser.add_argument('--batch', help="Batch mode (No interactive input for commands)", action='store_true') + self.parser.add_argument('--start_dir', help='Path of working dir for variable content (data, log, .conf)', default=self.start_dir, metavar="path") self.parser.add_argument('--config_file', help='Path of config file', default=config_file, metavar="path") self.parser.add_argument('--data_dir', help='Path of data directory', default=data_dir, metavar="path") + self.parser.add_argument('--console_log_level', help='Level of logging to console', default="default", choices=["default", "DEBUG", "INFO", "ERROR", "off"]) + self.parser.add_argument('--log_dir', help='Path of logging directory', default=log_dir, metavar="path") - self.parser.add_argument('--log_level', help='Level of logging to file', default="DEBUG", choices=["DEBUG", "INFO", "ERROR"]) + self.parser.add_argument('--log_level', help='Level of logging to file', default="DEBUG", choices=["DEBUG", "INFO", "ERROR", "off"]) self.parser.add_argument('--log_rotate', help='Log rotate interval', default="daily", choices=["hourly", "daily", "weekly", "off"]) self.parser.add_argument('--log_rotate_backup_count', help='Log rotate backup count', default=5, type=int) @@ -250,10 +268,12 @@ class Config(object): self.parser.add_argument('--proxy', help='Socks proxy address', metavar='ip:port') self.parser.add_argument('--bind', help='Bind outgoing sockets to this address', metavar='ip') self.parser.add_argument('--trackers', help='Bootstraping torrent trackers', default=trackers, metavar='protocol://address', nargs='*') - self.parser.add_argument('--trackers_file', help='Load torrent trackers dynamically from a file', default=False, metavar='path') + self.parser.add_argument('--trackers_file', help='Load torrent trackers dynamically from a file', metavar='path', nargs='*') self.parser.add_argument('--trackers_proxy', help='Force use proxy to connect to trackers (disable, tor, ip:port)', default="disable") self.parser.add_argument('--use_libsecp256k1', help='Use Libsecp256k1 liblary for speedup', type='bool', choices=[True, False], default=True) self.parser.add_argument('--use_openssl', help='Use OpenSSL liblary for speedup', type='bool', choices=[True, False], default=True) + self.parser.add_argument('--openssl_lib_file', help='Path for OpenSSL library file (default: detect)', default=argparse.SUPPRESS, metavar="path") + self.parser.add_argument('--openssl_bin_file', help='Path for OpenSSL binary file (default: detect)', default=argparse.SUPPRESS, metavar="path") self.parser.add_argument('--disable_db', help='Disable database updating', action='store_true') self.parser.add_argument('--disable_encryption', help='Disable connection encryption', action='store_true') self.parser.add_argument('--force_encryption', help="Enforce encryption to all peer connections", action='store_true') @@ -272,6 +292,12 @@ class Config(object): self.parser.add_argument("--fix_float_decimals", help='Fix content.json modification date float precision on verification', type='bool', choices=[True, False], default=fix_float_decimals) self.parser.add_argument("--db_mode", choices=["speed", "security"], default="speed") + + self.parser.add_argument('--threads_fs_read', help='Number of threads for file read operations', default=1, type=int) + self.parser.add_argument('--threads_fs_write', help='Number of threads for file write operations', default=1, type=int) + self.parser.add_argument('--threads_crypt', help='Number of threads for cryptographic operations', default=2, type=int) + self.parser.add_argument('--threads_db', help='Number of threads for database operations', default=1, type=int) + self.parser.add_argument("--download_optional", choices=["manual", "auto"], default="manual") self.parser.add_argument('--coffeescript_compiler', help='Coffeescript compiler for developing', default=coffeescript, @@ -296,20 +322,21 @@ class Config(object): self.trackers = self.arguments.trackers[:] - try: - if self.trackers_file.startswith("/"): # Absolute - trackers_file_path = self.trackers_file - elif self.trackers_file.startswith("{data_dir}"): # Relative to data_dir - trackers_file_path = self.trackers_file.replace("{data_dir}", self.data_dir) - else: # Relative to zeronet.py - trackers_file_path = self.start_dir + "/" + self.trackers_file + for trackers_file in self.trackers_file: + try: + if trackers_file.startswith("/"): # Absolute + trackers_file_path = trackers_file + elif trackers_file.startswith("{data_dir}"): # Relative to data_dir + trackers_file_path = trackers_file.replace("{data_dir}", self.data_dir) + else: # Relative to zeronet.py + trackers_file_path = self.start_dir + "/" + trackers_file - for line in open(trackers_file_path): - tracker = line.strip() - if "://" in tracker and tracker not in self.trackers: - self.trackers.append(tracker) - except Exception as err: - print("Error loading trackers file: %s" % err) + for line in open(trackers_file_path): + tracker = line.strip() + if "://" in tracker and tracker not in self.trackers: + self.trackers.append(tracker) + except Exception as err: + print("Error loading trackers file: %s" % err) # Find arguments specified for current action def getActionArguments(self): @@ -350,8 +377,17 @@ class Config(object): valid_parameters.append(arg) return valid_parameters + plugin_parameters + def getParser(self, argv): + action = self.getAction(argv) + if not action: + return self.parser + else: + return self.subparsers.choices[action] + # Parse arguments from config file and command line def parse(self, silent=False, parse_config=True): + argv = self.argv[:] # Copy command line arguments + current_parser = self.getParser(argv) if silent: # Don't display messages or quit on unknown parameter original_print_message = self.parser._print_message original_exit = self.parser.exit @@ -359,11 +395,10 @@ class Config(object): def silencer(parser, function_name): parser.exited = True return None - self.parser.exited = False - self.parser._print_message = lambda *args, **kwargs: silencer(self.parser, "_print_message") - self.parser.exit = lambda *args, **kwargs: silencer(self.parser, "exit") + current_parser.exited = False + current_parser._print_message = lambda *args, **kwargs: silencer(current_parser, "_print_message") + current_parser.exit = lambda *args, **kwargs: silencer(current_parser, "exit") - argv = self.argv[:] # Copy command line arguments self.parseCommandline(argv, silent) # Parse argv self.setAttributes() if parse_config: @@ -377,10 +412,10 @@ class Config(object): self.ip_local.append(self.fileserver_ip) if silent: # Restore original functions - if self.parser.exited and self.action == "main": # Argument parsing halted, don't start ZeroNet with main action + if current_parser.exited and self.action == "main": # Argument parsing halted, don't start ZeroNet with main action self.action = None - self.parser._print_message = original_print_message - self.parser.exit = original_exit + current_parser._print_message = original_print_message + current_parser.exit = original_exit self.loadTrackersFile() @@ -419,7 +454,7 @@ class Config(object): key = section + "_" + key if key == "open_browser": # Prefer config file value over cli argument - if "--%s" % key in argv: + while "--%s" % key in argv: pos = argv.index("--open_browser") del argv[pos:pos + 2] @@ -433,6 +468,16 @@ class Config(object): argv = argv[:1] + argv_extend + argv[1:] return argv + # Return command line value of given argument + def getCmdlineValue(self, key): + if key not in self.argv: + return None + argv_index = self.argv.index(key) + if argv_index == len(self.argv) - 1: # last arg, test not specified + return None + + return self.argv[argv_index + 1] + # Expose arguments as class attributes def setAttributes(self): # Set attributes from arguments @@ -441,8 +486,9 @@ class Config(object): for key, val in args.items(): if type(val) is list: val = val[:] - if key in ("data_dir", "log_dir"): - val = val.replace("\\", "/") + if key in ("data_dir", "log_dir", "start_dir", "openssl_bin_file", "openssl_lib_file"): + if val: + val = val.replace("\\", "/") setattr(self, key, val) def loadPlugins(self): @@ -451,7 +497,11 @@ class Config(object): @PluginManager.acceptPlugins class ConfigPlugin(object): def __init__(self, config): + self.argv = config.argv self.parser = config.parser + self.subparsers = config.subparsers + self.test_parser = config.test_parser + self.getCmdlineValue = config.getCmdlineValue self.createArguments() def createArguments(self): @@ -539,12 +589,15 @@ class Config(object): else: format = '%(name)s %(message)s' - if self.silent: - level = logging.ERROR - elif self.debug: - level = logging.DEBUG + if self.console_log_level == "default": + if self.silent: + level = logging.ERROR + elif self.debug: + level = logging.DEBUG + else: + level = logging.INFO else: - level = logging.INFO + level = logging.getLevelName(self.console_log_level) console_logger = logging.StreamHandler() console_logger.setFormatter(logging.Formatter(format, "%H:%M:%S")) @@ -573,7 +626,13 @@ class Config(object): logging.getLogger('').setLevel(logging.getLevelName(self.log_level)) logging.getLogger('').addHandler(file_logger) - def initLogging(self, console_logging=True, file_logging=True): + def initLogging(self, console_logging=None, file_logging=None): + if console_logging == None: + console_logging = self.console_log_level != "off" + + if file_logging == None: + file_logging = self.log_level != "off" + # Create necessary files and dirs if not os.path.isdir(self.log_dir): os.mkdir(self.log_dir) @@ -587,7 +646,6 @@ class Config(object): logging.addLevelName(15, "WARNING") logging.getLogger('').name = "-" # Remove root prefix - logging.getLogger("geventwebsocket.handler").setLevel(logging.WARNING) # Don't log ws debug messages if console_logging: self.initConsoleLogger() diff --git a/src/Connection/Connection.py b/src/Connection/Connection.py index 8122ec08..22bcf29c 100644 --- a/src/Connection/Connection.py +++ b/src/Connection/Connection.py @@ -125,11 +125,11 @@ class Connection(object): self.sock = self.server.tor_manager.createSocket(self.ip, self.port) elif config.tor == "always" and helper.isPrivateIp(self.ip) and self.ip not in config.ip_local: raise Exception("Can't connect to local IPs in Tor: always mode") - elif config.trackers_proxy != "disable" and self.is_tracker_connection: + elif config.trackers_proxy != "disable" and config.tor != "always" and self.is_tracker_connection: if config.trackers_proxy == "tor": self.sock = self.server.tor_manager.createSocket(self.ip, self.port) else: - from lib.PySocks import socks + import socks self.sock = socks.socksocket() proxy_ip, proxy_port = config.trackers_proxy.split(":") self.sock.set_proxy(socks.PROXY_TYPE_SOCKS5, proxy_ip, int(proxy_port)) diff --git a/src/Connection/ConnectionServer.py b/src/Connection/ConnectionServer.py index f81dc5f8..8d377aca 100644 --- a/src/Connection/ConnectionServer.py +++ b/src/Connection/ConnectionServer.py @@ -46,6 +46,8 @@ class ConnectionServer(object): self.stream_server = None self.stream_server_proxy = None self.running = False + self.stopping = False + self.thread_checker = None self.stat_recv = defaultdict(lambda: defaultdict(int)) self.stat_sent = defaultdict(lambda: defaultdict(int)) @@ -76,6 +78,8 @@ class ConnectionServer(object): self.handleRequest = request_handler def start(self, check_connections=True): + if self.stopping: + return False self.running = True if check_connections: self.thread_checker = gevent.spawn(self.checkConnections) @@ -99,17 +103,23 @@ class ConnectionServer(object): def listen(self): if not self.running: - return False + return None + if self.stream_server_proxy: gevent.spawn(self.listenProxy) try: self.stream_server.serve_forever() except Exception as err: self.log.info("StreamServer listen error: %s" % err) + return False + self.log.debug("Stopped.") def stop(self): - self.log.debug("Stopping") + self.log.debug("Stopping %s" % self.stream_server) + self.stopping = True self.running = False + if self.thread_checker: + gevent.kill(self.thread_checker) if self.stream_server: self.stream_server.stop() @@ -238,9 +248,9 @@ class ConnectionServer(object): def checkConnections(self): run_i = 0 + time.sleep(15) while self.running: run_i += 1 - time.sleep(15) # Check every minute self.ip_incoming = {} # Reset connected ips counter last_message_time = 0 s = time.time() @@ -317,6 +327,8 @@ class ConnectionServer(object): if time.time() - s > 0.01: self.log.debug("Connection cleanup in %.3fs" % (time.time() - s)) + + time.sleep(15) self.log.debug("Checkconnections ended") @util.Noparallel(blocking=False) @@ -354,7 +366,7 @@ class ConnectionServer(object): for connection in self.connections if connection.handshake.get("time") and connection.last_ping_delay ]) - if len(corrections) < 6: + if len(corrections) < 9: return 0.0 mid = int(len(corrections) / 2 - 1) median = (corrections[mid - 1] + corrections[mid] + corrections[mid + 1]) / 3 diff --git a/src/Content/ContentDb.py b/src/Content/ContentDb.py index aeb23fe1..f284581e 100644 --- a/src/Content/ContentDb.py +++ b/src/Content/ContentDb.py @@ -1,4 +1,3 @@ -import time import os from Db.Db import Db, DbTableError @@ -12,6 +11,8 @@ class ContentDb(Db): def __init__(self, path): Db.__init__(self, {"db_name": "ContentDb", "tables": {}}, path) self.foreign_keys = True + + def init(self): try: self.schema = self.getSchema() try: @@ -25,8 +26,8 @@ class ContentDb(Db): except Exception as err: self.log.error("Error loading content.db: %s, rebuilding..." % Debug.formatException(err)) self.close() - os.unlink(path) # Remove and try again - Db.__init__(self, {"db_name": "ContentDb", "tables": {}}, path) + os.unlink(self.db_path) # Remove and try again + Db.__init__(self, {"db_name": "ContentDb", "tables": {}}, self.db_path) self.foreign_keys = True self.schema = self.getSchema() try: @@ -155,6 +156,7 @@ def getContentDb(path=None): path = "%s/content.db" % config.data_dir if path not in content_dbs: content_dbs[path] = ContentDb(path) + content_dbs[path].init() return content_dbs[path] getContentDb() # Pre-connect to default one diff --git a/src/Content/ContentManager.py b/src/Content/ContentManager.py index 12a9b638..6256a8cd 100644 --- a/src/Content/ContentManager.py +++ b/src/Content/ContentManager.py @@ -40,7 +40,7 @@ class ContentManager(object): # Load all content.json files def loadContents(self): if len(self.contents) == 0: - self.log.debug("ContentDb not initialized, load files from filesystem") + self.log.info("ContentDb not initialized, load files from filesystem...") self.loadContent(add_bad_files=False, delete_removed_files=False) self.site.settings["size"], self.site.settings["size_optional"] = self.getTotalSize() @@ -595,20 +595,27 @@ class ContentManager(object): return back def isValidRelativePath(self, relative_path): - if ".." in relative_path: + if ".." in relative_path.replace("\\", "/").split("/"): return False elif len(relative_path) > 255: return False + elif relative_path[0] in (".", "/"): # Starts with + return False + elif relative_path[-1] in (".", " "): # Ends with + return False + elif re.match(r".*(^|/)(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CONOUT\$|CONIN\$)(\.|/|$)", relative_path, re.IGNORECASE): # Protected on Windows + return False else: - return re.match(r"^[a-z\[\]\(\) A-Z0-9~_@=\.\+-/]+$", relative_path) + return re.match(r"^[^\x00-\x1F\"*:<>?\\|]+$", relative_path) def sanitizePath(self, inner_path): - return re.sub("[^a-z\[\]\(\) A-Z0-9_@=\.\+-/]", "", inner_path) + return re.sub("[\x00-\x1F\"*:<>?\\|]", "", inner_path) # Hash files in directory def hashFiles(self, dir_inner_path, ignore_pattern=None, optional_pattern=None): files_node = {} files_optional_node = {} + db_inner_path = self.site.storage.getDbFile() if dir_inner_path and not self.isValidRelativePath(dir_inner_path): ignored = True self.log.error("- [ERROR] Only ascii encoded directories allowed: %s" % dir_inner_path) @@ -624,7 +631,7 @@ class ContentManager(object): elif not self.isValidRelativePath(file_relative_path): ignored = True self.log.error("- [ERROR] Invalid filename: %s" % file_relative_path) - elif dir_inner_path == "" and self.site.storage.getDbFile() and file_relative_path.startswith(self.site.storage.getDbFile()): + elif dir_inner_path == "" and db_inner_path and file_relative_path.startswith(db_inner_path): ignored = True elif optional_pattern and SafeRe.match(optional_pattern, file_relative_path): optional = True @@ -795,9 +802,12 @@ class ContentManager(object): def getSignsRequired(self, inner_path, content=None): return 1 # Todo: Multisig - def verifyCert(self, inner_path, content): + def verifyCertSign(self, user_address, user_auth_type, user_name, issuer_address, sign): from Crypt import CryptBitcoin + cert_subject = "%s#%s/%s" % (user_address, user_auth_type, user_name) + return CryptBitcoin.verify(cert_subject, issuer_address, sign) + def verifyCert(self, inner_path, content): rules = self.getRules(inner_path, content) if not rules: @@ -820,12 +830,7 @@ class ContentManager(object): else: raise VerifyError("Invalid cert signer: %s" % domain) - try: - cert_subject = "%s#%s/%s" % (rules["user_address"], content["cert_auth_type"], name) - result = CryptBitcoin.verify(cert_subject, cert_address, content["cert_sign"]) - except Exception as err: - raise VerifyError("Certificate verify error: %s" % err) - return result + return self.verifyCertSign(rules["user_address"], content["cert_auth_type"], name, cert_address, content["cert_sign"]) # Checks if the content.json content is valid # Return: True or False @@ -858,15 +863,16 @@ class ContentManager(object): if content.get("inner_path") and content["inner_path"] != inner_path: raise VerifyError("Wrong inner_path: %s" % content["inner_path"]) - # Check total site size limit - if site_size > site_size_limit: - if inner_path == "content.json" and self.site.settings["size"] == 0: - # First content.json download, save site size to display warning + # If our content.json file bigger than the size limit throw error + if inner_path == "content.json": + content_size_file = len(json.dumps(content, indent=1)) + if content_size_file > site_size_limit: + # Save site size to display warning self.site.settings["size"] = site_size - task = self.site.worker_manager.findTask(inner_path) - if task: # Dont try to download from other peers - self.site.worker_manager.failTask(task) - raise VerifyError("Content too large %sB > %sB, aborting task..." % (site_size, site_size_limit)) + task = self.site.worker_manager.tasks.findTask(inner_path) + if task: # Dont try to download from other peers + self.site.worker_manager.failTask(task) + raise VerifyError("Content too large %s B > %s B, aborting task..." % (site_size, site_size_limit)) # Verify valid filenames for file_relative_path in list(content.get("files", {}).keys()) + list(content.get("files_optional", {}).keys()): @@ -883,7 +889,7 @@ class ContentManager(object): self.site.settings["size_optional"] = site_size_optional return True else: - return False + raise VerifyError("Content verify error") def verifyContentInclude(self, inner_path, content, content_size, content_size_optional): # Load include details @@ -928,10 +934,13 @@ class ContentManager(object): if type(file) is dict: new_content = file else: - if sys.version_info.major == 3 and sys.version_info.minor < 6: - new_content = json.loads(file.read().decode("utf8")) - else: - new_content = json.load(file) + try: + if sys.version_info.major == 3 and sys.version_info.minor < 6: + new_content = json.loads(file.read().decode("utf8")) + else: + new_content = json.load(file) + except Exception as err: + raise VerifyError("Invalid json file: %s" % err) if inner_path in self.contents: old_content = self.contents.get(inner_path, {"modified": 0}) # Checks if its newer the ours diff --git a/src/Crypt/Crypt.py b/src/Crypt/Crypt.py new file mode 100644 index 00000000..7d7d3659 --- /dev/null +++ b/src/Crypt/Crypt.py @@ -0,0 +1,4 @@ +from Config import config +from util import ThreadPool + +thread_pool_crypt = ThreadPool.ThreadPool(config.threads_crypt) \ No newline at end of file diff --git a/src/Crypt/CryptBitcoin.py b/src/Crypt/CryptBitcoin.py index a558e676..f54015dc 100644 --- a/src/Crypt/CryptBitcoin.py +++ b/src/Crypt/CryptBitcoin.py @@ -1,25 +1,35 @@ import logging import base64 +import binascii +import time +import hashlib -from util import OpensslFindPatch -from lib import pybitcointools as btctools +from util.Electrum import dbl_format from Config import config -lib_verify_best = "btctools" +lib_verify_best = "sslcrypto" +import sslcrypto +sslcurve_native = sslcrypto.ecc.get_curve("secp256k1") +sslcurve_fallback = sslcrypto.fallback.ecc.get_curve("secp256k1") +sslcurve = sslcurve_native -def loadLib(lib_name): - global bitcoin, libsecp256k1message, lib_verify_best +def loadLib(lib_name, silent=False): + global sslcurve, libsecp256k1message, lib_verify_best if lib_name == "libsecp256k1": + s = time.time() from lib import libsecp256k1message + import coincurve lib_verify_best = "libsecp256k1" - logging.info("Libsecpk256k1 loaded") - elif lib_name == "openssl": - import bitcoin.signmessage - import bitcoin.core.key - import bitcoin.wallet - - logging.info("OpenSSL loaded, version: %.9X" % bitcoin.core.key._ssl.SSLeay()) + if not silent: + logging.info( + "Libsecpk256k1 loaded: %s in %.3fs" % + (type(coincurve._libsecp256k1.lib).__name__, time.time() - s) + ) + elif lib_name == "sslcrypto": + sslcurve = sslcurve_native + elif lib_name == "sslcrypto_fallback": + sslcurve = sslcurve_fallback try: if not config.use_libsecp256k1: @@ -27,35 +37,30 @@ try: loadLib("libsecp256k1") lib_verify_best = "libsecp256k1" except Exception as err: - logging.info("Libsecp256k1 load failed: %s, try to load OpenSSL" % err) - try: - if not config.use_openssl: - raise Exception("Disabled by config") - loadLib("openssl") - lib_verify_best = "openssl" - except Exception as err: - logging.info("OpenSSL load failed: %s, falling back to slow bitcoin verify" % err) + logging.info("Libsecp256k1 load failed: %s" % err) -def newPrivatekey(uncompressed=True): # Return new private key - privatekey = btctools.encode_privkey(btctools.random_key(), "wif") - return privatekey +def newPrivatekey(): # Return new private key + return sslcurve.private_to_wif(sslcurve.new_private_key()).decode() def newSeed(): - return btctools.random_key() + return binascii.hexlify(sslcurve.new_private_key()).decode() def hdPrivatekey(seed, child): - masterkey = btctools.bip32_master_key(bytes(seed, "ascii")) - childkey = btctools.bip32_ckd(masterkey, child % 100000000) # Too large child id could cause problems - key = btctools.bip32_extract_key(childkey) - return btctools.encode_privkey(key, "wif") + # Too large child id could cause problems + privatekey_bin = sslcurve.derive_child(seed.encode(), child % 100000000) + return sslcurve.private_to_wif(privatekey_bin).decode() def privatekeyToAddress(privatekey): # Return address from private key try: - return btctools.privkey_to_address(privatekey) + if len(privatekey) == 64: + privatekey_bin = bytes.fromhex(privatekey) + else: + privatekey_bin = sslcurve.wif_to_private(privatekey.encode()) + return sslcurve.private_to_address(privatekey_bin, is_compressed=False).decode() except Exception: # Invalid privatekey return False @@ -63,8 +68,13 @@ def privatekeyToAddress(privatekey): # Return address from private key def sign(data, privatekey): # Return sign to data using private key if privatekey.startswith("23") and len(privatekey) > 52: return None # Old style private key not supported - sign = btctools.ecdsa_sign(data, privatekey) - return sign + return base64.b64encode(sslcurve.sign( + data.encode(), + sslcurve.wif_to_private(privatekey.encode()), + is_compressed=False, + recoverable=True, + hash=dbl_format + )).decode() def verify(data, valid_address, sign, lib_verify=None): # Verify data using address and sign @@ -76,17 +86,9 @@ def verify(data, valid_address, sign, lib_verify=None): # Verify data using add if lib_verify == "libsecp256k1": sign_address = libsecp256k1message.recover_address(data.encode("utf8"), sign).decode("utf8") - elif lib_verify == "openssl": - sig = base64.b64decode(sign) - message = bitcoin.signmessage.BitcoinMessage(data) - hash = message.GetHash() - - pubkey = bitcoin.core.key.CPubKey.recover_compact(hash, sig) - - sign_address = str(bitcoin.wallet.P2PKHBitcoinAddress.from_pubkey(pubkey)) - elif lib_verify == "btctools": # Use pure-python - pub = btctools.ecdsa_recover(data, sign) - sign_address = btctools.pubtoaddr(pub) + elif lib_verify in ("sslcrypto", "sslcrypto_fallback"): + publickey = sslcurve.recover(base64.b64decode(sign), data.encode(), hash=dbl_format) + sign_address = sslcurve.public_to_address(publickey).decode() else: raise Exception("No library enabled for signature verification") diff --git a/src/Crypt/CryptConnection.py b/src/Crypt/CryptConnection.py index 86a40f5e..ebbc6295 100644 --- a/src/Crypt/CryptConnection.py +++ b/src/Crypt/CryptConnection.py @@ -11,13 +11,23 @@ from util import helper class CryptConnectionManager: def __init__(self): - # OpenSSL params - if sys.platform.startswith("win"): + if config.openssl_bin_file: + self.openssl_bin = config.openssl_bin_file + elif sys.platform.startswith("win"): self.openssl_bin = "tools\\openssl\\openssl.exe" + elif config.dist_type.startswith("bundle_linux"): + self.openssl_bin = "../runtime/bin/openssl" else: self.openssl_bin = "openssl" + + self.context_client = None + self.context_server = None + + self.openssl_conf_template = "src/lib/openssl/openssl.cnf" + self.openssl_conf = config.data_dir + "/openssl.cnf" + self.openssl_env = { - "OPENSSL_CONF": "src/lib/openssl/openssl.cnf", + "OPENSSL_CONF": self.openssl_conf, "RANDFILE": config.data_dir + "/openssl-rand.tmp" } @@ -29,6 +39,44 @@ class CryptConnectionManager: self.cert_csr = config.data_dir + "/cert-rsa.csr" self.key_pem = config.data_dir + "/key-rsa.pem" + self.log = logging.getLogger("CryptConnectionManager") + self.log.debug("Version: %s" % ssl.OPENSSL_VERSION) + + self.fakedomains = [ + "yahoo.com", "amazon.com", "live.com", "microsoft.com", "mail.ru", "csdn.net", "bing.com", + "amazon.co.jp", "office.com", "imdb.com", "msn.com", "samsung.com", "huawei.com", "ztedevices.com", + "godaddy.com", "w3.org", "gravatar.com", "creativecommons.org", "hatena.ne.jp", + "adobe.com", "opera.com", "apache.org", "rambler.ru", "one.com", "nationalgeographic.com", + "networksolutions.com", "php.net", "python.org", "phoca.cz", "debian.org", "ubuntu.com", + "nazwa.pl", "symantec.com" + ] + + def createSslContexts(self): + if self.context_server and self.context_client: + return False + ciphers = "ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:AES128-SHA256:AES256-SHA:" + ciphers += "!aNULL:!eNULL:!EXPORT:!DSS:!DES:!RC4:!3DES:!MD5:!PSK" + + if hasattr(ssl, "PROTOCOL_TLS"): + protocol = ssl.PROTOCOL_TLS + else: + protocol = ssl.PROTOCOL_TLSv1_2 + self.context_client = ssl.SSLContext(protocol) + self.context_client.check_hostname = False + self.context_client.verify_mode = ssl.CERT_NONE + + self.context_server = ssl.SSLContext(protocol) + self.context_server.load_cert_chain(self.cert_pem, self.key_pem) + + for ctx in (self.context_client, self.context_server): + ctx.set_ciphers(ciphers) + ctx.options |= ssl.OP_NO_COMPRESSION + try: + ctx.set_alpn_protocols(["h2", "http/1.1"]) + ctx.set_npn_protocols(["h2", "http/1.1"]) + except Exception: + pass + # Select crypt that supported by both sides # Return: Name of the crypto def selectCrypt(self, client_supported): @@ -41,15 +89,10 @@ class CryptConnectionManager: # Return: wrapped socket def wrapSocket(self, sock, crypt, server=False, cert_pin=None): if crypt == "tls-rsa": - ciphers = "ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:AES128-SHA256:AES256-SHA:" - ciphers += "!aNULL:!eNULL:!EXPORT:!DSS:!DES:!RC4:!3DES:!MD5:!PSK" if server: - sock_wrapped = ssl.wrap_socket( - sock, server_side=server, keyfile=self.key_pem, - certfile=self.cert_pem, ciphers=ciphers - ) + sock_wrapped = self.context_server.wrap_socket(sock, server_side=True) else: - sock_wrapped = ssl.wrap_socket(sock, ciphers=ciphers) + sock_wrapped = self.context_client.wrap_socket(sock, server_hostname=random.choice(self.fakedomains)) if cert_pin: cert_hash = hashlib.sha256(sock_wrapped.getpeercert(True)).hexdigest() if cert_hash != cert_pin: @@ -83,42 +126,42 @@ class CryptConnectionManager: "/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA", "/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA" ] - fakedomains = [ - "yahoo.com", "amazon.com", "live.com", "microsoft.com", "mail.ru", "csdn.net", "bing.com", - "amazon.co.jp", "office.com", "imdb.com", "msn.com", "samsung.com", "huawei.com", "ztedevices.com", - "godaddy.com", "w3.org", "gravatar.com", "creativecommons.org", "hatena.ne.jp", - "adobe.com", "opera.com", "apache.org", "rambler.ru", "one.com", "nationalgeographic.com", - "networksolutions.com", "php.net", "python.org", "phoca.cz", "debian.org", "ubuntu.com", - "nazwa.pl", "symantec.com" - ] - self.openssl_env['CN'] = random.choice(fakedomains) + self.openssl_env['CN'] = random.choice(self.fakedomains) if os.path.isfile(self.cert_pem) and os.path.isfile(self.key_pem): + self.createSslContexts() return True # Files already exits import subprocess + # Replace variables in config template + conf_template = open(self.openssl_conf_template).read() + conf_template = conf_template.replace("$ENV::CN", self.openssl_env['CN']) + open(self.openssl_conf, "w").write(conf_template) + # Generate CAcert and CAkey cmd_params = helper.shellquote( self.openssl_bin, - self.openssl_env["OPENSSL_CONF"], + self.openssl_conf, random.choice(casubjects), self.cakey_pem, self.cacert_pem ) cmd = "%s req -new -newkey rsa:2048 -days 3650 -nodes -x509 -config %s -subj %s -keyout %s -out %s -batch" % cmd_params - logging.debug("Generating RSA CAcert and CAkey PEM files...") + self.log.debug("Generating RSA CAcert and CAkey PEM files...") + self.log.debug("Running: %s" % cmd) proc = subprocess.Popen( cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, env=self.openssl_env ) - back = proc.stdout.read().strip().decode().replace("\r", "") + back = proc.stdout.read().strip().decode(errors="replace").replace("\r", "") proc.wait() - logging.debug("%s\n%s" % (cmd, back)) if not (os.path.isfile(self.cacert_pem) and os.path.isfile(self.cakey_pem)): - logging.error("RSA ECC SSL CAcert generation failed, CAcert or CAkey files not exist.") + self.log.error("RSA ECC SSL CAcert generation failed, CAcert or CAkey files not exist. (%s)" % back) return False + else: + self.log.debug("Result: %s" % back) # Generate certificate key and signing request cmd_params = helper.shellquote( @@ -126,17 +169,17 @@ class CryptConnectionManager: self.key_pem, self.cert_csr, "/CN=" + self.openssl_env['CN'], - self.openssl_env["OPENSSL_CONF"], + self.openssl_conf, ) cmd = "%s req -new -newkey rsa:2048 -keyout %s -out %s -subj %s -sha256 -nodes -batch -config %s" % cmd_params - logging.debug("Generating certificate key and signing request...") + self.log.debug("Generating certificate key and signing request...") proc = subprocess.Popen( cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, env=self.openssl_env ) - back = proc.stdout.read().strip().decode().replace("\r", "") + back = proc.stdout.read().strip().decode(errors="replace").replace("\r", "") proc.wait() - logging.debug("%s\n%s" % (cmd, back)) + self.log.debug("Running: %s\n%s" % (cmd, back)) # Sign request and generate certificate cmd_params = helper.shellquote( @@ -145,21 +188,30 @@ class CryptConnectionManager: self.cacert_pem, self.cakey_pem, self.cert_pem, - self.openssl_env["OPENSSL_CONF"] + self.openssl_conf ) cmd = "%s x509 -req -in %s -CA %s -CAkey %s -set_serial 01 -out %s -days 730 -sha256 -extensions x509_ext -extfile %s" % cmd_params - logging.debug("Generating RSA cert...") + self.log.debug("Generating RSA cert...") proc = subprocess.Popen( cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, env=self.openssl_env ) - back = proc.stdout.read().strip().decode().replace("\r", "") + back = proc.stdout.read().strip().decode(errors="replace").replace("\r", "") proc.wait() - logging.debug("%s\n%s" % (cmd, back)) + self.log.debug("Running: %s\n%s" % (cmd, back)) if os.path.isfile(self.cert_pem) and os.path.isfile(self.key_pem): + self.createSslContexts() + + # Remove no longer necessary files + os.unlink(self.openssl_conf) + os.unlink(self.cacert_pem) + os.unlink(self.cakey_pem) + os.unlink(self.cert_csr) + return True else: - logging.error("RSA ECC SSL cert generation failed, cert or key files not exist.") + self.log.error("RSA ECC SSL cert generation failed, cert or key files not exist.") + manager = CryptConnectionManager() diff --git a/src/Db/Db.py b/src/Db/Db.py index 24c0e9f5..d1d9ce15 100644 --- a/src/Db/Db.py +++ b/src/Db/Db.py @@ -5,7 +5,10 @@ import logging import re import os import atexit +import threading import sys +import weakref +import errno import gevent @@ -13,7 +16,12 @@ from Debug import Debug from .DbCursor import DbCursor from util import SafeRe from util import helper +from util import ThreadPool +from Config import config +thread_pool_db = ThreadPool.ThreadPool(config.threads_db) + +next_db_id = 0 opened_dbs = [] @@ -24,7 +32,7 @@ def dbCleanup(): for db in opened_dbs[:]: idle = time.time() - db.last_query_time if idle > 60 * 5 and db.close_idle: - db.close() + db.close("Cleanup") def dbCommitCheck(): @@ -42,28 +50,36 @@ def dbCommitCheck(): def dbCloseAll(): for db in opened_dbs[:]: - db.close() + db.close("Close all") + gevent.spawn(dbCleanup) gevent.spawn(dbCommitCheck) atexit.register(dbCloseAll) + class DbTableError(Exception): def __init__(self, message, table): super().__init__(message) self.table = table + class Db(object): def __init__(self, schema, db_path, close_idle=False): + global next_db_id self.db_path = db_path self.db_dir = os.path.dirname(db_path) + "/" self.schema = schema self.schema["version"] = self.schema.get("version", 1) self.conn = None self.cur = None + self.cursors = weakref.WeakSet() + self.id = next_db_id + next_db_id += 1 self.progress_sleeping = False - self.log = logging.getLogger("Db:%s" % schema["db_name"]) + self.commiting = False + self.log = logging.getLogger("Db#%s:%s" % (self.id, schema["db_name"])) self.table_names = None self.collect_stats = False self.foreign_keys = False @@ -76,27 +92,51 @@ class Db(object): self.last_query_time = time.time() self.last_sleep_time = time.time() self.num_execute_since_sleep = 0 + self.lock = ThreadPool.Lock() + self.connect_lock = ThreadPool.Lock() def __repr__(self): return "" % (id(self), self.db_path, self.close_idle) def connect(self): - if self not in opened_dbs: - opened_dbs.append(self) - s = time.time() - if not os.path.isdir(self.db_dir): # Directory not exist yet - os.makedirs(self.db_dir) - self.log.debug("Created Db path: %s" % self.db_dir) - if not os.path.isfile(self.db_path): - self.log.debug("Db file not exist yet: %s" % self.db_path) - self.conn = sqlite3.connect(self.db_path, isolation_level="DEFERRED") - self.conn.row_factory = sqlite3.Row - self.conn.set_progress_handler(self.progress, 5000000) - self.cur = self.getCursor() - self.log.debug( - "Connected to %s in %.3fs (opened: %s, sqlite version: %s)..." % - (self.db_path, time.time() - s, len(opened_dbs), sqlite3.version) - ) + self.connect_lock.acquire(True) + try: + if self.conn: + self.log.debug("Already connected, connection ignored") + return + + if self not in opened_dbs: + opened_dbs.append(self) + s = time.time() + try: # Directory not exist yet + os.makedirs(self.db_dir) + self.log.debug("Created Db path: %s" % self.db_dir) + except OSError as err: + if err.errno != errno.EEXIST: + raise err + if not os.path.isfile(self.db_path): + self.log.debug("Db file not exist yet: %s" % self.db_path) + self.conn = sqlite3.connect(self.db_path, isolation_level="DEFERRED", check_same_thread=False) + self.conn.row_factory = sqlite3.Row + self.conn.set_progress_handler(self.progress, 5000000) + self.conn.execute('PRAGMA journal_mode=WAL') + if self.foreign_keys: + self.conn.execute("PRAGMA foreign_keys = ON") + self.cur = self.getCursor() + + self.log.debug( + "Connected to %s in %.3fs (opened: %s, sqlite version: %s)..." % + (self.db_path, time.time() - s, len(opened_dbs), sqlite3.version) + ) + self.log.debug("Connect by thread: %s" % threading.current_thread().ident) + self.log.debug("Connect called by %s" % Debug.formatStack()) + finally: + self.connect_lock.release() + + def getConn(self): + if not self.conn: + self.connect() + return self.conn def progress(self, *args, **kwargs): self.progress_sleeping = True @@ -109,19 +149,34 @@ class Db(object): self.connect() return self.cur.execute(query, params) + @thread_pool_db.wrap def commit(self, reason="Unknown"): if self.progress_sleeping: self.log.debug("Commit ignored: Progress sleeping") return False + if not self.conn: + self.log.debug("Commit ignored: No connection") + return False + + if self.commiting: + self.log.debug("Commit ignored: Already commiting") + return False + try: s = time.time() + self.commiting = True self.conn.commit() self.log.debug("Commited in %.3fs (reason: %s)" % (time.time() - s, reason)) return True except Exception as err: - self.log.error("Commit error: %s" % err) + if "SQL statements in progress" in str(err): + self.log.warning("Commit delayed: %s (reason: %s)" % (Debug.formatException(err), reason)) + else: + self.log.error("Commit error: %s (reason: %s)" % (Debug.formatException(err), reason)) return False + finally: + self.commiting = False def insertOrUpdate(self, *args, **kwargs): if not self.conn: @@ -158,21 +213,36 @@ class Db(object): self.delayed_queue = [] self.delayed_queue_thread = None - def close(self): + def close(self, reason="Unknown"): + if not self.conn: + return False + self.connect_lock.acquire() s = time.time() if self.delayed_queue: self.processDelayed() if self in opened_dbs: opened_dbs.remove(self) self.need_commit = False - self.commit("Closing") + self.commit("Closing: %s" % reason) + self.log.debug("Close called by %s" % Debug.formatStack()) + for i in range(5): + if len(self.cursors) == 0: + break + self.log.debug("Pending cursors: %s" % len(self.cursors)) + time.sleep(0.1 * i) + if len(self.cursors): + self.log.debug("Killing cursors: %s" % len(self.cursors)) + self.conn.interrupt() + if self.cur: self.cur.close() if self.conn: - self.conn.close() + ThreadPool.main_loop.call(self.conn.close) self.conn = None self.cur = None - self.log.debug("%s closed in %.3fs, opened: %s" % (self.db_path, time.time() - s, len(opened_dbs))) + self.log.debug("%s closed (reason: %s) in %.3fs, opened: %s" % (self.db_path, reason, time.time() - s, len(opened_dbs))) + self.connect_lock.release() + return True # Gets a cursor object to database # Return: Cursor class @@ -180,11 +250,7 @@ class Db(object): if not self.conn: self.connect() - cur = DbCursor(self.conn, self) - cur.execute('PRAGMA journal_mode=WAL') - if self.foreign_keys: - cur.execute("PRAGMA foreign_keys = ON") - + cur = DbCursor(self) return cur def getSharedCursor(self): @@ -271,7 +337,6 @@ class Db(object): except Exception as err: self.log.error("Error creating table %s: %s" % (table_name, Debug.formatException(err))) raise DbTableError(err, table_name) - #return False self.log.debug("Db check done in %.3fs, changed tables: %s" % (time.time() - s, changed_tables)) if changed_tables: diff --git a/src/Db/DbCursor.py b/src/Db/DbCursor.py index 2c41c2c1..acb8846d 100644 --- a/src/Db/DbCursor.py +++ b/src/Db/DbCursor.py @@ -1,18 +1,14 @@ import time import re -import gevent from util import helper - # Special sqlite cursor class DbCursor: - def __init__(self, conn, db): - self.conn = conn + def __init__(self, db): self.db = db - self.cursor = conn.cursor() self.logging = False def quoteValue(self, value): @@ -87,26 +83,37 @@ class DbCursor: return query, params def execute(self, query, params=None): - if query.upper().strip("; ") == "VACUUM": - self.db.commit("vacuum called") query = query.strip() - while self.db.progress_sleeping: + while self.db.progress_sleeping or self.db.commiting: time.sleep(0.1) self.db.last_query_time = time.time() query, params = self.parseQuery(query, params) - s = time.time() + cursor = self.db.getConn().cursor() + self.db.cursors.add(cursor) + if self.db.lock.locked(): + self.db.log.debug("Locked for %.3fs" % (time.time() - self.db.lock.time_lock)) - if params: # Query has parameters - res = self.cursor.execute(query, params) - if self.logging: - self.db.log.debug(query + " " + str(params) + " (Done in %.4f)" % (time.time() - s)) - else: - res = self.cursor.execute(query) - if self.logging: - self.db.log.debug(query + " (Done in %.4f)" % (time.time() - s)) + try: + s = time.time() + self.db.lock.acquire(True) + if query.upper().strip("; ") == "VACUUM": + self.db.commit("vacuum called") + if params: + res = cursor.execute(query, params) + else: + res = cursor.execute(query) + finally: + self.db.lock.release() + + taken_query = time.time() - s + if self.logging or taken_query > 1: + if params: # Query has parameters + self.db.log.debug("Query: " + query + " " + str(params) + " (Done in %.4f)" % (time.time() - s)) + else: + self.db.log.debug("Query: " + query + " (Done in %.4f)" % (time.time() - s)) # Log query stats if self.db.collect_stats: @@ -115,12 +122,39 @@ class DbCursor: self.db.query_stats[query]["call"] += 1 self.db.query_stats[query]["time"] += time.time() - s - if not self.db.need_commit: - query_type = query.split(" ", 1)[0].upper() - if query_type in ["UPDATE", "DELETE", "INSERT", "CREATE"]: - self.db.need_commit = True + query_type = query.split(" ", 1)[0].upper() + is_update_query = query_type in ["UPDATE", "DELETE", "INSERT", "CREATE"] + if not self.db.need_commit and is_update_query: + self.db.need_commit = True - return res + if is_update_query: + return cursor + else: + return res + + def executemany(self, query, params): + while self.db.progress_sleeping or self.db.commiting: + time.sleep(0.1) + + self.db.last_query_time = time.time() + + s = time.time() + cursor = self.db.getConn().cursor() + self.db.cursors.add(cursor) + + try: + self.db.lock.acquire(True) + cursor.executemany(query, params) + finally: + self.db.lock.release() + + taken_query = time.time() - s + if self.logging or taken_query > 0.1: + self.db.log.debug("Execute many: %s (Done in %.4f)" % (query, taken_query)) + + self.db.need_commit = True + + return cursor # Creates on updates a database row without incrementing the rowid def insertOrUpdate(self, table, query_sets, query_wheres, oninsert={}): @@ -129,11 +163,11 @@ class DbCursor: params = query_sets params.update(query_wheres) - self.execute( + res = self.execute( "UPDATE %s SET %s WHERE %s" % (table, ", ".join(sql_sets), " AND ".join(sql_wheres)), params ) - if self.cursor.rowcount == 0: + if res.rowcount == 0: params.update(oninsert) # Add insert-only fields self.execute("INSERT INTO %s ?" % table, params) @@ -163,7 +197,7 @@ class DbCursor: def needTable(self, table, cols, indexes=None, version=1): current_version = self.db.getTableVersion(table) if int(current_version) < int(version): # Table need update or not extis - self.db.log.info("Table %s outdated...version: %s need: %s, rebuilding..." % (table, current_version, version)) + self.db.log.debug("Table %s outdated...version: %s need: %s, rebuilding..." % (table, current_version, version)) self.createTable(table, cols) if indexes: self.createIndexes(table, indexes) @@ -209,4 +243,4 @@ class DbCursor: return row def close(self): - self.cursor.close() + pass diff --git a/src/Debug/Debug.py b/src/Debug/Debug.py index 4c4099f7..10a4d627 100644 --- a/src/Debug/Debug.py +++ b/src/Debug/Debug.py @@ -15,46 +15,83 @@ class Notify(Exception): def formatExceptionMessage(err): err_type = err.__class__.__name__ - err_message = str(err.args[-1]) + if err.args: + err_message = err.args[-1] + else: + err_message = err.__str__() return "%s: %s" % (err_type, err_message) +python_lib_dir = os.path.dirname(os.__file__) + + +def formatTraceback(items, limit=None, fold_builtin=True): + back = [] + i = 0 + prev_file_title = "" + is_prev_builtin = False + + for path, line in items: + i += 1 + is_last = i == len(items) + dir_name, file_name = os.path.split(path.replace("\\", "/")) + + plugin_match = re.match(".*/plugins/(.+)$", dir_name) + if plugin_match: + file_title = "%s/%s" % (plugin_match.group(1), file_name) + is_prev_builtin = False + elif path.startswith(python_lib_dir): + if is_prev_builtin and not is_last and fold_builtin: + if back[-1] != "...": + back.append("...") + continue + else: + file_title = path.replace(python_lib_dir, "").replace("\\", "/").strip("/").replace("site-packages/", "") + is_prev_builtin = True + else: + file_title = file_name + is_prev_builtin = False + + if file_title == prev_file_title: + back.append("%s" % line) + else: + back.append("%s line %s" % (file_title, line)) + + prev_file_title = file_title + + if limit and i >= limit: + back.append("...") + break + return back + + def formatException(err=None, format="text"): import traceback if type(err) == Notify: return err - elif type(err) == tuple and err[0] is not None: # Passed trackeback info + elif type(err) == tuple and err and err[0] is not None: # Passed trackeback info exc_type, exc_obj, exc_tb = err err = None else: # No trackeback info passed, get latest exc_type, exc_obj, exc_tb = sys.exc_info() if not err: - err = exc_obj.message - tb = [] - for frame in traceback.extract_tb(exc_tb): - path, line, function, text = frame - dir_name, file_name = os.path.split(path.replace("\\", "/")) - plugin_match = re.match(".*/plugins/(.+)$", dir_name) - if plugin_match: - file_title = "%s/%s" % (plugin_match.group(1), file_name) + if hasattr(err, "message"): + err = exc_obj.message else: - file_title = file_name - tb.append("%s line %s" % (file_title, line)) + err = exc_obj + + tb = formatTraceback([[frame[0], frame[1]] for frame in traceback.extract_tb(exc_tb)]) if format == "html": - return "%s: %s
    %s" % (exc_type.__name__, err, " > ".join(tb)) + return "%s: %s
    %s" % (repr(err), err, " > ".join(tb)) else: return "%s: %s in %s" % (exc_type.__name__, err, " > ".join(tb)) -def formatStack(): +def formatStack(limit=None): import inspect - back = [] - for stack in inspect.stack(): - frame, path, line, function, source, index = stack - file = os.path.split(path)[1] - back.append("%s line %s" % (file, line)) - return " > ".join(back) + tb = formatTraceback([[frame[1], frame[2]] for frame in inspect.stack()[1:]], limit=limit) + return " > ".join(tb) # Test if gevent eventloop blocks @@ -63,13 +100,16 @@ import gevent import time +num_block = 0 def testBlock(): + global num_block logging.debug("Gevent block checker started") last_time = time.time() while 1: time.sleep(1) if time.time() - last_time > 1.1: - logging.debug("Gevent block detected: %s" % (time.time() - last_time - 1)) + logging.debug("Gevent block detected: %.3fs" % (time.time() - last_time - 1)) + num_block += 1 last_time = time.time() gevent.spawn(testBlock) diff --git a/src/Debug/DebugHook.py b/src/Debug/DebugHook.py index 5ae49121..d100a3b8 100644 --- a/src/Debug/DebugHook.py +++ b/src/Debug/DebugHook.py @@ -50,7 +50,7 @@ def handleErrorNotify(*args, **kwargs): if err.__name__ == "KeyboardInterrupt": shutdown("Keyboard interrupt") elif err.__name__ != "Notify": - logging.error("Unhandled exception: %s" % [args]) + logging.error("Unhandled exception: %s" % Debug.formatException(args)) sys.__excepthook__(*args, **kwargs) @@ -73,15 +73,20 @@ else: gevent.Greenlet = gevent.greenlet.Greenlet = ErrorhookedGreenlet importlib.reload(gevent) -def handleGreenletError(self, context, type, value, tb): +def handleGreenletError(context, type, value, tb): + if context.__class__ is tuple and context[0].__class__.__name__ == "ThreadPool": + # Exceptions in ThreadPool will be handled in the main Thread + return None + if isinstance(value, str): # Cython can raise errors where the value is a plain string # e.g., AttributeError, "_semaphore.Semaphore has no attr", value = type(value) - if not issubclass(type, self.NOT_ERROR): + + if not issubclass(type, gevent.get_hub().NOT_ERROR): sys.excepthook(type, value, tb) -gevent.hub.Hub.handle_error = handleGreenletError +gevent.get_hub().handle_error = handleGreenletError try: signal.signal(signal.SIGTERM, lambda signum, stack_frame: shutdown("SIGTERM")) diff --git a/src/Debug/DebugLock.py b/src/Debug/DebugLock.py new file mode 100644 index 00000000..9cf22520 --- /dev/null +++ b/src/Debug/DebugLock.py @@ -0,0 +1,24 @@ +import time +import logging + +import gevent.lock + +from Debug import Debug + + +class DebugLock: + def __init__(self, log_after=0.01, name="Lock"): + self.name = name + self.log_after = log_after + self.lock = gevent.lock.Semaphore(1) + self.release = self.lock.release + + def acquire(self, *args, **kwargs): + s = time.time() + res = self.lock.acquire(*args, **kwargs) + time_taken = time.time() - s + if time_taken >= self.log_after: + logging.debug("%s: Waited %.3fs after called by %s" % + (self.name, time_taken, Debug.formatStack()) + ) + return res diff --git a/src/Debug/DebugMedia.py b/src/Debug/DebugMedia.py index a24203b9..a892dc56 100644 --- a/src/Debug/DebugMedia.py +++ b/src/Debug/DebugMedia.py @@ -45,6 +45,7 @@ def findCoffeescriptCompiler(): # Generates: all.js: merge *.js, compile coffeescript, all.css: merge *.css, vendor prefix features def merge(merged_path): + merged_path = merged_path.replace("\\", "/") merge_dir = os.path.dirname(merged_path) s = time.time() ext = merged_path.split(".")[-1] @@ -77,9 +78,10 @@ def merge(merged_path): parts = [] s_total = time.time() for file_path in findfiles(merge_dir, find_ext): - parts.append(b"\n/* ---- %s ---- */\n\n" % file_path.replace(config.data_dir, "").encode("utf8")) + file_relative_path = file_path.replace(merge_dir + "/", "") + parts.append(b"\n/* ---- %s ---- */\n\n" % file_relative_path.encode("utf8")) if file_path.endswith(".coffee"): # Compile coffee script - if file_path in changed or file_path.replace(config.data_dir, "") not in old_parts: # Only recompile if changed or its not compiled before + if file_path in changed or file_relative_path not in old_parts: # Only recompile if changed or its not compiled before if config.coffeescript_compiler is None: config.coffeescript_compiler = findCoffeescriptCompiler() if not config.coffeescript_compiler: @@ -90,7 +92,7 @@ def merge(merged_path): file_path_escaped = helper.shellquote(file_path.replace("/", os.path.sep)) if "%s" in config.coffeescript_compiler: # Replace %s with coffeescript file - command = config.coffeescript_compiler % file_path_escaped + command = config.coffeescript_compiler.replace("%s", file_path_escaped) else: # Put coffeescript file to end command = config.coffeescript_compiler + " " + file_path_escaped @@ -106,14 +108,14 @@ def merge(merged_path): parts.append(out) else: # Put error message in place of source code error = out - logging.error("%s Compile error: %s" % (file_path, error)) + logging.error("%s Compile error: %s" % (file_relative_path, error)) error_escaped = re.escape(error).replace(b"\n", b"\\n").replace(br"\\n", br"\n") parts.append( b"alert('%s compile error: %s');" % - (file_path.encode(), error_escaped) + (file_relative_path.encode(), error_escaped) ) else: # Not changed use the old_part - parts.append(old_parts[file_path.replace(config.data_dir, "")]) + parts.append(old_parts[file_relative_path]) else: # Add to parts parts.append(open(file_path, "rb").read()) diff --git a/src/Debug/DebugReloader.py b/src/Debug/DebugReloader.py index 29ca7029..482c7921 100644 --- a/src/Debug/DebugReloader.py +++ b/src/Debug/DebugReloader.py @@ -19,7 +19,9 @@ else: class DebugReloader: - def __init__(self, paths=["src", "plugins"]): + def __init__(self, paths=None): + if not paths: + paths = ["src", "plugins", config.data_dir + "/__plugins__"] self.log = logging.getLogger("DebugReloader") self.last_chaged = 0 self.callbacks = [] @@ -29,6 +31,8 @@ class DebugReloader: event_handler.on_modified = event_handler.on_deleted = self.onChanged event_handler.on_created = event_handler.on_moved = self.onChanged for path in paths: + if not os.path.isdir(path): + continue self.log.debug("Adding autoreload: %s" % path) self.observer.schedule(event_handler, path, recursive=True) self.observer.start() @@ -42,7 +46,10 @@ class DebugReloader: if ext not in ["py", "json"] or "Test" in path or time.time() - self.last_chaged < 1.0: return False self.last_chaged = time.time() - time_modified = os.path.getmtime(path) + if os.path.isfile(path): + time_modified = os.path.getmtime(path) + else: + time_modified = 0 self.log.debug("File changed: %s reloading source code (modified %.3fs ago)" % (evt, time.time() - time_modified)) if time.time() - time_modified > 5: # Probably it's just an attribute change, ignore it return False diff --git a/src/File/FileRequest.py b/src/File/FileRequest.py index 0846a714..65c335a9 100644 --- a/src/File/FileRequest.py +++ b/src/File/FileRequest.py @@ -122,12 +122,12 @@ class FileRequest(object): should_validate_content = False valid = None # Same or earlier content as we have elif not body: # No body sent, we have to download it first - self.log.debug("Missing body from update, downloading...") + site.log.debug("Missing body from update for file %s, downloading ..." % inner_path) peer = site.addPeer(self.connection.ip, self.connection.port, return_peer=True, source="update") # Add or get peer try: body = peer.getFile(site.address, inner_path).read() except Exception as err: - self.log.debug("Can't download updated file %s: %s" % (inner_path, err)) + site.log.debug("Can't download updated file %s: %s" % (inner_path, err)) self.response({"error": "File invalid update: Can't download updaed file"}) self.connection.badAction(5) return @@ -136,7 +136,7 @@ class FileRequest(object): try: content = json.loads(body.decode()) except Exception as err: - self.log.debug("Update for %s is invalid JSON: %s" % (inner_path, err)) + site.log.debug("Update for %s is invalid JSON: %s" % (inner_path, err)) self.response({"error": "File invalid JSON"}) self.connection.badAction(5) return @@ -149,7 +149,7 @@ class FileRequest(object): try: valid = site.content_manager.verifyFile(inner_path, content) except Exception as err: - self.log.debug("Update for %s is invalid: %s" % (inner_path, err)) + site.log.debug("Update for %s is invalid: %s" % (inner_path, err)) error = err valid = False @@ -187,7 +187,7 @@ class FileRequest(object): if inner_path in site.content_manager.contents: peer.last_content_json_update = site.content_manager.contents[inner_path]["modified"] if config.verbose: - self.log.debug( + site.log.debug( "Same version, adding new peer for locked files: %s, tasks: %s" % (peer.key, len(site.worker_manager.tasks)) ) @@ -269,7 +269,7 @@ class FileRequest(object): return {"bytes_sent": bytes_sent, "file_size": file_size, "location": params["location"]} except RequestError as err: - self.log.debug("GetFile %s %s request error: %s" % (self.connection, params["inner_path"], Debug.formatException(err))) + self.log.debug("GetFile %s %s %s request error: %s" % (self.connection, params["site"], params["inner_path"], Debug.formatException(err))) self.response({"error": "File read error: %s" % err}) except OSError as err: if config.verbose: diff --git a/src/File/FileServer.py b/src/File/FileServer.py index 5f1d9b47..68be3a4b 100644 --- a/src/File/FileServer.py +++ b/src/File/FileServer.py @@ -2,6 +2,7 @@ import logging import time import random import socket +import sys import gevent import gevent.pool @@ -64,7 +65,7 @@ class FileServer(ConnectionServer): self.port_opened = {} - self.sites = {} + self.sites = self.site_manager.sites self.last_request = time.time() self.files_parsing = {} self.ui_server = None @@ -108,7 +109,7 @@ class FileServer(ConnectionServer): self.log.debug("IPv6 supported on IP %s" % local_ipv6) return True except socket.error as err: - self.log.error("IPv6 not supported: %s" % err) + self.log.warning("IPv6 not supported: %s" % err) return False except Exception as err: self.log.error("IPv6 check error: %s" % err) @@ -346,7 +347,20 @@ class FileServer(ConnectionServer): # Bind and start serving sites def start(self, check_sites=True): + if self.stopping: + return False + ConnectionServer.start(self) + + try: + self.stream_server.start() + except Exception as err: + self.log.error("Error listening on: %s:%s: %s" % (self.ip, self.port, err)) + if "ui_server" in dir(sys.modules["main"]): + self.log.debug("Stopping UI Server.") + sys.modules["main"].ui_server.stop() + return False + self.sites = self.site_manager.list() if config.debug: # Auto reload FileRequest on change diff --git a/src/Peer/Peer.py b/src/Peer/Peer.py index b5b22436..03cc1f47 100644 --- a/src/Peer/Peer.py +++ b/src/Peer/Peer.py @@ -115,7 +115,10 @@ class Peer(object): return self.connection def __str__(self): - return "Peer:%-12s" % self.ip + if self.site: + return "Peer:%-12s of %s" % (self.ip, self.site.address_short) + else: + return "Peer:%-12s" % self.ip def __repr__(self): return "<%s>" % self.__str__() @@ -130,9 +133,12 @@ class Peer(object): def found(self, source="other"): if self.reputation < 5: if source == "tracker": - self.reputation += 1 + if self.ip.endswith(".onion"): + self.reputation += 1 + else: + self.reputation += 2 elif source == "local": - self.reputation += 3 + self.reputation += 20 if source in ("tracker", "local"): self.site.peers_recent.appendleft(self) @@ -339,7 +345,10 @@ class Peer(object): back[hash] += list(map(unpacker_func, peers)) for hash in res.get("my", []): - back[hash].append((self.connection.ip, self.connection.port)) + if self.connection: + back[hash].append((self.connection.ip, self.connection.port)) + else: + back[hash].append((self.ip, self.port)) return back diff --git a/src/Plugin/PluginManager.py b/src/Plugin/PluginManager.py index fbf37d3c..dbafa98f 100644 --- a/src/Plugin/PluginManager.py +++ b/src/Plugin/PluginManager.py @@ -5,62 +5,142 @@ import shutil import time from collections import defaultdict +import importlib +import json + from Debug import Debug from Config import config - import plugins -import importlib - class PluginManager: def __init__(self): self.log = logging.getLogger("PluginManager") - self.plugin_path = os.path.abspath(os.path.dirname(plugins.__file__)) + self.path_plugins = os.path.abspath(os.path.dirname(plugins.__file__)) + self.path_installed_plugins = config.data_dir + "/__plugins__" self.plugins = defaultdict(list) # Registered plugins (key: class name, value: list of plugins for class) self.subclass_order = {} # Record the load order of the plugins, to keep it after reload self.pluggable = {} self.plugin_names = [] # Loaded plugin names - self.after_load = [] # Execute functions after loaded plugins + self.plugins_updated = {} # List of updated plugins since restart + self.plugins_rev = {} # Installed plugins revision numbers + self.after_load = [] # Execute functions after loaded plugins + self.function_flags = {} # Flag function for permissions self.reloading = False + self.config_path = config.data_dir + "/plugins.json" + self.loadConfig() - sys.path.append(os.path.join(os.getcwd(), self.plugin_path)) + self.config.setdefault("builtin", {}) + + sys.path.append(os.path.join(os.getcwd(), self.path_plugins)) self.migratePlugins() if config.debug: # Auto reload Plugins on file change from Debug import DebugReloader DebugReloader.watcher.addCallback(self.reloadPlugins) + def loadConfig(self): + if os.path.isfile(self.config_path): + try: + self.config = json.load(open(self.config_path, encoding="utf8")) + except Exception as err: + self.log.error("Error loading %s: %s" % (self.config_path, err)) + self.config = {} + else: + self.config = {} + + def saveConfig(self): + f = open(self.config_path, "w", encoding="utf8") + json.dump(self.config, f, ensure_ascii=False, sort_keys=True, indent=2) + def migratePlugins(self): - for dir_name in os.listdir(self.plugin_path): + for dir_name in os.listdir(self.path_plugins): if dir_name == "Mute": self.log.info("Deleting deprecated/renamed plugin: %s" % dir_name) - shutil.rmtree("%s/%s" % (self.plugin_path, dir_name)) + shutil.rmtree("%s/%s" % (self.path_plugins, dir_name)) # -- Load / Unload -- + def listPlugins(self, list_disabled=False): + plugins = [] + for dir_name in sorted(os.listdir(self.path_plugins)): + dir_path = os.path.join(self.path_plugins, dir_name) + plugin_name = dir_name.replace("disabled-", "") + if dir_name.startswith("disabled"): + is_enabled = False + else: + is_enabled = True + + plugin_config = self.config["builtin"].get(plugin_name, {}) + if "enabled" in plugin_config: + is_enabled = plugin_config["enabled"] + + if dir_name == "__pycache__" or not os.path.isdir(dir_path): + continue # skip + if dir_name.startswith("Debug") and not config.debug: + continue # Only load in debug mode if module name starts with Debug + if not is_enabled and not list_disabled: + continue # Dont load if disabled + + plugin = {} + plugin["source"] = "builtin" + plugin["name"] = plugin_name + plugin["dir_name"] = dir_name + plugin["dir_path"] = dir_path + plugin["inner_path"] = plugin_name + plugin["enabled"] = is_enabled + plugin["rev"] = config.rev + plugin["loaded"] = plugin_name in self.plugin_names + plugins.append(plugin) + + plugins += self.listInstalledPlugins(list_disabled) + return plugins + + def listInstalledPlugins(self, list_disabled=False): + plugins = [] + + for address, site_plugins in sorted(self.config.items()): + if address == "builtin": + continue + for plugin_inner_path, plugin_config in sorted(site_plugins.items()): + is_enabled = plugin_config.get("enabled", False) + if not is_enabled and not list_disabled: + continue + plugin_name = os.path.basename(plugin_inner_path) + + dir_path = "%s/%s/%s" % (self.path_installed_plugins, address, plugin_inner_path) + + plugin = {} + plugin["source"] = address + plugin["name"] = plugin_name + plugin["dir_name"] = plugin_name + plugin["dir_path"] = dir_path + plugin["inner_path"] = plugin_inner_path + plugin["enabled"] = is_enabled + plugin["rev"] = plugin_config.get("rev", 0) + plugin["loaded"] = plugin_name in self.plugin_names + plugins.append(plugin) + + return plugins + # Load all plugin def loadPlugins(self): all_loaded = True s = time.time() - for dir_name in sorted(os.listdir(self.plugin_path)): - dir_path = os.path.join(self.plugin_path, dir_name) - if dir_name == "__pycache__": - continue # skip - if dir_name.startswith("disabled"): - continue # Dont load if disabled - if not os.path.isdir(dir_path): - continue # Dont load if not dir - if dir_name.startswith("Debug") and not config.debug: - continue # Only load in debug mode if module name starts with Debug - self.log.debug("Loading plugin: %s" % dir_name) + for plugin in self.listPlugins(): + self.log.debug("Loading plugin: %s (%s)" % (plugin["name"], plugin["source"])) + if plugin["source"] != "builtin": + self.plugins_rev[plugin["name"]] = plugin["rev"] + site_plugin_dir = os.path.dirname(plugin["dir_path"]) + if site_plugin_dir not in sys.path: + sys.path.append(site_plugin_dir) try: - __import__(dir_name) + sys.modules[plugin["name"]] = __import__(plugin["dir_name"]) except Exception as err: - self.log.error("Plugin %s load error: %s" % (dir_name, Debug.formatException(err))) + self.log.error("Plugin %s load error: %s" % (plugin["name"], Debug.formatException(err))) all_loaded = False - if dir_name not in self.plugin_names: - self.plugin_names.append(dir_name) + if plugin["name"] not in self.plugin_names: + self.plugin_names.append(plugin["name"]) self.log.debug("Plugins loaded in %.3fs" % (time.time() - s)) for func in self.after_load: @@ -74,19 +154,23 @@ class PluginManager: self.plugins_before = self.plugins self.plugins = defaultdict(list) # Reset registered plugins for module_name, module in list(sys.modules.items()): - if module and getattr(module, "__file__", None) and self.plugin_path in module.__file__: # Module file in plugin_path - if "allow_reload" in dir(module) and not module.allow_reload: # Reload disabled - # Re-add non-reloadable plugins - for class_name, classes in self.plugins_before.items(): - for c in classes: - if c.__module__ != module.__name__: - continue - self.plugins[class_name].append(c) - else: - try: - importlib.reload(module) - except Exception as err: - self.log.error("Plugin %s reload error: %s" % (module_name, Debug.formatException(err))) + if not module or not getattr(module, "__file__", None): + continue + if self.path_plugins not in module.__file__ and self.path_installed_plugins not in module.__file__: + continue + + if "allow_reload" in dir(module) and not module.allow_reload: # Reload disabled + # Re-add non-reloadable plugins + for class_name, classes in self.plugins_before.items(): + for c in classes: + if c.__module__ != module.__name__: + continue + self.plugins[class_name].append(c) + else: + try: + importlib.reload(module) + except Exception as err: + self.log.error("Plugin %s reload error: %s" % (module_name, Debug.formatException(err))) self.loadPlugins() # Load new plugins diff --git a/src/Site/Site.py b/src/Site/Site.py index 7b4f5ec3..32f10abe 100644 --- a/src/Site/Site.py +++ b/src/Site/Site.py @@ -22,6 +22,7 @@ from .SiteStorage import SiteStorage from Crypt import CryptHash from util import helper from util import Diff +from util import GreenletManager from Plugin import PluginManager from File import FileServer from .SiteAnnouncer import SiteAnnouncer @@ -41,8 +42,9 @@ class Site(object): self.content = None # Load content.json self.peers = {} # Key: ip:port, Value: Peer.Peer - self.peers_recent = collections.deque(maxlen=100) + self.peers_recent = collections.deque(maxlen=150) self.peer_blacklist = SiteManager.peer_blacklist # Ignore this peers (eg. myself) + self.greenlet_manager = GreenletManager.GreenletManager() # Running greenlets self.worker_manager = WorkerManager(self) # Handle site download from other peers self.bad_files = {} # SHA check failed files, need to redownload {"inner.content": 1} (key: file, value: failed accept) self.content_updated = None # Content.js update time @@ -125,7 +127,7 @@ class Site(object): if not SiteManager.site_manager.sites.get(self.address): SiteManager.site_manager.sites[self.address] = self SiteManager.site_manager.load(False) - SiteManager.site_manager.save() + SiteManager.site_manager.saveDelayed() def isServing(self): if config.offline: @@ -156,7 +158,10 @@ class Site(object): def downloadContent(self, inner_path, download_files=True, peer=None, check_modifications=False, diffs={}): s = time.time() if config.verbose: - self.log.debug("Downloading %s..." % inner_path) + self.log.debug( + "DownloadContent %s: Started. (download_files: %s, check_modifications: %s, diffs: %s)..." % + (inner_path, download_files, check_modifications, diffs.keys()) + ) if not inner_path.endswith("content.json"): return False @@ -164,21 +169,35 @@ class Site(object): found = self.needFile(inner_path, update=self.bad_files.get(inner_path)) content_inner_dir = helper.getDirname(inner_path) if not found: - self.log.debug("Download %s failed, check_modifications: %s" % (inner_path, check_modifications)) + self.log.debug("DownloadContent %s: Download failed, check_modifications: %s" % (inner_path, check_modifications)) if check_modifications: # Download failed, but check modifications if its succed later self.onFileDone.once(lambda file_name: self.checkModifications(0), "check_modifications") return False # Could not download content.json if config.verbose: - self.log.debug("Got %s" % inner_path) + self.log.debug("DownloadContent got %s" % inner_path) + sub_s = time.time() + changed, deleted = self.content_manager.loadContent(inner_path, load_includes=False) + if config.verbose: + self.log.debug("DownloadContent %s: loadContent done in %.3fs" % (inner_path, time.time() - sub_s)) + if inner_path == "content.json": self.saveSettings() if peer: # Update last received update from peer to prevent re-sending the same update to it peer.last_content_json_update = self.content_manager.contents[inner_path]["modified"] + # Verify size limit + if inner_path == "content.json": + site_size_limit = self.getSizeLimit() * 1024 * 1024 + content_size = len(json.dumps(self.content_manager.contents[inner_path], indent=1)) + sum([file["size"] for file in list(self.content_manager.contents[inner_path].get("files", {}).values()) if file["size"] >= 0]) # Size of new content + if site_size_limit < content_size: + # Not enought don't download anything + self.log.debug("DownloadContent Size limit reached (site too big please increase limit): %.2f MB > %.2f MB" % (content_size / 1024 / 1024, site_size_limit / 1024 / 1024)) + return False + # Start download files file_threads = [] if download_files: @@ -210,11 +229,11 @@ class Site(object): time_on_done = time.time() - s self.log.debug( - "Patched successfully: %s (diff: %.3fs, verify: %.3fs, write: %.3fs, on_done: %.3fs)" % + "DownloadContent Patched successfully: %s (diff: %.3fs, verify: %.3fs, write: %.3fs, on_done: %.3fs)" % (file_inner_path, time_diff, time_verify, time_write, time_on_done) ) except Exception as err: - self.log.debug("Failed to patch %s: %s" % (file_inner_path, err)) + self.log.debug("DownloadContent Failed to patch %s: %s" % (file_inner_path, err)) diff_success = False if not diff_success: @@ -248,22 +267,21 @@ class Site(object): include_threads.append(include_thread) if config.verbose: - self.log.debug("%s: Downloading %s includes..." % (inner_path, len(include_threads))) + self.log.debug("DownloadContent %s: Downloading %s includes..." % (inner_path, len(include_threads))) gevent.joinall(include_threads) if config.verbose: - self.log.debug("%s: Includes download ended" % inner_path) + self.log.debug("DownloadContent %s: Includes download ended" % inner_path) if check_modifications: # Check if every file is up-to-date self.checkModifications(0) if config.verbose: - self.log.debug("%s: Downloading %s files, changed: %s..." % (inner_path, len(file_threads), len(changed))) + self.log.debug("DownloadContent %s: Downloading %s files, changed: %s..." % (inner_path, len(file_threads), len(changed))) gevent.joinall(file_threads) if config.verbose: - self.log.debug("%s: DownloadContent ended in %.3fs" % (inner_path, time.time() - s)) - - if not self.worker_manager.tasks: - self.onComplete() # No more task trigger site complete + self.log.debug("DownloadContent %s: ended in %.3fs (tasks left: %s)" % ( + inner_path, time.time() - s, len(self.worker_manager.tasks) + )) return True @@ -308,14 +326,15 @@ class Site(object): # Download all files of the site @util.Noparallel(blocking=False) - def download(self, check_size=False, blind_includes=False): + def download(self, check_size=False, blind_includes=False, retry_bad_files=True): if not self.connection_server: self.log.debug("No connection server found, skipping download") return False + s = time.time() self.log.debug( - "Start downloading, bad_files: %s, check_size: %s, blind_includes: %s" % - (self.bad_files, check_size, blind_includes) + "Start downloading, bad_files: %s, check_size: %s, blind_includes: %s, called by: %s" % + (self.bad_files, check_size, blind_includes, Debug.formatStack()) ) gevent.spawn(self.announce, force=True) if check_size: # Check the size first @@ -326,7 +345,9 @@ class Site(object): # Download everything valid = self.downloadContent("content.json", check_modifications=blind_includes) - self.onComplete.once(lambda: self.retryBadFiles(force=True)) + if retry_bad_files: + self.onComplete.once(lambda: self.retryBadFiles(force=True)) + self.log.debug("Download done in %.3fs" % (time.time() - s)) return valid @@ -349,6 +370,7 @@ class Site(object): del self.bad_files[aborted_inner_path] self.worker_manager.removeSolvedFileTasks(mark_as_good=False) break + pool.join() self.log.debug("Ended downloadContent pool len: %s, skipped: %s" % (len(inner_paths), num_skipped)) def pooledDownloadFile(self, inner_paths, pool_size=100, only_if_bad=False): @@ -366,12 +388,13 @@ class Site(object): # Update worker, try to find client that supports listModifications command def updater(self, peers_try, queried, since): + threads = [] while 1: if not peers_try or len(queried) >= 3: # Stop after 3 successful query break peer = peers_try.pop(0) if config.verbose: - self.log.debug("Try to get updates from: %s Left: %s" % (peer, peers_try)) + self.log.debug("CheckModifications: Try to get updates from: %s Left: %s" % (peer, peers_try)) res = None with gevent.Timeout(20, exception=False): @@ -383,6 +406,7 @@ class Site(object): queried.append(peer) modified_contents = [] my_modified = self.content_manager.listModified(since) + num_old_files = 0 for inner_path, modified in res["modified_files"].items(): # Check if the peer has newer files than we has_newer = int(modified) > my_modified.get(inner_path, 0) has_older = int(modified) < my_modified.get(inner_path, 0) @@ -391,13 +415,18 @@ class Site(object): # We dont have this file or we have older modified_contents.append(inner_path) self.bad_files[inner_path] = self.bad_files.get(inner_path, 0) + 1 - if has_older: - self.log.debug("%s client has older version of %s, publishing there..." % (peer, inner_path)) + if has_older and num_old_files < 5: + num_old_files += 1 + self.log.debug("CheckModifications: %s client has older version of %s, publishing there (%s/5)..." % (peer, inner_path, num_old_files)) gevent.spawn(self.publisher, inner_path, [peer], [], 1) if modified_contents: - self.log.debug("%s new modified file from %s" % (len(modified_contents), peer)) + self.log.debug("CheckModifications: %s new modified file from %s" % (len(modified_contents), peer)) modified_contents.sort(key=lambda inner_path: 0 - res["modified_files"][inner_path]) # Download newest first - gevent.spawn(self.pooledDownloadContent, modified_contents, only_if_bad=True) + t = gevent.spawn(self.pooledDownloadContent, modified_contents, only_if_bad=True) + threads.append(t) + if config.verbose: + self.log.debug("CheckModifications: Waiting for %s pooledDownloadContent" % len(threads)) + gevent.joinall(threads) # Check modified content.json files from peers and add modified files to bad_files # Return: Successfully queried peers [Peer, Peer...] @@ -412,7 +441,7 @@ class Site(object): self.announce() for wait in range(10): time.sleep(5 + wait) - self.log.debug("Waiting for peers...") + self.log.debug("CheckModifications: Waiting for peers...") if self.peers: break @@ -426,7 +455,7 @@ class Site(object): if config.verbose: self.log.debug( - "Try to get listModifications from peers: %s, connected: %s, since: %s" % + "CheckModifications: Try to get listModifications from peers: %s, connected: %s, since: %s" % (peers_try, peers_connected_num, since) ) @@ -443,7 +472,7 @@ class Site(object): if queried: break - self.log.debug("Queried listModifications from: %s in %.3fs since %s" % (queried, time.time() - s, since)) + self.log.debug("CheckModifications: Queried listModifications from: %s in %.3fs since %s" % (queried, time.time() - s, since)) time.sleep(0.1) return queried @@ -603,6 +632,7 @@ class Site(object): return len(published) # Copy this site + @util.Noparallel() def clone(self, address, privatekey=None, address_index=None, root_inner_path="", overwrite=False): import shutil new_site = SiteManager.site_manager.need(address, all_file=False) @@ -720,6 +750,10 @@ class Site(object): return self.needFile(*args, **kwargs) def isFileDownloadAllowed(self, inner_path, file_info): + # Verify space for all site + if self.settings["size"] > self.getSizeLimit() * 1024 * 1024: + return False + # Verify space for file if file_info.get("size", 0) > config.file_size_limit * 1024 * 1024: self.log.debug( "File size %s too large: %sMB > %sMB, skipping..." % @@ -742,7 +776,13 @@ class Site(object): # Check and download if file not exist def needFile(self, inner_path, update=False, blocking=True, peer=None, priority=0): - if self.storage.isFile(inner_path) and not update: # File exist, no need to do anything + if self.worker_manager.tasks.findTask(inner_path): + task = self.worker_manager.addTask(inner_path, peer, priority=priority) + if blocking: + return task["evt"].get() + else: + return task["evt"] + elif self.storage.isFile(inner_path) and not update: # File exist, no need to do anything return True elif not self.isServing(): # Site not serving return False @@ -805,7 +845,8 @@ class Site(object): return peer def announce(self, *args, **kwargs): - self.announcer.announce(*args, **kwargs) + if self.isServing(): + self.announcer.announce(*args, **kwargs) # Keep connections to get the updates def needConnections(self, num=None, check_site_on_reconnect=False): @@ -823,7 +864,7 @@ class Site(object): self.log.debug("Need connections: %s, Current: %s, Total: %s" % (need, connected, len(self.peers))) if connected < need: # Need more than we have - for peer in list(self.peers.values()): + for peer in self.getRecentPeers(30): if not peer.connection or not peer.connection.connected: # No peer connection or disconnected peer.pex() # Initiate peer exchange if peer.connection and peer.connection.connected: @@ -849,6 +890,8 @@ class Site(object): continue # Not connectable if not peer.connection: continue # No connection + if peer.ip.endswith(".onion") and not self.connection_server.tor_manager.enabled: + continue # Onion not supported if peer.key in ignore: continue # The requester has this peer if time.time() - peer.connection.last_recv_time > 60 * 60 * 2: # Last message more than 2 hours ago @@ -873,7 +916,10 @@ class Site(object): # Return: Recently found peers def getRecentPeers(self, need_num): found = list(set(self.peers_recent)) - self.log.debug("Recent peers %s of %s (need: %s)" % (len(found), len(self.peers_recent), need_num)) + self.log.debug( + "Recent peers %s of %s (need: %s)" % + (len(found), len(self.peers), need_num) + ) if len(found) >= need_num or len(found) >= len(self.peers): return sorted( @@ -884,8 +930,13 @@ class Site(object): # Add random peers need_more = need_num - len(found) + if not self.connection_server.tor_manager.enabled: + peers = [peer for peer in self.peers.values() if not peer.ip.endswith(".onion")] + else: + peers = list(self.peers.values()) + found_more = sorted( - list(self.peers.values())[0:need_more * 50], + peers[0:need_more * 50], key=lambda peer: peer.reputation, reverse=True )[0:need_more * 2] @@ -1005,14 +1056,22 @@ class Site(object): return self.settings.get("autodownloadoptional") def delete(self): + self.log.info("Deleting site...") + s = time.time() self.settings["serving"] = False + self.settings["deleting"] = True self.saveSettings() + num_greenlets = self.greenlet_manager.stopGreenlets("Site %s deleted" % self.address) self.worker_manager.running = False - self.worker_manager.stopWorkers() - self.storage.deleteFiles() - self.updateWebsocket(deleted=True) - self.content_manager.contents.db.deleteSite(self) + num_workers = self.worker_manager.stopWorkers() SiteManager.site_manager.delete(self.address) + self.content_manager.contents.db.deleteSite(self) + self.updateWebsocket(deleted=True) + self.storage.deleteFiles() + self.log.info( + "Deleted site in %.3fs (greenlets: %s, workers: %s)" % + (time.time() - s, num_greenlets, num_workers) + ) # - Events - diff --git a/src/Site/SiteAnnouncer.py b/src/Site/SiteAnnouncer.py index 2e2a353f..2fd63e82 100644 --- a/src/Site/SiteAnnouncer.py +++ b/src/Site/SiteAnnouncer.py @@ -10,6 +10,7 @@ from Plugin import PluginManager from Config import config from Debug import Debug from util import helper +from greenlet import GreenletExit import util @@ -38,6 +39,8 @@ class SiteAnnouncer(object): if not self.site.connection_server.tor_manager.enabled: trackers = [tracker for tracker in trackers if ".onion" not in tracker] + trackers = [tracker for tracker in trackers if self.getAddressParts(tracker)] # Remove trackers with unknown address + if "ipv6" not in self.site.connection_server.supported_ip_types: trackers = [tracker for tracker in trackers if helper.getIpType(self.getAddressParts(tracker)["ip"]) != "ipv6"] @@ -58,7 +61,7 @@ class SiteAnnouncer(object): def getOpenedServiceTypes(self): back = [] # Type of addresses they can reach me - if config.trackers_proxy == "disable": + if config.trackers_proxy == "disable" and config.tor != "always": for ip_type, opened in list(self.site.connection_server.port_opened.items()): if opened: back.append(ip_type) @@ -90,11 +93,12 @@ class SiteAnnouncer(object): for tracker in trackers: # Start announce threads tracker_stats = global_stats[tracker] # Reduce the announce time for trackers that looks unreliable - if tracker_stats["num_error"] > 5 and tracker_stats["time_request"] > time.time() - 60 * min(30, tracker_stats["num_error"]): + time_announce_allowed = time.time() - 60 * min(30, tracker_stats["num_error"]) + if tracker_stats["num_error"] > 5 and tracker_stats["time_request"] > time_announce_allowed and not force: if config.verbose: self.site.log.debug("Tracker %s looks unreliable, announce skipped (error: %s)" % (tracker, tracker_stats["num_error"])) continue - thread = gevent.spawn(self.announceTracker, tracker, mode=mode) + thread = self.site.greenlet_manager.spawn(self.announceTracker, tracker, mode=mode) threads.append(thread) thread.tracker = tracker @@ -134,7 +138,7 @@ class SiteAnnouncer(object): self.site.log.error("Announce to %s trackers in %.3fs, failed" % (len(threads), time.time() - s)) if len(threads) == 1 and mode != "start": # Move to next tracker self.site.log.debug("Tracker failed, skipping to next one...") - gevent.spawn_later(1.0, self.announce, force=force, mode=mode, pex=pex) + self.site.greenlet_manager.spawnLater(1.0, self.announce, force=force, mode=mode, pex=pex) self.updateWebsocket(trackers="announced") @@ -206,10 +210,12 @@ class SiteAnnouncer(object): self.stats[tracker]["time_status"] = time.time() self.stats[tracker]["last_error"] = str(error) self.stats[tracker]["time_last_error"] = time.time() - self.stats[tracker]["num_error"] += 1 + if self.site.connection_server.has_internet: + self.stats[tracker]["num_error"] += 1 self.stats[tracker]["num_request"] += 1 global_stats[tracker]["num_request"] += 1 - global_stats[tracker]["num_error"] += 1 + if self.site.connection_server.has_internet: + global_stats[tracker]["num_error"] += 1 self.updateWebsocket(tracker="error") return False @@ -257,7 +263,7 @@ class SiteAnnouncer(object): peers = self.site.getConnectedPeers() if len(peers) == 0: # Small number of connected peers for this site, connect to any - peers = list(self.site.peers.values()) + peers = list(self.site.getRecentPeers(20)) need_num = 10 random.shuffle(peers) @@ -271,6 +277,8 @@ class SiteAnnouncer(object): if num_added: self.site.worker_manager.onPeers() self.site.updateWebsocket(peers_added=num_added) + else: + time.sleep(0.1) if done == query_num: break self.site.log.debug("Pex result: from %s peers got %s new peers." % (done, total_added)) diff --git a/src/Site/SiteManager.py b/src/Site/SiteManager.py index 40724866..44773b0d 100644 --- a/src/Site/SiteManager.py +++ b/src/Site/SiteManager.py @@ -7,10 +7,13 @@ import atexit import gevent +import util from Plugin import PluginManager from Content import ContentDb from Config import config from util import helper +from util import RateLimit +from util import Cached @PluginManager.acceptPlugins @@ -25,14 +28,25 @@ class SiteManager(object): atexit.register(lambda: self.save(recalculate_size=True)) # Load all sites from data/sites.json + @util.Noparallel() def load(self, cleanup=True, startup=False): - self.log.debug("Loading sites...") + from Debug import Debug + self.log.info("Loading sites... (cleanup: %s, startup: %s)" % (cleanup, startup)) self.loaded = False from .Site import Site address_found = [] added = 0 + load_s = time.time() # Load new adresses - for address, settings in json.load(open("%s/sites.json" % config.data_dir)).items(): + try: + json_path = "%s/sites.json" % config.data_dir + data = json.load(open(json_path)) + except Exception as err: + raise Exception("Unable to load %s: %s" % (json_path, err)) + + sites_need = [] + + for address, settings in data.items(): if address not in self.sites: if os.path.isfile("%s/%s/content.json" % (config.data_dir, address)): # Root content.json exists, try load site @@ -49,7 +63,7 @@ class SiteManager(object): elif startup: # No site directory, start download self.log.debug("Found new site in sites.json: %s" % address) - gevent.spawn(self.need, address, settings=settings) + sites_need.append([address, settings]) added += 1 address_found.append(address) @@ -78,9 +92,14 @@ class SiteManager(object): if address in content_db.sites: del content_db.sites[address] - if added: - self.log.debug("SiteManager added %s sites" % added) self.loaded = True + for address, settings in sites_need: + gevent.spawn(self.need, address, settings=settings) + if added: + self.log.info("Added %s sites in %.3fs" % (added, time.time() - load_s)) + + def saveDelayed(self): + RateLimit.callAsync("Save sites.json", allowed_again=5, func=self.save) def save(self, recalculate_size=False): if not self.sites: @@ -93,7 +112,7 @@ class SiteManager(object): data = {} # Generate data file s = time.time() - for address, site in self.list().items(): + for address, site in list(self.list().items()): if recalculate_size: site.settings["size"], site.settings["size_optional"] = site.content_manager.getTotalSize() # Update site size data[address] = site.settings @@ -102,7 +121,7 @@ class SiteManager(object): s = time.time() if data: - helper.atomicWrite("%s/sites.json" % config.data_dir, json.dumps(data, indent=2, sort_keys=True).encode()) + helper.atomicWrite("%s/sites.json" % config.data_dir, helper.jsonDumps(data).encode("utf8")) else: self.log.debug("Save error: No data") time_write = time.time() - s @@ -125,41 +144,67 @@ class SiteManager(object): def isDomain(self, address): return False + @Cached(timeout=10) + def isDomainCached(self, address): + return self.isDomain(address) + + def resolveDomain(self, domain): + return False + + @Cached(timeout=10) + def resolveDomainCached(self, domain): + return self.resolveDomain(domain) + # Return: Site object or None if not found def get(self, address): + if self.isDomainCached(address): + address_resolved = self.resolveDomainCached(address) + if address_resolved: + address = address_resolved + if not self.loaded: # Not loaded yet self.log.debug("Loading site: %s)..." % address) self.load() - return self.sites.get(address) + site = self.sites.get(address) + + return site + + def add(self, address, all_file=True, settings=None, **kwargs): + from .Site import Site + self.sites_changed = int(time.time()) + # Try to find site with differect case + for recover_address, recover_site in list(self.sites.items()): + if recover_address.lower() == address.lower(): + return recover_site + + if not self.isAddress(address): + return False # Not address: %s % address + self.log.debug("Added new site: %s" % address) + config.loadTrackersFile() + site = Site(address, settings=settings) + self.sites[address] = site + if not site.settings["serving"]: # Maybe it was deleted before + site.settings["serving"] = True + site.saveSettings() + if all_file: # Also download user files on first sync + site.download(check_size=True, blind_includes=True) + return site # Return or create site and start download site files - def need(self, address, all_file=True, settings=None): - from .Site import Site + def need(self, address, *args, **kwargs): + if self.isDomainCached(address): + address_resolved = self.resolveDomainCached(address) + if address_resolved: + address = address_resolved + site = self.get(address) if not site: # Site not exist yet - self.sites_changed = int(time.time()) - # Try to find site with differect case - for recover_address, recover_site in list(self.sites.items()): - if recover_address.lower() == address.lower(): - return recover_site - - if not self.isAddress(address): - return False # Not address: %s % address - self.log.debug("Added new site: %s" % address) - config.loadTrackersFile() - site = Site(address, settings=settings) - self.sites[address] = site - if not site.settings["serving"]: # Maybe it was deleted before - site.settings["serving"] = True - site.saveSettings() - if all_file: # Also download user files on first sync - site.download(check_size=True, blind_includes=True) - + site = self.add(address, *args, **kwargs) return site def delete(self, address): self.sites_changed = int(time.time()) - self.log.debug("SiteManager deleted site: %s" % address) + self.log.debug("Deleted site: %s" % address) del(self.sites[address]) # Delete from sites.json self.save() diff --git a/src/Site/SiteStorage.py b/src/Site/SiteStorage.py index f9e0ef25..c12a80b0 100644 --- a/src/Site/SiteStorage.py +++ b/src/Site/SiteStorage.py @@ -3,7 +3,7 @@ import re import shutil import json import time -import sys +import errno from collections import defaultdict import sqlite3 @@ -11,14 +11,20 @@ import gevent.event import util from util import SafeRe -from Db.Db import Db, DbTableError +from Db.Db import Db from Debug import Debug from Config import config from util import helper +from util import ThreadPool from Plugin import PluginManager from Translate import translate as _ +thread_pool_fs_read = ThreadPool.ThreadPool(config.threads_fs_read, name="FS read") +thread_pool_fs_write = ThreadPool.ThreadPool(config.threads_fs_write, name="FS write") +thread_pool_fs_batch = ThreadPool.ThreadPool(1, name="FS batch") + + @PluginManager.acceptPlugins class SiteStorage(object): def __init__(self, site, allow_create=True): @@ -38,11 +44,14 @@ class SiteStorage(object): raise Exception("Directory not exists: %s" % self.directory) def getDbFile(self): - if self.isFile("dbschema.json"): - schema = self.loadJson("dbschema.json") - return schema["db_file"] + if self.db: + return self.db.schema["db_file"] else: - return False + if self.isFile("dbschema.json"): + schema = self.loadJson("dbschema.json") + return schema["db_file"] + else: + return False # Create new databaseobject with the site's schema def openDb(self, close_idle=False): @@ -50,52 +59,65 @@ class SiteStorage(object): db_path = self.getPath(schema["db_file"]) return Db(schema, db_path, close_idle=close_idle) - def closeDb(self): + def closeDb(self, reason="Unknown (SiteStorage)"): if self.db: - self.db.close() + self.db.close(reason) self.event_db_busy = None self.db = None def getDbSchema(self): try: + self.site.needFile("dbschema.json") schema = self.loadJson("dbschema.json") except Exception as err: raise Exception("dbschema.json is not a valid JSON: %s" % err) return schema - # Return db class - def getDb(self): - if not self.db: - self.log.debug("No database, waiting for dbschema.json...") - self.site.needFile("dbschema.json", priority=3) - self.has_db = self.isFile("dbschema.json") # Recheck if dbschema exist - if self.has_db: - schema = self.getDbSchema() - db_path = self.getPath(schema["db_file"]) - if not os.path.isfile(db_path) or os.path.getsize(db_path) == 0: - try: - self.rebuildDb() - except Exception as err: - self.log.error(err) - pass - - if self.db: - self.db.close() - self.db = self.openDb(close_idle=True) + def loadDb(self): + self.log.debug("No database, waiting for dbschema.json...") + self.site.needFile("dbschema.json", priority=3) + self.log.debug("Got dbschema.json") + self.has_db = self.isFile("dbschema.json") # Recheck if dbschema exist + if self.has_db: + schema = self.getDbSchema() + db_path = self.getPath(schema["db_file"]) + if not os.path.isfile(db_path) or os.path.getsize(db_path) == 0: try: - changed_tables = self.db.checkTables() - if changed_tables: - self.rebuildDb(delete_db=False) # TODO: only update the changed table datas - except sqlite3.OperationalError: + self.rebuildDb(reason="Missing database") + except Exception as err: + self.log.error(err) pass + if self.db: + self.db.close("Gettig new db for SiteStorage") + self.db = self.openDb(close_idle=True) + try: + changed_tables = self.db.checkTables() + if changed_tables: + self.rebuildDb(delete_db=False, reason="Changed tables") # TODO: only update the changed table datas + except sqlite3.OperationalError: + pass + + # Return db class + @util.Noparallel() + def getDb(self): + if self.event_db_busy: # Db not ready for queries + self.log.debug("Wating for db...") + self.event_db_busy.get() # Wait for event + if not self.db: + self.loadDb() return self.db def updateDbFile(self, inner_path, file=None, cur=None): path = self.getPath(inner_path) - return self.getDb().updateJson(path, file, cur) + if cur: + db = cur.db + else: + db = self.getDb() + return db.updateJson(path, file, cur) # Return possible db files for the site + @thread_pool_fs_read.wrap def getDbFiles(self): found = 0 for content_inner_path, content in self.site.content_manager.contents.items(): @@ -103,7 +125,7 @@ class SiteStorage(object): if self.isFile(content_inner_path): yield content_inner_path, self.getPath(content_inner_path) else: - self.log.error("[MISSING] %s" % content_inner_path) + self.log.debug("[MISSING] %s" % content_inner_path) # Data files in content.json content_inner_path_dir = helper.getDirname(content_inner_path) # Content.json dir relative to site for file_relative_path in list(content.get("files", {}).keys()) + list(content.get("files_optional", {}).keys()): @@ -114,15 +136,16 @@ class SiteStorage(object): if self.isFile(file_inner_path): yield file_inner_path, self.getPath(file_inner_path) else: - self.log.error("[MISSING] %s" % file_inner_path) + self.log.debug("[MISSING] %s" % file_inner_path) found += 1 if found % 100 == 0: time.sleep(0.001) # Context switch to avoid UI block # Rebuild sql cache @util.Noparallel() - def rebuildDb(self, delete_db=True): - self.log.info("Rebuilding db...") + @thread_pool_fs_batch.wrap + def rebuildDb(self, delete_db=True, reason="Unknown"): + self.log.info("Rebuilding db (reason: %s)..." % reason) self.has_db = self.isFile("dbschema.json") if not self.has_db: return False @@ -131,7 +154,7 @@ class SiteStorage(object): db_path = self.getPath(schema["db_file"]) if os.path.isfile(db_path) and delete_db: if self.db: - self.closeDb() # Close db if open + self.closeDb("rebuilding") # Close db if open time.sleep(0.5) self.log.info("Deleting %s" % db_path) try: @@ -143,7 +166,7 @@ class SiteStorage(object): self.db = self.openDb() self.event_db_busy = gevent.event.AsyncResult() - self.log.info("Creating tables...") + self.log.info("Rebuild: Creating tables...") # raise DbTableError if not valid self.db.checkTables() @@ -151,16 +174,20 @@ class SiteStorage(object): cur = self.db.getCursor() cur.logging = False s = time.time() - self.log.info("Getting db files...") + self.log.info("Rebuild: Getting db files...") db_files = list(self.getDbFiles()) num_imported = 0 num_total = len(db_files) num_error = 0 - self.log.info("Importing data...") + self.log.info("Rebuild: Importing data...") try: if num_total > 100: - self.site.messageWebsocket(_["Database rebuilding...
    Imported {0} of {1} files (error: {2})..."].format("0000", num_total, num_error), "rebuild", 0) + self.site.messageWebsocket( + _["Database rebuilding...
    Imported {0} of {1} files (error: {2})..."].format( + "0000", num_total, num_error + ), "rebuild", 0 + ) for file_inner_path, file_path in db_files: try: if self.updateDbFile(file_inner_path, file=open(file_path, "rb"), cur=cur): @@ -171,19 +198,25 @@ class SiteStorage(object): if num_imported and num_imported % 100 == 0: self.site.messageWebsocket( - _["Database rebuilding...
    Imported {0} of {1} files (error: {2})..."].format(num_imported, num_total, num_error), - "rebuild", - int(float(num_imported) / num_total * 100) + _["Database rebuilding...
    Imported {0} of {1} files (error: {2})..."].format( + num_imported, num_total, num_error + ), + "rebuild", int(float(num_imported) / num_total * 100) ) time.sleep(0.001) # Context switch to avoid UI block finally: cur.close() if num_total > 100: - self.site.messageWebsocket(_["Database rebuilding...
    Imported {0} of {1} files (error: {2})..."].format(num_imported, num_total, num_error), "rebuild", 100) - self.log.info("Imported %s data file in %.3fs" % (num_imported, time.time() - s)) + self.site.messageWebsocket( + _["Database rebuilding...
    Imported {0} of {1} files (error: {2})..."].format( + num_imported, num_total, num_error + ), "rebuild", 100 + ) + self.log.info("Rebuild: Imported %s data file in %.3fs" % (num_imported, time.time() - s)) self.event_db_busy.set(True) # Event done, notify waiters self.event_db_busy = None # Clear event + self.db.commit("Rebuilt") return True @@ -192,16 +225,13 @@ class SiteStorage(object): if not query.strip().upper().startswith("SELECT"): raise Exception("Only SELECT query supported") - if self.event_db_busy: # Db not ready for queries - self.log.debug("Wating for db...") - self.event_db_busy.get() # Wait for event try: res = self.getDb().execute(query, params) except sqlite3.DatabaseError as err: if err.__class__.__name__ == "DatabaseError": self.log.error("Database error: %s, query: %s, try to rebuilding it..." % (err, query)) try: - self.rebuildDb() + self.rebuildDb(reason="Query error") except sqlite3.OperationalError: pass res = self.db.cur.execute(query, params) @@ -209,28 +239,37 @@ class SiteStorage(object): raise err return res + def ensureDir(self, inner_path): + try: + os.makedirs(self.getPath(inner_path)) + except OSError as err: + if err.errno == errno.EEXIST: + return False + else: + raise err + return True + # Open file object def open(self, inner_path, mode="rb", create_dirs=False, **kwargs): file_path = self.getPath(inner_path) if create_dirs: - file_dir = os.path.dirname(file_path) - if not os.path.isdir(file_dir): - os.makedirs(file_dir) + file_inner_dir = os.path.dirname(inner_path) + self.ensureDir(file_inner_dir) return open(file_path, mode, **kwargs) # Open file object + @thread_pool_fs_read.wrap def read(self, inner_path, mode="rb"): return open(self.getPath(inner_path), mode).read() - # Write content to file - def write(self, inner_path, content): + @thread_pool_fs_write.wrap + def writeThread(self, inner_path, content): file_path = self.getPath(inner_path) # Create dir if not exist - file_dir = os.path.dirname(file_path) - if not os.path.isdir(file_dir): - os.makedirs(file_dir) + self.ensureDir(os.path.dirname(inner_path)) # Write file if hasattr(content, 'read'): # File-like object + with open(file_path, "wb") as file: shutil.copyfileobj(content, file) # Write buff to disk else: # Simple string @@ -239,7 +278,10 @@ class SiteStorage(object): else: with open(file_path, "wb") as file: file.write(content) - del content + + # Write content to file + def write(self, inner_path, content): + self.writeThread(inner_path, content) self.onUpdated(inner_path) # Remove file from filesystem @@ -267,6 +309,7 @@ class SiteStorage(object): raise rename_err # List files from a directory + @thread_pool_fs_read.wrap def walk(self, dir_inner_path, ignore=None): directory = self.getPath(dir_inner_path) for root, dirs, files in os.walk(directory): @@ -299,6 +342,7 @@ class SiteStorage(object): dirs[:] = dirs_filtered # list directories in a directory + @thread_pool_fs_read.wrap def list(self, dir_inner_path): directory = self.getPath(dir_inner_path) return os.listdir(directory) @@ -306,62 +350,39 @@ class SiteStorage(object): # Site content updated def onUpdated(self, inner_path, file=None): # Update Sql cache + should_load_to_db = inner_path.endswith(".json") or inner_path.endswith(".json.gz") if inner_path == "dbschema.json": self.has_db = self.isFile("dbschema.json") # Reopen DB to check changes if self.has_db: - self.closeDb() - self.getDb() - elif not config.disable_db and (inner_path.endswith(".json") or inner_path.endswith(".json.gz")) and self.has_db: # Load json file to db + self.closeDb("New dbschema") + gevent.spawn(self.getDb) + elif not config.disable_db and should_load_to_db and self.has_db: # Load json file to db if config.verbose: self.log.debug("Loading json file to db: %s (file: %s)" % (inner_path, file)) try: self.updateDbFile(inner_path, file) except Exception as err: self.log.error("Json %s load error: %s" % (inner_path, Debug.formatException(err))) - self.closeDb() + self.closeDb("Json load error") # Load and parse json file + @thread_pool_fs_read.wrap def loadJson(self, inner_path): with self.open(inner_path, "r", encoding="utf8") as file: return json.load(file) - def formatJson(self, data): - content = json.dumps(data, indent=1, sort_keys=True) - - # Make it a little more compact by removing unnecessary white space - def compact_dict(match): - if "\n" in match.group(0): - return match.group(0).replace(match.group(1), match.group(1).strip()) - else: - return match.group(0) - - content = re.sub("\{(\n[^,\[\{]{10,100}?)\}[, ]{0,2}\n", compact_dict, content, flags=re.DOTALL) - - def compact_list(match): - if "\n" in match.group(0): - stripped_lines = re.sub("\n[ ]*", "", match.group(1)) - return match.group(0).replace(match.group(1), stripped_lines) - else: - return match.group(0) - - content = re.sub("\[([^\[\{]{2,300}?)\][, ]{0,2}\n", compact_list, content, flags=re.DOTALL) - - # Remove end of line whitespace - content = re.sub("(?m)[ ]+$", "", content) - return content - # Write formatted json file def writeJson(self, inner_path, data): # Write to disk - self.write(inner_path, self.formatJson(data).encode("utf8")) + self.write(inner_path, helper.jsonDumps(data).encode("utf8")) # Get file size def getSize(self, inner_path): path = self.getPath(inner_path) try: return os.path.getsize(path) - except: + except Exception: return 0 # File exist @@ -515,10 +536,15 @@ class SiteStorage(object): self.log.debug("Checked files in %.2fs... Found bad files: %s, Quick:%s" % (time.time() - s, len(bad_files), quick_check)) # Delete site's all file + @thread_pool_fs_batch.wrap def deleteFiles(self): - self.log.debug("Deleting files from content.json...") + site_title = self.site.content_manager.contents.get("content.json", {}).get("title", self.site.address) + message_id = "delete-%s" % self.site.address + self.log.debug("Deleting files from content.json (title: %s)..." % site_title) + files = [] # Get filenames - for content_inner_path in list(self.site.content_manager.contents.keys()): + content_inner_paths = list(self.site.content_manager.contents.keys()) + for i, content_inner_path in enumerate(content_inner_paths): content = self.site.content_manager.contents.get(content_inner_path, {}) files.append(content_inner_path) # Add normal files @@ -530,9 +556,16 @@ class SiteStorage(object): file_inner_path = helper.getDirname(content_inner_path) + file_relative_path # Relative to site dir files.append(file_inner_path) + if i % 100 == 0: + num_files = len(files) + self.site.messageWebsocket( + _("Deleting site {site_title}...
    Collected {num_files} files"), + message_id, (i / len(content_inner_paths)) * 25 + ) + if self.isFile("dbschema.json"): self.log.debug("Deleting db file...") - self.closeDb() + self.closeDb("Deleting site") self.has_db = False try: schema = self.loadJson("dbschema.json") @@ -542,7 +575,8 @@ class SiteStorage(object): except Exception as err: self.log.error("Db file delete error: %s" % err) - for inner_path in files: + num_files = len(files) + for i, inner_path in enumerate(files): path = self.getPath(inner_path) if os.path.isfile(path): for retry in range(5): @@ -552,21 +586,46 @@ class SiteStorage(object): except Exception as err: self.log.error("Error removing %s: %s, try #%s" % (inner_path, err, retry)) time.sleep(float(retry) / 10) + if i % 100 == 0: + self.site.messageWebsocket( + _("Deleting site {site_title}...
    Deleting file {i}/{num_files}"), + message_id, 25 + (i / num_files) * 50 + ) self.onUpdated(inner_path, False) self.log.debug("Deleting empty dirs...") + i = 0 for root, dirs, files in os.walk(self.directory, topdown=False): for dir in dirs: path = os.path.join(root, dir) - if os.path.isdir(path) and os.listdir(path) == []: - os.rmdir(path) - self.log.debug("Removing %s" % path) + if os.path.isdir(path): + try: + i += 1 + if i % 100 == 0: + self.site.messageWebsocket( + _("Deleting site {site_title}...
    Deleting empty directories {i}"), + message_id, 85 + ) + os.rmdir(path) + except OSError: # Not empty + pass + if os.path.isdir(self.directory) and os.listdir(self.directory) == []: os.rmdir(self.directory) # Remove sites directory if empty if os.path.isdir(self.directory): self.log.debug("Some unknown file remained in site data dir: %s..." % self.directory) + self.site.messageWebsocket( + _("Deleting site {site_title}...
    Site deleted, but some unknown files left in the directory"), + message_id, 100 + ) return False # Some files not deleted else: - self.log.debug("Site data directory deleted: %s..." % self.directory) + self.log.debug("Site %s data directory deleted: %s..." % (site_title, self.directory)) + + self.site.messageWebsocket( + _("Deleting site {site_title}...
    All files deleted successfully"), + message_id, 100 + ) + return True # All clean diff --git a/src/Test/Spy.py b/src/Test/Spy.py index 8062d063..44422550 100644 --- a/src/Test/Spy.py +++ b/src/Test/Spy.py @@ -1,3 +1,5 @@ +import logging + class Spy: def __init__(self, obj, func_name): self.obj = obj @@ -6,11 +8,12 @@ class Spy: self.calls = [] def __enter__(self, *args, **kwargs): + logging.debug("Spy started") def loggedFunc(cls, *args, **kwargs): call = dict(enumerate(args, 1)) call[0] = cls call.update(kwargs) - print("Logging", call) + logging.debug("Spy call: %s" % call) self.calls.append(call) return self.func_original(cls, *args, **kwargs) setattr(self.obj, self.__name__, loggedFunc) diff --git a/src/Test/TestCached.py b/src/Test/TestCached.py new file mode 100644 index 00000000..088962c0 --- /dev/null +++ b/src/Test/TestCached.py @@ -0,0 +1,59 @@ +import time + +from util import Cached + + +class CachedObject: + def __init__(self): + self.num_called_add = 0 + self.num_called_multiply = 0 + self.num_called_none = 0 + + @Cached(timeout=1) + def calcAdd(self, a, b): + self.num_called_add += 1 + return a + b + + @Cached(timeout=1) + def calcMultiply(self, a, b): + self.num_called_multiply += 1 + return a * b + + @Cached(timeout=1) + def none(self): + self.num_called_none += 1 + return None + + +class TestCached: + def testNoneValue(self): + cached_object = CachedObject() + assert cached_object.none() is None + assert cached_object.none() is None + assert cached_object.num_called_none == 1 + time.sleep(2) + assert cached_object.none() is None + assert cached_object.num_called_none == 2 + + def testCall(self): + cached_object = CachedObject() + + assert cached_object.calcAdd(1, 2) == 3 + assert cached_object.calcAdd(1, 2) == 3 + assert cached_object.calcMultiply(1, 2) == 2 + assert cached_object.calcMultiply(1, 2) == 2 + assert cached_object.num_called_add == 1 + assert cached_object.num_called_multiply == 1 + + assert cached_object.calcAdd(2, 3) == 5 + assert cached_object.calcAdd(2, 3) == 5 + assert cached_object.num_called_add == 2 + + assert cached_object.calcAdd(1, 2) == 3 + assert cached_object.calcMultiply(2, 3) == 6 + assert cached_object.num_called_add == 2 + assert cached_object.num_called_multiply == 2 + + time.sleep(2) + assert cached_object.calcAdd(1, 2) == 3 + assert cached_object.num_called_add == 3 diff --git a/src/Test/TestConnectionServer.py b/src/Test/TestConnectionServer.py index f7f62831..82ee605c 100644 --- a/src/Test/TestConnectionServer.py +++ b/src/Test/TestConnectionServer.py @@ -47,7 +47,7 @@ class TestConnection: # Close connection connection.close("Test ended") client.stop() - time.sleep(0.01) + time.sleep(0.1) assert len(file_server.connections) == 0 assert file_server.num_incoming == 2 # One for file_server fixture, one for the test diff --git a/src/Test/TestContent.py b/src/Test/TestContent.py index 9c84b812..d46abc1f 100644 --- a/src/Test/TestContent.py +++ b/src/Test/TestContent.py @@ -200,7 +200,7 @@ class TestContent: inner_path = "content.json" data_dict = site.storage.loadJson(inner_path) - for good_relative_path in ["data.json", "out/data.json", "Any File [by none] (1).jpg"]: + for good_relative_path in ["data.json", "out/data.json", "Any File [by none] (1).jpg", "árvzítűrő/tükörfúrógép.txt"]: data_dict["files"] = {good_relative_path: {"sha512": "369d4e780cc80504285f13774ca327fe725eed2d813aad229e62356b07365906", "size": 505}} if "sign" in data_dict: @@ -212,7 +212,7 @@ class TestContent: data = io.BytesIO(json.dumps(data_dict).encode()) assert site.content_manager.verifyFile(inner_path, data, ignore_same=False) - for bad_relative_path in ["../data.json", "data/" * 100, "invalid|file.jpg"]: + for bad_relative_path in ["../data.json", "data/" * 100, "invalid|file.jpg", "con.txt", "any/con.txt"]: data_dict["files"] = {bad_relative_path: {"sha512": "369d4e780cc80504285f13774ca327fe725eed2d813aad229e62356b07365906", "size": 505}} if "sign" in data_dict: @@ -246,3 +246,26 @@ class TestContent: with site.storage.open("data/users/1C5sgvWaSgfaTpV5kjBCnCiKtENNMYo69q/content.json") as data: site.content_manager.verifyFile("data/users/1C5sgvWaSgfaTpV5kjBCnCiKtENNMYo69q/content.json", data, ignore_same=False) assert "Potentially unsafe" in str(err.value) + + def testPathValidation(self, site): + assert site.content_manager.isValidRelativePath("test.txt") + assert site.content_manager.isValidRelativePath("test/!@#$%^&().txt") + assert site.content_manager.isValidRelativePath("ÜøßÂŒƂÆÇ.txt") + assert site.content_manager.isValidRelativePath("тест.текст") + assert site.content_manager.isValidRelativePath("𝐮𝐧𝐢𝐜𝐨𝐝𝐞𝑖𝑠𝒂𝒘𝒆𝒔𝒐𝒎𝒆") + + # Test rules based on https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names + + assert not site.content_manager.isValidRelativePath("any\\hello.txt") # \ not allowed + assert not site.content_manager.isValidRelativePath("/hello.txt") # Cannot start with / + assert not site.content_manager.isValidRelativePath("../hello.txt") # Not allowed .. in path + assert not site.content_manager.isValidRelativePath("\0hello.txt") # NULL character + assert not site.content_manager.isValidRelativePath("\31hello.txt") # 0-31 (ASCII control characters) + assert not site.content_manager.isValidRelativePath("any/hello.txt ") # Cannot end with space + assert not site.content_manager.isValidRelativePath("any/hello.txt.") # Cannot end with dot + assert not site.content_manager.isValidRelativePath("any/CON") # Protected names on Windows + assert not site.content_manager.isValidRelativePath("CON/any.txt") + assert not site.content_manager.isValidRelativePath("any/lpt1.txt") + assert site.content_manager.isValidRelativePath("any/CONAN") + assert not site.content_manager.isValidRelativePath("any/CONOUT$") + assert not site.content_manager.isValidRelativePath("a" * 256) # Max 255 characters allowed diff --git a/src/Test/TestFileRequest.py b/src/Test/TestFileRequest.py index 6a8d634a..3fabc271 100644 --- a/src/Test/TestFileRequest.py +++ b/src/Test/TestFileRequest.py @@ -91,7 +91,7 @@ class TestFileRequest: def testPex(self, file_server, site, site_temp): file_server.sites[site.address] = site client = FileServer(file_server.ip, 1545) - client.sites[site_temp.address] = site_temp + client.sites = {site_temp.address: site_temp} site_temp.connection_server = client connection = client.getConnection(file_server.ip, 1544) diff --git a/src/Test/TestFlag.py b/src/Test/TestFlag.py new file mode 100644 index 00000000..12fd8165 --- /dev/null +++ b/src/Test/TestFlag.py @@ -0,0 +1,39 @@ +import os + +import pytest + +from util.Flag import Flag + +class TestFlag: + def testFlagging(self): + flag = Flag() + @flag.admin + @flag.no_multiuser + def testFn(anything): + return anything + + assert "admin" in flag.db["testFn"] + assert "no_multiuser" in flag.db["testFn"] + + def testSubclassedFlagging(self): + flag = Flag() + class Test: + @flag.admin + @flag.no_multiuser + def testFn(anything): + return anything + + class SubTest(Test): + pass + + assert "admin" in flag.db["testFn"] + assert "no_multiuser" in flag.db["testFn"] + + def testInvalidFlag(self): + flag = Flag() + with pytest.raises(Exception) as err: + @flag.no_multiuser + @flag.unknown_flag + def testFn(anything): + return anything + assert "Invalid flag" in str(err.value) diff --git a/src/Test/TestNoparallel.py b/src/Test/TestNoparallel.py index b48dd229..6fc4f57d 100644 --- a/src/Test/TestNoparallel.py +++ b/src/Test/TestNoparallel.py @@ -4,6 +4,16 @@ import gevent import pytest import util +from util import ThreadPool + + +@pytest.fixture(params=['gevent.spawn', 'thread_pool.spawn']) +def queue_spawn(request): + thread_pool = ThreadPool.ThreadPool(10) + if request.param == "gevent.spawn": + return gevent.spawn + else: + return thread_pool.spawn class ExampleClass(object): @@ -13,7 +23,7 @@ class ExampleClass(object): @util.Noparallel() def countBlocking(self, num=5): for i in range(1, num + 1): - time.sleep(0.01) + time.sleep(0.1) self.counted += 1 return "counted:%s" % i @@ -33,20 +43,20 @@ class ExampleClass(object): class TestNoparallel: - def testBlocking(self): + def testBlocking(self, queue_spawn): obj1 = ExampleClass() obj2 = ExampleClass() # Dont allow to call again until its running and wait until its running threads = [ - gevent.spawn(obj1.countBlocking), - gevent.spawn(obj1.countBlocking), - gevent.spawn(obj1.countBlocking), - gevent.spawn(obj2.countBlocking) + queue_spawn(obj1.countBlocking), + queue_spawn(obj1.countBlocking), + queue_spawn(obj1.countBlocking), + queue_spawn(obj2.countBlocking) ] assert obj2.countBlocking() == "counted:5" # The call is ignored as obj2.countBlocking already counting, but block until its finishes gevent.joinall(threads) - assert [thread.value for thread in threads] == ["counted:5", "counted:5", "counted:5", "counted:5"] # Check the return value for every call + assert [thread.value for thread in threads] == ["counted:5", "counted:5", "counted:5", "counted:5"] obj2.countBlocking() # Allow to call again as obj2.countBlocking finished assert obj1.counted == 5 @@ -54,7 +64,6 @@ class TestNoparallel: def testNoblocking(self): obj1 = ExampleClass() - obj2 = ExampleClass() thread1 = obj1.countNoblocking() thread2 = obj1.countNoblocking() # Ignored @@ -68,24 +77,24 @@ class TestNoparallel: obj1.countNoblocking().join() # Allow again and wait until finishes assert obj1.counted == 10 - def testQueue(self): + def testQueue(self, queue_spawn): obj1 = ExampleClass() - gevent.spawn(obj1.countQueue, num=10) - gevent.spawn(obj1.countQueue, num=10) - gevent.spawn(obj1.countQueue, num=10) + queue_spawn(obj1.countQueue, num=1) + queue_spawn(obj1.countQueue, num=1) + queue_spawn(obj1.countQueue, num=1) - time.sleep(3.0) - assert obj1.counted == 20 # No multi-queue supported + time.sleep(0.3) + assert obj1.counted == 2 # No multi-queue supported obj2 = ExampleClass() - gevent.spawn(obj2.countQueue, num=10) - gevent.spawn(obj2.countQueue, num=10) + queue_spawn(obj2.countQueue, num=10) + queue_spawn(obj2.countQueue, num=10) time.sleep(1.5) # Call 1 finished, call 2 still working assert 10 < obj2.counted < 20 - gevent.spawn(obj2.countQueue, num=10) + queue_spawn(obj2.countQueue, num=10) time.sleep(2.0) assert obj2.counted == 30 @@ -101,16 +110,16 @@ class TestNoparallel: gevent.joinall(threads) assert obj1.counted == 5 * 2 # Only called twice (no multi-queue allowed) - def testIgnoreClass(self): + def testIgnoreClass(self, queue_spawn): obj1 = ExampleClass() obj2 = ExampleClass() threads = [ - gevent.spawn(obj1.countQueue), - gevent.spawn(obj1.countQueue), - gevent.spawn(obj1.countQueue), - gevent.spawn(obj2.countQueue), - gevent.spawn(obj2.countQueue) + queue_spawn(obj1.countQueue), + queue_spawn(obj1.countQueue), + queue_spawn(obj1.countQueue), + queue_spawn(obj2.countQueue), + queue_spawn(obj2.countQueue) ] s = time.time() time.sleep(0.001) @@ -122,11 +131,37 @@ class TestNoparallel: taken = time.time() - s assert 1.2 > taken >= 1.0 # 2 * 0.5s count = ~1s - def testException(self): + def testException(self, queue_spawn): + class MyException(Exception): + pass + @util.Noparallel() def raiseException(): - raise Exception("Test error!") + raise MyException("Test error!") - with pytest.raises(Exception) as err: + with pytest.raises(MyException) as err: raiseException() assert str(err.value) == "Test error!" + + with pytest.raises(MyException) as err: + queue_spawn(raiseException).get() + assert str(err.value) == "Test error!" + + def testMultithreadMix(self, queue_spawn): + obj1 = ExampleClass() + with ThreadPool.ThreadPool(10) as thread_pool: + s = time.time() + t1 = queue_spawn(obj1.countBlocking, 5) + time.sleep(0.01) + t2 = thread_pool.spawn(obj1.countBlocking, 5) + time.sleep(0.01) + t3 = thread_pool.spawn(obj1.countBlocking, 5) + time.sleep(0.3) + t4 = gevent.spawn(obj1.countBlocking, 5) + threads = [t1, t2, t3, t4] + for thread in threads: + assert thread.get() == "counted:5" + + time_taken = time.time() - s + assert obj1.counted == 5 + assert 0.5 < time_taken < 0.7 diff --git a/src/Test/TestPeer.py b/src/Test/TestPeer.py index f7bdb6da..f57e046e 100644 --- a/src/Test/TestPeer.py +++ b/src/Test/TestPeer.py @@ -15,7 +15,7 @@ class TestPeer: def testPing(self, file_server, site, site_temp): file_server.sites[site.address] = site client = FileServer(file_server.ip, 1545) - client.sites[site_temp.address] = site_temp + client.sites = {site_temp.address: site_temp} site_temp.connection_server = client connection = client.getConnection(file_server.ip, 1544) @@ -34,7 +34,7 @@ class TestPeer: def testDownloadFile(self, file_server, site, site_temp): file_server.sites[site.address] = site client = FileServer(file_server.ip, 1545) - client.sites[site_temp.address] = site_temp + client.sites = {site_temp.address: site_temp} site_temp.connection_server = client connection = client.getConnection(file_server.ip, 1544) @@ -129,7 +129,7 @@ class TestPeer: def testFindHash(self, file_server, site, site_temp): file_server.sites[site.address] = site client = FileServer(file_server.ip, 1545) - client.sites[site_temp.address] = site_temp + client.sites = {site_temp.address: site_temp} site_temp.connection_server = client # Add file_server as peer to client diff --git a/src/Test/TestSiteDownload.py b/src/Test/TestSiteDownload.py index 1d4ba4c1..cd0a4c9f 100644 --- a/src/Test/TestSiteDownload.py +++ b/src/Test/TestSiteDownload.py @@ -3,6 +3,7 @@ import time import pytest import mock import gevent +import gevent.event import os from Connection import ConnectionServer @@ -26,14 +27,16 @@ class TestSiteDownload: # Init client server client = FileServer(file_server.ip, 1545) - client.sites[site_temp.address] = site_temp + client.sites = {site_temp.address: site_temp} site_temp.connection_server = client site_temp.announce = mock.MagicMock(return_value=True) # Don't try to find peers from the net site_temp.addPeer(file_server.ip, 1544) - site_temp.download(blind_includes=True).join(timeout=5) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) + + assert site_temp.storage.isFile("content.json") # Rename non-optional file os.rename(site.storage.getPath("data/img/domain.png"), site.storage.getPath("data/img/domain-new.png")) @@ -50,7 +53,7 @@ class TestSiteDownload: with Spy.Spy(FileRequest, "route") as requests: site.publish() time.sleep(0.1) - site_temp.download(blind_includes=True).join(timeout=5) # Wait for download + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) # Wait for download assert "streamFile" not in [req[1] for req in requests] content = site_temp.storage.loadJson("content.json") @@ -75,14 +78,14 @@ class TestSiteDownload: # Init client server client = FileServer(file_server.ip, 1545) - client.sites[site_temp.address] = site_temp + client.sites = {site_temp.address: site_temp} site_temp.connection_server = client site_temp.announce = mock.MagicMock(return_value=True) # Don't try to find peers from the net site_temp.addPeer(file_server.ip, 1544) - site_temp.download(blind_includes=True).join(timeout=5) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) assert site_temp.settings["optional_downloaded"] == 0 @@ -106,7 +109,7 @@ class TestSiteDownload: with Spy.Spy(FileRequest, "route") as requests: site.publish() time.sleep(0.1) - site_temp.download(blind_includes=True).join(timeout=5) # Wait for download + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) # Wait for download assert "streamFile" not in [req[1] for req in requests] content = site_temp.storage.loadJson("content.json") @@ -131,12 +134,12 @@ class TestSiteDownload: # Init client server client = FileServer(file_server.ip, 1545) - client.sites[site_temp.address] = site_temp + client.sites = {site_temp.address: site_temp} site_temp.connection_server = client # Download normally site_temp.addPeer(file_server.ip, 1544) - site_temp.download(blind_includes=True).join(timeout=5) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) bad_files = site_temp.storage.verifyFiles(quick_check=True)["bad_files"] assert not bad_files @@ -145,7 +148,7 @@ class TestSiteDownload: assert len(list(site_temp.storage.query("SELECT * FROM comment"))) == 2 # Add archived data - assert not "archived" in site.content_manager.contents["data/users/content.json"]["user_contents"] + assert "archived" not in site.content_manager.contents["data/users/content.json"]["user_contents"] assert not site.content_manager.isArchived("data/users/1C5sgvWaSgfaTpV5kjBCnCiKtENNMYo69q/content.json", time.time()-1) site.content_manager.contents["data/users/content.json"]["user_contents"]["archived"] = {"1C5sgvWaSgfaTpV5kjBCnCiKtENNMYo69q": time.time()} @@ -160,7 +163,7 @@ class TestSiteDownload: assert not "archived" in site_temp.content_manager.contents["data/users/content.json"]["user_contents"] site.publish() time.sleep(0.1) - site_temp.download(blind_includes=True).join(timeout=5) # Wait for download + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) # Wait for download # The archived content should disappear from remote client assert "archived" in site_temp.content_manager.contents["data/users/content.json"]["user_contents"] @@ -179,12 +182,12 @@ class TestSiteDownload: # Init client server client = FileServer(file_server.ip, 1545) - client.sites[site_temp.address] = site_temp + client.sites = {site_temp.address: site_temp} site_temp.connection_server = client # Download normally site_temp.addPeer(file_server.ip, 1544) - site_temp.download(blind_includes=True).join(timeout=5) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) bad_files = site_temp.storage.verifyFiles(quick_check=True)["bad_files"] assert not bad_files @@ -209,7 +212,7 @@ class TestSiteDownload: assert not "archived_before" in site_temp.content_manager.contents["data/users/content.json"]["user_contents"] site.publish() time.sleep(0.1) - site_temp.download(blind_includes=True).join(timeout=5) # Wait for download + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) # Wait for download # The archived content should disappear from remote client assert "archived_before" in site_temp.content_manager.contents["data/users/content.json"]["user_contents"] @@ -236,7 +239,7 @@ class TestSiteDownload: site_temp.addPeer(file_server.ip, 1544) # Download site - site_temp.download(blind_includes=True).join(timeout=5) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) # Download optional data/optional.txt site.storage.verifyFiles(quick_check=True) # Find what optional files we have @@ -301,7 +304,7 @@ class TestSiteDownload: # Download normal files site_temp.log.info("Start Downloading site") - site_temp.download(blind_includes=True).join(timeout=5) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) # Download optional data/optional.txt optional_file_info = site_temp.content_manager.getFileInfo("data/optional.txt") @@ -331,7 +334,7 @@ class TestSiteDownload: assert site_temp.storage.deleteFiles() file_server_full.stop() [connection.close() for connection in file_server.connections] - site_full.content_manager.contents.db.close() + site_full.content_manager.contents.db.close("FindOptional test end") def testUpdate(self, file_server, site, site_temp): assert site.storage.directory == config.data_dir + "/" + site.address @@ -343,7 +346,7 @@ class TestSiteDownload: # Init client server client = FileServer(file_server.ip, 1545) - client.sites[site_temp.address] = site_temp + client.sites = {site_temp.address: site_temp} site_temp.connection_server = client # Don't try to find peers from the net @@ -354,7 +357,8 @@ class TestSiteDownload: site_temp.addPeer(file_server.ip, 1544) # Download site from site to site_temp - site_temp.download(blind_includes=True).join(timeout=5) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) + assert len(site_temp.bad_files) == 1 # Update file data_original = site.storage.open("data/data.json").read() @@ -372,7 +376,8 @@ class TestSiteDownload: site.content_manager.sign("content.json", privatekey="5KUh3PvNm5HUWoCfSUfcYvfQ2g3PrRNJWr6Q9eqdBGu23mtMntv") site.publish() time.sleep(0.1) - site_temp.download(blind_includes=True).join(timeout=5) + site.log.info("Downloading site") + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) assert len([request for request in requests if request[1] in ("getFile", "streamFile")]) == 1 assert site_temp.storage.open("data/data.json").read() == data_new @@ -403,9 +408,12 @@ class TestSiteDownload: site.log.info("Publish new data.json with patch") with Spy.Spy(FileRequest, "route") as requests: site.content_manager.sign("content.json", privatekey="5KUh3PvNm5HUWoCfSUfcYvfQ2g3PrRNJWr6Q9eqdBGu23mtMntv") + + event_done = gevent.event.AsyncResult() site.publish(diffs=diffs) - site_temp.download(blind_includes=True).join(timeout=5) - assert len([request for request in requests if request[1] in ("getFile", "streamFile")]) == 0 + time.sleep(0.1) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) + assert [request for request in requests if request[1] in ("getFile", "streamFile")] == [] assert site_temp.storage.open("data/data.json").read() == data_new @@ -419,14 +427,15 @@ class TestSiteDownload: # Init client server client = FileServer(file_server.ip, 1545) - client.sites[site_temp.address] = site_temp + client.sites = {site_temp.address: site_temp} site_temp.connection_server = client # Connect peers site_temp.addPeer(file_server.ip, 1544) # Download site from site to site_temp - site_temp.download(blind_includes=True).join(timeout=5) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) + assert list(site_temp.bad_files.keys()) == ["data/users/1J6UrZMkarjVg5ax9W4qThir3BFUikbW6C/content.json"] # Update file data_original = site.storage.open("data/data.json").read() @@ -445,7 +454,7 @@ class TestSiteDownload: assert "data/data.json" in diffs content_json = site.storage.loadJson("content.json") - content_json["title"] = "BigZeroBlog" * 1024 * 10 + content_json["description"] = "BigZeroBlog" * 1024 * 10 site.storage.writeJson("content.json", content_json) site.content_manager.loadContent("content.json", force=True) @@ -455,8 +464,99 @@ class TestSiteDownload: site.content_manager.sign("content.json", privatekey="5KUh3PvNm5HUWoCfSUfcYvfQ2g3PrRNJWr6Q9eqdBGu23mtMntv") assert site.storage.getSize("content.json") > 10 * 1024 # Make it a big content.json site.publish(diffs=diffs) - site_temp.download(blind_includes=True).join(timeout=5) + time.sleep(0.1) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) file_requests = [request for request in requests if request[1] in ("getFile", "streamFile")] assert len(file_requests) == 1 assert site_temp.storage.open("data/data.json").read() == data_new + assert site_temp.storage.open("content.json").read() == site.storage.open("content.json").read() + + # Test what happened if the content.json of the site is bigger than the site limit + def testHugeContentSiteUpdate(self, file_server, site, site_temp): + # Init source server + site.connection_server = file_server + file_server.sites[site.address] = site + + # Init client server + client = FileServer(file_server.ip, 1545) + client.sites = {site_temp.address: site_temp} + site_temp.connection_server = client + + # Connect peers + site_temp.addPeer(file_server.ip, 1544) + + # Download site from site to site_temp + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) + site_temp.settings["size_limit"] = int(20 * 1024 *1024) + site_temp.saveSettings() + + # Raise limit size to 20MB on site so it can be signed + site.settings["size_limit"] = int(20 * 1024 *1024) + site.saveSettings() + + content_json = site.storage.loadJson("content.json") + content_json["description"] = "PartirUnJour" * 1024 * 1024 + site.storage.writeJson("content.json", content_json) + changed, deleted = site.content_manager.loadContent("content.json", force=True) + + # Make sure we have 2 differents content.json + assert site_temp.storage.open("content.json").read() != site.storage.open("content.json").read() + + # Generate diff + diffs = site.content_manager.getDiffs("content.json") + + # Publish with patch + site.log.info("Publish new content.json bigger than 10MB") + with Spy.Spy(FileRequest, "route") as requests: + site.content_manager.sign("content.json", privatekey="5KUh3PvNm5HUWoCfSUfcYvfQ2g3PrRNJWr6Q9eqdBGu23mtMntv") + assert site.storage.getSize("content.json") > 10 * 1024 * 1024 # verify it over 10MB + time.sleep(0.1) + site.publish(diffs=diffs) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) + + assert site_temp.storage.getSize("content.json") < site_temp.getSizeLimit() * 1024 * 1024 + assert site_temp.storage.open("content.json").read() == site.storage.open("content.json").read() + + def testUnicodeFilename(self, file_server, site, site_temp): + assert site.storage.directory == config.data_dir + "/" + site.address + assert site_temp.storage.directory == config.data_dir + "-temp/" + site.address + + # Init source server + site.connection_server = file_server + file_server.sites[site.address] = site + + # Init client server + client = FileServer(file_server.ip, 1545) + client.sites = {site_temp.address: site_temp} + site_temp.connection_server = client + site_temp.announce = mock.MagicMock(return_value=True) # Don't try to find peers from the net + + site_temp.addPeer(file_server.ip, 1544) + + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) + + site.storage.write("data/img/árvíztűrő.png", b"test") + + site.content_manager.sign("content.json", privatekey="5KUh3PvNm5HUWoCfSUfcYvfQ2g3PrRNJWr6Q9eqdBGu23mtMntv") + + content = site.storage.loadJson("content.json") + assert "data/img/árvíztűrő.png" in content["files"] + assert not site_temp.storage.isFile("data/img/árvíztűrő.png") + settings_before = site_temp.settings + + with Spy.Spy(FileRequest, "route") as requests: + site.publish() + time.sleep(0.1) + assert site_temp.download(blind_includes=True, retry_bad_files=False).get(timeout=10) # Wait for download + assert len([req[1] for req in requests if req[1] == "streamFile"]) == 1 + + content = site_temp.storage.loadJson("content.json") + assert "data/img/árvíztűrő.png" in content["files"] + assert site_temp.storage.isFile("data/img/árvíztűrő.png") + + assert site_temp.settings["size"] == settings_before["size"] + assert site_temp.settings["size_optional"] == settings_before["size_optional"] + + assert site_temp.storage.deleteFiles() + [connection.close() for connection in file_server.connections] diff --git a/src/Test/TestThreadPool.py b/src/Test/TestThreadPool.py new file mode 100644 index 00000000..5e95005e --- /dev/null +++ b/src/Test/TestThreadPool.py @@ -0,0 +1,163 @@ +import time +import threading + +import gevent +import pytest + +from util import ThreadPool + + +class TestThreadPool: + def testExecutionOrder(self): + with ThreadPool.ThreadPool(4) as pool: + events = [] + + @pool.wrap + def blocker(): + events.append("S") + out = 0 + for i in range(10000000): + if i == 3000000: + events.append("M") + out += 1 + events.append("D") + return out + + threads = [] + for i in range(3): + threads.append(gevent.spawn(blocker)) + gevent.joinall(threads) + + assert events == ["S"] * 3 + ["M"] * 3 + ["D"] * 3 + + res = blocker() + assert res == 10000000 + + def testLockBlockingSameThread(self): + lock = ThreadPool.Lock() + + s = time.time() + + def unlocker(): + time.sleep(1) + lock.release() + + gevent.spawn(unlocker) + lock.acquire(True) + lock.acquire(True, timeout=2) + + unlock_taken = time.time() - s + + assert 1.0 < unlock_taken < 1.5 + + def testLockBlockingDifferentThread(self): + lock = ThreadPool.Lock() + + def locker(): + lock.acquire(True) + time.sleep(0.5) + lock.release() + + with ThreadPool.ThreadPool(10) as pool: + threads = [ + pool.spawn(locker), + pool.spawn(locker), + gevent.spawn(locker), + pool.spawn(locker) + ] + time.sleep(0.1) + + s = time.time() + + lock.acquire(True, 5.0) + + unlock_taken = time.time() - s + + assert 1.8 < unlock_taken < 2.2 + + gevent.joinall(threads) + + def testMainLoopCallerThreadId(self): + main_thread_id = threading.current_thread().ident + with ThreadPool.ThreadPool(5) as pool: + def getThreadId(*args, **kwargs): + return threading.current_thread().ident + + t = pool.spawn(getThreadId) + assert t.get() != main_thread_id + + t = pool.spawn(lambda: ThreadPool.main_loop.call(getThreadId)) + assert t.get() == main_thread_id + + def testMainLoopCallerGeventSpawn(self): + main_thread_id = threading.current_thread().ident + with ThreadPool.ThreadPool(5) as pool: + def waiter(): + time.sleep(1) + return threading.current_thread().ident + + def geventSpawner(): + event = ThreadPool.main_loop.call(gevent.spawn, waiter) + + with pytest.raises(Exception) as greenlet_err: + event.get() + assert str(greenlet_err.value) == "cannot switch to a different thread" + + waiter_thread_id = ThreadPool.main_loop.call(event.get) + return waiter_thread_id + + s = time.time() + waiter_thread_id = pool.apply(geventSpawner) + assert main_thread_id == waiter_thread_id + time_taken = time.time() - s + assert 0.9 < time_taken < 1.2 + + def testEvent(self): + with ThreadPool.ThreadPool(5) as pool: + event = ThreadPool.Event() + + def setter(): + time.sleep(1) + event.set("done!") + + def getter(): + return event.get() + + pool.spawn(setter) + t_gevent = gevent.spawn(getter) + t_pool = pool.spawn(getter) + s = time.time() + assert event.get() == "done!" + time_taken = time.time() - s + gevent.joinall([t_gevent, t_pool]) + + assert t_gevent.get() == "done!" + assert t_pool.get() == "done!" + + assert 0.9 < time_taken < 1.2 + + with pytest.raises(Exception) as err: + event.set("another result") + + assert "Event already has value" in str(err.value) + + def testMemoryLeak(self): + import gc + thread_objs_before = [id(obj) for obj in gc.get_objects() if "threadpool" in str(type(obj))] + + def worker(): + time.sleep(0.1) + return "ok" + + def poolTest(): + with ThreadPool.ThreadPool(5) as pool: + for i in range(20): + pool.spawn(worker) + + for i in range(5): + poolTest() + new_thread_objs = [obj for obj in gc.get_objects() if "threadpool" in str(type(obj)) and id(obj) not in thread_objs_before] + #print("New objs:", new_thread_objs, "run:", num_run) + + # Make sure no threadpool object left behind + assert not new_thread_objs diff --git a/src/Test/TestTor.py b/src/Test/TestTor.py index 63ff47f9..0252d73a 100644 --- a/src/Test/TestTor.py +++ b/src/Test/TestTor.py @@ -117,7 +117,7 @@ class TestTor: file_server.tor_manager = tor_manager client = FileServer(file_server.ip, 1545) - client.sites[site_temp.address] = site_temp + client.sites = {site_temp.address: site_temp} site_temp.connection_server = client # Add file_server as peer to client diff --git a/src/Test/TestUiWebsocket.py b/src/Test/TestUiWebsocket.py new file mode 100644 index 00000000..d2d23d03 --- /dev/null +++ b/src/Test/TestUiWebsocket.py @@ -0,0 +1,11 @@ +import sys +import pytest + +@pytest.mark.usefixtures("resetSettings") +class TestUiWebsocket: + def testPermission(self, ui_websocket): + res = ui_websocket.testAction("ping") + assert res == "pong" + + res = ui_websocket.testAction("certList") + assert "You don't have permission" in res["error"] diff --git a/src/Test/TestWorkerTaskManager.py b/src/Test/TestWorkerTaskManager.py new file mode 100644 index 00000000..eb5c4a2a --- /dev/null +++ b/src/Test/TestWorkerTaskManager.py @@ -0,0 +1,128 @@ +import pytest + +from Worker import WorkerTaskManager +from . import Spy + + +class TestUiWebsocket: + def checkSort(self, tasks): # Check if it has the same order as a list sorted separately + tasks_list = list(tasks) + tasks_list.sort(key=lambda task: task["id"]) + assert tasks_list != list(tasks) + tasks_list.sort(key=lambda task: (0 - (task["priority"] - task["workers_num"] * 10), task["id"])) + assert tasks_list == list(tasks) + + def testAppendSimple(self): + tasks = WorkerTaskManager.WorkerTaskManager() + tasks.append({"id": 1, "priority": 15, "workers_num": 1, "inner_path": "file1.json"}) + tasks.append({"id": 2, "priority": 1, "workers_num": 0, "inner_path": "file2.json"}) + tasks.append({"id": 3, "priority": 8, "workers_num": 0, "inner_path": "file3.json"}) + assert [task["inner_path"] for task in tasks] == ["file3.json", "file1.json", "file2.json"] + + self.checkSort(tasks) + + def testAppendMany(self): + tasks = WorkerTaskManager.WorkerTaskManager() + for i in range(1000): + tasks.append({"id": i, "priority": i % 20, "workers_num": i % 3, "inner_path": "file%s.json" % i}) + assert tasks[0]["inner_path"] == "file39.json" + assert tasks[-1]["inner_path"] == "file980.json" + + self.checkSort(tasks) + + def testRemove(self): + tasks = WorkerTaskManager.WorkerTaskManager() + for i in range(1000): + tasks.append({"id": i, "priority": i % 20, "workers_num": i % 3, "inner_path": "file%s.json" % i}) + + i = 333 + task = {"id": i, "priority": i % 20, "workers_num": i % 3, "inner_path": "file%s.json" % i} + assert task in tasks + + with Spy.Spy(tasks, "indexSlow") as calls: + tasks.remove(task) + assert len(calls) == 0 + + assert task not in tasks + + # Remove non existent item + with Spy.Spy(tasks, "indexSlow") as calls: + with pytest.raises(ValueError): + tasks.remove(task) + assert len(calls) == 0 + + self.checkSort(tasks) + + def testRemoveAll(self): + tasks = WorkerTaskManager.WorkerTaskManager() + tasks_list = [] + for i in range(1000): + task = {"id": i, "priority": i % 20, "workers_num": i % 3, "inner_path": "file%s.json" % i} + tasks.append(task) + tasks_list.append(task) + + for task in tasks_list: + tasks.remove(task) + + assert len(tasks.inner_paths) == 0 + assert len(tasks) == 0 + + def testModify(self): + tasks = WorkerTaskManager.WorkerTaskManager() + for i in range(1000): + tasks.append({"id": i, "priority": i % 20, "workers_num": i % 3, "inner_path": "file%s.json" % i}) + + task = tasks[333] + task["priority"] += 10 + + with pytest.raises(AssertionError): + self.checkSort(tasks) + + with Spy.Spy(tasks, "indexSlow") as calls: + tasks.updateItem(task) + assert len(calls) == 1 + + assert task in tasks + + self.checkSort(tasks) + + # Check reorder optimization + with Spy.Spy(tasks, "indexSlow") as calls: + tasks.updateItem(task, "priority", task["priority"] + 10) + assert len(calls) == 0 + + with Spy.Spy(tasks, "indexSlow") as calls: + tasks.updateItem(task, "priority", task["workers_num"] - 1) + assert len(calls) == 0 + + self.checkSort(tasks) + + def testModifySamePriority(self): + tasks = WorkerTaskManager.WorkerTaskManager() + for i in range(1000): + tasks.append({"id": i, "priority": 10, "workers_num": 5, "inner_path": "file%s.json" % i}) + + task = tasks[333] + + # Check reorder optimization + with Spy.Spy(tasks, "indexSlow") as calls: + tasks.updateItem(task, "priority", task["workers_num"] - 1) + assert len(calls) == 0 + + def testIn(self): + tasks = WorkerTaskManager.WorkerTaskManager() + + i = 1 + task = {"id": i, "priority": i % 20, "workers_num": i % 3, "inner_path": "file%s.json" % i} + + assert task not in tasks + + def testFindTask(self): + tasks = WorkerTaskManager.WorkerTaskManager() + for i in range(1000): + tasks.append({"id": i, "priority": i % 20, "workers_num": i % 3, "inner_path": "file%s.json" % i}) + + assert tasks.findTask("file999.json") + assert not tasks.findTask("file-unknown.json") + tasks.remove(tasks.findTask("file999.json")) + assert not tasks.findTask("file999.json") diff --git a/src/Test/conftest.py b/src/Test/conftest.py index 1f068d69..8f9dc3a5 100644 --- a/src/Test/conftest.py +++ b/src/Test/conftest.py @@ -8,15 +8,22 @@ import shutil import gc import datetime import atexit +import threading import pytest import mock import gevent +if "libev" not in str(gevent.config.loop): + # Workaround for random crash when libuv used with threads + gevent.config.loop = "libev-cext" + import gevent.event from gevent import monkey monkey.patch_all(thread=False, subprocess=False) +atexit_register = atexit.register +atexit.register = lambda func: "" # Don't register shutdown functions to avoid IO error on exit def pytest_addoption(parser): parser.addoption("--slow", action='store_true', default=False, help="Also run slow tests") @@ -38,7 +45,7 @@ else: CHROMEDRIVER_PATH = "chromedriver" SITE_URL = "http://127.0.0.1:43110" -TEST_DATA_PATH = 'src/Test/testdata' +TEST_DATA_PATH = 'src/Test/testdata' sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + "/../lib")) # External modules directory sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + "/..")) # Imports relative to src dir @@ -68,26 +75,44 @@ config.verbose = True # Use test data for unittests config.tor = "disable" # Don't start Tor client config.trackers = [] config.data_dir = TEST_DATA_PATH # Use test data for unittests +if "ZERONET_LOG_DIR" in os.environ: + config.log_dir = os.environ["ZERONET_LOG_DIR"] config.initLogging(console_logging=False) # Set custom formatter with realative time format (via: https://stackoverflow.com/questions/31521859/python-logging-module-time-since-last-log) +time_start = time.time() class TimeFilter(logging.Filter): + def __init__(self, *args, **kwargs): + self.time_last = time.time() + self.main_thread_id = threading.current_thread().ident + super().__init__(*args, **kwargs) def filter(self, record): - try: - last = self.last - except AttributeError: - last = record.relativeCreated + if threading.current_thread().ident != self.main_thread_id: + record.thread_marker = "T" + record.thread_title = "(Thread#%s)" % self.main_thread_id + else: + record.thread_marker = " " + record.thread_title = "" - delta = datetime.datetime.fromtimestamp(record.relativeCreated / 1000.0) - datetime.datetime.fromtimestamp(last / 1000.0) + since_last = time.time() - self.time_last + if since_last > 0.1: + line_marker = "!" + elif since_last > 0.02: + line_marker = "*" + elif since_last > 0.01: + line_marker = "-" + else: + line_marker = " " - record.relative = '{0:.3f}'.format(delta.seconds + delta.microseconds / 1000000.0) + since_start = time.time() - time_start + record.since_start = "%s%.3fs" % (line_marker, since_start) - self.last = record.relativeCreated + self.time_last = time.time() return True log = logging.getLogger() -fmt = logging.Formatter(fmt='+%(relative)ss %(levelname)-8s %(name)s %(message)s') +fmt = logging.Formatter(fmt='%(since_start)s %(thread_marker)s %(levelname)-8s %(name)s %(message)s %(thread_title)s') [hndl.addFilter(TimeFilter()) for hndl in log.handlers] [hndl.setFormatter(fmt) for hndl in log.handlers] @@ -105,19 +130,21 @@ from util import RateLimit from Db import Db from Debug import Debug +gevent.get_hub().NOT_ERROR += (Debug.Notify,) def cleanup(): Db.dbCloseAll() for dir_path in [config.data_dir, config.data_dir + "-temp"]: - for file_name in os.listdir(dir_path): - ext = file_name.rsplit(".", 1)[-1] - if ext not in ["csr", "pem", "srl", "db", "json", "tmp"]: - continue - file_path = dir_path + "/" + file_name - if os.path.isfile(file_path): - os.unlink(file_path) + if os.path.isdir(dir_path): + for file_name in os.listdir(dir_path): + ext = file_name.rsplit(".", 1)[-1] + if ext not in ["csr", "pem", "srl", "db", "json", "tmp"]: + continue + file_path = dir_path + "/" + file_name + if os.path.isfile(file_path): + os.unlink(file_path) -atexit.register(cleanup) +atexit_register(cleanup) @pytest.fixture(scope="session") def resetSettings(request): @@ -177,10 +204,9 @@ def site(request): site.announce = mock.MagicMock(return_value=True) # Don't try to find peers from the net def cleanup(): - site.storage.deleteFiles() - site.content_manager.contents.db.deleteSite(site) - del SiteManager.site_manager.sites["1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT"] - site.content_manager.contents.db.close() + site.delete() + site.content_manager.contents.db.close("Test cleanup") + site.content_manager.contents.db.timer_check_optional.kill() SiteManager.site_manager.sites.clear() db_path = "%s/content.db" % config.data_dir os.unlink(db_path) @@ -188,10 +214,12 @@ def site(request): gevent.killall([obj for obj in gc.get_objects() if isinstance(obj, gevent.Greenlet) and obj not in threads_before]) request.addfinalizer(cleanup) + site.greenlet_manager.stopGreenlets() site = Site("1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT") # Create new Site object to load content.json files if not SiteManager.site_manager.sites: SiteManager.site_manager.sites = {} SiteManager.site_manager.sites["1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT"] = site + site.settings["serving"] = True return site @@ -200,17 +228,19 @@ def site_temp(request): threads_before = [obj for obj in gc.get_objects() if isinstance(obj, gevent.Greenlet)] with mock.patch("Config.config.data_dir", config.data_dir + "-temp"): site_temp = Site("1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT") + site_temp.settings["serving"] = True site_temp.announce = mock.MagicMock(return_value=True) # Don't try to find peers from the net def cleanup(): - site_temp.storage.deleteFiles() - site_temp.content_manager.contents.db.deleteSite(site_temp) - site_temp.content_manager.contents.db.close() + site_temp.delete() + site_temp.content_manager.contents.db.close("Test cleanup") + site_temp.content_manager.contents.db.timer_check_optional.kill() db_path = "%s-temp/content.db" % config.data_dir os.unlink(db_path) del ContentDb.content_dbs[db_path] gevent.killall([obj for obj in gc.get_objects() if isinstance(obj, gevent.Greenlet) and obj not in threads_before]) request.addfinalizer(cleanup) + site_temp.log = logging.getLogger("Temp:%s" % site_temp.address_short) return site_temp @@ -324,10 +354,13 @@ def ui_websocket(site, user): self.result = gevent.event.AsyncResult() def send(self, data): + logging.debug("WsMock: Set result (data: %s) called by %s" % (data, Debug.formatStack())) self.result.set(json.loads(data)["result"]) def getResult(self): + logging.debug("WsMock: Get result") back = self.result.get() + logging.debug("WsMock: Got result (data: %s)" % back) self.result = gevent.event.AsyncResult() return back @@ -335,9 +368,8 @@ def ui_websocket(site, user): ui_websocket = UiWebsocket(ws_mock, site, None, user, None) def testAction(action, *args, **kwargs): - func = getattr(ui_websocket, "action%s" % action) - func(0, *args, **kwargs) - return ui_websocket.ws.result.get() + ui_websocket.handleRequest({"id": 0, "cmd": action, "params": list(args) if args else kwargs}) + return ui_websocket.ws.getResult() ui_websocket.testAction = testAction return ui_websocket @@ -397,21 +429,58 @@ def db(request): db.checkTables() def stop(): - db.close() + db.close("Test db cleanup") os.unlink(db_path) request.addfinalizer(stop) return db -@pytest.fixture(params=["btctools", "openssl", "libsecp256k1"]) +@pytest.fixture(params=["sslcrypto", "sslcrypto_fallback", "libsecp256k1"]) def crypt_bitcoin_lib(request, monkeypatch): monkeypatch.setattr(CryptBitcoin, "lib_verify_best", request.param) CryptBitcoin.loadLib(request.param) return CryptBitcoin -# Workaround for pytest>=0.4.1 bug when logging in atexit handlers (I/O operation on closed file) +@pytest.fixture(scope='function', autouse=True) +def logCaseStart(request): + global time_start + time_start = time.time() + logging.debug("---- Start test case: %s ----" % request._pyfuncitem) + yield None # Wait until all test done + + +# Workaround for pytest bug when logging in atexit/post-fixture handlers (I/O operation on closed file) +def workaroundPytestLogError(): + import _pytest.capture + write_original = _pytest.capture.EncodedFile.write + + def write_patched(obj, *args, **kwargs): + try: + write_original(obj, *args, **kwargs) + except ValueError as err: + if str(err) == "I/O operation on closed file": + pass + else: + raise err + + def flush_patched(obj, *args, **kwargs): + try: + obj.buffer.flush(*args, **kwargs) + except ValueError as err: + if str(err).startswith("I/O operation on closed file"): + pass + else: + raise err + + _pytest.capture.EncodedFile.write = write_patched + _pytest.capture.EncodedFile.flush = flush_patched + + +workaroundPytestLogError() + @pytest.fixture(scope='session', autouse=True) def disableLog(): yield None # Wait until all test done logging.getLogger('').setLevel(logging.getLevelName(logging.CRITICAL)) + diff --git a/src/Test/pytest.ini b/src/Test/pytest.ini index d09210d1..556389a2 100644 --- a/src/Test/pytest.ini +++ b/src/Test/pytest.ini @@ -1,5 +1,6 @@ [pytest] python_files = Test*.py -addopts = -rsxX -v --durations=6 +addopts = -rsxX -v --durations=6 --no-print-logs --capture=fd markers = - webtest: mark a test as a webtest. \ No newline at end of file + slow: mark a tests as slow. + webtest: mark a test as a webtest. diff --git a/src/Tor/TorManager.py b/src/Tor/TorManager.py index fafe51eb..7e5c8bb0 100644 --- a/src/Tor/TorManager.py +++ b/src/Tor/TorManager.py @@ -15,11 +15,7 @@ from Config import config from Crypt import CryptRsa from Site import SiteManager import socks -try: - from gevent.coros import RLock -except: - from gevent.lock import RLock -from util import helper +from gevent.lock import RLock from Debug import Debug from Plugin import PluginManager @@ -38,6 +34,7 @@ class TorManager(object): self.lock = RLock() self.starting = True self.connecting = True + self.status = None self.event_started = gevent.event.AsyncResult() if config.tor == "disable": @@ -64,7 +61,7 @@ class TorManager(object): self.starting = True try: if not self.connect(): - raise Exception("No connection") + raise Exception(self.status) self.log.debug("Tor proxy port %s check ok" % config.tor_proxy) except Exception as err: if sys.platform.startswith("win") and os.path.isfile(self.tor_exe): @@ -72,7 +69,8 @@ class TorManager(object): # Change to self-bundled Tor ports self.port = 49051 self.proxy_port = 49050 - socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", self.proxy_port) + if config.tor == "always": + socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", self.proxy_port) self.enabled = True if not self.connect(): self.startTor() @@ -154,6 +152,9 @@ class TorManager(object): res_auth = self.send('AUTHENTICATE "%s"' % config.tor_password, conn) elif cookie_match: cookie_file = cookie_match.group(1).encode("ascii").decode("unicode_escape") + if not os.path.isfile(cookie_file) and self.tor_process: + # Workaround for tor client cookie auth file utf8 encoding bug (https://github.com/torproject/stem/issues/57) + cookie_file = os.path.dirname(self.tor_exe) + "\\data\\control_auth_cookie" auth_hex = binascii.b2a_hex(open(cookie_file, "rb").read()) res_auth = self.send("AUTHENTICATE %s" % auth_hex.decode("utf8"), conn) else: diff --git a/src/Translate/Translate.py b/src/Translate/Translate.py index 4163d333..066133d1 100644 --- a/src/Translate/Translate.py +++ b/src/Translate/Translate.py @@ -28,7 +28,7 @@ class EscapeProxy(dict): class Translate(dict): def __init__(self, lang_dir=None, lang=None): if not lang_dir: - lang_dir = "src/Translate/languages/" + lang_dir = os.path.dirname(__file__) + "/languages/" if not lang: lang = config.language self.lang = lang diff --git a/src/Translate/languages/fa.json b/src/Translate/languages/fa.json new file mode 100644 index 00000000..e644247a --- /dev/null +++ b/src/Translate/languages/fa.json @@ -0,0 +1,50 @@ +{ + "Congratulations, your port {0} is opened.
    You are a full member of the ZeroNet network!": "تبریک، درگاه {0} شما باز شده است.
    شما یک عضو تمام شبکه ZeroNet هستید!", + "Tor mode active, every connection using Onion route.": "حالت Tor فعال است، هر ارتباط از مسیریابی پیاز (Onion) استفاده می‌کند.", + "Successfully started Tor onion hidden services.": "خدمات پنهان پیاز (Onion) Tor با موفقیت راه‌اندازی شد.", + "Unable to start hidden services, please check your config.": "قادر به راه‌اندازی خدمات پنهان نیستیم، لطفا تنظیمات خود را بررسی نمایید.", + "For faster connections open {0} port on your router.": "برای ارتباطات سریعتر درگاه {0} را بر روی مسیریاب (روتر) خود باز نمایید.", + "Your connection is restricted. Please, open {0} port on your router": "ارتباط شما محدود‌شده است. لطفا درگاه {0} را در مسیریاب (روتر) خود باز نمایید", + "or configure Tor to become a full member of the ZeroNet network.": "یا پیکربندی Tor را انجام دهید تا به یک عضو تمام شبکه ZeroNet تبدیل شوید.", + + "Select account you want to use in this site:": "حسابی را که می‌خواهید در این سایت استفاده کنید، انتخاب کنید:", + "currently selected": "در حال حاضر انتخاب‌شده", + "Unique to site": "مختص به سایت", + + "Content signing failed": "امضای محتوا با شکست مواجه شد", + "Content publish queued for {0:.0f} seconds.": "محتوا در صف انتشار با {0:.0f} ثانیه تاخیر قرار گرفت.", + "Content published to {0} peers.": "محتوا برای {0} تعداد همتا انتشار یافت.", + "No peers found, but your content is ready to access.": "همتایی یافت نشد، اما محتوای شما آماده دسترسی است.", + "Your network connection is restricted. Please, open {0} port": "ارتباط شبکه شما محدود‌شده است. لطفا درگاه {0} را", + "on your router to make your site accessible for everyone.": "در مسیریاب (روتر) خود باز کنید تا سایت خود را برای همه در دسترس قرار دهید.", + "Content publish failed.": "انتشار محتوا موفق نبود.", + "This file still in sync, if you write it now, then the previous content may be lost.": "این فایل همچنان همگام است، اگز شما آن را بنویسید، ممکن است محتوای قبلی از‌بین رود.", + "Write content anyway": "در هر صورت محتوا را بنویس", + "New certificate added:": "گواهی جدیدی افزوده شد:", + "You current certificate:": "گواهی فعلی شما:", + "Change it to {auth_type}/{auth_user_name}@{domain}": "تغییرش بده به {auth_type}/{auth_user_name}@{domain}", + "Certificate changed to: {auth_type}/{auth_user_name}@{domain}.": "گواهینامه به: {auth_type}/{auth_user_name}@{domain} تغییر پیدا کرد.", + "Site cloned": "سایت همسان‌سازی شد", + + "You have successfully changed the web interface's language!": "شما با موفقیت زبان رابط وب را تغییر دادید!", + "Due to the browser's caching, the full transformation could take some minute.": "به دلیل ذخیره‌سازی در مرور‌گر، امکان دارد تغییر شکل کامل چند دقیقه طول بکشد.", + + "Connection with UiServer Websocket was lost. Reconnecting...": "اتصال با UiServer Websocket قطع شد. اتصال دوباره...", + "Connection with UiServer Websocket recovered.": "ارتباط با UiServer Websocket دوباره بر‌قرار شد.", + "UiServer Websocket error, please reload the page.": "خطای UiServer Websocket, لطفا صفحه را دوباره بارگیری کنید.", + "   Connecting...": "   برقراری ارتباط...", + "Site size: ": "حجم سایت: ", + "MB is larger than default allowed ": "MB بیشتر از پیش‌فرض مجاز است ", + "Open site and set size limit to \" + site_info.next_size_limit + \"MB": "سایت را باز کرده و محدوده حجم را به \" + site_info.next_size_limit + \"MB تنظیم کن", + " files needs to be downloaded": " فایل‌هایی که نیاز است، دانلود شوند", + " downloaded": " دانلود شد", + " download failed": " دانلود موفق نبود", + "Peers found: ": "چند همتا یافت شد: ", + "No peers found": "همتایی یافت نشد", + "Running out of size limit (": "عبور کرده از محدوده حجم (", + "Set limit to \" + site_info.next_size_limit + \"MB": "محدوده را به \" + site_info.next_size_limit + \"MB تنظیم کن", + "Site size limit changed to {0}MB": "محدوده حجم سایت به {0}MB تغییر کرد", + " New version of this page has just released.
    Reload to see the modified content.": " نسخه جدیدی از این صفحه منتشر شده است.
    برای مشاهده محتوای تغییر‌یافته دوباره بارگیری نمایید.", + "This site requests permission:": "این سایت درخواست مجوز می‌کند:", + "_(Accept)": "_(پذیرفتن)" +} diff --git a/src/Translate/languages/jp.json b/src/Translate/languages/jp.json index 9978acc7..5f858dd6 100644 --- a/src/Translate/languages/jp.json +++ b/src/Translate/languages/jp.json @@ -1,82 +1,57 @@ { - "Peers": "ピア", - "Connected": "接続済み", - "Connectable": "利用可能", - "Connectable peers": "ピアに接続可能", + "Congratulations, your port {0} is opened.
    You are a full member of the ZeroNet network!": "おめでとうございます。ポート {0} が開きました。これでZeroNetネットワークのメンバーです。", + "Tor mode active, every connection using Onion route.": "Torモードがアクティブです、全ての接続はOnionルートを使用します。", + "Successfully started Tor onion hidden services.": "Tor onionサービスを正常に開始しました。", + "Unable to start hidden services, please check your config.": "非表示のサービスを開始できません。設定を確認してください。", + "For faster connections open {0} port on your router.": "接続を高速化するにはルーターのポート {0} を開けてください。", + "Your connection is restricted. Please, open {0} port on your router": "接続が制限されています。ルーターのポート {0} を開けてください。", + "or configure Tor to become a full member of the ZeroNet network.": "または、TorをZeroNetネットワークのメンバーになるように設定してください。", - "Data transfer": "データ転送", - "Received": "受信", - "Received bytes": "受信バイト数", - "Sent": "送信", - "Sent bytes": "送信バイト数", + "Select account you want to use in this site:": "このサイトで使用するアカウントを選択:", + "currently selected": "現在選択中", + "Unique to site": "サイト固有", - "Files": "ファイル", - "Total": "合計", - "Image": "画像", - "Other": "その他", - "User data": "ユーザーデータ", + "Content signing failed": "コンテンツの署名に失敗", + "Content publish queued for {0:.0f} seconds.": "コンテンツの公開は{0:.0f}秒のキューに入れられました。", + "Content published to {0} peers.": "{0}ピアに公開されたコンテンツ。", + "No peers found, but your content is ready to access.": "ピアは見つかりませんでしたが、コンテンツにアクセスする準備ができました。", + "Your network connection is restricted. Please, open {0} port": "ネットワーク接続が制限されています。ポート {0} を開いて、", + "on your router to make your site accessible for everyone.": "誰でもサイトにアクセスできるようにしてください。", + "Content publish failed.": "コンテンツの公開に失敗しました。", + "This file still in sync, if you write it now, then the previous content may be lost.": "このファイルはまだ同期しています。今すぐ書き込むと、前のコンテンツが失われる可能性があります。", + "Write content anyway": "とにかくコンテンツを書く", + "New certificate added:": "新しい証明書が追加されました:", + "You current certificate:": "現在の証明書:", + "Change it to {auth_type}/{auth_user_name}@{domain}": "{auth_type}/{auth_user_name}@{domain} に変更", + "Certificate changed to: {auth_type}/{auth_user_name}@{domain}.": "変更後の証明書: {auth_type}/{auth_user_name}@{domain}", + "Site cloned": "複製されたサイト", - "Size limit": "サイズ制限", - "limit used": "使用上限", - "free space": "フリースペース", - "Set": "セット", + "You have successfully changed the web interface's language!": "Webインターフェースの言語が正常に変更されました!", + "Due to the browser's caching, the full transformation could take some minute.": "ブラウザのキャッシュにより、完全な変換には数分かかる場合があります。", - "Optional files": "オプション ファイル", - "Downloaded": "ダウンロード済み", - "Download and help distribute all files": "ダウンロードしてすべてのファイルの配布を支援する", - "Total size": "合計サイズ", - "Downloaded files": "ダウンロードされたファイル", + "Connection with UiServer Websocket was lost. Reconnecting...": "UiServer Websocketとの接続が失われました。再接続しています...", + "Connection with UiServer Websocket recovered.": "UiServer Websocketとの接続が回復しました。", + "UiServer Websocket error, please reload the page.": "UiServer Websocketエラー、ページをリロードしてください。", + "   Connecting...": "   接続しています...", + "Site size: ": "サイトサイズ: ", + "MB is larger than default allowed ": "MBはデフォルトの許容値よりも大きいです。 ", + "Open site and set size limit to \" + site_info.next_size_limit + \"MB": "サイトを開き、サイズ制限を \" + site_info.next_size_limit + \"MB に設定", + " files needs to be downloaded": " ファイルをダウンロードする必要があります", + " downloaded": " ダウンロード", + " download failed": " ダウンロード失敗", + "Peers found: ": "ピアが見つかりました: ", + "No peers found": "ピアが見つかりません", + "Running out of size limit (": "サイズ制限を使い果たしました (", + "Set limit to \" + site_info.next_size_limit + \"MB": "制限を \" + site_info.next_size_limit + \"MB に設定", + "Site size limit changed to {0}MB": "サイトのサイズ制限が {0}MB に変更されました", + " New version of this page has just released.
    Reload to see the modified content.": " このページの新しいバージョンが公開されました。
    変更されたコンテンツを見るには再読み込みしてください。", + "This site requests permission:": "このサイトは権限を要求しています:", + "_(Accept)": "_(許可)", + + "Save": "保存", + "Trackers announcing": "トラッカーをお知らせ", + "Error": "エラー", + "Done": "完了", + "Tracker connection error detected.": "トラッカー接続エラーが検出されました。" - "Database": "データベース", - "search feeds": "フィードを検索する", - "{feeds} query": "{フィード} お問い合わせ", - "Reload": "再読込", - "Rebuild": "再ビルド", - "No database found": "データベースが見つかりません", - - "Identity address": "Identity address", - "Change": "編集", - - "Site control": "サイト管理", - "Update": "更新", - "Pause": "一時停止", - "Resume": "再開", - "Delete": "削除", - "Are you sure?": "本当によろしいですか?", - - "Site address": "サイトアドレス", - "Donate": "寄付する", - - "Missing files": "ファイルがありません", - "{} try": "{} 試す", - "{} tries": "{} 試行", - "+ {num_bad_files} more": "+ {num_bad_files} more", - - "This is my site": "This is my site", - "Site title": "サイトタイトル", - "Site description": "サイトの説明", - "Save site settings": "サイトの設定を保存する", - - "Content publishing": "コンテンツを公開する", - "Choose": "選択", - "Sign": "Sign", - "Publish": "公開する", - - "This function is disabled on this proxy": "この機能はこのプロキシで無効になっています", - "GeoLite2 City database download error: {}!
    Please download manually and unpack to data dir:
    {}": "GeoLite2 Cityデータベースのダウンロードエラー: {}!
    手動でダウンロードして、フォルダに解凍してください。:
    {}", - "Downloading GeoLite2 City database (one time only, ~20MB)...": "GeoLite2 Cityデータベースの読み込み (これは一度だけ行われます, ~20MB)...", - "GeoLite2 City database downloaded!": "GeoLite2 Cityデータベースがダウンロードされました!", - - "Are you sure?": "本当によろしいですか?", - "Site storage limit modified!": "サイトの保存容量の制限が変更されました!", - "Database schema reloaded!": "データベーススキーマがリロードされました!", - "Database rebuilding....": "データベースの再構築中....", - "Database rebuilt!": "データベースが再構築されました!", - "Site updated!": "サイトが更新されました!", - "Delete this site": "このサイトを削除する", - "File write error: ": "ファイル書き込みエラー:", - "Site settings saved!": "サイト設定が保存されました!", - "Enter your private key:": "秘密鍵を入力してください:", - " Signed!": " Signed!", - "WebGL not supported": "WebGLはサポートされていません" -} \ No newline at end of file +} diff --git a/src/Translate/languages/pl.json b/src/Translate/languages/pl.json index 75caeceb..679e909d 100644 --- a/src/Translate/languages/pl.json +++ b/src/Translate/languages/pl.json @@ -13,8 +13,8 @@ "Content signing failed": "Podpisanie treści zawiodło", "Content publish queued for {0:.0f} seconds.": "Publikacja treści wstrzymana na {0:.0f} sekund(y).", - "Content published to {0} peers.": "Treść opublikowana do {0} uzytkowników równorzednych.", - "No peers found, but your content is ready to access.": "Nie odnaleziono użytkowników równorzędnych, ale twoja treść jest dostępna.", + "Content published to {0} peers.": "Treść opublikowana do {0} uzytkowników.", + "No peers found, but your content is ready to access.": "Nie odnaleziono użytkowników, ale twoja treść jest dostępna.", "Your network connection is restricted. Please, open {0} port": "Twoje połączenie sieciowe jest ograniczone. Proszę, otwórz port {0}", "on your router to make your site accessible for everyone.": "w swoim routerze, by twoja strona mogłabyć dostępna dla wszystkich.", "Content publish failed.": "Publikacja treści zawiodła.", @@ -39,13 +39,16 @@ " files needs to be downloaded": " pliki muszą zostać ściągnięte", " downloaded": " ściągnięte", " download failed": " ściąganie nie powiodło się", - "Peers found: ": "Odnaleziono użytkowników równorzednych: ", - "No peers found": "Nie odnaleziono użytkowników równorzędnych", + "Peers found: ": "Odnaleziono użytkowników: ", + "No peers found": "Nie odnaleziono użytkowników", "Running out of size limit (": "Limit rozmiaru na wyczerpaniu (", "Set limit to \" + site_info.next_size_limit + \"MB": "Ustaw limit na \" + site_info.next_size_limit + \"MBów", "Site size limit changed to {0}MB": "Rozmiar limitu strony zmieniony na {0}MBów", " New version of this page has just released.
    Reload to see the modified content.": "Nowa wersja tej strony właśnie została wydana.
    Odśwież by zobaczyć nową, zmodyfikowaną treść strony.", "This site requests permission:": "Ta strona wymaga uprawnień:", - "_(Accept)": "Przyznaj uprawnienia" + "_(Accept)": "Przyznaj uprawnienia", + "Sign and publish": "Podpisz i opublikuj", + "Restart ZeroNet client?": "Uruchomić ponownie klienta ZeroNet?", + "Restart": "Uruchom ponownie" } diff --git a/src/Ui/UiRequest.py b/src/Ui/UiRequest.py index 48599fda..51730954 100644 --- a/src/Ui/UiRequest.py +++ b/src/Ui/UiRequest.py @@ -5,6 +5,7 @@ import mimetypes import json import html import urllib +import socket import gevent @@ -25,6 +26,20 @@ status_texts = { 500: "500 Internal Server Error", } +content_types = { + "asc": "application/pgp-keys", + "css": "text/css", + "gpg": "application/pgp-encrypted", + "html": "text/html", + "js": "application/javascript", + "json": "application/json", + "sig": "application/pgp-signature", + "txt": "text/plain", + "webmanifest": "application/manifest+json", + "wasm": "application/wasm", + "webp": "image/webp" +} + class SecurityError(Exception): pass @@ -68,13 +83,19 @@ class UiRequest(object): return True if self.isProxyRequest(): # Support for chrome extension proxy - if self.server.site_manager.isDomain(host): + if self.isDomain(host): return True else: return False return False + def isDomain(self, address): + return self.server.site_manager.isDomainCached(address) + + def resolveDomain(self, domain): + return self.server.site_manager.resolveDomainCached(domain) + # Call the request handler function base on path def route(self, path): # Restict Ui access by ip @@ -83,10 +104,25 @@ class UiRequest(object): # Check if host allowed to do request if not self.isHostAllowed(self.env.get("HTTP_HOST")): - return self.error403("Invalid host: %s" % self.env.get("HTTP_HOST"), details=False) + ret_error = next(self.error403("Invalid host: %s" % self.env.get("HTTP_HOST"), details=False)) + + http_get = self.env["PATH_INFO"] + if self.env["QUERY_STRING"]: + http_get += "?{0}".format(self.env["QUERY_STRING"]) + self_host = self.env["HTTP_HOST"].split(":")[0] + self_ip = self.env["HTTP_HOST"].replace(self_host, socket.gethostbyname(self_host)) + link = "http://{0}{1}".format(self_ip, http_get) + ret_body = """ +

    Start the client with --ui_host "{host}" argument

    +

    or access via ip: {link}

    + """.format( + host=html.escape(self.env["HTTP_HOST"]), + link=html.escape(link) + ).encode("utf8") + return iter([ret_error, ret_body]) # Prepend .bit host for transparent proxy - if self.server.site_manager.isDomain(self.env.get("HTTP_HOST")): + if self.isDomain(self.env.get("HTTP_HOST")): path = re.sub("^/", "/" + self.env.get("HTTP_HOST") + "/", path) path = re.sub("^http://zero[/]+", "/", path) # Remove begining http://zero/ for chrome extension path = re.sub("^http://", "/", path) # Remove begining http for chrome extension .bit access @@ -109,8 +145,8 @@ class UiRequest(object): if path == "/": return self.actionIndex() - elif path == "/favicon.ico": - return self.actionFile("src/Ui/media/img/favicon.ico") + elif path in ("/favicon.ico", "/apple-touch-icon.png"): + return self.actionFile("src/Ui/media/img/%s" % path) # Internal functions elif "/ZeroNet-Internal/" in path: path = re.sub(".*?/ZeroNet-Internal/", "/", path) @@ -163,7 +199,7 @@ class UiRequest(object): # The request is proxied by chrome extension or a transparent proxy def isProxyRequest(self): - return self.env["PATH_INFO"].startswith("http://") or (self.server.allow_trans_proxy and self.server.site_manager.isDomain(self.env.get("HTTP_HOST"))) + return self.env["PATH_INFO"].startswith("http://") or (self.server.allow_trans_proxy and self.isDomain(self.env.get("HTTP_HOST"))) def isWebSocketRequest(self): return self.env.get("HTTP_UPGRADE") == "websocket" @@ -176,14 +212,10 @@ class UiRequest(object): file_name = file_name.lower() ext = file_name.rsplit(".", 1)[-1] - if ext == "css": # Force correct css content type - content_type = "text/css" - elif ext == "js": # Force correct javascript content type - content_type = "text/javascript" - elif ext == "json": # Correct json header - content_type = "application/json" - elif ext in ("ttf", "woff", "otf", "woff2", "eot"): - content_type = "application/font" + if ext in content_types: + content_type = content_types[ext] + elif ext in ("ttf", "woff", "otf", "woff2", "eot", "sfnt", "collection"): + content_type = "font/%s" % ext else: content_type = mimetypes.guess_type(file_name)[0] @@ -253,13 +285,11 @@ class UiRequest(object): headers["X-Frame-Options"] = "SAMEORIGIN" if content_type != "text/html" and self.env.get("HTTP_REFERER") and self.isSameOrigin(self.getReferer(), self.getRequestUrl()): headers["Access-Control-Allow-Origin"] = "*" # Allow load font files from css - if content_type == "text/javascript" and not self.env.get("HTTP_REFERER"): - headers["Access-Control-Allow-Origin"] = "*" # Allow loading JavaScript modules in Chrome if noscript: - headers["Content-Security-Policy"] = "default-src 'none'; sandbox allow-top-navigation allow-forms; img-src 'self'; font-src 'self'; media-src 'self'; style-src 'self' 'unsafe-inline';" + headers["Content-Security-Policy"] = "default-src 'none'; sandbox allow-top-navigation allow-forms; img-src *; font-src * data:; media-src *; style-src * 'unsafe-inline';" elif script_nonce and self.isScriptNonceSupported(): - headers["Content-Security-Policy"] = "default-src 'none'; script-src 'nonce-{0}'; img-src 'self'; style-src 'self' 'unsafe-inline'; connect-src *; frame-src 'self'".format(script_nonce) + headers["Content-Security-Policy"] = "default-src 'none'; script-src 'nonce-{0}'; img-src 'self' blob: data:; style-src 'self' blob: 'unsafe-inline'; connect-src *; frame-src 'self' blob:".format(script_nonce) if allow_ajax: headers["Access-Control-Allow-Origin"] = "null" @@ -269,20 +299,19 @@ class UiRequest(object): headers["Access-Control-Allow-Headers"] = "Origin, X-Requested-With, Content-Type, Accept, Cookie, Range" headers["Access-Control-Allow-Credentials"] = "true" - if content_type == "text/html": - content_type = "text/html; charset=utf-8" - if content_type == "text/plain": - content_type = "text/plain; charset=utf-8" - # Download instead of display file types that can be dangerous if re.findall("/svg|/xml|/x-shockwave-flash|/pdf", content_type): headers["Content-Disposition"] = "attachment" cacheable_type = ( - content_type == "text/css" or content_type.startswith("image") or content_type.startswith("video") or - self.env["REQUEST_METHOD"] == "OPTIONS" or content_type == "application/javascript" + self.env["REQUEST_METHOD"] == "OPTIONS" or + content_type.split("/", 1)[0] in ("image", "video", "font") or + content_type in ("application/javascript", "text/css") ) + if content_type in ("text/plain", "text/html", "text/css", "application/javascript", "application/json", "application/manifest+json"): + content_type += "; charset=utf-8" + if status in (200, 206) and cacheable_type: # Cache Css, Js, Image files for 10min headers["Cache-Control"] = "public, max-age=600" # Cache 10 min else: @@ -294,9 +323,16 @@ class UiRequest(object): # Renders a template def render(self, template_path, *args, **kwargs): template = open(template_path, encoding="utf8").read() - for key, val in list(kwargs.items()): - template = template.replace("{%s}" % key, "%s" % val) - return template.encode("utf8") + + def renderReplacer(m): + if m.group(1) in kwargs: + return "%s" % kwargs.get(m.group(1), "") + else: + return m.group(0) + + template_rendered = re.sub("{(.*?)}", renderReplacer, template) + + return template_rendered.encode("utf8") # - Actions - @@ -337,7 +373,7 @@ class UiRequest(object): return self.error403("WebSocket request not allowed to load wrapper") # No websocket if "text/html" not in self.env.get("HTTP_ACCEPT", ""): - return self.error403("Invalid Accept header to load wrapper") + return self.error403("Invalid Accept header to load wrapper: %s" % self.env.get("HTTP_ACCEPT", "")) if "prefetch" in self.env.get("HTTP_X_MOZ", "") or "prefetch" in self.env.get("HTTP_PURPOSE", ""): return self.error403("Prefetch not allowed to load wrapper") @@ -378,6 +414,16 @@ class UiRequest(object): else: return "/" + address + def getWsServerUrl(self): + if self.isProxyRequest(): + if self.env["REMOTE_ADDR"] == "127.0.0.1": # Local client, the server address also should be 127.0.0.1 + server_url = "http://127.0.0.1:%s" % self.env["SERVER_PORT"] + else: # Remote client, use SERVER_NAME as server's real address + server_url = "http://%s:%s" % (self.env["SERVER_NAME"], self.env["SERVER_PORT"]) + else: + server_url = "" + return server_url + def processQueryString(self, site, query_string): match = re.search("zeronet_peers=(.*?)(&|$)", query_string) if match: @@ -414,6 +460,9 @@ class UiRequest(object): file_url = "/" + address + "/" + inner_path root_url = "/" + address + "/" + if self.isProxyRequest(): + self.server.allowed_ws_origins.add(self.env["HTTP_HOST"]) + # Wrapper variable inits body_style = "" meta_tags = "" @@ -430,15 +479,12 @@ class UiRequest(object): inner_query_string = "?wrapper_nonce=%s" % wrapper_nonce if self.isProxyRequest(): # Its a remote proxy request - if self.env["REMOTE_ADDR"] == "127.0.0.1": # Local client, the server address also should be 127.0.0.1 - server_url = "http://127.0.0.1:%s" % self.env["SERVER_PORT"] - else: # Remote client, use SERVER_NAME as server's real address - server_url = "http://%s:%s" % (self.env["SERVER_NAME"], self.env["SERVER_PORT"]) homepage = "http://zero/" + config.homepage else: # Use relative path - server_url = "" homepage = "/" + config.homepage + server_url = self.getWsServerUrl() # Real server url for WS connections + user = self.getCurrentUser() if user: theme = user.settings.get("theme", "light") @@ -513,8 +559,18 @@ class UiRequest(object): def isSameOrigin(self, url_a, url_b): if not url_a or not url_b: return False - origin_a = re.sub("http[s]{0,1}://(.*?/.*?/).*", "\\1", url_a) - origin_b = re.sub("http[s]{0,1}://(.*?/.*?/).*", "\\1", url_b) + + url_a = url_a.replace("/raw/", "/") + url_b = url_b.replace("/raw/", "/") + + origin_pattern = "http[s]{0,1}://(.*?/.*?/).*" + is_origin_full = re.match(origin_pattern, url_a) + if not is_origin_full: # Origin looks trimmed to host, require only same host + origin_pattern = "http[s]{0,1}://(.*?/).*" + + origin_a = re.sub(origin_pattern, "\\1", url_a) + origin_b = re.sub(origin_pattern, "\\1", url_b) + return origin_a == origin_b # Return {address: 1Site.., inner_path: /data/users.json} from url path @@ -530,6 +586,8 @@ class UiRequest(object): match = re.match(r"/media/(?P
    [A-Za-z0-9]+[A-Za-z0-9\._-]+)(?P/.*|$)", path) if match: path_parts = match.groupdict() + if self.isDomain(path_parts["address"]): + path_parts["address"] = self.resolveDomain(path_parts["address"]) path_parts["request_address"] = path_parts["address"] # Original request address (for Merger sites) path_parts["inner_path"] = path_parts["inner_path"].lstrip("/") if not path_parts["inner_path"]: @@ -549,9 +607,10 @@ class UiRequest(object): return self.error404(path) address = path_parts["address"] + file_path = "%s/%s/%s" % (config.data_dir, address, path_parts["inner_path"]) - if config.debug and file_path.split("/")[-1].startswith("all."): + if (config.debug or config.merge_media) and file_path.split("/")[-1].startswith("all."): # If debugging merge *.css to all.css and *.js to all.js site = self.server.sites.get(address) if site and site.settings["own"]: @@ -607,7 +666,7 @@ class UiRequest(object): # File not in allowed path return self.error403() else: - if config.debug and match.group("inner_path").startswith("all."): + if (config.debug or config.merge_media) and match.group("inner_path").startswith("all."): # If debugging merge *.css to all.css and *.js to all.js from Debug import DebugMedia DebugMedia.merge(file_path) @@ -617,13 +676,15 @@ class UiRequest(object): return self.error400() def actionSiteAdd(self): - post = dict(urllib.parse.parse_qsl(self.env["wsgi.input"].read())) + post_data = self.env["wsgi.input"].read().decode() + post = dict(urllib.parse.parse_qsl(post_data)) if post["add_nonce"] not in self.server.add_nonces: return self.error403("Add nonce error.") self.server.add_nonces.remove(post["add_nonce"]) SiteManager.site_manager.need(post["address"]) return self.actionRedirect(post["url"]) + @helper.encodeResponse def actionSiteAddPrompt(self, path): path_parts = self.parsePath(path) if not path_parts or not self.server.site_manager.isAddress(path_parts["address"]): @@ -652,7 +713,7 @@ class UiRequest(object): return block # Stream a file to client - def actionFile(self, file_path, block_size=64 * 1024, send_header=True, header_length=True, header_noscript=False, header_allow_ajax=False, file_size=None, file_obj=None, path_parts=None): + def actionFile(self, file_path, block_size=64 * 1024, send_header=True, header_length=True, header_noscript=False, header_allow_ajax=False, extra_headers={}, file_size=None, file_obj=None, path_parts=None): file_name = os.path.basename(file_path) if file_size is None: @@ -670,7 +731,10 @@ class UiRequest(object): header_length = False if send_header: - extra_headers = {} + extra_headers = extra_headers.copy() + content_encoding = self.get.get("zeronet_content_encoding", "") + if all(part.strip() in ("gzip", "compress", "deflate", "identity", "br") for part in content_encoding.split(",")): + extra_headers["Content-Encoding"] = content_encoding extra_headers["Accept-Ranges"] = "bytes" if header_length: extra_headers["Content-Length"] = str(file_size) @@ -712,9 +776,21 @@ class UiRequest(object): # On websocket connection def actionWebsocket(self): ws = self.env.get("wsgi.websocket") + if ws: - wrapper_key = self.get["wrapper_key"] + # Allow only same-origin websocket requests + origin = self.env.get("HTTP_ORIGIN") + host = self.env.get("HTTP_HOST") + # Allow only same-origin websocket requests + if origin: + origin_host = origin.split("://", 1)[-1] + if origin_host != host and origin_host not in self.server.allowed_ws_origins: + error_message = "Invalid origin: %s (host: %s, allowed: %s)" % (origin, host, self.server.allowed_ws_origins) + ws.send(json.dumps({"error": error_message})) + return self.error403(error_message) + # Find site by wrapper_key + wrapper_key = self.get["wrapper_key"] site = None for site_check in list(self.server.sites.values()): if site_check.settings["wrapper_key"] == wrapper_key: @@ -738,7 +814,7 @@ class UiRequest(object): # Remove websocket from every site (admin sites allowed to join other sites event channels) if ui_websocket in site_check.websockets: site_check.websockets.remove(ui_websocket) - return "Bye." + return [b"Bye."] else: # No site found by wrapper key ws.send(json.dumps({"error": "Wrapper key not found: %s" % wrapper_key})) return self.error403("Wrapper key not found: %s" % wrapper_key) @@ -796,7 +872,7 @@ class UiRequest(object): # You are not allowed to access this def error403(self, message="", details=True): self.sendHeader(403, noscript=True) - self.log.error("Error 403: %s" % message) + self.log.warning("Error 403: %s" % message) return self.formatError("Forbidden", message, details=details) # Send file not found error @@ -836,6 +912,10 @@ class UiRequest(object): """ % (title, html.escape(message), html.escape(json.dumps(details, indent=4, sort_keys=True))) else: return """ +

    %s

    %s

    """ % (title, html.escape(message)) diff --git a/src/Ui/UiServer.py b/src/Ui/UiServer.py index 9daa90b1..188ff811 100644 --- a/src/Ui/UiServer.py +++ b/src/Ui/UiServer.py @@ -1,13 +1,11 @@ import logging import time -import cgi +import urllib import socket -import sys import gevent from gevent.pywsgi import WSGIServer -from gevent.pywsgi import WSGIHandler -from geventwebsocket.handler import WebSocketHandler +from lib.gevent_ws import WebSocketHandler from .UiRequest import UiRequest from Site import SiteManager @@ -16,8 +14,19 @@ from Debug import Debug import importlib +class LogDb(logging.StreamHandler): + def __init__(self, ui_server): + self.lines = [] + self.ui_server = ui_server + return super(LogDb, self).__init__() + + def emit(self, record): + self.ui_server.updateWebsocket(log_event=record.levelname) + self.lines.append([time.time(), record.levelname, self.format(record)]) + + # Skip websocket handler if not necessary -class UiWSGIHandler(WSGIHandler): +class UiWSGIHandler(WebSocketHandler): def __init__(self, *args, **kwargs): self.server = args[2] @@ -25,25 +34,25 @@ class UiWSGIHandler(WSGIHandler): self.args = args self.kwargs = kwargs + def handleError(self, err): + if config.debug: # Allow websocket errors to appear on /Debug + import main + main.DebugHook.handleError() + else: + ui_request = UiRequest(self.server, {}, self.environ, self.start_response) + block_gen = ui_request.error500("UiWSGIHandler error: %s" % Debug.formatExceptionMessage(err)) + for block in block_gen: + self.write(block) + def run_application(self): - if "HTTP_UPGRADE" in self.environ: # Websocket request - try: - ws_handler = WebSocketHandler(*self.args, **self.kwargs) - ws_handler.__dict__ = self.__dict__ # Match class variables - ws_handler.run_application() - except Exception as err: - logging.error("UiWSGIHandler websocket error: %s" % Debug.formatException(err)) - if config.debug: # Allow websocket errors to appear on /Debug - import main - main.DebugHook.handleError() - else: # Standard HTTP request - try: - super(UiWSGIHandler, self).run_application() - except Exception as err: - logging.error("UiWSGIHandler error: %s" % Debug.formatException(err)) - if config.debug: # Allow websocket errors to appear on /Debug - import main - main.DebugHook.handleError() + err_name = "UiWSGIHandler websocket" if "HTTP_UPGRADE" in self.environ else "UiWSGIHandler" + try: + super(UiWSGIHandler, self).run_application() + except (ConnectionAbortedError, ConnectionResetError) as err: + logging.warning("%s connection error: %s" % (err_name, err)) + except Exception as err: + logging.warning("%s error: %s" % (err_name, Debug.formatException(err))) + self.handleError(err) def handle(self): # Save socket to be able to close them properly on exit @@ -53,7 +62,6 @@ class UiWSGIHandler(WSGIHandler): class UiServer: - def __init__(self): self.ip = config.ui_ip self.port = config.ui_port @@ -76,6 +84,7 @@ class UiServer: self.allowed_hosts.update(["localhost"]) else: self.allowed_hosts = set([]) + self.allowed_ws_origins = set() self.allow_trans_proxy = config.ui_trans_proxy self.wrapper_nonces = [] @@ -85,6 +94,10 @@ class UiServer: self.sites = SiteManager.site_manager.list() self.log = logging.getLogger(__name__) + self.logdb_errors = LogDb(ui_server=self) + self.logdb_errors.setLevel(logging.getLevelName("ERROR")) + logging.getLogger('').addHandler(self.logdb_errors) + # After WebUI started def afterStarted(self): from util import Platform @@ -94,7 +107,7 @@ class UiServer: def handleRequest(self, env, start_response): path = bytes(env["PATH_INFO"], "raw-unicode-escape").decode("utf8") if env.get("QUERY_STRING"): - get = dict(cgi.parse_qsl(env['QUERY_STRING'])) + get = dict(urllib.parse.parse_qsl(env['QUERY_STRING'])) else: get = {} ui_request = UiRequest(self, get, env, start_response) @@ -195,5 +208,10 @@ class UiServer: time.sleep(1) def updateWebsocket(self, **kwargs): + if kwargs: + param = {"event": list(kwargs.items())[0]} + else: + param = None + for ws in self.websockets: - ws.event("serverChanged", kwargs) \ No newline at end of file + ws.event("serverChanged", param) diff --git a/src/Ui/UiWebsocket.py b/src/Ui/UiWebsocket.py index 39012648..7fce398b 100644 --- a/src/Ui/UiWebsocket.py +++ b/src/Ui/UiWebsocket.py @@ -18,18 +18,12 @@ from Plugin import PluginManager from Translate import translate as _ from util import helper from util import SafeRe +from util.Flag import flag from Content.ContentManager import VerifyError, SignError @PluginManager.acceptPlugins class UiWebsocket(object): - admin_commands = set([ - "sitePause", "siteResume", "siteDelete", "siteList", "siteSetLimit", "siteAdd", "siteListModifiedFiles", "siteSetSettingsValue", - "channelJoinAllsite", "serverUpdate", "serverPortcheck", "serverShutdown", "serverShowdirectory", "serverGetWrapperNonce", - "certSet", "certList", "configSet", "permissionAdd", "permissionRemove", "announcerStats", "userSetGlobalSettings" - ]) - async_commands = set(["fileGet", "fileList", "dirList", "fileNeed", "serverPortcheck", "siteListModifiedFiles"]) - def __init__(self, ws, site, server, user, request): self.ws = ws self.site = site @@ -117,9 +111,8 @@ class UiWebsocket(object): # Has permission to run the command def hasCmdPermission(self, cmd): - cmd = cmd[0].lower() + cmd[1:] - - if cmd in self.admin_commands and "ADMIN" not in self.permissions: + flags = flag.db.get(self.getCmdFuncName(cmd), ()) + if "admin" in flags and "ADMIN" not in self.permissions: return False else: return True @@ -146,6 +139,8 @@ class UiWebsocket(object): self.cmd("setSiteInfo", site_info) elif channel == "serverChanged": server_info = self.formatServerInfo() + if len(params) > 0 and params[0]: # Extra data + server_info.update(params[0]) self.cmd("setServerInfo", server_info) elif channel == "announcerChanged": site = params[0] @@ -205,6 +200,10 @@ class UiWebsocket(object): gevent.spawn(asyncErrorWatcher, func, *args, **kwargs) return wrapper + def getCmdFuncName(self, cmd): + func_name = "action" + cmd[0].upper() + cmd[1:] + return func_name + # Handle incoming messages def handleRequest(self, req): @@ -214,17 +213,21 @@ class UiWebsocket(object): if cmd == "response": # It's a response to a command return self.actionResponse(req["to"], req["result"]) - elif not self.hasCmdPermission(cmd): # Admin commands - return self.response(req["id"], {"error": "You don't have permission to run %s" % cmd}) else: # Normal command - func_name = "action" + cmd[0].upper() + cmd[1:] + func_name = self.getCmdFuncName(cmd) func = getattr(self, func_name, None) + if self.site.settings.get("deleting"): + return self.response(req["id"], {"error": "Site is deleting"}) + if not func: # Unknown command - self.response(req["id"], {"error": "Unknown command: %s" % cmd}) - return + return self.response(req["id"], {"error": "Unknown command: %s" % cmd}) + + if not self.hasCmdPermission(cmd): # Admin commands + return self.response(req["id"], {"error": "You don't have permission to run %s" % cmd}) # Execute in parallel - if cmd in self.async_commands: + func_flags = flag.db.get(self.getCmdFuncName(cmd), ()) + if func_flags and "async_run" in func_flags: func = self.asyncWrapper(func) # Support calling as named, unnamed parameters and raw first argument too @@ -308,6 +311,7 @@ class UiWebsocket(object): "debug": config.debug, "offline": config.offline, "plugins": PluginManager.plugin_manager.plugin_names, + "plugins_rev": PluginManager.plugin_manager.plugins_rev, "user_settings": self.user.settings } if "ADMIN" in self.site.settings["permissions"]: @@ -362,12 +366,15 @@ class UiWebsocket(object): if channel not in self.channels: self.channels.append(channel) + self.response(to, "ok") + # Server variables def actionServerInfo(self, to): back = self.formatServerInfo() self.response(to, back) # Create a new wrapper nonce that allows to load html file + @flag.admin def actionServerGetWrapperNonce(self, to): wrapper_nonce = self.request.getWrapperNonce() self.response(to, wrapper_nonce) @@ -376,6 +383,7 @@ class UiWebsocket(object): back = self.formatAnnouncerInfo(self.site) self.response(to, back) + @flag.admin def actionAnnouncerStats(self, to): back = {} trackers = self.site.announcer.getTrackers() @@ -638,6 +646,7 @@ class UiWebsocket(object): return self.response(to, rows) # List files in directory + @flag.async_run def actionFileList(self, to, inner_path): try: return list(self.site.storage.walk(inner_path)) @@ -646,6 +655,7 @@ class UiWebsocket(object): return {"error": Debug.formatExceptionMessage(err)} # List directories in a directory + @flag.async_run def actionDirList(self, to, inner_path): try: return list(self.site.storage.list(inner_path)) @@ -661,7 +671,7 @@ class UiWebsocket(object): try: res = self.site.storage.query(query, params) except Exception as err: # Response the error to client - self.log.error("DbQuery error: %s" % err) + self.log.error("DbQuery error: %s" % Debug.formatException(err)) return self.response(to, {"error": Debug.formatExceptionMessage(err)}) # Convert result to dict for row in res: @@ -671,14 +681,15 @@ class UiWebsocket(object): return self.response(to, rows) # Return file content - def actionFileGet(self, to, inner_path, required=True, format="text", timeout=300): + @flag.async_run + def actionFileGet(self, to, inner_path, required=True, format="text", timeout=300, priority=6): try: if required or inner_path in self.site.bad_files: with gevent.Timeout(timeout): - self.site.needFile(inner_path, priority=6) + self.site.needFile(inner_path, priority=priority) body = self.site.storage.read(inner_path, "rb") except (Exception, gevent.Timeout) as err: - self.log.error("%s fileGet error: %s" % (inner_path, Debug.formatException(err))) + self.log.debug("%s fileGet error: %s" % (inner_path, Debug.formatException(err))) body = None if not body: @@ -690,11 +701,12 @@ class UiWebsocket(object): body = body.decode() self.response(to, body) - def actionFileNeed(self, to, inner_path, timeout=300): + @flag.async_run + def actionFileNeed(self, to, inner_path, timeout=300, priority=6): try: with gevent.Timeout(timeout): - self.site.needFile(inner_path, priority=6) - except Exception as err: + self.site.needFile(inner_path, priority=priority) + except (Exception, gevent.Timeout) as err: return self.response(to, {"error": Debug.formatExceptionMessage(err)}) return self.response(to, "ok") @@ -816,6 +828,7 @@ class UiWebsocket(object): # - Admin actions - + @flag.admin def actionPermissionAdd(self, to, permission): if permission not in self.site.settings["permissions"]: self.site.settings["permissions"].append(permission) @@ -823,12 +836,14 @@ class UiWebsocket(object): self.site.updateWebsocket(permission_added=permission) self.response(to, "ok") + @flag.admin def actionPermissionRemove(self, to, permission): self.site.settings["permissions"].remove(permission) self.site.saveSettings() self.site.updateWebsocket(permission_removed=permission) self.response(to, "ok") + @flag.admin def actionPermissionDetails(self, to, permission): if permission == "ADMIN": self.response(to, _["Modify your client's configuration and access all site"] + " " + _["(Dangerous!)"] + "") @@ -840,12 +855,14 @@ class UiWebsocket(object): self.response(to, "") # Set certificate that used for authenticate user for site + @flag.admin def actionCertSet(self, to, domain): self.user.setCert(self.site.address, domain) self.site.updateWebsocket(cert_changed=domain) self.response(to, "ok") # List user's certificates + @flag.admin def actionCertList(self, to): back = [] auth_address = self.user.getAuthAddress(self.site.address) @@ -860,9 +877,9 @@ class UiWebsocket(object): return back # List all site info + @flag.admin def actionSiteList(self, to, connecting_sites=False): ret = [] - SiteManager.site_manager.load() # Reload sites for site in list(self.server.sites.values()): if not site.content_manager.contents.get("content.json") and not connecting_sites: continue # Incomplete site @@ -870,6 +887,7 @@ class UiWebsocket(object): self.response(to, ret) # Join to an event channel on all sites + @flag.admin def actionChannelJoinAllsite(self, to, channel): if channel not in self.channels: # Add channel to channels self.channels.append(channel) @@ -878,6 +896,8 @@ class UiWebsocket(object): if self not in site.websockets: site.websockets.append(self) + self.response(to, "ok") + # Update site content.json def actionSiteUpdate(self, to, address, check_files=False, since=None, announce=False): def updateThread(): @@ -895,6 +915,7 @@ class UiWebsocket(object): self.response(to, {"error": "Unknown site: %s" % address}) # Pause site serving + @flag.admin def actionSitePause(self, to, address): site = self.server.sites.get(address) if site: @@ -907,6 +928,7 @@ class UiWebsocket(object): self.response(to, {"error": "Unknown site: %s" % address}) # Resume site serving + @flag.admin def actionSiteResume(self, to, address): site = self.server.sites.get(address) if site: @@ -919,6 +941,8 @@ class UiWebsocket(object): else: self.response(to, {"error": "Unknown site: %s" % address}) + @flag.admin + @flag.no_multiuser def actionSiteDelete(self, to, address): site = self.server.sites.get(address) if site: @@ -955,6 +979,7 @@ class UiWebsocket(object): self.response(to, response) return "ok" + @flag.no_multiuser def actionSiteClone(self, to, address, root_inner_path="", target_address=None, redirect=True): if not SiteManager.site_manager.isAddress(address): self.response(to, {"error": "Not a site: %s" % address}) @@ -981,6 +1006,8 @@ class UiWebsocket(object): lambda res: self.cbSiteClone(to, address, root_inner_path, target_address, redirect) ) + @flag.admin + @flag.no_multiuser def actionSiteSetLimit(self, to, size_limit): self.site.settings["size_limit"] = int(size_limit) self.site.saveSettings() @@ -988,6 +1015,7 @@ class UiWebsocket(object): self.site.updateWebsocket() self.site.download(blind_includes=True) + @flag.admin def actionSiteAdd(self, to, address): site_manager = SiteManager.site_manager if address in site_manager.sites: @@ -998,6 +1026,8 @@ class UiWebsocket(object): else: return {"error": "Invalid address"} + @flag.admin + @flag.async_run def actionSiteListModifiedFiles(self, to, content_inner_path="content.json"): content = self.site.content_manager.contents[content_inner_path] min_mtime = content.get("modified", 0) @@ -1048,6 +1078,7 @@ class UiWebsocket(object): self.site.settings["cache"]["modified_files"] = modified_files return {"modified_files": modified_files} + @flag.admin def actionSiteSetSettingsValue(self, to, key, value): if key not in ["modified_files_notification"]: return {"error": "Can't change this key"} @@ -1068,11 +1099,19 @@ class UiWebsocket(object): settings = self.user.settings self.response(to, settings) + @flag.admin def actionUserSetGlobalSettings(self, to, settings): self.user.settings = settings self.user.save() self.response(to, "ok") + @flag.admin + @flag.no_multiuser + def actionServerErrors(self, to): + return self.server.logdb_errors.lines + + @flag.admin + @flag.no_multiuser def actionServerUpdate(self, to): def cbServerUpdate(res): self.response(to, res) @@ -1087,6 +1126,7 @@ class UiWebsocket(object): import main main.update_after_shutdown = True + main.restart_after_shutdown = True SiteManager.site_manager.save() main.file_server.stop() main.ui_server.stop() @@ -1097,19 +1137,36 @@ class UiWebsocket(object): cbServerUpdate ) + @flag.admin + @flag.async_run + @flag.no_multiuser def actionServerPortcheck(self, to): import main file_server = main.file_server file_server.portCheck() self.response(to, file_server.port_opened) + @flag.admin + @flag.no_multiuser def actionServerShutdown(self, to, restart=False): import main - if restart: - main.restart_after_shutdown = True - main.file_server.stop() - main.ui_server.stop() + def cbServerShutdown(res): + self.response(to, res) + if not res: + return False + if restart: + main.restart_after_shutdown = True + main.file_server.stop() + main.ui_server.stop() + if restart: + message = [_["Restart ZeroNet client?"], _["Restart"]] + else: + message = [_["Shut down ZeroNet client?"], _["Shut down"]] + self.cmd("confirm", message, cbServerShutdown) + + @flag.admin + @flag.no_multiuser def actionServerShowdirectory(self, to, directory="backup", inner_path=""): if self.request.env["REMOTE_ADDR"] != "127.0.0.1": return self.response(to, {"error": "Only clients from 127.0.0.1 allowed to run this command"}) @@ -1129,12 +1186,19 @@ class UiWebsocket(object): else: return self.response(to, {"error": "Not a directory"}) + @flag.admin + @flag.no_multiuser def actionConfigSet(self, to, key, value): import main if key not in config.keys_api_change_allowed: - self.response(to, {"error": "Forbidden you cannot set this config key"}) + self.response(to, {"error": "Forbidden: You cannot set this config key"}) return + if key == "open_browser": + if value not in ["default_browser", "False"]: + self.response(to, {"error": "Forbidden: Invalid value"}) + return + # Remove empty lines from lists if type(value) is list: value = [line for line in value if line] diff --git a/src/Ui/media/Loading.coffee b/src/Ui/media/Loading.coffee index 7cd2479d..877087c6 100644 --- a/src/Ui/media/Loading.coffee +++ b/src/Ui/media/Loading.coffee @@ -6,11 +6,11 @@ class Loading setProgress: (percent) -> if @timer_hide clearInterval @timer_hide - RateLimit 200, -> + RateLimit 500, -> $(".progressbar").css("transform": "scaleX(#{parseInt(percent*100)/100})").css("opacity", "1").css("display", "block") hideProgress: -> - console.log "hideProgress" + @log "hideProgress" @timer_hide = setTimeout ( => $(".progressbar").css("transform": "scaleX(1)").css("opacity", "0").hideLater(1000) ), 300 @@ -23,6 +23,7 @@ class Loading showTooLarge: (site_info) -> + @log "Displaying large site confirmation" if $(".console .button-setlimit").length == 0 # Not displaying it yet line = @printLine("Site size: #{parseInt(site_info.settings.size/1024/1024)}MB is larger than default allowed #{parseInt(site_info.size_limit)}MB", "warning") button = $("" + "Open site and set size limit to #{site_info.next_size_limit}MB" + "") @@ -52,7 +53,7 @@ class Loading # We dont need loadingscreen anymore hideScreen: -> - console.log "hideScreen" + @log "hideScreen" if not $(".loadingscreen").hasClass("done") # Only if its not animating already if @screen_visible # Hide with animate $(".loadingscreen").addClass("done").removeLater(2000) @@ -80,6 +81,8 @@ class Loading if type == "warning" then line.addClass("console-warning") return line + log: (args...) -> + console.log "[Loading]", args... window.Loading = Loading diff --git a/src/Ui/media/Notifications.coffee b/src/Ui/media/Notifications.coffee index b31067fb..8898b645 100644 --- a/src/Ui/media/Notifications.coffee +++ b/src/Ui/media/Notifications.coffee @@ -51,13 +51,13 @@ class Notifications ), timeout # Animate - width = elem.outerWidth() + width = Math.min(elem.outerWidth() + 50, 580) if not timeout then width += 20 # Add space for close button if elem.outerHeight() > 55 then elem.addClass("long") elem.css({"width": "50px", "transform": "scale(0.01)"}) elem.animate({"scale": 1}, 800, "easeOutElastic") elem.animate({"width": width}, 700, "easeInOutCubic") - $(".body", elem).css("width": (width - 80)) + $(".body", elem).css("width": (width - 50)) $(".body", elem).cssLater("box-shadow", "0px 0px 5px rgba(0,0,0,0.1)", 1000) # Close button or Confirm button diff --git a/src/Ui/media/Wrapper.coffee b/src/Ui/media/Wrapper.coffee index e57a1868..cecd1bc6 100644 --- a/src/Ui/media/Wrapper.coffee +++ b/src/Ui/media/Wrapper.coffee @@ -417,11 +417,13 @@ class Wrapper @reload(message.params[0]) reload: (url_post="") -> + @log "Reload" + current_url = window.location.toString().replace(/#.*/g, "") if url_post - if window.location.toString().indexOf("?") > 0 - window.location += "&"+url_post + if current_url.indexOf("?") > 0 + window.location = current_url + "&" + url_post else - window.location += "?"+url_post + window.location = current_url + "?" + url_post else window.location.reload() @@ -491,6 +493,7 @@ class Wrapper # Iframe loaded onPageLoad: (e) => + @log "onPageLoad" @inner_loaded = true if not @inner_ready then @sendInner {"cmd": "wrapperReady"} # Inner frame loaded before wrapper #if not @site_error then @loading.hideScreen() # Hide loading screen @@ -525,14 +528,11 @@ class Wrapper @address = site_info.address @setSiteInfo site_info - if site_info.settings.size > site_info.size_limit*1024*1024 # Site size too large and not displaying it yet - if @loading.screen_visible - @loading.showTooLarge(site_info) - else - @displayConfirm "Site is larger than allowed: #{(site_info.settings.size/1024/1024).toFixed(1)}MB/#{site_info.size_limit}MB", "Set limit to #{site_info.next_size_limit}MB", => - @ws.cmd "siteSetLimit", [site_info.next_size_limit], (res) => - if res == "ok" - @notifications.add("size_limit", "done", "Site storage limit modified!", 5000) + if site_info.settings.size > site_info.size_limit * 1024 * 1024 and not @loading.screen_visible # Site size too large and not displaying it yet + @displayConfirm "Site is larger than allowed: #{(site_info.settings.size/1024/1024).toFixed(1)}MB/#{site_info.size_limit}MB", "Set limit to #{site_info.next_size_limit}MB", => + @ws.cmd "siteSetLimit", [site_info.next_size_limit], (res) => + if res == "ok" + @notifications.add("size_limit", "done", "Site storage limit modified!", 5000) if site_info.content?.title? window.document.title = site_info.content.title + " - ZeroNet" @@ -552,8 +552,8 @@ class Wrapper @loading.hideScreen() if not @site_info then @reloadSiteInfo() if site_info.content - window.document.title = site_info.content.title+" - ZeroNet" - @log "Required file done, setting title to", window.document.title + window.document.title = site_info.content.title + " - ZeroNet" + @log "Required file #{window.file_inner_path} done, setting title to", window.document.title if not window.show_loadingscreen @notifications.add("modified", "info", "New version of this page has just released.
    Reload to see the modified content.") # File failed downloading @@ -583,12 +583,17 @@ class Wrapper @notifications.add("size_limit", "done", "Site storage limit modified!", 5000) return false - if @loading.screen_visible and @inner_loaded and site_info.settings.size < site_info.size_limit*1024*1024 and site_info.settings.size > 0 # Loading screen still visible, but inner loaded + if @loading.screen_visible and @inner_loaded and site_info.settings.size < site_info.size_limit * 1024 * 1024 and site_info.settings.size > 0 # Loading screen still visible, but inner loaded + @log "Loading screen visible, but inner loaded" @loading.hideScreen() if site_info?.settings?.own and site_info?.settings?.modified != @site_info?.settings?.modified @updateModifiedPanel() + if @loading.screen_visible and site_info.settings.size > site_info.size_limit * 1024 * 1024 + @log "Site too large" + @loading.showTooLarge(site_info) + @site_info = site_info @event_site_info.resolve() @@ -674,11 +679,13 @@ class Wrapper setSizeLimit: (size_limit, reload=true) => + @log "setSizeLimit: #{size_limit}, reload: #{reload}" + @inner_loaded = false # Inner frame not loaded, just a 404 page displayed @ws.cmd "siteSetLimit", [size_limit], (res) => if res != "ok" return false @loading.printLine res - @inner_loaded = false # Inner frame not loaded, just a 404 page displayed + @inner_loaded = false if reload then @reloadIframe() return false diff --git a/src/Ui/media/Wrapper.css b/src/Ui/media/Wrapper.css index b78427d6..d633ff45 100644 --- a/src/Ui/media/Wrapper.css +++ b/src/Ui/media/Wrapper.css @@ -8,7 +8,10 @@ a { color: black } #inner-iframe { width: 100%; height: 100%; position: absolute; border: 0; } /*; transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.8s ease-in-out*/ #inner-iframe.back { transform: scale(0.95) translate(-300px, 0); opacity: 0.4 } -.button { padding: 5px 10px; margin-left: 10px; background-color: #FFF85F; border-bottom: 2px solid #CDBD1E; border-radius: 2px; text-decoration: none; transition: all 0.5s; background-position: left center; } +.button { + padding: 5px 10px; margin-left: 10px; background-color: #FFF85F; border-bottom: 2px solid #CDBD1E; + border-radius: 2px; text-decoration: none; transition: all 0.5s; background-position: left center; white-space: nowrap; +} .button:hover { background-color: #FFF400; border-bottom: 2px solid #4D4D4C; transition: none } .button:active { position: relative; top: 1px } .button:focus { outline: none } @@ -44,21 +47,22 @@ a { color: black } .notifications { position: absolute; top: 0; right: 80px; display: inline-block; z-index: 999; white-space: nowrap } .notification { - position: relative; float: right; clear: both; margin: 10px; box-sizing: border-box; overflow: hidden; backface-visibility: hidden; perspective: 1000px; padding-bottom: 5px; - color: #4F4F4F; font-family: 'Lucida Grande', 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px; /*border: 1px solid rgba(210, 206, 205, 0.2)*/ + position: relative; float: right; clear: both; margin: 10px; box-sizing: border-box; overflow: hidden; backface-visibility: hidden; + perspective: 1000px; padding-bottom: 5px; color: #4F4F4F; font-family: 'Lucida Grande', 'Segoe UI', Helvetica, Arial, sans-serif; + font-size: 14px; line-height: 20px; /*border: 1px solid rgba(210, 206, 205, 0.2)*/ } .notification-icon { display: block; width: 50px; height: 50px; position: absolute; float: left; z-index: 2; text-align: center; background-color: #e74c3c; line-height: 45px; vertical-align: bottom; font-size: 40px; color: white; } .notification .body { - padding-left: 14px; padding-right: 60px; height: 40px; vertical-align: middle; display: table; + padding-left: 14px; padding-right: 60px; height: 50px; vertical-align: middle; display: table; padding-right: 20px; box-sizing: border-box; background-color: white; left: 50px; top: 0; position: relative; padding-top: 5px; padding-bottom: 5px; } .notification .message-outer { display: table-row } -.notification .buttons { display: table-cell; vertical-align: top; padding-top: 9px; } +.notification .buttons { display: table-cell; vertical-align: top; padding-top: 9px; padding-right: 20px; text-align: right; } .notification.long .body { padding-top: 10px; padding-bottom: 10px } -.notification .message { display: table-cell; vertical-align: middle; } +.notification .message { display: table-cell; vertical-align: middle; max-width: 500px; white-space: normal; } .notification.visible { max-width: 350px } @@ -107,9 +111,10 @@ a { color: black } /* Infopanel */ .infopanel { - position: absolute; z-index: 999; padding: 15px 15px; bottom: 55px; right: 50px; border: 1px solid #eff3fe; display: none; - font-family: 'Lucida Grande', 'Segoe UI', Helvetica, Arial, sans-serif; box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); background-color: white; - border-left: 4px solid #9a61f8; border-top-left-radius: 4px; border-bottom-left-radius: 4px; transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); + position: absolute; z-index: 999; padding: 15px 15px; bottom: 25px; right: 50px; border: 1px solid #eff3fe; display: none; + font-family: 'Lucida Grande', 'Segoe UI', Helvetica, Arial, sans-serif; box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); + background-color: white; border-left: 4px solid #9a61f8; border-top-left-radius: 4px; border-bottom-left-radius: 4px; + transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); } .infopanel.visible { display: block; } .infopanel.closed { box-shadow: none; transform: translateX(100%); right: 0px; cursor: pointer; } @@ -130,7 +135,7 @@ a { color: black } /* Loading screen */ -.loadingscreen { width: 100%; height: 100%; position: absolute; background-color: #EEE; z-index: 1; overflow: hidden; display: none } +.loadingscreen { width: 100%; height: 100%; position: absolute; background-color: #EEE; z-index: 1; overflow: auto; display: none } .theme-dark .loadingscreen { background-color: #180922; } .loading-text { text-align: center; vertical-align: middle; top: 50%; position: absolute; margin-top: 39px; width: 100% } .loading-config { @@ -176,7 +181,7 @@ a { color: black } .progressbar { background: #26C281; position: fixed; width: 100%; z-index: 100; top: 0; left: 0; transform: scaleX(0); transform-origin: 0% 0%; transform:translate3d(0,0,0); - height: 2px; transition: transform 0.5s, opacity 1s; display: none; backface-visibility: hidden; transform-style: preserve-3d; + height: 2px; transition: transform 1s, opacity 1s; display: none; backface-visibility: hidden; transform-style: preserve-3d; } .progressbar .peg { display: block; position: absolute; right: 0; width: 100px; height: 100%; @@ -216,8 +221,8 @@ a { color: black } /* Small screen */ @media screen and (max-width: 600px) { .notification .message { white-space: normal; } - .notification .buttons { padding-right: 22px; } + .notification .buttons { padding-right: 22px; padding-right: 40px; } .notification .button { white-space: nowrap; } - .notification { margin: 0px } - .notifications { right: 0px } + .notification { margin: 0px; } + .notifications { right: 0px; max-width: 80%; } } diff --git a/src/Ui/media/all.css b/src/Ui/media/all.css index d742c3b5..6e4173c2 100644 --- a/src/Ui/media/all.css +++ b/src/Ui/media/all.css @@ -1,5 +1,5 @@ -/* ---- src/Ui/media/Wrapper.css ---- */ +/* ---- Wrapper.css ---- */ body { margin: 0; padding: 0; height: 100%; background-color: #D2CECD; overflow: hidden } @@ -12,7 +12,10 @@ a { color: black } #inner-iframe { width: 100%; height: 100%; position: absolute; border: 0; } /*; transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.8s ease-in-out*/ #inner-iframe.back { -webkit-transform: scale(0.95) translate(-300px, 0); -moz-transform: scale(0.95) translate(-300px, 0); -o-transform: scale(0.95) translate(-300px, 0); -ms-transform: scale(0.95) translate(-300px, 0); transform: scale(0.95) translate(-300px, 0) ; opacity: 0.4 } -.button { padding: 5px 10px; margin-left: 10px; background-color: #FFF85F; border-bottom: 2px solid #CDBD1E; -webkit-border-radius: 2px; -moz-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; border-radius: 2px ; text-decoration: none; -webkit-transition: all 0.5s; -moz-transition: all 0.5s; -o-transition: all 0.5s; -ms-transition: all 0.5s; transition: all 0.5s ; background-position: left center; } +.button { + padding: 5px 10px; margin-left: 10px; background-color: #FFF85F; border-bottom: 2px solid #CDBD1E; + -webkit-border-radius: 2px; -moz-border-radius: 2px; -o-border-radius: 2px; -ms-border-radius: 2px; border-radius: 2px ; text-decoration: none; -webkit-transition: all 0.5s; -moz-transition: all 0.5s; -o-transition: all 0.5s; -ms-transition: all 0.5s; transition: all 0.5s ; background-position: left center; white-space: nowrap; +} .button:hover { background-color: #FFF400; border-bottom: 2px solid #4D4D4C; -webkit-transition: none ; -moz-transition: none ; -o-transition: none ; -ms-transition: none ; transition: none } .button:active { position: relative; top: 1px } .button:focus { outline: none } @@ -48,21 +51,22 @@ a { color: black } .notifications { position: absolute; top: 0; right: 80px; display: inline-block; z-index: 999; white-space: nowrap } .notification { - position: relative; float: right; clear: both; margin: 10px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; overflow: hidden; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -o-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden ; -webkit-perspective: 1000px; -moz-perspective: 1000px; -o-perspective: 1000px; -ms-perspective: 1000px; perspective: 1000px ; padding-bottom: 5px; - color: #4F4F4F; font-family: 'Lucida Grande', 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px; /*border: 1px solid rgba(210, 206, 205, 0.2)*/ + position: relative; float: right; clear: both; margin: 10px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; overflow: hidden; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -o-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden ; + -webkit-perspective: 1000px; -moz-perspective: 1000px; -o-perspective: 1000px; -ms-perspective: 1000px; perspective: 1000px ; padding-bottom: 5px; color: #4F4F4F; font-family: 'Lucida Grande', 'Segoe UI', Helvetica, Arial, sans-serif; + font-size: 14px; line-height: 20px; /*border: 1px solid rgba(210, 206, 205, 0.2)*/ } .notification-icon { display: block; width: 50px; height: 50px; position: absolute; float: left; z-index: 2; text-align: center; background-color: #e74c3c; line-height: 45px; vertical-align: bottom; font-size: 40px; color: white; } .notification .body { - padding-left: 14px; padding-right: 60px; height: 40px; vertical-align: middle; display: table; + padding-left: 14px; padding-right: 60px; height: 50px; vertical-align: middle; display: table; padding-right: 20px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; background-color: white; left: 50px; top: 0; position: relative; padding-top: 5px; padding-bottom: 5px; } .notification .message-outer { display: table-row } -.notification .buttons { display: table-cell; vertical-align: top; padding-top: 9px; } +.notification .buttons { display: table-cell; vertical-align: top; padding-top: 9px; padding-right: 20px; text-align: right; } .notification.long .body { padding-top: 10px; padding-bottom: 10px } -.notification .message { display: table-cell; vertical-align: middle; } +.notification .message { display: table-cell; vertical-align: middle; max-width: 500px; white-space: normal; } .notification.visible { max-width: 350px } @@ -120,9 +124,10 @@ a { color: black } /* Infopanel */ .infopanel { - position: absolute; z-index: 999; padding: 15px 15px; bottom: 55px; right: 50px; border: 1px solid #eff3fe; display: none; - font-family: 'Lucida Grande', 'Segoe UI', Helvetica, Arial, sans-serif; -webkit-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); -moz-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); -o-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); -ms-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17) ; background-color: white; - border-left: 4px solid #9a61f8; border-top-left-radius: 4px; border-bottom-left-radius: 4px; -webkit-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); -moz-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); -o-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); -ms-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) ; + position: absolute; z-index: 999; padding: 15px 15px; bottom: 25px; right: 50px; border: 1px solid #eff3fe; display: none; + font-family: 'Lucida Grande', 'Segoe UI', Helvetica, Arial, sans-serif; -webkit-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); -moz-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); -o-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); -ms-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17) ; + background-color: white; border-left: 4px solid #9a61f8; border-top-left-radius: 4px; border-bottom-left-radius: 4px; + -webkit-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); -moz-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); -o-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); -ms-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) ; } .infopanel.visible { display: block; } .infopanel.closed { -webkit-box-shadow: none; -moz-box-shadow: none; -o-box-shadow: none; -ms-box-shadow: none; box-shadow: none ; -webkit-transform: translateX(100%); -moz-transform: translateX(100%); -o-transform: translateX(100%); -ms-transform: translateX(100%); transform: translateX(100%) ; right: 0px; cursor: pointer; } @@ -143,7 +148,7 @@ a { color: black } /* Loading screen */ -.loadingscreen { width: 100%; height: 100%; position: absolute; background-color: #EEE; z-index: 1; overflow: hidden; display: none } +.loadingscreen { width: 100%; height: 100%; position: absolute; background-color: #EEE; z-index: 1; overflow: auto; display: none } .theme-dark .loadingscreen { background-color: #180922; } .loading-text { text-align: center; vertical-align: middle; top: 50%; position: absolute; margin-top: 39px; width: 100% } .loading-config { @@ -189,7 +194,7 @@ a { color: black } .progressbar { background: #26C281; position: fixed; width: 100%; z-index: 100; top: 0; left: 0; -webkit-transform: scaleX(0); -moz-transform: scaleX(0); -o-transform: scaleX(0); -ms-transform: scaleX(0); transform: scaleX(0) ; transform-origin: 0% 0%; transform:translate3d(0,0,0); - height: 2px; -webkit-transition: transform 0.5s, opacity 1s; -moz-transition: transform 0.5s, opacity 1s; -o-transition: transform 0.5s, opacity 1s; -ms-transition: transform 0.5s, opacity 1s; transition: transform 0.5s, opacity 1s ; display: none; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -o-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden ; transform-style: preserve-3d; + height: 2px; -webkit-transition: transform 1s, opacity 1s; -moz-transition: transform 1s, opacity 1s; -o-transition: transform 1s, opacity 1s; -ms-transition: transform 1s, opacity 1s; transition: transform 1s, opacity 1s ; display: none; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -o-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden ; transform-style: preserve-3d; } .progressbar .peg { display: block; position: absolute; right: 0; width: 100px; height: 100%; @@ -255,8 +260,8 @@ a { color: black } /* Small screen */ @media screen and (max-width: 600px) { .notification .message { white-space: normal; } - .notification .buttons { padding-right: 22px; } + .notification .buttons { padding-right: 22px; padding-right: 40px; } .notification .button { white-space: nowrap; } - .notification { margin: 0px } - .notifications { right: 0px } + .notification { margin: 0px; } + .notifications { right: 0px; max-width: 80%; } } diff --git a/src/Ui/media/all.js b/src/Ui/media/all.js index 86c61b51..eb3dc905 100644 --- a/src/Ui/media/all.js +++ b/src/Ui/media/all.js @@ -1,12 +1,12 @@ -/* ---- src/Ui/media/lib/00-jquery.min.js ---- */ +/* ---- lib/00-jquery.min.js ---- */ /*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */ !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w("