diff --git a/build.xml b/build.xml index de7ea40..a7ac3b3 100644 --- a/build.xml +++ b/build.xml @@ -76,10 +76,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugin/clients.config b/plugin/clients.config new file mode 100644 index 0000000..704a779 --- /dev/null +++ b/plugin/clients.config @@ -0,0 +1,7 @@ +# +# syndie has a lot of System.exit() calls, so +# until these are patched, just run in a separate JVM +# +clientApp.0.main=net.i2p.util.ShellCommand +clientApp.0.args=java -Duser.home=$PLUGIN -cp $I2P/lib/i2p.jar:$PLUGIN/lib/hsqldb.jar:$PLUGIN/lib/swt.jar:$PLUGIN/lib/syndie.jar syndie.gui.SWTUI +clientApp.0.delay=20 diff --git a/scripts/makeplugin.sh b/scripts/makeplugin.sh new file mode 100755 index 0000000..b2c046b --- /dev/null +++ b/scripts/makeplugin.sh @@ -0,0 +1,105 @@ +#!/bin/sh +# +# basic packaging up of a plugin +# +# usage: makeplugin.sh plugindir +# +# zzz 2010-02 +# +PUBKEYDIR=$HOME/.i2p-plugin-keys +PUBKEYFILE=$PUBKEYDIR/plugin-public-signing.key +PRIVKEYFILE=$PUBKEYDIR/plugin-private-signing.key +B64KEYFILE=$PUBKEYDIR/plugin-public-signing.txt +export I2P=../i2p/pkg-temp + +# put your files in here +PLUGINDIR=${1:-plugin} + +PC=plugin.config +PCT=${PC}.tmp + +if [ ! -f $PRIVKEYFILE ] +then + mkdir -p $PUBKEYDIR + java -cp $I2P/lib/i2p.jar net.i2p.crypto.TrustedUpdate keygen $PUBKEYFILE $PRIVKEYFILE + java -cp $I2P/lib/i2p.jar net.i2p.data.Base64 encode $PUBKEYFILE $B64KEYFILE + rm -rf logs/ + chmod 444 $PUBKEYFILE $B64KEYFILE + chmod 400 $PRIVKEYFILE + echo "Created new keys: $PUBKEYFILE $PRIVKEYFILE" +fi + +rm -f plugin.zip +if [ ! -d $PLUGINDIR ] +then + echo "You must have a $PLUGINDIR directory" + exit 1 +fi + +OPWD=$PWD +cd $PLUGINDIR + +if [ ! -f $PC ] +then + echo "You must have a $PC file" + exit 1 +fi + +grep -q '^signer=' $PC +if [ "$?" -ne "0" ] +then + echo "You must have a signer in $PC" + echo 'For example signer=joe@mail.i2p' + exit 1 +fi + +grep -q '^name=' $PC +if [ "$?" -ne "0" ] +then + echo "You must have a plugin name in $PC" + echo 'For example name=foo' + exit 1 +fi + +grep -q '^version=' $PC +if [ "$?" -ne "0" ] +then + echo "You must have a version in $PC" + echo 'For example version=0.1.2' + exit 1 +fi + +# update the date +grep -v '^date=' $PC > $PCT +DATE=`date '+%s000'` +echo "date=$DATE" >> $PCT +mv $PCT $PC + +# add our Base64 key +grep -v '^key=' $PC > $PCT +B64KEY=`cat $B64KEYFILE` +echo "key=$B64KEY" >> $PCT +mv $PCT $PC + +# zip it +zip -r $OPWD/plugin.zip * + +# get the version and use it for the sud header +VERSION=`grep '^version=' $PC | cut -f 2 -d '='` +# get the name and use it for the file name +NAME=`grep '^name=' $PC | cut -f 2 -d '='` +XPI2P=${NAME}.xpi2p +cd $OPWD + +# sign it +java -cp $I2P/lib/i2p.jar net.i2p.crypto.TrustedUpdate sign plugin.zip $XPI2P $PRIVKEYFILE $VERSION +rm -f plugin.zip + +# verify +echo 'Verifying. ...' +java -cp $I2P/lib/i2p.jar net.i2p.crypto.TrustedUpdate showversion $XPI2P +java -cp $I2P/lib/i2p.jar -Drouter.trustedUpdateKeys=$B64KEY net.i2p.crypto.TrustedUpdate verifysig $XPI2P +rm -rf logs/ + +echo -n 'Plugin created: ' +wc -c $XPI2P diff --git a/scripts/plugin.config b/scripts/plugin.config new file mode 100644 index 0000000..1eec880 --- /dev/null +++ b/scripts/plugin.config @@ -0,0 +1,8 @@ +name=syndie +signer=zzz-plugin@mail.i2p +updateURL=http://stats.i2p/i2p/plugins/syndie-update.xpi2p +description=Distributed messaging +author=jrandom (packaged by zzz) +license=Public Domain +websiteURL=http://syndie.i2p2.de/ +disableStop=true diff --git a/src/syndie/Version.java b/src/syndie/Version.java index 5799e1d..691ab8b 100644 --- a/src/syndie/Version.java +++ b/src/syndie/Version.java @@ -1,4 +1,4 @@ package syndie; public class Version { - public static final String VERSION = "1.101b-6"; + public static final String VERSION = "1.101b-7"; }