From 416e43e7bb14674c944b18ca87c7a79310dbd173 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 15 Dec 2020 19:54:33 -0600 Subject: [PATCH 1/9] correct yt link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5eea66c5..86d265b3 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Not yet usable: ## Watch the talk from BSidesPDX 2019 - + improving anonymous networking talk link From b1ef248ee924a4627a97ef5a8e4cdb3b528719d7 Mon Sep 17 00:00:00 2001 From: Duncan X Simpson Date: Mon, 14 Dec 2020 23:20:27 -0700 Subject: [PATCH 2/9] Docker improvements - Modify onionr.sh to parse env and supply args to run-onionr-node.py - Run onionr by default rather than bash - Run as unprivileged user by default instead of root - Use /app for all code - Specify python 3.7 (3.8 fails to build cffi) - Use apt-get rather than apt (apt's CLI is not stable) - Slight reformatting and consolidation --- Dockerfile | 34 ++++++++++++++++++---------------- onionr.sh | 21 +++++++++++++++++++-- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 546152db..c8e93527 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,30 @@ -FROM python +FROM python:3.7 -#Base settings -ENV HOME /root +USER root + +RUN mkdir /app +WORKDIR /app + +ENV PORT=8080 +EXPOSE 8080 #Install needed packages -RUN apt update && apt install -y tor locales +RUN apt-get update && apt-get install -y tor locales RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 -WORKDIR /srv/ -ADD ./requirements.txt /srv/requirements.txt +ADD ./requirements.txt /app/requirements.txt RUN pip3 install --require-hashes -r requirements.txt -WORKDIR /root/ #Add Onionr source -COPY . /root/ -VOLUME /root/data/ +COPY . /app/ -#Set upstart command -CMD bash +VOLUME /app/data/ -#Expose ports -EXPOSE 8080 +#Default to running as nonprivileged user +RUN chmod g=u -R /app +USER 1000 + +CMD ["bash", "./onionr.sh"] diff --git a/onionr.sh b/onionr.sh index 0b7d898c..ea925a52 100755 --- a/onionr.sh +++ b/onionr.sh @@ -2,5 +2,22 @@ ORIG_ONIONR_RUN_DIR=`pwd` export ORIG_ONIONR_RUN_DIR cd "$(dirname "$0")" -cd src -./__init__.py "$@" \ No newline at end of file + +[[ -n "$USE_TOR" ]] || USE_TOR=1 +[[ -n "$PORT" ]] || PORT=8080 +[[ -n "$KEEP_LOG" ]] || KEEP_LOG=0 +[[ -n "$STORE_PLAINTEXT" ]] || STORE_PLAINTEXT=1 + +PRIVKEY_OPT="" +[[ -f "privkey.key" ]] && PRIVKEY_OPT="--private-key privkey.key" + +python run-onionr-node.py \ + --open-ui 0 \ + --onboarding 0 \ + --bind-address 0.0.0.0 \ + --port $PORT \ + --use-tor $USE_TOR \ + --keep-log-on-exit $KEEP_LOG \ + --store-plaintext $STORE_PLAINTEXT \ + $PRIVKEY_OPT \ + "$@" From 2bd58945daa244ebceb6a04acd1a572ea7a9f9f3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 10 Dec 2020 14:04:14 +0000 Subject: [PATCH 3/9] Bump watchdog from 0.10.4 to 1.0.1 Bumps [watchdog](https://github.com/gorakhargosh/watchdog) from 0.10.4 to 1.0.1. - [Release notes](https://github.com/gorakhargosh/watchdog/releases) - [Changelog](https://github.com/gorakhargosh/watchdog/blob/master/changelog.rst) - [Commits](https://github.com/gorakhargosh/watchdog/compare/v0.10.4...v1.0.1) Signed-off-by: dependabot-preview[bot] --- requirements.in | 2 +- requirements.txt | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/requirements.in b/requirements.in index c23dec08..ea5f0c18 100644 --- a/requirements.in +++ b/requirements.in @@ -12,5 +12,5 @@ toomanyobjs==1.1.0 niceware==0.2.1 psutil==5.7.3 filenuke==0.0.0 -watchdog==0.10.4 +watchdog==1.0.1 ujson==4.0.1 diff --git a/requirements.txt b/requirements.txt index ffedc92c..759f221a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -141,9 +141,6 @@ niceware==0.2.1 \ --hash=sha256:0f8b192f2a1e800e068474f6e208be9c7e2857664b33a96f4045340de4e5c69c \ --hash=sha256:cf2dc0e1567d36d067c61b32fed0f1b9c4534ed511f9eeead4ba548d03b5c9eb \ # via -r requirements.in -pathtools==0.1.2 \ - --hash=sha256:7c35c5421a39bb82e58018febd90e3b6e5db34c5443aaaf742b3f33d4655f1c0 \ - # via watchdog psutil==5.7.3 \ --hash=sha256:01bc82813fbc3ea304914581954979e637bcc7084e59ac904d870d6eb8bb2bc7 \ --hash=sha256:1cd6a0c9fb35ece2ccf2d1dd733c1e165b342604c67454fd56a4c12e0a106787 \ @@ -232,8 +229,8 @@ urllib3==1.25.11 \ --hash=sha256:8d7eaa5a82a1cac232164990f04874c594c9453ec55eef02eab885aa02fc17a2 \ --hash=sha256:f5321fbe4bf3fefa0efd0bfe7fb14e90909eb62a48ccda331726b4319897dd5e \ # via -r requirements.in, requests -watchdog==0.10.4 \ - --hash=sha256:e38bffc89b15bafe2a131f0e1c74924cf07dcec020c2e0a26cccd208831fcd43 \ +watchdog==1.0.1 \ + --hash=sha256:78ea5d78f2cf8e4d6343ab2cbed93bb47b7a85b1c2f90a1dea365226bbab68ac \ # via -r requirements.in werkzeug==0.15.5 \ --hash=sha256:87ae4e5b5366da2347eb3116c0e6c681a0e939a33b2805e2c0cbd282664932c4 \ From ae359de56252f64b3e0d2868910fbe5791e5a5cc Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 15 Dec 2020 21:59:36 -0600 Subject: [PATCH 4/9] Added custom port and bind address args --- onionr.sh | 21 ++------------------- run-onionr-node.py | 13 +++++++++++++ src/apiservers/private/__init__.py | 11 +++++++++-- static-data/default_config.json | 1 + tests/test_default_config_json.py | 1 + 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/onionr.sh b/onionr.sh index ea925a52..0b7d898c 100755 --- a/onionr.sh +++ b/onionr.sh @@ -2,22 +2,5 @@ ORIG_ONIONR_RUN_DIR=`pwd` export ORIG_ONIONR_RUN_DIR cd "$(dirname "$0")" - -[[ -n "$USE_TOR" ]] || USE_TOR=1 -[[ -n "$PORT" ]] || PORT=8080 -[[ -n "$KEEP_LOG" ]] || KEEP_LOG=0 -[[ -n "$STORE_PLAINTEXT" ]] || STORE_PLAINTEXT=1 - -PRIVKEY_OPT="" -[[ -f "privkey.key" ]] && PRIVKEY_OPT="--private-key privkey.key" - -python run-onionr-node.py \ - --open-ui 0 \ - --onboarding 0 \ - --bind-address 0.0.0.0 \ - --port $PORT \ - --use-tor $USE_TOR \ - --keep-log-on-exit $KEEP_LOG \ - --store-plaintext $STORE_PLAINTEXT \ - $PRIVKEY_OPT \ - "$@" +cd src +./__init__.py "$@" \ No newline at end of file diff --git a/run-onionr-node.py b/run-onionr-node.py index 2c8f3431..15fd581e 100755 --- a/run-onionr-node.py +++ b/run-onionr-node.py @@ -55,6 +55,12 @@ def show_info(p: Process): parser = argparse.ArgumentParser() +parser.add_argument( + "--bind-address", help="Address to bind to. Be very careful with non-loopback", + type=str, default="") +parser.add_argument( + "--port", help="Port to bind to, must be available and possible", + type=int, default=0) parser.add_argument( "--use-bootstrap-file", help="Use bootstrap node list file", type=int, default=1) @@ -129,6 +135,13 @@ config['general']['dev_mode'] = False config['general']['store_plaintext_blocks'] = True config['general']['use_bootstrap_list'] = True config['transports']['tor'] = True +config['general']['bind_port'] = 0 # client api server port +config['general']['bind_address'] = '' # client api server address + +if args.bind_address: + config['general']['bind_address'] = args.bind_address +if args.port: + config['client']['client']['port'] = args.port if not args.use_bootstrap_file: config['general']['use_bootstrap_list'] = False diff --git a/src/apiservers/private/__init__.py b/src/apiservers/private/__init__.py index 3bc0df3a..657c30b7 100644 --- a/src/apiservers/private/__init__.py +++ b/src/apiservers/private/__init__.py @@ -50,13 +50,20 @@ class PrivateAPI: self.startTime = epoch.get_epoch() app = flask.Flask(__name__) + + bind_port = int(config.get('client.client.port', 59496)) self.bindPort = bind_port self.clientToken = config.get('client.webpassword') - self.host = httpapi.apiutils.setbindip.set_bind_IP( - private_API_host_file) + if config.get('general.bind_address'): + with open(private_API_host_file, 'w') as bindFile: + bindFile.write(config.get('general.bind_address')) + self.host = config.get('general.bind_address') + else: + self.host = httpapi.apiutils.setbindip.set_bind_IP( + private_API_host_file) logger.info('Running api on %s:%s' % (self.host, self.bindPort)) self.httpServer = '' diff --git a/static-data/default_config.json b/static-data/default_config.json index 2a788eb3..dcad2e50 100755 --- a/static-data/default_config.json +++ b/static-data/default_config.json @@ -8,6 +8,7 @@ "general": { "allow_public_api_dns_rebinding": false, "announce_node": true, + "bind_address": "", "dev_mode": false, "display_header": true, "ephemeral_tunnels": false, diff --git a/tests/test_default_config_json.py b/tests/test_default_config_json.py index b50db4b2..2678b13c 100644 --- a/tests/test_default_config_json.py +++ b/tests/test_default_config_json.py @@ -24,6 +24,7 @@ class OnionrConfig(unittest.TestCase): self.assertEqual(conf['allocations']['disk'], 1073741824) self.assertEqual(conf['allocations']['disk'], 1073741824) self.assertEqual(conf['general']['announce_node'], True) + self.assertEqual(conf['general']['bind_address'], '') self.assertEqual(conf['general']['dev_mode'], False) self.assertEqual(conf['general']['display_header'], True) self.assertEqual(conf['general']['ephemeral_tunnels'], False) From c44d6624ff7df9813f1574c305d9828124a0d609 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 15 Dec 2020 19:54:33 -0600 Subject: [PATCH 5/9] correct yt link Docker improvements - Run onionr by default rather than bash - Run as unprivileged user by default instead of root - Use /app for all code - Specify python 3.7 (3.8 fails to build cffi) - Use apt-get rather than apt (apt's CLI is not stable) - Slight reformatting and consolidation Added custom port and bind address args --- Dockerfile | 34 ++++++++++++++++-------------- README.md | 2 +- run-onionr-node.py | 13 ++++++++++++ src/apiservers/private/__init__.py | 11 ++++++++-- static-data/default_config.json | 1 + tests/test_default_config_json.py | 1 + 6 files changed, 43 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 546152db..c8e93527 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,30 @@ -FROM python +FROM python:3.7 -#Base settings -ENV HOME /root +USER root + +RUN mkdir /app +WORKDIR /app + +ENV PORT=8080 +EXPOSE 8080 #Install needed packages -RUN apt update && apt install -y tor locales +RUN apt-get update && apt-get install -y tor locales RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ locale-gen -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 -WORKDIR /srv/ -ADD ./requirements.txt /srv/requirements.txt +ADD ./requirements.txt /app/requirements.txt RUN pip3 install --require-hashes -r requirements.txt -WORKDIR /root/ #Add Onionr source -COPY . /root/ -VOLUME /root/data/ +COPY . /app/ -#Set upstart command -CMD bash +VOLUME /app/data/ -#Expose ports -EXPOSE 8080 +#Default to running as nonprivileged user +RUN chmod g=u -R /app +USER 1000 + +CMD ["bash", "./onionr.sh"] diff --git a/README.md b/README.md index 5eea66c5..86d265b3 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Not yet usable: ## Watch the talk from BSidesPDX 2019 - + improving anonymous networking talk link diff --git a/run-onionr-node.py b/run-onionr-node.py index 2c8f3431..15fd581e 100755 --- a/run-onionr-node.py +++ b/run-onionr-node.py @@ -55,6 +55,12 @@ def show_info(p: Process): parser = argparse.ArgumentParser() +parser.add_argument( + "--bind-address", help="Address to bind to. Be very careful with non-loopback", + type=str, default="") +parser.add_argument( + "--port", help="Port to bind to, must be available and possible", + type=int, default=0) parser.add_argument( "--use-bootstrap-file", help="Use bootstrap node list file", type=int, default=1) @@ -129,6 +135,13 @@ config['general']['dev_mode'] = False config['general']['store_plaintext_blocks'] = True config['general']['use_bootstrap_list'] = True config['transports']['tor'] = True +config['general']['bind_port'] = 0 # client api server port +config['general']['bind_address'] = '' # client api server address + +if args.bind_address: + config['general']['bind_address'] = args.bind_address +if args.port: + config['client']['client']['port'] = args.port if not args.use_bootstrap_file: config['general']['use_bootstrap_list'] = False diff --git a/src/apiservers/private/__init__.py b/src/apiservers/private/__init__.py index 3bc0df3a..657c30b7 100644 --- a/src/apiservers/private/__init__.py +++ b/src/apiservers/private/__init__.py @@ -50,13 +50,20 @@ class PrivateAPI: self.startTime = epoch.get_epoch() app = flask.Flask(__name__) + + bind_port = int(config.get('client.client.port', 59496)) self.bindPort = bind_port self.clientToken = config.get('client.webpassword') - self.host = httpapi.apiutils.setbindip.set_bind_IP( - private_API_host_file) + if config.get('general.bind_address'): + with open(private_API_host_file, 'w') as bindFile: + bindFile.write(config.get('general.bind_address')) + self.host = config.get('general.bind_address') + else: + self.host = httpapi.apiutils.setbindip.set_bind_IP( + private_API_host_file) logger.info('Running api on %s:%s' % (self.host, self.bindPort)) self.httpServer = '' diff --git a/static-data/default_config.json b/static-data/default_config.json index 2a788eb3..dcad2e50 100755 --- a/static-data/default_config.json +++ b/static-data/default_config.json @@ -8,6 +8,7 @@ "general": { "allow_public_api_dns_rebinding": false, "announce_node": true, + "bind_address": "", "dev_mode": false, "display_header": true, "ephemeral_tunnels": false, diff --git a/tests/test_default_config_json.py b/tests/test_default_config_json.py index b50db4b2..2678b13c 100644 --- a/tests/test_default_config_json.py +++ b/tests/test_default_config_json.py @@ -24,6 +24,7 @@ class OnionrConfig(unittest.TestCase): self.assertEqual(conf['allocations']['disk'], 1073741824) self.assertEqual(conf['allocations']['disk'], 1073741824) self.assertEqual(conf['general']['announce_node'], True) + self.assertEqual(conf['general']['bind_address'], '') self.assertEqual(conf['general']['dev_mode'], False) self.assertEqual(conf['general']['display_header'], True) self.assertEqual(conf['general']['ephemeral_tunnels'], False) From 57638e73f7eb103416b4fa669b50dd71dc4a851c Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Fri, 18 Dec 2020 00:12:22 +0000 Subject: [PATCH 6/9] added faq.md --- docs/faq.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/faq.md diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 00000000..13f37262 --- /dev/null +++ b/docs/faq.md @@ -0,0 +1,24 @@ +

Onionr FAQ

+ +(Most of the FAQ answers apply to planned features and do not reflect in the demo network) + +* How does Onionr route messages? + +Onionr creates a message with an anti-spam proof (usually). It is then forwarded between nodes using binomial tree broadcast. + +The network is structured based on the particular transport being used, for Tor, .onion addresses are used to determine closeness between nodes. + +Churn due to connectivity changes or issues, membership changes or malicious activity means nodes need to sometimes look far away for missed messages. + +To help with scale, messages can be intelligently deleted or forwarded, for example a mail message can be marked by its recipient at a given point for deletion, or forum posts can be set to expire after a short period or after lack of activity. + + +* Why do you use Python instead of [language]? + +I'm very comfortable in Python, and I believe it is a maintainable language if you use it correctly with modern features, also it has many quality libraries useful to the project, like pyncal and stem. Most places in the project are IO bound. + + +* What do you think of bad actors who might use Onionr? + +Users should be able to exclude viewing, processing, and hosting content they do not want to. To this end, I want to enable user-configurable filtering based on lists provided by friends, fuzzy hashing, and voting. + From e36f44f9a1ca056112286c332553092cf2d99826 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 22 Dec 2020 00:54:29 +0000 Subject: [PATCH 7/9] bump deps --- requirements.in | 7 +-- requirements.txt | 135 ++++++++++++++++++++++++++++++----------------- 2 files changed, 92 insertions(+), 50 deletions(-) diff --git a/requirements.in b/requirements.in index ea5f0c18..4da3250f 100644 --- a/requirements.in +++ b/requirements.in @@ -1,5 +1,5 @@ urllib3==1.25.11 -requests==2.25.0 +requests==2.25.1 PyNaCl==1.4.0 gevent==20.9.0 Flask==1.1.2 @@ -10,7 +10,8 @@ unpaddedbase32==0.2.0 streamedrequests==1.0.3 toomanyobjs==1.1.0 niceware==0.2.1 -psutil==5.7.3 +psutil==5.8.0 filenuke==0.0.0 -watchdog==1.0.1 +watchdog==1.0.2 ujson==4.0.1 +cffi==1.14.4 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 759f221a..865d9951 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,36 +8,44 @@ certifi==2018.11.29 \ --hash=sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7 \ --hash=sha256:993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033 \ # via requests -cffi==1.12.2 \ - --hash=sha256:00b97afa72c233495560a0793cdc86c2571721b4271c0667addc83c417f3d90f \ - --hash=sha256:0ba1b0c90f2124459f6966a10c03794082a2f3985cd699d7d63c4a8dae113e11 \ - --hash=sha256:0bffb69da295a4fc3349f2ec7cbe16b8ba057b0a593a92cbe8396e535244ee9d \ - --hash=sha256:21469a2b1082088d11ccd79dd84157ba42d940064abbfa59cf5f024c19cf4891 \ - --hash=sha256:2e4812f7fa984bf1ab253a40f1f4391b604f7fc424a3e21f7de542a7f8f7aedf \ - --hash=sha256:2eac2cdd07b9049dd4e68449b90d3ef1adc7c759463af5beb53a84f1db62e36c \ - --hash=sha256:2f9089979d7456c74d21303c7851f158833d48fb265876923edcb2d0194104ed \ - --hash=sha256:3dd13feff00bddb0bd2d650cdb7338f815c1789a91a6f68fdc00e5c5ed40329b \ - --hash=sha256:4065c32b52f4b142f417af6f33a5024edc1336aa845b9d5a8d86071f6fcaac5a \ - --hash=sha256:51a4ba1256e9003a3acf508e3b4f4661bebd015b8180cc31849da222426ef585 \ - --hash=sha256:59888faac06403767c0cf8cfb3f4a777b2939b1fbd9f729299b5384f097f05ea \ - --hash=sha256:59c87886640574d8b14910840327f5cd15954e26ed0bbd4e7cef95fa5aef218f \ - --hash=sha256:610fc7d6db6c56a244c2701575f6851461753c60f73f2de89c79bbf1cc807f33 \ - --hash=sha256:70aeadeecb281ea901bf4230c6222af0248c41044d6f57401a614ea59d96d145 \ - --hash=sha256:71e1296d5e66c59cd2c0f2d72dc476d42afe02aeddc833d8e05630a0551dad7a \ - --hash=sha256:8fc7a49b440ea752cfdf1d51a586fd08d395ff7a5d555dc69e84b1939f7ddee3 \ - --hash=sha256:9b5c2afd2d6e3771d516045a6cfa11a8da9a60e3d128746a7fe9ab36dfe7221f \ - --hash=sha256:9c759051ebcb244d9d55ee791259ddd158188d15adee3c152502d3b69005e6bd \ - --hash=sha256:b4d1011fec5ec12aa7cc10c05a2f2f12dfa0adfe958e56ae38dc140614035804 \ - --hash=sha256:b4f1d6332339ecc61275bebd1f7b674098a66fea11a00c84d1c58851e618dc0d \ - --hash=sha256:c030cda3dc8e62b814831faa4eb93dd9a46498af8cd1d5c178c2de856972fd92 \ - --hash=sha256:c2e1f2012e56d61390c0e668c20c4fb0ae667c44d6f6a2eeea5d7148dcd3df9f \ - --hash=sha256:c37c77d6562074452120fc6c02ad86ec928f5710fbc435a181d69334b4de1d84 \ - --hash=sha256:c8149780c60f8fd02752d0429246088c6c04e234b895c4a42e1ea9b4de8d27fb \ - --hash=sha256:cbeeef1dc3c4299bd746b774f019de9e4672f7cc666c777cd5b409f0b746dac7 \ - --hash=sha256:e113878a446c6228669144ae8a56e268c91b7f1fafae927adc4879d9849e0ea7 \ - --hash=sha256:e21162bf941b85c0cda08224dade5def9360f53b09f9f259adb85fc7dd0e7b35 \ - --hash=sha256:fb6934ef4744becbda3143d30c6604718871495a5e36c408431bf33d9c146889 \ - # via pynacl +cffi==1.14.4 \ + --hash=sha256:00a1ba5e2e95684448de9b89888ccd02c98d512064b4cb987d48f4b40aa0421e \ + --hash=sha256:00e28066507bfc3fe865a31f325c8391a1ac2916219340f87dfad602c3e48e5d \ + --hash=sha256:045d792900a75e8b1e1b0ab6787dd733a8190ffcf80e8c8ceb2fb10a29ff238a \ + --hash=sha256:0638c3ae1a0edfb77c6765d487fee624d2b1ee1bdfeffc1f0b58c64d149e7eec \ + --hash=sha256:105abaf8a6075dc96c1fe5ae7aae073f4696f2905fde6aeada4c9d2926752362 \ + --hash=sha256:155136b51fd733fa94e1c2ea5211dcd4c8879869008fc811648f16541bf99668 \ + --hash=sha256:1a465cbe98a7fd391d47dce4b8f7e5b921e6cd805ef421d04f5f66ba8f06086c \ + --hash=sha256:1d2c4994f515e5b485fd6d3a73d05526aa0fcf248eb135996b088d25dfa1865b \ + --hash=sha256:2c24d61263f511551f740d1a065eb0212db1dbbbbd241db758f5244281590c06 \ + --hash=sha256:51a8b381b16ddd370178a65360ebe15fbc1c71cf6f584613a7ea08bfad946698 \ + --hash=sha256:594234691ac0e9b770aee9fcdb8fa02c22e43e5c619456efd0d6c2bf276f3eb2 \ + --hash=sha256:5cf4be6c304ad0b6602f5c4e90e2f59b47653ac1ed9c662ed379fe48a8f26b0c \ + --hash=sha256:64081b3f8f6f3c3de6191ec89d7dc6c86a8a43911f7ecb422c60e90c70be41c7 \ + --hash=sha256:6bc25fc545a6b3d57b5f8618e59fc13d3a3a68431e8ca5fd4c13241cd70d0009 \ + --hash=sha256:798caa2a2384b1cbe8a2a139d80734c9db54f9cc155c99d7cc92441a23871c03 \ + --hash=sha256:7c6b1dece89874d9541fc974917b631406233ea0440d0bdfbb8e03bf39a49b3b \ + --hash=sha256:840793c68105fe031f34d6a086eaea153a0cd5c491cde82a74b420edd0a2b909 \ + --hash=sha256:8d6603078baf4e11edc4168a514c5ce5b3ba6e3e9c374298cb88437957960a53 \ + --hash=sha256:9cc46bc107224ff5b6d04369e7c595acb700c3613ad7bcf2e2012f62ece80c35 \ + --hash=sha256:9f7a31251289b2ab6d4012f6e83e58bc3b96bd151f5b5262467f4bb6b34a7c26 \ + --hash=sha256:9ffb888f19d54a4d4dfd4b3f29bc2c16aa4972f1c2ab9c4ab09b8ab8685b9c2b \ + --hash=sha256:a5ed8c05548b54b998b9498753fb9cadbfd92ee88e884641377d8a8b291bcc01 \ + --hash=sha256:a7711edca4dcef1a75257b50a2fbfe92a65187c47dab5a0f1b9b332c5919a3fb \ + --hash=sha256:af5c59122a011049aad5dd87424b8e65a80e4a6477419c0c1015f73fb5ea0293 \ + --hash=sha256:b18e0a9ef57d2b41f5c68beefa32317d286c3d6ac0484efd10d6e07491bb95dd \ + --hash=sha256:b4e248d1087abf9f4c10f3c398896c87ce82a9856494a7155823eb45a892395d \ + --hash=sha256:ba4e9e0ae13fc41c6b23299545e5ef73055213e466bd107953e4a013a5ddd7e3 \ + --hash=sha256:c6332685306b6417a91b1ff9fae889b3ba65c2292d64bd9245c093b1b284809d \ + --hash=sha256:d5ff0621c88ce83a28a10d2ce719b2ee85635e85c515f12bac99a95306da4b2e \ + --hash=sha256:d9efd8b7a3ef378dd61a1e77367f1924375befc2eba06168b6ebfa903a5e59ca \ + --hash=sha256:df5169c4396adc04f9b0a05f13c074df878b6052430e03f50e68adf3a57aa28d \ + --hash=sha256:ebb253464a5d0482b191274f1c8bf00e33f7e0b9c66405fbffc61ed2c839c775 \ + --hash=sha256:ec80dc47f54e6e9a78181ce05feb71a0353854cc26999db963695f950b5fb375 \ + --hash=sha256:f032b34669220030f905152045dfa27741ce1a6db3324a5bc0b96b6c7420c87b \ + --hash=sha256:f60567825f791c6f8a592f3c6e3bd93dd2934e3f9dac189308426bd76b00ef3b \ + --hash=sha256:f803eaa94c2fcda012c047e62bc7a51b0bdabda1cad7a92a522694ea2d76e49f \ + # via -r requirements.in, pynacl chardet==3.0.4 \ --hash=sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae \ --hash=sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691 \ @@ -141,18 +149,35 @@ niceware==0.2.1 \ --hash=sha256:0f8b192f2a1e800e068474f6e208be9c7e2857664b33a96f4045340de4e5c69c \ --hash=sha256:cf2dc0e1567d36d067c61b32fed0f1b9c4534ed511f9eeead4ba548d03b5c9eb \ # via -r requirements.in -psutil==5.7.3 \ - --hash=sha256:01bc82813fbc3ea304914581954979e637bcc7084e59ac904d870d6eb8bb2bc7 \ - --hash=sha256:1cd6a0c9fb35ece2ccf2d1dd733c1e165b342604c67454fd56a4c12e0a106787 \ - --hash=sha256:2cb55ef9591b03ef0104bedf67cc4edb38a3edf015cf8cf24007b99cb8497542 \ - --hash=sha256:56c85120fa173a5d2ad1d15a0c6e0ae62b388bfb956bb036ac231fbdaf9e4c22 \ - --hash=sha256:5d9106ff5ec2712e2f659ebbd112967f44e7d33f40ba40530c485cc5904360b8 \ - --hash=sha256:6a3e1fd2800ca45083d976b5478a2402dd62afdfb719b30ca46cd28bb25a2eb4 \ - --hash=sha256:ade6af32eb80a536eff162d799e31b7ef92ddcda707c27bbd077238065018df4 \ - --hash=sha256:af73f7bcebdc538eda9cc81d19db1db7bf26f103f91081d780bbacfcb620dee2 \ - --hash=sha256:e02c31b2990dcd2431f4524b93491941df39f99619b0d312dfe1d4d530b08b4b \ - --hash=sha256:fa38ac15dbf161ab1e941ff4ce39abd64b53fec5ddf60c23290daed2bc7d1157 \ - --hash=sha256:fbcac492cb082fa38d88587d75feb90785d05d7e12d4565cbf1ecc727aff71b7 \ +psutil==5.8.0 \ + --hash=sha256:0066a82f7b1b37d334e68697faba68e5ad5e858279fd6351c8ca6024e8d6ba64 \ + --hash=sha256:02b8292609b1f7fcb34173b25e48d0da8667bc85f81d7476584d889c6e0f2131 \ + --hash=sha256:0ae6f386d8d297177fd288be6e8d1afc05966878704dad9847719650e44fc49c \ + --hash=sha256:0c9ccb99ab76025f2f0bbecf341d4656e9c1351db8cc8a03ccd62e318ab4b5c6 \ + --hash=sha256:0dd4465a039d343925cdc29023bb6960ccf4e74a65ad53e768403746a9207023 \ + --hash=sha256:12d844996d6c2b1d3881cfa6fa201fd635971869a9da945cf6756105af73d2df \ + --hash=sha256:1bff0d07e76114ec24ee32e7f7f8d0c4b0514b3fae93e3d2aaafd65d22502394 \ + --hash=sha256:245b5509968ac0bd179287d91210cd3f37add77dad385ef238b275bad35fa1c4 \ + --hash=sha256:28ff7c95293ae74bf1ca1a79e8805fcde005c18a122ca983abf676ea3466362b \ + --hash=sha256:36b3b6c9e2a34b7d7fbae330a85bf72c30b1c827a4366a07443fc4b6270449e2 \ + --hash=sha256:52de075468cd394ac98c66f9ca33b2f54ae1d9bff1ef6b67a212ee8f639ec06d \ + --hash=sha256:5da29e394bdedd9144c7331192e20c1f79283fb03b06e6abd3a8ae45ffecee65 \ + --hash=sha256:61f05864b42fedc0771d6d8e49c35f07efd209ade09a5afe6a5059e7bb7bf83d \ + --hash=sha256:6223d07a1ae93f86451d0198a0c361032c4c93ebd4bf6d25e2fb3edfad9571ef \ + --hash=sha256:6323d5d845c2785efb20aded4726636546b26d3b577aded22492908f7c1bdda7 \ + --hash=sha256:6ffe81843131ee0ffa02c317186ed1e759a145267d54fdef1bc4ea5f5931ab60 \ + --hash=sha256:74f2d0be88db96ada78756cb3a3e1b107ce8ab79f65aa885f76d7664e56928f6 \ + --hash=sha256:74fb2557d1430fff18ff0d72613c5ca30c45cdbfcddd6a5773e9fc1fe9364be8 \ + --hash=sha256:90d4091c2d30ddd0a03e0b97e6a33a48628469b99585e2ad6bf21f17423b112b \ + --hash=sha256:90f31c34d25b1b3ed6c40cdd34ff122b1887a825297c017e4cbd6796dd8b672d \ + --hash=sha256:99de3e8739258b3c3e8669cb9757c9a861b2a25ad0955f8e53ac662d66de61ac \ + --hash=sha256:c6a5fd10ce6b6344e616cf01cc5b849fa8103fbb5ba507b6b2dee4c11e84c935 \ + --hash=sha256:ce8b867423291cb65cfc6d9c4955ee9bfc1e21fe03bb50e177f2b957f1c2469d \ + --hash=sha256:d225cd8319aa1d3c85bf195c4e07d17d3cd68636b8fc97e6cf198f782f99af28 \ + --hash=sha256:ea313bb02e5e25224e518e4352af4bf5e062755160f77e4b1767dd5ccb65f876 \ + --hash=sha256:ea372bcc129394485824ae3e3ddabe67dc0b118d262c568b4d2602a7070afdb0 \ + --hash=sha256:f4634b033faf0d968bb9220dd1c793b897ab7f1189956e1aa9eae752527127d3 \ + --hash=sha256:fcc01e900c1d7bee2a37e5d6e4f9194760a93597c97fee89c4ae51701de03563 \ # via -r requirements.in pycparser==2.19 \ --hash=sha256:a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3 \ @@ -180,9 +205,9 @@ pysocks==1.7.1 \ --hash=sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5 \ --hash=sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0 \ # via -r requirements.in -requests==2.25.0 \ - --hash=sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8 \ - --hash=sha256:e786fa28d8c9154e6a4de5d46a1d921b8749f8b74e28bde23768e5e16eece998 \ +requests==2.25.1 \ + --hash=sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804 \ + --hash=sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e \ # via -r requirements.in, streamedrequests six==1.12.0 \ --hash=sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c \ @@ -229,8 +254,24 @@ urllib3==1.25.11 \ --hash=sha256:8d7eaa5a82a1cac232164990f04874c594c9453ec55eef02eab885aa02fc17a2 \ --hash=sha256:f5321fbe4bf3fefa0efd0bfe7fb14e90909eb62a48ccda331726b4319897dd5e \ # via -r requirements.in, requests -watchdog==1.0.1 \ - --hash=sha256:78ea5d78f2cf8e4d6343ab2cbed93bb47b7a85b1c2f90a1dea365226bbab68ac \ +watchdog==1.0.2 \ + --hash=sha256:016b01495b9c55b5d4126ed8ae75d93ea0d99377084107c33162df52887cee18 \ + --hash=sha256:101532b8db506559e52a9b5d75a308729b3f68264d930670e6155c976d0e52a0 \ + --hash=sha256:27d9b4666938d5d40afdcdf2c751781e9ce36320788b70208d0f87f7401caf93 \ + --hash=sha256:2f1ade0d0802503fda4340374d333408831cff23da66d7e711e279ba50fe6c4a \ + --hash=sha256:376cbc2a35c0392b0fe7ff16fbc1b303fd99d4dd9911ab5581ee9d69adc88982 \ + --hash=sha256:57f05e55aa603c3b053eed7e679f0a83873c540255b88d58c6223c7493833bac \ + --hash=sha256:5f1f3b65142175366ba94c64d8d4c8f4015825e0beaacee1c301823266b47b9b \ + --hash=sha256:602dbd9498592eacc42e0632c19781c3df1728ef9cbab555fab6778effc29eeb \ + --hash=sha256:68744de2003a5ea2dfbb104f9a74192cf381334a9e2c0ed2bbe1581828d50b61 \ + --hash=sha256:85e6574395aa6c1e14e0f030d9d7f35c2340a6cf95d5671354ce876ac3ffdd4d \ + --hash=sha256:b1d723852ce90a14abf0ec0ca9e80689d9509ee4c9ee27163118d87b564a12ac \ + --hash=sha256:d948ad9ab9aba705f9836625b32e965b9ae607284811cd98334423f659ea537a \ + --hash=sha256:e2a531e71be7b5cc3499ae2d1494d51b6a26684bcc7c3146f63c810c00e8a3cc \ + --hash=sha256:e7c73edef48f4ceeebb987317a67e0080e5c9228601ff67b3c4062fa020403c7 \ + --hash=sha256:ee21aeebe6b3e51e4ba64564c94cee8dbe7438b9cb60f0bb350c4fa70d1b52c2 \ + --hash=sha256:f1d0e878fd69129d0d68b87cee5d9543f20d8018e82998efb79f7e412d42154a \ + --hash=sha256:f84146f7864339c8addf2c2b9903271df21d18d2c721e9a77f779493234a82b5 \ # via -r requirements.in werkzeug==0.15.5 \ --hash=sha256:87ae4e5b5366da2347eb3116c0e6c681a0e939a33b2805e2c0cbd282664932c4 \ From 9d55c62d68019fcf8f70cdd75dd4bb6df5c81e67 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 22 Dec 2020 01:03:04 +0000 Subject: [PATCH 8/9] * revert pow to 5 * is is_alive in sneakernet observer * catch subprocess err in 3.9.x (dirty hack) in vanityonionr and block gen * bump version --- scripts/disable-dev-config.py | 4 ++-- src/etc/onionrvalues.py | 2 +- src/onionrproofs/subprocesspow.py | 15 +++++++++++---- src/sneakernet/__init__.py | 4 ++-- src/vanityonionr/__init__.py | 16 ++++++++++++---- static-data/default_config.json | 4 ++-- tests/runtime-result.txt | 2 +- tests/test_default_config_json.py | 4 ++-- 8 files changed, 33 insertions(+), 18 deletions(-) diff --git a/scripts/disable-dev-config.py b/scripts/disable-dev-config.py index d2b847b8..ca337a12 100755 --- a/scripts/disable-dev-config.py +++ b/scripts/disable-dev-config.py @@ -18,8 +18,8 @@ conf['general']['display_header'] = True conf['general']['security_level'] = 0 conf['general']['use_bootstrap_list'] = True conf['onboarding']['done'] = False -conf['general']['minimum_block_pow'] = 6 -conf['general']['minimum_send_pow'] = 6 +conf['general']['minimum_block_pow'] = 5 +conf['general']['minimum_send_pow'] = 5 conf['log']['file']['remove_on_exit'] = True conf['transports']['lan'] = True conf['transports']['tor'] = True diff --git a/src/etc/onionrvalues.py b/src/etc/onionrvalues.py index cafb8010..776068c2 100755 --- a/src/etc/onionrvalues.py +++ b/src/etc/onionrvalues.py @@ -23,7 +23,7 @@ import filepaths DENIABLE_PEER_ADDRESS = "OVPCZLOXD6DC5JHX4EQ3PSOGAZ3T24F75HQLIUZSDSMYPEOXCPFA" PASSWORD_LENGTH = 25 ONIONR_TAGLINE = 'Private P2P Communication - GPLv3 - https://Onionr.net' -ONIONR_VERSION = '8.0.0' +ONIONR_VERSION = '8.0.1' ONIONR_VERSION_CODENAME = 'Genesis' ONIONR_VERSION_TUPLE = tuple(ONIONR_VERSION.split('.')) # (MAJOR, MINOR, VERSION) API_VERSION = '2' # increments of 1; only change when something fundamental about how the API works changes. This way other nodes know how to communicate without learning too much information about you. diff --git a/src/onionrproofs/subprocesspow.py b/src/onionrproofs/subprocesspow.py index 2923de74..a988b366 100755 --- a/src/onionrproofs/subprocesspow.py +++ b/src/onionrproofs/subprocesspow.py @@ -91,10 +91,17 @@ class SubprocessPOW: def _spawn_proc(self): """Create a child proof of work process wait for data and send shutdown signal when its found""" - parent_conn, child_conn = Pipe() - p = Process(target=self.do_pow, args=(child_conn,), daemon=True) - p.start() - #p.join() + # The importerror started happening in 3.9.x + # not worth fixing because this POW will be replaced by VDF + try: + parent_conn, child_conn = Pipe() + p = Process(target=self.do_pow, args=(child_conn,), daemon=True) + p.start() + except ImportError: + logger.error( + "Error in subprocess module when getting new POW " + + "pipe.\nThis is related to a problem in 3.9.x", terminal=True) + return payload = None try: while True: diff --git a/src/sneakernet/__init__.py b/src/sneakernet/__init__.py index 9c78b568..6b4002a8 100644 --- a/src/sneakernet/__init__.py +++ b/src/sneakernet/__init__.py @@ -63,6 +63,6 @@ def sneakernet_import_thread(): for path in watch_paths: observer.schedule(_Importer(), path, recursive=True) observer.start() - while observer.isAlive(): + while observer.is_alive(): # call import func with timeout - observer.join(60) \ No newline at end of file + observer.join(60) diff --git a/src/vanityonionr/__init__.py b/src/vanityonionr/__init__.py index 7be6abcd..49556619 100644 --- a/src/vanityonionr/__init__.py +++ b/src/vanityonionr/__init__.py @@ -29,6 +29,8 @@ from multiprocessing import Process, Pipe, Queue import re, time import threading +import logger + wordlist = niceware.WORD_LIST def find_vanity_mnemonic(start_words: str, queue): @@ -47,10 +49,16 @@ def find_vanity_mnemonic(start_words: str, queue): def _start(start_words, obj): done = False - q = Queue() - p = Process(target=find_vanity_mnemonic, args=[start_words, q], daemon=True) - p.daemon = True - p.start() + try: + q = Queue() + p = Process(target=find_vanity_mnemonic, args=[start_words, q], daemon=True) + p.daemon = True + p.start() + except ImportError: + logger.error( + "Error in subprocess module when getting new POW " + + "pipe.\nThis is related to a problem in 3.9.x", terminal=True) + return rec = None while not done: try: diff --git a/static-data/default_config.json b/static-data/default_config.json index dcad2e50..fe047199 100755 --- a/static-data/default_config.json +++ b/static-data/default_config.json @@ -72,9 +72,9 @@ "tor": true }, "ui": { - "animated_background": false, + "animated_background": true, "public_remote_enabled": false, "public_remote_hosts": [], "theme": "dark" } -} +} \ No newline at end of file diff --git a/tests/runtime-result.txt b/tests/runtime-result.txt index 3fe82038..ed6d5e78 100644 --- a/tests/runtime-result.txt +++ b/tests/runtime-result.txt @@ -1 +1 @@ -1606975647 \ No newline at end of file +1608601319 \ No newline at end of file diff --git a/tests/test_default_config_json.py b/tests/test_default_config_json.py index 2678b13c..76ec3e65 100644 --- a/tests/test_default_config_json.py +++ b/tests/test_default_config_json.py @@ -30,8 +30,8 @@ class OnionrConfig(unittest.TestCase): self.assertEqual(conf['general']['ephemeral_tunnels'], False) self.assertEqual(conf['general']['hide_created_blocks'], True) self.assertEqual(conf['general']['insert_deniable_blocks'], True) - self.assertEqual(conf['general']['minimum_block_pow'], 6) - self.assertEqual(conf['general']['minimum_send_pow'], 6) + self.assertEqual(conf['general']['minimum_block_pow'], 5) + self.assertEqual(conf['general']['minimum_send_pow'], 5) self.assertEqual(conf['general']['public_key'], '') self.assertEqual(conf['general']['random_bind_ip'], True) self.assertEqual(conf['general']['security_level'], 0) From 427957b9e80f1e7f47b76514d72321360de7801f Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 22 Dec 2020 01:55:05 +0000 Subject: [PATCH 9/9] add all venvs to gitignore and update changelog --- .gitignore | 2 +- CHANGELOG.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 39d2b429..262f1c5f 100755 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ daemon-true.txt .vscode/tags .vscode/settings.json -venv/* +venv* src/fs* src/tmp/* testdata/* diff --git a/CHANGELOG.md b/CHANGELOG.md index caa6ab2c..c4603a86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.0.1] - 2020-12-22 + +* Fix subprocess in 3.9x with dumb hack +* Dependency bumps ## [8.0.0] - 2020-12-04