Compare commits

..

1 Commits

199 changed files with 1763 additions and 1895 deletions

6
.gitignore vendored
View File

@@ -54,10 +54,4 @@ sloccount.sc
.settings/
# IDEA
*.iml
.idea
# Gradle
.gradle
# TODO: why does this file appear?
apps/routerconsole/jsp/favicon.ico

View File

@@ -1,24 +0,0 @@
image: openjdk:8-alpine
stages:
- test
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- .gradle
test:
stage: test
coverage: '/Total.*?([0-9]{1,3})%/'
before_script:
- apk add --no-cache grep
script:
- ./gradlew codeCoverageReport
# The actual output that will be parsed by the code coverage
- grep -oP "Total.*?%" build/reports/jacoco/html/index.html
only:
- merge_requests
- tags

6
.idea/ant.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/build.xml" />
</component>
</project>

41
.idea/compiler.xml generated Normal file
View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="addressbook_main" target="1.7" />
<module name="addressbook_test" target="1.7" />
<module name="BOB_main" target="1.7" />
<module name="BOB_test" target="1.7" />
<module name="core_main" target="1.7" />
<module name="core_test" target="1.7" />
<module name="desktopgui_main" target="1.7" />
<module name="desktopgui_test" target="1.7" />
<module name="i2psnark_main" target="1.7" />
<module name="i2psnark_test" target="1.7" />
<module name="i2ptunnel_main" target="1.7" />
<module name="i2ptunnel_test" target="1.7" />
<module name="installer_main" target="1.7" />
<module name="installer_test" target="1.7" />
<module name="jetty_main" target="1.7" />
<module name="jetty_test" target="1.7" />
<module name="jrobin_main" target="1.7" />
<module name="jrobin_test" target="1.7" />
<module name="ministreaming_main" target="1.7" />
<module name="ministreaming_test" target="1.7" />
<module name="router_main" target="1.7" />
<module name="router_test" target="1.7" />
<module name="routerconsole_main" target="1.7" />
<module name="routerconsole_test" target="1.7" />
<module name="sam_main" target="1.7" />
<module name="sam_test" target="1.7" />
<module name="streaming_main" target="1.7" />
<module name="streaming_test" target="1.7" />
<module name="susidns_main" target="1.7" />
<module name="susidns_test" target="1.7" />
<module name="susimail_main" target="1.7" />
<module name="susimail_test" target="1.7" />
<module name="systray_main" target="1.7" />
<module name="systray_test" target="1.7" />
</bytecodeTargetLevel>
</component>
</project>

3
.idea/copyright/profiles_settings.xml generated Normal file
View File

@@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="javax.servlet.jsp-2.2.0.v201112011158">
<CLASSES>
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

22
.idea/libraries/jettylib.xml generated Normal file
View File

@@ -0,0 +1,22 @@
<component name="libraryTable">
<library name="jettylib">
<CLASSES>
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-security-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-servlets-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-deploy-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-util-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-servlet-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-http-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-xml-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-server-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/servlet-api-3.0.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-jmx-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-webapp-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-io-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-continuation-8.1.17.v20150415.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/lib/jetty-rewrite-8.1.17.v20150415.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

9
.idea/libraries/jrobin_1_5_9_1.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="jrobin-1.5.9.1">
<CLASSES>
<root url="jar://$PROJECT_DIR$/apps/jrobin/jrobin-1.5.9.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

10
.idea/libraries/lib.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="lib">
<CLASSES>
<root url="jar://$PROJECT_DIR$/apps/susidns/src/lib/jstl.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/susidns/src/lib/standard.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

9
.idea/libraries/start.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="start">
<CLASSES>
<root url="jar://$PROJECT_DIR$/apps/jetty/jetty-distribution-8.1.17.v20150415/start.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

9
.idea/libraries/systray4j.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="systray4j">
<CLASSES>
<root url="jar://$PROJECT_DIR$/apps/systray/java/lib/systray4j.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

9
.idea/libraries/tomcat_coyote_util.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="tomcat-coyote-util">
<CLASSES>
<root url="jar://$PROJECT_DIR$/apps/jetty/apache-tomcat/lib/tomcat-coyote-util.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

12
.idea/libraries/tomcat_lib.xml generated Normal file
View File

@@ -0,0 +1,12 @@
<component name="libraryTable">
<library name="tomcat-lib">
<CLASSES>
<root url="jar://$PROJECT_DIR$/apps/jetty/apache-tomcat-deployer/lib/tomcat-juli.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/apache-tomcat-deployer/lib/el-api.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/apache-tomcat-deployer/lib/jasper.jar!/" />
<root url="jar://$PROJECT_DIR$/apps/jetty/apache-tomcat-deployer/lib/jasper-el.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

9
.idea/libraries/wrapper.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="wrapper">
<CLASSES>
<root url="jar://$PROJECT_DIR$/installer/lib/wrapper/all/wrapper.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

9
.idea/libraries/wrapper_win.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="wrapper-win">
<CLASSES>
<root url="jar://$PROJECT_DIR$/installer/lib/wrapper/win-all/wrapper.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

57
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ClientPropertiesManager">
<properties class="javax.swing.AbstractButton">
<property name="hideActionText" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JComponent">
<property name="html.disable" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JEditorPane">
<property name="JEditorPane.w3cLengthUnits" class="java.lang.Boolean" />
<property name="JEditorPane.honorDisplayProperties" class="java.lang.Boolean" />
<property name="charset" class="java.lang.String" />
</properties>
<properties class="javax.swing.JList">
<property name="List.isFileList" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JPasswordField">
<property name="JPasswordField.cutCopyAllowed" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JSlider">
<property name="Slider.paintThumbArrowShape" class="java.lang.Boolean" />
<property name="JSlider.isFilled" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JTable">
<property name="Table.isFileList" class="java.lang.Boolean" />
<property name="JTable.autoStartsEdit" class="java.lang.Boolean" />
<property name="terminateEditOnFocusLost" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JToolBar">
<property name="JToolBar.isRollover" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JTree">
<property name="JTree.lineStyle" class="java.lang.String" />
</properties>
<properties class="javax.swing.text.JTextComponent">
<property name="caretAspectRatio" class="java.lang.Double" />
<property name="caretWidth" class="java.lang.Integer" />
</properties>
</component>
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build" />
</component>
</project>

80
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/BOB/BOB.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/BOB/BOB.iml" group="apps/BOB" />
<module fileurl="file://$PROJECT_DIR$/apps/BOB/BOB.iml" filepath="$PROJECT_DIR$/apps/BOB/BOB.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/BOB/BOB_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/BOB/BOB_main.iml" group="apps/BOB" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/BOB/BOB_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/BOB/BOB_test.iml" group="apps/BOB" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/addressbook/addressbook.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/addressbook/addressbook.iml" group="apps/addressbook" />
<module fileurl="file://$PROJECT_DIR$/apps/addressbook/addressbook.iml" filepath="$PROJECT_DIR$/apps/addressbook/addressbook.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/addressbook/addressbook_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/addressbook/addressbook_main.iml" group="apps/addressbook" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/addressbook/addressbook_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/addressbook/addressbook_test.iml" group="apps/addressbook" />
<module fileurl="file://$PROJECT_DIR$/apps/admin/admin.iml" filepath="$PROJECT_DIR$/apps/admin/admin.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/apps.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/apps.iml" group="apps" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/core/core.iml" filepath="$PROJECT_DIR$/.idea/modules/core/core.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/core/core.iml" filepath="$PROJECT_DIR$/core/core.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/core/core_main.iml" filepath="$PROJECT_DIR$/.idea/modules/core/core_main.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/core/core_test.iml" filepath="$PROJECT_DIR$/.idea/modules/core/core_test.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/desktopgui/desktopgui.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/desktopgui/desktopgui.iml" group="apps/desktopgui" />
<module fileurl="file://$PROJECT_DIR$/apps/desktopgui/desktopgui.iml" filepath="$PROJECT_DIR$/apps/desktopgui/desktopgui.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/desktopgui/desktopgui_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/desktopgui/desktopgui_main.iml" group="apps/desktopgui" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/desktopgui/desktopgui_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/desktopgui/desktopgui_test.iml" group="apps/desktopgui" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/i2p.i2p.sl.iml" filepath="$PROJECT_DIR$/.idea/modules/i2p.i2p.sl.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/i2psnark/i2psnark.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/i2psnark/i2psnark.iml" group="apps/i2psnark" />
<module fileurl="file://$PROJECT_DIR$/apps/i2psnark/i2psnark.iml" filepath="$PROJECT_DIR$/apps/i2psnark/i2psnark.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/i2psnark/i2psnark_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/i2psnark/i2psnark_main.iml" group="apps/i2psnark" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/i2psnark/i2psnark_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/i2psnark/i2psnark_test.iml" group="apps/i2psnark" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/i2ptunnel/i2ptunnel.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/i2ptunnel/i2ptunnel.iml" group="apps/i2ptunnel" />
<module fileurl="file://$PROJECT_DIR$/apps/i2ptunnel/i2ptunnel.iml" filepath="$PROJECT_DIR$/apps/i2ptunnel/i2ptunnel.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/i2ptunnel/i2ptunnel_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/i2ptunnel/i2ptunnel_main.iml" group="apps/i2ptunnel" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/i2ptunnel/i2ptunnel_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/i2ptunnel/i2ptunnel_test.iml" group="apps/i2ptunnel" />
<module fileurl="file://$PROJECT_DIR$/apps/imagegen/identicon/identicon.iml" filepath="$PROJECT_DIR$/apps/imagegen/identicon/identicon.iml" />
<module fileurl="file://$PROJECT_DIR$/apps/imagegen/imagegen/imagegen.iml" filepath="$PROJECT_DIR$/apps/imagegen/imagegen/imagegen.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/installer/installer.iml" filepath="$PROJECT_DIR$/.idea/modules/installer/installer.iml" group="installer" />
<module fileurl="file://$PROJECT_DIR$/installer/installer.iml" filepath="$PROJECT_DIR$/installer/installer.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/installer/installer_main.iml" filepath="$PROJECT_DIR$/.idea/modules/installer/installer_main.iml" group="installer" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/installer/installer_test.iml" filepath="$PROJECT_DIR$/.idea/modules/installer/installer_test.iml" group="installer" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/jetty/jetty.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/jetty/jetty.iml" group="apps/jetty" />
<module fileurl="file://$PROJECT_DIR$/apps/jetty/jetty.iml" filepath="$PROJECT_DIR$/apps/jetty/jetty.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/jetty/jetty_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/jetty/jetty_main.iml" group="apps/jetty" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/jetty/jetty_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/jetty/jetty_test.iml" group="apps/jetty" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/jrobin/jrobin.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/jrobin/jrobin.iml" group="apps/jrobin" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/jrobin/jrobin_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/jrobin/jrobin_main.iml" group="apps/jrobin" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/jrobin/jrobin_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/jrobin/jrobin_test.iml" group="apps/jrobin" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/ministreaming/ministreaming.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/ministreaming/ministreaming.iml" group="apps/ministreaming" />
<module fileurl="file://$PROJECT_DIR$/apps/ministreaming/ministreaming.iml" filepath="$PROJECT_DIR$/apps/ministreaming/ministreaming.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/ministreaming/ministreaming_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/ministreaming/ministreaming_main.iml" group="apps/ministreaming" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/ministreaming/ministreaming_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/ministreaming/ministreaming_test.iml" group="apps/ministreaming" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/router/router.iml" filepath="$PROJECT_DIR$/.idea/modules/router/router.iml" group="router" />
<module fileurl="file://$PROJECT_DIR$/router/router.iml" filepath="$PROJECT_DIR$/router/router.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/router/router_main.iml" filepath="$PROJECT_DIR$/.idea/modules/router/router_main.iml" group="router" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/router/router_test.iml" filepath="$PROJECT_DIR$/.idea/modules/router/router_test.iml" group="router" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/routerconsole/routerconsole.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/routerconsole/routerconsole.iml" group="apps/routerconsole" />
<module fileurl="file://$PROJECT_DIR$/apps/routerconsole/routerconsole.iml" filepath="$PROJECT_DIR$/apps/routerconsole/routerconsole.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/routerconsole/routerconsole_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/routerconsole/routerconsole_main.iml" group="apps/routerconsole" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/routerconsole/routerconsole_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/routerconsole/routerconsole_test.iml" group="apps/routerconsole" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/sam/sam.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/sam/sam.iml" group="apps/sam" />
<module fileurl="file://$PROJECT_DIR$/apps/sam/sam.iml" filepath="$PROJECT_DIR$/apps/sam/sam.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/sam/sam_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/sam/sam_main.iml" group="apps/sam" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/sam/sam_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/sam/sam_test.iml" group="apps/sam" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/streaming/streaming.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/streaming/streaming.iml" group="apps/streaming" />
<module fileurl="file://$PROJECT_DIR$/apps/streaming/streaming.iml" filepath="$PROJECT_DIR$/apps/streaming/streaming.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/streaming/streaming_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/streaming/streaming_main.iml" group="apps/streaming" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/streaming/streaming_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/streaming/streaming_test.iml" group="apps/streaming" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/susidns/susidns.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/susidns/susidns.iml" group="apps/susidns" />
<module fileurl="file://$PROJECT_DIR$/apps/susidns/susidns.iml" filepath="$PROJECT_DIR$/apps/susidns/susidns.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/susidns/susidns_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/susidns/susidns_main.iml" group="apps/susidns" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/susidns/susidns_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/susidns/susidns_test.iml" group="apps/susidns" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/susimail/susimail.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/susimail/susimail.iml" group="apps/susimail" />
<module fileurl="file://$PROJECT_DIR$/apps/susimail/susimail.iml" filepath="$PROJECT_DIR$/apps/susimail/susimail.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/susimail/susimail_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/susimail/susimail_main.iml" group="apps/susimail" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/susimail/susimail_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/susimail/susimail_test.iml" group="apps/susimail" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/systray/systray.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/systray/systray.iml" group="apps/systray" />
<module fileurl="file://$PROJECT_DIR$/apps/systray/systray.iml" filepath="$PROJECT_DIR$/apps/systray/systray.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/systray/systray_main.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/systray/systray_main.iml" group="apps/systray" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/apps/systray/systray_test.iml" filepath="$PROJECT_DIR$/.idea/modules/apps/systray/systray_test.iml" group="apps/systray" />
<module fileurl="file://$PROJECT_DIR$/apps/imagegen/zxing/zxing.iml" filepath="$PROJECT_DIR$/apps/imagegen/zxing/zxing.iml" />
</modules>
</component>
</project>

6
.idea/runConfigurations/updater.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="updater" type="AntRunConfiguration" factoryName="Ant Target">
<antsettings antfile="file://$PROJECT_DIR$/build.xml" target="updater" />
<method />
</configuration>
</component>

View File

@@ -1,17 +1,17 @@
language: java
dist: bionic
dist: xenial
jdk:
- oraclejdk11
matrix:
include:
- jdk: oraclejdk11
- jdk: oraclejdk8
addons:
sonarcloud:
organization: "i2p"
before_install:
- sed -i "1iplugins {\n id 'org.sonarqube' version '3.0'\n}\n" build.gradle
- sed -i "1iplugins {\n id 'org.sonarqube' version '2.6.1'\n}\n" build.gradle
- jdk: openjdk8
before_cache:
@@ -24,11 +24,13 @@ cache:
- $HOME/.sonar/cache/
- .gradle
env:
- SONAR_SCANNER_OPTS="-Xmx2048m"
script:
- travis_wait 45 ./tests/scripts/travis.sh
- |
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ]; then
./gradlew sonarqube codeCoverageReport
else
./gradlew check codeCoverageReport
fi
after_success:
- bash <(curl -s https://codecov.io/bash)

View File

@@ -619,21 +619,21 @@ trans.tr_TR = installer/resources/eepsite/docroot/help/index_tr.html
;; Text on /console
;;
type = HTML
source_file = apps/routerconsole/resources/docs/readme.html
source_file = installer/resources/readme/readme.html
source_lang = en
trans.ar = apps/routerconsole/resources/docs/readme_ar.html
trans.de = apps/routerconsole/resources/docs/readme_de.html
trans.fr = apps/routerconsole/resources/docs/readme_fr.html
trans.ar = installer/resources/readme/readme_ar.html
trans.de = installer/resources/readme/readme_de.html
trans.fr = installer/resources/readme/readme_fr.html
;; Java converts id to in
trans.id = apps/routerconsole/resources/docs/readme_in.html
trans.it = apps/routerconsole/resources/docs/readme_it.html
trans.ja = apps/routerconsole/resources/docs/readme_ja.html
trans.pl = apps/routerconsole/resources/docs/readme_pl.html
trans.pt = apps/routerconsole/resources/docs/readme_pt.html
trans.ro = apps/routerconsole/resources/docs/readme_ro.html
trans.ru_RU = apps/routerconsole/resources/docs/readme_ru.html
trans.tr_TR = apps/routerconsole/resources/docs/readme_tr.html
trans.zh_CN = apps/routerconsole/resources/docs/readme_zh.html
trans.id = installer/resources/readme/readme_in.html
trans.it = installer/resources/readme/readme_it.html
trans.ja = installer/resources/readme/readme_ja.html
trans.pl = installer/resources/readme/readme_pl.html
trans.pt = installer/resources/readme/readme_pt.html
trans.ro = installer/resources/readme/readme_ro.html
trans.ru_RU = installer/resources/readme/readme_ru.html
trans.tr_TR = installer/resources/readme/readme_tr.html
trans.zh_CN = installer/resources/readme/readme_zh.html
[main]
host = https://www.transifex.com

View File

@@ -2,7 +2,6 @@ sourceSets {
main {
java {
srcDir 'src'
srcDir 'build/messages-src'
}
}
}
@@ -13,14 +12,3 @@ dependencies {
compile project(':installer')
compile project(':apps:systray')
}
// Create the java files from the po files. The jar task will compile them.
// This requires gettext 0.19 or higher.
// We don't support the "slow way"
task bundle {
doLast {
if (!(new File("$buildDir/classes/java/main/net/i2p/desktopgui/messages_de.class")).exists())
println "apps/desktopgui/bundle-messages.sh".execute().text
}
}
jar.dependsOn bundle

View File

@@ -86,8 +86,6 @@
<jar basedir="${build}" excludes="messages-src/**" destfile="${dist}/${jar}">
<manifest>
<attribute name="Main-Class" value="net.i2p.desktopgui.Main"/>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />

1
apps/desktopgui/bundle-messages.sh Executable file → Normal file
View File

@@ -11,7 +11,6 @@
# zzz - public domain
# Mathiasdm - modifications for desktopgui
#
cd `dirname $0`
CLASS=net.i2p.desktopgui.messages
TMPFILE=build/javafiles.txt
export TZ=UTC

View File

@@ -6,7 +6,6 @@ sourceSets {
main {
java {
srcDir 'java/src'
srcDir 'java/build/messages-src'
}
}
}
@@ -35,30 +34,13 @@ artifacts {
archives i2psnarkJar
}
// Create the java files from the po files. The jar task will compile them.
// This requires gettext 0.19 or higher.
// We don't support the "slow way"
task bundle {
doLast {
if (!(new File("$buildDir/classes/java/main/org/klomp/snark/web/messages_de.class")).exists())
println "apps/i2psnark/java/bundle-messages.sh".execute().text
}
}
war.dependsOn bundle
war {
rootSpec.exclude('/org/klomp/snark/*.class')
rootSpec.exclude('/org/klomp/snark/bencode/**')
rootSpec.exclude('/org/klomp/snark/comments/**')
rootSpec.exclude('/org/klomp/snark/dht/**')
rootSpec.exclude('/org/klomp/snark/standalone/**')
from ('resources', {
into ".resources"
})
into '.icons', {
from 'icons'
}
webInf {
into 'classes/org/klomp/snark/web'
from 'mime.properties'
}
webXml = file('web.xml')
// TODO why is this in there? WEB-INF/lib/systray.jar
}

View File

@@ -10,7 +10,6 @@
#
# zzz - public domain
#
cd `dirname $0`
CLASS=org.klomp.snark.web.messages
TMPFILE=build/javafiles.txt
export TZ=UTC

View File

@@ -6,8 +6,6 @@ sourceSets {
main {
java {
srcDir 'java/src'
srcDir 'java/build/messages-src'
srcDir 'java/build/messages-proxy-src'
}
}
test {
@@ -24,26 +22,8 @@ dependencies {
providedCompile project(':apps:jetty')
}
// Create the java files from the po files. The jar task will compile them.
// This requires gettext 0.19 or higher.
// We don't support the "slow way"
task bundleProxy {
doLast {
if (!(new File("$buildDir/classes/java/main/net/i2p/i2ptunnel/proxy/messages_de.class")).exists())
println "apps/i2ptunnel/java/bundle-messages-proxy.sh".execute().text
}
}
task bundle {
doLast {
if (!(new File("$buildDir/classes/java/main/net/i2p/i2ptunnel/web/messages_de.class")).exists())
println "apps/i2ptunnel/java/bundle-messages.sh".execute().text
}
}
task i2ptunnelJar(type: Jar) {
from sourceSets.main.output
exclude '**/web/*.class'
exclude '**/ui/*.class'
exclude '**/EditBean.class'
exclude '**/IndexBean.class'
@@ -51,21 +31,8 @@ task i2ptunnelJar(type: Jar) {
attributes 'Main-Class': 'net.i2p.i2ptunnel.I2PTunnel'
attributes 'Class-Path': 'i2p.jar mstreaming.jar'
}
from ('resources', {
into "net/i2p/i2ptunnel/resources"
})
from ('../routerconsole/jsp', {
include 'themes/console/*/*.css'
include 'themes/console/images/i2plogo.png'
include 'themes/console/images/favicon.ico'
include 'themes/console/images/itoopie_sm.png'
into "net/i2p/i2ptunnel/resources"
})
}
i2ptunnelJar.dependsOn bundleProxy
war.dependsOn bundle
// not needed unless we're building for both android and regular
task tempBeansJar(type: Jar) {
from sourceSets.main.output
include '**/EditBean.class'
@@ -74,7 +41,6 @@ task tempBeansJar(type: Jar) {
baseName = 'temp-beans'
}
// only for android
task uiJar(type: Jar) {
baseName = 'i2ptunnel-ui'
from sourceSets.main.output
@@ -85,27 +51,12 @@ task uiJar(type: Jar) {
}
artifacts {
archives i2ptunnelJar //, tempBeansJar, uiJar
archives i2ptunnelJar, tempBeansJar, uiJar
}
war {
include '**/EditBean.class'
include '**/ui/*.class'
include '**/IndexBean.class'
from 'jsp'
rootSpec.exclude('/net/i2p/i2ptunnel/*.class')
rootSpec.exclude('/net/i2p/i2ptunnel/access')
rootSpec.exclude('/net/i2p/i2ptunnel/irc')
rootSpec.exclude('/net/i2p/i2ptunnel/localServer')
rootSpec.exclude('/net/i2p/i2ptunnel/proxy')
rootSpec.exclude('/net/i2p/i2ptunnel/socks')
rootSpec.exclude('/net/i2p/i2ptunnel/streamr')
rootSpec.exclude('/net/i2p/i2ptunnel/udp')
rootSpec.exclude('/net/i2p/i2ptunnel/udpTunnel')
exclude 'jsp/web.xml'
exclude '*.jsi'
exclude '*.jsp'
webXml = file('jsp/web.xml')
// FIXME why is this in there? WEB-INF/lib/mstreaming.jar
}

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test/junit"/>
<classpathentry combineaccessrules="false" kind="src" path="/i2p_sdk"/>
<classpathentry combineaccessrules="false" kind="src" path="/ministreaming"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="build/obj"/>
</classpath>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>i2ptunnel</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -86,12 +86,7 @@
<target name="jar" depends="builddep, compile, bundle-proxy, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
<!-- set if unset -->
<property name="workspace.changes.j.tr" value="" />
<mkdir dir="./build/obj/net/i2p/i2ptunnel/resources"/>
<copy todir="./build/obj/net/i2p/i2ptunnel/resources">
<fileset dir="../../routerconsole/jsp/" includes="themes/console/*/*.css themes/console/images/i2plogo.png themes/console/images/favicon.ico themes/console/images/itoopie_sm.png" />
<fileset dir="../resources" includes="**/*.ht" />
</copy>
<jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" excludes="**/ui/*.class **/web/*.class" >
<jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" includes="**/*.class" excludes="**/ui/*.class **/web/*.class" >
<manifest>
<attribute name="Main-Class" value="net.i2p.i2ptunnel.I2PTunnel" />
<attribute name="${manifest.classpath.name}" value="i2p.jar mstreaming.jar" />
@@ -235,7 +230,7 @@
<pathelement location="../../../build/i2p.jar" />
</classpath>
<arg value="tag" />
<arg value="../resources/proxy/" />
<arg value="../../../installer/resources/proxy/" />
<arg value="build/Proxy.java" />
</java>
</target>

View File

@@ -10,7 +10,6 @@
#
# zzz - public domain
#
cd `dirname $0`
CLASS=net.i2p.i2ptunnel.proxy.messages
TMPFILE=build/javafiles-proxy.txt
export TZ=UTC

View File

@@ -10,7 +10,6 @@
#
# zzz - public domain
#
cd `dirname $0`
CLASS=net.i2p.i2ptunnel.web.messages
TMPFILE=build/javafiles.txt
export TZ=UTC

View File

@@ -307,15 +307,9 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
if (_log.shouldLog(Log.INFO))
_log.info(tunnel.getClientOptions().getProperty("inbound.nickname") + ": Building a new socket manager since there is no other one");
socketManager = buildSocketManager(tunnel, pkf);
/*
since we enabled ratchet by default, we're not compatible with ancient servers anyway.
I2PSession sub = addSubsession(tunnel);
if (sub != null && _log.shouldLog(Log.WARN))
_log.warn("Added subsession " + sub);
*/
}
return socketManager;
}
@@ -325,9 +319,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
*
* @return subsession, or null if none was added
* @since 0.9.20
* @deprecated unused as of 0.9.49
*/
@Deprecated
protected static synchronized I2PSession addSubsession(I2PTunnel tunnel) {
I2PSession sess = socketManager.getSession();
if (sess.getMyDestination().getSigType() == SigType.DSA_SHA1)

View File

@@ -7,7 +7,6 @@ import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
@@ -41,7 +40,6 @@ import net.i2p.data.Base64;
import net.i2p.data.DataHelper;
import net.i2p.data.Destination;
import net.i2p.data.i2cp.MessageStatusMessage;
import net.i2p.i2ptunnel.localServer.LocalHTTPServer;
import net.i2p.util.EepGet;
import net.i2p.util.EventDispatcher;
import net.i2p.util.InternalSocket;
@@ -672,7 +670,8 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
* @since 0.9.4 moved from I2PTunnelHTTPClient
*/
protected static String getErrorPage(I2PAppContext ctx, String base, String backup) {
String file = "proxy/" + base + "-header.ht";
File errorDir = new File(ctx.getBaseDir(), "docs");
File file = new File(errorDir, base + "-header.ht");
try {
return readFile(ctx, file);
} catch(IOException ioe) {
@@ -684,24 +683,20 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
private static final String BUNDLE_NAME = "net.i2p.i2ptunnel.proxy.messages";
/**
* As of 0.9.49, loads the error pages from the jar, not the file system.
* @since 0.9.4 moved from I2PTunnelHTTPClient
*/
private static String readFile(I2PAppContext ctx, String file) throws IOException {
private static String readFile(I2PAppContext ctx, File file) throws IOException {
Reader reader = null;
char[] buf = new char[512];
StringBuilder out = new StringBuilder(2048);
InputStream in = LocalHTTPServer.getResource(file);
if (in == null)
throw new IOException();
try {
boolean hasSusiDNS = ctx.portMapper().isRegistered(PortMapper.SVC_SUSIDNS);
boolean hasI2PTunnel = ctx.portMapper().isRegistered(PortMapper.SVC_I2PTUNNEL);
if (hasSusiDNS && hasI2PTunnel) {
reader = new TranslateReader(ctx, BUNDLE_NAME, in);
reader = new TranslateReader(ctx, BUNDLE_NAME, new FileInputStream(file));
} else {
// strip out the addressbook links
reader = new InputStreamReader(in, "UTF-8");
reader = new InputStreamReader(new FileInputStream(file), "UTF-8");
int len;
while((len = reader.read(buf)) > 0) {
out.append(buf, 0, len);
@@ -739,7 +734,6 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
String rv = out.toString();
return rv;
} finally {
try { in.close(); } catch (IOException ioe) {}
try {
if(reader != null)
reader.close();

View File

@@ -218,14 +218,6 @@ public class TunnelControllerGroup implements ClientApp {
}
}
/**
* Helper
* @since 0.9.49
*/
public I2PAppContext getContext() {
return _context;
}
/**
* ClientApp interface
* @throws IllegalArgumentException if unable to load config from file
@@ -383,8 +375,6 @@ public class TunnelControllerGroup implements ClientApp {
* @throws IllegalArgumentException if unable to load from file
*/
private synchronized void loadControllers(File cfgFile, boolean shouldMigrate) {
if (_log.shouldInfo())
_log.info("Getting controllers from config file " + cfgFile);
File dir = new SecureDirectory(_context.getConfigDir(), CONFIG_DIR);
List<Properties> props = null;
if (cfgFile.exists()) {
@@ -970,6 +960,9 @@ public class TunnelControllerGroup implements ClientApp {
* @since 0.9.42
*/
private List<TunnelController> getControllers(File cfgFile) {
if (_log.shouldInfo())
_log.info("Getting controllers from config file " + cfgFile);
synchronized (this) {
if (!_controllersLoaded)
loadControllers(cfgFile);

View File

@@ -5,7 +5,6 @@ package net.i2p.i2ptunnel.localServer;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
@@ -125,30 +124,32 @@ public abstract class LocalHTTPServer {
if ((method.equals("GET") || method.equals("HEAD")) &&
targetRequest.startsWith("/themes/") &&
!targetRequest.contains("..")) {
String filename = targetRequest.substring(1);
String filename = null;
try {
filename = targetRequest.substring(8); // "/themes/".length
} catch (IndexOutOfBoundsException ioobe) {
return;
}
// theme hack
if (filename.startsWith("themes/console/default/"))
if (filename.startsWith("console/default/"))
filename = filename.replaceFirst("default", context.getProperty("routerconsole.theme", "light"));
InputStream in = getResource(filename);
if (in != null) {
try {
String type;
if (filename.endsWith(".css"))
type = "text/css";
else if (filename.endsWith(".ico"))
type = "image/x-icon";
else if (filename.endsWith(".png"))
type = "image/png";
else if (filename.endsWith(".jpg"))
type = "image/jpeg";
else type = "text/html";
out.write("HTTP/1.1 200 OK\r\nContent-Type: ".getBytes("UTF-8"));
out.write(type.getBytes("UTF-8"));
out.write("\r\nCache-Control: max-age=86400\r\nConnection: close\r\nProxy-Connection: close\r\n\r\n".getBytes("UTF-8"));
DataHelper.copy(in, out);
} finally {
try { in.close(); } catch (IOException ioe) {}
}
File themesDir = new File(context.getBaseDir(), "docs/themes");
File file = new File(themesDir, filename);
if (file.exists() && !file.isDirectory()) {
String type;
if (filename.endsWith(".css"))
type = "text/css";
else if (filename.endsWith(".ico"))
type = "image/x-icon";
else if (filename.endsWith(".png"))
type = "image/png";
else if (filename.endsWith(".jpg"))
type = "image/jpeg";
else type = "text/html";
out.write("HTTP/1.1 200 OK\r\nContent-Type: ".getBytes("UTF-8"));
out.write(type.getBytes("UTF-8"));
out.write("\r\nCache-Control: max-age=86400\r\nConnection: close\r\nProxy-Connection: close\r\n\r\n".getBytes("UTF-8"));
FileUtil.readFile(filename, themesDir.getAbsolutePath(), out);
return;
}
}
@@ -482,15 +483,6 @@ public abstract class LocalHTTPServer {
return buf.toString();
}
/**
* @param resource relative path
* @return stream or null if not found
* @since 0.9.49
*/
public static InputStream getResource(String resource) {
return LocalHTTPServer.class.getResourceAsStream("/net/i2p/i2ptunnel/resources/" + resource);
}
/** these strings go in the jar, not the war */
private static final String BUNDLE_NAME = "net.i2p.i2ptunnel.proxy.messages";

View File

@@ -88,53 +88,24 @@ public class GeneralHelper {
return null;
}
/**
* Save the configuration for a new or existing tunnel to disk.
* For new tunnels, adds to controller and (if configured) starts it.
*/
public List<String> saveTunnel(int tunnel, TunnelConfig config) {
return saveTunnel(_context, _group, tunnel, config);
}
/**
* Save the configuration for a new or existing tunnel to disk.
* For new tunnels, adds to controller and (if configured) starts it.
*
* @param context unused, taken from tcg
*/
public static List<String> saveTunnel(I2PAppContext context, TunnelControllerGroup tcg, int tunnel, TunnelConfig config) {
List<String> msgs = new ArrayList<String>();
TunnelController cur = updateTunnelConfig(tcg, tunnel, config, msgs);
msgs.addAll(saveConfig(tcg, cur));
public static List<String> saveTunnel(
I2PAppContext context, TunnelControllerGroup tcg, int tunnel, TunnelConfig config) {
List<String> msgs = updateTunnelConfig(tcg, tunnel, config);
msgs.addAll(saveConfig(context, tcg, tunnel));
return msgs;
}
/**
* Update the config and if shared, adjust and save the config of other shared clients.
* If a new tunnel, this will call tcg.addController(), and start it if so configured.
* This does NOT save this tunnel's config. Caller must call saveConfig() also.
*/
protected static List<String> updateTunnelConfig(TunnelControllerGroup tcg, int tunnel, TunnelConfig config) {
List<String> msgs = new ArrayList<String>();
updateTunnelConfig(tcg, tunnel, config, msgs);
return msgs;
}
/**
* Update the config and if shared, adjust and save the config of other shared clients.
* If a new tunnel, this will call tcg.addController(), and start it if so configured.
* This does NOT save this tunnel's config. Caller must call saveConfig() also.
*
* @param msgs out parameter, messages will be added
* @return the old or new controller, non-null.
* @since 0.9.49
*/
private static TunnelController updateTunnelConfig(TunnelControllerGroup tcg, int tunnel, TunnelConfig config, List<String> msgs) {
// Get current tunnel controller
TunnelController cur = getController(tcg, tunnel);
Properties props = config.getConfig();
List<String> msgs = new ArrayList<String>();
String type = props.getProperty(TunnelController.PROP_TYPE);
if (TunnelController.TYPE_STD_CLIENT.equals(type) || TunnelController.TYPE_IRC_CLIENT.equals(type)) {
//
@@ -183,8 +154,20 @@ public class GeneralHelper {
tcg.addController(cur);
if (cur.getStartOnLoad())
cur.startTunnelBackground();
try {
tcg.saveConfig(cur);
} catch (IOException ioe) {
msgs.add("Failed to save initial tunnel config after creation " +
cur.getName() + ", check logs:" + ioe);
}
} else {
cur.setConfig(props, "");
try {
tcg.saveConfig(cur);
} catch (IOException ioe) {
msgs.add("Failed to save initial tunnel config after creation " +
cur.getName() + ", check logs:" + ioe);
}
}
// Only modify other shared tunnels
// if the current tunnel is shared, and of supported type
@@ -205,13 +188,14 @@ public class GeneralHelper {
try {
tcg.saveConfig(c);
} catch (IOException ioe) {
msgs.add(0, _t("Failed to save configuration", tcg.getContext()) + ": " + ioe);
msgs.add("Failed to save initial tunnel config after creation " +
cur.getName() + ", check logs:" + ioe);
}
}
}
}
return cur;
return msgs;
}
/**
@@ -256,35 +240,16 @@ public class GeneralHelper {
to.setConfig(cOpt, "");
}
/**
* Save the configuration for an existing tunnel to disk.
* New tunnels must use saveConfig(..., TunnelController).
*
* @param context unused, taken from tcg
* @param tunnel must already exist
* @since 0.9.49
*/
protected static List<String> saveConfig(I2PAppContext context, TunnelControllerGroup tcg, int tunnel) {
TunnelController cur = getController(tcg, tunnel);
if (cur == null) {
List<String> rv = tcg.clearAllMessages();
rv.add("Invalid tunnel number");
return rv;
}
return saveConfig(tcg, cur);
}
/**
* Save the configuration to disk.
* For new and existing tunnels.
* Does NOT call tcg.addController() for new tunnels. See udpateConfig()
*
* @since 0.9.49
*/
private static List<String> saveConfig(TunnelControllerGroup tcg, TunnelController cur) {
I2PAppContext context = tcg.getContext();
protected static List<String> saveConfig(
I2PAppContext context, TunnelControllerGroup tcg, int tunnel) {
List<String> rv = tcg.clearAllMessages();
try {
TunnelController cur = getController(tcg, tunnel);
if (cur == null) {
//List<String> msgs = new ArrayList<String>();
rv.add("Invalid tunnel number");
return rv;
}
tcg.saveConfig(cur);
rv.add(0, _t("Configuration changes saved", context));
} catch (IOException ioe) {

View File

@@ -18,7 +18,7 @@
<div class="panel" id="overview"><h2><%=intl._t("Hidden Services Manager")%></h2><p>
<%=intl._t("These are the local services provided by your router.")%>
&nbsp;
<%=intl._t("By default, most of your client services (email, HTTP proxy, IRC) will share the same set of tunnels and be listed as \"Shared Clients\".")%>
<%=intl._t("By default, most of your client services (email, HTTP proxy, IRC) will share the same set of tunnels and be listed as \"Shared Clients\" and \"Shared Clients(DSA)\".")%>
</p></div>
<%
boolean isInitialized = indexBean.isInitialized();

View File

@@ -221,6 +221,10 @@ hr {
padding: 7px 8px 3px;
}
button.control, input.control {
padding: 5px 8px !important;
}
.control:hover, .control:focus {
text-decoration: none;
color: #19191f;
@@ -655,6 +659,7 @@ input {
#tunnelDepth, #tunnelVariance, #tunnelQuantity, #tunnelBackupQuantity,
#tunnelDepthOut, #tunnelVarianceOut, #tunnelQuantityOut, #tunnelBackupQuantityOut,
#localDestination, #customOptions, #leasesetKey, #name, #description, textarea[name="accessList"] {
width: 100% !important;
margin: 0 !important;
text-align: left !important;
}
@@ -955,6 +960,8 @@ input.tunnelName, input.tunnelDescriptionText, #userAgents, .freetext.tunnelDesc
#customOptions {
margin-top: 15px !important;
width: 99%;
width: calc(100% - 10px) !important;
}
#tunnelDepth, #tunnelVariance, #tunnelQuantity, #tunnelBackupQuantity,

View File

@@ -9,8 +9,8 @@ sourceSets {
}
dependencies {
ext.jettyVersion = '9.3.29.v20201019'
ext.tomcatVersion = '9.0.40'
ext.jettyVersion = '9.2.25.v20180606'
ext.tomcatVersion = '8.5.40'
compile project(':core')
compile 'org.eclipse.jetty:jetty-http:' + ext.jettyVersion
compile 'org.eclipse.jetty:jetty-io:' + ext.jettyVersion

View File

@@ -439,7 +439,6 @@
<copy todir="build/obj" file="resources/log4j.properties" />
<jar destfile="./jettylib/jetty-i2p.jar" basedir="./build/obj" includes="**/*.class log4j.properties" >
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />

View File

@@ -8,7 +8,6 @@ sourceSets {
main {
java {
srcDir 'java/src'
srcDir 'java/build/messages-src'
}
}
test {
@@ -22,17 +21,6 @@ dependencies {
api project(':core')
}
// Create the java files from the po files. The jar task will compile them.
// This requires gettext 0.19 or higher.
// We don't support the "slow way"
task bundle {
doLast {
if (!(new File("$buildDir/classes/java/main/net/i2p/client/streaming/messages_de.class")).exists())
println "apps/ministreaming/java/bundle-messages.sh".execute().text
}
}
jar.dependsOn bundle
jar {
manifest {
attributes 'Specification-Title': 'I2P Streaming API'

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test/junit"/>
<classpathentry kind="src" path="demo"/>
<classpathentry combineaccessrules="false" kind="src" path="/i2p_sdk"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="build/obj"/>
</classpath>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ministreaming</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -10,7 +10,6 @@
#
# zzz - public domain
#
cd `dirname $0`
CLASS=net.i2p.client.streaming.messages
TMPFILE=build/javafiles.txt
export TZ=UTC

View File

@@ -60,6 +60,6 @@ public class I2PSocketExceptionTest {
public void testUnknownStatus() {
I2PSocketException e = new I2PSocketException(255);
assertThat(e.getStatus(), is(255));
assertThat(e.getMessage(), endsWith(": 255"));
assertThat(e.getMessage(), is("Failure code: 255"));
}
}

View File

@@ -7,9 +7,6 @@ sourceSets {
main {
java {
srcDir 'java/src'
srcDir 'java/build/messages-src'
srcDir 'java/build/messages-countries-src'
srcDir 'java/build/messages-news-src'
}
}
}
@@ -43,27 +40,7 @@ if (System.getenv("TARGET_JAVA_HOME") == null && JavaVersion.current() != JavaVe
test.dependsOn scalaTest
}
// Create the java files from the po files. The jar task will compile them.
// This requires gettext 0.19 or higher.
// We don't support the "slow way"
task bundleJar {
doLast {
if (!(new File("$buildDir/classes/java/main/net/i2p/router/countries/messages_de.class")).exists())
println "apps/routerconsole/java/bundle-messages-countries.sh".execute().text
if (!(new File("$buildDir/classes/java/main/net/i2p/router/news/messages_de.class")).exists())
println "apps/routerconsole/java/bundle-messages-news.sh".execute().text
}
}
task bundle {
doLast {
if (!(new File("$buildDir/classes/java/main/net/i2p/router/web/messages_de.class")).exists())
println "apps/routerconsole/java/bundle-messages.sh".execute().text
}
}
task consoleJar(type: Jar) {
from sourceSets.main.output
exclude 'net/i2p/router/web/helpers/**'
jar {
manifest {
// Top level installer will rename to jrobin.jar
// DTG added in 0.8.4, not in the classpath for very old installs,
@@ -73,30 +50,12 @@ task consoleJar(type: Jar) {
// All new jetty 7 jars should have been in 0.9.6, added in 0.9.7
attributes 'Class-Path': 'i2p.jar router.jar jrobin.jar desktopgui.jar i2psnark.jar jstl.jar standard.jar jetty-continuation.jar jetty-http.jar jetty-io.jar jetty-security.jar jetty-servlet.jar jetty-servlets.jar jetty-util.jar jetty-webapp.jar'
}
from ('resources-news', {
into "net/i2p/router/news/resources"
})
}
consoleJar.dependsOn bundleJar
war.dependsOn bundle
artifacts {
archives consoleJar
}
war {
rootSpec.exclude('/com/vuze/**/*')
rootSpec.exclude('/edu/internet2/**/*')
rootSpec.exclude('/net/i2p/router/news/*')
rootSpec.exclude('/net/i2p/router/sybil/*')
rootSpec.exclude('/net/i2p/router/update/*')
rootSpec.exclude('/net/i2p/router/web/*.class')
from 'jsp'
exclude 'jsp/web.xml'
exclude '*.jsi'
exclude '*.jsp'
// Remove classes from the classpath, they are in the jar.
// If we return to precompiling jsps this needs to change.
classpath = []
webXml = file('jsp/web.xml')
from ('resources', {
into "WEB-INF/classes/net/i2p/router/web/resources"
})
}

View File

@@ -140,11 +140,7 @@
<copy file="src/edu/internet2/ndt/locale/Tcpbw100_msgs_nl_NL.properties" tofile="build/obj/edu/internet2/ndt/locale/Tcpbw100_msgs_nl.properties" />
<copy file="src/edu/internet2/ndt/locale/Tcpbw100_msgs_pt_BR.properties" tofile="build/obj/edu/internet2/ndt/locale/Tcpbw100_msgs_pt.properties" />
<copy file="src/edu/internet2/ndt/locale/Tcpbw100_msgs_ru_RU.properties" tofile="build/obj/edu/internet2/ndt/locale/Tcpbw100_msgs_ru.properties" />
<mkdir dir="build/obj/net/i2p/router/news/resources" />
<copy todir="build/obj/net/i2p/router/news/resources" >
<fileset dir="../resources-news" />
</copy>
<jar destfile="./build/routerconsole.jar" basedir="./build/obj" excludes="net/i2p/router/web/helpers/**/* net/i2p/router/web/servlets/**/* net/i2p/router/web/resources/**/*">
<jar destfile="./build/routerconsole.jar" basedir="./build/obj" excludes="net/i2p/router/web/helpers/* net/i2p/router/web/servlets/*">
<manifest>
<!-- DTG added in 0.8.4, not in the classpath for very old installs, before we changed wrapper.config to specify * -->
<!-- very old installs don't have i2psnark,jstl,standard in the classpath... not added in WebAppConfiguration any more -->
@@ -164,11 +160,7 @@
<!-- newsxml.jar only (subset of routerconsole, no war) for Android -->
<target name="newsxmljar" depends="compileNewsOnly" >
<mkdir dir="build/obj/net/i2p/router/news/resources" />
<copy todir="build/obj/net/i2p/router/news/resources" >
<fileset dir="../resources-news" />
</copy>
<jar destfile="./build/newsxml.jar" basedir="./build/obj" includes="net/i2p/router/news/**/*" >
<jar destfile="./build/newsxml.jar" basedir="./build/obj" includes="**/*.class">
</jar>
</target>
@@ -346,13 +338,10 @@
<target name="war" depends="precompilejsp, warUpToDate, listChangedFiles2" unless="war.uptodate" >
<!-- set if unset -->
<property name="workspace.changes.w.tr" value="" />
<!-- Don't include the css in the war, the main build.xml will copy it to docs/themes/console/ -->
<copy file="../jsp/themes/console/images/favicon.ico" tofile="../jsp/favicon.ico" />
<mkdir dir="build/obj/net/i2p/router/web/resources" />
<copy todir="build/obj/net/i2p/router/web/resources" >
<fileset dir="../resources" />
</copy>
<war destfile="build/routerconsole.war" webxml="../jsp/web-out.xml"
basedir="../jsp/" excludes="web.xml, **/*.java, *.jsp, *.jsi, web-fragment.xml, web-out.xml">
basedir="../jsp/" excludes="web.xml, *.css, **/*.java, *.jsp, *.jsi, web-fragment.xml, web-out.xml">
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
@@ -362,9 +351,8 @@
<attribute name="X-Compile-Source-JDK" value="${javac.version}" />
<attribute name="X-Compile-Target-JDK" value="${javac.version}" />
</manifest>
<classes dir="./build/obj" includes="net/i2p/router/web/helpers/* net/i2p/router/web/servlets/* net/i2p/router/web/resources/**/*" />
<classes dir="./build/obj" includes="net/i2p/router/web/helpers/* net/i2p/router/web/servlets/*" />
</war>
<delete file="../jsp/favicon.ico" />
</target>
<target name="warUpToDate">

View File

@@ -10,7 +10,6 @@
#
# zzz - public domain
#
cd `dirname $0`
CLASS=net.i2p.router.countries.messages
TMPFILE=build/javafiles-countries.txt
export TZ=UTC
@@ -34,9 +33,9 @@ fi
# set LG2 to the language you need in environment variables to enable this
#
# generate strings/Countries.java from ../../../core/resources/countries.txt
# generate strings/Countries.java from ../../../installer/resources/countries.txt
#
CFILE=../../../core/resources/countries.txt
CFILE=../../../installer/resources/countries.txt
# add ../java/ so the refs will work in the po file
JFILE=../java/build/Countries.java
if [ $CFILE -nt $JFILE -o ! -s $JFILE ]

View File

@@ -10,7 +10,6 @@
#
# zzz - public domain
#
cd `dirname $0`
CLASS=net.i2p.router.news.messages
TMPFILE=build/javafiles-news.txt
export TZ=UTC

View File

@@ -10,7 +10,6 @@
#
# zzz - public domain
#
cd `dirname $0`
CLASS=net.i2p.router.web.messages
TMPFILE=build/javafiles.txt
export TZ=UTC

View File

@@ -1,7 +1,7 @@
package net.i2p.router.news;
import java.io.File;
import java.io.InputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.Reader;
import java.text.DateFormat;
@@ -190,17 +190,12 @@ public class NewsManager implements ClientApp {
}
private List<NewsEntry> parseInitialNews() {
InputStream is = NewsManager.class.getResourceAsStream("/net/i2p/router/news/resources/docs/initialNews/initialNews.xml");
if (is == null) {
if (_log.shouldWarn())
_log.warn("failed to load initial news");
return Collections.emptyList();
}
File file = new File(_context.getBaseDir(), "docs/initialNews/initialNews.xml");
Reader reader = null;
try {
char[] buf = new char[512];
StringBuilder out = new StringBuilder(2048);
reader = new TranslateReader(_context, BUNDLE_NAME, is);
reader = new TranslateReader(_context, BUNDLE_NAME, new FileInputStream(file));
int len;
while((len = reader.read(buf)) > 0) {
out.append(buf, 0, len);
@@ -211,17 +206,14 @@ public class NewsManager implements ClientApp {
rv.get(0).updated = _context.clock().now();
} else {
if (_log.shouldWarn())
_log.warn("failed to load initial news");
_log.warn("failed to load " + file);
}
return rv;
} catch (IOException ioe) {
if (_log.shouldWarn())
_log.warn("failed to load initial news", ioe);
_log.warn("failed to load " + file, ioe);
return Collections.emptyList();
} finally {
try {
is.close();
} catch (IOException foo) {}
try {
if (reader != null)
reader.close();

View File

@@ -94,7 +94,7 @@ public class Analysis extends JobImpl implements RouterApp {
private static final double POINTS_NEW = 4.0;
private static final double POINTS_BANLIST = 25.0;
public static final boolean DEFAULT_BLOCK = true;
public static final double DEFAULT_BLOCK_THRESHOLD = 50.0;
public static final double DEFAULT_BLOCK_THRESHOLD = 75.0;
public static final long DEFAULT_BLOCK_TIME = 7*24*60*60*1000L;
public static final long DEFAULT_REMOVE_TIME = 30*24*60*60*1000L;
public static final long DEFAULT_FREQUENCY = 24*60*60*1000L;

View File

@@ -21,7 +21,6 @@ public class CSSHelper extends HelperBase {
/** @since 0.9.33 moved from ConfigUIHelper */
public static final String PROP_THEME_PFX = PROP_THEME_NAME + '.';
public static final String DEFAULT_THEME = "light";
public static final String ALT_THEME = "dark";
public static final String BASE_THEME_PATH = "/themes/console/";
private static final String FORCE = "classic";
public static final String PROP_REFRESH = "routerconsole.summaryRefresh";

View File

@@ -1,10 +1,6 @@
package net.i2p.router.web;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Locale;
import net.i2p.util.FileUtil;
@@ -16,15 +12,12 @@ public class ContentHelper extends HelperBase {
private String _lang;
/**
* Caution, use absolute paths only for getContent() and getTextContent(),
* do not assume files are in CWD.
* Caution, use absolute paths only, do not assume files are in CWD
*/
public void setPage(String page) { _page = page; }
public void setStartAtBeginning(String moo) {
_startAtBeginning = Boolean.parseBoolean(moo);
}
public void setLang(String l) {
/*****
if((_lang == null || !_lang.equals(l)) && (l != null)) {

View File

@@ -13,6 +13,4 @@ public class GraphConstants {
public static final int DEFAULT_Y = 100;
public static final int MAX_X = 2048;
public static final int MAX_Y = 1024;
public static final String PROP_UTC = "routerconsole.graphUTC";
}

View File

@@ -162,9 +162,6 @@ class SummaryRenderer {
def.setFont(RrdGraphDef.FONTTAG_LEGEND, legnd);
def.setFont(RrdGraphDef.FONTTAG_TITLE, large);
boolean localTime = !_context.getBooleanProperty(GraphConstants.PROP_UTC);
if (localTime)
def.setTimeZone(SystemVersion.getSystemTimeZone(_context));
def.setTimeSpan(start/1000, end/1000);
def.setMinValue(0d);
String name = _listener.getRate().getRateStat().getName();
@@ -251,39 +248,23 @@ class SummaryRenderer {
if (!hideLegend) {
// '07 Jul 21:09' with month name in the system locale
// TODO: Fix Arabic time display
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM HH:mm");
Map<Long, String> events = ((RouterContext)_context).router().eventLog().getEvents(EventLog.STARTED, start);
if (localTime) {
for (Map.Entry<Long, String> event : events.entrySet()) {
long started = event.getKey().longValue();
if (started > start && started < end) {
String legend;
if (Messages.isRTL(lang)) {
// RTL languages
legend = _t("Restart") + ' ' + DataHelper.formatTime(started) + " - " + event.getValue() + "\\l";
} else {
legend = _t("Restart") + ' ' + DataHelper.formatTime(started) + " [" + event.getValue() + "]\\l";
}
def.vrule(started / 1000, RESTART_BAR_COLOR, legend, 2.0f);
for (Map.Entry<Long, String> event : events.entrySet()) {
long started = event.getKey().longValue();
if (started > start && started < end) {
// String legend = _t("Restart") + ' ' + sdf.format(new Date(started)) + " UTC " + event.getValue() + "\\l";
String legend;
if (Messages.isRTL(lang)) {
// RTL languages
legend = _t("Restart") + ' ' + sdf.format(new Date(started)) + " - " + event.getValue() + "\\l";
} else {
legend = _t("Restart") + ' ' + sdf.format(new Date(started)) + " [" + event.getValue() + "]\\l";
}
def.vrule(started / 1000, RESTART_BAR_COLOR, legend, 2.0f);
}
def.comment(DataHelper.formatTime(start) + "" + DataHelper.formatTime(end) + "\\r");
} else {
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM HH:mm");
for (Map.Entry<Long, String> event : events.entrySet()) {
long started = event.getKey().longValue();
if (started > start && started < end) {
String legend;
if (Messages.isRTL(lang)) {
// RTL languages
legend = _t("Restart") + ' ' + sdf.format(new Date(started)) + " - " + event.getValue() + "\\l";
} else {
legend = _t("Restart") + ' ' + sdf.format(new Date(started)) + " [" + event.getValue() + "]\\l";
}
def.vrule(started / 1000, RESTART_BAR_COLOR, legend, 2.0f);
}
}
def.comment(sdf.format(new Date(start)) + "" + sdf.format(new Date(end)) + " UTC\\r");
}
def.comment(sdf.format(new Date(start)) + "" + sdf.format(new Date(end)) + " UTC\\r");
}
if (!showCredit)
def.setShowSignature(false);

View File

@@ -76,7 +76,6 @@ public class ConfigUIHelper extends HelperBase {
Set<String> rv = new TreeSet<String>();
// add a failsafe even if we can't find any themes
rv.add(CSSHelper.DEFAULT_THEME);
rv.add(CSSHelper.ALT_THEME);
File dir = new File(_context.getBaseDir(), "docs/themes/console");
File[] files = dir.listFiles();
if (files == null)

View File

@@ -32,8 +32,6 @@ import net.i2p.util.SystemVersion;
public class FileDumpHelper extends HelperBase {
private static final boolean isWindows = SystemVersion.isWindows();
private static final String LINK = "http://git.idk.i2p/i2p-hackers/i2p.i2p/-/tree/";
public String getFileSummary() {
StringBuilder buf = new StringBuilder(16*1024);
buf.append("<table id=\"jardump\">\n<tr><th>File</th><th>Size</th><th>Date</th><th>SHA 256</th><th>Revision</th>" +
@@ -58,7 +56,7 @@ public class FileDumpHelper extends HelperBase {
}
Collections.sort(flist);
for (File f : flist) {
dumpFile(buf, f, true);
dumpFile(buf, f);
}
}
@@ -67,14 +65,14 @@ public class FileDumpHelper extends HelperBase {
buf.append("<tr><th class=\"subheading routerfiles\" colspan=\"9\"><b>Router Jar Files:</b> <code>");
buf.append(dir.getAbsolutePath());
buf.append("</code></th></tr>\n");
dumpDir(buf, dir, ".jar", true);
dumpDir(buf, dir, ".jar");
// our wars
dir = new File(_context.getBaseDir(), "webapps");
buf.append("<tr><th class=\"subheading routerfiles\" colspan=\"9\"><b>Router War Files:</b> <code>");
buf.append(dir.getAbsolutePath());
buf.append("</code></th></tr>\n");
dumpDir(buf, dir, ".war", true);
dumpDir(buf, dir, ".war");
// plugins
File pluginDir = new File(_context.getConfigDir(), PluginStarter.PLUGIN_DIR);
@@ -89,9 +87,9 @@ public class FileDumpHelper extends HelperBase {
buf.append("<tr><th class=\"subheading pluginfiles\" colspan=\"9\"><b>Plugin File Location:</b> <code>");
buf.append(dir.getAbsolutePath());
buf.append("</code></th></tr>");
dumpDir(buf, dir, ".jar", false);
dumpDir(buf, dir, ".jar");
dir = new File(files[i], "console/webapps");
dumpDir(buf, dir, ".war", false);
dumpDir(buf, dir, ".war");
}
}
@@ -99,23 +97,23 @@ public class FileDumpHelper extends HelperBase {
return buf.toString();
}
private static void dumpDir(StringBuilder buf, File dir, String suffix, boolean linkrev) {
private static void dumpDir(StringBuilder buf, File dir, String suffix) {
File[] files = dir.listFiles(new FileSuffixFilter(suffix));
if (files == null)
return;
Arrays.sort(files);
for (int i = 0; i < files.length; i++) {
dumpFile(buf, files[i], linkrev);
dumpFile(buf, files[i]);
}
}
private static void dumpFile(StringBuilder buf, File f, boolean linkrev) {
private static void dumpFile(StringBuilder buf, File f) {
buf.append("<tr><td><b title=\"").append(f.getAbsolutePath()).append("\">").append(f.getName()).append("</b></td>" +
"<td align=\"right\">").append(f.length()).append("</td>" +
"<td>");
long mod = f.lastModified();
if (mod > 0)
buf.append(DataHelper.formatTime(mod));
buf.append((new Date(mod)).toString());
else
buf.append("<font color=\"red\">Not found</font>");
buf.append("</td><td align=\"center\">");
@@ -145,13 +143,13 @@ public class FileDumpHelper extends HelperBase {
if (s != null && s.length() > 20) {
if (iv != null)
buf.append("<br>");
if (linkrev)
buf.append("<a href=\"").append(LINK).append(s).append("\">");
// fix and uncomment if a reliable viewmtn host appears
//buf.append("<a href=\"http://killyourtv.i2p/viewmtn/revision/info/").append(s)
// .append("\">");
buf.append("<span class=\"revision\"><tt>").append(s.substring(0, 20)).append("</tt>" +
"<br>" +
"<tt>").append(s.substring(20)).append("</tt></span>");
if (linkrev)
buf.append("</a>");
//buf.append("</tt>");
}
buf.append("</td><td>");
s = getAtt(att, "Created-By");

View File

@@ -32,7 +32,6 @@ public class GraphHelper extends FormHandler {
private int _refreshDelaySeconds;
private boolean _persistent;
private boolean _graphHideLegend;
private boolean _utc;
private String _stat;
private int _end;
@@ -132,9 +131,6 @@ public class GraphHelper extends FormHandler {
/** @since 0.9.32 */
public void setHideLegend(String foo) { _graphHideLegend = true; }
/** @since 0.9.49 */
public void setUtc(String foo) { _utc = true; }
/**
* For single stat page
* @since 0.9
@@ -161,8 +157,6 @@ public class GraphHelper extends FormHandler {
else if (title.equals("bw.recvRate")) hasRx = true;
}
boolean hideLegend = _context.getProperty(PROP_LEGEND, DEFAULT_LEGEND);
// param is ignored, we get it from the property, but add it to defeat caching on change
boolean utc = _context.getBooleanProperty(PROP_UTC);
if (hasTx && hasRx && !_showEvents) {
// remove individual tx/rx graphs if displaying combined
@@ -176,7 +170,6 @@ public class GraphHelper extends FormHandler {
+ "&amp;c=" + (3 * _periodCount )
+ "&amp;w=" + (3 * _width)
+ "&amp;h=" + (3 * _height)
+ (utc ? "&amp;utc" : "")
+ "\">");
String title = _t("Combined bandwidth graph");
_out.write("<img class=\"statimage\""
@@ -191,8 +184,6 @@ public class GraphHelper extends FormHandler {
// no legend, no height difference needed
_out.write("&amp;height=" + (_height));
}
if (utc)
_out.write("&amp;utc");
_out.write("&amp;hideLegend=" + hideLegend
+ "\" alt=\"" + title + "\" title=\"" + title + "\"></a>\n");
}
@@ -208,7 +199,6 @@ public class GraphHelper extends FormHandler {
+ "&amp;w=" + (3 * _width)
+ "&amp;h=" + (3 * _height)
+ (_showEvents ? "&amp;showEvents=1" : "")
+ (utc ? "&amp;utc" : "")
+ "\">");
_out.write("<img class=\"statimage\" border=\"0\""
+ " src=\"viewstat.jsp?stat="
@@ -219,7 +209,6 @@ public class GraphHelper extends FormHandler {
+ "&amp;width=" + _width
+ "&amp;height=" + _height
+ "&amp;hideLegend=" + hideLegend
+ (utc ? "&amp;utc" : "")
+ "\" alt=\"" + title
+ "\" title=\"" + title + "\"></a>\n");
}
@@ -400,7 +389,7 @@ public class GraphHelper extends FormHandler {
+ "\">" + _t("pixels wide") + "&nbsp;&nbsp;&nbsp;<input size=\"4\" style=\"text-align: right;\" type=\"text\" name=\"height\" value=\"" + _height
+ "\">" + _t("pixels high") + "</span><br><span class=\"nowrap\">\n<b>");
_out.write(_t("Display period") + ":</b> <input size=\"4\" style=\"text-align: right;\" type=\"text\" name=\"periodCount\" value=\"" + _periodCount + "\">" + _t("minutes") + "</span><br><span class=\"nowrap\">\n<b>");
_out.write(_t("Display period") + ":</b> <input size=\"5\" style=\"text-align: right;\" type=\"text\" name=\"periodCount\" value=\"" + _periodCount + "\">" + _t("minutes") + "</span><br><span class=\"nowrap\">\n<b>");
_out.write(_t("Refresh delay") + ":</b> <select name=\"refreshDelay\">");
@@ -428,12 +417,6 @@ public class GraphHelper extends FormHandler {
if (hideLegend)
_out.write(HelperBase.CHECKED);
_out.write(">" + _t("Do not show legend on graphs") + "</label></span><br><span class=\"nowrap\">\n<b>");
_out.write(_t("UTC") + ":</b> ");
_out.write("<label><input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"utc\"");
boolean utc = _context.getBooleanProperty(PROP_UTC);
if (utc)
_out.write(HelperBase.CHECKED);
_out.write(">" + _t("Use UTC time on graphs") + "</label></span><br><span class=\"nowrap\">\n<b>");
_out.write(_t("Persistence") +
":</b> <label><input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"persistent\"");
boolean persistent = _context.getBooleanPropertyDefaultTrue(SummaryListener.PROP_PERSISTENT);
@@ -494,7 +477,6 @@ public class GraphHelper extends FormHandler {
_refreshDelaySeconds != _context.getProperty(PROP_REFRESH, DEFAULT_REFRESH) ||
_showEvents != _context.getBooleanProperty(PROP_EVENTS) ||
_graphHideLegend != _context.getProperty(PROP_LEGEND, DEFAULT_LEGEND) ||
_utc != _context.getBooleanProperty(PROP_UTC) ||
_persistent != _context.getBooleanPropertyDefaultTrue(SummaryListener.PROP_PERSISTENT)) {
Map<String, String> changes = new HashMap<String, String>();
changes.put(PROP_X, Integer.toString(_width));
@@ -504,7 +486,6 @@ public class GraphHelper extends FormHandler {
changes.put(PROP_EVENTS, Boolean.toString(_showEvents));
changes.put(PROP_LEGEND, Boolean.toString(_graphHideLegend));
changes.put(SummaryListener.PROP_PERSISTENT, Boolean.toString(_persistent));
changes.put(PROP_UTC, Boolean.toString(_utc));
boolean warn = _persistent != _context.getBooleanPropertyDefaultTrue(SummaryListener.PROP_PERSISTENT);
_context.router().saveConfig(changes, null);
addFormNotice(_t("Graph settings saved"));

View File

@@ -5,7 +5,6 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import net.i2p.crypto.EncType;
import net.i2p.crypto.SigType;
import net.i2p.data.DataHelper;
import net.i2p.util.SystemVersion;
@@ -29,7 +28,6 @@ public class NetDbHelper extends FormHandler {
private boolean _debug;
private boolean _graphical;
private SigType _type;
private EncType _etype;
private String _newNonce;
private boolean _postOK;
@@ -121,12 +119,6 @@ public class NetDbHelper extends FormHandler {
_type = SigType.parseSigType(f);
}
/** @since 0.9.49 */
public void setEtype(String f) {
if (f != null && f.length() > 0)
_etype = EncType.parseEncType(f);
}
/** @since 0.9.28 */
public void setMtu(String f) {
if (f != null && f.length() > 0)
@@ -279,10 +271,10 @@ public class NetDbHelper extends FormHandler {
if (_routerPrefix != null || _version != null || _country != null ||
_family != null || _caps != null || _ip != null || _sybil != null ||
_port != 0 || _type != null || _mtu != null || _ipv6 != null ||
_ssucaps != null || _transport != null || _cost != 0 || _etype != null) {
_ssucaps != null || _transport != null || _cost != 0) {
renderer.renderRouterInfoHTML(_out, _limit, _page,
_routerPrefix, _version, _country,
_family, _caps, _ip, _sybil, _port, _type, _etype,
_family, _caps, _ip, _sybil, _port, _type,
_mtu, _ipv6, _ssucaps, _transport, _cost);
} else if (_lease) {
renderer.renderLeaseSetHTML(_out, _debug);
@@ -316,7 +308,7 @@ public class NetDbHelper extends FormHandler {
if (_routerPrefix != null || _version != null || _country != null ||
_family != null || _caps != null || _ip != null || _sybil != null ||
_port != 0 || _type != null || _mtu != null || _ipv6 != null ||
_ssucaps != null || _transport != null || _cost != 0 || _etype != null)
_ssucaps != null || _transport != null || _cost != 0)
return 2;
if (_full == 2)
return 3;
@@ -377,7 +369,6 @@ public class NetDbHelper extends FormHandler {
"<tr><td>Capabilities:</td><td><input type=\"text\" name=\"caps\"></td><td>e.g. f or XOfR</td></tr>\n" +
"<tr><td>Cost:</td><td><input type=\"text\" name=\"cost\"></td><td></td></tr>\n" +
"<tr><td>Country Code:</td><td><input type=\"text\" name=\"c\"></td><td>e.g. ru</td></tr>\n" +
"<tr><td>Encryption Type:</td><td><input type=\"text\" name=\"etype\"></td><td></td></tr>\n" +
"<tr><td>Router Family:</td><td><input type=\"text\" name=\"fam\"></td><td></td></tr>\n" +
"<tr><td>Hash Prefix:</td><td><input type=\"text\" name=\"r\"></td><td></td></tr>\n" +
"<tr><td>IP or Hostname:</td><td><input type=\"text\" name=\"ip\"></td><td>host name, IPv4, or IPv6, /24,/16,/8 suffixes optional for IPv4, prefix ok for IPv6</td></tr>\n" +

View File

@@ -104,7 +104,7 @@ class NetDbRenderer {
public void renderRouterInfoHTML(Writer out, int pageSize, int page,
String routerPrefix, String version,
String country, String family, String caps,
String ip, String sybil, int port, SigType type, EncType etype,
String ip, String sybil, int port, SigType type,
String mtu, String ipv6, String ssucaps,
String tr, int cost) throws IOException {
StringBuilder buf = new StringBuilder(4*1024);
@@ -162,8 +162,6 @@ class NetDbRenderer {
ubuf.append("&amp;tr=").append(tr);
if (type != null)
ubuf.append("&amp;type=").append(type);
if (etype != null)
ubuf.append("&amp;etype=").append(etype);
if (ip != null)
ubuf.append("&amp;ip=").append(ip);
if (port != 0)
@@ -222,8 +220,7 @@ class NetDbRenderer {
// 'O' will catch PO and XO also
(caps != null && hasCap(ri, caps)) ||
(tr != null && ri.getTargetAddress(tr) != null) ||
(type != null && type == ri.getIdentity().getSigType()) ||
(etype != null && etype == ri.getIdentity().getEncType())) {
(type != null && type == ri.getIdentity().getSigType())) {
if (skipped < toSkip) {
skipped++;
continue;
@@ -519,7 +516,7 @@ class NetDbRenderer {
buf.append("<b>").append(_t("Destination")).append(":</b> ");
TunnelPoolSettings in = _context.tunnelManager().getInboundSettings(key);
if (in != null && in.getDestinationNickname() != null)
buf.append(DataHelper.escapeHTML(in.getDestinationNickname()));
buf.append(in.getDestinationNickname());
else
buf.append(dest.toBase64().substring(0, 6));
buf.append("</th></tr>\n");

View File

@@ -1,90 +0,0 @@
package net.i2p.router.web.helpers;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Locale;
import net.i2p.router.web.HelperBase;
import net.i2p.router.web.Messages;
/**
* @since 0.9.49
*/
public class ResourceHelper extends HelperBase {
protected String _page;
private int _maxLines;
/**
* Use relative path for getResource().
*/
public void setPage(String page) { _page = page; }
public void setMaxLines(String lines) {
if (lines != null) {
try {
_maxLines = Integer.parseInt(lines);
} catch (NumberFormatException nfe) {
_maxLines = -1;
}
} else {
_maxLines = -1;
}
}
/**
* Convert file.ext to file_lang.ext if it exists.
* Get lang from the cgi lang param, then properties, then from the default locale.
* _context must be set to check the property.
* @return "" on error
*/
public String getResource() {
if (_page == null || _page.contains(".."))
return "";
String lang = null;
String page = null;
int lastdot = _page.lastIndexOf('.');
if (lastdot <= 0) {
page = _page;
} else {
if (_context != null)
lang = _context.getProperty(Messages.PROP_LANG);
if (lang == null || lang.length() <= 0) {
lang = Locale.getDefault().getLanguage();
if (lang == null || lang.length() <= 0)
page = _page;
}
}
if (page == null) {
if (lang.equals("en"))
page = _page;
else
page = _page.substring(0, lastdot) + '_' + lang + _page.substring(lastdot);
}
InputStream is = ResourceHelper.class.getResourceAsStream("/net/i2p/router/web/resources/" + page);
if (is == null) {
is = ResourceHelper.class.getResourceAsStream("/net/i2p/router/web/resources/" + _page);
if (is == null)
return "";
}
BufferedReader in = null;
StringBuilder buf = new StringBuilder(20000);
try {
in = new BufferedReader(new InputStreamReader(is, "UTF-8"));
String line = null;
int i = 0;
while ( (line = in.readLine()) != null) {
buf.append(line);
buf.append('\n');
if (_maxLines > 0 && ++i >= _maxLines)
break;
}
} catch (IOException ioe) {
} finally {
if (in != null) try { in.close(); } catch (IOException ioe) {}
try { is.close(); } catch (IOException ioe) {}
}
return buf.toString();
}
}

View File

@@ -34,6 +34,7 @@ class Dummy {
// note that if the wording changes in i2ptunnel.config, we have to
// keep the old string here as well for existing installs
_t("shared clients");
_t("shared clients (DSA)");
_t("IRC proxy");
_t("eepsite");
_t("I2P webserver");

View File

@@ -25,7 +25,7 @@
<jsp:setProperty name="updatehelper" property="contextId" value="<%=i2pcontextId%>" />
<jsp:getProperty name="updatehelper" property="newsStatus" /><br>
</div><div class="main" id="console">
<jsp:useBean class="net.i2p.router.web.helpers.ResourceHelper" id="contenthelper" scope="request" />
<jsp:useBean class="net.i2p.router.web.ContentHelper" id="contenthelper" scope="request" />
<div class="welcome">
<div class="langbox" title="<%=intl._t("Configure Language")%>">
<a href="/configui#langheading"><img src="/themes/console/images/info/control.png" alt="<%=intl._t("Configure Language")%>"></a>
@@ -33,8 +33,9 @@
<a name="top"></a>
<h2><%=intl._t("Welcome to I2P")%></h2>
</div>
<jsp:setProperty name="contenthelper" property="page" value="docs/readme.html" />
<% java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getBaseDir(), "docs/readme.html"); %>
<jsp:setProperty name="contenthelper" property="page" value="<%=fpath.getAbsolutePath()%>" />
<jsp:setProperty name="contenthelper" property="maxLines" value="300" />
<jsp:setProperty name="contenthelper" property="contextId" value="<%=i2pcontextId%>" />
<jsp:getProperty name="contenthelper" property="resource" />
<jsp:getProperty name="contenthelper" property="content" />
</div></body></html>

View File

@@ -76,18 +76,8 @@
net.i2p.data.Hash h = dest.calculateHash();
net.i2p.crypto.SessionKeyManager skm = ctx.clientManager().getClientSessionKeyManager(h);
if (skm != null) {
out.print("<div class=\"debug_section\" id=\"cskm" + (i++) + "\"><h2>");
net.i2p.router.TunnelPoolSettings tps = ctx.tunnelManager().getInboundSettings(h);
if (tps != null) {
String nick = tps.getDestinationNickname();
if (nick != null)
out.print(net.i2p.data.DataHelper.escapeHTML(nick));
else
out.print("<font size=\"-2\">" + dest.toBase32() + "</font>");
} else {
out.print("<font size=\"-2\">" + dest.toBase32() + "</font>");
}
out.print(" Session Key Manager</h2>");
out.print("<div class=\"debug_section\" id=\"cskm" + (i++) + "\">");
out.print("<h2><font size=\"-2\">" + dest.toBase32() + "</font> Session Key Manager</h2>");
skm.renderStatusHTML(out);
out.print("</div>");
}

View File

@@ -12,8 +12,8 @@
* with headers set so the browser caches.
*
* As of 0.9.36:
* All new and changed flags must go in the ../resources/docs/icons/flags16x11/ dir,
* which is copied into the war and will be checked first by flags.jsp.
* All new and changed flags must go in the flags16x11/ dir,
* which will be checked first by flags.jsp.
* The flags/ dir is the original set from famfamfam,
* which may be symlinked in package installs.
*
@@ -23,54 +23,44 @@ if (c != null &&
(c.length() == 2 || c.length() == 7) &&
c.replaceAll("[a-z0-9_]", "").length() == 0) {
String flagSet = "flags16x11";
String s = request.getParameter("s");
java.io.File ffile;
long lastmod;
java.io.InputStream fin = flags_jsp.class.getResourceAsStream("/net/i2p/router/web/resources/docs/icons/" + flagSet + '/' + c + ".png");
if (fin != null) {
// found in the war
java.io.File war = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getBaseDir(), "webapps/routerconsole.war");
ffile = null;
lastmod = war.lastModified();
} else {
// fallback to flags dir, which will be symlinked to /usr/share/flags/countries/16x11 for package builds
String base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath() +
String base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath() +
java.io.File.separatorChar +
"docs" + java.io.File.separatorChar + "icons";
String file = "flags" + java.io.File.separatorChar + c + ".png";
String file = flagSet + java.io.File.separatorChar + c + ".png";
java.io.File ffile = new java.io.File(base, file);
if (!ffile.exists()) {
// fallback to flags dir, which will be symlinked to /usr/share/flags/countries/16x11 for package builds
file = "flags" + java.io.File.separatorChar + c + ".png";
ffile = new java.io.File(base, file);
long length = ffile.length();
if (length <= 0) {
response.sendError(403, "Flag not found");
return;
}
response.setHeader("Content-Length", Long.toString(length));
lastmod = ffile.lastModified();
}
long lastmod = ffile.lastModified();
if (lastmod > 0) {
long iflast = request.getDateHeader("If-Modified-Since");
// iflast is -1 if not present; round down file time
if (iflast >= ((lastmod / 1000) * 1000)) {
response.setStatus(304);
if (fin != null)
fin.close();
return;
}
response.setDateHeader("Last-Modified", lastmod);
// cache for a day
response.setDateHeader("Expires", net.i2p.I2PAppContext.getGlobalContext().clock().now() + 86400000l);
response.setHeader("Cache-Control", "public, max-age=604800");
response.setHeader("X-Content-Type-Options", "nosniff");
}
// cache for a day
response.setDateHeader("Expires", net.i2p.I2PAppContext.getGlobalContext().clock().now() + 86400000l);
response.setHeader("Cache-Control", "public, max-age=604800");
response.setHeader("X-Content-Type-Options", "nosniff");
long length = ffile.length();
if (length > 0)
response.setHeader("Content-Length", Long.toString(length));
response.setContentType("image/png");
response.setHeader("Accept-Ranges", "none");
java.io.FileInputStream fin = null;
java.io.OutputStream cout = response.getOutputStream();
try {
// flags dir may be a symlink, which readFile will reject
// We carefully vetted the "c" value above.
//net.i2p.util.FileUtil.readFile(file, base, cout);
if (fin == null)
fin = new java.io.FileInputStream(ffile);
fin = new java.io.FileInputStream(ffile);
net.i2p.data.DataHelper.copy(fin, cout);
} catch (java.io.IOException ioe) {
// prevent 'Committed' IllegalStateException from Jetty

View File

@@ -73,6 +73,22 @@ img {
border: none;
}
img[src$="bound.png"] {
filter: hue-rotate(-40deg);
}
a img[src$="bound.png"] {
filter: hue-rotate(-40deg) drop-shadow(0 0 1px #ccf);
}
a:hover img[src$="bound.png"] {
filter: hue-rotate(-40deg) drop-shadow(0 0 1px #f60);
}
a img {
filter: drop-shadow(0 0 1px #ccf);
}
a:hover img {
filter: drop-shadow(0 0 1px #f60);
}
@@ -6568,8 +6584,9 @@ h3#displayevents {
}
form[action="events"] {
border: 1px solid #ddf;
border: 1px solid #7778bf;
padding: 10px 10px 10px 50px;
margin: -16px 0 -2px 0;
background: url(/themes/console/images/info/logs.png) 12px center no-repeat;
background-size: 28px 28px;
}

8
apps/sam/java/.classpath Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/i2p_sdk"/>
<classpathentry combineaccessrules="false" kind="src" path="/ministreaming"/>
<classpathentry kind="output" path="build"/>
</classpath>

17
apps/sam/java/.project Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sam</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test/junit"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry combineaccessrules="false" kind="src" path="/i2p_sdk"/>
<classpathentry combineaccessrules="false" kind="src" path="/ministreaming"/>
<classpathentry kind="output" path="build/obj"/>
</classpath>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>streaming</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -24,7 +24,7 @@ public class MessageOutputStreamTest extends TestCase {
@Test
public void test() throws Exception {
Receiver receiver = new Receiver();
MessageOutputStream out = new MessageOutputStream(_context, _st2, receiver, 100, 100);
MessageOutputStream out = new MessageOutputStream(_context, _st2, receiver, 100);
byte buf[] = new byte[128*1024];
_context.random().nextBytes(buf);
out.write(buf);

View File

@@ -6,7 +6,6 @@ sourceSets {
main {
java {
srcDir 'src/java/src'
srcDir 'src/build/messages-src'
}
}
}
@@ -16,30 +15,8 @@ dependencies {
providedCompile project(':apps:jetty')
}
// Create the java files from the po files. The jar task will compile them.
// This requires gettext 0.19 or higher.
// We don't support the "slow way"
task bundle {
doLast {
if (!(new File("$buildDir/classes/java/main/i2p/susi/dns/messages_de.class")).exists())
println "apps/susidns/src/bundle-messages.sh".execute().text
}
}
war.dependsOn bundle
war {
from 'src/jsp'
from 'src/index.html'
from ('src/js', {
into "js"
})
from ('src/svg', {
into "svg"
})
from ('src/themes', {
into "themes"
})
exclude '*.jsi'
exclude '*.jsp'
webXml = file('src/WEB-INF/web-template.xml')
}

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="java/src"/>
<classpathentry combineaccessrules="false" kind="src" path="/i2p_sdk"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/jstl.jar"/>
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/standard.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="WEB-INF/classes"/>
</classpath>

17
apps/susidns/src/.project Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>susidns</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -10,7 +10,6 @@
#
# zzz - public domain
#
cd `dirname $0`
CLASS=i2p.susi.dns.messages
TMPFILE=tmp/javafiles.txt
export TZ=UTC

View File

@@ -86,7 +86,7 @@
</p>
<div class="illustrate">
<object type="image/svg+xml" data="images/how.svg?<%=net.i2p.CoreVersion.VERSION%>">
<img src="themes/images/how.png" border="0" alt="address book working scheme" title="How the address book works" class="illustrate" />
<img src="images/how.png" border="0" alt="address book working scheme" title="How the address book works" class="illustrate" />
</object>
</div>
</div>

View File

@@ -6,7 +6,6 @@ sourceSets {
main {
java {
srcDir 'src/src'
srcDir 'build/messages-src'
}
}
}
@@ -16,17 +15,6 @@ dependencies {
providedCompile project(':apps:jetty')
}
// Create the java files from the po files. The jar task will compile them.
// This requires gettext 0.19 or higher.
// We don't support the "slow way"
task bundle {
doLast {
if (!(new File("$buildDir/classes/java/main/i2p/susi/webmail/messages_de.class")).exists())
println "apps/susimail/bundle-messages.sh".execute().text
}
}
war.dependsOn bundle
war {
from 'src'
exclude 'WEB-INF/web.xml'

1
apps/susimail/bundle-messages.sh Executable file → Normal file
View File

@@ -10,7 +10,6 @@
#
# zzz - public domain
#
cd `dirname $0`
CLASS=i2p.susi.webmail.messages
TMPFILE=javafiles.txt
export TZ=UTC

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry combineaccessrules="false" kind="src" path="/i2p_sdk"/>
<classpathentry kind="lib" path="lib/systray4j.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="build/obj"/>
</classpath>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>systray</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -1,3 +1,7 @@
plugins {
id 'idea'
}
String getReleaseVersion() {
def releaseVersion
file("core/java/src/net/i2p/CoreVersion.java").readLines().findAll({ line ->
@@ -41,6 +45,24 @@ String getBuiltBy() {
builtBy
}
boolean haveMonotone() {
file("_MTN").exists()
}
String getWorkspaceVersion() {
if (haveMonotone()) {
def stdout = new ByteArrayOutputStream()
exec {
executable 'mtn'
args 'automate', 'get_base_revision_id'
standardOutput = stdout
}
stdout.toString().trim()
} else {
'unknown'
}
}
String compat(String src) {
if (src.contains('.')) {
src.substring(src.lastIndexOf('.') + 1)
@@ -49,8 +71,13 @@ String compat(String src) {
}
}
String getWorkspaceVersion() {
"git" // TODO: extract revision
String javaExecutable(String targetJavaHome, String execName) {
def javaExecutablesPath = new File(targetJavaHome, "bin")
def executable = new File(javaExecutablesPath, execName)
if (!executable.exists()) {
throw new IllegalArgumentException("There is no ${execName} executable in ${javaExecutablesPath}")
}
executable.toString()
}
def releaseVersion = getReleaseVersion()
@@ -61,9 +88,14 @@ def fullVersion = "$releaseVersion-$buildVersion$buildExtra"
def builtBy = getBuiltBy()
def workspaceVersion = getWorkspaceVersion()
subprojects {
// Exclude apps/ dir itself, but include its subdirs
def javaProjects = subprojects - project(':apps')
configure(javaProjects) {
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'eclipse'
apply plugin: 'idea'
repositories {
jcenter()
@@ -101,16 +133,74 @@ subprojects {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
def i2pBootClasspath
// Set java7BootClasspath=/path/to/rt.jar:/path/to/jce.jar in ~/.gradle/gradle.properties if needed
if (java7BootClasspath) {
i2pBootClasspath = java7BootClasspath
} else {
def java7Home = System.getenv("JAVA7_HOME")
if (java7Home) {
i2pBootClasspath = "${java7Home}/jre/lib/jce.jar:${java7Home}/jre/lib/rt.jar"
}
}
if (i2pBootClasspath) {
tasks.withType(AbstractCompile, { AbstractCompile ac ->
ac.options.bootstrapClasspath = files(i2pBootClasspath)
})
} else {
if (JavaVersion.current().java8Compatible && !JavaVersion.current().java9Compatible) {
throw new GradleException("Set java7BootClasspath property or JAVA7_HOME environment variable to enable cross-compilation, or run Gradle with JDK 9+")
}
project.afterEvaluate {
tasks.withType(JavaCompile) {
def version = compat(sourceCompatibility)
logger.info("Configuring $name to use --release $version")
options.compilerArgs.addAll(['--release', version])
}
}
}
// Set up Java override if configured (used to test with Java 7).
def targetJavaHome = System.getenv("TARGET_JAVA_HOME")
if (targetJavaHome) {
if (JavaVersion.current().java9Compatible) {
throw new GradleException("Only set TARGET_JAVA_HOME with JDK 8")
}
project.afterEvaluate {
logger.info("Target Java home set to ${targetJavaHome}")
logger.info("Configuring Gradle to use forked compilation and testing")
tasks.withType(JavaCompile) {
options.fork = true
options.forkOptions.javaHome = file(targetJavaHome)
}
tasks.withType(Javadoc) {
executable = javaExecutable(targetJavaHome, "javadoc")
}
tasks.withType(Test) {
executable = javaExecutable(targetJavaHome, "java")
}
tasks.withType(JavaExec) {
executable = javaExecutable(targetJavaHome, "java")
}
}
}
}
task codeCoverageReport(type: JacocoReport) {
dependsOn(subprojects.test)
dependsOn(javaProjects.test)
jacocoClasspath = project(':core').configurations.jacocoAnt
additionalSourceDirs.from(files(subprojects.sourceSets.main.allSource.srcDirs))
sourceDirectories.from(files(subprojects.sourceSets.main.allSource.srcDirs))
classDirectories.from(files(subprojects.sourceSets.main.output))
executionData.from(files(subprojects.jacocoTestReport.executionData))
additionalSourceDirs.from(files(javaProjects.sourceSets.main.allSource.srcDirs))
sourceDirectories.from(files(javaProjects.sourceSets.main.allSource.srcDirs))
classDirectories.from(files(javaProjects.sourceSets.main.output))
executionData.from(files(javaProjects.jacocoTestReport.executionData))
doFirst {
executionData = files(executionData.findAll { it.exists() })

View File

@@ -32,8 +32,6 @@
<echo message=" bbLauncher: build the Browser Bundle router launcher" />
<echo message=" bundle: (GIT ONLY!) generate a git bundle and a corresponding torrent." />
<echo message=" tarball: tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
<echo message=" git-bundle: (GIT ONLY!) generate a git bundle and a corresponding torrent." />
<!--<echo message=" bundleRelease: (GIT ONLY!) generate a git bundle only up to the most recent tag, and a corresponding torrent." />-->
<echo message=" updater: Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
<echo message=" updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
<echo message=" signed-updater200: Signed updater compressed with pack200 (creates i2pupdate.su3, 60% smaller)" />
@@ -774,7 +772,6 @@
<jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
<fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
@@ -790,7 +787,6 @@
<jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
<fileset dir="installer/lib/jbigi" includes="*.so *.jnilib" />
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
@@ -806,7 +802,6 @@
<jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
<fileset dir="installer/lib/jbigi" includes="*bsd*.so" />
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
@@ -821,7 +816,6 @@
<jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
<fileset dir="installer/lib/jbigi" includes="*linux*.so" />
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
@@ -836,7 +830,6 @@
<jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
<fileset dir="installer/lib/jbigi" includes="*linux*.so" excludes="*linux-arm*.so,*linux-ppc*.so" />
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
@@ -851,7 +844,6 @@
<jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
<fileset dir="installer/lib/jbigi" includes="*linux*_64.so libjcpuid-x86_64-linux.so" excludes="*linux-arm*.so,*linux-ppc*.so" />
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
@@ -866,7 +858,6 @@
<jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
<fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
@@ -881,7 +872,6 @@
<jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
<fileset dir="installer/lib/jbigi" includes="*.jnilib" />
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
@@ -897,7 +887,6 @@
<jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
<fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
@@ -1500,7 +1489,7 @@
<target name="copyflags" depends="copyflags-unlesspkg" >
<copy todir="pkg-temp/eepsite/docroot/help/lib/" >
<fileset dir="apps/routerconsole/resources/docs/icons/flags16x11" includes="lang_ar.png" />
<fileset dir="installer/resources/icons/flags16x11" includes="lang_ar.png" />
</copy>
</target>
@@ -1509,7 +1498,7 @@
<fileset dir="installer/resources/icons/flags/" includes="az.png cn.png de.png es.png fr.png hu.png id.png ir.png it.png jp.png nl.png pl.png pt.png ro.png ru.png se.png tr.png us.png" />
</copy>
<copy todir="pkg-temp/docs/icons/flags" >
<!-- base flags/ dir only. flags16x11/ dir now in the war -->
<!-- base flags/ dir only. flags16x11/ dir already copied by prepConsoleDocs target -->
<fileset dir="installer/resources/icons/flags" />
</copy>
</target>
@@ -1661,8 +1650,29 @@
<delete dir="./pkg-mavencentral" />
</target>
<!-- GeoIP file -->
<target name="prepConsoleDocs" depends="prepgeoupdate" >
<!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
<target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
<copy todir="pkg-temp/docs/initialNews/">
<fileset dir="installer/resources/initialNews/" />
</copy>
<!-- ensure the proxy files have the correct line endings -->
<fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
</target>
<!-- readme and proxy error page files -->
<target name="prepConsoleDocUpdates">
<copy todir="pkg-temp/docs/" >
<fileset dir="installer/resources/readme/" includes="readme*.html" />
<fileset dir="installer/resources/proxy/" includes="*.ht" />
<!--
As of 0.9.36:
All new and changed flags must go in the flags16x11/ dir,
which will be checked first by flags.jsp.
The flags/ dir is the original set from famfamfam,
which may be symlinked in package installs.
-->
<fileset dir="installer/resources/" includes="icons/flags16x11/*" />
</copy>
</target>
<target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
@@ -1784,7 +1794,7 @@
</exec>
</target>
<target name="prepupdate" depends="build2, prepupdateSmall, prepCertificates, prep-script-translation, truncatehistory">
<target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation, truncatehistory">
<copy file="build/BOB.jar" todir="pkg-temp/lib/" />
<copy file="build/sam.jar" todir="pkg-temp/lib/" />
<copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
@@ -1833,6 +1843,9 @@
<copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
<copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
<copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
<!-- decapitalized the file in 0.7.8 -->
<copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
<copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
<!--
<copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
-->
@@ -1850,6 +1863,8 @@
<!-- GeoIP files -->
<target name="prepgeoupdate" depends="prepgeoupdate-unlesspkg" >
<copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
<copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
<!--
<copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
-->
@@ -3079,11 +3094,16 @@
<copy file="apps/addressbook/myhosts.txt" todir="pkg-temp/addressbook/" />
<!-- config.txt is in installer/resources/portable -->
<mkdir dir="pkg-temp/docs" />
<copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
<copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
<copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
<copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
<copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
<!-- HTTP Header files, english only,
if you need a different lang do it in a seperate target -->
<copy todir="pkg-temp/docs/" >
<fileset dir="installer/resources/proxy/" includes="**-header.ht" />
</copy>
<!-- Theme light only -->
<copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
<fileset dir="installer/resources/themes/console/light/" includes="**.css" />
@@ -3127,7 +3147,7 @@
<checksum file="portable-win32.zip" forceOverwrite="yes"/>
<move file="portable" tofile="pkg-temp"/>
</target>
<target name="git-bundle" depends="pkg">
<target name="bundle" depends="pkg">
<exec executable="git" failonerror="true">
<arg value="bundle" />
<arg value="create" />

View File

@@ -10,7 +10,6 @@ sourceSets {
main {
java {
srcDir 'java/src'
srcDir 'java/build/messages-src'
exclude 'gnu/getopt'
exclude 'gnu/gettext'
}
@@ -68,26 +67,12 @@ if (System.getenv("TARGET_JAVA_HOME") == null && JavaVersion.current() != JavaVe
test.dependsOn scalaTest
}
// Create the java files from the po files. The jar task will compile them.
// This requires gettext 0.19 or higher.
// We don't support the "slow way"
task bundle {
doLast {
if (!(new File("$buildDir/classes/java/main/net/i2p/util/messages_de.class")).exists())
println "core/java/bundle-messages.sh".execute().text
}
}
jar.dependsOn bundle
jar {
manifest {
attributes 'Specification-Title': 'I2P Core API'
attributes 'Implementation-Title': 'I2P Java Core API'
attributes 'Main-Class': 'net.i2p.util.CommandLine'
}
from ('resources', {
into "net/i2p/util/resources"
})
}
configurations {

8
core/java/.classpath Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test/junit"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="build/obj"/>
</classpath>

31
core/java/.project Normal file
View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>i2p_sdk</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/core-makejar.launch</value>
</dictionary>
<dictionary>
<key>incclean</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -109,12 +109,9 @@
<target name="jar" depends="compile, bundle, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
<!-- set if unset -->
<property name="workspace.changes.tr" value="" />
<mkdir dir="build/obj/net/i2p/util/resources" />
<copy todir="build/obj/net/i2p/util/resources" >
<fileset dir="../resources" />
</copy>
<jar destfile="./build/i2p.jar" >
<fileset dir="./build/obj" />
<fileset dir="./build/obj" includes="**/*.class" />
<fileset dir="./src" includes="net/i2p/util/resources/*" />
<!-- the getopt translation files -->
<fileset dir="src" includes="${translation.includes}" />
<manifest>

View File

@@ -10,7 +10,6 @@
#
# zzz - public domain
#
cd `dirname $0`
CLASS=net.i2p.util.messages
TMPFILE=build/javafiles.txt
export TZ=UTC

View File

@@ -99,8 +99,14 @@ class RequestLeaseSetMessageHandler extends HandlerImpl {
protected boolean requiresLS2(I2PSessionImpl session) {
if (!session.supportsLS2())
return false;
// we do this check first because we must set _ls2Type regardless
String s = session.getOptions().getProperty(PROP_LS_TYPE);
if (session.isOffline())
return true;
String s = session.getOptions().getProperty(PROP_LS_ENCTYPE);
if (s != null) {
if (!s.equals("0") && !s.equals("ELGAMAL_2048"))
return true;
}
s = session.getOptions().getProperty(PROP_LS_TYPE);
if (s != null) {
try {
int type = Integer.parseInt(s);
@@ -113,13 +119,6 @@ class RequestLeaseSetMessageHandler extends HandlerImpl {
return true;
}
}
if (session.isOffline())
return true;
s = session.getOptions().getProperty(PROP_LS_ENCTYPE);
if (s != null) {
if (!s.equals("0") && !s.equals("ELGAMAL_2048"))
return true;
}
return false;
}

View File

@@ -12,7 +12,6 @@ package net.i2p.crypto;
import java.security.InvalidKeyException;
// for using system version
import java.util.concurrent.LinkedBlockingQueue;
import java.security.GeneralSecurityException;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
@@ -38,21 +37,14 @@ import net.i2p.util.SystemVersion;
* @author jrandom, thecrypto
*/
public final class CryptixAESEngine extends AESEngine {
private final LinkedBlockingQueue<Cipher> _ciphers;
private final static CryptixRijndael_Algorithm _algo = new CryptixRijndael_Algorithm();
// keys are now cached in the SessionKey objects
//private CryptixAESKeyCache _cache;
/** see test results below */
private static final int MIN_SYSTEM_AES_LENGTH = 640;
private static final int MIN_SYSTEM_AES_LENGTH = 704;
private static final boolean USE_SYSTEM_AES = hasAESNI() && CryptoCheck.isUnlimited();
private static final boolean CACHE = true;
private static final int CACHE_SIZE = 8;
private static final SecretKeySpec ZERO_KEY = new SecretKeySpec(new byte[32], "AES");
private static final IvParameterSpec ZERO_IV = new IvParameterSpec(new byte[16], 0, 16);
/**
* Do we have AES-NI support in the processor and JVM?
* Only on 64-bit x86 Java 7 fast JVMs, with AES-NI support.
@@ -75,9 +67,6 @@ public final class CryptixAESEngine extends AESEngine {
/** */
public CryptixAESEngine(I2PAppContext context) {
super(context);
// testing
//_ciphers = new LinkedBlockingQueue<Cipher>(CACHE_SIZE);
_ciphers = USE_SYSTEM_AES ? new LinkedBlockingQueue<Cipher>(CACHE_SIZE) : null;
//_cache = new CryptixAESKeyCache();
}
@@ -117,10 +106,9 @@ public final class CryptixAESEngine extends AESEngine {
try {
SecretKeySpec key = new SecretKeySpec(sessionKey.getData(), "AES");
IvParameterSpec ivps = new IvParameterSpec(iv, ivOffset, 16);
Cipher cipher = acquire();
Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
cipher.init(Cipher.ENCRYPT_MODE, key, ivps, _context.random());
cipher.doFinal(payload, payloadIndex, length, out, outIndex);
release(cipher);
return;
} catch (GeneralSecurityException gse) {
if (_log.shouldLog(Log.WARN))
@@ -165,10 +153,9 @@ public final class CryptixAESEngine extends AESEngine {
try {
SecretKeySpec key = new SecretKeySpec(sessionKey.getData(), "AES");
IvParameterSpec ivps = new IvParameterSpec(iv, ivOffset, 16);
Cipher cipher = acquire();
Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
cipher.init(Cipher.DECRYPT_MODE, key, ivps, _context.random());
cipher.doFinal(payload, payloadIndex, length, out, outIndex);
release(cipher);
return;
} catch (GeneralSecurityException gse) {
if (_log.shouldLog(Log.WARN))
@@ -263,38 +250,10 @@ public final class CryptixAESEngine extends AESEngine {
CryptixRijndael_Algorithm.blockDecrypt(payload, rv, inIndex, outIndex, pkey);
}
/**
* @return cached or new
* @since 0.9.49
*/
private Cipher acquire() {
Cipher rv = _ciphers.poll();
if (rv == null) {
try {
rv = Cipher.getInstance("AES/CBC/NoPadding");
} catch (GeneralSecurityException e) {
throw new UnsupportedOperationException("AES/CBC/NoPadding", e);
}
}
return rv;
}
/**
* Cipher will be initialized with a zero key and IV.
*
* @since 0.9.49
*/
private void release(Cipher cipher) {
if (CACHE) {
try {
cipher.init(Cipher.DECRYPT_MODE, ZERO_KEY, ZERO_IV, _context.random());
} catch (GeneralSecurityException e) {
return;
}
_ciphers.offer(cipher);
}
}
/******
private static final int MATCH_RUNS = 11000;
private static final int TIMING_RUNS = 100000;
******/
/**
* Test results 10K timing runs.
@@ -327,8 +286,6 @@ public final class CryptixAESEngine extends AESEngine {
*/
/*******
public static void main(String args[]) {
final int MATCH_RUNS = 11000;
final int TIMING_RUNS = 100000;
I2PAppContext ctx = I2PAppContext.getGlobalContext();
try {
boolean canTestSystem = USE_SYSTEM_AES;

View File

@@ -36,8 +36,7 @@ import net.i2p.data.DataHelper;
*
* Warning - not thread-safe. Create new instances as necessary.
*
* As of 0.9.49, this supports the RFC 8484 (DNS) format only.
* Does NOT support the JSON format (used prior to 0.9.49)
* This supports the JSON format only. Does NOT support RFC 8484 (DNS format)
* or RFC 7858 (DNS over TLS).
*
* https://developers.google.com/speed/public-dns/docs/dns-over-https

View File

@@ -433,15 +433,20 @@ public class I2PSSLSocketFactory {
*/
private static void addCountries(I2PAppContext ctx, List<String> tlds) {
Log log = ctx.logManager().getLog(I2PSSLSocketFactory.class);
InputStream is = I2PSSLSocketFactory.class.getResourceAsStream("/net/i2p/util/resources/" + COUNTRY_FILE_DEFAULT);
if (is == null) {
String geoDir = ctx.getProperty(PROP_GEOIP_DIR, GEOIP_DIR_DEFAULT);
File geoFile = new File(geoDir);
if (!geoFile.isAbsolute())
geoFile = new File(ctx.getBaseDir(), geoDir);
geoFile = new File(geoFile, COUNTRY_FILE_DEFAULT);
if (!geoFile.exists()) {
if (log.shouldWarn())
log.warn("Country file not found");
log.warn("Country file not found: " + geoFile.getAbsolutePath());
return;
}
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
br = new BufferedReader(new InputStreamReader(
new FileInputStream(geoFile), "UTF-8"));
String line = null;
int i = 0;
while ( (line = br.readLine()) != null) {
@@ -455,11 +460,10 @@ public class I2PSSLSocketFactory {
} catch (IndexOutOfBoundsException ioobe) {}
}
if (log.shouldInfo())
log.info("Loaded " + i + " TLDs from " + COUNTRY_FILE_DEFAULT);
log.info("Loaded " + i + " TLDs from " + geoFile.getAbsolutePath());
} catch (IOException ioe) {
log.error("Error reading the Country File", ioe);
} finally {
try { is.close(); } catch (IOException ioe) {}
if (br != null) try { br.close(); } catch (IOException ioe) {}
}
}

View File

@@ -9,6 +9,7 @@ pkg-temp/clients.config usr/share/i2p
pkg-temp/docs usr/share/i2p/
pkg-temp/eepget usr/bin
pkg-temp/eepsite usr/share/i2p
pkg-temp/geoip usr/share/i2p
pkg-temp/hosts.txt usr/share/i2p
pkg-temp/i2prouter-nowrapper usr/bin
pkg-temp/i2psnark.config usr/share/i2p

View File

@@ -9,6 +9,7 @@ pkg-temp/clients.config usr/share/i2p
pkg-temp/docs usr/share/i2p/
pkg-temp/eepget usr/bin
pkg-temp/eepsite usr/share/i2p
pkg-temp/geoip usr/share/i2p
pkg-temp/hosts.txt usr/share/i2p
pkg-temp/i2prouter-nowrapper usr/bin
pkg-temp/i2psnark.config usr/share/i2p

View File

@@ -9,6 +9,7 @@ pkg-temp/clients.config usr/share/i2p
pkg-temp/docs usr/share/i2p/
pkg-temp/eepget usr/bin
pkg-temp/eepsite usr/share/i2p
pkg-temp/geoip usr/share/i2p
pkg-temp/hosts.txt usr/share/i2p
pkg-temp/i2prouter-nowrapper usr/bin
pkg-temp/i2psnark.config usr/share/i2p

View File

@@ -9,6 +9,7 @@ pkg-temp/clients.config usr/share/i2p
pkg-temp/docs usr/share/i2p/
pkg-temp/eepget usr/bin
pkg-temp/eepsite usr/share/i2p
pkg-temp/geoip usr/share/i2p
pkg-temp/hosts.txt usr/share/i2p
pkg-temp/i2prouter-nowrapper usr/bin
pkg-temp/i2psnark.config usr/share/i2p

2
debian/control vendored
View File

@@ -78,7 +78,7 @@ Architecture: all
Section: net
Priority: optional
Depends: ${misc:Depends}, ${java:Depends}, ${shlibs:Depends},
openjdk-16-jre-headless | openjdk-15-jre-headless | openjdk-14-jre-headless | openjdk-13-jre-headless | openjdk-12-jre-headless | openjdk-11-jre-headless | default-jre-headless | java16-runtime-headless | java15-runtime-headless | java14-runtime-headless | java13-runtime-headless | java12-runtime-headless | java11-runtime-headless,
openjdk-14-jre-headless | openjdk-13-jre-headless | openjdk-12-jre-headless | openjdk-11-jre-headless | default-jre-headless | java14-runtime-headless | java13-runtime-headless | java12-runtime-headless | java11-runtime-headless,
geoip-database,
gettext-base,
libgetopt-java,

View File

@@ -9,6 +9,7 @@ pkg-temp/clients.config usr/share/i2p
pkg-temp/docs usr/share/i2p/
pkg-temp/eepget usr/bin
pkg-temp/eepsite usr/share/i2p
pkg-temp/geoip usr/share/i2p
pkg-temp/hosts.txt usr/share/i2p
pkg-temp/i2prouter-nowrapper usr/bin
pkg-temp/i2psnark.config usr/share/i2p

View File

@@ -159,3 +159,20 @@ Index: i2p-0.9.45/apps/routerconsole/java/src/edu/internet2/ndt/JSONUtils.java
/**
* Created by Sebastian Malecki on 13.05.14.
Index: i2p-0.9.45/core/java/src/net/i2p/util/DNSOverHTTPS.java
===================================================================
--- i2p-0.9.45.orig/core/java/src/net/i2p/util/DNSOverHTTPS.java
+++ i2p-0.9.45/core/java/src/net/i2p/util/DNSOverHTTPS.java
@@ -12,9 +12,9 @@ import java.util.Map;
import gnu.getopt.Getopt;
-import org.json.simple.JsonArray;
-import org.json.simple.JsonObject;
-import org.json.simple.Jsoner;
+import @JSON_SIMPLE@.JsonArray;
+import @JSON_SIMPLE@.JsonObject;
+import @JSON_SIMPLE@.Jsoner;
import net.i2p.I2PAppContext;
import net.i2p.data.DataHelper;

Some files were not shown because too many files have changed in this diff Show More