From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id gNoIJBMdK2OvEAEAbAwnHQ (envelope-from ) for ; Wed, 21 Sep 2022 16:17:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id iJniIxMdK2OFhgEAauVa8A (envelope-from ) for ; Wed, 21 Sep 2022 16:17:55 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1420F20EAC for ; Wed, 21 Sep 2022 16:17:54 +0200 (CEST) Received: from localhost ([::1]:60452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ob0Xy-0007jL-2x for larch@yhetil.org; Wed, 21 Sep 2022 10:17:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaMGX-0005uY-1e for help-guix@gnu.org; Mon, 19 Sep 2022 15:17:13 -0400 Received: from koszko.org ([93.95.227.159]:46544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaMGT-0003SZ-A2 for help-guix@gnu.org; Mon, 19 Sep 2022 15:17:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=koszko.org; s=mail; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/yQ7oIJzzC37qkTn55+o7Vu5oH0Ym3G8L9CG0+ZtTes=; b=xAzPwL79oxqG2NXqKeQw5q0rxc vnqftRBwdrydIJ7uGOKImWt0arQ0JD8Np/OM0+Y5et3UCZfqpTFl00sVq2qgtnZb+5p6iXIFDX+HA R8uXJHTBTaMnDFdS2otK6M5dcLNC1wJTH2p2lCzCIxO3sZ3lSIQvi9LzvR00Utm47Ntq3tRe3JjVU 86j5s7P26ljO5c3Aq6G+Fegrn/MIqzfSzHQsOdyxXgn4KikTcqo1vLfjzdT5UDX1+XBnewJxChhRJ oyU3UkZl2u8/RDuydpOT0pdfH+QFyhZlK5vtdaaWYet0PkYnQDZzQyB+V+gKL7oMgIXhU3Ek9titT xhcBA9EDMGPp5GJazOQThC2xZC1O50Nua3dtT0x11X4UJM+aangAa0O4GFrXZH/DPBPcTBVPfOeOO toAnvojQz1sUueiSuXs9hqepe2BCKVWFnxIs70ghtsIIrUjW5G1yXbThrOkR8nYRvDYtMJbWzaxHe 73W+8jeE6aE5z2ONOsuUOvTM8m0+aNfd/eiFHylmG8qBH4a284An/Slkv9mrzvgOylFFkILl1lGH8 LyzlA+xMaS36v/3KTFstc7A+icBbOaHByzIqp6jw9fj9fWSmDw1LHV7rzC8YDarB2Yg63ED+mO/fX +NmaPEY/oioC5HARJ5PY1gHnoJrQVwfFK4xGVsaGc=; Received: from [91.231.169.167] (helo=koszkonutek-tmp.pl.eu.org) by koszko.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaMGH-0005Rt-Ok for help-guix@gnu.org; Mon, 19 Sep 2022 21:16:57 +0200 Date: Mon, 19 Sep 2022 21:16:55 +0200 To: help-guix@gnu.org Subject: installing mitmproxy with Guix Message-ID: <20220919211655.324b8823@koszkonutek-tmp.pl.eu.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/_e2vMGnFMb3kB+udZ_cc2pI"; protocol="application/pgp-signature"; micalg=pgp-sha256 Received-SPF: pass client-ip=93.95.227.159; envelope-from=koszko@koszko.org; helo=koszko.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 21 Sep 2022 10:16:57 -0400 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" Reply-to: Wojtek Kosior From: Wojtek Kosior via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663769875; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=/yQ7oIJzzC37qkTn55+o7Vu5oH0Ym3G8L9CG0+ZtTes=; b=Xifdp5Xiw2y1nuTXNKTP5I+Hg2HvnAy0N16uP9tyiwPVoVU5M9n3+0xL6s+zjLg1h8IMXI 2+vZpdIVMtpPaVGWLnNc04BS/+U6rPHZOoMPedzX8dX9dVLyIrdOhyFIHRJQ7hZ+0+8N+R xYosBsoZU03cDJ2YxnzbFvD8Jkv+GtK7MqRCqbigNylhGkGxrTCTqT4mA4jjNY4glHZADx rVStDvjwsX9J/Nk+zJUufJpJQDk2MtzgNjRmBE4LaIc3YKK2lJQdvnRNe2nhovT/HBQxaG NN++rowGNlyZbz322MvUGb/5I5qn7+JekmxcVc6Z2l9PlfRnN251JTeI0C8Fmw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663769875; a=rsa-sha256; cv=none; b=LuvP2J6tTK7LLt75fXXAtyjdDnw3BZDxS9gh9lvHzE17aox3oKgMfooixXNy4J9cPcNB92 wVVsV0uZUUfp+l3UFZwPqAKKA1PwYGVydwegZvnNif3FPcWTJG7t6lu9gc8P5E3h9mUBfx KPIk52SB6IodPNrjCt72MwAVQ2SjtvHYQlke1x3wx3Q0wDRLdzg5pOLHT+621ABX0xHAaC fDVr+0SIcypNNCrT8T7HKgF30+2bhaNwywkY3v8hCyqmCgQdr9xfoyw66eLBXlIpeuEXsz yLMe5gZC4cN9KLKaNlkQgUxCm4Ehq6QuLSbfn5VgALqAhzfLi/BJtly5qXGasA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=xAzPwL79; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.24 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=xAzPwL79; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1420F20EAC X-Spam-Score: -4.24 X-Migadu-Scanner: scn1.migadu.com X-TUID: AXymJFXh2+Q0 --Sig_/_e2vMGnFMb3kB+udZ_cc2pI Content-Type: multipart/mixed; boundary="MP_/Fz3jM_0SgIDO0s0uGiY3Ws3" --MP_/Fz3jM_0SgIDO0s0uGiY3Ws3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, I just finished making my first working package definition (acutally, a set of definitions...) for Guix. It's for mitmproxy, a popular TLS-enabled proxy for observing and modifying HTTP(s) traffic, written in Python. I wanted to share this with others. The package module file is attached - I'm making it available to everyone under Creative Commons Zero as indicated by the SPDX identifier in the file. I suspect I could instead make the changes in Guix' repo, make a commit, generate a patch from git and send it to guix-patches@gnu.org, but - as you'll see, the package forced update of inputs of several existing packages and my current solution seems too imperfect to be included (even though it works), - it's my first attempt at Guix packaging and there'll likely be some other issues that need resolving - preparing and submitting a patch is simply more time-consuming than sending a .scm file =F0=9F=98=85 - maybe I'm just unconsciously seeking integration with people? Nevertheless, what do you think would be the best way to address the conflict of propagated inputs (in this case caused by python-cryptography and python-cryptography-next being required at the same time)? Best, Wojtek -- (sig_start) website: https://koszko.org/koszko.html PGP: https://koszko.org/key.gpg fingerprint: E972 7060 E3C5 637C 8A4F 4B42 4BC5 221C 5A79 FD1A Meet Krak=C3=B3w saints! #13: blessed Jan Beyzym Poznaj =C5=9Bwi=C4=99tych krakowskich! #13: b=C5=82ogos=C5=82awiony Jan Be= yzym https://pl.wikipedia.org/wiki/Jan_Beyzym -- (sig_end) --MP_/Fz3jM_0SgIDO0s0uGiY3Ws3 Content-Type: text/x-scheme Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=mitmproxy.scm ;; SPDX-License-Identifier: CC0-1.0 ;; Copyright (C) 2022 Wojtek Kosior (define-module (mitmproxy)) (use-modules (guix packages) (guix download) (guix git-download) (guix build-system python) ((guix licenses) #:prefix license:) (gnu packages python-build) (gnu packages python-xyz) (gnu packages python-crypto) (gnu packages compression) (gnu packages python-compression) (gnu packages xdisorg) (gnu packages serialization) (gnu packages protobuf) (gnu packages python-web) (gnu packages check) (gnu packages sphinx)) (define-public python-kaitaistruct (package (name "python-kaitaistruct") (version "0.10") (source (origin (method url-fetch) (uri (pypi-uri "kaitaistruct" version)) (sha256 (base32 "0ap5ka51gnc2mc4s1kqqsi6nb6zqv8wsrg17ryxazmkkj7idwi50")))) (build-system python-build-system) (home-page "https://kaitai.io") (native-inputs (list python-wheel)) (synopsis "Declarative parser generator for binary data: runtime library for Pyt= hon") (description "Kaitai Struct is a declarative language used for describing various b= inary data structures, laid out in files or in memory - i.e. binary file formats, network stream packet formats, etc.") (license license:expat))) (define-public python-parver (package (name "python-parver") (version "0.3.1") (source (origin (method url-fetch) (uri (pypi-uri "parver" version)) (sha256 (base32 "1lyzqp8bz0n2kzabzl7k7g7cn90rlnrxjzva2p62gsfc7djy00n9")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'relax-requirements (lambda _ (substitute* "setup.py" (("arpeggio[^']*") "arpeggio")))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? (invoke "pytest"))))))) (propagated-inputs (list python-arpeggio python-attrs python-six)) (native-inputs (list python-hypothesis python-pretend python-pytest)) (home-page "https://github.com/RazerM/parver") (synopsis "Parse and manipulate version numbers.") (description "Parver facilitates parsing and manipulation of @url{https://www.python.org/dev/peps/pep-0440/,PEP 440} version numbers.") (license license:expat))) (define-public python-pyopenssl-for-mitmproxy (let ((base python-pyopenssl)) (package (inherit base) (version "22.0.0") (source (origin (inherit (package-source base)) (uri (pypi-uri "pyOpenSSL" version)) (sha256 (base32 "1gzihw09sqi71lwx97c69hab7w4rbnl6hhfrl6za3i5a4la1n2v6")))) (propagated-inputs (modify-inputs (package-propagated-inputs base) (replace "python-cryptography" python-cryptography-next)))))) (define-public python-urllib3-for-mitmproxy (let ((base python-urllib3)) (package (inherit base) (propagated-inputs (modify-inputs (package-propagated-inputs base) (replace "python-cryptography" python-cryptography-next) (replace "python-pyopenssl" python-pyopenssl-for-mitmproxy)))))) (define-public python-requests-for-mitmproxy (let ((base python-requests)) (package (inherit base) (propagated-inputs (modify-inputs (package-propagated-inputs base) (replace "python-urllib3" python-urllib3-for-mitmproxy)))))) (define-public python-werkzeug-for-mitmproxy (let ((base python-werkzeug)) (package (inherit base) (propagated-inputs (modify-inputs (package-propagated-inputs base) (replace "python-requests" python-requests-for-mitmproxy)))))) (define-public python-flask-for-mitmproxy (let ((base python-flask)) (package (inherit base) (propagated-inputs (modify-inputs (package-propagated-inputs base) (replace "python-werkzeug" python-werkzeug-for-mitmproxy)))))) (define-public mitmproxy (package (name "mitmproxy") (version "8.1.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/mitmproxy/mitmproxy") (commit (string-append "v" version)))) (sha256 (base32 "0kpzk8ci02vyjg9nqnpnadmgyaxxrpdydgfnm2xmxf1s4rzdcvwx")) (snippet '(begin ;; The player contains some minified JS. It would be possible to= find ;; player sources elsewhere on the internet but there's no point= in ;; doing do since we're not building the docs anyway. (delete-file "docs/src/assets/asciinema-player.js") #t)))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'relax-requirements (lambda _ (substitute* "setup.py" (("kaitaistruct>=3D0\\.7[^\"]*") "kaitaistruct") ;; The ">=3D2.8" req was there because older ldap3 lacked a = crucial ;; ">=3D0.4.8" req for its dep, pyasn. It's not an issue for= Guix ;; which ships with pyasn 4.8 anyway. (("ldap3>=3D2\\.8[^\"]*") "ldap3") (("protobuf>=3D3\\.14,<5") "protobuf") (("sortedcontainers>=3D2\\.3[^\"]*") "sortedcontainers") (("wsproto>=3D1\\.0[^\"]*") "wsproto") (("pytest-timeout[^\"]*<2[^\"]*") "pytest-timeout") (("pytest-asyncio[^\"]*<0.14[^\"]*") "pytest-asyncio")) (substitute* "test/mitmproxy/proxy/layers/http/test_http.py" (("isinstance\\(x, HTTPFlow\\)") "issubclass(type(x), HTTPFlow)")))) (replace 'check (lambda* (#:key tests? inputs outputs #:allow-other-keys) (when tests? (setenv "HOME" "/tmp") (invoke "pytest" "--timeout" "60"))))))) (propagated-inputs (list python-asgiref python-blinker python-brotli python-cryptography-next python-flask-for-mitmproxy python-h11 python-h2 python-hyperframe python-kaitaistruct python-ldap3 python-msgpack python-passlib python-protobuf python-pyopenssl-for-mitmproxy python-pyparsing python-pyperclip python-ruamel.yaml python-sortedcontainers python-tornado-6 python-urwid python-wsproto python-publicsuffix2 python-zstandard)) (native-inputs (list python-parver python-pytest python-pytest-asyncio python-pytest-timeout)) (home-page "https://mitmproxy.org/") (synopsis "A free interactive HTTPS proxy") (description "An interactive TLS-capable intercepting HTTP proxy for penetration te= sters and software developers. It can be used to intercept, inspect, modify and replay web traffic such as HTTP/1, HTTP/2, WebSockets, or any other SSL/TLS-protected protocols.") (license license:expat))) --MP_/Fz3jM_0SgIDO0s0uGiY3Ws3-- --Sig_/_e2vMGnFMb3kB+udZ_cc2pI Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQTpcnBg48VjfIpPS0JLxSIcWnn9GgUCYyjAJwAKCRBLxSIcWnn9 Glu/APoDWmUQdQ0T1jr/mKkeN6xNpNoEOdS5q8VlAcR9RHOHBwEAhIHtDOLrlYmB SqZInT+VZfJ4VIogETJTyrvl+LyJ1gY= =MVay -----END PGP SIGNATURE----- --Sig_/_e2vMGnFMb3kB+udZ_cc2pI--