From 59aa969228afe36f4620c05f65ad186c2d2ed578 Mon Sep 17 00:00:00 2001 From: Nekmo Date: Wed, 6 Feb 2019 23:37:44 +0100 Subject: [PATCH 01/13] Issue #120: FreeNAS iocage Plugin --- docs/installation.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/installation.rst b/docs/installation.rst index 4768ce1..db63f02 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -62,6 +62,9 @@ There is support for FreeNAS created by `Troy Prelog = 2.4.1`` (including 2.4.2) +`has a bug with FreeBSD `_. Install Scapy 2.4.0 + Installation Issues ------------------- From 84ffda007c6fef42a7ecea0c2f847a295e596651 Mon Sep 17 00:00:00 2001 From: Nekmo Date: Mon, 18 Feb 2019 01:15:59 +0100 Subject: [PATCH 02/13] Issue #119: Authorization Header with OpenHab --- amazon_dash/execute.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/amazon_dash/execute.py b/amazon_dash/execute.py index 790f64e..3e2a1cc 100644 --- a/amazon_dash/execute.py +++ b/amazon_dash/execute.py @@ -278,7 +278,9 @@ def get_headers(self): :return: HTTP Headers :rtype: dict """ - return copy.copy(self.default_headers or {}) + headers = copy.copy(self.default_headers or {}) + headers.update(self.data.get('headers') or {}) + return headers def get_body(self): """Get body to send. By default default_body @@ -363,7 +365,7 @@ class ExecuteOpenHab(ExecuteOwnApiBase): def __init__(self, name, data): super(ExecuteOpenHab, self).__init__(name, data) - self.data['headers'] = {'Accept': 'application/json'} + self.data['headers'] = dict(self.data.get('headers') or {}, **{'Accept': 'application/json'}) def get_url(self): """Open Hab url From 55d641ae57631b7a49742be93735349c92a9b1fc Mon Sep 17 00:00:00 2001 From: Nekmo Date: Sat, 23 Feb 2019 23:49:06 +0100 Subject: [PATCH 03/13] Issue #128: Command On Button Press Does Not Work In Combination With Docker --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 87a0770..3704ee7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,8 @@ RUN apk update \ procps=3.3.15-r0 \ tcpdump=4.9.2-r3 \ scapy=2.4.0-r0 \ + && apk add --no-cache \ + bash \ && pip install --no-cache-dir -r py3-requirements.txt \ && pip install . \ && python -m amazon_dash.install \ From 5c105d3fcfe4479729095884ba56bf8e9fff0d1a Mon Sep 17 00:00:00 2001 From: Nekmo Date: Mon, 11 Mar 2019 01:42:21 +0100 Subject: [PATCH 04/13] Issue #132: Systemd service does not work after reboot --- amazon_dash/install/services/amazon-dash.service | 2 ++ 1 file changed, 2 insertions(+) diff --git a/amazon_dash/install/services/amazon-dash.service b/amazon_dash/install/services/amazon-dash.service index f13a642..a7601a0 100644 --- a/amazon_dash/install/services/amazon-dash.service +++ b/amazon_dash/install/services/amazon-dash.service @@ -1,5 +1,7 @@ [Unit] Description=Amazon Dash service +After=network-online.target +Wants=network-online.target [Service] User=root From ff97acdc1fb3315ad84be4cbe6634632a449ef3c Mon Sep 17 00:00:00 2001 From: Nekmo Date: Mon, 11 Mar 2019 01:48:09 +0100 Subject: [PATCH 05/13] Changed setup description. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 39ff913..fba05e9 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -"""Package description +"""Find web directories without bruteforce """ from setuptools import setup, find_packages, __version__ as setuptool_version from distutils.util import convert_path From fa371469881fb08112f6c21fbf755b8b289a6513 Mon Sep 17 00:00:00 2001 From: Nekmo Date: Mon, 11 Mar 2019 01:48:52 +0100 Subject: [PATCH 06/13] Changed setup description. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fba05e9..fcf5ddc 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -"""Find web directories without bruteforce +"""Hack your Amazon Dash to run what you want. """ from setuptools import setup, find_packages, __version__ as setuptool_version from distutils.util import convert_path From fecf8b3eb060367d63b48931d8e093bb00a19b56 Mon Sep 17 00:00:00 2001 From: Nekmo Date: Tue, 12 Mar 2019 23:55:38 +0100 Subject: [PATCH 07/13] Issue #130: jsonschema has been updated to 3.0.0 (incompatible update) --- common-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-requirements.txt b/common-requirements.txt index ac6e859..b85c1c5 100644 --- a/common-requirements.txt +++ b/common-requirements.txt @@ -1,5 +1,5 @@ PyYAML>=3.0 -jsonschema +jsonschema<3.0.0 requests click click-default-group \ No newline at end of file From b0b0bc4a7be79ba6132ba8fc87c337089980ded4 Mon Sep 17 00:00:00 2001 From: Nekmo Date: Thu, 14 Mar 2019 21:39:06 +0100 Subject: [PATCH 08/13] Issue #129: Doubts in the installation between python2 and python3. --- README.rst | 9 +++++---- docs/installation.rst | 11 ++++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index efbc009..3fffb7c 100644 --- a/README.rst +++ b/README.rst @@ -50,12 +50,13 @@ with few resources. .. code:: console - $ sudo pip install amazon-dash # and after: - $ sudo python -m amazon_dash.install + $ sudo pip3 install amazon-dash # and after: + $ sudo python3 -m amazon_dash.install Also available on `AUR `_ and -`FreeNAS `_. See other installation methods -`in the documentation `_. +`FreeNAS `_. You can also use ``pip2`` and +``python2`` if your system only has Python2, but Python 3 is the recommended version. See other installation +methods `in the documentation `_. 2. Use *discovery mode* **to know the mac of your Dash** (Run the program, and then press any button): diff --git a/docs/installation.rst b/docs/installation.rst index db63f02..9594290 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -12,11 +12,16 @@ To install amazon-dash, run these commands in your terminal: .. code-block:: console - $ pip install -U amazon_dash - $ sudo python -m amazon_dash.install + $ sudo pip3 install -U amazon_dash + $ sudo python3 -m amazon_dash.install This is the preferred method to install amazon-dash, as it will always install the most recent stable release. -You must execute both commands in the correct order. +You must execute both commands in the correct order. Amazon-dash also works with Python2: + +.. code-block:: console + + $ sudo pip2 install -U amazon_dash + $ sudo python2 -m amazon_dash.install If you don't have `pip`_ installed, this `Python installation guide`_ can guide you through the process. From 0e2bdc24ff8ea32cecb2f5f54f5cc1c0f99c197b Mon Sep 17 00:00:00 2001 From: Nekmo Date: Wed, 20 Mar 2019 23:36:44 +0100 Subject: [PATCH 09/13] Issue #117: Trouble installing on os x --- amazon_dash/install/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/amazon_dash/install/__init__.py b/amazon_dash/install/__init__.py index 7e3ba62..6a70334 100644 --- a/amazon_dash/install/__init__.py +++ b/amazon_dash/install/__init__.py @@ -1,4 +1,5 @@ import os +import platform import shutil import sys from subprocess import check_output @@ -15,6 +16,7 @@ dirname = os.path.dirname(os.path.abspath(__file__)) CONFIG_EXAMPLE = os.path.join(dirname, 'amazon-dash.yml') SYSTEMD_SERVICE = os.path.join(dirname, 'services', 'amazon-dash.service') +UNSUPPORTED_SYSTEMS = ['Darwin', 'Windows'] if sys.version_info < (3,0): @@ -125,6 +127,12 @@ def installation(self): @click.group(cls=DefaultGroup, default='all', default_if_no_args=True) @click.option('--root-required/--root-not-required', default=True) def cli(root_required): + system = platform.system() + if system in UNSUPPORTED_SYSTEMS: + click.echo('{} is not supported by the installation wizard. ' + 'However, you can use Amazon-dash manually.\n' + 'http://docs.nekmo.org/amazon-dash/usage.html#manually'.format(system), err=True) + sys.exit(2) if os.getuid() and root_required: click.echo('The installation must be done as root. Maybe you forgot sudo?', err=True) sys.exit(1) From ba17a2a7644aa1bac9a0a40431430940bdb1caf3 Mon Sep 17 00:00:00 2001 From: Filip Weiss Date: Tue, 2 Jul 2019 17:38:00 +0200 Subject: [PATCH 10/13] always send http body as utf-8. fixes #139 --- amazon_dash/execute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amazon_dash/execute.py b/amazon_dash/execute.py index 3e2a1cc..610dc8b 100644 --- a/amazon_dash/execute.py +++ b/amazon_dash/execute.py @@ -209,7 +209,7 @@ def execute(self, root_allowed=False): if self.data.get('content-type'): kwargs['headers']['content-type'] = self.data['content-type'] if self.data.get('body'): - kwargs['data'] = self.data['body'] + kwargs['data'] = self.data['body'].encode('utf-8') if self.data.get('auth'): kwargs['auth'] = tuple(self.data['auth'].split(':', 1)) try: From 812339aa3eac0b8b1d358276eb7dac3cad71923e Mon Sep 17 00:00:00 2001 From: Nekmo Date: Thu, 1 Aug 2019 00:28:08 +0200 Subject: [PATCH 11/13] Issue #141: [Fix] Error when installing Scapy + tcpdump missing (forced scapy release on requirements). --- py2-requirements.txt | 2 +- py3-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/py2-requirements.txt b/py2-requirements.txt index ff269db..26f4528 100644 --- a/py2-requirements.txt +++ b/py2-requirements.txt @@ -1,3 +1,3 @@ -scapy +scapy<=2.4.0 subprocess32 -r common-requirements.txt diff --git a/py3-requirements.txt b/py3-requirements.txt index d768638..4561b95 100644 --- a/py3-requirements.txt +++ b/py3-requirements.txt @@ -1,2 +1,2 @@ -scapy>=2.4.0 +scapy<=2.4.0 -r common-requirements.txt From 227904903a685bf9db7a8d1860f28dd28de5df16 Mon Sep 17 00:00:00 2001 From: Nekmo Date: Thu, 1 Aug 2019 00:34:13 +0200 Subject: [PATCH 12/13] Issue #141: [Fix] Error when installing Scapy + tcpdump missing (note in readme). --- README.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.rst b/README.rst index 3fffb7c..61947a6 100644 --- a/README.rst +++ b/README.rst @@ -58,6 +58,9 @@ Also available on `AUR `_ a ``python2`` if your system only has Python2, but Python 3 is the recommended version. See other installation methods `in the documentation `_. +**Note:** ``scapy 2.4.1/2.4.2`` releases are broken (``MANIFEST`` is missing in wheel). Scapy 2.4.0 will be used by +default (or earlier). It may also be necessary to install ``tcpdump`` on your system (in Debian +``apt install tcpdump``). 2. Use *discovery mode* **to know the mac of your Dash** (Run the program, and then press any button): From 094708ad3caeb87d381c8bd03a38338b54e04396 Mon Sep 17 00:00:00 2001 From: Nekmo Date: Thu, 1 Aug 2019 00:35:15 +0200 Subject: [PATCH 13/13] =?UTF-8?q?Bump=20version:=201.3.2=20=E2=86=92=201.3?= =?UTF-8?q?.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- amazon_dash/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 6804790..9c2118f 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.3.2 +current_version = 1.3.3 commit = True tag = True diff --git a/amazon_dash/__init__.py b/amazon_dash/__init__.py index 919eba8..2a9be19 100644 --- a/amazon_dash/__init__.py +++ b/amazon_dash/__init__.py @@ -1,2 +1,2 @@ -__version__ = '1.3.2' \ No newline at end of file +__version__ = '1.3.3' \ No newline at end of file