From 82be88eaf034a6777566b54602934b9cc4402625 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Mon, 23 Oct 2023 13:47:58 +0200 Subject: [PATCH] v2.5.0 Signed-off-by: Jeroen Oudshoorn --- builder/pwnagotchi.json | 80 ++++++++++++++++++++++++++++++++++++++--- builder/pwnagotchi.yml | 38 ++++++++++++++------ 2 files changed, 102 insertions(+), 16 deletions(-) diff --git a/builder/pwnagotchi.json b/builder/pwnagotchi.json index 56c9568a..3c3949e7 100644 --- a/builder/pwnagotchi.json +++ b/builder/pwnagotchi.json @@ -14,18 +14,88 @@ } ], "provisioners": [ + { + "type": "file", + "source": "../builder/data/usr/local/bin/bettercap", + "destination": "/usr/local/bin/bettercap" + }, + { + "type": "file", + "source": "../builder/data/usr/local/bin/pwngrid", + "destination": "/usr/local/bin/pwngrid" + }, + { + "type": "file", + "source": "../builder/data/usr/bin/pwnlib", + "destination": "/usr/bin/pwnlib" + }, + { + "type": "file", + "source": "../builder/data/usr/bin/bettercap-launcher", + "destination": "/usr/bin/bettercap-launcher" + }, + { + "type": "file", + "source": "../builder/data/usr/bin/pwnagotchi-launcher", + "destination": "/usr/bin/pwnagotchi-launcher" + }, + { + "type": "file", + "source": "../builder/data/usr/bin/monstop", + "destination": "/usr/bin/monstop" + }, + { + "type": "file", + "source": "../builder/data/usr/bin/monstart", + "destination": "/usr/bin/monstart" + }, + { + "type": "file", + "source": "../builder/data/usr/bin/hdmion", + "destination": "/usr/bin/hdmion" + }, + { + "type": "file", + "source": "../builder/data/usr/bin/hdmioff", + "destination": "/usr/bin/hdmioff" + }, + { + "type": "file", + "source": "../builder/data/etc/systemd/system/pwngrid-peer.service", + "destination": "/etc/systemd/system/pwngrid-peer.service" + }, + { + "type": "file", + "source": "../builder/data/etc/systemd/system/pwnagotchi.service", + "destination": "/etc/systemd/system/pwnagotchi.service" + }, + { + "type": "file", + "source": "../builder/data/etc/systemd/system/bettercap.service", + "destination": "/etc/systemd/system/bettercap.service" + }, { "type": "shell", "inline": [ - "mkdir -p /usr/local/src/pwnagotchi" + "chmod +x /usr/bin/*" + ] + }, + { + "type": "shell", + "inline": [ + "chmod +x /usr/local/bin/*" ] }, { "type": "file", - "sources": [ - "../dist/pwnagotchi-{{user `pwn_version`}}.tar.gz" - ], - "destination": "/usr/local/src/pwnagotchi/" + "source": "../builder/data/etc/update-motd.d/01-motd", + "destination": "/etc/update-motd.d/01-motd" + }, + { + "type": "shell", + "inline": [ + "chmod +x /etc/update-motd.d/*" + ] }, { "type": "shell", diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index 6076e4be..2811f29d 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -122,7 +122,6 @@ - libusb-1.0-0-dev - lsof - make - - ntp - python3-dbus - python3-flask - python3-flask-cors @@ -194,7 +193,7 @@ # Install nexmon to fix wireless scanning (takes 2.5G of space) - name: clone nexmon repository git: - repo: https://github.com/DrSchottky/nexmon.git + repo: https://github.com/jayofelony/nexmon.git dest: /usr/local/src/nexmon register: nexmongit @@ -308,10 +307,23 @@ path: /etc/pwnagotchi/conf.d/ state: directory - - name: Install pwnagotchi from source archive + - name: clone pwnagotchi repository + git: + repo: https://github.com/jayofelony/pwnagotchi.git + dest: /usr/local/src/pwnagotchi + register: pwnagotchigit + + - name: build pwnagotchi wheel + command: "python3 setup.py sdist bdist_wheel" + args: + chdir: /usr/local/src/pwnagotchi + when: (pwnagotchigit.changed) or (pip_packages['pwnagotchi'] is undefined) or (pip_packages['pwnagotchi'] != pwnagotchi_version) + + - name: install pwnagotchi wheel and dependencies pip: - name: /usr/local/src/pwnagotchi/pwnagotchi-{{ pwnagotchi.version }}.tar.gz - extra_args: --verbose --prefer-binary --ignore-installed + name: "{{ lookup('fileglob', '/usr/local/src/pwnagotchi/dist/pwnagotchi*.whl') }}" + extra_args: "--no-cache-dir" + when: (pwnagotchigit.changed) or (pip_packages['pwnagotchi'] is undefined) or (pip_packages['pwnagotchi'] != pwnagotchi_version) - name: remove pwnagotchi folder file: @@ -541,6 +553,16 @@ args: executable: /bin/bash + - name: remove /root/go folder + file: + state: absent + path: /root/go + + - name: remove /usr/local/go folder + file: + state: absent + path: /usr/local/go + - name: remove pip cache file: state: absent @@ -551,12 +573,6 @@ autoremove: yes when: removed.changed - - name: set permissions - command: "chmod +x /usr/bin/*" - - - name: set permissions - command: "chmod +x /usr/local/bin/*" - handlers: - name: reload systemd services systemd: