Compare commits
65 Commits
add_action
...
main
Author | SHA1 | Date | |
---|---|---|---|
364c16c08e | |||
bfbe4385a7 | |||
1b95da1bdf | |||
856a0d909c | |||
c11e6b8ab6 | |||
5adcaf73be | |||
673a8092c0 | |||
0533a5d323 | |||
c045114009 | |||
6fec195e21 | |||
1384ef0d49 | |||
67743500ad | |||
fb7a93ca5b | |||
be89c2b5fa | |||
b68045aa6b | |||
|
144bc02528 | ||
9f316030d5 | |||
|
cdce75fedd | ||
45a8b7696b | |||
|
4609b6595f | ||
45ad6e2571 | |||
82a4f27050 | |||
3f7fc09e7c | |||
e3494a016f | |||
|
0c0f164744 | ||
3f683ee8df | |||
64a6c15fdf | |||
|
c84ad705da | ||
012f6bc826 | |||
2e8cff1c82 | |||
2392b7d25f | |||
|
62d5cb0418 | ||
b20af1737b | |||
c1660e678f | |||
cd64b45561 | |||
23760ea74e | |||
|
7c17dfc11a | ||
c7c0028ab1 | |||
1cd8ef3768 | |||
|
b28ef34b1d | ||
5a0406e6d5 | |||
a661e12944 | |||
f1bcb63f5d | |||
|
b41d922ca5 | ||
138a116c40 | |||
485990033b | |||
|
99d35233cd | ||
|
5605bcaa55 | ||
240a31e51c | |||
|
3b173cf8aa | ||
8f438102be | |||
279e9751bc | |||
|
861c28d9c0 | ||
a047737d50 | |||
e58a7e887a | |||
027b497cb2 | |||
73e375a805 | |||
|
cbd88f96d8 | ||
b4947a75a7 | |||
ba00b359c8 | |||
7b99f92704 | |||
|
0032661fff | ||
ac6bf17cb2 | |||
bbdcf9505c | |||
a9428904eb |
21
.github/workflows/main.yml
vendored
Normal file
21
.github/workflows/main.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#should deny
|
||||||
|
name: Verify
|
||||||
|
on: [pull_request]
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Prepare repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt install -y unzip jq
|
||||||
|
|
||||||
|
- name: Run verify script
|
||||||
|
run: |
|
||||||
|
cd scripts
|
||||||
|
bash verify.sh
|
||||||
|
if [ $? -eq 1 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,6 @@
|
|||||||
build
|
build
|
||||||
node_modules
|
node_modules
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
|
data/themes/*
|
||||||
|
!data/themes/*.zip
|
||||||
|
@ -15,3 +15,4 @@ This is the repository for the Stack Theme Selector Server. This server is used
|
|||||||
- Extract zip of theme and make any changes
|
- Extract zip of theme and make any changes
|
||||||
- Create new archive
|
- Create new archive
|
||||||
- Update [themes.json](data/themes.json) file
|
- Update [themes.json](data/themes.json) file
|
||||||
|
- Run [verify.sh](scripts/verify.sh) for non comprehensive checks
|
||||||
|
@ -3,64 +3,73 @@
|
|||||||
{
|
{
|
||||||
"name": "Chan",
|
"name": "Chan",
|
||||||
"id": "chan",
|
"id": "chan",
|
||||||
"sha256": "d12829dc7c2d048abd00df552b537b1c2ab56684b38a9cd7490b649d1d412654",
|
"version": 16,
|
||||||
"size": "~68.2 MB",
|
"sha256": "ecf9825c64855608eff62e0ed51a9286958396a500dbdce4d0c9dc6f70b70e05",
|
||||||
|
"size": "~121 MB",
|
||||||
"previewImageUrl": "https://themes.stackwallet.com/previews/chan-theme.png"
|
"previewImageUrl": "https://themes.stackwallet.com/previews/chan-theme.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Dark",
|
"name": "Dark",
|
||||||
"id": "dark",
|
"id": "dark",
|
||||||
"sha256": "fe3494385abce8a828e68c653050e721e36ac4206edd6b65955d36b09005f296",
|
"version": 16,
|
||||||
"size": "~567.3 kB",
|
"sha256": "a84cefe7d7d8041e64575d626fcf8c9a7b5eaf99507d1b6e3be0d22913590cf6",
|
||||||
|
"size": "~1.1 MB",
|
||||||
"previewImageUrl": "https://themes.stackwallet.com/previews/dark-theme.png"
|
"previewImageUrl": "https://themes.stackwallet.com/previews/dark-theme.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Dark Chan",
|
"name": "Dark Chan",
|
||||||
"id": "dark_chan",
|
"id": "dark_chan",
|
||||||
"sha256": "80dc35365d5e938dfa0756e1ab5837a06a4ae8e7cc848e3c12d3cb53dd6e1df1",
|
"version": 16,
|
||||||
"size": "~68.0 MB",
|
"sha256": "36c21443a9bec1f56282ca87f51173d7fad7384ff15e296334d5fd002ef62958",
|
||||||
|
"size": "~121 MB",
|
||||||
"previewImageUrl": "https://themes.stackwallet.com/previews/darkchans-theme.png"
|
"previewImageUrl": "https://themes.stackwallet.com/previews/darkchans-theme.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Forest",
|
"name": "Forest",
|
||||||
"id": "forest",
|
"id": "forest",
|
||||||
"sha256": "e849c8e6176d485d1eab8c1e6b0a188d5d07b4a7f2d10ce67cf3e9346c021bf1",
|
"version": 16,
|
||||||
"size": "~949.2 kB",
|
"sha256": "3d9b9b5322d5c4738e0ae672c7a1dec3277eb7077423b5de918aca45ee7dddd4",
|
||||||
|
"size": "~1 MB",
|
||||||
"previewImageUrl": "https://themes.stackwallet.com/previews/forest-theme.png"
|
"previewImageUrl": "https://themes.stackwallet.com/previews/forest-theme.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Fruit Sorbet",
|
"name": "Fruit Sorbet",
|
||||||
"id": "fruit_sorbet",
|
"id": "fruit_sorbet",
|
||||||
"sha256": "7ed0d5fd2611fb53162787ae1c344a52bd84d97bb243e0483a67f94e200e93d3",
|
"version": 16,
|
||||||
"size": "~720.3 kB",
|
"sha256": "298ab0e1174bd4b9f148cdf3d26108f29c1638619383d2de694c7e07c58a0a15",
|
||||||
|
"size": "~880 kB",
|
||||||
"previewImageUrl": "https://themes.stackwallet.com/previews/fruit-sorbet.png"
|
"previewImageUrl": "https://themes.stackwallet.com/previews/fruit-sorbet.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Light",
|
"name": "Light",
|
||||||
"id": "light",
|
"id": "light",
|
||||||
"sha256": "49362aaf8afd91a3d27ef3ec2ead5cee40ba22737e2c8b74cc6ea33fc9bba750",
|
"version": 16,
|
||||||
"size": "~515.2 kB",
|
"sha256": "d2390788054db5a0bbd0372ca3f2dac0cb7dac447c389a1679f68ce4f0e25286",
|
||||||
|
"size": "~1 MB",
|
||||||
"previewImageUrl": ""
|
"previewImageUrl": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Ocean Breeze",
|
"name": "Ocean Breeze",
|
||||||
"id": "ocean_breeze",
|
"id": "ocean_breeze",
|
||||||
"sha256": "e78897001847b04d7000527b9b8edb10ed57e3acbad40da61f2016a075678ba2",
|
"version": 16,
|
||||||
"size": "~2.9 MB",
|
"sha256": "f65fde0b2ad56c27d0e2612f19a0f38b32df182b314e4307c339158c7b245982",
|
||||||
|
"size": "~3 MB",
|
||||||
"previewImageUrl": "https://themes.stackwallet.com/previews/ocean-breeze.png"
|
"previewImageUrl": "https://themes.stackwallet.com/previews/ocean-breeze.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "OLED Black",
|
"name": "OLED Black",
|
||||||
"id": "oled_black",
|
"id": "oled_black",
|
||||||
"sha256": "b74d299948263237d4ec4c7de7428b1dd34faf40ce30defc33255fdc4ca768b8",
|
"version": 16,
|
||||||
"size": "~576.8 kB",
|
"sha256": "f685975eb6d670a991eb7638aa2c351a8a53839f17768967620df8245d6ec872",
|
||||||
|
"size": "~1.1 MB",
|
||||||
"previewImageUrl": "https://themes.stackwallet.com/previews/orange-dark-theme.png"
|
"previewImageUrl": "https://themes.stackwallet.com/previews/orange-dark-theme.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Orange",
|
"name": "Orange",
|
||||||
"id": "orange",
|
"id": "orange",
|
||||||
"sha256": "bc59b71795e44f4eb199417224bf48ed8dc6ec50c3d55d0a864e2515f8fffa74",
|
"version": 16,
|
||||||
"size": "~171.8 kB",
|
"sha256": "b044c7a5d7f59a805581156b28415b0f39d862f41c11ced4e739d5d012f95ded",
|
||||||
|
"size": "~465 kB",
|
||||||
"previewImageUrl": "https://themes.stackwallet.com/previews/orange-theme.png"
|
"previewImageUrl": "https://themes.stackwallet.com/previews/orange-theme.png"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
67
scripts/verify.sh
Executable file
67
scripts/verify.sh
Executable file
@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function checkVersionAndId {
|
||||||
|
idArg=$1
|
||||||
|
versionArg=$2
|
||||||
|
|
||||||
|
themeId="$(unzip -p "${idArg}.zip" theme.json | jq -r '.id')"
|
||||||
|
if [[ $idArg != "$themeId" ]]; then
|
||||||
|
echo "Theme id for $idArg does NOT match!"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "theme ids match"
|
||||||
|
fi
|
||||||
|
|
||||||
|
themeVersion="$(unzip -p "${idArg}.zip" theme.json | jq -r '.version')"
|
||||||
|
if [[ "$versionArg" != "$themeVersion" ]]; then
|
||||||
|
echo "Versions for $idArg do NOT match!"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "versions match"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zip_dir="../data/themes"
|
||||||
|
|
||||||
|
# Change to the specified zip_dir
|
||||||
|
cd "$zip_dir" || exit 1
|
||||||
|
|
||||||
|
|
||||||
|
json_file="../themes.json"
|
||||||
|
|
||||||
|
# Read the contents of the JSON file
|
||||||
|
json=$(cat "$json_file")
|
||||||
|
|
||||||
|
# Extract the "sha256" and "id" values using jq
|
||||||
|
themes=$(echo "$json" | jq -r '.themes[] | "\(.sha256) \(.id) \(.version)"')
|
||||||
|
|
||||||
|
# Loop through each theme and print the "sha256" and "id" values
|
||||||
|
while read -r sha256 id version; do
|
||||||
|
|
||||||
|
file="${id}.zip"
|
||||||
|
if [[ -f "$file" ]]; then
|
||||||
|
# Calculate the SHA256 hash
|
||||||
|
sha256sum_output=$(sha256sum "$file")
|
||||||
|
sha256_hash=${sha256sum_output%% *}
|
||||||
|
|
||||||
|
# Check if match
|
||||||
|
if [[ "$sha256" == "$sha256_hash" ]]; then
|
||||||
|
echo "Theme $file hash matches hash in themes.json"
|
||||||
|
else
|
||||||
|
echo "Theme $file hash doe NOT match hash in themes.json!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check inside zip file
|
||||||
|
checkVersionAndId "$id" "$version"
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "Theme $file not found!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
done <<< "$themes"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user