4 Commits

Author SHA1 Message Date
zzz
39a7f6d7df 0.20.0-beta3
Some checks failed
Sync Primary Repository to GitHub Mirror / sync (push) Has been cancelled
2025-06-26 07:08:33 -04:00
zzz
808aeec562 fix peer offset in announce replies
Some checks failed
Sync Primary Repository to GitHub Mirror / sync (push) Has been cancelled
spec changed a while back but this code didn't get updated
2025-06-25 13:58:28 -04:00
zzz
9a8ac980d3 bump min i2p version
Some checks failed
Sync Primary Repository to GitHub Mirror / sync (push) Has been cancelled
2025-06-07 09:29:49 -04:00
728c646dac Add github sync for i2p.plugins.zzzot
Some checks failed
Sync Primary Repository to GitHub Mirror / sync (push) Has been cancelled
2025-05-10 18:56:01 -04:00
4 changed files with 71 additions and 5 deletions

66
.github/workflows/sync.yaml vendored Normal file
View File

@ -0,0 +1,66 @@
# GitHub Actions workflow file to sync an external repository to this GitHub mirror.
# This file was automatically generated by go-github-sync.
#
# The workflow does the following:
# - Runs on a scheduled basis (and can also be triggered manually)
# - Clones the GitHub mirror repository
# - Fetches changes from the primary external repository
# - Applies those changes to the mirror repository
# - Pushes the updated content back to the GitHub mirror
#
# Authentication is handled by the GITHUB_TOKEN secret provided by GitHub Actions.
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Validate Github Actions Environment
run: if [ "$GITHUB_ACTIONS" != "true" ]; then echo 'This script must be run in a GitHub Actions environment.'; exit 1; fi
- name: Checkout GitHub Mirror
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |-
git config user.name 'GitHub Actions'
git config user.email 'actions@github.com'
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Sync Primary Repository
run: |-
# Add the primary repository as a remote
git remote add primary https://i2pgit.org/I2P_Developers/i2p.plugins.zzzot.git
# Fetch the latest changes from the primary repository
git fetch primary
# Check if the primary branch exists in the primary repository
if git ls-remote --heads primary master | grep -q master; then
echo "Primary branch master found in primary repository"
else
echo "Error: Primary branch master not found in primary repository"
exit 1
fi
# Check if we're already on the mirror branch
if git rev-parse --verify --quiet master; then
git checkout master
else
# Create the mirror branch if it doesn't exist
git checkout -b master
fi
# Force-apply all changes from primary, overriding any conflicts
echo "Performing force sync from primary/master to master"
git reset --hard primary/master
# Push changes back to the mirror repository
git push origin master
name: Sync Primary Repository to GitHub Mirror
"on":
push: {}
schedule:
- cron: 0 * * * *
workflow_dispatch: {}

View File

@ -11,4 +11,4 @@ updateURL.su3=http://stats.i2p/i2p/plugins/zzzot-update.su3
websiteURL=http://zzz.i2p/forums/16
license=Apache 2.0
min-jetty-version=9
min-i2p-version=2.8.2
min-i2p-version=2.9.0

View File

@ -299,6 +299,7 @@ public class UDPHandler implements I2PSessionMuxedListener {
// ignored
//long ip = DataHelper.fromLong(data, 84, 4);
//long key = DataHelper.fromLong(data, 88, 4);
// Note: BEP 15 spec default is -1 but we read as a positive long
long want = DataHelper.fromLong(data, 92, 4);
if (want > MAX_RESPONSES)
want = MAX_RESPONSES;
@ -357,16 +358,15 @@ public class UDPHandler implements I2PSessionMuxedListener {
}
int count = peerlist != null ? peerlist.size() : 0;
byte[] resp = new byte[22 + (32 * count)];
byte[] resp = new byte[20 + (32 * count)];
resp[3] = (byte) ACTION_ANNOUNCE;
DataHelper.toLong(resp, 4, 4, transID);
DataHelper.toLong(resp, 8, 4, torrents.getInterval());
DataHelper.toLong(resp, 12, 4, size - seeds);
DataHelper.toLong(resp, 16, 4, seeds);
DataHelper.toLong(resp, 20, 2, count);
if (peerlist != null) {
for (int i = 0; i < count; i++) {
System.arraycopy(peerlist.get(i).getHashBytes(), 0, resp, 22 + (i * 32), 32);
System.arraycopy(peerlist.get(i).getHashBytes(), 0, resp, 20 + (i * 32), 32);
}
}

View File

@ -82,7 +82,7 @@ public class ZzzOTController implements ClientApp {
private static final String NAME = "ZzzOT";
private static final String DEFAULT_SITENAME = "ZZZOT";
private static final String PROP_SITENAME = "sitename";
private static final String VERSION = "0.20.0-beta2";
private static final String VERSION = "0.20.0-beta3";
private static final String DEFAULT_SHOWFOOTER = "true";
private static final String PROP_SHOWFOOTER = "showfooter";
private static final String DEFAULT_FOOTERTEXT = "Running <a href=\"http://git.idk.i2p/i2p-hackers/i2p.plugins.zzzot\" target=\"_blank\">ZZZOT</a> " + VERSION;