forked from I2P_Developers/i2p.i2p
Compare commits
126 Commits
release-gi
...
build-debi
| Author | SHA1 | Date | |
|---|---|---|---|
| c0a0aa7700 | |||
| 4a9131c39d | |||
| b47269f14e | |||
| fb317b44ba | |||
| e64e12b3fb | |||
| f71e59a049 | |||
| 169fb59d7d | |||
|
|
922178b2c7 | ||
|
|
74a9193ba5 | ||
|
|
335409f1d2 | ||
|
|
d6edb9e96c | ||
| f150855f1c | |||
|
|
655ce09796 | ||
|
|
91ebec15d5 | ||
|
|
b17d321503 | ||
|
|
a6398d88a9 | ||
|
|
59969db16c | ||
|
|
b68a5ea7fd | ||
|
|
c2234685b9 | ||
|
|
ce7daaa02a | ||
|
|
b19999f95a | ||
|
|
92ecc9f8e8 | ||
|
|
aa2ba92db8 | ||
|
|
5f3c41244b | ||
|
|
bf29132898 | ||
|
|
a424331b78 | ||
|
|
ccb0c279f7 | ||
|
|
7fe01fb9a7 | ||
|
|
66c4c10a78 | ||
|
|
163967311e | ||
|
|
75734448c5 | ||
|
|
aed1de84b8 | ||
|
|
51560a8ec8 | ||
|
|
ec89a80e80 | ||
|
|
41c7b7382a | ||
|
|
b4e1fbd857 | ||
|
|
517ff4fa24 | ||
|
|
106b1a696d | ||
|
|
6cab545c45 | ||
|
|
619923dbf8 | ||
|
|
ed0ecdf253 | ||
|
|
d42ef2223d | ||
|
|
e461004ed9 | ||
|
|
2e180d4c60 | ||
|
|
152ad1659b | ||
|
|
888311e34f | ||
|
|
2df5fb972a | ||
|
|
a481255adb | ||
|
|
139594df8f | ||
|
|
659ab97f69 | ||
|
|
963a4fe89c | ||
|
|
4c4dbae107 | ||
|
|
6978049416 | ||
|
|
46fe1ba74a | ||
|
|
13bd5e4938 | ||
|
|
bbacf85245 | ||
|
|
68f011f344 | ||
|
|
8bd2384ac8 | ||
|
|
54dda1a15f | ||
|
|
3f44a555ba | ||
|
|
86cbb2ed4e | ||
|
|
2569123055 | ||
|
|
afa4b9e66d | ||
|
|
67bd5a32fd | ||
|
|
ada3629507 | ||
|
|
dcb7314306 | ||
|
|
e3c2ad6354 | ||
|
|
178ea252d5 | ||
|
|
7e4ba4eb31 | ||
|
|
de43de17f6 | ||
|
|
2ceb9c429a | ||
|
|
0b59f53fe9 | ||
|
|
62fce859b9 | ||
|
|
9fc97764c5 | ||
|
|
2813d9412d | ||
|
|
a0bf76a4b1 | ||
|
|
d2a79e8837 | ||
|
|
738ef496d4 | ||
|
|
a2734ffa72 | ||
|
|
8606d30e9a | ||
|
|
a45084cfc3 | ||
|
|
eeaf6f3514 | ||
|
|
9e18ff1cd1 | ||
|
|
665239fd37 | ||
|
|
12f9a7187e | ||
|
|
8835351b99 | ||
|
|
a3c44912f2 | ||
|
|
db9f735376 | ||
|
|
875a7242d4 | ||
|
|
51ecdc64a4 | ||
|
|
7b785ea454 | ||
|
|
8f5fc44755 | ||
|
|
010dbfa6f2 | ||
|
|
e20a19c358 | ||
|
|
387e513949 | ||
|
|
5e005e6520 | ||
|
|
e88f40cd95 | ||
|
|
82e93a53a3 | ||
| fee5668c1c | |||
|
|
abb8cbe75d | ||
|
|
340df51429 | ||
|
|
bec8feb05a | ||
|
|
d86ccded53 | ||
|
|
db7d92a5cd | ||
|
|
30ffdd03c7 | ||
| 251d8de943 | |||
|
|
5e8de68746 | ||
|
|
8ae29c8c00 | ||
|
|
542efa0d9a | ||
|
|
23c80accfa | ||
|
|
b909430725 | ||
|
|
20b413bc67 | ||
|
|
a9b6b86183 | ||
|
|
66b724759d | ||
|
|
56059448c5 | ||
|
|
1c52eeb910 | ||
|
|
4aefe4bf7a | ||
|
|
b9444cdc51 | ||
|
|
eb72e4c9f5 | ||
|
|
aa181ee43f | ||
|
|
ab04f92072 | ||
|
|
0830329eaf | ||
|
|
2d154cc90e | ||
|
|
183280871f | ||
|
|
067ee80ba0 | ||
|
|
1154d28be7 |
31
.dockerignore
Normal file
31
.dockerignore
Normal file
@@ -0,0 +1,31 @@
|
||||
.idea
|
||||
.git
|
||||
Dockerfile
|
||||
|
||||
|
||||
# Gradle
|
||||
.gradle
|
||||
build
|
||||
apps/BOB/build
|
||||
apps/addressbook/build
|
||||
apps/desktopgui/build
|
||||
apps/i2pcontrol/build
|
||||
apps/i2psnark/build
|
||||
apps/i2ptunnel/build
|
||||
apps/imagegen/build
|
||||
apps/jetty/build
|
||||
apps/jrobin/build
|
||||
apps/ministreaming/java/build
|
||||
apps/ministreaming/build
|
||||
apps/routerconsole/build
|
||||
apps/sam/build
|
||||
apps/streaming/build
|
||||
apps/susidns/build
|
||||
apps/susimail/build
|
||||
apps/systray/build
|
||||
core/java/build
|
||||
core/build
|
||||
installer/build
|
||||
router/java/build
|
||||
router/build
|
||||
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -54,4 +54,10 @@ sloccount.sc
|
||||
.settings/
|
||||
# IDEA
|
||||
*.iml
|
||||
.idea
|
||||
|
||||
# Gradle
|
||||
.gradle
|
||||
|
||||
# TODO: why does this file appear?
|
||||
apps/routerconsole/jsp/favicon.ico
|
||||
|
||||
66
.gitlab-ci.yml
Normal file
66
.gitlab-ci.yml
Normal file
@@ -0,0 +1,66 @@
|
||||
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
|
||||
|
||||
# Make sure we can build a docker image
|
||||
# It's cached for later jobs
|
||||
build_docker:
|
||||
stage: test
|
||||
image: docker:19.03.12
|
||||
services:
|
||||
- docker:19.03.12-dind
|
||||
script:
|
||||
# Try to load latest branch image from local tar or from registry
|
||||
- docker load -i ci-exports/$CI_COMMIT_REF_SLUG.tar || docker pull $CI_REGISTRY_IMAGE:latest || true
|
||||
- docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:latest .
|
||||
- mkdir -p ci-exports/
|
||||
- docker save $CI_REGISTRY_IMAGE:latest > ci-exports/$CI_COMMIT_REF_SLUG.tar
|
||||
variables:
|
||||
# When using dind service, we need to instruct docker to talk with
|
||||
# the daemon started inside of the service. The daemon is available
|
||||
# with a network connection instead of the default
|
||||
# /var/run/docker.sock socket. Docker 19.03 does this automatically
|
||||
# by setting the DOCKER_HOST in
|
||||
# https://github.com/docker-library/docker/blob/d45051476babc297257df490d22cbd806f1b11e4/19.03/docker-entrypoint.sh#L23-L29
|
||||
#
|
||||
# The 'docker' hostname is the alias of the service container as described at
|
||||
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services.
|
||||
#
|
||||
# Specify to Docker where to create the certificates, Docker will
|
||||
# create them automatically on boot, and will create
|
||||
# `/certs/client` that will be shared between the service and job
|
||||
# container, thanks to volume mount from config.toml
|
||||
DOCKER_TLS_CERTDIR: "/certs"
|
||||
# Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
|
||||
DOCKER_HOST: tcp://docker:2376
|
||||
cache:
|
||||
# The same key should be used across branches
|
||||
key: "$CI_COMMIT_REF_SLUG"
|
||||
paths:
|
||||
- ci-exports/*.tar
|
||||
only:
|
||||
- master
|
||||
- merge_requests
|
||||
- tags
|
||||
|
||||
6
.idea/ant.xml
generated
6
.idea/ant.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?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
41
.idea/compiler.xml
generated
@@ -1,41 +0,0 @@
|
||||
<?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
3
.idea/copyright/profiles_settings.xml
generated
@@ -1,3 +0,0 @@
|
||||
<component name="CopyrightManager">
|
||||
<settings default="" />
|
||||
</component>
|
||||
@@ -1,9 +0,0 @@
|
||||
<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
22
.idea/libraries/jettylib.xml
generated
@@ -1,22 +0,0 @@
|
||||
<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
9
.idea/libraries/jrobin_1_5_9_1.xml
generated
@@ -1,9 +0,0 @@
|
||||
<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
10
.idea/libraries/lib.xml
generated
@@ -1,10 +0,0 @@
|
||||
<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
9
.idea/libraries/start.xml
generated
@@ -1,9 +0,0 @@
|
||||
<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
9
.idea/libraries/systray4j.xml
generated
@@ -1,9 +0,0 @@
|
||||
<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
9
.idea/libraries/tomcat_coyote_util.xml
generated
@@ -1,9 +0,0 @@
|
||||
<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
12
.idea/libraries/tomcat_lib.xml
generated
@@ -1,12 +0,0 @@
|
||||
<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
9
.idea/libraries/wrapper.xml
generated
@@ -1,9 +0,0 @@
|
||||
<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
9
.idea/libraries/wrapper_win.xml
generated
@@ -1,9 +0,0 @@
|
||||
<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
57
.idea/misc.xml
generated
@@ -1,57 +0,0 @@
|
||||
<?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
80
.idea/modules.xml
generated
@@ -1,80 +0,0 @@
|
||||
<?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
6
.idea/runConfigurations/updater.xml
generated
@@ -1,6 +0,0 @@
|
||||
<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>
|
||||
16
.travis.yml
16
.travis.yml
@@ -1,17 +1,17 @@
|
||||
language: java
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
|
||||
jdk:
|
||||
- oraclejdk11
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- jdk: oraclejdk8
|
||||
- jdk: oraclejdk11
|
||||
addons:
|
||||
sonarcloud:
|
||||
organization: "i2p"
|
||||
before_install:
|
||||
- sed -i "1iplugins {\n id 'org.sonarqube' version '2.6.1'\n}\n" build.gradle
|
||||
- sed -i "1iplugins {\n id 'org.sonarqube' version '3.0'\n}\n" build.gradle
|
||||
- jdk: openjdk8
|
||||
|
||||
before_cache:
|
||||
@@ -24,13 +24,11 @@ cache:
|
||||
- $HOME/.sonar/cache/
|
||||
- .gradle
|
||||
|
||||
env:
|
||||
- SONAR_SCANNER_OPTS="-Xmx2048m"
|
||||
|
||||
script:
|
||||
- |
|
||||
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ]; then
|
||||
./gradlew sonarqube codeCoverageReport
|
||||
else
|
||||
./gradlew check codeCoverageReport
|
||||
fi
|
||||
- travis_wait 45 ./tests/scripts/travis.sh
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
26
.tx/config
26
.tx/config
@@ -619,21 +619,21 @@ trans.tr_TR = installer/resources/eepsite/docroot/help/index_tr.html
|
||||
;; Text on /console
|
||||
;;
|
||||
type = HTML
|
||||
source_file = installer/resources/readme/readme.html
|
||||
source_file = apps/routerconsole/resources/docs/readme.html
|
||||
source_lang = en
|
||||
trans.ar = installer/resources/readme/readme_ar.html
|
||||
trans.de = installer/resources/readme/readme_de.html
|
||||
trans.fr = installer/resources/readme/readme_fr.html
|
||||
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
|
||||
;; Java converts id to in
|
||||
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
|
||||
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
|
||||
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
export JAVA_HOME=/opt/jdk/jre
|
||||
|
||||
# Ensure user rights
|
||||
chown -R i2p:nobody /opt/i2p
|
||||
chmod -R u+rwx /opt/i2p
|
||||
|
||||
gosu i2p /opt/i2p/i2psvc /opt/i2p/wrapper.config wrapper.pidfile=/var/tmp/i2p.pid \
|
||||
wrapper.name=i2p \
|
||||
wrapper.displayname="I2P Service" \
|
||||
wrapper.statusfile=/var/tmp/i2p.status \
|
||||
wrapper.java.statusfile=/var/tmp/i2p.java.status \
|
||||
wrapper.logfile=/var/tmp/wrapper.log
|
||||
80
Dockerfile
80
Dockerfile
@@ -1,62 +1,40 @@
|
||||
FROM meeh/java8server:latest
|
||||
# Docker image based on Alpine with Java.
|
||||
# Use a multi-stage build to reduce the size of the resulting image
|
||||
# We need alpine >v3 in order to install an apache-ant > 1.9
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
# We use Oracle Java to run I2P, but uses the openjdk to build it.
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Build installer
|
||||
RUN apt-get update \
|
||||
# Workaround for installing openjdk-11-jre-headless
|
||||
&& mkdir -p /usr/share/man/man1 \
|
||||
&& apt-get -qqqy install debhelper ant debconf gettext libgmp-dev po-debconf fakeroot \
|
||||
build-essential quilt dh-apparmor dh-systemd libservice-wrapper-java libjson-simple-java \
|
||||
devscripts libjetty9-java libtomcat9-java libtaglibs-standard-jstlel-java libgetopt-java \
|
||||
bash-completion
|
||||
|
||||
MAINTAINER Mikal Villa <mikal@sigterm.no>
|
||||
WORKDIR /tmp/build
|
||||
COPY . ./
|
||||
|
||||
ENV GIT_BRANCH="master"
|
||||
ENV I2P_PREFIX="/opt/i2p"
|
||||
ENV PATH=${I2P_PREFIX}/bin:$PATH
|
||||
ENV JAVA_HOME=/usr/lib/jvm/default-jvm
|
||||
RUN ant debian
|
||||
|
||||
ENV GOSU_VERSION=1.7
|
||||
ENV GOSU_SHASUM="34049cfc713e8b74b90d6de49690fa601dc040021980812b2f1f691534be8a50 /usr/local/bin/gosu"
|
||||
|
||||
RUN mkdir /user && adduser -S -h /user i2p && chown -R i2p:nobody /user
|
||||
|
||||
# Adding files first, since Docker.expt is required for installation
|
||||
ADD Docker.expt /tmp/Docker.expt
|
||||
ADD Docker.entrypoint.sh /entrypoint.sh
|
||||
|
||||
# Required for wget https
|
||||
RUN apk add --no-cache openssl
|
||||
# Gosu is a replacement for su/sudo in docker and not a backdoor :) See https://github.com/tianon/gosu
|
||||
RUN wget -O /usr/local/bin/gosu https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64 \
|
||||
&& echo "${GOSU_SHASUM}" | sha256sum -c && chmod +x /usr/local/bin/gosu
|
||||
|
||||
#
|
||||
# Each RUN is a layer, adding the dependencies and building i2pd in one layer takes around 8-900Mb, so to keep the
|
||||
# image under 200mb we need to remove all the build dependencies in the same "RUN" / layer.
|
||||
#
|
||||
|
||||
# The main layer
|
||||
RUN apk --no-cache add build-base git gettext tar bzip2 apache-ant openjdk8 expect \
|
||||
&& mkdir -p /usr/src/build \
|
||||
&& cd /usr/src/build \
|
||||
&& git clone -b ${GIT_BRANCH} https://github.com/i2p/i2p.i2p.git \
|
||||
&& cd /usr/src/build/i2p.i2p \
|
||||
&& echo "noExe=true" >> build.properties \
|
||||
&& ant installer-linux \
|
||||
&& cp i2pinstall*.jar /tmp/i2pinstall.jar \
|
||||
&& mkdir -p /opt \
|
||||
&& chown i2p:root /opt \
|
||||
&& chmod u+rw /opt \
|
||||
&& gosu i2p expect -f /tmp/Docker.expt \
|
||||
&& cd ${I2P_PREFIX} \
|
||||
&& rm -fr man docs *.bat *.command *.app /tmp/i2pinstall.jar /tmp/Docker.expt \
|
||||
&& rm -fr /usr/src/build \
|
||||
&& apk --purge del build-base apache-ant expect tcl expat git openjdk8 openjdk8-jre openjdk8-jre-base openjdk8-jre-lib bzip2 tar \
|
||||
binutils-libs binutils pkgconfig libcurl libc-dev musl-dev g++ make fortify-headers pkgconf giflib libssh2 libxdmcp libxcb \
|
||||
libx11 pcre alsa-lib libxi libxrender libxml2 readline bash openssl \
|
||||
&& rm -fr /usr/lib/jvm/default-jre \
|
||||
&& ln -sf /opt/jdk/jre /usr/lib/jvm/default-jre \
|
||||
&& chmod a+x /entrypoint.sh
|
||||
# Second stage only using the installer from the last stage
|
||||
# ---------------------------------------------------------
|
||||
# We can't use alpine here as the java service wrapper is built with glibc
|
||||
# alpine uses musl
|
||||
FROM openjdk:11.0-jre-slim
|
||||
|
||||
# "install" i2p by copying over installed files
|
||||
COPY --from=builder /tmp/*.deb /tmp/
|
||||
|
||||
# Install and configure
|
||||
RUN apt-get update -qqq \
|
||||
&& apt-get -qqqy install geoip-database famfamfam-flag-png \
|
||||
&& dpkb -i /tmp/*
|
||||
|
||||
EXPOSE 7654 7656 7657 7658 4444 6668 8998 7659 7660 4445 15000-20000
|
||||
|
||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
||||
USER i2psvc
|
||||
ENTRYPOINT [ "/usr/bin/i2prouter" ]
|
||||
CMD start
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class Daemon {
|
||||
* client applications.
|
||||
* @param published
|
||||
* The published AddressBook. This address book is published on
|
||||
* the user's eepsite so that others may subscribe to it.
|
||||
* the user's I2P Site so that others may subscribe to it.
|
||||
* May be null.
|
||||
* If non-null, overwrite with the new addressbook.
|
||||
* @param subscriptions
|
||||
@@ -111,7 +111,7 @@ class Daemon {
|
||||
* The NamingService to update, generally the root NamingService from the context.
|
||||
* @param published
|
||||
* The published AddressBook. This address book is published on
|
||||
* the user's eepsite so that others may subscribe to it.
|
||||
* the user's I2P Site so that others may subscribe to it.
|
||||
* May be null.
|
||||
* If non-null, overwrite with the new addressbook.
|
||||
* @param subscriptions
|
||||
|
||||
@@ -2,6 +2,7 @@ sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir 'src'
|
||||
srcDir 'build/messages-src'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,3 +13,14 @@ 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
|
||||
|
||||
@@ -86,6 +86,8 @@
|
||||
<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
Normal file → Executable file
1
apps/desktopgui/bundle-messages.sh
Normal file → Executable file
@@ -11,6 +11,7 @@
|
||||
# zzz - public domain
|
||||
# Mathiasdm - modifications for desktopgui
|
||||
#
|
||||
cd `dirname $0`
|
||||
CLASS=net.i2p.desktopgui.messages
|
||||
TMPFILE=build/javafiles.txt
|
||||
export TZ=UTC
|
||||
|
||||
22
apps/i2pcontrol/build.gradle
Normal file
22
apps/i2pcontrol/build.gradle
Normal file
@@ -0,0 +1,22 @@
|
||||
plugins {
|
||||
id 'war'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir 'java'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
providedCompile project(':router')
|
||||
providedCompile project(':apps:jetty')
|
||||
providedCompile files('../../installer/lib/wrapper/all/wrapper.jar')
|
||||
}
|
||||
|
||||
war {
|
||||
archiveName 'jsonrpc.war'
|
||||
webXml = file('web.xml')
|
||||
}
|
||||
@@ -55,7 +55,7 @@ import java.util.StringTokenizer;
|
||||
* This handles the starting and stopping of Jetty
|
||||
* from a single static class so it can be called via clients.config.
|
||||
*
|
||||
* This makes installation of a new eepsite a turnkey operation.
|
||||
* This makes installation of a new I2P Site a turnkey operation.
|
||||
*
|
||||
* Usage: I2PControlController -d $PLUGIN [start|stop]
|
||||
*
|
||||
|
||||
@@ -6,13 +6,14 @@ sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir 'java/src'
|
||||
srcDir 'java/build/messages-src'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':core')
|
||||
compile project(':apps:systray')
|
||||
providedCompile project(':apps:systray')
|
||||
compile 'gnu.getopt:java-getopt:1.0.13'
|
||||
providedCompile project(':apps:ministreaming')
|
||||
providedCompile project(':apps:jetty')
|
||||
@@ -34,10 +35,26 @@ artifacts {
|
||||
archives i2psnarkJar
|
||||
}
|
||||
|
||||
war {
|
||||
into '.icons', {
|
||||
from 'icons'
|
||||
// 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"
|
||||
})
|
||||
webInf {
|
||||
into 'classes/org/klomp/snark/web'
|
||||
from 'mime.properties'
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#
|
||||
# zzz - public domain
|
||||
#
|
||||
cd `dirname $0`
|
||||
CLASS=org.klomp.snark.web.messages
|
||||
TMPFILE=build/javafiles.txt
|
||||
export TZ=UTC
|
||||
|
||||
@@ -5,8 +5,10 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
@@ -57,7 +59,6 @@ public class I2PSnarkUtil {
|
||||
private int _i2cpPort;
|
||||
private final Map<String, String> _opts;
|
||||
private volatile I2PSocketManager _manager;
|
||||
private boolean _configured;
|
||||
private volatile boolean _connecting;
|
||||
private final Set<Hash> _banlist;
|
||||
private int _maxUploaders;
|
||||
@@ -84,6 +85,10 @@ public class I2PSnarkUtil {
|
||||
public static final String PROP_MAX_BW = "i2cp.outboundBytesPerSecond";
|
||||
public static final boolean DEFAULT_USE_DHT = true;
|
||||
public static final String EEPGET_USER_AGENT = "I2PSnark";
|
||||
private static final List<String> HIDDEN_I2CP_OPTS = Arrays.asList(new String[] {
|
||||
PROP_MAX_BW, "inbound.length", "outbound.length", "inbound.quantity", "outbound.quantity"
|
||||
});
|
||||
|
||||
|
||||
public I2PSnarkUtil(I2PAppContext ctx) {
|
||||
this(ctx, "i2psnark");
|
||||
@@ -142,25 +147,34 @@ public class I2PSnarkUtil {
|
||||
/** @since 0.9.1 */
|
||||
public I2PAppContext getContext() { return _context; }
|
||||
|
||||
public boolean configured() { return _configured; }
|
||||
|
||||
/**
|
||||
* @param i2cpHost may be null for no change
|
||||
* @param i2cpPort may be 0 for no change
|
||||
* @param opts may be null for no change
|
||||
*/
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void setI2CPConfig(String i2cpHost, int i2cpPort, Map opts) {
|
||||
if (i2cpHost != null)
|
||||
_i2cpHost = i2cpHost;
|
||||
if (i2cpPort > 0)
|
||||
_i2cpPort = i2cpPort;
|
||||
// can't remove any options this way...
|
||||
if (opts != null)
|
||||
_opts.putAll(opts);
|
||||
if (opts != null) {
|
||||
synchronized(_opts) {
|
||||
// removed options...
|
||||
for (Iterator<String> iter = _opts.keySet().iterator(); iter.hasNext(); ) {
|
||||
String k = iter.next();
|
||||
if (!HIDDEN_I2CP_OPTS.contains(k) && !opts.containsKey(k))
|
||||
iter.remove();
|
||||
}
|
||||
_opts.putAll(opts);
|
||||
}
|
||||
}
|
||||
// this updates the session options and tells the router
|
||||
setMaxUpBW(_maxUpBW);
|
||||
_configured = true;
|
||||
}
|
||||
|
||||
public void setMaxUploaders(int limit) {
|
||||
_maxUploaders = limit;
|
||||
_configured = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,13 +183,16 @@ public class I2PSnarkUtil {
|
||||
*/
|
||||
public void setMaxUpBW(int limit) {
|
||||
_maxUpBW = limit;
|
||||
_opts.put(PROP_MAX_BW, Integer.toString(limit * (1024 * 6 / 5))); // add a little for overhead
|
||||
_configured = true;
|
||||
synchronized(_opts) {
|
||||
_opts.put(PROP_MAX_BW, Integer.toString(limit * (1024 * 6 / 5))); // add a little for overhead
|
||||
}
|
||||
if (_manager != null) {
|
||||
I2PSession sess = _manager.getSession();
|
||||
if (sess != null) {
|
||||
Properties newProps = new Properties();
|
||||
newProps.putAll(_opts);
|
||||
synchronized(_opts) {
|
||||
newProps.putAll(_opts);
|
||||
}
|
||||
sess.updateOptions(newProps);
|
||||
}
|
||||
}
|
||||
@@ -183,17 +200,24 @@ public class I2PSnarkUtil {
|
||||
|
||||
public void setMaxConnections(int limit) {
|
||||
_maxConnections = limit;
|
||||
_configured = true;
|
||||
}
|
||||
|
||||
public void setStartupDelay(int minutes) {
|
||||
_startupDelay = minutes;
|
||||
_configured = true;
|
||||
}
|
||||
|
||||
public String getI2CPHost() { return _i2cpHost; }
|
||||
public int getI2CPPort() { return _i2cpPort; }
|
||||
public Map<String, String> getI2CPOptions() { return _opts; }
|
||||
|
||||
/**
|
||||
* @return a copy
|
||||
*/
|
||||
public Map<String, String> getI2CPOptions() {
|
||||
synchronized(_opts) {
|
||||
return new HashMap<String, String>(_opts);
|
||||
}
|
||||
}
|
||||
|
||||
public String getEepProxyHost() { return _proxyHost; }
|
||||
public int getEepProxyPort() { return _proxyPort; }
|
||||
public boolean getEepProxySet() { return _shouldProxy; }
|
||||
@@ -225,9 +249,8 @@ public class I2PSnarkUtil {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Connecting to I2P", new Exception("I did it"));
|
||||
Properties opts = _context.getProperties();
|
||||
if (_opts != null) {
|
||||
for (Map.Entry<String, String> entry : _opts.entrySet() )
|
||||
opts.setProperty(entry.getKey(), entry.getValue());
|
||||
synchronized(_opts) {
|
||||
opts.putAll(_opts);
|
||||
}
|
||||
// override preference and start with two tunnels. IdleChecker will ramp up/down as necessary
|
||||
String sin = opts.getProperty("inbound.quantity");
|
||||
|
||||
@@ -1068,7 +1068,8 @@ class PeerCoordinator implements PeerListener
|
||||
// just in case
|
||||
removePartialPiece(piece);
|
||||
// Oops. We didn't actually download this then... :(
|
||||
downloaded.addAndGet(0 - metainfo.getPieceLength(piece));
|
||||
// Reports of counter going negative?
|
||||
//downloaded.addAndGet(0 - metainfo.getPieceLength(piece));
|
||||
// Mark this peer as not having the piece. PeerState will update its bitfield.
|
||||
for (Piece pc : wantedPieces) {
|
||||
if (pc.getId() == piece) {
|
||||
|
||||
@@ -461,7 +461,7 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
*/
|
||||
private boolean writeTorrents(PrintWriter out, HttpServletRequest req, boolean canWrite) throws IOException {
|
||||
/** dl, ul, down rate, up rate, peers, size */
|
||||
final long stats[] = {0,0,0,0,0,0};
|
||||
final long stats[] = new long[6];
|
||||
String peerParam = req.getParameter("p");
|
||||
String stParam = req.getParameter("st");
|
||||
|
||||
@@ -2479,8 +2479,8 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
if (!_context.isRouterContext()) {
|
||||
try {
|
||||
// class only in standalone builds
|
||||
Class helper = Class.forName("org.klomp.snark.standalone.ConfigUIHelper");
|
||||
Method getLangSettings = helper.getMethod("getLangSettings", new Class[] {I2PAppContext.class});
|
||||
Class<?> helper = Class.forName("org.klomp.snark.standalone.ConfigUIHelper");
|
||||
Method getLangSettings = helper.getMethod("getLangSettings", I2PAppContext.class);
|
||||
String langSettings = (String) getLangSettings.invoke(null, _context);
|
||||
// If we get to here, we have the language settings
|
||||
out.write("<tr><td>");
|
||||
|
||||
@@ -6,6 +6,8 @@ sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir 'java/src'
|
||||
srcDir 'java/build/messages-src'
|
||||
srcDir 'java/build/messages-proxy-src'
|
||||
}
|
||||
}
|
||||
test {
|
||||
@@ -17,13 +19,31 @@ sourceSets {
|
||||
|
||||
dependencies {
|
||||
compile project(':core')
|
||||
compile project(':apps:ministreaming')
|
||||
providedCompile project(':apps:ministreaming')
|
||||
compile 'gnu.getopt:java-getopt:1.0.13'
|
||||
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'
|
||||
@@ -31,8 +51,21 @@ 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'
|
||||
@@ -41,6 +74,7 @@ task tempBeansJar(type: Jar) {
|
||||
baseName = 'temp-beans'
|
||||
}
|
||||
|
||||
// only for android
|
||||
task uiJar(type: Jar) {
|
||||
baseName = 'i2ptunnel-ui'
|
||||
from sourceSets.main.output
|
||||
@@ -51,12 +85,26 @@ 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')
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?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>
|
||||
@@ -86,7 +86,12 @@
|
||||
<target name="jar" depends="builddep, compile, bundle-proxy, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
|
||||
<!-- set if unset -->
|
||||
<property name="workspace.changes.j.tr" value="" />
|
||||
<jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" includes="**/*.class" excludes="**/ui/*.class **/web/*.class" >
|
||||
<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" >
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="net.i2p.i2ptunnel.I2PTunnel" />
|
||||
<attribute name="${manifest.classpath.name}" value="i2p.jar mstreaming.jar" />
|
||||
@@ -230,7 +235,7 @@
|
||||
<pathelement location="../../../build/i2p.jar" />
|
||||
</classpath>
|
||||
<arg value="tag" />
|
||||
<arg value="../../../installer/resources/proxy/" />
|
||||
<arg value="../resources/proxy/" />
|
||||
<arg value="build/Proxy.java" />
|
||||
</java>
|
||||
</target>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#
|
||||
# zzz - public domain
|
||||
#
|
||||
cd `dirname $0`
|
||||
CLASS=net.i2p.i2ptunnel.proxy.messages
|
||||
TMPFILE=build/javafiles-proxy.txt
|
||||
export TZ=UTC
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#
|
||||
# zzz - public domain
|
||||
#
|
||||
cd `dirname $0`
|
||||
CLASS=net.i2p.i2ptunnel.web.messages
|
||||
TMPFILE=build/javafiles.txt
|
||||
export TZ=UTC
|
||||
|
||||
@@ -291,10 +291,13 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
_socketManagerState = SocketManagerState.INIT;
|
||||
// We could be here a LONG time, holding the lock
|
||||
socketManager = buildSocketManager(tunnel, pkf);
|
||||
/*
|
||||
since we enabled ratchet by default, we're not compatible with ancient servers anyway.
|
||||
// FIXME may not be the right place for this
|
||||
I2PSession sub = addSubsession(tunnel);
|
||||
if (sub != null && _log.shouldLog(Log.WARN))
|
||||
_log.warn("Added subsession " + sub);
|
||||
*/
|
||||
} else {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info(tunnel.getClientOptions().getProperty("inbound.nickname") + ": Not building a new socket manager since the old one is open [s=" + s + "]");
|
||||
@@ -307,9 +310,15 @@ 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;
|
||||
}
|
||||
@@ -319,7 +328,9 @@ 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)
|
||||
|
||||
@@ -68,7 +68,7 @@ import net.i2p.util.PortMapper;
|
||||
* Rewrite as http://i2p/$b64key/...
|
||||
*
|
||||
* If the $site resolves with the I2P naming service, then it is directed towards
|
||||
* that eepsite, otherwise it is directed towards this client's outproxy (typically
|
||||
* that I2P Site, otherwise it is directed towards this client's outproxy (typically
|
||||
* "squid.i2p"). Only HTTP and HTTPS are supported (no ftp, mailto, etc). Both GET
|
||||
* and POST have been tested, though other $methods should work.
|
||||
*
|
||||
@@ -678,7 +678,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
|
||||
// allow i2paddresshelper=<b32>.b32.i2p syntax.
|
||||
/*
|
||||
also i2paddresshelper=name.i2p for aliases
|
||||
i.e. on your eepsite put
|
||||
i.e. on your I2P Site put
|
||||
<a href="?i2paddresshelper=name.i2p">This is the name I want to be called.</a>
|
||||
*/
|
||||
Destination _dest = _context.namingService().lookup(ahelperKey);
|
||||
@@ -1351,7 +1351,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
|
||||
}
|
||||
|
||||
// Redirect to non-addresshelper URL to not clog the browser address bar
|
||||
// and not pass the parameter to the eepsite.
|
||||
// and not pass the parameter to the I2P Site.
|
||||
// This also prevents the not-found error page from looking bad
|
||||
// Syndie can't handle a redirect of a POST
|
||||
if (ahelperPresent && !"POST".equals(method) && !"PUT".equals(method)) {
|
||||
|
||||
@@ -7,6 +7,7 @@ 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;
|
||||
@@ -40,6 +41,7 @@ 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;
|
||||
@@ -670,8 +672,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
|
||||
* @since 0.9.4 moved from I2PTunnelHTTPClient
|
||||
*/
|
||||
protected static String getErrorPage(I2PAppContext ctx, String base, String backup) {
|
||||
File errorDir = new File(ctx.getBaseDir(), "docs");
|
||||
File file = new File(errorDir, base + "-header.ht");
|
||||
String file = "proxy/" + base + "-header.ht";
|
||||
try {
|
||||
return readFile(ctx, file);
|
||||
} catch(IOException ioe) {
|
||||
@@ -683,20 +684,24 @@ 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, File file) throws IOException {
|
||||
private static String readFile(I2PAppContext ctx, String 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, new FileInputStream(file));
|
||||
reader = new TranslateReader(ctx, BUNDLE_NAME, in);
|
||||
} else {
|
||||
// strip out the addressbook links
|
||||
reader = new InputStreamReader(new FileInputStream(file), "UTF-8");
|
||||
reader = new InputStreamReader(in, "UTF-8");
|
||||
int len;
|
||||
while((len = reader.read(buf)) > 0) {
|
||||
out.append(buf, 0, len);
|
||||
@@ -734,6 +739,7 @@ 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();
|
||||
|
||||
@@ -218,6 +218,14 @@ 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
|
||||
@@ -375,6 +383,8 @@ 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()) {
|
||||
@@ -960,9 +970,6 @@ 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);
|
||||
|
||||
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -124,32 +125,30 @@ public abstract class LocalHTTPServer {
|
||||
if ((method.equals("GET") || method.equals("HEAD")) &&
|
||||
targetRequest.startsWith("/themes/") &&
|
||||
!targetRequest.contains("..")) {
|
||||
String filename = null;
|
||||
try {
|
||||
filename = targetRequest.substring(8); // "/themes/".length
|
||||
} catch (IndexOutOfBoundsException ioobe) {
|
||||
return;
|
||||
}
|
||||
String filename = targetRequest.substring(1);
|
||||
// theme hack
|
||||
if (filename.startsWith("console/default/"))
|
||||
if (filename.startsWith("themes/console/default/"))
|
||||
filename = filename.replaceFirst("default", context.getProperty("routerconsole.theme", "light"));
|
||||
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);
|
||||
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) {}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -483,6 +482,15 @@ 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";
|
||||
|
||||
|
||||
@@ -88,24 +88,53 @@ 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);
|
||||
}
|
||||
|
||||
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));
|
||||
/**
|
||||
* 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));
|
||||
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)) {
|
||||
//
|
||||
@@ -154,20 +183,8 @@ 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
|
||||
@@ -188,14 +205,13 @@ public class GeneralHelper {
|
||||
try {
|
||||
tcg.saveConfig(c);
|
||||
} catch (IOException ioe) {
|
||||
msgs.add("Failed to save initial tunnel config after creation " +
|
||||
cur.getName() + ", check logs:" + ioe);
|
||||
msgs.add(0, _t("Failed to save configuration", tcg.getContext()) + ": " + ioe);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return msgs;
|
||||
return cur;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,16 +256,35 @@ public class GeneralHelper {
|
||||
to.setConfig(cOpt, "");
|
||||
}
|
||||
|
||||
protected static List<String> saveConfig(
|
||||
I2PAppContext context, TunnelControllerGroup tcg, int tunnel) {
|
||||
/**
|
||||
* 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();
|
||||
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) {
|
||||
|
||||
@@ -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.")%>
|
||||
|
||||
<%=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)\".")%>
|
||||
<%=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\".")%>
|
||||
</p></div>
|
||||
<%
|
||||
boolean isInitialized = indexBean.isInitialized();
|
||||
|
||||
@@ -221,10 +221,6 @@ hr {
|
||||
padding: 7px 8px 3px;
|
||||
}
|
||||
|
||||
button.control, input.control {
|
||||
padding: 5px 8px !important;
|
||||
}
|
||||
|
||||
.control:hover, .control:focus {
|
||||
text-decoration: none;
|
||||
color: #19191f;
|
||||
@@ -659,7 +655,6 @@ 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;
|
||||
}
|
||||
@@ -961,7 +956,6 @@ input.tunnelName, input.tunnelDescriptionText, #userAgents, .freetext.tunnelDesc
|
||||
#customOptions {
|
||||
margin-top: 15px !important;
|
||||
width: 99%;
|
||||
width: calc(100% - 10px) !important;
|
||||
}
|
||||
|
||||
#tunnelDepth, #tunnelVariance, #tunnelQuantity, #tunnelBackupQuantity,
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
<%=intl._t("Try this if none of the tunnel types below fit your requirements, or you don't know what type of tunnel you need.")%>
|
||||
</td></tr>
|
||||
<tr><td>HTTP/HTTPS</td><td>
|
||||
<%=intl._t("Tunnel that acts as an HTTP proxy for reaching eepsites inside I2P.")%>
|
||||
<%=intl._t("Tunnel that acts as an HTTP proxy for reaching I2P Sites inside I2P.")%>
|
||||
<%=intl._t("Set your browser to use this tunnel as an http proxy, or set your \"http_proxy\" environment variable for command-line applications in GNU/Linux.")%>
|
||||
<%=intl._t("Websites outside I2P can also be reached if an HTTP proxy within I2P is known.")%>
|
||||
</td></tr>
|
||||
@@ -161,7 +161,7 @@
|
||||
</td></tr>
|
||||
<tr><td>HTTP</td><td>
|
||||
<%=intl._t("A server tunnel that is customised for HTTP connections.")%>
|
||||
<%=intl._t("Use this tunnel type if you want to host an eepsite.")%>
|
||||
<%=intl._t("Use this tunnel type if you want to host an I2P Site.")%>
|
||||
</td></tr>
|
||||
<tr><td>IRC</td><td>
|
||||
<%=intl._t("A customised server tunnel for hosting IRC networks inside I2P.")%>
|
||||
|
||||
25
apps/imagegen/build.gradle
Normal file
25
apps/imagegen/build.gradle
Normal file
@@ -0,0 +1,25 @@
|
||||
plugins {
|
||||
id 'war'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir 'identicon/core/src/main/java'
|
||||
srcDir 'imagegen/webapp/src/main/java'
|
||||
srcDir 'zxing/core/src/main/java'
|
||||
srcDir 'zxing/javase/src/main/java'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':core')
|
||||
providedCompile project(':apps:jetty')
|
||||
}
|
||||
|
||||
war {
|
||||
from 'imagegen/webapp/src/main/webapp/imagegen.css'
|
||||
from 'imagegen/webapp/src/main/webapp/index.html'
|
||||
webXml = file('imagegen/webapp/src/main/webapp/WEB-INF/web.xml')
|
||||
}
|
||||
@@ -9,8 +9,8 @@ sourceSets {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
ext.jettyVersion = '9.2.25.v20180606'
|
||||
ext.tomcatVersion = '8.5.40'
|
||||
ext.jettyVersion = '9.3.29.v20201019'
|
||||
ext.tomcatVersion = '9.0.40'
|
||||
compile project(':core')
|
||||
compile 'org.eclipse.jetty:jetty-http:' + ext.jettyVersion
|
||||
compile 'org.eclipse.jetty:jetty-io:' + ext.jettyVersion
|
||||
|
||||
@@ -439,6 +439,7 @@
|
||||
<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}" />
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
package net.i2p.jetty;
|
||||
|
||||
import java.nio.channels.ClosedChannelException;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
@@ -127,7 +129,7 @@ public class I2PLogger implements Logger
|
||||
if (th != null) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn(msg, th);
|
||||
else
|
||||
else if (!(th instanceof ClosedChannelException))
|
||||
_log.logAlways(Log.WARN, msg + ": " + th);
|
||||
} else {
|
||||
_log.logAlways(Log.WARN, msg);
|
||||
|
||||
@@ -317,7 +317,7 @@ public class I2PRequestLog extends AbstractLifeCycle implements RequestLog
|
||||
buf.append(request.getMethod());
|
||||
buf.append(' ');
|
||||
|
||||
u8buf.append(request.getHttpURI().toString());
|
||||
u8buf.append(request.getRequestURI());
|
||||
|
||||
buf.append(' ');
|
||||
buf.append(request.getProtocol());
|
||||
|
||||
@@ -8,6 +8,7 @@ sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir 'java/src'
|
||||
srcDir 'java/build/messages-src'
|
||||
}
|
||||
}
|
||||
test {
|
||||
@@ -21,6 +22,17 @@ 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'
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?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>
|
||||
@@ -10,6 +10,7 @@
|
||||
#
|
||||
# zzz - public domain
|
||||
#
|
||||
cd `dirname $0`
|
||||
CLASS=net.i2p.client.streaming.messages
|
||||
TMPFILE=build/javafiles.txt
|
||||
export TZ=UTC
|
||||
|
||||
@@ -60,6 +60,6 @@ public class I2PSocketExceptionTest {
|
||||
public void testUnknownStatus() {
|
||||
I2PSocketException e = new I2PSocketException(255);
|
||||
assertThat(e.getStatus(), is(255));
|
||||
assertThat(e.getMessage(), is("Failure code: 255"));
|
||||
assertThat(e.getMessage(), endsWith(": 255"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir 'java/src'
|
||||
srcDir 'java/build/messages-src'
|
||||
srcDir 'java/build/messages-countries-src'
|
||||
srcDir 'java/build/messages-news-src'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,7 +43,27 @@ if (System.getenv("TARGET_JAVA_HOME") == null && JavaVersion.current() != JavaVe
|
||||
test.dependsOn scalaTest
|
||||
}
|
||||
|
||||
jar {
|
||||
// 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/**'
|
||||
manifest {
|
||||
// Top level installer will rename to jrobin.jar
|
||||
// DTG added in 0.8.4, not in the classpath for very old installs,
|
||||
@@ -50,12 +73,30 @@ 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'
|
||||
// Remove classes from the classpath, they are in the jar.
|
||||
// If we return to precompiling jsps this needs to change.
|
||||
classpath = []
|
||||
exclude 'jsp/web.xml'
|
||||
exclude '*.jsi'
|
||||
exclude '*.jsp'
|
||||
webXml = file('jsp/web.xml')
|
||||
from ('resources', {
|
||||
into "WEB-INF/classes/net/i2p/router/web/resources"
|
||||
})
|
||||
}
|
||||
|
||||
@@ -140,7 +140,11 @@
|
||||
<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" />
|
||||
<jar destfile="./build/routerconsole.jar" basedir="./build/obj" excludes="net/i2p/router/web/helpers/* net/i2p/router/web/servlets/*">
|
||||
<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/**/*">
|
||||
<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 -->
|
||||
@@ -160,7 +164,11 @@
|
||||
|
||||
<!-- newsxml.jar only (subset of routerconsole, no war) for Android -->
|
||||
<target name="newsxmljar" depends="compileNewsOnly" >
|
||||
<jar destfile="./build/newsxml.jar" basedir="./build/obj" includes="**/*.class">
|
||||
<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>
|
||||
</target>
|
||||
|
||||
@@ -338,10 +346,13 @@
|
||||
<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, *.css, **/*.java, *.jsp, *.jsi, web-fragment.xml, web-out.xml">
|
||||
basedir="../jsp/" excludes="web.xml, **/*.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}" />
|
||||
@@ -351,8 +362,9 @@
|
||||
<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/*" />
|
||||
<classes dir="./build/obj" includes="net/i2p/router/web/helpers/* net/i2p/router/web/servlets/* net/i2p/router/web/resources/**/*" />
|
||||
</war>
|
||||
<delete file="../jsp/favicon.ico" />
|
||||
</target>
|
||||
|
||||
<target name="warUpToDate">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#
|
||||
# zzz - public domain
|
||||
#
|
||||
cd `dirname $0`
|
||||
CLASS=net.i2p.router.countries.messages
|
||||
TMPFILE=build/javafiles-countries.txt
|
||||
export TZ=UTC
|
||||
@@ -33,9 +34,9 @@ fi
|
||||
# set LG2 to the language you need in environment variables to enable this
|
||||
|
||||
#
|
||||
# generate strings/Countries.java from ../../../installer/resources/countries.txt
|
||||
# generate strings/Countries.java from ../../../core/resources/countries.txt
|
||||
#
|
||||
CFILE=../../../installer/resources/countries.txt
|
||||
CFILE=../../../core/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 ]
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#
|
||||
# zzz - public domain
|
||||
#
|
||||
cd `dirname $0`
|
||||
CLASS=net.i2p.router.news.messages
|
||||
TMPFILE=build/javafiles-news.txt
|
||||
export TZ=UTC
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#
|
||||
# zzz - public domain
|
||||
#
|
||||
cd `dirname $0`
|
||||
CLASS=net.i2p.router.web.messages
|
||||
TMPFILE=build/javafiles.txt
|
||||
export TZ=UTC
|
||||
@@ -39,6 +40,7 @@ fi
|
||||
ROUTERFILES="\
|
||||
../../../router/java/src/net/i2p/router/Blocklist.java \
|
||||
../../../router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java \
|
||||
../../../router/java/src/net/i2p/router/sybil/Analysis.java \
|
||||
../../../router/java/src/net/i2p/router/tasks/CoalesceStatsEvent.java \
|
||||
../../../router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java \
|
||||
../../../router/java/src/net/i2p/router/transport/GetBidsJob.java \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package net.i2p.router.news;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.text.DateFormat;
|
||||
@@ -190,12 +190,17 @@ public class NewsManager implements ClientApp {
|
||||
}
|
||||
|
||||
private List<NewsEntry> parseInitialNews() {
|
||||
File file = new File(_context.getBaseDir(), "docs/initialNews/initialNews.xml");
|
||||
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();
|
||||
}
|
||||
Reader reader = null;
|
||||
try {
|
||||
char[] buf = new char[512];
|
||||
StringBuilder out = new StringBuilder(2048);
|
||||
reader = new TranslateReader(_context, BUNDLE_NAME, new FileInputStream(file));
|
||||
reader = new TranslateReader(_context, BUNDLE_NAME, is);
|
||||
int len;
|
||||
while((len = reader.read(buf)) > 0) {
|
||||
out.append(buf, 0, len);
|
||||
@@ -206,14 +211,17 @@ public class NewsManager implements ClientApp {
|
||||
rv.get(0).updated = _context.clock().now();
|
||||
} else {
|
||||
if (_log.shouldWarn())
|
||||
_log.warn("failed to load " + file);
|
||||
_log.warn("failed to load initial news");
|
||||
}
|
||||
return rv;
|
||||
} catch (IOException ioe) {
|
||||
if (_log.shouldWarn())
|
||||
_log.warn("failed to load " + file, ioe);
|
||||
_log.warn("failed to load initial news", ioe);
|
||||
return Collections.emptyList();
|
||||
} finally {
|
||||
try {
|
||||
is.close();
|
||||
} catch (IOException foo) {}
|
||||
try {
|
||||
if (reader != null)
|
||||
reader.close();
|
||||
|
||||
@@ -21,6 +21,7 @@ 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";
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
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;
|
||||
@@ -12,12 +16,15 @@ public class ContentHelper extends HelperBase {
|
||||
private String _lang;
|
||||
|
||||
/**
|
||||
* Caution, use absolute paths only, do not assume files are in CWD
|
||||
* Caution, use absolute paths only for getContent() and getTextContent(),
|
||||
* 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)) {
|
||||
|
||||
@@ -13,4 +13,6 @@ 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";
|
||||
}
|
||||
|
||||
@@ -1009,7 +1009,7 @@ public class PluginStarter implements Runnable {
|
||||
return false;
|
||||
boolean rv = group.activeCount() > 0;
|
||||
|
||||
// Plugins start before the eepsite, and will create the static Timer thread
|
||||
// Plugins start before the I2P Site, and will create the static Timer thread
|
||||
// in RolloverFileOutputStream, which never stops. Don't count it.
|
||||
// Ditto HSQLDB Timer (jwebcache)
|
||||
if (rv) {
|
||||
|
||||
@@ -35,7 +35,6 @@ import net.i2p.jetty.I2PLogger;
|
||||
import net.i2p.router.RouterContext;
|
||||
import net.i2p.router.app.RouterApp;
|
||||
import net.i2p.router.news.NewsManager;
|
||||
import net.i2p.router.sybil.Analysis;
|
||||
import net.i2p.router.update.ConsoleUpdateManager;
|
||||
import net.i2p.util.Addresses;
|
||||
import net.i2p.util.FileSuffixFilter;
|
||||
@@ -901,14 +900,6 @@ public class RouterConsoleRunner implements RouterApp {
|
||||
if (_mgr == null)
|
||||
_context.addShutdownTask(new ServerShutdown());
|
||||
ConfigServiceHandler.registerSignalHandler(_context);
|
||||
|
||||
if (_mgr != null &&
|
||||
//_context.getBooleanProperty(HelperBase.PROP_ADVANCED) &&
|
||||
!SystemVersion.isSlow() &&
|
||||
_context.getProperty(Analysis.PROP_FREQUENCY, Analysis.DEFAULT_FREQUENCY) > 0) {
|
||||
// registers and starts itself
|
||||
Analysis.getInstance(_context);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.i2p.router.web;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Collections;
|
||||
@@ -22,6 +23,7 @@ import net.i2p.router.RouterContext;
|
||||
import static net.i2p.router.web.GraphConstants.*;
|
||||
import net.i2p.stat.Rate;
|
||||
import net.i2p.stat.RateStat;
|
||||
import net.i2p.util.FileSuffixFilter;
|
||||
import net.i2p.util.FileUtil;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SystemVersion;
|
||||
@@ -43,7 +45,7 @@ public class StatSummarizer implements Runnable, ClientApp {
|
||||
private final Log _log;
|
||||
/** list of SummaryListener instances */
|
||||
private final List<SummaryListener> _listeners;
|
||||
private static final int MAX_CONCURRENT_PNG = SystemVersion.isARM() ? 2 : 3;
|
||||
private static final int MAX_CONCURRENT_PNG = SystemVersion.isSlow() ? 1 : 3;
|
||||
private final Semaphore _sem;
|
||||
private volatile boolean _isRunning;
|
||||
private volatile Thread _thread;
|
||||
@@ -91,6 +93,24 @@ public class StatSummarizer implements Runnable, ClientApp {
|
||||
String spec = _context.getProperty("stat.summaries", DEFAULT_DATABASES);
|
||||
String[] rates = DataHelper.split(spec, ",");
|
||||
syncThreads = Math.min(rates.length / 2, 4);
|
||||
// delete files for unconfigured rates
|
||||
Set<String> configured = new HashSet<String>(rates.length);
|
||||
for (String r : rates) {
|
||||
configured.add(SummaryListener.createName(_context, r));
|
||||
}
|
||||
File rrdDir = new File(_context.getRouterDir(), SummaryListener.RRD_DIR);
|
||||
FileFilter filter = new FileSuffixFilter(SummaryListener.RRD_PREFIX, SummaryListener.RRD_SUFFIX);
|
||||
File[] files = rrdDir.listFiles(filter);
|
||||
if (files != null) {
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
File f = files[i];
|
||||
String name = f.getName();
|
||||
String hash = name.substring(SummaryListener.RRD_PREFIX.length(), name.length() - SummaryListener.RRD_SUFFIX.length());
|
||||
if (!configured.contains(hash)) {
|
||||
f.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
syncThreads = 0;
|
||||
deleteOldRRDs();
|
||||
|
||||
@@ -35,8 +35,8 @@ public class SummaryListener implements RateSummaryListener {
|
||||
public static final String PROP_PERSISTENT = "routerconsole.graphPersistent";
|
||||
/** note that .jrb files are NOT compatible with .rrd files */
|
||||
static final String RRD_DIR = "rrd";
|
||||
private static final String RRD_PREFIX = "rrd-";
|
||||
private static final String RRD_SUFFIX = ".jrb";
|
||||
static final String RRD_PREFIX = "rrd-";
|
||||
static final String RRD_SUFFIX = ".jrb";
|
||||
static final ConsolFun CF = ConsolFun.AVERAGE;
|
||||
static final DsType DS = DsType.GAUGE;
|
||||
private static final double XFF = 0.9d;
|
||||
|
||||
@@ -162,6 +162,9 @@ 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();
|
||||
@@ -248,23 +251,39 @@ 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);
|
||||
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";
|
||||
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);
|
||||
}
|
||||
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);
|
||||
|
||||
@@ -65,7 +65,7 @@ public class CertHelper extends HelperBase {
|
||||
if (!hasTunnels)
|
||||
output(_t("SAM"), null);
|
||||
|
||||
// Eepsite
|
||||
// I2P Site
|
||||
tunnelDir = new File(dir, EEPSITE_DIR);
|
||||
hasTunnels = false;
|
||||
tunnels = tunnelDir.listFiles(new FileSuffixFilter(".crt"));
|
||||
|
||||
@@ -9,6 +9,8 @@ import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.i2p.app.ClientApp;
|
||||
import net.i2p.app.ClientAppState;
|
||||
@@ -37,6 +39,15 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
public static final String PROP_ENABLE_CLIENT_CHANGE = "routerconsole.enableClientChange";
|
||||
public static final String PROP_ENABLE_PLUGIN_INSTALL = "routerconsole.enablePluginInstall";
|
||||
|
||||
/**
|
||||
* simple regex from
|
||||
* https://stackoverflow.com/questions/8204680/java-regex-email
|
||||
* not the massive RFC 822 compliant one
|
||||
* modified so .i2p will work
|
||||
*/
|
||||
private static final Pattern VALID_EMAIL_ADDRESS_REGEX =
|
||||
Pattern.compile("[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z2]{2,6}", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
public ConfigClientsHelper() {}
|
||||
|
||||
/** @since 0.9.14.1 */
|
||||
@@ -302,10 +313,13 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
}
|
||||
s = stripHTML(appProps, "author");
|
||||
if (s != null) {
|
||||
String[] authors = DataHelper.split(s, "[,; \r\n\t]");
|
||||
Matcher m = VALID_EMAIL_ADDRESS_REGEX.matcher(s);
|
||||
String author = m.find() ? m.group() : null;
|
||||
desc.append("<tr><td><b>")
|
||||
.append(_t("Author")).append("</b></td><td>");
|
||||
if (s.indexOf('@') > 0)
|
||||
desc.append("<a href=\"mailto:").append(s).append("\">").append(s).append("</a>");
|
||||
if (author != null)
|
||||
desc.append("<a href=\"mailto:").append(author).append("\">").append(s).append("</a>");
|
||||
else
|
||||
desc.append(s);
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ 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)
|
||||
|
||||
@@ -32,6 +32,8 @@ 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>" +
|
||||
@@ -56,7 +58,7 @@ public class FileDumpHelper extends HelperBase {
|
||||
}
|
||||
Collections.sort(flist);
|
||||
for (File f : flist) {
|
||||
dumpFile(buf, f);
|
||||
dumpFile(buf, f, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,14 +67,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");
|
||||
dumpDir(buf, dir, ".jar", true);
|
||||
|
||||
// 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");
|
||||
dumpDir(buf, dir, ".war", true);
|
||||
|
||||
// plugins
|
||||
File pluginDir = new File(_context.getConfigDir(), PluginStarter.PLUGIN_DIR);
|
||||
@@ -87,9 +89,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");
|
||||
dumpDir(buf, dir, ".jar", false);
|
||||
dir = new File(files[i], "console/webapps");
|
||||
dumpDir(buf, dir, ".war");
|
||||
dumpDir(buf, dir, ".war", false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,23 +99,23 @@ public class FileDumpHelper extends HelperBase {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
private static void dumpDir(StringBuilder buf, File dir, String suffix) {
|
||||
private static void dumpDir(StringBuilder buf, File dir, String suffix, boolean linkrev) {
|
||||
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]);
|
||||
dumpFile(buf, files[i], linkrev);
|
||||
}
|
||||
}
|
||||
|
||||
private static void dumpFile(StringBuilder buf, File f) {
|
||||
private static void dumpFile(StringBuilder buf, File f, boolean linkrev) {
|
||||
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((new Date(mod)).toString());
|
||||
buf.append(DataHelper.formatTime(mod));
|
||||
else
|
||||
buf.append("<font color=\"red\">Not found</font>");
|
||||
buf.append("</td><td align=\"center\">");
|
||||
@@ -143,13 +145,13 @@ public class FileDumpHelper extends HelperBase {
|
||||
if (s != null && s.length() > 20) {
|
||||
if (iv != null)
|
||||
buf.append("<br>");
|
||||
// fix and uncomment if a reliable viewmtn host appears
|
||||
//buf.append("<a href=\"http://killyourtv.i2p/viewmtn/revision/info/").append(s)
|
||||
// .append("\">");
|
||||
if (linkrev)
|
||||
buf.append("<a href=\"").append(LINK).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>");
|
||||
//buf.append("</tt>");
|
||||
if (linkrev)
|
||||
buf.append("</a>");
|
||||
}
|
||||
buf.append("</td><td>");
|
||||
s = getAtt(att, "Created-By");
|
||||
|
||||
@@ -32,6 +32,7 @@ public class GraphHelper extends FormHandler {
|
||||
private int _refreshDelaySeconds;
|
||||
private boolean _persistent;
|
||||
private boolean _graphHideLegend;
|
||||
private boolean _utc;
|
||||
private String _stat;
|
||||
private int _end;
|
||||
|
||||
@@ -131,6 +132,9 @@ 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
|
||||
@@ -157,6 +161,8 @@ 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
|
||||
@@ -170,6 +176,7 @@ public class GraphHelper extends FormHandler {
|
||||
+ "&c=" + (3 * _periodCount )
|
||||
+ "&w=" + (3 * _width)
|
||||
+ "&h=" + (3 * _height)
|
||||
+ (utc ? "&utc" : "")
|
||||
+ "\">");
|
||||
String title = _t("Combined bandwidth graph");
|
||||
_out.write("<img class=\"statimage\""
|
||||
@@ -184,6 +191,8 @@ public class GraphHelper extends FormHandler {
|
||||
// no legend, no height difference needed
|
||||
_out.write("&height=" + (_height));
|
||||
}
|
||||
if (utc)
|
||||
_out.write("&utc");
|
||||
_out.write("&hideLegend=" + hideLegend
|
||||
+ "\" alt=\"" + title + "\" title=\"" + title + "\"></a>\n");
|
||||
}
|
||||
@@ -199,6 +208,7 @@ public class GraphHelper extends FormHandler {
|
||||
+ "&w=" + (3 * _width)
|
||||
+ "&h=" + (3 * _height)
|
||||
+ (_showEvents ? "&showEvents=1" : "")
|
||||
+ (utc ? "&utc" : "")
|
||||
+ "\">");
|
||||
_out.write("<img class=\"statimage\" border=\"0\""
|
||||
+ " src=\"viewstat.jsp?stat="
|
||||
@@ -209,6 +219,7 @@ public class GraphHelper extends FormHandler {
|
||||
+ "&width=" + _width
|
||||
+ "&height=" + _height
|
||||
+ "&hideLegend=" + hideLegend
|
||||
+ (utc ? "&utc" : "")
|
||||
+ "\" alt=\"" + title
|
||||
+ "\" title=\"" + title + "\"></a>\n");
|
||||
}
|
||||
@@ -389,7 +400,7 @@ public class GraphHelper extends FormHandler {
|
||||
+ "\">" + _t("pixels wide") + " <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=\"5\" 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=\"4\" 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\">");
|
||||
@@ -417,6 +428,12 @@ 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);
|
||||
@@ -477,6 +494,7 @@ 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));
|
||||
@@ -486,6 +504,7 @@ 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"));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user