tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
0
fork
atom
overview
issues
pulls
pipelines
burpsuite: add updateScript
Yechiel Worenklein
8 months ago
7f030992
6d2955e7
+41
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
bu
burpsuite
package.nix
update.sh
+2
pkgs/by-name/bu/burpsuite/package.nix
···
91
91
cp -r ${desktopItem}/share/applications $out/share
92
92
'';
93
93
94
94
+
passthru.updateScript = ./update.sh;
95
95
+
94
96
meta = with lib; {
95
97
inherit description;
96
98
longDescription = ''
+39
pkgs/by-name/bu/burpsuite/update.sh
···
1
1
+
#!/usr/bin/env nix-shell
2
2
+
#!nix-shell -i bash -p curl jq xxd gnused diffutils
3
3
+
set -eu -o pipefail
4
4
+
5
5
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
6
6
+
7
7
+
curl -s 'https://portswigger.net/burp/releases/data' |
8
8
+
jq -r '
9
9
+
[[
10
10
+
.ResultSet.Results[]
11
11
+
| select(
12
12
+
(.categories | sort) == (["Professional","Community"] | sort)
13
13
+
and .releaseChannels == ["Early Adopter"]
14
14
+
)
15
15
+
][0].builds[]
16
16
+
| select(.ProductPlatform == "Jar")
17
17
+
]' >latest.json
18
18
+
19
19
+
version=$(jq -r '.[0].Version' latest.json)
20
20
+
21
21
+
comm_hex=$(jq -r '.[] | select(.ProductId=="community") .Sha256Checksum' latest.json)
22
22
+
pro_hex=$(jq -r '.[] | select(.ProductId=="pro") .Sha256Checksum' latest.json)
23
23
+
24
24
+
comm_sri="sha256-$(printf %s "$comm_hex" | xxd -r -p | base64 -w0)"
25
25
+
pro_sri="sha256-$(printf %s "$pro_hex" | xxd -r -p | base64 -w0)"
26
26
+
27
27
+
sed -i \
28
28
+
-e "s|^\(\s*version = \)\"[^\"]*\";|\1\"$version\";|" \
29
29
+
-e "/productName = \"community\"/,/hash =/ {
30
30
+
s|sha256-[^\"]*|$comm_sri|
31
31
+
}" \
32
32
+
-e "/productName = \"pro\"/,/hash =/ {
33
33
+
s|sha256-[^\"]*|$pro_sri|
34
34
+
}" \
35
35
+
$SCRIPT_DIR/package.nix
36
36
+
37
37
+
echo "burpsuite → $version"
38
38
+
echo " community: $comm_sri"
39
39
+
echo " pro : $pro_sri"