i2p / i2p.i2p-bote

I2P-Bote is a serverless, encrypted e-mail application.
https://i2pbote.xyz
Other
145 stars 44 forks source link

Build Bote to launch separately from i2p Java router #92

Closed vikanezrimaya closed 7 years ago

vikanezrimaya commented 7 years ago

I use i2pd as my router and I can't afford to launch another router to use Bote, can it be un-tethered from Java router and launched in separate Jetty instance, for example?

Where it all started

str4d commented 7 years ago

This is definitely possible; it just needs build system legwork.

By default, Gradle builds "fat WARs" - the WAR includes all libraries necessary to run it. For an I2P plugin, we don't want that - we include the libraries separately inside the plugin, along with a "thin WAR" that only contains the I2P-Bote code. It is trivial to exclude the libraries from the WAR in the build.config (by putting the dependencies in the providedCompile configuration instead of compile), but I have not yet worked out how to have one Gradle project generate both thin and fat WARs.

Once both types of WARs can be built, all that remains is to bundle it with e.g. Tomcat.

majestrate commented 7 years ago

i managed to make a fat jar in my gradle-fat branch https://github.com/majestrate/i2p.i2p-bote/tree/gradle-fat

majestrate commented 7 years ago

the problem is that it doesn't quite grab everything yet because of some i2p.i2p libs not being added right in the i2p.i2p subproject

majestrate commented 7 years ago

I think it misses i2p.i2p's jetty-i2p.jar at least.

str4d commented 7 years ago

That also generates fat JARs, not fat WARs, so it probably misses the JSP code too. But it's probably on the right track...

str4d commented 7 years ago

I think the full solution will be something along the lines of Gradle's EAR plugin: http://stackoverflow.com/questions/6337148/is-there-a-right-way-to-create-skinny-wars-and-an-ear-file-in-gradle

It sounds similar to what I'm doing already to build I2P plugins, so hopefully the Gradle logic in there will be useful.

vikanezrimaya commented 7 years ago

eeh, this seems kinda complicated for me, can you provide instructions and/or script to do it automagically? because I have literally zero experience with tweaking Gradle.

majestrate commented 7 years ago

@kisik21 it'll be added sooooon™

str4d commented 7 years ago

Done! It's now as simple as ./gradlew :webapp:tomcatRunWar (after copying your I2P-Bote data directory into the webapp folder).