Add plugin zip to CI

This commit is contained in:
eyedeekay
2024-03-05 16:29:58 -05:00
parent aa54248eb8
commit 6ed3aae543
5 changed files with 77 additions and 24 deletions

View File

@ -36,7 +36,7 @@ jobs:
- name: build with Ant - name: build with Ant
run: | run: |
export PATH=$PATH:$(go env GOPATH)/bin export PATH=$PATH:$(go env GOPATH)/bin
ant distclean jpackage debian ant distclean jpackage debian pluginzip
- name: Upload Firefox Profile Strict - name: Upload Firefox Profile Strict
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@ -77,6 +77,11 @@ jobs:
with: with:
name: i2pbrowser_${{ github.sha }}_amd64.deb name: i2pbrowser_${{ github.sha }}_amd64.deb
path: ./i2pbrowser_1.0.0_amd64.deb path: ./i2pbrowser_1.0.0_amd64.deb
- name: Upload i2pfirefox.zip (unsigned plugin)
uses: actions/upload-artifact@v4
with:
name: i2pfirefox-${{ github.sha }}_amd64.zip
path: ./plugin.zip
buildrpm: buildrpm:

View File

@ -340,6 +340,51 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
</exec> </exec>
</target> </target>
<target name="pluginzip" depends="all, buildNum">
<delete>
<!-- in installer but not update -->
<fileset dir="plugin/" includes="i2ptunnel.config i2pfirefox.config eepsite/docroot/index.html eepsite/docroot/robots.txt" />
</delete>
<delete dir="plugin/eepsite/docroot/torrents/" />
<!-- get version number -->
<!-- make the update xpi2p -->
<!-- this contains everything except i2ptunnel.config -->
<copy file="LICENSE.md" todir="plugin/" overwrite="true" />
<copy file="README.md" todir="plugin/" overwrite="true" />
<copy file="CHANGES.md" todir="plugin/" overwrite="true" />
<copy file="scripts/plugin.config" todir="plugin/" overwrite="true" />
<mkdir dir="plugin/lib/" />
<copy file="src/build/i2pfirefox.jar" todir="plugin/lib/" overwrite="true" />
<copy file="src/build/i2pfirefox-plugin.jar" todir="plugin/lib/" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="update-only=true" />
</exec>
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${release.number}-${build.number}" />
</exec>
<input message="Enter su3 signing key password:" addproperty="release.password.su3" />
<fail message="You must enter a password." >
<condition>
<equals arg1="${release.password.su3}" arg2=""/>
</condition>
</fail>
<!-- make the install xpi2p -->
<copy file="scripts/plugin.config" todir="plugin/" overwrite="true" />
<!-- Files in installer but not update. Be sure to Add to delete fileset above and clean target below -->
<copy file="scripts/i2ptunnel.config" todir="plugin/" overwrite="true" />
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${release.number}-${build.number}" />
</exec>
<exec executable="zip">
<arg value="-r"/>
<arg value="plugin.zip"/>
<arg value="plugin"/>
</exec>
</target>
<target name="plugin" depends="all, buildNum"> <target name="plugin" depends="all, buildNum">
<delete> <delete>
<!-- in installer but not update --> <!-- in installer but not update -->
@ -370,12 +415,6 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<equals arg1="${release.password.su3}" arg2=""/> <equals arg1="${release.password.su3}" arg2=""/>
</condition> </condition>
</fail> </fail>
<!-- this will fail if no su3 keys exist, as it needs the password twice -->
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" />
</exec>
<move file="i2pfirefox.xpi2p" tofile="i2pfirefox-update.xpi2p" overwrite="true" />
<move file="i2pfirefox.su3" tofile="i2pfirefox-update.su3" overwrite="true" />
<!-- make the install xpi2p --> <!-- make the install xpi2p -->
<copy file="scripts/plugin.config" todir="plugin/" overwrite="true" /> <copy file="scripts/plugin.config" todir="plugin/" overwrite="true" />
@ -384,6 +423,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true"> <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
<arg value="version=${release.number}-${build.number}" /> <arg value="version=${release.number}-${build.number}" />
</exec> </exec>
<exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" > <exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
<arg value="plugin" /> <arg value="plugin" />
</exec> </exec>

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Mon Mar 04 20:11:29 EST 2024 #Tue Mar 05 16:05:51 EST 2024
build.number=640 build.number=649

View File

@ -55,27 +55,30 @@ public class I2PBrowser extends I2PGenericUnsafeBrowser {
private boolean outputConfig = false; private boolean outputConfig = false;
private boolean useSystray = true; private boolean useSystray = true;
private void launchFirefox(int privateWindow, String[] url) { public void launchFirefox(int privateWindow, String[] url) {
logger.info("I2PFirefox" + privateWindow); String priv = privateWindow == 1 ? "private-window" : "long-profile";
logger.info("I2PFirefox" + priv);
i2pFirefox.usability = usability; i2pFirefox.usability = usability;
if (outputConfig) if (outputConfig)
i2pFirefox.storeFirefoxDefaults(); i2pFirefox.storeFirefoxDefaults();
i2pFirefox.launch(privateWindow, url); i2pFirefox.launch(privateWindow, url);
} }
private void launchChromium(int privateWindow, String[] url) { public void launchChromium(int privateWindow, String[] url) {
logger.info("I2PChromium" + privateWindow); String priv = privateWindow == 1 ? "private-window" : "long-profile";
logger.info("I2PChromium" + priv);
i2pChromium.usability = usability; i2pChromium.usability = usability;
if (outputConfig) if (outputConfig)
i2pChromium.storeChromiumDefaults(); i2pChromium.storeChromiumDefaults();
i2pChromium.launch(privateWindow, url); i2pChromium.launch(privateWindow, url);
} }
private void launchGeneric(int privateWindowInt, String[] url) { private void launchGeneric(int privateWindowInt, String[] url) {
String priv = privateWindowInt == 1 ? "private-window" : "long-profile";
boolean privateWindow = false; boolean privateWindow = false;
if (privateWindowInt == 1) if (privateWindowInt == 1)
privateWindow = true; privateWindow = true;
if (outputConfig) if (outputConfig)
i2pGeneral.storeGenericDefaults(); i2pGeneral.storeGenericDefaults();
logger.info("I2PGeneric" + privateWindowInt); logger.info("I2PGeneric" + priv);
i2pGeneral.launch(privateWindow, url); i2pGeneral.launch(privateWindow, url);
} }

View File

@ -52,6 +52,9 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
pluginDir = new File(_context.getAppDir(), "plugins/i2pfirefox/"); pluginDir = new File(_context.getAppDir(), "plugins/i2pfirefox/");
profileDir = new File(pluginDir, "profile/"); profileDir = new File(pluginDir, "profile/");
i2pBrowser = new I2PBrowser(profileDir.getAbsolutePath()); i2pBrowser = new I2PBrowser(profileDir.getAbsolutePath());
i2pBrowser.firefox = true;
i2pBrowser.chromiumFirst = false;
i2pBrowser.generic = false;
} }
public I2PBrowserPlugin(I2PAppContext ctx, ClientAppManager mgr, public I2PBrowserPlugin(I2PAppContext ctx, ClientAppManager mgr,
String args[]) { String args[]) {
@ -62,6 +65,9 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
pluginDir = new File(_context.getAppDir(), "plugins/i2pfirefox/"); pluginDir = new File(_context.getAppDir(), "plugins/i2pfirefox/");
profileDir = new File(pluginDir, "profile/"); profileDir = new File(pluginDir, "profile/");
i2pBrowser = new I2PBrowser(profileDir.getAbsolutePath()); i2pBrowser = new I2PBrowser(profileDir.getAbsolutePath());
i2pBrowser.firefox = true;
i2pBrowser.chromiumFirst = false;
i2pBrowser.generic = false;
} }
public String getDisplayName() { return "I2P Browser"; } public String getDisplayName() { return "I2P Browser"; }
public String getName() { return "I2P Browser"; } public String getName() { return "I2P Browser"; }
@ -69,7 +75,6 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
if (i2pBrowser == null) if (i2pBrowser == null)
return ClientAppState.STOPPED; return ClientAppState.STOPPED;
if (!isSystrayEnabled()) if (!isSystrayEnabled())
return ClientAppState.STOPPED;
if (!i2pBrowser.running()) if (!i2pBrowser.running())
return ClientAppState.STOPPED; return ClientAppState.STOPPED;
if (i2pBrowser.running()) if (i2pBrowser.running())
@ -78,7 +83,7 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
} }
public void shutdown(String[] args) { public void shutdown(String[] args) {
if (!isSystrayEnabled()) { if (!isSystrayEnabled()) {
System.out.println("I2P Browser tray manager not supported"); i2pBrowser.logger.info("I2P Browser tray manager not supported");
i2pBrowser.stop(); i2pBrowser.stop();
changeState(ClientAppState.STOPPED); changeState(ClientAppState.STOPPED);
return; return;
@ -86,10 +91,10 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
} }
public void startup() { public void startup() {
if (!isSystrayEnabled()) { if (!isSystrayEnabled()) {
System.out.println("I2P Browser tray manager not supported"); i2pBrowser.logger.info("I2P Browser tray manager not supported");
try { try {
String url = "http://proxy.i2p"; String url = "http://proxy.i2p";
i2pBrowser.launch(false, new String[] {url}); i2pBrowser.launchFirefox(0, new String[] {url});
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -97,14 +102,14 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
} }
try { try {
String url = "http://proxy.i2p"; String url = "http://proxy.i2p";
System.out.println( i2pBrowser.logger.info(
"Starting I2P Browser tray manager by testing http://proxy.i2p"); "Starting I2P Browser tray manager by testing http://proxy.i2p");
MenuService dtg = startTrayApp(); MenuService dtg = startTrayApp();
try { try {
Thread.sleep(1000); Thread.sleep(1000);
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
} }
i2pBrowser.launch(false, new String[] {url}); i2pBrowser.launchFirefox(0, new String[] {url});
if (dtg != null) { if (dtg != null) {
dtg.addMenu("Launch I2P Browser", new Starter(dtg)); dtg.addMenu("Launch I2P Browser", new Starter(dtg));
dtg.addMenu("Quit I2P Browser", new Stopper(dtg)); dtg.addMenu("Quit I2P Browser", new Stopper(dtg));
@ -131,7 +136,7 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
} }
// Copied directly from I2PSnark-standalone where it is used to determine // Copied directly from I2PSnark-standalone where it is used to determine
// whether to launch the tray app Our environment should basically never be // whether to launchFirefox the tray app Our environment should basically never be
// headless, that doesn't make any sense, but something tells me I should // headless, that doesn't make any sense, but something tells me I should
// leave that check in. // leave that check in.
private boolean isSystrayEnabled() { private boolean isSystrayEnabled() {
@ -171,7 +176,7 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
*/ */
public class StarterThread implements Runnable { public class StarterThread implements Runnable {
public void run() { public void run() {
i2pBrowser.launch(false); i2pBrowser.launchFirefox(0, null);
changeState(ClientAppState.RUNNING); changeState(ClientAppState.RUNNING);
} }
} }