Compare commits

..

1801 Commits

Author SHA1 Message Date
dff1c45fa7 gitlab-ci: Run tests on merge requests and tags 2021-01-07 15:18:01 +01:00
279e643688 gitlab-ci: Replace check job with test
I can't see what other things `check` is running besides tests.
2021-01-07 14:42:09 +01:00
6bb0974774 gitlab-ci: Install grep instead of using busybox version 2021-01-07 14:30:13 +01:00
29e24568d0 gitlab-ci: Try adding code coverage 2021-01-07 14:19:38 +01:00
e61ed7d784 gitlab-ci: Gradle command typo
Step 1: Learn how to type
2021-01-07 12:53:26 +01:00
5e31e2f78c gitlab-ci: Keep cache only on branch and tag
Sharing caches across branches surely isn't a good idea.
2021-01-07 12:49:38 +01:00
c25decb272 gitlab-ci: first attempt 2021-01-07 12:47:27 +01:00
2c5fe22710 test: fix I2PSocketExceptionTest::testUnknownStatus
In non-English environments, the message is translated.
2021-01-07 12:36:01 +01:00
zzz
2e180d4c60 Build: Add translations to gradle build (part 3 - only rebuild if necessary) 2021-01-03 10:35:04 -05:00
zzz
152ad1659b Build: Add translations to gradle build (part 2 - wars)
Several fixes for i2ptunnel gradle build
2021-01-03 09:55:42 -05:00
zzz
888311e34f Build: Add translations to gradle build (part 1 - jars) 2021-01-03 09:08:21 -05:00
zzz
2df5fb972a Sybil: Reduce default threshold 2021-01-02 09:58:08 -05:00
zzz
a481255adb Tunnels: Improve error handling of zero tunnel ID at OBEP
Reduce max time to defragment
Make logging of errors consistent
cleanups, stat tweaks
2021-01-02 09:57:27 -05:00
idk
139594df8f Move travis test runner script to own file so it's easier to work with 2021-01-02 09:12:02 -05:00
idk
659ab97f69 Try increasing sonar scanner heap size in travis builds 2021-01-02 08:49:46 -05:00
idk
963a4fe89c Extend travis timeout and make sonarqube output verbose 2021-01-02 08:39:21 -05:00
zzz
4c4dbae107 Console: Show file mod time in local time zone on /jars 2021-01-01 11:05:04 -05:00
zzz
6978049416 Console: Link to our gitlab on /jars 2021-01-01 10:49:14 -05:00
zzz
46fe1ba74a Build: Gradle fixes
Add resources to jars and wars
remove .jsi and .jsp files from wars
remove classes that are in jars from the wars for apps that have both
compile jsps in routerconsole.war
build routerconsole.jar
2021-01-01 10:17:00 -05:00
zzz
13bd5e4938 SSU: Remove router version check for random intro key, now that the release is out 2021-01-01 07:13:26 -05:00
idk
bbacf85245 travis-ci test: correct the sonarqube version for the last time, I think 2020-12-31 15:38:24 -05:00
idk
68f011f344 Remove some CSS that applies to images that aren't present in the current software. Also switch to version 2.8.0 of sonarqube in travis.yml since 3.0.0 does not seem to be available as a gradle plugin for this version 2020-12-31 15:31:52 -05:00
idk
8bd2384ac8 travis-ci test: Try updating the sonarqube plugin. 2020-12-31 13:05:26 -05:00
zzz
54dda1a15f alignment 2020-12-31 12:47:01 -05:00
zzz
3f44a555ba Console: Use local time on graphs by default, add UTC option 2020-12-31 12:36:07 -05:00
idk
86cbb2ed4e travis-ci test: Try switching to oraclejdk11 without updating the sonarqube plugin. 2020-12-31 11:52:10 -05:00
zzz
2569123055 NetDB: Drop lookups with replies going to us
Extend lookup expire time
Cleanups
2020-12-31 08:37:04 -05:00
idk
afa4b9e66d Tweak border color on /events form 2020-12-30 18:34:42 -05:00
idk
67bd5a32fd fix overlapping border on /events css, closes #4 2020-12-30 18:32:57 -05:00
idk
ada3629507 correct name of git-bundle ant target 2020-12-30 15:38:47 -05:00
idk
dcb7314306 travis-ci now requires you to use trusty if you also want to use oraclejdk8 2020-12-30 14:50:09 -05:00
idk
e3c2ad6354 fix broken travis test 2020-12-30 14:14:30 -05:00
idk
178ea252d5 Merge branch 'bundle-target' into 'master'
add a bundle target to ant that generates a current git bundle and corresponding torrent.

See merge request i2p-hackers/i2p.i2p!1
2020-12-30 15:49:41 +00:00
idk
7e4ba4eb31 Merge branch 'master' into 'bundle-target'
# Conflicts:
#   build.xml
2020-12-30 15:48:58 +00:00
zzz
de43de17f6 Crypto: Only skip N mixHash for router messages
Still required for ECIES build replies; previous checkin broke it
Make a new pattern id for N without responses
Fixes ECIES build replies
2020-12-30 07:08:47 -05:00
zzz
2ceb9c429a Console: Add tunnel nicknames to router debug page
Escape tunnel nicknames on LS debug page
2020-12-29 16:29:53 -05:00
zzz
0b59f53fe9 i2ptunnel: Disable shared clients (DSA), any server not
supporting EdDSA doesn't support LS2.
2020-12-29 15:51:51 -05:00
zzz
62fce859b9 Ratchet: mixHash() not required after message for N pattern 2020-12-29 14:15:00 -05:00
zzz
9fc97764c5 NetDB: Verify RI stores for a while after starting 2020-12-29 14:06:28 -05:00
zzz
2813d9412d Crypto: Cache AES Ciphers
About a 10% speedup
2020-12-29 10:26:41 -05:00
zzz
a0bf76a4b1 Debian: Add JRE 15,16 2020-12-28 08:29:07 -05:00
zzz
d2a79e8837 Build: Add version where missing from jar manifests 2020-12-28 08:07:50 -05:00
zzz
738ef496d4 Debian: Build fix for no geoip files 2020-12-27 10:13:02 -05:00
zzz
a2734ffa72 SSU: Fix restoration of window after failed message
Reported by and adapted from patch by zlatinb
2020-12-27 08:50:11 -05:00
zzz
8606d30e9a Build: Fixup installer build after flags move 2020-12-26 10:28:37 -05:00
zzz
a45084cfc3 Console: Move initial news to jar 2020-12-26 10:13:49 -05:00
zzz
eeaf6f3514 Console: Fix missing newlines in readme output 2020-12-26 09:36:36 -05:00
zzz
9e18ff1cd1 Router: Move countries.txt file into i2p.jar 2020-12-26 09:33:13 -05:00
zzz
665239fd37 Router: Move continents.txt file into jar
Move core resources directory to be consistent with the other subsystems
2020-12-26 08:11:00 -05:00
zzz
12f9a7187e Console: Move flag overrides to war 2020-12-26 06:12:31 -05:00
zzz
8835351b99 I2CP: Fix requesting leasesets for subsessions (ticket #2458)
Always request new LS for subsessions also
Don't reuse LS object for subsessions
Cancel rerequest timer as necessary
Fixes watchdog warnings
Fixes console status for subsessions in different states
javadocs
2020-12-24 13:56:32 -05:00
zzz
a3c44912f2 SusiDNS: Fix link to backup image 2020-12-24 10:11:41 -05:00
zzz
db9f735376 i2ptunnel: Fix writing config file twice on saving existing tunnel
Fix 'Invalid tunnel number' message on saving new tunnel
javadocs
log tweaks
2020-12-23 12:26:56 -05:00
zzz
875a7242d4 Javadoc update for DoH 2020-12-23 10:22:34 -05:00
zzz
51ecdc64a4 Debian: Refresh json patch 2020-12-23 10:18:29 -05:00
zzz
7b785ea454 I2CP: Fix encrypted leaseset for ECIES and dual-key encryption, and for offline keys 2020-12-23 10:05:58 -05:00
zzz
8f5fc44755 Crypto: Increase ratchet tag window
Set trimbehind = lookahead
Ramp up tag window faster
Check for ratchet ES encrypt fails
Log tweaks
2020-12-23 06:47:39 -05:00
zzz
010dbfa6f2 Console: Move resource helper to war, doesn't work from jar 2020-12-22 12:37:47 -05:00
zzz
e20a19c358 Console: Move readme files to war 2020-12-22 09:50:02 -05:00
zzz
387e513949 Console: Add netdb search by enc. type 2020-12-22 07:36:47 -05:00
Zlatin Balevsky
5e005e6520 Merge branch 'whitespace' into 'master'
Whitespace

See merge request i2p-hackers/i2p.i2p!7
2020-12-21 23:00:12 +00:00
Zlatin Balevsky
e88f40cd95 Whitespace 2020-12-21 23:00:12 +00:00
zzz
82e93a53a3 bump -7 2020-12-21 15:51:14 -05:00
zzz
fee5668c1c Merge branch 'partial-ack-fix' into 'master'
SSU: Fix partial acks not being sent when there are no 'gaps'.

See merge request i2p-hackers/i2p.i2p!6
2020-12-21 20:47:11 +00:00
zzz
abb8cbe75d SSU: Fix partial acks not being sent when there are no 'gaps'.
Workaround the bug on the sending side for pre-0.9.49 routers by sending fragments in reverse order.

Bug introduced in commit 9c4558d891 Sep 20 2014.
This partially reverts that commit.
Reported by and adapted from a patch by zlatinb
2020-12-21 10:02:20 -05:00
zzz
340df51429 Console: Fix theme selection 2020-12-20 14:40:09 -05:00
zzz
bec8feb05a Build: Fix up proxy file location 2020-12-20 14:08:13 -05:00
zzz
d86ccded53 Proxy: Move error page resources to jar 2020-12-20 13:50:54 -05:00
idk
db7d92a5cd Apply 1 suggestion(s) to 1 file(s) 2020-12-20 17:57:52 +00:00
zzz
30ffdd03c7 SSU log tweaks 2020-12-20 08:35:07 -05:00
zzz
251d8de943 Merge branch 'wplus-wip' into 'master'
SSU: Westwood+ congestion control (ticket #2427)

See merge request i2p-hackers/i2p.i2p!4
2020-12-20 13:13:34 +00:00
zzz
5e8de68746 SSU: Increase sendWindowBytesRemaining when increasing the window
Fix BWE log formatting
2020-12-19 08:23:13 -05:00
zzz
8ae29c8c00 SSU: Westwood+ bandwidth estimator classes (ticket #2427) 2020-12-19 07:26:53 -05:00
zzz
542efa0d9a SSU: Westwood+ congestion control (ticket #2427)
Reduce initial window to match RFC
Add back to window on message failure
Remove two bps stats
log tweaks
2020-12-18 14:46:26 -05:00
zzz
23c80accfa SSU: More PeerState cleanup 2020-12-18 11:58:55 -05:00
zzz
b909430725 SSU: Account for packet overhead in window calculations 2020-12-18 11:52:18 -05:00
zzz
20b413bc67 Crypto: Fix use after free (ticket #2797) 2020-12-18 11:05:36 -05:00
Zlatin Balevsky
a9b6b86183 Merge branch 'ssu-sync-fix' into 'master'
lock locked_shouldSend on this

See merge request i2p-hackers/i2p.i2p!3
2020-12-18 13:48:40 +00:00
Zlatin Balevsky
66b724759d lock locked_shouldSend on this 2020-12-18 09:03:52 +00:00
zzz
56059448c5 SSU: Send subset of fragments (ticket #2427)
if all fragments will not fit in the window.
Track per-fragment send count.
Reset send window when retransmitting.
Update send window when partial acks received.
Make OMS.getMaxSends() and getPushCount() track different things.
Change OMS.push() to be called by OMF and return the pushed fragments.
Use size of smallest fragment rather than total size to determine if we can send a message now.
This is an improved fix for ticket #2505.
Eliminate repeated calls to OMS.getLifetime()
Log tweaks and reduce log levels
Improves throughput on lossy connections.
Reduces latency for large messages.
This is prep for reducing DEFAULT_SEND_WINDOW_BYTES and W+, which
would have exacerbated these issues.
Additional changes to follow, implementing Westwood+, see #2427
2020-12-17 12:54:24 -05:00
zzz
1c52eeb910 NetDB: Prevent reported NPE 2020-12-16 11:01:45 -05:00
zzz
4aefe4bf7a SSU: Fix OMF looping when timer isn't cancelled after last message acked
Push out timer when no more bandwidth available
Workarounds for now, more changes to follow
2020-12-16 09:40:39 -05:00
idk
b9444cdc51 Merge branch 'fix-ides' into 'master'
Fix ides

See merge request i2p-hackers/i2p.i2p!2
2020-12-14 23:22:16 +00:00
idk
eb72e4c9f5 remove padding from control buttons on i2ptunnel in order to recenter the text vertically 2020-12-14 12:18:19 -05:00
zzz
aa181ee43f SSU: Restore sync dropped in cleanup 2020-12-12 11:00:03 -05:00
zzz
ab04f92072 SSU: PeerState cleanup 2020-12-12 10:15:02 -05:00
zzz
0830329eaf Build: delete file after building to make git happy 2020-12-12 10:13:56 -05:00
Zlatin Balevsky
2d154cc90e update gitignore 2020-12-11 20:21:10 +00:00
Zlatin Balevsky
183280871f get gradle assemble to work 2020-12-11 20:12:27 +00:00
Zlatin Balevsky
067ee80ba0 remove IntelliJ and Eclipse project descriptors 2020-12-11 19:45:25 +00:00
idk
804e2f39f9 append full version to git bundle generation when generating from the ant target 2020-12-11 13:51:40 -05:00
zzz
0ad7e52b71 Router (proposal 156):
- Change router ECIES SKM to use N pattern, remove Elligator2, to match proposal changes
- Allow encrypted messages to ECIES routers
- Allow ECIES routers to become floodfill
- Add XDH factory to VM comm system for tests
2020-12-11 10:08:41 -05:00
zzz
e15110bbe1 Build: Fix i2pcontrol unset property in manifest 2020-12-11 09:00:12 -05:00
idk
2cffda6974 update the HACKING.md to reflect better and/or git-based instructions, also a test commit for git migration. 2020-12-10 13:42:02 -05:00
zzz
2300f6c226 i2psnark: Add web seeds in TrackerClient
list web seeds in UI
2020-12-06 14:25:43 +00:00
zzz
1ed8a1b6f3 i2psnark: Close RAF on error 2020-12-06 14:13:10 +00:00
zzz
c4ed7719e8 i2psnark: Preserve file attribute strings in metainfo 2020-12-06 14:00:02 +00:00
zzz
a98fe45204 Streaming: Add Retry-After header to throttle response 2020-12-06 13:26:55 +00:00
zzz
5a3e26453f Transport: Block SIP ports 2020-12-06 13:11:46 +00:00
zzz
c259000cdb Console: fixup param name 2020-12-06 13:09:57 +00:00
zzz
d683f0d9eb Util: Change DoH to the RFC 8484 protocol 2020-12-06 12:54:20 +00:00
zzz
48b8886224 i2psnark: Add WebSeed support - WIP - not hooked in yet 2020-12-06 12:43:55 +00:00
zzz
1097220d31 i2psnark: Move URIUtil from war to jar (prep for WebSeed) 2020-12-06 12:37:19 +00:00
zzz
fdeae72d38 i2psnark: Fix up standalone build 2020-12-06 12:31:22 +00:00
zzz
f870bc2ccd console: Move web resources to war 2020-12-06 12:05:53 +00:00
zzz
ec3bfa3cb7 susimail: Move web resources to war 2020-12-06 12:03:27 +00:00
zzz
c3f7c5d154 susidns: Move web resources to war 2020-12-06 12:02:11 +00:00
zzz
127b93c1e2 i2ptunnel: Move web resources to war 2020-12-06 11:59:54 +00:00
zzz
cd019f258f i2psnark: Move web resources to war 2020-12-06 11:59:11 +00:00
zzz
889b7361fe imagegen: Move CSS to war 2020-12-06 11:55:40 +00:00
zzz
99f6d4aba4 MiniDNS javadoc fix 2020-12-05 14:27:56 +00:00
zzz
69deddcbc7 Add DNS library to support RFC 8484 DoH (ticket #2201)
WIP - not yet hooked in

This is a portion of release 1.0.0 of MiniDNS from https://github.com/MiniDNS/minidns/ 2020-07-18
Only contains the minidns-core portion of the library.
Removed tests, most util classes, and DnsRootServer class.
Unmodified, as a base for future checkins.
Total size of zipped classes is about 75 KB.

This software may be used under the terms of (at your choice)
- LGPL version 2 (or later)
- Apache Software licence
- WTFPL
2020-12-05 14:21:08 +00:00
zzz
58020b4b58 Console: Swap some columns on ssu /peers for consistency
Format send window and slow start threshold values
2020-12-05 12:56:58 +00:00
zzz
df43e72a08 PRNG: Drop unused exception and interface 2020-12-05 12:51:24 +00:00
zzz
326e2c630c Debian: Files for 0.9.48
refresh patches
update release docs
2020-12-02 14:53:38 +00:00
zzz
36fdfd529f 0.9.48 2020-12-01 15:54:41 +00:00
zzz
94bdc9c5b3 Late pl,zh translation updates 2020-12-01 14:50:37 +00:00
zzz
c60e51514c Add old cert to deletelist.txt
Javadoc fix
2020-12-01 14:39:44 +00:00
zzz
7dcbbf17c3 Console: Fix headers on /debug
JS: Update license headers
patch from idk
2020-12-01 14:36:50 +00:00
zzz
5551deb246 pull RU translations 2020-11-28 19:42:22 +00:00
zzz
6e8fd42efd pull translations 2020-11-27 18:40:53 +00:00
zzz
5020100ef8 BuildTime update 2020-11-27 18:06:55 +00:00
zzz
6c2c6abfb9 NTCP: Enable nodelay by default
SSU: Don't wakeup OMF after ack if no more messages are pending
2020-11-26 18:58:22 +00:00
hankhill19580
4940c34779 More light theme CSS tweaks to table headings and table spacing on /config*, switch from uppercase to capitalize for titles on SusiMail 2020-11-25 03:58:38 +00:00
hankhill19580
6d5aebeaa0 remove borders from around notifications on /welcome 2020-11-24 19:27:02 +00:00
zzz
d8924119b5 NTCP: Add nodelay option for testing 2020-11-24 14:48:59 +00:00
zzz
4b445e7d35 Build: release target fixes for git 2020-11-24 14:45:02 +00:00
zzz
17e47a0c93 Build: revisions target for git 2020-11-24 14:02:20 +00:00
zzz
2ffb570850 Console: Serve default favicon.ico
i2ptunnel: Remove dup link to nonexistent theme favicon.ico
2020-11-23 18:46:12 +00:00
zzz
aef2fb8ce0 i2pcontrol: Basic HTML fixes and HTTP headers for static pages 2020-11-23 15:24:19 +00:00
zzz
875fcdfb94 NetDB: Increase min FF version for LS lookups since most are LS2 now 2020-11-22 19:46:18 +00:00
hankhill19580
151f856b0a apply revert to h3#transports on /peers to fix cramping 2020-11-22 16:25:15 +00:00
zzz
337787be0e i2psnark: Remove old opentrackers 2020-11-21 17:27:41 +00:00
zzz
798521466d Proxy: Remove old jump servers 2020-11-21 17:24:24 +00:00
zzz
678c035fa3 Proxy: Fix CSP for conflict error page 2020-11-21 17:21:36 +00:00
zzz
ccb4210f8b NetDB: Limit max explore at startup when hidden 2020-11-20 14:37:22 +00:00
zzz
7e5dc6ad64 Tomcat 9.0.40 2020-11-20 14:11:59 +00:00
zzz
31622d0458 NetDB: Increase exploration rate when hidden 2020-11-20 12:59:22 +00:00
zzz
f9b18545f9 Reseed update 2020-11-20 12:30:52 +00:00
hankhill19580
e67eccd1eb Remove inconsistent gradients from light theme /config items 2020-11-19 22:25:51 +00:00
hankhill19580
cefe212a17 Get rid of uppercase text transforms on non-table headings, fix wierd white background on h4's 2020-11-19 21:44:11 +00:00
hankhill19580
8a76d71bd5 Widen margins in langsettings dropdown 2020-11-19 21:11:04 +00:00
hankhill19580
806df95114 Lighten up some borders on /home, improve consistency of backgrounds on /home, header margins on apps on homepages 2020-11-19 20:56:21 +00:00
hankhill19580
c6c0b9ce8a Un-squish the SusiDNS SVG image on Firefoxes greater than 83, remove wierd padding from .optboxes 2020-11-19 18:27:29 +00:00
zzz
00a0970c95 Crypto: Adjust Java key cache sizes 2020-11-19 14:52:11 +00:00
zzz
cb1bd95f2b Build: Reproducible build fix (ticket #2279) 2020-11-19 14:28:38 +00:00
zzz
d12b52f82a Debian: Clean up old commented-out rules 2020-11-19 12:53:26 +00:00
zzz
891ffaac09 Update apparmor profile for usrmerge
https://bugs.launchpad.net/ubuntu/+source/i2p/+bug/1784023
2020-11-19 12:42:07 +00:00
zzz
36fbf0e332 poupdate-source 2020-11-18 17:54:36 +00:00
zzz
e811238d60 NetDB: Disable sending encrypted messages to ECIES routers for now
The #ls2 team plans to change the specification and re-enable after the 0.9.48 release
2020-11-17 16:21:10 +00:00
zzz
c9e6bef825 Jetty: Patch to fix console not starting on Java 11.0.9.1
Backport JavaVersion.java from Jetty 9.4.34
Jetty does not plan to fix in 9.3.x
ref:
https://github.com/eclipse/jetty.project/issues/5682
https://github.com/eclipse/jetty.project/issues/2284
http://zzz.i2p/topics/2991
2020-11-17 15:50:10 +00:00
zzz
0f002b9b69 Jetty 9.3.29.v20201019/ 2020-11-17 15:39:08 +00:00
zzz
f179a057bc Wrapper: Add missing binaries for armv7 and aarch64 to installer (ticket #2308) 2020-11-17 12:04:49 +00:00
zzz
6f5042be8f Test: Drop ancient unused DateMessage 2020-11-16 16:16:49 +00:00
zzz
2044474549 Zxing: Update to 3.4.1 (2020-09-29)
Merge in javadoc fixes
2020-11-16 15:55:27 +00:00
zzz
0b0b93f26f javadoc fix 2020-11-16 15:32:29 +00:00
zzz
595f8762ab I2NP: Don't extend DataStructureImpl, to save space
Fixup test as required
2020-11-16 14:51:35 +00:00
zzz
8644eb431e GeoIP 2020-11-01 2020-11-16 14:43:22 +00:00
zzz
223afdfc7e Wrapper: Update to wrapper 3.5.44
All binaries from Tanuki Delta Pack Community Edition,
except for armhf (armv6), compiled on Raspberry Pi:
  ant 1.8.2
  javac 1.7.0_151
  gcc 4.6.3-14+rpi1

Windows binaries remain unchanged as we must recompile them ourselves
(32 bit just to change the icon; 64 bit is not provided by Tanuki)

PPC 32-bit big endian not updated, no longer supported by Tanuki
2020-11-16 14:35:48 +00:00
zzz
de41cab08e GarlicClove: Store time as long rather than Date to save space 2020-11-11 16:00:57 +00:00
zzz
3606a42ea8 Lease: Store time as long rather than Date to save space
Add long methods, deprecate Date methods
2020-11-11 15:15:44 +00:00
zzz
6887c7edae I2CP: Don't have I2CP Messages extend DataStructureImpl, to save space
Ditto MessageId and SessionId.
Fixup unit tests as required
2020-11-11 13:09:42 +00:00
hankhill19580
4a00691385 increment the counter on the bandwidth config page by 5 instead of 10 so that it can actually match the recommendations on the /welcome 2020-11-11 00:32:35 +00:00
hankhill19580
1d0a2c4fac Fix right-side padding of down arrow on select boxes 2020-11-10 19:40:30 +00:00
hankhill19580
d0016380e5 Make all the border radiuses consistent across apps. Button-like inputs get a 12px radius, text-like inputs get a 6px radius. "Professional but not prickly." nix almost all drop-shadows and most text-shadows. more 1-3 pixed tweaks to get text centered up 2020-11-10 19:15:41 +00:00
zzz
29dc311c6a Ratchet: Destroy HandshakeState after fatal NS/NSR errors 2020-11-10 15:22:46 +00:00
zzz
7aa78a1aed One more i2cp buffer size increase 2020-11-10 14:57:39 +00:00
zzz
989f64192f i2psnark: Larger read buffer for large files 2020-11-10 14:54:37 +00:00
zzz
c908c6bd05 Data: SDS no longer extends DataStructureImpl to save space
More minor i2cp efficiency improvements
KeyCertificate log tweak
2020-11-10 14:48:42 +00:00
hankhill19580
9f51b72cab fix oversized button on i2ptunnel home page 2020-11-08 02:49:16 +00:00
zzz
a2fd817915 Tunnels: getUnknownOptions() is non-null
one more TunnelId fixup
2020-11-07 13:53:44 +00:00
zzz
5bafdd05a9 Tunnels: Simplify TunnelId and HopConfig to save space
and reduce object churn and duplication
Fixup tests, javadocs, logging as required
2020-11-07 13:40:48 +00:00
hankhill19580
e18708bdbe round and re-center buttons on i2ptunnel home page 2020-11-07 07:18:15 +00:00
hankhill19580
f6687c1f88 add a little padding to the left of the text in the sidebar under Local Tunnels, set links list style to none instead of using the link image 2020-11-07 02:55:35 +00:00
hankhill19580
b9eabca403 use paste.png for the pastebin instead of pasteidk.png so in theory other pastebins could use it 2020-11-06 16:59:30 +00:00
hankhill19580
9ec2c62f2f update the contents of /home to include git.idk.i2p and paste.idk.i2p 2020-11-06 16:57:47 +00:00
zzz
d4152ea546 NetDB: Ensure RI republish time is less than validation time
to prevent failures on connections esp. for hidden mode
2020-11-05 18:47:49 +00:00
zzz
8cc62b5b42 Util: More elimination of data copies 2020-11-04 14:27:16 +00:00
zzz
e242015145 Util: Hook in ByteArrayStream
Set accurate lengths for zero-copy
2020-11-04 12:04:24 +00:00
zzz
35da97936d Point to gitlab in console readme.html,
as approved at today's meeting
2020-11-03 20:59:39 +00:00
zzz
bfe21176ea Add host already linked in console,
as approved at today's meeting
2020-11-03 20:30:53 +00:00
zzz
d1dd9ab517 i2ptunnel: Add checks for offline expiration in alternate destination
Improve logging for expiration checks
2020-11-03 16:39:35 +00:00
zzz
c18dbe974a Remove reseed SSL cert, now using a CA 2020-11-02 22:19:49 +00:00
zzz
f69563da75 Util: New zero-copy BAOS
WIP, to be hooked in
2020-11-02 12:12:20 +00:00
zzz
057eca56d5 Console: Show offline expiration on LS debug page 2020-11-02 12:01:58 +00:00
zzz
a21a64e0c6 i2psnark: Remove unused bencode() methods 2020-11-02 11:39:40 +00:00
zzz
751af5bcd8 i2psnark: Limit max size of embedded video 2020-11-02 11:33:34 +00:00
zzz
c8605009ba i2ptunnel: Automatically restart tunnel if offline-signed private key file is updated
Periodically log if about to expire
Short delay between stop and start on restart
_tunnel is always non-null
2020-11-02 11:27:06 +00:00
zzz
5625caebda I2CP: Remove tunnels immediately on client disconnect 2020-11-02 11:21:52 +00:00
zzz
fc0a78dd7b Util: Drop class deprecated 11 years ago 2020-10-31 20:20:59 +00:00
zzz
90aab37002 i2psnark: Add support for comment and url_list to Storage CLI
Add support for multiple urls to MetaInfo CLI
Add comment to release torrent
2020-10-30 16:37:54 +00:00
zzz
5c1a529df0 Util: Fix NPE in EepGet CLI callback via PartialEepGet
Fix callback javadocs
2020-10-30 15:22:24 +00:00
zzz
6fa015c410 i2psnark: MetaInfo support for url-list (prep for BEP 19),
WIP - unused for now.
Add url-list to CLI tool for testing
Add comment support to CLI tool
2020-10-30 13:18:46 +00:00
zzz
2d1e68b53b i2psnark: Store BEP 47 padding file info in a bitmap (prep for BEP 52),
WIP - unused for now.
Don't instantiate files_utf8 unless needed, which it never is
2020-10-29 17:13:32 +00:00
zzz
35012a3bad Crypto: Precalculate Noise init hash 2020-10-29 16:51:13 +00:00
zzz
190b76d7fd Tunnels: Improved logging and handling of offline signature expiration
Store back ref to controller in tunnel
Stop server controller on I2PException
Support generation of keys with fractional days expiration for testing
2020-10-29 15:20:56 +00:00
hankhill19580
8d0b1214d2 un-do android check in ObjectCounter and fix hte issue by correctly setting the classpath instead, see RELEASE-PROCESS.md in i2p.android.base 2020-10-29 04:04:18 +00:00
zzz
70eb2a49f9 Router: Fix ECIES tunnel testing part 2
Remove ratchet tag from RSKM on timeout
2020-10-28 13:15:26 +00:00
zzz
f231ea0951 Util: ObjectCounter better android detection 2020-10-28 12:09:55 +00:00
zzz
f9ffdd5137 Router: Fix tunnel testing for ECIES routers 2020-10-28 12:04:01 +00:00
hankhill19580
38f9955391 fix android keySet bug that I discovered this morning 2020-10-28 04:33:47 +00:00
zzz
517ff9af28 Build: Fix dev info in maven data 2020-10-27 15:30:03 +00:00
zzz
62a91acb40 DoH: Limit response size, sort servers for test
SSLEepGet: Fix handling of state param, support max size param
2020-10-27 14:53:11 +00:00
zzz
69a5266675 DoH: Add CLI test of all servers 2020-10-27 12:45:37 +00:00
zzz
e671741329 DoH: Set user agent 2020-10-26 22:47:32 +00:00
zzz
ab55f27ea4 DoH: Add more CLI options for testing 2020-10-26 15:29:59 +00:00
zzz
cf88b3057a DoH: limit total time and max requests
Better loop checking, force DoH off for request
2020-10-26 13:44:23 +00:00
zzz
af97eedcbb Util: Fix EepGet allowCaching parameter
Add SSLEepGet method to force DoH on/off
2020-10-26 12:22:54 +00:00
zzz
7823001594 BOB: Add deprecation warnings 2020-10-25 12:31:50 +00:00
zzz
a49f87179a Router: Quick checks of eph. key MSB before Noise DH
Additional checks on ECIES BRR to catch old/buggy routers
Detailed logging of ECIES BRR decrypt fails
2020-10-25 10:55:53 +00:00
zzz
b52f85ac38 Tunnels: Add missing expiration field to ECIES BRR 2020-10-23 19:42:05 +00:00
zzz
470bc77551 fix one more ;; 2020-10-23 16:10:58 +00:00
zzz
a0822a6b71 NTCP2: Reduce min downtime for rekeying if hidden 2020-10-23 16:09:15 +00:00
zzz
15da2f85ad SSU: Minor cleanup of congestion checkin 2020-10-23 16:05:39 +00:00
zzz
9b3ff9e615 TCG: Rename method to reflect what it really does 2020-10-23 16:03:19 +00:00
zzz
df1db163f0 i2ptunnel: Remove mtn tunnel (new installs only) 2020-10-23 15:50:30 +00:00
zzz
4a4d814a17 Tunnels: Move AES reply keys from HopConfig to TunnelCreatorConfig
to save space; not stored for participating tunnels.
2020-10-23 12:58:45 +00:00
hankhill19580
c84360ba4b Update the Firefox user-agent string to match the Firefox ESR that is currently used in Tor Browser, credit to dr|zed for pointing out the update and the fix. Tor Browser updated to Firefox ESR 78 with the 10.0 release on September 24, 2020 2020-10-22 16:12:26 +00:00
zzz
6a6064d614 Garlic: Reduce log level on misrouted message 2020-10-21 20:24:12 +00:00
zzz
49565a99f9 SSU: Redesign of the congestion control (tickets #2412, #2649, #2654, #2713),
modelled on TCP Reno (RFCs 5681 and 6298)
- Use a single timer per connection
- Resend up to half the un-acked messages per timer event instead of a single message
- Only send either old or new messages, do not mix
- Cache/avoid several timer calls
- Instead of 3 return values, allocating bandwidth is now a boolean function
- Avoid one of the iterations over all un-acked messages every packet pusher loop
- Remove 100 ms failsafe
- Fix OMF debug log NPE
With the same cpu usage the bandwidth is much higher
Significant speed improvement for lossy connections (e.g. wifi)
Patch by zlatinb
2020-10-21 18:14:51 +00:00
zzz
ee27bc3bbf Reseed: Renew SSL cert expiring soon 2020-10-21 15:21:41 +00:00
zzz
25899d41d5 NetDB: ECIES router support (proposal 156):
Support sending encrypted lookups and stores to ECIES routers
Support requesting AEAD replies to ECIES routers
Encrypt RI lookups when using ECIES even on slow machines
Switch back to RatchetSKM
Don't schedule ack timer for router SKM
Reduce getContext() calls
GMB null check cleanup
MessageWrapper javadoc clarifications
Log tweaks
2020-10-21 14:54:47 +00:00
zzz
35f6a2e2bf NetDB: Reseed after a long downtime 2020-10-21 13:46:31 +00:00
zzz
9ae5cbbc87 SSU: Increase socket buffer size (ticket #2781) 2020-10-21 12:44:27 +00:00
zzz
0ace93cec7 i2psnark: Remove references to "maggot" links 2020-10-17 15:19:23 +00:00
zzz
d387448794 ;; -> ; 2020-10-17 14:41:13 +00:00
zzz
4d82917b94 SSU: Fix calculation of nextSendDelay (ticket #2714)
patch from zlatinb
2020-10-17 12:12:15 +00:00
hankhill19580
7a77f48963 Work on lining up some of the button text and icons a little better, fix peer icon and top/bottom icon, various padding issues 2020-10-16 04:55:48 +00:00
zzz
dee5dfc682 clear exec bit 2020-10-15 15:48:39 +00:00
zzz
5ed6f834c1 libjbigi for linux aarch64 (ticket #1840)
stripped
gcc: 7.5.0
jdk: openjdk version "1.8.0_265"
Built on: Raspberry Pi 4 Model B Rev 1.4
Add support to mbuild-all.sh
2020-10-15 15:36:38 +00:00
zzz
3b8e5f0763 i2psnark: Stub out BEP 52 message numbers
Hide BEP 48 padding directory from UI
Check for and reject BEP 52 info multihashes for now
Use cached fai.isDirectory for efficiency
Use storage.getFileCount() instead of meta.getFiles() to prep for padding files
Add notes for padding file TODOs
2020-10-15 12:04:24 +00:00
zzz
7c1798513d Util: Singleton OrderedProperties comparator 2020-10-15 11:54:43 +00:00
zzz
e54950e02e Router: MessageWrapper.wrap() and GMB support for ECIES (prop. #156 WIP)
NetDB parts still TODO
Remove PK param from GMB.buildECIESMessage(), already in config
2020-10-15 11:50:11 +00:00
zzz
b2f060795c Router: Misc. debug fixes
- StatisticsManager fix for null router in unit tests
- Debug toString() enhancements
- Dest hash logs in b32
- Javadoc fix
2020-10-15 11:39:32 +00:00
zzz
940ad61ccc Ratchet: ECIESAEADEngine main() quick test IK/N NSR 2020-10-15 11:32:25 +00:00
zzz
c1f531ea92 Ratchet: Add support for zero key (prop. #144, WIP for prop. #156) 2020-10-15 11:17:41 +00:00
zzz
0ebca7e8e3 Ratchet: Destroy HandshakeState after NS failure 2020-10-15 11:10:33 +00:00
zzz
d301669726 Router: Don't re-derive public key from private for every HandshakeState 2020-10-15 11:01:22 +00:00
zzz
010bb0a2fe NTCP: Fix sending termination on idle timeout (ticket #2777) 2020-10-12 13:29:46 +00:00
zzz
f028002c11 NTCP: Catch IAE in Reader, possibly a race with cancelled key?
http://zzz.i2p/topics/2968
2020-10-12 13:28:57 +00:00
zzz
11e1747ffc New partial translations for Kurdish, Turkmen, Argentinian Spanish 2020-10-12 12:50:49 +00:00
zzz
5dc9333bb6 DTG: Enable by default for Linux KDE and LXDE
Hide option on /configservice if not supported
2020-10-12 11:24:08 +00:00
zzz
f77acb6db6 i2psnark: Don't truncate 'file not found in torrent' status 2020-10-11 16:25:20 +00:00
zzz
22abf09bd7 i2psnark: Version the file icons
Minor cleanup of icon set selector
2020-10-11 13:22:26 +00:00
zzz
9a1d7a2ae3 Installer: Disable pack200 (ticket #2778) 2020-10-11 12:07:09 +00:00
zzz
98e5908557 i2psnark: Cache length of metainfo 2020-10-10 14:59:13 +00:00
zzz
9e36fe090c Transport: Simplify IPv6 address validation
reject reserved ranges
2020-10-10 12:59:53 +00:00
zzz
b4b6968ede Ratchet debug: Hide expired sessions
Hide sessions with null public key
2020-10-09 13:54:12 +00:00
zzz
999c4c51a2 NetDB: Don't use DSA-SHA1 routers for lookups, stores, or tunnel peers
Don't use non-ElGamal routers for lookups or stores
Prevent DSA-SHA1 routers from auto-floodfill
2020-10-09 13:46:37 +00:00
zzz
8737a6a4fd i2ptunnel: Filter server response headers even if not compressing 2020-10-07 15:02:06 +00:00
zzz
a9a5d13e06 Build: Set javac release property (ticket #2775)
Ant version 1.9.8 or higher now required
Drop support for Xenial package build
Fix up BOB build configuration
Fix i2psnark standalone build
2020-10-07 13:33:41 +00:00
hankhill19580
ca1e2ba91e Switch Snark dark and light themes to using images embedded in the .war, and remove the images substitutions from the filesystem and css 2020-10-07 04:47:27 +00:00
zzz
2e34969bbc Add git hostnames as requested by idk 2020-10-04 16:42:50 +00:00
zzz
cead0b2fb8 Router: Add support for building tunnels through ECIES routers (proposals 152,156)
Preliminary, proposal not finalized, subject to change
Not yet compatibility tested with other implementations
Add peers to match requested length for explicitPeers
remove commented out code
log tweaks
2020-10-03 14:05:22 +00:00
hankhill19580
9d566aea68 snark theme fixes: Revert the i2psnark buttons on the ubergine and vanilla themes back to their original versions, but keep flat buttons for dark and light themes. Fix some squashed icons and apply some slightly better icons for indicating torrent status and contents on dark theme. 2020-10-01 05:01:44 +00:00
zzz
2d9933a4a9 Router: Don't unregister a message without a selector (ticket #2771) 2020-09-28 13:59:30 +00:00
zzz
cd699c587b i2ptunnel: I2Ping CLI tunnel quantity 1
Show current setting for owndest in CLI
Skip a irrelevant log message for I2Ping
Break wait on interrupt
Log level tweaks
2020-09-27 14:38:44 +00:00
zzz
4108007b26 JBigI: Fix zen/zen2/zen3 CPU names (ticket #1869) 2020-09-27 14:33:58 +00:00
zzz
b31b42a557 Streaming: Fix copy/paste errors in tag option handling 2020-09-27 14:17:36 +00:00
zzz
c3f187abcb Console: Drop gateway icon on leasesets page,
just adds clutter with no value.
Change last-changed time on leaseset debug page to use standard formatting
2020-09-26 14:05:29 +00:00
zzz
2989d955d9 JBigI: GMP 6.2.0 for linux 64 bit (ticket #1869)
Add support for zen and zen2
Enable more fallbacks for zen and zen2
Adds Zen and Zen2 binaries, stripped
Built with gcc 9.3.0
Other binaries will be added if testing shows improvement
Fix hangs in mbuild-all.sh build script
Add silvermont and goldmont to build script, untested, support TBD
GMP is GPLv2
More info: http://zzz.i2p/topics/2955
2020-09-26 12:58:55 +00:00
zzz
ea4409897d i2ptunnel: Change enctype default to both for:
HTTP, IRC, and Streamr servers
IRC, SOCKS IRC, and Streamr clients
2020-09-22 14:52:55 +00:00
zzz
7dd7f021b0 Susimail, SAM: More defensive ByteBuffer casting to avoid runtime issues (ticket #2775) 2020-09-22 14:39:32 +00:00
zzz
2cb53ec45c Update LICENSE.txt since SSU HMAC was moved from core to router 2020-09-20 13:48:46 +00:00
hankhill19580
8fa3e45e47 Add tags for librejs compatibility on application/console pages and in embedded javascript 2020-09-20 05:05:57 +00:00
zzz
c4a5d111e7 Build: More git support for release and Debian targets 2020-09-18 14:31:24 +00:00
zzz
dca45a9b18 i2psnark: Defensive checks for v2 format files and magnet links 2020-09-16 14:42:11 +00:00
zzz
6ffebbd5c1 GeoIP: Notify blocklist of new country file (ticket #2759) 2020-09-16 13:43:14 +00:00
zzz
aa07775a32 Blocklist: Move HTML status generation to console 2020-09-11 17:21:04 +00:00
zzz
30244f9d9b Router: Use MuxedSKM for ECIES routers (proposal 156 WIP) 2020-09-11 14:13:36 +00:00
zzz
19d4a5ce26 Blocklist: Refactoring (ticket #2759 WIP) 2020-09-10 16:20:08 +00:00
zzz
e4cb730c1b GeoIP: Generate country blocklist when hidden (ticket #2759)
WIP - full blocking requires restart for now
2020-09-10 14:00:04 +00:00
zzz
3b18e54545 Console: Fix /configclients help message for split client config files 2020-09-10 13:01:18 +00:00
zzz
2fbbd8e7d1 Crypto: Cache HMAC256 instances
Appx. 38% speedup
As suggested by jogger
2020-09-09 21:13:37 +00:00
zzz
e466331407 GeoIP: Add methods to get all IPs for a country
from a geoip 1 or 2 database,
to prep for a country blocklist (ticket #2759)
WIP - not hooked in yet
2020-09-09 15:26:24 +00:00
zzz
5d1f46e6c4 Blocklist: Track versions of each file
Adjust synchronization
Fix logging for feed file
Prep for a country blocklist (ticket #2759 WIP)
2020-09-08 13:38:10 +00:00
zzz
36318def69 Tunnels: BuildRequestor minor cleanup 2020-09-08 13:32:24 +00:00
zzz
72e4b16c1a I2NP BRR: Minor cleanup and javadoc note 2020-09-08 13:26:33 +00:00
zzz
8a10c3a097 NTCP: Call afterSend() for multiple messages in NTCP2 (ticket #2769) 2020-09-08 13:17:46 +00:00
zzz
d402300dba Console: Support remote lookup of full router hash from search form 2020-09-04 16:57:40 +00:00
zzz
ada6753255 Tunnels: For now, don't try to decrypt a build record with a ECIES key (proposal 152 WIP) 2020-09-04 15:03:14 +00:00
zzz
ceb0749e0d Util: Fix decompression of compressed zero bytes (ticket #2770) 2020-09-02 15:57:04 +00:00
zzz
4863ab3711 javadoc 2020-09-02 13:51:27 +00:00
zzz
c745cc8aa1 Ratchet: Change SparseArray from int to char to reduce space 2020-09-02 13:48:30 +00:00
zzz
273902f616 SSU: Randomize intro key 2020-09-02 13:26:10 +00:00
zzz
bb761aea96 Router: Prep for router encryption types (Proposal 156 WIP) 2020-09-02 13:09:38 +00:00
zzz
d13a7d2872 Router: Reduce next key threshold for ratchet 2020-09-02 12:55:21 +00:00
zzz
49b2ca061c New Ed25519 destinations for postman's servers 2020-09-02 12:52:25 +00:00
hankhill19580
3e23ec8d27 fix trac#2768 2020-09-01 14:14:39 +00:00
zzz
22eeb90b81 Bump -1 2020-08-29 13:44:11 +00:00
zzz
6a69cef2a8 Ratchet: Minor cleanup 2020-08-29 13:41:48 +00:00
zzz
c1fef302f3 Crypto: ChaCha small initialization speedup 2020-08-29 13:39:52 +00:00
zzz
bd370cf407 spelling fix 2020-08-29 13:34:42 +00:00
zzz
feba993019 javadoc fix 2020-08-29 13:34:00 +00:00
zzz
623a11dd8f console: ngettext fixes 2020-08-29 13:32:34 +00:00
zzz
ba7fb00450 i2ptunnel: Prevent changing alt private key file while running 2020-08-29 12:52:00 +00:00
zzz
20b4186331 merge of '554c9e737b3a7b6585cc36c8e22de6012ca57754'
and 'cd8c225752a1e1e5be98c13e7e7f5fdb2b160642'
2020-08-25 19:50:03 +00:00
zzz
2479645d22 Debian files and checklists update for 0.9.47 2020-08-25 19:49:54 +00:00
hankhill19580
8585e2e955 fix heading alignment for console news on light theme 2020-08-24 17:20:34 +00:00
hankhill19580
14518dc396 fix missing classic icons from imagegen css/index, removed classic reference ie-compatability from css.jsi 2020-08-24 17:15:40 +00:00
zzz
ccd64b6f07 0.9.47 2020-08-24 15:33:54 +00:00
zzz
21efdb9bd0 bump for review 2020-08-21 19:18:06 +00:00
zzz
94778c74dc update translations 2020-08-21 19:09:48 +00:00
hankhill19580
929c09fecc add fontawesome license to router console themes section in LICENSE.txt 2020-08-20 19:35:03 +00:00
zzz
c067f38123 GeoIP 2020-08
Meet db-ip.com license requirements
BuildTime update
2020-08-20 15:39:12 +00:00
zzz
046d1e01b0 make method private 2020-08-19 18:52:18 +00:00
zzz
cc6247fe7e findbugs all over 2020-08-19 14:50:58 +00:00
hankhill19580
797a31924d Improve appearance of a few icons from the new icon set, all are under Fontawesome license except for move_up.png, move_down.png, move_top.png, and move_bottom.png which are used under the Feather license 2020-08-16 18:01:54 +00:00
zzz
87f9b619e5 welcome text correction 2020-08-14 15:00:23 +00:00
hankhill19580
4ac89e7024 Remove mistaken association between Localization Lab and our Transifex efforts. 2020-08-14 13:49:18 +00:00
zzz
fceda68cd8 Remove reseed 2020-08-14 12:58:18 +00:00
zzz
07fc66ccff Profiles: Create profiles in the nonblocking path
thanks energy52
2020-08-14 12:54:39 +00:00
zzz
d7b512ca9a spelling fix 2020-08-13 19:11:00 +00:00
hankhill19580
926f88585a fix typo on welcome.jsp 2020-08-13 18:08:58 +00:00
zzz
717e1c58fa Transport: State transition fix 2020-08-13 15:38:03 +00:00
zzz
4b3dbd8915 poupdate-source 2020-08-12 18:49:44 +00:00
hankhill19580
9d31a41ffe remove extraneous comma 2020-08-12 18:33:50 +00:00
hankhill19580
217571118b tag complete sentences for strings in welcome.jsp 2020-08-12 18:29:10 +00:00
hankhill19580
b03e919cbe fix strings on welcome.jsp 2020-08-12 17:50:12 +00:00
hankhill19580
482b305065 Fix fontawesome license file 2020-08-12 13:33:55 +00:00
hankhill19580
27776cddb2 use color versions of the new icons(last big image checkin), add custom images for community sites, tweak some sizes on images that were squashed or stretched, remove borders on /home buttons 2020-08-11 22:01:50 +00:00
hankhill19580
029e082cfc note icon change in history.txt 2020-08-11 05:21:18 +00:00
hankhill19580
6087a46a0b replace basically every small image, icon, or indicator with one from a consistent source, minus personal/community sites and plugns, see licenses/LICENSE-fontawesome for more details 2020-08-11 05:10:00 +00:00
zzz
b78f6a645c Debian: Fix patch offsets 2020-08-01 14:16:16 +00:00
zzz
f8b04e398e Debian: Support libjson-simple-java 3 for bullseye
Patch adapted from Gilles Filippini
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=960589
2020-08-01 14:12:54 +00:00
zzz
097f178e2a I2NP: Locking for message ID 2020-08-01 13:49:43 +00:00
zzz
d221846c31 NetDB: Only flood LS to rotated floodfills just before
midnight if the LS will expire after midnight
Reduce number of stat periods
2020-08-01 13:34:26 +00:00
zzz
fa08d2f946 Util: Add KeyStore and SHA256 to CLI 2020-08-01 13:22:24 +00:00
zzz
336563e7c0 Router: Logging fix for client start failures 2020-08-01 13:04:33 +00:00
zzz
f4ac8e02f6 Util: More efficient use of random data 2020-08-01 12:59:50 +00:00
zzz
29d2051a34 configlogging code cleanup 2020-08-01 12:48:53 +00:00
zzz
e52359c4c0 NetDB: New reseed 2020-08-01 12:40:46 +00:00
zzz
d73b327fd0 NetDB: Track client that requested LS
OCMOSJ: Don't send to a RAP LS
2020-08-01 12:36:31 +00:00
hankhill19580
d1bdeae596 replace tabs with spaces in HomeHelper.java 2020-07-31 14:51:05 +00:00
hankhill19580
fa8bd4310c fix typos in the welcome wizard 2020-07-29 02:38:56 +00:00
zzz
4f8f8b659b Drop more old susi files 2020-07-28 20:34:07 +00:00
zzz
5a9eb68160 Data: Don't check LS1 revocation signature 2020-07-28 16:14:05 +00:00
hankhill19580
b97ec8da90 clean up some of the awkward language on the welcome wizard, don't ask people to 'be patient' explain what is happening, etc 2020-07-27 17:01:48 +00:00
zzz
a3fe0092ac i2ptunnel: Change CONNECT tunnel default sigType to EdDSA (ticket #2749) 2020-07-22 17:18:23 +00:00
zzz
896dbfbacf i2ptunnel: Change default encType to both for new tunnels,
http client, shared clients, and all tunnels for new installs (ticket #2751)
Change IRC tunnel sigType to EdDSA for new installs (ticket #2749)
2020-07-22 15:34:43 +00:00
zzz
4d3561c92a i2psnark: Increase max pipeline, negotiate actual value 2020-07-19 14:45:48 +00:00
hankhill19580
3c7b658a59 Avoid some repeated code 2020-07-16 05:25:02 +00:00
hankhill19580
6482437795 Move plugins to their own section on /home, and make it so that if all the elements of a section are shown, that section becomes hidden(so that plugins are not enabled by default) 2020-07-15 16:06:06 +00:00
zzz
12e2dabaa8 Router: Consistent logging for network ID check
Log level change for peer test IP
2020-07-11 14:19:01 +00:00
zzz
e05545ab7c OCMOSJ: Don't lookup an expiring LS2 if unpublished 2020-07-11 13:53:53 +00:00
zzz
f0bcab2e2c NTCP: Atomics for NTCP final state (ticket #2701) 2020-07-11 13:12:25 +00:00
zzz
075ac7ab43 SAM: Rename 3.3 control session 2020-07-09 17:05:06 +00:00
zzz
31d7d7d9bb Addressbook: Rename the book nobody uses
Config migration
Version the svg
Remove very old standalone files
2020-07-09 16:45:37 +00:00
hankhill19580
ed14aa130c Credit sadie for the first part of her redesign work 2020-07-08 17:44:12 +00:00
zzz
81007c1a03 LookupDestJob: Missing return after sending fail for blind data 2020-07-07 15:04:02 +00:00
zzz
2e3ff679f3 i2psnark: Change ETA default sort order (ticket #2733)
add markdown mime type
2020-07-07 13:22:44 +00:00
zzz
a84996399e Reseed: Enforce minimum version for bundling 2020-07-07 12:50:34 +00:00
hankhill19580
7b872474fd turn URL's in readme into Markdown Links using URL as link text, as suggested by user gnuself on trac and approved by idk 2020-07-04 21:02:20 +00:00
hankhill19580
531b7c2ae9 Remove extra step-indicator from first slide of welcome wizard 2020-07-03 23:21:15 +00:00
hankhill19580
95f16c99bd Remove Why I2P from the welcome wizard. Make the welcome wizard more informative about the functionality contained within I2P. Tweaks to stylesheets on the welcome wizard. 2020-07-03 23:18:14 +00:00
hankhill19580
462180f9a4 re-name full color logo(logogrey7.png=>wizardlogo7.png) used in welcome wizard and remove the old redundant ones. 2020-07-03 16:15:32 +00:00
hankhill19580
505c49ad01 Tweak position of headings and infoboxes in welcome wizard, switch to full-color I2P logo on all pages 2020-07-03 15:36:14 +00:00
hankhill19580
16d6cf0177 make expanding sections scrollable on iframed dark theme 2020-07-02 12:44:42 +00:00
zzz
112beb552b i2ptunnel: Fix missing throttling section for non-HTTP servers 2020-07-02 12:15:54 +00:00
hankhill19580
b53cdafc84 clarify license status of new wizard assets 2020-06-28 18:50:34 +00:00
zzz
365b9053ec NetDB: Check signature in verify
Remove null checks, _target can't be null
2020-06-28 14:56:08 +00:00
hankhill19580
aadc9a13aa improve appearance of textareas and inputs when the text inside is highlighed, on the i2ptunnel dark theme 2020-06-26 22:08:16 +00:00
hankhill19580
39f3e3a92c more non-textual updates to the bandwidth wizard 2020-06-24 18:02:25 +00:00
hankhill19580
9a6374c79b new images for the install wizard, re-name the images, even up the font sizes on the bandwidth configuration pages 2020-06-23 21:51:53 +00:00
zzz
3a392e84a9 Sybil: Enable analysis and blocking by default 2020-06-22 19:59:35 +00:00
zzz
c119de6188 OCMOSJ: Send meta LS failure code 2020-06-13 13:56:31 +00:00
zzz
066833819b another Broadwell CPU ID 2020-06-12 16:00:44 +00:00
zzz
c840f223cd CSS tweak 2020-06-12 15:59:12 +00:00
zzz
4c2bf3e42f I2CP: Meta LS error code handling 2020-06-12 15:58:30 +00:00
zzz
6ec95a7f13 Misc. Javadoc fixes 2020-06-10 15:28:22 +00:00
zzz
670e57b9e5 Tools: Support hostname lookups in LookupDest CLI 2020-06-10 15:21:22 +00:00
hankhill19580
d441ead884 Fix awkward text, browsers should be plural 2020-06-09 17:11:43 +00:00
hankhill19580
38f654edd9 Fix awkward text on console welcome browser page, adjust table spacing on configreseed 2020-06-09 17:09:36 +00:00
zzz
25b4d136b8 fix take 2 2020-06-08 12:35:06 +00:00
zzz
2b9783028d fix dup 2020-06-07 20:57:45 +00:00
zzz
6c0e18d3e2 i2ptunnel: Fix missing tunnel quantity section for servers
More ngettext
Hide some text for config advanced
2020-06-07 20:00:50 +00:00
zzz
e23f671ca3 Util: New getEstimatedDowntime() method 2020-06-07 17:20:45 +00:00
zzz
2af7066074 Jetty: Switch from jetty to tomcat jar for servlet-api
to get the 4.0 dtds
Put servlet version on the logs page
2020-06-07 16:22:21 +00:00
zzz
220f641ba6 i2ptunnel: Warn about soon-to-expire offline signatures 2020-06-06 19:42:07 +00:00
zzz
76493b398f i2ptunnel: Rename access lists 2020-06-06 19:29:45 +00:00
zzz
f1a277c4d7 I2CP, i2ptunnel: Check for expired offline signature client-side
Better error message on the router side
2020-06-06 18:44:49 +00:00
zzz
ac76d544b9 Fix creation of Encrypted LS2
Blinded flag bit goes on the inner LS, not the outer
Fix corruption of inner signature
Broken in 0.9.42
2020-06-06 17:24:26 +00:00
zzz
cd77461fba I2CP: Fix issues with persisted leaseset private keys
- Don't generate revocation key for LS2
- Fix generation of persistent revocation key for LS1
- Fix persistent private keys without persistent revocation key
- Don't put unconfigured private keys in leaseset
- Don't strip i2cp.leaseSetPrivateKey from config before it's used
2020-06-06 14:36:01 +00:00
zzz
326178ad47 CI: Try to fix travis 2020-06-03 16:09:01 +00:00
zzz
0fce24479f i2psnark: Enable dual-keys 2020-06-03 15:41:09 +00:00
zzz
3f895d32dd Router: Implement ratchet-layer acks (proposal 144)
Store destination in outbound session
Allow sending null data through OCMOSJ for ratchet acks; omit data clove
Only call messageDeliveryStatusUpdate() for nonzero nonce
2020-06-03 12:33:09 +00:00
zzz
2af26f7d5b Console: Fix alignment of totals row on /peers NTCP tab
as reported at http://zzz.i2p/topics/2901 post #5
2020-06-03 11:19:47 +00:00
zzz
765d4ea725 Console: Don't list temporary IPv6 addresses on /confignet 2020-06-02 12:01:40 +00:00
zzz
ec231ecd78 Transports: Cache the last reachable peer
Adapted from i2speed / jogger
ref: http://zzz.i2p/topics/2894 item 5
2020-06-01 13:08:03 +00:00
zzz
957767c985 Util: Move fromLong8()/toLong8() methods to DataHelper 2020-06-01 12:25:09 +00:00
zzz
3cc7374984 Transports: Make unreachable maps concurrent
Adapted from i2speed / jogger
ref: http://zzz.i2p/topics/2894 item 5
2020-06-01 12:12:04 +00:00
zzz
6461c8e880 Profiles: Make more calls nonblocking
Adapted from i2speed / jogger
ref: http://zzz.i2p/topics/2894 item 1
2020-06-01 12:03:56 +00:00
zzz
edfbc4081b Tomcat 9.0.35 (Servlet 4.0)
Switch Bionic to 9.x
Disco+ already on 9.x
Xenial remains on 8.x
Update dependencies doc
2020-05-31 15:35:18 +00:00
zzz
317bf1e9db Fix javadoc errors 2020-05-31 12:46:13 +00:00
zzz
f985004be0 Util: Update json-simple lib to 2.3.0 2017-10-04
Bundle 2.0 API only; remove 1.1 API
Convert DoH, NDT, and i2pcontrol to the 2.x API
Fix i2pcontrol handling of number values and serialization for 2.x API
Remove xenial dependency on libjson-simple-java, it has only 1.1
Set min and max version constraint on libjson-simple-java for bionic+
Based on patch from Gilles Filippini
ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901827
This does not support 3.x but the patch for that will be smaller.
2020-05-31 12:37:37 +00:00
zzz
4fd834d13e Util: Fix DoH handling of Cloudflare responses 2020-05-30 21:44:48 +00:00
zzz
370f96acfb Streaming: Increase MTU for ratchet (proposal 155)
Set MTU in receiveConnection() for inbound connections
Cleanup CDR.isAckOnly()
Only call now() in MOS for debugging
Set receive.streamActive stat to 1, not 0
2020-05-30 16:24:25 +00:00
zzz
d8b308dd9d Build: Force Java 7 for mavencentral jars used by Android 2020-05-28 14:06:37 +00:00
zzz
3ad8f9b9a5 i2psnark: Fix js for delete buttons (ticket #2743) 2020-05-28 13:02:53 +00:00
zzz
4fe9a27e2e RRD4J 3.6 (ticket #2716) 2020-05-28 10:33:03 +00:00
zzz
686fe88e61 Build: Remove javac.compilerargs7 build property (ticket #2511) 2020-05-27 17:46:30 +00:00
zzz
9b5e4373d4 Debian: Fix patches for Jetty 9.3.28 (ticket #2098)
Add xenial patch to ant test target
2020-05-27 17:19:16 +00:00
zzz
03b1a4dfc0 Installer: Require Java 8 (ticket #2511)
Jetty 9.3.28 (ticket #2098)
This breaks Debian builds, fixes to follow
2020-05-27 16:08:54 +00:00
zzz
27e422f81d Installer: Sign the dlls (ticket #2704) 2020-05-27 13:23:54 +00:00
zzz
f3e821a65d UPnP fixes part 7:
Don't set I2P user agent, spoof MiniUPnPc
Don't convert string-to-bytes-to-string
Don't fallback to alternate code after failure
Don't use HttpURLConnection if proxy enabled
Add location sanity checks
Force Connection: close
Don't attempt to set Host header, HttpURLConnection ignores it
Disable following redirects
2020-05-27 12:49:15 +00:00
zzz
3fac44874e Console: Rename all the js init() functions 2020-05-27 12:35:12 +00:00
zzz
f8df7eba7f Transports: Check for Java proxy settings that could interfere 2020-05-27 12:07:50 +00:00
zzz
4574ebd8a9 Console: Don't translate "caps" 2020-05-27 11:57:59 +00:00
zzz
a00b9bb0c7 Console: Handle bad param on /peers 2020-05-27 11:54:06 +00:00
zzz
e091eeae90 Util: Reduce default gzip compression level for performance
Add fast zero-decompressor
2020-05-27 11:48:21 +00:00
zzz
0a98147315 Debian files for 0.9.46 2020-05-26 17:11:42 +00:00
zzz
e9cc4a4357 0.9.46 2020-05-25 12:32:28 +00:00
zzz
0ab4730002 javadoc fix 2020-05-25 10:25:21 +00:00
zzz
31d7b6fb7d Ratchet: Change session replace timeout value to match spec 2020-05-23 11:31:03 +00:00
zzz
26e5f4c482 Windows: Fix installation directory permissions
For new installs, change owner rather than giving 'F' permission to Users group
For existing installs, change owner and change 'F' permission to 'RX' for Users group
Local privilege escalation vulnerability
Introduced 2009-06-11, released in 0.7.5 2009-06-29
Reported by Juilo Cesar Fort of Blaze Information Security 2020-04-28
2020-05-23 11:28:15 +00:00
zzz
766649bd54 bump for review 2020-05-22 19:47:53 +00:00
zzz
bb6641ed96 pull translations from TX 2020-05-22 19:35:57 +00:00
zzz
6aa81f7ec6 UPnP fixes part 6:
Fix malformed HTTP requests
Check HTTP response code in Parser
Check content type in Parser
Debug log in Parser
Show device URL in CLI
Don't retry after parser exception
Close resources in finally block
2020-05-22 18:22:56 +00:00
hankhill19580
a3fc8af1dd fix padding on the i2ptunnel .username and .password and and the width of the customoptions 2020-05-22 02:30:03 +00:00
hankhill19580
05082e3ffa On iframed i2ptunnel pages, resize the height of the iframe when a config table is expanded or contacted 2020-05-22 01:29:28 +00:00
hankhill19580
4b655070d4 reverse string change to welcome wizard, Alternatively isn't that confusing and translation is important. 2020-05-21 16:58:10 +00:00
zzz
f25037447d unit test tweaks 2020-05-21 14:11:30 +00:00
zzz
df3a03afc5 Streaming: Fix timer race (ticket #2739) 2020-05-21 11:47:39 +00:00
zzz
ded4bde905 I2CP: Add API method to get router version 2020-05-20 19:03:28 +00:00
hankhill19580
e1d8e360a5 slightly widen the notice div on the console so text never needs to wrap 2020-05-20 17:56:43 +00:00
hankhill19580
b373e253c9 Remove reference to to I2P Browser from the welcome wizard 2020-05-20 17:40:40 +00:00
zzz
a9d84da3b3 i2ptunnel, SusiDNS: Replace onblur with CSP-safe js 2020-05-20 11:12:49 +00:00
zzz
4b7c62aa9c Tunnel: Reduce the IBGW and client OBGW batch time
Should reduce RTT by 225 ms
2020-05-20 10:48:00 +00:00
zzz
e16c0a3271 i2ptunnel: Disable gzip for streamr server 2020-05-20 10:44:28 +00:00
zzz
ef66457181 Util: Speed up zero compression
As suggested by orignal
2020-05-19 14:24:20 +00:00
zzz
093c46c937 Ratchet: Prep for ratchet-layer acks (WIP) 2020-05-18 13:00:45 +00:00
zzz
d48d16d237 Proxy: Fix error code for incompatible encryption 2020-05-18 12:25:25 +00:00
zzz
65cd84dd2e Reseed update 2020-05-18 10:40:16 +00:00
zzz
c457ef68c7 New MuWire logo
License: CC0
Source: Funded by MuWire development
2020-05-18 09:56:15 +00:00
zzz
f00b86475d Streamr: Add expiration timer
Log tweaks
2020-05-17 18:49:47 +00:00
zzz
90bc00436c UPnP fixes part 5:
Set interfaces at startup, to prevent Android from binding to public interfaces
Log fix
2020-05-17 15:47:08 +00:00
zzz
1af32bfe79 UPnP fixes part 4:
Update SSDP listening sockets on interface changes
2020-05-17 14:56:30 +00:00
zzz
25338019ca UPnP fixes part 3:
Switch to alternate device on connected event if better
Remove mappings on device change
Fix bug, wasn't removing mappings on device removal
Retry other devices on device removal or disconnect
2020-05-17 11:05:35 +00:00
zzz
878c11b36f UPnP fixes part 2:
Change data structure of ignored devices to store full device
Don't ignore disconnected devices even if subscription successful
Clear event veriables when switching devices
Hide non-IGD devices from ignored list
2020-05-16 22:45:27 +00:00
zzz
c6c9ba76d9 UPnP fixes part 1:
Numerous fixes for handling multiple devices and selecting the best one
Fixes on device removal
Deal with devices that support permanent leases only
Locking fixes
Sort ignored devices in UI
Remove unused isDisabled field
Log tweaks
2020-05-16 21:16:51 +00:00
zzz
a0261e8fd7 BuildTime update 2020-05-16 11:50:27 +00:00
zzz
d493028c1e i2ptunnel: Disables for persistent client key 2020-05-16 11:47:21 +00:00
zzz
3992ea235d i2ptunnel: Remove javascript from proxy error pages
Add security headers
Fix typo on resetp-header
2020-05-15 21:31:37 +00:00
zzz
31b527a4c4 i2ptunnel: Hide description label if none
Identify shared clients on index page
2020-05-15 19:32:23 +00:00
zzz
09b647f283 i2ptunnel: Don't show b32 twice for non-http servers 2020-05-15 17:59:45 +00:00
zzz
40b312d7c1 Streaming: Change pushBackRTO() log error to warn (ticket #2739) 2020-05-14 18:47:54 +00:00
zzz
fad9d0e3da param length check 2020-05-14 12:57:24 +00:00
zzz
31a57b1a60 poupdate-source 2020-05-13 23:03:02 +00:00
zzz
50e44ece54 Tools: Export private key from private key file in X.509 form
Add missing loadprivatekey command to CertUtil
2020-05-13 20:19:12 +00:00
zzz
f233416bf6 Build: Tweaks for git 2020-05-13 13:28:33 +00:00
zzz
1b3885720a Console: Fix option text on /confignet (ticket #2738) 2020-05-13 12:58:10 +00:00
zzz
82dd9435a3 Console: Support stuffing form from params on /configreseed
Fix HTML errors
2020-05-13 11:40:01 +00:00
zzz
bc89d247ec Console: Support stuffing form from params on /configplugins 2020-05-13 11:04:16 +00:00
zzz
fe36482063 Console: onchange removal 2020-05-12 18:57:29 +00:00
zzz
a47f6d1b2e SusiMail: onclick removal (part 3)
Strict CSP
Fix markall/clearall logic
2020-05-12 17:43:27 +00:00
zzz
8aa23c7dc7 SusiMail: Replace onclick part 2 2020-05-12 17:32:46 +00:00
zzz
0eef0dd21b SusiMail: Replace onclick and onload, part 1
Don't reload page after mark-all and clear-all
2020-05-12 17:03:59 +00:00
zzz
a12a26f65c Console: Hide sensitive properties on /configadvanced 2020-05-12 15:38:25 +00:00
zzz
1ebed8b6aa i2ptunnel: Shared client tooltip depends on current setting 2020-05-12 14:53:56 +00:00
zzz
deb0fe338c i2ptunnel: Hide shared client warning when it doesn't apply 2020-05-12 14:17:31 +00:00
zzz
005f79c95f i2ptunnel: Disable changing shared client option while running 2020-05-12 14:07:30 +00:00
zzz
eeee8d7600 i2ptunnel: Use readonly, not disable, to avoid losing data in forms
Fix disabling of interface select box
Caused by disable changes on May 8
2020-05-12 13:21:25 +00:00
zzz
13cfdf0d5a i2ptunnel: Encrypt keys in forms 2020-05-12 12:50:35 +00:00
zzz
e77c3f23d3 i2psnark: Stricter CSP 2020-05-11 21:08:57 +00:00
zzz
d157daea10 i2psnark: Remove onclick on delete buttons
Version the js
2020-05-11 20:47:42 +00:00
zzz
9aa36562b9 i2psnark: Remove onclick on folder page 2020-05-11 20:12:40 +00:00
zzz
6a36b79a95 i2psnark: Remove onload 2020-05-11 19:33:00 +00:00
zzz
2cd2f25c56 Console: Remove onload and unsafe CSP on iframed pages 2020-05-11 18:04:19 +00:00
zzz
8631db8769 i2ptunnel: Replace edit onclick with js file
Remove unsafe CSP
2020-05-11 17:12:12 +00:00
zzz
7da2ac9ef3 Console: Fix delete confirmation on /configplugins
Replace /configclients and /configplugins onclick with js file
Remove unsafe CSP on /configclients
2020-05-11 16:43:53 +00:00
zzz
4da58258f5 i2psnark: Check for non-i2p URL 2020-05-10 20:28:30 +00:00
zzz
4f78040569 i2psnark: Check for non-i2p URL 2020-05-10 19:21:52 +00:00
zzz
0738d1d1fb i2psnark: Fix section anchors 2020-05-10 19:16:04 +00:00
zzz
e99e15209a i2psnark: Expand section when param passed in
(prep for handler)
2020-05-10 16:18:29 +00:00
hankhill19580
96a8aa9d0c clear susidns notification the next time the user clicks anywhere on the page, closes #2419 2020-05-10 07:36:47 +00:00
hankhill19580
0bbd747f82 clear susidns notification the next time the user clicks anywhere on the page, closes #2419 2020-05-10 07:35:40 +00:00
zzz
e31b837a7f Console: CSS fix hover over disabled button 2020-05-09 21:47:15 +00:00
zzz
ab7e428624 GeoIP: Add to CLI 2020-05-09 19:37:28 +00:00
zzz
565e7f4d67 GeoIP: Log tweak 2020-05-09 15:52:57 +00:00
zzz
910de68495 Build: Release prep - Geoip 2020-05, checklist, deletelist 2020-05-09 15:50:58 +00:00
zzz
e904c9981e i2ptunnel: Move CSS to own dir, remove allowCSS() and allowJS() 2020-05-09 12:42:44 +00:00
zzz
ddc372f58c NDT: Replace Java Timers with SimpleTImer2 to eliminate two non-daemon threads 2020-05-09 12:12:32 +00:00
zzz
4ff234c110 i2ptunnel: More disabled options 2020-05-08 22:29:09 +00:00
zzz
69ef47e68c i2ptunnel: Tooltips for disabled options 2020-05-08 20:47:39 +00:00
zzz
59901ec7c3 i2ptunnel: Fix padding on password form 2020-05-08 19:22:21 +00:00
zzz
13e38f3d3e i2ptunnel: Disable changing LS encryption on running tunnel 2020-05-08 19:16:05 +00:00
zzz
4b85f06951 Build: Fix more targets when in git workspace 2020-05-08 15:34:35 +00:00
zzz
08df2ba907 Build: Use git rev if mtn rev not available
Adapted from patch by dr|zed
2020-05-08 14:38:56 +00:00
zzz
7a192b4961 Console: More netdb formatting improvements
Hide signing key if not full
Label changes
2020-05-08 14:06:46 +00:00
zzz
d18f622458 CoreVersion: Fix previous change which broke build script 2020-05-08 13:48:33 +00:00
zzz
8a482659e0 Console: Fix padding when no addresses 2020-05-08 12:45:32 +00:00
zzz
eeecede382 Add another CoreVersion field specifically for StatisticsManager (ticket #2729) 2020-05-08 12:21:26 +00:00
zzz
d49741c2db Router: FloodfillPeerSelector cleanup (ticket #2694) 2020-05-08 11:09:11 +00:00
zzz
2ac2850cd4 Router: Min version for tunnel peers 2020-05-07 17:17:15 +00:00
zzz
3d56545210 Router: INMP and netdb DSRM selector cleanup 2020-05-07 13:25:31 +00:00
zzz
5de76252ea Router: Prevent INMP config setting from breaking things 2020-05-07 10:35:14 +00:00
zzz
778d6a2809 Streaming: Reduce default ack delay to match RFCs (ticket #2706) 2020-05-06 13:59:41 +00:00
hankhill19580
f90cbaba5a update history.txt to include my changes to i2ptunnel and susimail. 2020-05-05 19:19:04 +00:00
zzz
6510e07b8b Console: Handle wrapper log trunctaion
More efficient line skipping
2020-05-05 16:27:07 +00:00
zzz
4996c05361 i2ptunnel: Add ECIES persistent key support
Fix changing enc type on servers
2020-05-05 14:38:04 +00:00
zzz
78effe14ad Console: Fix log clearing without wrapper (ticket #2449)
Use ABQ as buffer when reading
2020-05-05 12:51:41 +00:00
zzz
122b12fa31 i2ptunnel: Remove experts label from dual-key option
Header tweaks for translatability
2020-05-05 10:42:15 +00:00
zzz
438703a29b Ratchet: Add padding based on optimal message size
remove unused method
log tweaks
2020-05-05 10:39:16 +00:00
zzz
467a48cfe1 Build: Use --java2 for msgfmt
Runtime should be smaller and faster w/o Hashtable
Increases p200 size by < 1%; repack by 3.5%; updater by 4.5%
2020-05-05 10:36:56 +00:00
zzz
2b1c6a9d8f Console: Add wrapper log clear button (ticket #2449) 2020-05-04 21:22:13 +00:00
zzz
f1307614c6 Console: Add log clear buttons (ticket #2449) 2020-05-04 16:59:46 +00:00
zzz
ea8e340895 Util: Change LogConsoleBuffer implementation (prep for ticket #2449) 2020-05-04 15:26:50 +00:00
zzz
26af857dc7 i2ptunnel: Copy over all relevant options to other shared clients
when saving, not just tunnel quantity and length (ticket #1545)
Don't take sig type from client private key file unless persistent option is set also
2020-05-04 14:10:20 +00:00
zzz
f04526d83a Console, eepsite: Fix Arabic translation of 'Arabic' (ticket #2731) 2020-05-03 17:37:47 +00:00
zzz
a255a60944 Crypto: Don't start YK thread in app context 2020-05-03 11:06:46 +00:00
zzz
b4de0cfaf9 Crypto: Interrupt YK thread when empty 2020-05-03 09:56:21 +00:00
zzz
2188d6b222 Checkmark fix take 2 2020-05-03 09:48:04 +00:00
zzz
0528e4109d I2CP: Add PROP_GZIP
i2ptunnel: Disable I2CP gzip for HTTP server tunnels
i2psnark: Disable I2CP gzip
2020-05-02 22:16:39 +00:00
zzz
47f09479ad eepsite: Fix RTL issues on Arabic help page (ticket #2731)
patch from 'rany'
2020-05-02 10:50:44 +00:00
zzz
80d24fa70d Console: Only call getTheme() once 2020-05-02 10:38:37 +00:00
hankhill19580
bef9ea11bf fix collapsing table behavior on i2ptunnel edit pages 2020-05-01 23:33:09 +00:00
hankhill19580
278090a772 add missing icon from susimail light theme, fix padding on tables in i2ptunnel 2020-05-01 21:43:31 +00:00
zzz
eab688b0bc Ratchet: Fix NPE ratcheting IB NSR tagset 2020-05-01 14:04:14 +00:00
zzz
788c72c331 javadoc 2020-05-01 11:53:11 +00:00
zzz
90d9843acc Router: I2NP debug log improvements 2020-05-01 11:51:28 +00:00
zzz
d7095b69b9 Streaming: Cleanup, use field instead of method 2020-05-01 11:19:07 +00:00
zzz
dd96e29213 Streaming: Fix overhead documentation 2020-05-01 11:16:55 +00:00
zzz
fd3e181b7c i2ptunnel: Prevent changing types on stopped shared client if other shared clients are running 2020-04-30 15:19:51 +00:00
zzz
d7b5783674 i2ptunnel: Prevent changing enc type on running tunnel 2020-04-30 13:38:38 +00:00
zzz
634802c008 Streaming: Westwood+ congestion control (ticket #2719)
Increase max slow start window to 64
Change RTT calculations from double to float
Original idea from jogger
Original patch from zlatinb
Developed and tested with zlatinb
2020-04-30 12:44:55 +00:00
zzz
9e233b42a5 Ratchet: Error handling fixes, log tweaks 2020-04-30 11:29:08 +00:00
zzz
4cf8bfbe0d Ratchet: Increase callback timeout
- Mark tagsets after ratchet, and single tagsets, as acked
  so we don't go searching for the reverse tagset
  or adjust the expiration downward
- Eliminate redundant split() calculation
2020-04-29 21:40:25 +00:00
zzz
e1beeb3653 Log cleanup 2020-04-29 12:57:58 +00:00
zzz
82a918b37d Susimail, EdDSA: Convert Hashtable to HashMap 2020-04-29 12:54:37 +00:00
zzz
b6ecad3c0f Router: Convert Vector to List 2020-04-29 12:37:46 +00:00
zzz
e9d56d85af Console: Event log param fix again 2020-04-28 14:40:57 +00:00
zzz
b874bb2ba0 Ratchet: Block format updates 2020-04-27 20:51:02 +00:00
zzz
7f179551b7 javadoc 2020-04-27 19:54:44 +00:00
zzz
10be87bb59 Ratchet: Reduce tagset expiration
other minor cleanups
2020-04-27 19:52:39 +00:00
zzz
5173d24c72 Crypto: Reduce max ElG tagset expiration at receiver 2020-04-27 19:50:39 +00:00
zzz
f4a37ce75f i2psnark: Don't unchoke when we don't have pieces
Don't avoid partial pieces if there are several seeds
2020-04-27 19:49:09 +00:00
hankhill19580
ff4cfd3eb0 improve collapsing table behavior 2020-04-27 03:17:48 +00:00
hankhill19580
8b6d8507ec improve collapsing table behavior 2020-04-27 03:17:12 +00:00
hankhill19580
65356f09a6 Fix padding on tunnelName 2020-04-26 11:43:02 +00:00
hankhill19580
b0c6c845bf Improve toggle behavior 2020-04-26 11:31:14 +00:00
hankhill19580
6859baba9f Make custom options full width of i2ptunnel page 2020-04-26 09:40:04 +00:00
hankhill19580
c14541f4a3 Fix bug where the second time you opened a +/- table a - would not be shown and make the rest of the CSS line up right 2020-04-26 09:29:42 +00:00
hankhill19580
1083d2939b fix +/- expand collapse on i2ptunnel tables, and fix the padding 2020-04-26 02:19:47 +00:00
zzz
2a8f23602a i2psnark: Increase min size for video preview
CSS tweaks for large videos
Mime types update
2020-04-25 14:39:05 +00:00
zzz
da5c92a599 Console: Fix summary bar event log link param (thx drzed) 2020-04-25 13:02:44 +00:00
zzz
baa26aec26 Tests: Prevent ratchet NPE in local tests 2020-04-25 11:01:27 +00:00
zzz
9da290831b Ratchet: Variable tagset lookahead/trim limits
Remove total size trimming, it's redundant
2020-04-25 10:32:33 +00:00
zzz
882f853b1d Console: Change event log param from ms to sec 2020-04-24 12:58:53 +00:00
zzz
a7de9a7f24 i2psnark: Don't mark torrent BAD on I2CP errors (ticket #2725)
Logging:
 - Log to wrapper log after log manager shutdown (ticket #2725)
 - sync methods
Router:
 - Allow clients more time to get disconnect messages at shutdown (ticket #2725)
 - Don't delete router context at shutdown, to prevent a late
   creation of a new app context (ticket #2725)
 - Don't try to delete ping file on Android
javadocs
2020-04-24 12:44:17 +00:00
zzz
f2f6dfbf18 Router: Better enc type rejection message 2020-04-23 19:31:17 +00:00
zzz
5e2db982dd Router: Check for key certs in dests (prop. 145) 2020-04-23 19:16:31 +00:00
zzz
bc11e66429 SusiDNS: Fix typo that broke the add form 2020-04-23 18:57:29 +00:00
zzz
da8f49a712 Router: GarlicMessage debug logging improvements 2020-04-23 18:56:03 +00:00
zzz
a97085ac67 Ratchet: Expire outbound TS based on inbound last-used
Fix outbound expiration time
Reduce pending tagset expiration
Increase max send acks
Increase max next key replies
Don't save ref to NS callback once called
Sync tagset for debug output
2020-04-23 16:21:25 +00:00
zzz
eb7211660f Streaming: Reduce TCB cache time 2020-04-23 13:35:02 +00:00
zzz
b182562c80 Router: Fix logging NPE (thx zlatinb) 2020-04-21 17:01:03 +00:00
zzz
25a80c78b5 Build: Manifests for test, source, and javadoc jars 2020-04-21 12:52:23 +00:00
zzz
c69af8308f i2psnark: CSS tweak 2020-04-20 18:06:33 +00:00
zzz
0cc1861649 Streaming: Single retransmit timer per connection (ticket #2715)
Only instantiate ResendPacketEvent for fast retransmit
Move packet timeout field from ResendPacketEvent to PacketLocal
Set window size to 1 on timeout
Always adjust window when acked, even if the packet was sent more than once
Reduce INITIAL_WINDOW_SIZE from 6 to 3 to reduce router DH overhead
Set maximum burst retransmissions to 16
Closer compliance to RFCs 5681 and 6298
Prep for additional changes (Westwood)
Other minor cleanups
Original patch from zlatinb
2020-04-19 14:59:08 +00:00
zzz
57cd4c5843 Ratchet: Adaptive order of muxed decrypt based on previous traffic 2020-04-19 14:21:24 +00:00
zzz
cd035e1247 Console: Add header for client SKMs on /debug 2020-04-19 11:11:24 +00:00
zzz
73886d06e8 Ratchet: Fix tagset remaining calculation
More efficient tag insantiation
Debug page fixes
Javadoc fixes
Minor cleanups
2020-04-19 10:59:32 +00:00
hankhill19580
ae199581be Fix up the dark CSS for use with the new collapsing tables so tables line up, set ::selection highlighting on input text to a non-000 color so it shows up when you highlight it 2020-04-18 22:29:27 +00:00
zzz
bf425d8ac9 i2psnark: Periodically connect out to other seeds to fetch comments (ticket #2288)
javadoc updates
2020-04-18 15:04:43 +00:00
hankhill19580
823dc72eaa Improve padding consistency and readability on new i2ptunnel edit config pages 2020-04-17 23:13:18 +00:00
zzz
3716ccc3ef i2ptunnel UI: Move new js from console to i2ptunnel
Move <script> from body to head
Version the js links
2020-04-17 15:53:10 +00:00
zzz
108b3a2363 Tests: Add I2CP port option to LocalClientManager 2020-04-17 13:19:41 +00:00
zzz
35bb5896a1 Streaming: Slow start fix from zlatinb 2020-04-17 12:02:26 +00:00
zzz
da9bfd48c0 Crypto: Disable speculative AES tagset usage 2020-04-17 11:59:59 +00:00
hankhill19580
0bd3df6d98 Make the new dropdown_hover.png look consistent on i2ptunnel, re-run javascript prettifier 2020-04-17 06:02:12 +00:00
hankhill19580
0656abd101 Add the missing dropdown_active.png image to the light theme 2020-04-17 05:36:34 +00:00
hankhill19580
5299eb365f Re-organize the I2PTunnel UI and, in javascript-enabled browsers, turn advanced options onto accordion-menus. 2020-04-17 05:27:23 +00:00
zzz
53eb0fe7f8 SusiDNS: Remove taglib declarations where not required 2020-04-16 15:44:35 +00:00
zzz
4cdaa11024 Build: Reproducible build fix (ticket #2279) 2020-04-16 15:43:40 +00:00
zzz
e642d8e538 i2psnark: Fix TrackerClient thread name 2020-04-16 14:30:52 +00:00
zzz
cc5f13fc5e ElG/AES debug log tweaks 2020-04-16 13:27:53 +00:00
zzz
80f66113c4 i2psnark: Basic torrent file modification CLI 2020-04-16 13:24:51 +00:00
zzz
b3d5accca2 I2CP: Fix client notifier thread name 2020-04-16 13:22:23 +00:00
zzz
12ac06d5ba i2psnark: Debug page tweaks 2020-04-16 13:09:11 +00:00
zzz
7b47d3f314 Streaming:
Fix slow start (ticket #2708)
Reset retransmission timer after ack (ticket #2710)
Minor cleanups to prep for additional changes
Original analysis and patches from zlatinb
2020-04-14 12:59:26 +00:00
zzz
0d2dbcc8fc Ratchet: Additional muxed decrypt fix 2020-04-14 12:57:50 +00:00
zzz
e2cc62a21f Ratchet: Improve muxed decrypt
Try tags for both ratchet and AES before DH for either
Return empty CloveSet for ratchet errors after successful decrypt
Don't corrupt data in ECIESEngine on NS/NSR failure, for subsequent ElG attempt
Log tweaks
2020-04-14 12:13:00 +00:00
zzz
689b26102b i2psnark: CSS tweaks 2020-04-13 16:42:20 +00:00
zzz
c989addadc i2ptunnel: Allow comments in CLI command files 2020-04-13 16:41:26 +00:00
zzz
5e00bc6510 Streaming: Fix retransmission time (ticket #2709)
Remove unneeded checks on RTO max/min
Return new value from doubleRTO() (prep for ticket #2715)
2020-04-11 17:04:55 +00:00
zzz
828311a24f Debian: Fix patch offsets
Add ant target to validate patches
2020-04-10 18:49:30 +00:00
zzz
5976d4952f Jetty: Add GzipHandler for eepsites on Jetty 9.3/9.4 (ticket #2599)
by adding jetty-gzip.xml. JettyStart will copy the file
and add it to the configuration list automatically.
This does not affect standard installs which are still on 9.2;
it's only for Debian installs.
See also ticket #2098.
Partial backport from branch i2p.i2p.zzz.jetty93
2020-04-10 18:10:48 +00:00
zzz
80ae2ccea6 NTCP: Retain pending messages when replacing connection 2020-04-09 17:27:23 +00:00
zzz
370b7f1124 NetDB: Remove class M from auto-floodfill;
only 1% of floodfills are class M, and on average
they store 25% less leasesets than class N.
Reverts change to add M in 2015.
2020-04-08 20:20:55 +00:00
zzz
26b90b9d17 NTCP: More EnumSets 2020-04-08 15:36:36 +00:00
zzz
c8647fc3a5 i2psnark: Give peers preference to get their first pieces,
to mitigate effects of large pieces and allow them to
become interesting faster (ticket #2473)
2020-04-08 14:53:08 +00:00
zzz
3fa15824ee Ratchet: TagSet cleanups
Tag.toBase64() optimization
Javadoc fixes
2020-04-08 13:16:15 +00:00
zzz
1752291ffd Console: Fix disabling sidebar refresh
0 disables refresh on /configsidebar
disable ajax if refresh disabled
change refresh default to 15 sec
2020-04-07 20:47:12 +00:00
hankhill19580
4edb9bbf7f switch success notification icon with smaller version of icon, previous commit adds css ID's to table ID's on editclient 2020-04-07 16:07:23 +00:00
hankhill19580
e88a585703 switch success notification icon with smaller version of icon 2020-04-07 15:58:50 +00:00
zzz
928c0e9b91 Graphs: Reduce rrd4j sync thread pool size
disable pool if not persisting
stop pool on shutdown
2020-04-07 14:47:18 +00:00
zzz
83a4f5f2f0 Transport: Hang the X25519 keygen thread off CommSystem so Ratchet can use it
Don't start NTCP if neither 1 nor 2 is enabled
2020-04-07 13:23:36 +00:00
zzz
f54db66f77 Console: Use same IPv6 checkmark for NTCP and SSU 2020-04-07 13:21:41 +00:00
zzz
f16981d844 i2ptunnel: Unhide encryption type options 2020-04-06 21:08:52 +00:00
zzz
f6b5a2d493 Ratchet: Simplify OB Session; there can be only one active OB TS
Fix bugs handling of out-of-order nextkeys
Expire unacked tagsets every time through
Remore unused OB session methods
2020-04-06 20:27:47 +00:00
zzz
14b33a1e4c Ratchet: Don't allocate space for tagset keys initially 2020-04-06 15:23:30 +00:00
zzz
c99adeeb61 Ratchet: Use append() for keys too 2020-04-06 14:35:03 +00:00
zzz
b979a97905 Ratchet: Use SparseArray.append() instead of put() for efficiency 2020-04-06 14:29:07 +00:00
zzz
916b296ee0 Ratchet: Expire unused tagsets sooner 2020-04-06 13:54:49 +00:00
zzz
f9f64a441b Ratchet: Fix sorting for sessions on /debug 2020-04-06 13:22:58 +00:00
zzz
2482df7121 Ratchet: Decrypt ES messages in-place 2020-04-06 13:02:27 +00:00
zzz
f9d7cfa7e1 log level tweak 2020-04-06 12:46:16 +00:00
zzz
5229c0e811 Ratchet: Replace session if NS received after 3 minutes
Update lastUsed on NSR or first tag received
2020-04-06 12:45:46 +00:00
zzz
1ca9674f3f RatchetSKM: Group debug output for IB tagsets by pubkey, not session key
ElGamalSKM: Debug header change
ElGamalAESEngine: Minor cleanups for efficiency
2020-04-06 11:31:18 +00:00
zzz
c77e41c59e Ratchet: Next Key completion
Fix NextSessionKey constructor with null data
Fix handling of next keys
Fix sending OB next keys
Fix RatchetSessionTag.equals() for use in SKM
Delete OB NSR tagset when adding OB ES tagset
Log tweaks
2020-04-06 10:42:44 +00:00
zzz
8c4410277d Ratchet: Next Key WIP, got first ratchet working
Remove more ElG tag code from SKM
2020-04-04 11:56:25 +00:00
zzz
2ec9a4ab64 PKF: Add support for addsubdomain 2020-04-03 19:38:39 +00:00
zzz
6b05acff8d Ratchet: Next Key WIP 2020-04-01 18:44:06 +00:00
zzz
471b53698a Ratchet: Validate NS datetime block; add NS key bloom filter 2020-04-01 12:58:24 +00:00
zzz
7404bdc4fd NetDB: Add support for database lookup ratchet replies (proposal 154)
Add support for ElG-encrypted database lookups and stores from ECIES-only destinations
Add ratchet support to MessageWrapper
Application-specific timeout for MessageWrapper-generated tags
Refactor tunnel TestJob to use MessageWrapper
Add ratchet support to TestJob
TestJob cleanups
2020-03-31 19:21:35 +00:00
zzz
9307cc8a0c Ratchet: Add support for database lookup replies (proposal 154) 2020-03-31 18:43:52 +00:00
zzz
6dd0b23c61 Ratchet: Remove ID and DI from ACKREQ block
Use callback != null to specify request for ack
2020-03-30 20:09:29 +00:00
zzz
97f002bfb5 minor optimization 2020-03-30 17:03:20 +00:00
zzz
22ca4d0e44 Ratchet: GMB method to encrypt to a single key/tag for prop. 154 2020-03-30 16:53:14 +00:00
zzz
86fc6478f5 debug log tweak 2020-03-30 16:48:41 +00:00
zzz
dee92b5290 Ratchet: Updates
- Prep for prop. 154 with SingleTagSet
- Variable timeout for tagsets
- Start cleaner sooner
- Make key optional in next key block
- HTML debug output improvement
- log tweaks and javadocs
2020-03-30 16:44:42 +00:00
zzz
b19b529afe Ratchet: Expire tags too far behind current one 2020-03-29 17:53:28 +00:00
zzz
0c4cf5d3cd Ratchet: Add timeout job in OCMOSJ 2020-03-29 12:04:13 +00:00
zzz
eeb7ea4cae Ratchet: Acks and callbacks
- Store callbacks and ES acks in OutboundSession
- Calls from engine to SKM for callbacks and acks
- Pass key ID and remote key back in SessionKeyAndNonce
- Implmenent multiple acks in ACK block
2020-03-28 13:22:32 +00:00
zzz
23634afbc9 Ratchet: More updates
- Reply callback from ratchet to OCMOSJ (ES TODO)
- Store key ID in tagset (prep for next key)
- Move debug tagset ID from engine to tagset
- OCMOSJ minor cleanups
2020-03-27 19:38:24 +00:00
zzz
acf3abb19b Ratchet: Updates
- Modify NextKey, start of support (WIP)
- Don't expect DSM reply to ECIES destinations
- Debug setting to always sent ack request
2020-03-27 16:55:53 +00:00
zzz
c5435410ba atomic 2020-03-24 19:14:28 +00:00
zzz
786d68ce9a javadoc 2020-03-24 19:01:07 +00:00
zzz
0170ff2337 Blockfile: Add b32 to export output 2020-03-24 18:58:23 +00:00
zzz
a5c0448053 Graphs: Note restart required when changing persistence setting 2020-03-24 16:28:03 +00:00
zzz
7a1e2865fc Graphs: Fix rrd4j deprecation warnings 2020-03-24 16:19:33 +00:00
zzz
0c19216c4c Profiles: Remove unused ProfileManager.summarizePeers() 2020-03-24 13:08:23 +00:00
zzz
f2787a8df6 Profiles: Don't decay during first 90 minutes of uptime
Change decay from .75 twice a day to .84 four times a day;
approx. same overall decay in a day (.5)
Parameterize decay variables for clarity
Fix multiple NPEs in ProfileOrganizer CLI
Other cleanups
2020-03-24 13:03:40 +00:00
zzz
7654a0af42 Tunnels: Make new tunnel selection round-robin
Remove one-second stickiness, as OCMOSJ caching does the job better
http://zzz.i2p/topics/2454
2020-03-24 12:33:29 +00:00
zzz
5c1700c2ab Ratchet: Make DI optional in ACK request
Don't put ACK request in NS or NSR
2020-03-20 19:01:56 +00:00
zzz
6487fb0516 Tunnels: FragmentHandler cleanup (ticket #2699) 2020-03-20 12:32:28 +00:00
zzz
42fb3bb2e9 drop anoncoin from /home 2020-03-20 12:29:18 +00:00
hankhill19580
f57876dc3b merge of '996d0dc0db49250004a12cd4eb0374a477ff3617'
and 'ee72efae66f864d6e5ff42879055800bbbd44436'
2020-03-20 01:50:39 +00:00
hankhill19580
0a7027dd9b add 'ant bundle' target which generates a git bundle target iff the working copy is a git repository. Does not work with mtn clones. 2020-03-18 18:12:57 +00:00
idk
1154d28be7 add a bundle target to ant that generates a current git bundle and corresponding torrent. 2020-03-18 13:39:22 -04:00
zzz
0e68df6ba4 i2psnark: Hide non-i2p trackers on details page 2020-03-17 14:14:36 +00:00
zzz
7707c4bb94 Ratchet: Stub out ack and ack request blocks 2020-03-15 18:40:01 +00:00
hankhill19580
56639fa7d2 Fix dead links and inconsistent links in the readme.html, slight expansion to browser configuration options. 2020-03-07 18:02:38 +00:00
zzz
f0a15d084a change from textarea to input 2020-03-05 14:36:58 +00:00
zzz
de6cee8f6a update default irc server list 2020-03-04 13:25:42 +00:00
zzz
8b075f26bf Console: Fix wizard XHR initialization 2020-03-01 17:58:55 +00:00
zzz
5455820a74 Console: Add security headers to XHR targets 2020-03-01 17:57:05 +00:00
zzz
d38c660c36 Console, i2ptunnel: Hide temporary IPv6 addresses from bind options 2020-03-01 15:41:49 +00:00
zzz
3f629ce1af Console: Disable browser launch on /configclients when a service 2020-03-01 14:20:06 +00:00
zzz
29f9986f40 i2ptunnel: Check for same interface before warning of dup port 2020-02-29 14:44:07 +00:00
zzz
d505a2fe76 log level tweaks 2020-02-29 14:32:07 +00:00
zzz
3eb573295b SusiDNS: Support adding b32's (ticket #2101) 2020-02-29 14:11:04 +00:00
zzz
0b9babab42 Profiles: Limit average speed calculation to max high cap peers
Make reorganize() methods pkg private
2020-02-29 13:44:42 +00:00
zzz
c190ddd6b0 typo 2020-02-28 18:54:04 +00:00
zzz
53118fa9c6 Console: Fix /viewlicense for Debian packages 2020-02-28 18:49:20 +00:00
zzz
8cf241f6da Debian: Remove fonts-dejavu as package recommendation,
not needed for rrd4j with our patch
2020-02-28 16:59:07 +00:00
zzz
6774af6910 Systray: Don't attempt to launch browser when running as a service
Console: Hide/show things on /configservice when running as a service
Util: Add isWindowsService() and isService()
2020-02-27 17:30:16 +00:00
zzz
eb73f0aae2 Fixup rrd4j javadoc errors, tested with JDK 15 b11 2020-02-26 17:04:06 +00:00
zzz
0bec84a3b1 Profiles: Fix bug which caused speed values to be
divided by 3 after being read from file
Remove _isFailing field
Minor cleanup
Don't persist profiles when in vmCommSystem mode
2020-02-26 16:36:36 +00:00
meeh
75c2d24c45 merge of '0279ae34b6386470db3de49cbb7dcbdc5629c575'
and '9100eed7ff963fd8a54ab922b65208cfd5fb15b3'
2020-02-26 00:24:03 +00:00
meeh
53e77df77d Bump router version for osx build 2020-02-26 00:23:58 +00:00
zzz
326a85ea4f Profiles: add to 'big countries' list,
fix typo, thx drz
2020-02-25 15:32:51 +00:00
zzz
e567f7b460 Build: jrobin.jar no longer depends on i2p.jar 2020-02-25 15:22:55 +00:00
zzz
ab28ee960e Add missing parts of rrd4j 3.5 omitted from previous checkin (ticket #2684)
Apache 2.0 and LGPLv2.1
2020-02-25 15:15:23 +00:00
zzz
88a4261b03 Remove tagged string that was never translated anyway 2020-02-25 15:01:37 +00:00
zzz
e7a66659e9 OCMJH comment out unused code 2020-02-25 14:58:10 +00:00
zzz
44a935d086 debug for ratchet 2020-02-25 14:56:10 +00:00
zzz
1e5414f74f drop old tagged strings 2020-02-25 14:54:16 +00:00
zzz
357d400bc6 add install5.xml to release check 2020-02-25 14:46:35 +00:00
zzz
594f1c7f8b Util: Add isRTL() 2020-02-25 14:45:10 +00:00
zzz
4a845f0b73 checklist update 2020-02-25 14:39:48 +00:00
zzz
bc791f91ab NetDB: Comment out unused FloodOnlySearchJob code 2020-02-25 14:38:31 +00:00
zzz
f938090d6a NetDB: Don't send 'fake hash' for exploration any more,
no longer required for compatibility,
exploration option supported since 0.9.16
2020-02-25 14:36:44 +00:00
zzz
d9ea6b1f9c rrd4j patch (ticket #2684)
So that DejaVu fonts are not required in the classpath.
We set the default font to Monospaced.
All fonts are then set in SummaryRenderer.
2020-02-25 14:14:34 +00:00
zzz
5bed4a0d7f Replace old jrobin with rrd4j 3.5 (ticket #2684)
2019-02-10
From https://github.com/rrd4j/rrd4j/releases
Copyright (c) 2001-2005 Sasa Markovic and Ciaran Treanor.
Copyright (c) 2011 The OpenNMS Group, Inc.
Copyright 2011 The RRD4J Authors.
Apache 2.0 and LGPLv2.1

Unmodified as a base for future merges, except for omitted
files listed below.
This rev will not work; font patch to follow in next revision.

Following directories and files omitted:
converter/
core/RrdBerkeleyDbBackendFactory.java
core/RrdBerkeleyDbBackend.java
core/RrdMongoDBBackendFactory.java
core/RrdMongoDBBackend.java
demo/
graph/RrdGraphDefTemplate.java
inspector/
eu/bengreen/data/utility/
2020-02-25 14:04:21 +00:00
zzz
4826bbd333 debian files for .45 2020-02-24 22:38:12 +00:00
zzz
0540c76c51 release build fix for non-pack200 2020-02-24 17:33:47 +00:00
zzz
f081e88420 0.9.45 2020-02-24 17:13:44 +00:00
zzz
4030d0b427 Installer: Restore i2plogo.bmp, required for launch4j standalone executable (ticket #2608) 2020-02-24 17:07:48 +00:00
zzz
c5f6c9a498 Javadoc fixes after testing with JDK 14 build 36 2020-02-22 16:16:08 +00:00
zzz
403440bab8 bump for review 2020-02-21 18:05:39 +00:00
zzz
8ed7a029d7 more translations 2020-02-21 17:53:09 +00:00
zzz
ec6807cd2c pull translations 2020-02-21 17:50:51 +00:00
zzz
226494028a Update: Extend torrent update timeouts and limits for larger files (ticket #2693) 2020-02-20 18:55:48 +00:00
zzz
4bcd896829 Build: Add non-pack200 release targets (ticket #2693)
Update: Don't require pack200 for in-net update (ticket #2693)
2020-02-20 18:36:03 +00:00
zzz
2524a7a69d GeoIP: Prefer more recent of mmdb or Debian files if we have both 2020-02-20 16:44:18 +00:00
zzz
2805388a4c GeoIP: Add unknown and Kosovo country codes for db-ip.com (ticket #2692)
https://db-ip.com/faq.php
2020-02-20 15:42:22 +00:00
zzz
631a082ebd Util: Change GeoIP update script to use db-ip.com (ticket #2692) 2020-02-20 15:26:12 +00:00
zzz
24b98b86c2 update BuildTime 2020-02-19 15:22:57 +00:00
zzz
5ee903765e Util: Improve LookupDest CLI, add to CommandLine 2020-02-18 17:07:41 +00:00
zzz
c0db50ed0f Debian: Remove GzipFilter in base-context.xml,
does nothing with Jetty 9.4 (ticket #2599)
2020-02-17 17:48:09 +00:00
zzz
3403ea3b51 Install: Remove commented-out GzipFilter in cgi-context.xml,
it will never work, to be replaced with GzipHandler
2020-02-17 16:22:39 +00:00
zzz
daf595ab7e i2psnark: Revert API changes that broke i2psnark-rpc plugin
compile-tested only
2020-02-17 15:47:03 +00:00
zzz
fd958df118 Console: Fix jump-to-section on /stats 2020-02-15 18:28:45 +00:00
zzz
dd794ceee4 NTCP: Remove closed connections from write queue (ticket #2686) 2020-02-15 16:25:44 +00:00
zzz
c19a63c6a2 increase max share ratio 2020-02-14 14:09:34 +00:00
zzz
84bea6438f poupdate source 2020-02-12 17:12:50 +00:00
zzz
d3bd2ce190 I2PTunnel, I2CP: Place ECIES first in LS2
Data: Add debug code to ignore LS2 key order
2020-02-12 17:04:07 +00:00
zzz
e82f420ee6 Remove TODO comment, already fixed 2020-02-12 13:59:43 +00:00
zzz
a035901f0a console: /netdb margin fix 2020-02-12 13:48:25 +00:00
zzz
e73ddb548a i2ptunnel: Change default sig type to Ed for non-shared HTTP client 2020-02-12 13:05:50 +00:00
zzz
fd87c609f2 Reseed: Remove download.xxlspeed.com 2020-02-11 15:16:22 +00:00
zzz
17060c0100 Stats: 4 stats no longer required (thx drzed) 2020-02-11 13:51:12 +00:00
zzz
fe16ccb434 Transport: Mark yggdrasil IPv6 prefix as not routable
Minor cleanup of the checking code
2020-02-10 14:43:57 +00:00
zzz
a46100bde5 I2CP: I2CPMessageHandlerMap cleanup 2020-02-09 16:14:49 +00:00
zzz
0478ac75e9 Console: Show local tunnel status as green if any leases are valid 2020-02-09 15:04:30 +00:00
zzz
d42235486e update string as requested for translatability 2020-02-09 14:01:21 +00:00
zzz
dd3dbbf7f9 SSU: Skip down interfaces when looking for MTU,
handle bad values better
2020-02-05 16:43:58 +00:00
hankhill19580
efe85cc30a resources/installer/i2plogo.png is CC-BY-3.0 US(ura), license is in licenses 2020-02-05 15:59:36 +00:00
hankhill19580
0b3e6acb97 undo systemd unit change until I've tested it better, it was checked in by accident 2020-02-04 21:06:07 +00:00
hankhill19580
aa6c218122 Shrink izpack installer logo 2020-02-03 18:59:30 +00:00
hankhill19580
033c37f4a0 Shrink izpack installer logo 2020-02-03 18:59:01 +00:00
zzz
e7ddee5509 Graphs: Add stat for render time (ticket #2684) 2020-02-03 15:41:06 +00:00
zzz
f8283c04ca Console: Fix redirect to /graphs when clicking stop/restart on /graph 2020-02-03 15:03:23 +00:00
zzz
0f7bcbf4bb Graphs: Clean up font setting, fix bugs (ticket #2684)
Unit font now monospaced on Linux and Mac as intended
Don't set Droid Sans font, not present in any platform by default
Fix font scaling for Japanese
Detect more RTL languages
Make fonts configurable
2020-02-03 14:19:35 +00:00
hankhill19580
c4fce448c3 Use the new icon in the installer 2020-01-31 02:09:16 +00:00
zzz
c4c75c0ce5 javadoc fix 2020-01-27 16:21:05 +00:00
zzz
2988e58cb2 merge of '33d6437ea30f37b47795bc9e443064a00d297266'
and 'd264b4d7a1ab4e8fc4b510285f0ff30e26a27ca3'
2020-01-27 14:36:00 +00:00
hankhill19580
21ae518102 new images are under the Feather(MIT) license, installer/resources/themes/console/images/console/{light,dark}/console_status_running.png
installer/resources/themes/console/{light,dark}/console_status_stopped.png
        installer/resources/themes/console/{light,dark}/console_status_starting.png
        installer/resources/themes/console/images/title_window.png
        installer/resources/themes/console/images/local_down.png
        installer/resources/themes/console/images/local_up.png
        installer/resources/themes/console/images/local_inprogress.png
        installer/resources/themes/console/images/info/network_status/network_ok.png
        installer/resources/themes/console/images/info/network_status/network_hidden.png
        installer/resources/themes/console/images/info/network_status/network_firewalled.png
        installer/resources/themes/console/images/info/network_status/network_warning.png
        installer/resources/themes/console/images/info/network_status/network_testing.png
        installer/resources/themes/console/images/info/network_status/network_error.png
        installer/resources/themes/console/images/info/network_status/network_clockskew.png
        installer/resources/themes/console/images/info/network_status/network_vm.png
        installer/resources/themes/console/images/info/network_status/rejecting.png
        installer/resources/themes/console/images/info/network_status/accepting.png
        installer/resources/themes/console/images/info/network_status/rejecting_hidden.png
        installer/resources/themes/console/images/info/errortriangle.png
        installer/resources/themes/console/{light,dark}/warning.png
        installer/resources/themes/console/{light,dark}/warn.png
        installer/resources/themes/console/images/info/infowarn.png
        installer/resources/themes/console/images/info/infohelp.png
        installer/resources/themes/console/{light,dark}/infowarn.png
        installer/resources/themes/console/{light,dark}/infohelp.png
        installer/resources/themes/console/{light,dark}/confirmed.png
        installer/resources/themes/console/{light,dark}/help.png
        installer/resources/themes/console/images/favicon.ico
        installer/resources/themes/console/{light,dark}/favicon.ico
        installer/resources/themes/console/images/inbound.png
        installer/resources/themes/console/images/outbound.png
        installer/resources/themes/console/images/folder.png
        installer/resources/themes/console/images/cursor_zoom.png
        installer/resources/themes/console/{light,dark}/newsbullet_mini.png
2020-01-26 17:57:40 +00:00
zzz
8bebb884c3 Console: Fix light theme sidebar bandwidth graph 2020-01-26 17:19:20 +00:00
zzz
4401265200 Tunnels: Don't test ECIES-only tunnels 2020-01-26 13:41:19 +00:00
hankhill19580
094613b8de fix some issues with fonts and narrowness in light and dark themes, revise some icon choices on both themes 2020-01-25 21:10:43 +00:00
hankhill19580
6e38cce149 merge of '1dd202cbab5db44efb071d2b37c26b0fe8822b21'
and '692f541c9c3da4e376de3e3d8dbccff5bf33dc45'
2020-01-25 00:16:38 +00:00
meeh
9c626a07c5 Adding two new reseed hosts, hosted by me. 2020-01-24 20:00:40 +00:00
hankhill19580
80db2faeb7 Check in the undraw bell for the news notification, make the dark theme logo purple with a darker shadow to match the theme 2020-01-24 19:58:34 +00:00
hankhill19580
b31eb3f53b Change the color and size of the new square logo, remove background setters in mobile css for router console since they aren't needed anymore 2020-01-24 16:15:45 +00:00
hankhill19580
b572a330ed improve the consistency of the icons used throughout both the themes, round off buttons on light CSS theme, new favicon, bigger logo, don't fix sidebar height to 36px 2020-01-24 00:27:40 +00:00
zzz
98f7f30864 SSU: Use same valid IP criteria for sending relay request as for
receiving relay response
2020-01-22 20:48:32 +00:00
zzz
23d24a48b5 SU3File: Add date output to CLI
Bump -5 for previous Ratchet Elligator2 change
2020-01-21 21:00:54 +00:00
zzz
064e4046a6 Ratchet (proposal 144):
- Randomize high two bits of Elligator2 encoding (incompatible change)
- Fix NPE in RatchetTagSet.toString()
- Use zeros for padding block
- Add more debug logging
2020-01-21 17:54:14 +00:00
hankhill19580
50c86147b0 Fix some uncaught stuff in the new dark CSS theme 2020-01-16 18:35:18 +00:00
zzz
3c9e78bd76 i2ptunnel: Fix NPE if no config file 2020-01-15 14:10:49 +00:00
zzz
f65cfbf92c SSU: Extend timeout for msgs with multiple fragments (ticket #2640) 2020-01-11 14:19:31 +00:00
hankhill19580
4ad4e579d8 round button borders on /help 2020-01-09 19:43:53 +00:00
hankhill19580
1f6b3c1107 round off the remaining icons from the susimail light theme, fix some css issues from the dark theme 2020-01-08 17:45:49 +00:00
zzz
a2a646e1f5 i2psnark: Support "preview" HTML5 play for partial files 2020-01-08 17:12:10 +00:00
zzz
ea05af42fa Jetty 9.2.29.v20191105, Tomcat 8.5.50 2020-01-08 14:16:16 +00:00
hankhill19580
520faf477d icon consistency dark theme 2020-01-07 17:29:50 +00:00
hankhill19580
cf2a4ba053 fixed non-rounded icons on susimail menus 2020-01-07 17:25:37 +00:00
zzz
1a0b25a6ef Console: Don't refresh bw graph with js unless enclosing summary bar refresh time is longer 2020-01-03 14:52:58 +00:00
zzz
23598ab011 Console: Add hellips to restart messages 2020-01-03 13:51:01 +00:00
zzz
7ac189696b Console: Remove scroll-in-scroll for wrapper logs 2020-01-03 13:49:00 +00:00
zzz
ecdccac37e Console: Refactor the configstats js
Don't toggle the full stats box with toggle-all
2020-01-03 13:31:10 +00:00
zzz
e865f451ca i2psnark: CSS tweaks so the refresh isn't as glitchy
Reduce default refresh to 15 sec
bye whippy
2020-01-03 12:56:24 +00:00
zzz
3d80f0122f merge of '93f632609768276d0eccf0e9f518436ec83dfa57'
and '9908ac36a27905f02e28e8db9f93a32777fe9c62'
2020-01-03 12:12:55 +00:00
zzz
0a34f3d5dd Tests: Drop empty unit test files 2020-01-03 12:12:05 +00:00
hankhill19580
b588297458 delete two excessive background rules 2020-01-03 04:05:24 +00:00
hankhill19580
b524e91888 add license info to checkin 2020-01-03 03:28:27 +00:00
hankhill19580
29f8fec912 big CSS update across all dark-theme apps and susimail light-theme 2020-01-03 03:24:55 +00:00
zzz
09d31cb107 Util: Add https redirect support to EepGet and SSLEepGet
Add https support to EepGet CLI
2020-01-02 16:38:47 +00:00
zzz
fa9f60bcd9 Console, webapps: CSP improvements
i2ptunnel, susidns: Add headers.jsi
Console: Remove onload and use nonce for inline scripts where able
Version remaining js links
2019-12-25 12:18:00 +00:00
zzz
63b48e30be Console: Banlist and sidebar CSS tweaks 2019-12-24 14:01:04 +00:00
zzz
e714e7082e Console: Don't show a temporary IP ban if it's permanently banned also 2019-12-24 13:44:35 +00:00
zzz
9966c40d28 checklist update 2019-12-24 13:39:52 +00:00
zzz
9dbec9fbb5 drop unused flag 2019-12-24 13:35:50 +00:00
zzz
aa472feea9 i2ptunnel: Double default conn. and POST limits 2019-12-24 13:02:12 +00:00
zzz
c7a6584481 snark: psi's open tracker is back 2019-12-24 12:00:33 +00:00
zzz
ae994e3230 Console: Fix displayed name when installing new plugin 2019-12-21 14:24:18 +00:00
zzz
fcd8a3ae69 i2psnark: Fix autostart for torrent files copied into the dir
Use Collator for case-insensitive sort
Use Exception.getLocalizedMessage()
Prevent duplicate torrent starts
Don't write debug info to wrapper log
Increase max piece size
Navbar cleanup
2019-12-21 12:54:48 +00:00
zzz
ccaf4ce4b9 Console: Don't show 'Unresolved TCP address' error,
NTCP2 addresses may have triggered it.
2019-12-21 10:04:04 +00:00
zzz
5772b7d9ae NetDB: Randomize explore and refresh job delays 2019-12-20 16:07:24 +00:00
zzz
61ec10ff47 I2CP: Don't throw exception on early internalConnect()
ClientManager.isAlive() returns true even on port conflict
Hide port conflict message in console
2019-12-20 16:04:35 +00:00
zzz
c3138793fe SSU: Move statement affecting debug stats (ticket #2676) 2019-12-20 12:58:04 +00:00
zzz
c5904b080b SSU: Reduce log level on packet size error (ticket #2675) 2019-12-20 12:15:32 +00:00
zzz
7d10ef7a19 Add partial translations: bg, ca, cs, hi, hr, sq, sr 2019-12-20 11:17:14 +00:00
zzz
938410d68b Console: poupdate to remove strings moved to core and router 2019-12-19 14:24:18 +00:00
zzz
dd0d84fece Router: Add a router strings bundle 2019-12-19 14:08:28 +00:00
zzz
b2aa649c2a Build: Add encoding to all javac targets 2019-12-19 11:19:52 +00:00
zzz
74020ae5a3 CommSystem: Reduce IPv6 status thrashing 2019-12-19 10:56:13 +00:00
zzz
6f3cfd83cd Router: Prep for a router strings bundle 2019-12-18 13:43:17 +00:00
zzz
10b8c92fdb Proxy: Clean up links in error pages 2019-12-18 12:23:49 +00:00
zzz
520da91735 Console: Get log level translations from core 2019-12-17 19:24:41 +00:00
zzz
d73fc85c34 Move log level translations to core 2019-12-17 18:59:55 +00:00
zzz
4eca698584 Fix ngettext in DataHelper to make TX happy 2019-12-17 18:27:55 +00:00
zzz
3fa3b69cbc Fix ngettext in LogWriter 2019-12-17 17:33:04 +00:00
zzz
bf94460420 Core: Move date/time/size translations from console to core,
so apps can use them.
Fix translation in LogWriter, was never included in console.
2019-12-17 17:21:35 +00:00
zzz
d054652952 NetDB: Fixes for hidden routers losing peers (ticket #2673)
Explore more aggressively, increase thresholds
Explore with standard non-explore lookup if low on floodfills
Run RefreshRoutersJob if low on floodfills
Refactor SearchReplyJob to process all hashes at once
Transport: Use NTCP and SSU equally if hidden
2019-12-17 16:17:15 +00:00
zzz
ad3c978c7c Console: Partial az translation 2019-12-16 17:57:53 +00:00
zzz
3277ea4854 Console: Hide services sidebar section if empty
Use Exception.getLocalizedMessage() everywhere
HomeHelper javadoc
2019-12-15 15:48:19 +00:00
zzz
7b6e25db8b Console: Fix Hebrew translation
SusiMail: Add partial Hebrew translation
2019-12-15 15:39:38 +00:00
zzz
1974cc5559 Console: XML stats as attachments, not inline 2019-12-14 17:52:37 +00:00
zzz
9c534fda7b Console: Stat group display names 2019-12-14 14:17:06 +00:00
zzz
a5efce883a CoalesceStatsEvent: Add new known peers stat
cleanups
2019-12-14 13:18:02 +00:00
zzz
6197454225 Console: Add Content-Disposition header to graphs 2019-12-14 12:57:41 +00:00
zzz
64e9e2aebe PeerManager: Add countPeersByCapability() 2019-12-14 12:35:27 +00:00
zzz
faf130cf38 Elligator2 cleanups, thx orignal 2019-12-10 15:26:53 +00:00
zzz
831c1945a5 Fix build (missed one file) 2019-12-05 15:54:44 +00:00
zzz
26ecf364a6 drop unused icons 2019-12-04 18:19:20 +00:00
zzz
74b61a7ba6 Console: Sort advanced section after translation 2019-12-04 18:01:22 +00:00
zzz
d65208b917 Console: Sort help section after translation 2019-12-04 17:36:34 +00:00
zzz
bf70a1520b Console: Sort internals section after translation 2019-12-04 17:16:14 +00:00
zzz
3a3416d2a5 Console: Sort summary bar services section
Simplify data structures in NavHelper
Index NavHelper map by untranslated app name
NavHelper cleanups
2019-12-04 17:01:29 +00:00
zzz
00667151da Console: Rework summary bar services section
Move icon selection from CSS to code
Use plugin-configured icon if available
2019-12-03 19:18:20 +00:00
zzz
a9abf3babf less code inside synch block 2019-12-03 15:53:49 +00:00
zzz
cad3c46ea6 OCMOSJ: Cancel timeout job on reply
JobQueue: Improve removeJob()
2019-12-03 15:43:44 +00:00
zzz
9289a6daa9 NDT: Fix JSON encoding of extended login (ticket #2672)
Disable middlebox and firewall tests
Don't NPE if no middlebox test
Change version to match measurement-kit
Don't prefer IPv6, it is unreliable
Disable SSL by default, unreliable
Add 30s timeout to initial handshake to prevent long hangs on SSL
2019-12-03 14:57:32 +00:00
meeh
f2f29d6a6c merge of '2c002e114a71d2110b0c2313843dd3b41aa9a5f4'
and '87ba4083f66afda026363d0d844d0fa8e7486312'
2019-12-02 20:15:20 +00:00
meeh
3e888f8936 merge of '5a9a93d4878eb2e2757a350fa1b2b799745e7c1d'
and 'd00191a61a9b395dee95cfbc02f6e38664eb3d50'
2019-12-02 20:14:55 +00:00
meeh
cbccba8dc2 Changes for OSX launcher with the 0.9.44 router. 2019-12-02 20:14:50 +00:00
zzz
7cfc16ca36 NDT: Prevent NPE on JSON parse of bad/empty input (ticket #2672) 2019-12-02 17:45:22 +00:00
zzz
f7a2d23f1e NetDbRenderer debug log cleanup 2019-12-02 15:34:27 +00:00
zzz
31e8ff8f45 Update manager: Notify GeoIP type and file version 2019-12-02 15:29:42 +00:00
zzz
3a7ee4f211 Console: Move restart status up in summary bar
Process restart status first regardless of display order
2019-12-02 15:25:10 +00:00
zzz
cc3c2d4d1a misc. minor cleanups 2019-12-02 15:21:46 +00:00
zzz
11d89e248e i2psnark HTML5 minor cleanups 2019-12-02 15:01:23 +00:00
zzz
2bb94bea80 Debian changelogs for 0.9.44 2019-12-01 21:46:56 +00:00
zzz
2bfd421b19 0.9.44 2019-12-01 17:12:05 +00:00
zzz
4c9c83231b CSS tweaks after review 2019-12-01 17:04:46 +00:00
zzz
32044f1682 bump 2019-11-30 19:00:16 +00:00
zzz
51f7348d8a pull translations 2019-11-30 18:58:53 +00:00
hankhill19580
ae345cfb85 SusiDNS and router console css nits 2019-11-30 17:21:08 +00:00
hankhill19580
52edc35275 SusiDNS and router console css nits 2019-11-30 17:10:57 +00:00
hankhill19580
d5bc948bb4 fix css indentations 2019-11-30 06:42:55 +00:00
hankhill19580
86ff3420b5 Tab-Menu Layout Changes, color updates to the light theme, new icons, highlight active page in susidns 2019-11-30 06:39:13 +00:00
zzz
6b0e3750c9 Add more partial Persian translations, add to config page 2019-11-29 13:57:05 +00:00
zzz
600c681143 misc updates:
GeoIP, BuildTime, checklist, blocklist
2019-11-27 12:22:25 +00:00
zzz
e1189b9c9f i2psnark: Error messages take 2 2019-11-25 13:36:48 +00:00
zzz
9feeb76d6c i2psnark: Add thebland back as default also 2019-11-25 12:28:51 +00:00
zzz
9f02b27c4a i2psnark: Error message improvements 2019-11-24 16:59:27 +00:00
zzz
345cdd3eb0 Debian: Add apparmor support for Java 11 (Github PR #19) 2019-11-24 16:20:09 +00:00
zzz
def1e2ec68 i2psnark: Restore tracker.thebland.i2p 2019-11-24 16:10:55 +00:00
zzz
62c9ae67d0 new translations 2019-11-24 14:14:00 +00:00
zzz
10b756b726 poupdate-source 2019-11-24 13:28:11 +00:00
zzz
bf9d136a2b readme edits 2019-11-24 13:13:08 +00:00
hankhill19580
9ffd71e0b8 Settle on strings for new categories on the router console home page 2019-11-23 18:41:42 +00:00
zzz
6fa13313f0 Tunnel building:
- Don't count zero-hop tunnels as part of the pool when building
   - Don't build more than one zero-hop tunnel in a pool
   - Assume high build failure rate for new installs
   - Reduce threshold for tunnel length override
2019-11-23 16:51:14 +00:00
zzz
27fa991783 Remove dead reseed 2019-11-22 13:12:59 +00:00
zab2
09f6429b5f update javadoc 2019-11-21 15:12:30 +00:00
zab2
252a7972a1 only load a file filter definition if the definition has been modified since the last load 2019-11-21 15:12:04 +00:00
zab2
131ebc4d5a do not write to disk if there are no new breaches #2666 2019-11-21 14:56:25 +00:00
zzz
4e81e48d64 Use "Base32" and "Base64" consistently in strings
Update clearnet user-agent to match TBB
2019-11-21 13:59:26 +00:00
zzz
7b391fa17a I2CP: Don't put ECIES first in LS2 2019-11-20 15:01:22 +00:00
zzz
5e67f4232a I2CP: Prevent an uncaught OCMOSJ exception from killing the session 2019-11-20 14:54:46 +00:00
zzz
398b4ceade SSU: Lower ACKSender log level (ticket #2651) 2019-11-17 17:35:12 +00:00
zzz
03f4624f91 Transport: Save IPv6 firewalled state across restarts (ticket #2175)
Use EnumSets in UDPTransport
2019-11-16 17:12:40 +00:00
zzz
79334afcbc Console: Fix plugin icon-code images 2019-11-15 21:11:40 +00:00
zzz
c711d48835 Console: Hide more SSU peer info unless advanced 2019-11-15 13:55:04 +00:00
zzz
394db0b307 SSU: Remove redundant field (ticket #2659) 2019-11-15 13:45:58 +00:00
zzz
8bb1347e6e i2psnark: Don't start tunnels when autostart enabled but no
torrents set to autostart (ticket #2662)
Remove trackers apparently down
Don't show flv with HTML5
Another escape fix
2019-11-15 13:11:53 +00:00
zzz
e22810fd93 SSU minor cleanups 2019-11-15 11:06:14 +00:00
zzz
8218d55874 SSU: Fix log value (ticket #2652) 2019-11-14 15:51:52 +00:00
zzz
652b75a749 Transport: Remove unused currentReceiveSecond (ticket #2661) 2019-11-14 13:44:52 +00:00
zzz
620917cd70 Transport: Fixes for IPv6 firewalled logic (ticket #2175) 2019-11-14 13:25:38 +00:00
zzz
b8ed77da9a Consolidate I2CP property definitions 2019-11-13 18:06:35 +00:00
zzz
65b3cdbb12 Console: Hide buttons on /configkeyring if no entries 2019-11-13 17:39:56 +00:00
zzz
cecf255706 i2ptunnel: Don't delay after ConnectException if stopped
(fixes zzzot stop delay)
2019-11-13 15:37:16 +00:00
zzz
a854ccee69 remove plugins link 2019-11-13 14:07:01 +00:00
zzz
6e2ad50e16 i2psnark: Disable HTML5 for playlist files
Another escaping fix
2019-11-12 20:20:07 +00:00
zzz
fdb3c68d3f cleanup 2019-11-12 17:04:53 +00:00
zzz
d2e2109799 Router: Shutdown ECIES engine 2019-11-12 17:03:03 +00:00
zzz
9f0c3ee345 Debian: Fixup patch to match wrapper.config change 2019-11-12 17:00:36 +00:00
zzz
725509fe5c i2psnark: Exclude some video types from HTML5 2019-11-12 16:57:17 +00:00
zzz
13318a12da Console: Fix NPE on bad input 2019-11-12 16:55:39 +00:00
zzz
e8bf2ee30d i2psnark: Audio playlist support
Add HTML5 player for single-file torrents
2019-11-12 12:20:19 +00:00
hankhill19580
eda91af7c7 pick a better icon for hidden services manager, improve some text, and hide some of the stuff in /monitoring 2019-11-11 17:57:08 +00:00
zzz
9ddb655a88 KeyGenerator: Use new PrivateKey constructor to cache pubkey
Clear cached public key on private key destroy()
2019-11-11 14:24:11 +00:00
zzz
9d46a5d838 Router: Set default sig type to EdDSA for Android 2019-11-11 14:17:27 +00:00
hankhill19580
f7471713da Re-categorize items from /home and introduce 2 new categories. Make them configurable on /confighome 2019-11-11 00:49:26 +00:00
hankhill19580
b5d7f3e460 only declare one string for determining appdata, use old roaming appdata if it is present. 2019-11-09 08:23:41 +00:00
hankhill19580
7b53b0d3ad leave roaming appdir installs that already exist alone 2019-11-09 01:36:53 +00:00
hankhill19580
ff293d50a9 introduce divs to allow selecting buttons on /home by category 2019-11-08 17:42:53 +00:00
zzz
552100da17 i2psnark: More playlist mime types 2019-11-08 16:44:09 +00:00
zzz
a2b23f96e8 i2psnark: HTML5 on details page 2019-11-08 15:02:03 +00:00
zzz
14499c2993 i2psnark: Playlist mime type 2019-11-08 14:49:11 +00:00
zzz
dfc533b6e8 i2psnark: Another escaping fix 2019-11-08 14:48:30 +00:00
zzz
2738b3d29c i2psnark: Increase progress bar size again 2019-11-08 14:45:59 +00:00
zzz
07b7ab4262 Ratchet: Hook in MuxedEngine decrypt 2019-11-06 16:20:14 +00:00
zzz
b7f6cfbf46 Ratchet: Replace old session if new NS received
Log tweaks
2019-11-05 19:11:29 +00:00
zzz
ebc8dbe947 Ratchet: Increase tagset sizes
fix compile error
2019-11-05 17:26:22 +00:00
zzz
01d6cea017 Ratchet: Simplify lookup of OB session from IB NSR 2019-11-05 17:15:37 +00:00
zzz
160bcd7da8 MV log tweaks 2019-11-05 17:07:21 +00:00
zzz
bc40978297 Router: No longer check the clove ID in the Bloom filter, just check the expiration.
The Clove ID is just another random number, and the message ID in the clove
will be checked in the Bloom filter; that is sufficient.
Checking the clove ID as well just doubles the number of entries in the Bloom filter,
doubling the number of false positives over what is expected.
For ECIES-Ratchet, the clove ID is set to the message ID after decryption, as there
is no longer a separate field for the clove ID in the transmission format.
2019-11-05 16:43:12 +00:00
zzz
656dd42276 Ratchet: Prep for next key 2019-11-05 15:20:52 +00:00
zzz
4d1d11d1d4 Ratchet: Bob transition to ES
Store PK in RTS
New RST constructor
Log tweaks (lots)
2019-11-05 14:13:35 +00:00
zzz
3ae5b90c98 Ratchet: Expire pending outbound
Prep for Bob transition to ES
Log tweaks
2019-11-04 18:03:06 +00:00
zzz
2846c33b40 Ratchet: Debug page fixes 2019-11-03 17:06:33 +00:00
zzz
b5f6c58a0b Ratchet: Implement expiration
Store creation and last-used in tagset
Catch all decrypt/encrypt exceptions
Debug page improvements
2019-11-03 16:51:51 +00:00
zzz
3ba48fda86 Ratchet: Track pending sessions
Transition from NSR to ES
HandshakeState.clone() fix for multiple NSRs
Add tagset ID numbers
Debug logging
2019-11-02 15:42:16 +00:00
zzz
7c4569816f Ratchet: NSR send/recv fixes 2019-11-01 12:56:16 +00:00
zzz
0cd8073f39 Ratchet: WIP on NSR send/recv 2019-11-01 12:22:20 +00:00
zzz
71411be6d9 Ratchet: Changes to match current proposal 144
Pass CloveSet to/from ECIESEngine
2019-10-31 10:56:01 +00:00
zzz
a51ee8e745 findbugs all over 2019-10-30 15:26:56 +00:00
zzz
3719081469 Build: More findbugs source paths 2019-10-30 13:41:33 +00:00
zzz
2216a58143 I2NP: Javadoc fixes
Improve DataMessage.toString()
2019-10-29 16:30:08 +00:00
zzz
dc29525e5c Console: Remove theme choice objects on /configui
so we don't get snakes with noscript
(thx drz3d)
2019-10-28 16:07:25 +00:00
meeh
e5163c6ee5 Set autobits to false in wrapper.config. See #2299 2019-10-27 14:32:43 +00:00
meeh
c5db5f0de3 Fix runplain.sh for OSX. See #2299 2019-10-27 14:30:30 +00:00
zzz
3d75b3dc31 OCMOSJ: Keep bundling LS until acked
log tweaks
2019-10-27 12:24:08 +00:00
zzz
591b994b75 OCMOSJ: Bundle unwrapped ack with LS for ratchet dest 2019-10-27 12:21:22 +00:00
zzz
135e9ad31f NetDB: Don't send encrypted lookup reply to ratchet dest 2019-10-27 12:18:07 +00:00
zzz
eee9e47cac Transport: Publish IPv6 address on transition to non-firewalled (ticket #2175) 2019-10-25 13:27:30 +00:00
zzz
df6465f802 TestJob: Remove unused wrappedKey param from buildMessage() 2019-10-25 12:23:43 +00:00
zzz
0c256d30c7 OCMOSJ: Select target key in LS based on local client's support
Hook new SKMs and ending into Garlic Message encryption/decryption
Remove unused wrappedKey param from buildMessage()
Log tweaks and javadoc fixes
WIP
2019-10-25 12:21:33 +00:00
zzz
43c93bceed I2CP: Set client SKM based on configured encryption 2019-10-25 11:36:46 +00:00
zzz
f021abcae0 Crypto: Add ECIES Engine to context 2019-10-24 14:32:05 +00:00
zzz
7b28640e91 Crypto: Ratchet and Muxed SKMs and Engines (WIP) 2019-10-24 14:28:39 +00:00
zzz
6a47319b66 Crypto: SessionTagListener for RatchetTagSet 2019-10-24 14:01:53 +00:00
zzz
ee46678955 Crypto: RatchetTagSet using SparseArray 2019-10-24 13:54:20 +00:00
zzz
8c498069d8 Crypto: SparseArray mods
Remove AOSP dependencies
Remove unneeded code
Javadoc fixes
2019-10-24 13:50:29 +00:00
zzz
7389216560 Crypto: SparseArray from AOSP
Latest as pulled from android.googlesource.com
Copyright (C) 2006 The Android Open Source Project
Licensed under the Apache License, Version 2.0
Unmodified, as reference for future merges,
will not compile, mods to follow
2019-10-24 13:46:32 +00:00
zzz
129e474ecb I2CP: Add config to disable loopback for testing 2019-10-23 14:02:30 +00:00
zzz
3ed8620e5a I2CP: Fix error message for config errors (ticket #2639) 2019-10-23 13:48:39 +00:00
zzz
436a8b8720 Router: Register all LS2 keys with KeyManager 2019-10-23 13:38:41 +00:00
zzz
5d8871c17c NetDb: Don't try to garlic encrypt netdb messages with a ECIES key 2019-10-23 13:21:22 +00:00
zzz
d84fc4f0c8 Data: Add LeaseSet methods to get encryption key by type 2019-10-23 13:13:13 +00:00
zzz
2c2f90089b Crypto: Noise modifications to support ratchet:
- Add IK support
- Add generic key factory support
- Add method to get ephemeral key
- Add method to get encoded ephemeral key
- Add clone() support
- Add back ChaCha debug support
2019-10-23 13:02:00 +00:00
zzz
236354e5a8 Crypto: Base classes for ECIES-Ratchet (proposal 144) 2019-10-23 12:33:13 +00:00
zzz
aa3d2f39b1 Router: Fix logic error in check for local destinations 2019-10-23 12:23:04 +00:00
zzz
fb67ebb38d Crypto: New KeyFactory interface 2019-10-23 12:17:21 +00:00
zzz
a9d4798bfe Data: Cache public key in private key class 2019-10-23 12:15:58 +00:00
zzz
8484a22fc4 Router: Add KeyManager support for multiple leaseset private keys 2019-10-23 12:11:17 +00:00
zzz
0f7ebf2f71 Crypto: Don't zero-fill arrays already initialized 2019-10-23 12:04:41 +00:00
zzz
db37745a1c i2ptunnel: Add encrytion type selection to form 2019-10-23 11:57:22 +00:00
zzz
b12e7214c8 Build: Make 3 release targets, with jbigi/geoip/neither 2019-10-23 11:35:33 +00:00
zzz
079d464629 Startup: clients.config.d files must have a ".config" suffix 2019-10-23 11:26:35 +00:00
zzz
6dd2e9bb6b fix comment 2019-10-23 11:18:42 +00:00
zzz
413eb7d0eb Console: Consolidate 'selected' strings 2019-10-23 11:16:02 +00:00
zzz
68a03b835a Data: Reduce SessionTag size by flattening class 2019-10-23 11:08:42 +00:00
zzz
eef6c5cb33 Build: Recognize gettext 0.20 2019-10-23 11:00:23 +00:00
zzz
652f9bb6a0 Debian/Ubuntu updates for 0.9.43 2019-10-22 16:36:23 +00:00
zzz
ab7b85cc1a 0.9.43 2019-10-21 19:47:35 +00:00
zzz
2335f547f7 add new man pages to debian 2019-10-21 19:46:09 +00:00
zzz
701f777035 bump for review 2019-10-18 18:29:56 +00:00
zzz
77259293a8 Maxmind GeoIP 2019-10-15 2019-10-18 18:24:35 +00:00
zzz
4e231b26c3 I2CP: Remove pre-43 test code for BlindingInfo 2019-10-18 18:23:26 +00:00
zzz
9889d1adcb Console: changed headers and app colours on /home, headers in sidebar, news, and /console.
patch from sadie
2019-10-18 18:22:17 +00:00
hankhill19580
2377b1adde remove unused image from bandwidth wizard 2019-10-18 18:07:59 +00:00
zzz
47aa6101d4 New zh_TW translations for desktopgui and i2psnark
New ro man pages
Fix ru man page error
New transifex translation of zh readme
2019-10-18 13:41:10 +00:00
zzz
7161785c5b pull translations from transifex 2019-10-18 12:53:27 +00:00
zzz
2ca9fe2050 fix html error 2019-10-18 12:46:30 +00:00
zzz
1095a140de Util: Fix eepget -p :port 2019-10-16 12:57:50 +00:00
hankhill19580
0485e690c6 fix some colors and some padding in the new bandwidth wizard 2019-10-15 23:57:09 +00:00
hankhill19580
20103957a9 remove unused 48x48 flags from the installer package 2019-10-13 15:27:46 +00:00
zzz
9670858095 SessionIdleTimer log level reduction 2019-10-13 13:59:28 +00:00
hankhill19580
2bc8d58476 fix the trailing whitespace added by my IDE 2019-10-12 17:27:54 +00:00
zzz
70fd0c6f6a Tests: Disable NTP in context for unit tests 2019-10-12 14:47:59 +00:00
zzz
2b1a7015e4 poupdate-source after spelling fix 2019-10-12 14:14:56 +00:00
zzz
e8404a75fb spelling fix 2019-10-12 14:12:37 +00:00
zzz
05c30b4f1d NTCP: Performance improvement (tickets #2619, #2620) 2019-10-12 13:23:28 +00:00
zzz
29eabc4706 TCG javadoc notes for android 2019-10-11 16:14:26 +00:00
zzz
049b34f7cf Console: Fix mime type and encoding on javadoc pages 2019-10-10 14:48:23 +00:00
zzz
31f2c51e7e poupdate-source 2019-10-09 19:06:33 +00:00
zzz
71cc55fa7d langbox tweaks 2019-10-09 18:53:00 +00:00
hankhill19580
68a65d5cac fix tooltips on new gear links, shrink them down a little bit 2019-10-09 17:31:44 +00:00
hankhill19580
e4c5c4862f Improve accuracy of TunnelControllerGroup message 2019-10-08 18:14:42 +00:00
hankhill19580
cb2544157f fix erroneous log message in TunnelControllerGroup, replace language flags with a link to configui instead 2019-10-08 18:10:34 +00:00
zzz
612bdda281 build.xml comment 2019-10-08 14:11:43 +00:00
zzz
db5dd6a626 I2NP: Remove unused I2NPMessageHandler methods 2019-10-06 16:31:18 +00:00
hankhill19580
16db73b092 Improve bandwidth wizard CSS on narrow browser windows 2019-10-05 23:05:01 +00:00
hankhill19580
c259abc82c remove metadata from undraw assets 2019-10-05 15:30:23 +00:00
hankhill19580
99b33fabe6 regular-ize image sizes, make spacing more similar between dark and light themes of bwwizard, fix some background stuff 2019-10-05 07:45:32 +00:00
hankhill19580
81133a1a95 undo absolute positioning of messages 2019-10-04 05:26:43 +00:00
hankhill19580
9b3380cef3 check in undraw license 2019-10-04 05:13:11 +00:00
hankhill19580
87ba8577e9 fix css leaking from new bandwidth wizard to main router console in light mode. Images for new bandwidth wizard(installer/resources/themes/console/images/wizard/*.png) under the UnDraw license, which is in (licenses/LICENSE-undraw.txt). Make font size consistent on bandwidth page in light mode. 2019-10-04 05:11:42 +00:00
zzz
aca5617935 i2psnark: Start with minimum tunnel count (ticket #2623) 2019-10-03 14:10:18 +00:00
hankhill19580
e44a7c5054 modern-styled bandwidth configuration menu 2019-10-03 05:44:53 +00:00
zzz
142508c872 configkeyring html fixes 2019-10-02 20:23:47 +00:00
zzz
788e041939 Installer: Clean up old hosts.txt entries
see http://zzz.i2p/topics/2778
2019-10-02 14:04:48 +00:00
zzz
3563fdf9e4 Console: Add date columns on /configkeyring 2019-10-02 14:02:20 +00:00
zzz
ea8ac884fa i2ptunnel: Results page after generating LS2 DH key 2019-10-02 13:56:11 +00:00
zzz
bf33e8432d CSS -ms-user-select for IE 10
https://www.w3schools.com/csSref/css3_pr_user-select.asp
2019-10-02 13:52:03 +00:00
zzz
18ed1a6bb3 PortMapper: Fix URL generation for IPv6 hosts
Console: Remove i2pwiki.i2p (ticket #2626)
2019-10-01 16:09:17 +00:00
zzz
830e08065b spelling 2019-09-30 17:03:59 +00:00
zzz
c1722a9f82 i2psnark: Log more cases where torrent file gets renamed
(followup to changes for ticket #2291)
2019-09-30 17:01:02 +00:00
zzz
e5475bc229 i2psnark: Recognize more ebook file suffixes 2019-09-30 16:59:32 +00:00
meeh
d81bf6a417 Re-added -notimestamp for javadoc 2019-09-29 11:07:24 +00:00
zzz
3710ff9aa1 javadoc fixes 2019-09-28 12:07:59 +00:00
meeh
679aa1afac Revert javadoc thingy that didn't work. 2019-09-27 14:03:47 +00:00
zzz
320569ef7f Tomcat 8.5.46 2019-09-21 14:30:57 +00:00
zzz
4f0d764540 i2ptunnel: Support quoting for custom options (ticket #2603)
This also allows closing of ticket #2163.
2019-09-19 16:22:51 +00:00
zzz
a768afe05b i2psnark: Fix breakage of error tables 2019-09-18 16:37:06 +00:00
zzz
d15e068123 i2psnark: Details page cleanups part 2 2019-09-18 14:13:39 +00:00
zzz
c1431565ed i2psnark: Details page cleanups 2019-09-18 13:54:40 +00:00
zzz
2b6cb2099a I2CP: More BlindingInfo serialization fixes
Shorten lookup timeout on router side so the client gets the reply before timeout
2019-09-18 12:37:26 +00:00
zzz
f9a2193e2f i2ptunnel: New CLI BlindingInfo test
I2CP: Fix BlindingInfo serialization
2019-09-17 17:30:42 +00:00
zzz
0d325d5a28 i2ptunnel: Interstitial after auth save form 2019-09-17 15:00:50 +00:00
zzz
520da24e0c i2ptunnel: Improve query parsing in local HTTP server,
as required for b64 keys in form
2019-09-17 14:26:20 +00:00
zzz
69638caa7b i2ptunnel: B32 auth form improvements 2019-09-17 13:18:47 +00:00
zzz
62914d7678 i2ptunnel: Remove streamr, connect, and httpbidir from wizard
Don't override defaults in wizard
2019-09-17 12:09:26 +00:00
zzz
94c96b09e9 Router: Implement expiration for BlindData entries 2019-09-17 11:17:14 +00:00
zzz
0c2a8e9244 Util: Add sigtype/enctype help to PKF
remove dead code from SU3File help
2019-09-17 11:05:48 +00:00
zzz
67cd6409a0 EepHead: Don't output null values in CLI 2019-09-14 14:14:11 +00:00
zzz
65d0ea3f0b i2ptunnel: Fix SSL wizard for split config (ticket #2610) 2019-09-14 13:39:39 +00:00
zzz
f1b725a320 Util: Don't attempt to load hidden cert files (ticket #2622) 2019-09-14 11:40:39 +00:00
zzz
9e39cbe502 reseed: Fix adding netid param (ticket #2621) 2019-09-14 11:23:59 +00:00
zzz
8d104f7fea i2ptunnel: New form for blinding info (WIP) 2019-09-12 17:42:44 +00:00
zzz
e66d64d89b comment out debug log 2019-09-12 16:13:59 +00:00
zzz
9d28b17a04 I2CP: Don't return dest for a b33 lookup if we don't have the
required auth or secret
2019-09-12 16:09:44 +00:00
zzz
43f055ec28 I2CP BlindingInfo fixes 2019-09-12 13:56:00 +00:00
zzz
b4a5cc07c2 i2ptunnel: New b32 error page
Do basic b32 checks before looking up with session
Util: Fix AIOOBE on bad input to base 32 decode
log tweaks
b33 decode error message tweaks
2019-09-10 14:21:28 +00:00
zzz
479461ab3b I2CP: New Blinding Info message (proposal 123)
client- and router-side support
new session lookupDest2() method
return new b33 failure codes from lookup
show b33 alternates in tools
stub out support in HTTP client
2019-09-10 12:37:11 +00:00
zzz
c99a42f0b1 I2CP: Write single byte directly 2019-09-09 15:35:58 +00:00
zzz
65698aa0da remove unnecessary buffers 2019-09-08 19:59:55 +00:00
zzz
7f75d0254c Transport: Don't automatically transition from firewalled to non-firewalled
when IPv6 address changes
2019-09-08 17:09:09 +00:00
zzz
331ecf0625 Transport: Prefer temporary IPv6 addresses when in laptop mode 2019-09-08 12:09:35 +00:00
zzz
32d420e76f GeoIP: Also use saved IPv6 address for local router lookup 2019-09-08 12:08:09 +00:00
zzz
ee5a22be24 Console: Case-insensitive sort for plugins 2019-09-08 12:05:00 +00:00
zzz
b51962aeac Jetty: Support annotation scanning of plugins for Servlet 3.0 @WebServlet
Requires 4 jars not yet bundled:
 asm.jar
 javax-annotations-api.jar
 jetty-annotations.jar
 jetty-plus.jar
2019-09-07 16:59:24 +00:00
zzz
e73640bb8d Debian: revert allowing JRE 8 2019-09-07 13:40:01 +00:00
zzz
92515179e9 javadocs 2019-09-07 13:37:31 +00:00
zzz
c5f126c196 log tweaks 2019-09-07 13:34:56 +00:00
zzz
bb88555a63 Transport: Detect IPv6 address changes
Use same IPv6 address as previous if still valid
Log tweaks
2019-09-07 13:29:37 +00:00
zzz
e03a94647c Console: Fix first row of version info not selectable (ticket #2615) 2019-09-07 11:10:05 +00:00
zzz
8eda9abab7 Util: Fix time zone for formatted time/date 2019-09-07 11:00:29 +00:00
zzz
aed6d433c8 Transports: Remove IPv6 addresses on transition to IPv6 firewalled
log tweaks
2019-09-06 15:51:32 +00:00
zzz
71376d53c5 fix spacing on help page 2019-09-04 16:42:04 +00:00
zzz
9a84f77fab Add Romanian eepsite help page 2019-09-04 16:33:26 +00:00
zzz
2590fd8253 Debian: Allow recent JREs
require Jetty 9.4 or higher
2019-09-04 16:06:49 +00:00
zzz
ea3bddbcd6 i2psnark: un-rotate magnet icon 2019-09-04 15:53:48 +00:00
zzz
d04f0dae37 SusiMail: Show "to" rather than "from" in sent and drafts folder (ticket #2571)
Fix sort links going to wrong folder
2019-09-04 14:24:30 +00:00
zzz
3504bddea4 SSU: Don't mark peer unreachable if it reports we have a bad port,
as it could be due to the NAT external port range (ticket #2467)
Add log message
2019-09-04 13:49:29 +00:00
zzz
b3a5f1f8c1 SSU: Fix IPv6 peer test not firing
more debug logging
2019-09-03 16:46:31 +00:00
zzz
0f2f7e2454 Utils: Fix SAN verification for IPv6 hostnames
Add Quad9 DoH servers
Change Google DoH server hostname
2019-09-03 15:34:21 +00:00
zzz
b119d0be43 Tunnels: Use context AES for hop processing
and related cleanups
2019-09-03 12:42:10 +00:00
zzz
566221b732 Tests: Fix InboundTest so it can be run without a real router 2019-09-02 18:07:23 +00:00
zzz
81ab35abe6 Tests: Fix broken OutboundTest
never worked - didn't check result, processed own config
2019-09-02 14:01:02 +00:00
zzz
b2e37243ab i2psnark: CSS fixes -
increase progress bar size
don't justify comments
2019-09-02 13:59:16 +00:00
zzz
a6e3621c06 Util: Consolidate and standardize date/time formatting (ticket #2016) 2019-08-30 18:38:12 +00:00
zzz
96d8385f49 bump 2019-08-29 12:43:07 +00:00
zzz
912d25b775 Data: Mark Destination method that doesn't support sigtypes as deprecated 2019-08-29 12:24:45 +00:00
zzz
55cdd81017 Transport: UPnP HTML output fix 2019-08-29 12:19:11 +00:00
zzz
a1c18fd0aa Transport: Tweak log levels 2019-08-29 12:18:33 +00:00
zzz
5f3da69acc Router: Job Queue cleanups and javadocs (ticket #2590) 2019-08-29 12:15:13 +00:00
zzz
e6dcfaee15 Transport: Move I2PHMac to ssu package
Remove Mac interface
2019-08-29 12:07:30 +00:00
zzz
f724b2208b i2psnark: Drop debug icon 2019-08-29 11:59:40 +00:00
zzz
89b70895d7 Debian files for 0.9.42
checklist updates
2019-08-29 11:56:55 +00:00
meeh
cff2ae3ac9 Hotfix change to make 0.9.42 build on Mac OSX without disabling javadoc. (Since maven builds are built on OSX it's something that really should work fine) 2019-08-28 08:38:06 +00:00
zzz
ec0f8566b6 0.9.42 2019-08-27 12:28:25 +00:00
zzz
2ebe59436a bump for review 2019-08-23 18:19:01 +00:00
zzz
dcf6983607 translated man page updates 2019-08-23 18:17:22 +00:00
zzz
1779202ff9 translation updates from Transifex 2019-08-23 18:15:48 +00:00
zzz
6483abe7cf Transport: Add Turkey to hidden mode list 2019-08-23 18:01:09 +00:00
zzz
6618561237 Console: CSS updates from sadie 2019-08-22 16:06:19 +00:00
zzz
d8c9b0942f Transport: add Kazakhstan to hidden mode list 2019-08-20 15:39:03 +00:00
zzz
9938e50528 Tunnels: Remove timing calls unless for debug logging
Log client in b32
2019-08-19 17:14:43 +00:00
zzz
232b7f30d5 Build: Fix javadoc errors with Oracle JDK
Tested with 12.0.2
2019-08-19 16:33:19 +00:00
zzz
adba7e4c25 update earliest time 2019-08-19 14:49:57 +00:00
zzz
764f89f5c5 MaxMind GeoIP 13-Aug-2019 2019-08-19 14:47:29 +00:00
zzz
87180e0e2d SSU: Increase initial concurrent messages limit (ticket #2576)
Add comments for ticket #2427
2019-08-19 14:18:16 +00:00
hankhill19580
6789a735e3 fix typo 2019-08-18 19:12:06 +00:00
hankhill19580
65eb9b17db fix checks for config parameters in TunnelControllerGroup constructor 2019-08-18 19:08:27 +00:00
zzz
64ba43c007 Jetty: Log stack trace if 2nd arg is a Throwable (ticket #2592) 2019-08-18 14:53:32 +00:00
zzz
b2dec2f4b2 Tunnels: Clean up debug timing calls in preprocessor 2019-08-17 17:55:45 +00:00
zzz
789f482373 Transports: Disable eph. key reuse 2019-08-17 17:39:25 +00:00
zzz
a667c36d2d Tunnels: Reduce IBGW batching time (ticket #2586) 2019-08-15 19:27:05 +00:00
zzz
65e2132a25 SSU: Reduce ACK time to 150 (ticket #2574) 2019-08-15 17:45:06 +00:00
zzz
5e76118ffd po update source 2019-08-14 20:13:35 +00:00
zzz
131a70057e Console: Clean up help text, tag for translation (ticket #2298) 2019-08-14 19:52:54 +00:00
str4d
21ace66a46 Tests: Fix streaming integration tests after access filtering changes 2019-08-10 18:02:23 +00:00
str4d
459eb7fdcd Tests: Unify core test resources across JUnit and ScalaTest
Fixes a test failure running the ScalaTests under Ant
2019-08-10 17:19:21 +00:00
str4d
8586c28b5f Travis CI: Use Trusty build environment
Travis CI recently bumped the default build environment from Trusty to
Xenial. The latter does not enable installing Java 7 or 8, which we
still test against.
2019-08-10 16:52:40 +00:00
str4d
f32c863ba8 Tests: Temporarily mitigate discrepancy between Ant and Gradle in SingleFileNamingServiceTest 2019-08-10 16:48:21 +00:00
str4d
ee84e7e3e1 Tests: Fix compilation bug after SSU HMAC implementation move 2019-08-10 16:46:41 +00:00
str4d
cf4298f759 Jetty: Fix Gradle build 2019-08-10 16:10:07 +00:00
str4d
13190931b9 EdDSA: Reduce diff between vendored code and upstream
Includes missing license information.
2019-08-10 15:39:41 +00:00
zzz
08be6a4f4a i2ptunnel: Add failsafe timeouts for local sockets (ticket #2568) 2019-08-05 15:55:43 +00:00
zzz
7f015c4794 i2ptunnel: Add configs to override user agent
Not particularly helpful yet, because we don't have a way to
quote or escape spaces in the custom options field.
2019-08-05 15:34:46 +00:00
zzz
7b46d43492 update tooltip 2019-08-05 15:29:36 +00:00
zzz
a4bcff093f Transports: Implement cross-network detection (proposal 147)
Reseed: Send network ID in query string (proposal 147)
2019-08-05 14:27:17 +00:00
zzz
fb7b3c2793 Streaming: Reduce immediate ack delay (ticket #2584) 2019-08-04 21:08:29 +00:00
zzz
397bf43147 i2psnark: Fix autostart to start only torrents running previously,
save torrent running status on torrent stop when autostart is enabled,
remove dup call to startTorrent()
(ticket #2120)
2019-08-04 20:29:46 +00:00
zzz
49af26d958 i2psnark: Add checks for dup data dirs (ticket #2291)
Add two HashMaps for faster dup checks
2019-08-04 18:54:01 +00:00
zzz
0ce4811dec SSU: Fix stall when higher-priority message is added to queue (ticket #2582) 2019-08-04 16:28:41 +00:00
zzz
d3e3ec4d35 Transport: Allow local addresses when configured 2019-08-03 15:29:30 +00:00
zzz
8ed0dd2a5c Router: Fix Bloom filter false positives
caused by lack of sync around buffers.
Use temp buffers instead.
Most likely to affect high-bandwidth or testnet routers;
appears to be rare on lower-bandwidth routers.
2019-08-02 15:48:05 +00:00
zzz
8158753dac i2psnark:
- Fix announce hosts of the form b64dest[.i2p]
- Add last activity stat
- Disallow illegal filenames on Windows
- cleanups and log tweaks
2019-08-01 20:20:44 +00:00
zzz
e3481f6730 JBigI: GMP 6.1.2 for linux 64 bit (ticket #1869)
Adds Broadwell and Skylake binaries
Updates all other linux 64 bit binaries
32 bit libraries will not be updated
Other OS 64 bit binaries may or may not follow at a later date
2019-07-27 15:52:38 +00:00
zzz
165beb3fbd TCG: split config log tweaks and cleanups
Fix warning about no tunnels loaded
Add notes in config default files
2019-07-27 11:32:38 +00:00
zzz
5d367940d5 History for prop, -4 2019-07-26 13:00:51 +00:00
zzz
617294b7fa propagate from branch 'i2p.i2p.zzz.confsplit' (head 324249e53469a81e66f9d1c1989d9f53817868f4)
to branch 'i2p.i2p' (head cf6476e03a43a35fea6697b29f9ff43f77875100)
2019-07-26 12:53:03 +00:00
zzz
240d59393f Debian: Change debian files from stretch (Jetty 9.2, Tomcat 8, Java 8) to buster (Jetty 9.4, Tomcat 9, Java 11)
Add debian-alt/stretch files
Update debian-alt/precise, trusty, xenial, bionic, disco to include
 the changes from buster, not stretch
Remove debian-alt/buster, unstable files
Doc updates
2019-07-26 12:48:17 +00:00
zzz
6b94dc2dbd configclients: Only save files that have changed when in split config 2019-07-24 13:37:20 +00:00
zzz
3a0873c991 streaming debug log tweak and notes on ID mismatch 2019-07-23 21:08:30 +00:00
zzz
72ef065ab7 log tweak 2019-07-23 15:57:30 +00:00
zzz
66ecdb2f7a Data: Initial support for enc types in PrivateKeyFile and I2PSessionImpl
CreateRouterInfoJob updates and cleanups; KeyCert updates
2019-07-23 15:56:03 +00:00
zzz
e2980603b7 Router: Checks for new enc types
- Prevent encrypted lookups or stores
- Prevent participting in our tunnels
- Handle padding
- Checks in crypto classes
2019-07-23 13:29:37 +00:00
zzz
885e0468b2 NetDB: Mark ls2 received via garlic as blinded if bit 2 set in flags 2019-07-22 15:35:07 +00:00
zzz
3bfbb6aef6 i2ptunnel:
Store configFile path in controller so it doesn't change
Simplify assureConfigFile()
Sanitize tunnel name when creating config file name
Sort config when saving
Don't copy config when saving
Make shouldMigrate() private
Javadocs
2019-07-20 18:05:17 +00:00
zzz
365820172a Console: Split up /help page, prep for translation (ticket #2298) (WIP)
Summary bar -> sidebar
Remove static translated help pages
Add jsp for LICENSE.txt
2019-07-19 20:30:22 +00:00
zzz
d73058fd65 Console: Remove links on /configclients 2019-07-19 16:33:22 +00:00
zzz
7374484ccb Data: Set flag bit when blinded 2019-07-18 18:42:42 +00:00
hankhill19580
7d4229acab use for(Properties props: tunnels) to migrate tunnels 2019-07-18 17:04:36 +00:00
hankhill19580
41128f1457 remove redundant functions 2019-07-17 14:34:41 +00:00
hankhill19580
61f45b3a3a Remove un-needed imports 2019-07-17 02:25:07 +00:00
hankhill19580
aaacb2e558 Fix the configFile property so that removeControllers can work, fix cross-platform/un-migrated platform bugs, override equals so the list of controllers can remove a controller by passing the object 2019-07-17 02:22:07 +00:00
hankhill19580
9c2dc47a8a use .equals instead of == 2019-07-15 19:31:04 +00:00
hankhill19580
2db0a65425 Save tunnel configs on tunnel creation, only save one config at a time. 2019-07-15 19:05:03 +00:00
zzz
fd781f4894 TCG:
private/public method tweaks and revert API breakage
remove loadSplitConfig()
don't create empty file in assureConfigFile()
throw exception on empty config
locking fixes
formatting cleanups
@since fixes
log tweaks
2019-07-15 16:22:51 +00:00
hankhill19580
4a099854f7 Make sure listFiles returns i2ptunnel.config on un-migrated platforms, don't loop over loadControllers in startup() 2019-07-13 08:34:54 +00:00
hankhill19580
ff379c36cb NPE fix 2019-07-13 08:10:24 +00:00
hankhill19580
d5970f17de more consistency fixes 2019-07-13 07:18:25 +00:00
hankhill19580
595e43b8a4 fix the bug where it tries to migrate an already migrated config file, pass around files instead of strings, use the FileSuffixFilter, eliminate irrelevant code 2019-07-13 06:10:30 +00:00
zzz
6adc665fd3 Build: Move SSU HMAC implementation from core to router 2019-07-12 18:40:46 +00:00
zzz
1be569db7a Test: Fix broken junit test build 2019-07-12 17:33:03 +00:00
zzz
63e75ed307 increase max plugin size to 128 MB 2019-07-11 19:17:14 +00:00
zzz
6b990689cc imagegen:
Generate RGB QR code images
re-enable font anti-aliasing
scale font based on text and image size
2019-07-11 14:04:12 +00:00
zzz
3e48bf80f1 Add muwire.i2p to home page
as approved at July 2 meeting
icon: public domain
2019-07-10 12:13:30 +00:00
zzz
5341166e95 NetDb: Pick alternate reply GW for netdb store reply
if connected, to reduce connections
2019-07-09 18:36:02 +00:00
zzz
685088ccca NetDb: Fix NPE on store of Encrypted LS (ticket #2563) 2019-07-09 18:31:37 +00:00
zzz
7a64505139 Console: Hide netdb RI and LS tabs (ticket #2558) 2019-07-04 12:34:14 +00:00
zzz
df223af23d debian files for 0.9.41 2019-07-03 21:25:55 +00:00
zzz
8d74a196cf debian release build fix 2 2019-07-03 17:07:24 +00:00
zzz
26d74620a9 debian release build fix 2019-07-03 17:04:00 +00:00
zzz
e458361193 Fix bad reversion
0.9.41
2019-07-03 12:22:40 +00:00
zzz
fea35512a7 bump for review 2019-06-28 16:57:09 +00:00
zzz
d5dda73742 Add Romanian readme.html 2019-06-28 15:19:49 +00:00
zzz
86fd8ce391 Add Farsi translations for i2psnark and i2ptunnel
Add eepsite help translations for Polish and Portuguese
Fix Dutch eepsite help that had wrong language in it,
instalsler/r checkin last weekocroot/help/index_nl.html
2019-06-28 13:44:09 +00:00
zzz
e24333206e pull translations 2019-06-28 13:23:51 +00:00
zzz
0231d5eec2 merge of '35e9236c690ee69648566ad3a2b43ec6560570a7'
and 'f1938ed516f15ce07b8f4f4fc6338eac16a45b89'
2019-06-27 17:15:26 +00:00
zzz
258aea136e remove outproxy 2019-06-27 17:14:35 +00:00
zab2
44e1b6058f Add ability to set custom LogManager 2019-06-27 15:16:47 +00:00
zzz
051e18f9c7 Console: New network status icons from Sadie
Source: https://github.com/feathericons/feather
Feather is licensed under the MIT License.
https://raw.githubusercontent.com/feathericons/feather/master/LICENSE
2019-06-27 14:57:41 +00:00
zzz
a66fb815a6 Console: New dark theme logo
Created under contract to I2P by
Ura Design https://ura.design/projects/i2p
Copyright (c) 2019 The Invisible Internet Project. All rights reserved.
Creative Commons Attribution-ShareAlike 4.0 International License
https://creativecommons.org/licenses/by-sa/4.0/
2019-06-27 14:51:37 +00:00
zzz
3e8386382b Transport: Fix issues with leaving hidden mode (ticket #2557)
Lookup our IP even if not in our RI
Lookup IPv6 addresses detected in UDP
Javadocs
2019-06-26 16:12:19 +00:00
zzz
87109c8fef imagegen: Catch render error (ticket #2507) 2019-06-25 17:58:52 +00:00
zzz
7ecee9dfdb Streaming: Increase size of recently-closed cache 2019-06-25 14:23:32 +00:00
zzz
9dc24d5f27 Router: Disable MessageHistory job on Android 2019-06-25 14:19:31 +00:00
zzz
e6b5fc8fd4 I2CP: One more HostReply return code 2019-06-25 14:15:10 +00:00
zzz
b52e8d6b5c I2CP: Prevent sending message to a local meta destination 2019-06-25 13:34:59 +00:00
zzz
ce6551dacd log tweak 2019-06-25 13:30:35 +00:00
zzz
f7d785b6d2 log fix 2019-06-25 13:29:52 +00:00
zzz
27e060eee5 comment fixes 2019-06-25 13:28:30 +00:00
zzz
cf1c1bb3f7 encrypted ls2 test tweaks 2019-06-25 13:26:30 +00:00
zzz
85a2c9026a KeyGen test tweaks 2019-06-25 13:24:38 +00:00
zzz
d084f93506 test code 2019-06-25 13:21:22 +00:00
zzz
8433f658f8 Streaming: Check that destinations match 2019-06-25 13:18:26 +00:00
zzz
2cdb86fa1e Use checked sort 2019-06-25 13:10:53 +00:00
zzz
d8e06a0d14 Deprecate unused StatLog 2019-06-24 14:33:56 +00:00
zzz
c1418a1c2e StatManager cleanup and synch
BuildTime update
Make clock.skew stat non-required
2019-06-24 14:23:33 +00:00
zzz
b99f239f3d I2CP: Ensure that callbacks are called on abnormal close
throw IAE on invalid listener protocol/port
log tweaks
2019-06-22 16:58:44 +00:00
zzz
1a030c3f92 Console: New unthemed and light theme logo
Created under contract to I2P by
Ura Design https://ura.design/projects/i2p
Copyright (c) 2019 The Invisible Internet Project. All rights reserved.
Creative Commons Attribution-ShareAlike 4.0 International License
https://creativecommons.org/licenses/by-sa/4.0/
2019-06-22 12:40:36 +00:00
zzz
41e9bfc6b7 Console: Remove home page entries 2019-06-22 12:29:35 +00:00
zzz
f40655fc2f Console: New icons from Sadie
Source: https://github.com/feathericons/feather
Feather is licensed under the MIT License.
https://raw.githubusercontent.com/feathericons/feather/master/LICENSE
2019-06-21 19:51:35 +00:00
zzz
845e5ed37c missed one 2019-06-21 16:58:13 +00:00
zzz
019c3171c4 Update hidden mode list using the Freedom in the World Index 2019
https://freedomhouse.org/report/countries-world-freedom-2019
2019-06-21 16:41:54 +00:00
zzz
93a3f09971 poupdate-source 2019-06-19 18:47:33 +00:00
zzz
51457bd873 Remove atomike reseed and cert
Add backup plugin cert
Add log for one case where no valid RIs found in reseed
2019-06-18 17:35:14 +00:00
zzz
ebe95fc575 i2ptunnel: Improve logging when no outproxy configured (ticket #2338) 2019-06-18 13:24:48 +00:00
zzz
6d8431a77e I2CP: Use EnumSets for state checking 2019-06-17 15:46:28 +00:00
zzz
a8f2745169 Router: Don't check for ping file at startup on Android 2019-06-17 14:56:03 +00:00
zzz
61cdc7c7d2 Console: Hide news section in summary bar if news fetching
is disabled, or if empty (ticket #2301)
2019-06-17 13:11:23 +00:00
zzz
3aeadaa719 i2psnark: Fix QupZilla detection (ticket #2026) 2019-06-16 16:14:35 +00:00
zzz
a542b182ea i2psnark: Increase DHT blacklist time (ticket #2275)
Update time if already blacklisted
Prune blacklist if too big
2019-06-16 14:59:55 +00:00
zzz
1ddc651b11 Console: Fix stopping webapps at shutdown (ticket #2508)
RouterAppManager log tweaks
2019-06-15 16:02:22 +00:00
zzz
b0bca2f16c Util: Avoid dup context warning when SU3File called twice from gradle 2019-06-12 18:14:18 +00:00
zzz
d9775a5f10 INMP refactor 2019-06-09 16:42:43 +00:00
zzz
ea2ef7b127 Add Farsi susimail translation 2019-06-09 15:51:52 +00:00
zzz
6d9aa92ed0 Tests: Fix some bashisms, add more files to bashisms check 2019-06-09 15:50:50 +00:00
zzz
0c54b6d9da Eepsite Help page:
Add links to Arabic, Hungarian, Indonesian
Fix link to Italian
2019-06-09 15:04:20 +00:00
zzz
5ede0a139c UPnP: Set lease duration of 3 hours, always refresh the lease 2019-06-09 11:48:03 +00:00
hankhill19580
2918d6006f fix un-migrated and monolithic config saving 2019-06-09 02:20:23 +00:00
zzz
2c97dc2bcd Job: Deprecate getAddedBy(), suppress warnings 2019-06-08 16:12:51 +00:00
zzz
7e6a92ab7b NetDB: Faster startup for non-Android too 2019-06-08 13:14:14 +00:00
zzz
46ad48d5d1 log cleanup 2019-06-08 13:09:24 +00:00
zzz
2c24a68135 NetDB: Fix Deliv. Status msg sent direct to tunnel,
must be wrapped in a Tunnel GW msg.
2019-06-08 12:58:05 +00:00
hankhill19580
357feca7b1 fix bug when configs are un-migrated 2019-06-08 07:26:24 +00:00
hankhill19580
920a83ddab tiny formatting fix 2019-06-08 04:11:18 +00:00
hankhill19580
42e3406529 re-name inConfig to reflect new purpose 2019-06-08 04:04:53 +00:00
hankhill19580
7336f64c26 fix saving config files from ui 2019-06-08 04:03:31 +00:00
hankhill19580
c1731f68fa when deleting configs, move them to a backup location 2019-06-08 00:51:59 +00:00
zzz
5ed953e11e NetDB: Fix NPE on failed decrypt of enc. ls2 2019-06-07 19:50:56 +00:00
hankhill19580
e4892c6d5c fix removeConfig so it backs up and removes the files 2019-06-07 18:12:44 +00:00
zzz
1a200a16cc Make TunnelPool final in PooledTunnelCreatorConfig
Don't pass around both pool and cfg in args
Remove unused methods
Cleanup multiple now() and getSettings() calls
2019-06-07 15:19:06 +00:00
zzz
e50bf00fa8 Log tweaks, bump -10 2019-06-06 15:00:35 +00:00
zzz
e75881d6cc Build: Forgot libjcpuid 2019-06-06 13:53:00 +00:00
zzz
75ace4266e Build: New target jbigi-linux-x86-64-only 2019-06-06 13:47:42 +00:00
zzz
e82a547bce CPUID/NBI: Prep for GMP 6.1.2
Add Skylake support (ticket #1869)
Recognize more Intel "Lake" processors
Clean up CLI output
2019-06-06 13:28:44 +00:00
zzz
6d72aeed8c cleanup and logging 2019-06-05 18:00:39 +00:00
zzz
c01bf47c8a NetDb: Fix to set netDb ready immediately after reseed 2019-06-05 17:37:23 +00:00
zzz
4bd0f06cd6 jbigi: Support android builds using NDK
Prep for GMP 6.1.2
2019-06-05 17:13:15 +00:00
zzz
aab6529f62 Data: Fix for change of default auth type,
handle old value from persistent cache
2019-06-05 17:09:49 +00:00
zzz
11c8e8e794 dont migrate clients.config if android 2019-06-05 12:15:46 +00:00
zzz
0d1dbc7992 dont migrate clients.config if portable 2019-06-05 12:08:01 +00:00
zzz
7cd60bb0e7 Util: Add EKU to selfsigned certs 2019-06-05 11:47:59 +00:00
zzz
697b617c7a finals 2019-06-03 13:06:44 +00:00
zzz
fe6c7cd41f Transport: Fix large messages in SSU (ticket #2505) 2019-06-03 12:12:43 +00:00
zzz
eea0990b54 Use hasWrapper() util method 2019-06-03 11:39:56 +00:00
zzz
aa0bafb8a8 Update PAC file for additional security 2019-06-02 12:39:18 +00:00
zzz
c4ebc7357d TCG: Add new getInstance() method for Android
so instance with stale context is not returned.
Return null in Android for old method.
2019-06-02 11:08:38 +00:00
zzz
471c5d49d1 I2CP: Cleanups for single-byte reads
Stub out new error codes for prop. 123
2019-06-02 10:59:39 +00:00
zzz
eff2bdbf87 Build: Fix Debian (ticket #2517) 2019-06-02 10:17:59 +00:00
zzz
b5de81582f more renaming protection 2019-06-01 20:06:22 +00:00
zzz
500246ebed NetDB: Don't wait for all RIs to be read in on Android
to tell the router we've loaded them, lets i2ptunnel start faster.
2019-06-01 19:46:09 +00:00
hankhill19580
38f135ceb9 That took me entirely too long to figure out 2019-06-01 18:42:22 +00:00
hankhill19580
0a1a2ed82a unwrap some loops, get rid of configFiles(), fix loadConfig 2019-06-01 16:20:53 +00:00
zzz
0a774c6c58 remove cryptic logging 2019-06-01 14:12:48 +00:00
zzz
f44a8e49c5 Tunnels: Ensure GW Pumper threads stop on Android 2019-06-01 14:05:40 +00:00
zzz
1109331dfc Transport: UPnP fixes for Android 2019-05-31 21:43:41 +00:00
zzz
8a4c4694ec Blinding: cache b32, sort by b32 on /configkeyring 2019-05-31 15:26:20 +00:00
zzz
b4f331e621 Router: Fix persistence of blinded privkey and timestamp 2019-05-31 13:17:30 +00:00
zzz
67224858b7 whitespace 2019-05-30 15:36:11 +00:00
zzz
447e29e381 Console: More reword of tooltips 2019-05-30 15:28:36 +00:00
zzz
aae81a7b5f Console, i2ptunnel: Reword blinding options and tooltips
i2ptunnel: Unhide blinding options
2019-05-30 15:16:47 +00:00
zzz
f049319500 Console: Support deleting blinded entries on /configkeyring 2019-05-30 14:26:11 +00:00
zzz
6b3896c1f8 increase default max conns per minute 2019-05-30 12:16:12 +00:00
zzz
652c3d5dc2 Build: More mavenLocal cleanup 2019-05-30 12:02:10 +00:00
zzz
4d29bfefde i2ptunnel: Fix double-b64 of default client name
Add new default client if all are revoked
2019-05-30 11:39:42 +00:00
zzz
16ac93c36b maven script cleanups 2019-05-30 10:58:09 +00:00
zzz
040e092153 Blinding:
- Fix bugs with lookup password
- Log tweaks
2019-05-29 19:08:33 +00:00
meeh
098bde2a32 New ant target 'mavenLocal' + changes in the script to support this. 2019-05-29 18:22:33 +00:00
meeh
f94d2d5578 Script to install development builds to local maven. 2019-05-29 18:07:28 +00:00
zzz
30a34acd41 log fix 2019-05-29 15:56:39 +00:00
zzz
dca04f7f60 store save time in config files 2019-05-29 15:52:24 +00:00
zzz
307a8239fb log tweaks 2019-05-29 15:51:04 +00:00
zzz
e189236e3e flip LS tab order 2019-05-29 12:42:36 +00:00
zzz
a3fe7467c3 store ls secret as b64 2019-05-29 11:53:55 +00:00
zzz
973aab8f53 Blinding:
- Blinding only throws IAE
- Remove context arg from encode()
- Hook in new form args on /configkeyring
- Show b33 on /configkeyring
- Remove support for appended secret in b33
- Persist cache immediately when storing secret or privkey
- Fix i2ptunnel for std. ls2
- Add auth/secret required flags to BlindData
more to do
2019-05-28 15:12:20 +00:00
zzz
0c7c19451c missed file from previous checkin 2019-05-27 17:57:47 +00:00
zzz
73b00eb206 Console: Start rework of /configkeyring for LS2
Not hooked up yet - WIP
2019-05-27 15:44:51 +00:00
zzz
90e6458428 I2CP: Add per-client auth to generated leaseset
Set key on router side before verifying
2019-05-26 12:09:28 +00:00
hankhill19580
4fdcd25671 add some logging while I fix stuff 2019-05-25 17:35:57 +00:00
zzz
c2e2cc2e57 i2ptunnel: Revert user-select, already in css, doesn't work on input 2019-05-24 19:36:11 +00:00
zzz
2abd59e6d4 i2ptunnel: Per-client auth config
Hide encryption key for per-client auth
User-select: all for dest and reg fields
2019-05-24 17:42:11 +00:00
hankhill19580
65481ad61e improve config saving code, never use deprecated config function 2019-05-23 16:59:27 +00:00
zzz
47c64c2eef i2ptunnel: Rework server encryption key UI in prep for blinded keys
Remove generate button, automatically generate when required
Refactor auto configuration
2019-05-23 13:22:29 +00:00
zzz
7bdfd071ae i2ptunnel: select box for sig type 2019-05-23 11:12:19 +00:00
zzz
7858dbe757 i2ptunnel: Add LS2 option, change to select box 2019-05-23 10:41:34 +00:00
hankhill19580
8466cdc675 saveConfig for multi-configuration 2019-05-23 00:29:06 +00:00
zzz
ea5ddfcf36 i2ptunnel: Shared key is PSK 2019-05-22 18:27:34 +00:00
zzz
332898351c i2ptunnel: Per-client auth options (WIP) 2019-05-22 18:12:49 +00:00
zzz
2ec34f4827 I2CP: Set local privkey for encls2 2019-05-22 17:01:26 +00:00
zzz
7489a64e6c NetDB: Set secret and privkey before decrypting encls2 2019-05-22 16:30:32 +00:00
zzz
06fa817bde Data: Per-client auth for enc. LS2 (proposal 123) 2019-05-22 16:11:36 +00:00
zzz
cb762356da Data: Cache data for per-client auth 2019-05-22 16:01:10 +00:00
zzz
62649a6343 Crypto: Add X25519 DH method, prep for enc. ls2 auth. 2019-05-22 11:04:17 +00:00
zzz
a6434fb71e NTCP2: Use KeyGenerator for X25519 keys 2019-05-22 11:02:12 +00:00
zzz
a8f11d1834 Profiles: Omit comments from stored profiles 2019-05-21 17:24:18 +00:00
zzz
67e7e45779 Sybil: Skip comment lines in stored files
Escape % in stored reasons
Improve error handling when loading files
2019-05-20 18:27:29 +00:00
zzz
cafdca9a7b proxynet.i2p 2LD host 2019-05-20 13:53:29 +00:00
zzz
7efb290f13 addressbook: remove log info message 2019-05-20 13:51:43 +00:00
zzz
b3cb09481c Console: Hide some columns on SSU tab unless advanced 2019-05-20 12:50:27 +00:00
zzz
f543a45a72 Tunnels: Increase tunnel reuse probability 2019-05-20 11:17:18 +00:00
zzz
099cacd3e3 Installer: Fix -console install for izpack 5 (ticket #2492)
Switch to izpack 5 for non-windows release installer
2019-05-20 11:07:46 +00:00
zzz
b89720e710 Sybil: Delete old stored analysis if configured
Fix display of config tab
2019-05-19 18:38:21 +00:00
zzz
1ffc006b2e Build: Remove dependencies on Nashorn (ticket #2367) 2019-05-19 14:31:11 +00:00
zzz
f2f5df0db4 Sybil: Run IP and family tests on all routers
Hide some n/a fields, rework some text
Rename some config properties
2019-05-19 11:42:26 +00:00
zzz
10354df425 Sybil: Option to run on non-floodfills too 2019-05-18 21:45:55 +00:00
zzz
03bd3e2db3 checklist/doc updates 2019-05-18 14:43:13 +00:00
zzz
11b391bc35 Javadoc fixes from FreeBSD ports
https://svnweb.freebsd.org/ports?view=revision&revision=501144
2019-05-18 14:14:08 +00:00
zzz
a6e6d29d33 Sybil:
Show routers in analysis even if no RI available
Date format fixes
Put date in ban reason
Show ban reason
Add link to banlist
2019-05-18 13:10:45 +00:00
zzz
6600f373da Streaming: Fix NPE in debug logging (ticket #2504) 2019-05-15 10:58:15 +00:00
zzz
efa72dbb56 EepGet: Don't continue when requested a partial but didn't
get it, and the output is to a stream
Javadocs and log tweaks
2019-05-15 10:32:54 +00:00
zzz
4e267f690d Util: Don't set restrictive permissions on exported certs 2019-05-14 17:41:29 +00:00
zzz
05318013e2 Console: Prevent editing a client while it's starting 2019-05-13 14:44:35 +00:00
zzz
8840532ed0 Sybil: Auto-blocking 2019-05-13 13:28:04 +00:00
zzz
48a92ca1e7 Sybil: Auto-block UI 2019-05-13 12:15:19 +00:00
zzz
ff71540428 Snark: remove italics on speeds 2019-05-13 11:01:31 +00:00
zzz
f04b41c99a Console: Hide transport table unless advanced 2019-05-13 10:49:49 +00:00
zzz
847ebda3e2 Tunnels: Fix connection checker for NTCP2 2019-05-13 10:05:43 +00:00
zzz
e174a46801 javadoc fixes 2019-05-12 20:45:17 +00:00
zzz
04a985cd8c Consolidate Java version checking code, fix bugs
where versions are in different forms
Add warning about Java 7
2019-05-12 20:20:13 +00:00
zzz
adb1c6f58e Jetty: Fix webapps in eepsite (ticket #2477) 2019-05-12 18:14:55 +00:00
zzz
9eec35713c Utils: Allow absolute path to certs in I2PSSLSocketFactory 2019-05-11 13:37:18 +00:00
meeh
f6efdceaca Update test/check to support FreeBSD/MacOSX iconv which don't support the -o argument. Solution, use pipe instead. 2019-05-10 22:22:57 +00:00
zzz
c1adcfcc19 NetDB: Use expl. tunnels to verify Meta LS2 (proposal #123) 2019-05-10 17:33:39 +00:00
zzz
0a7330393d NetDB: Store Meta LS2 to floodfills (proposal #123) 2019-05-10 17:02:30 +00:00
zzz
63b2f29633 Begin i2p.i2p.zzz.confsplit branch
Code from Jan. 2018, never checked in, probably untested,
definitely incomplete.
2019-05-10 14:58:41 +00:00
zzz
d8980d10a4 Transport: Revert GeoIP changes that broke BundleRouterInfos 2019-05-10 11:46:25 +00:00
zzz
c7d052646e Transport: Start first GeoIP lookup when netdb is ready 2019-05-09 20:11:03 +00:00
zzz
de8a079cb4 Console: Remove plugin install success message (ticket #2494) 2019-05-09 17:30:46 +00:00
zzz
fc8b55df27 Wrapper: Update to wrapper 3.5.39
All binaries from Tanuki Delta Pack Community Edition,
except for armhf (armv6), compiled on Raspberry Pi:
  ant 1.8.2
  javac 1.7.0_151
  gcc 4.6.3-14+rpi1

Added linux-armv7 and linux64-armv8

Windows binaries remain unchanged as we must recompile them ourselves
(32 bit just to change the icon; 64 bit is not provided by Tanuki)
2019-05-09 14:19:50 +00:00
zzz
be6b200945 remove Java 9 warning 2019-05-09 12:01:50 +00:00
zzz
cbeaca66a2 rename method 2019-05-09 11:31:06 +00:00
zzz
585778cddc Console: Delay plugin update check until router is ready 2019-05-09 10:10:24 +00:00
zzz
cb0235bb5d Utils: su3file fix for extract -x w/o filename 2019-05-09 09:14:04 +00:00
zzz
558592a87f Utils: Auto-generate su3 output file for extract if not specified 2019-05-08 13:50:26 +00:00
zzz
41e8b6dfbb 0.9.40 debian files 2019-05-08 12:10:00 +00:00
meeh
5aae625788 Mac OSX Launcher: Version bump etc. 0.9.40, launcher version 0.1.5 2019-05-07 22:47:01 +00:00
zzz
16d2bdc1db 0.9.40 2019-05-07 11:54:18 +00:00
zzz
edb352b9d0 replace news cert 2019-05-07 11:44:11 +00:00
zzz
ffbf3d2023 javadocs after review 2019-05-07 11:42:31 +00:00
zzz
0147f003c4 Star icons update 2019-05-03 13:20:50 +00:00
zzz
50d93b1993 regenerate tr man pages 2019-05-03 12:57:12 +00:00
zzz
a39549a3d9 pull translations from transifex 2019-05-03 12:53:03 +00:00
meeh
9adabadeb9 Mac OSX Launcher: shell script for downloading and building Sparkle. 2019-05-02 23:12:54 +00:00
meeh
61303bfd0b Mac OSX Launcher: The podfile, which describes which 3rdparty libraries to pull at compile time. 2019-05-02 23:01:32 +00:00
meeh
e45963dbcb Mac OSX Launcher: main.mm updated to use the new swift main class name. 2019-05-02 23:00:44 +00:00
meeh
5f689ccbd4 Mac OSX Launcher: project file, workspace file and entittlements file updates. 2019-05-02 23:00:02 +00:00
meeh
17bb36deee Mac OSX Launcher: Info.plist update, adding Sparkle pubkey. 2019-05-02 22:59:01 +00:00
meeh
0b50c36c8a Mac OSX Launcher: xib UI updates. 2019-05-02 22:56:53 +00:00
meeh
feaa82181f Mac OSX Launcher: Router / Java wrapper. 2019-05-02 22:55:55 +00:00
meeh
803447b4c3 Mac OSX Launcher: Swift - ObjC/C++ bridge header update. 2019-05-02 22:55:04 +00:00
meeh
e93fb5c084 Mac OSX Launcher: Reduce amount of compiler warnings under build. 2019-05-02 22:54:02 +00:00
meeh
6a418ebcab Mac OSX Launcher: Swift 4.2 update in subprocess class. 2019-05-02 22:53:00 +00:00
meeh
67ca6e6552 Mac OSX Launcher: Identifiers file to hold Bundle ID and other static domain data. 2019-05-02 22:52:16 +00:00
meeh
540e7c37e0 Mac OSX Launcher: Cleanup and update in UI classes. Swift 4.2 2019-05-02 22:51:35 +00:00
meeh
7cb0c9bbb4 Mac OSX Launcher: Router management/healthcheck code updates. 2019-05-02 22:50:55 +00:00
meeh
66deb5dc7e Mac OSX Launcher: Cleaned, updated and renamed main swift class. 2019-05-02 22:50:12 +00:00
meeh
3e10745717 Mac OSX Launcher: Storyboard and NIB updates. Also moved to resources which they belong. 2019-05-02 22:48:16 +00:00
meeh
84419bbf0b Mac OSX Launcher: Common code for browser communication/control. 2019-05-02 22:47:01 +00:00
meeh
d81f993f81 Mac OSX Launcher: (feature disabled, WIP) new pretty userinterface. 2019-05-02 22:45:41 +00:00
meeh
8453c5cce0 merge of '4347aa09448af24e7796c3282763d4a1bfc5c07f'
and '648083ff7dde91e5aa4416e1a9f85989acca9fb6'
2019-05-02 22:43:41 +00:00
meeh
b2b047b4aa Mac OSX Launcher: Licenses for frameworks/libraries pulled from cocoapods under compile time. 2019-05-02 22:43:34 +00:00
meeh
7aa68c0a2b merge of '884fdac5153dc99fad97b61b1ef1172d8f0c09a9'
and 'c88b4076c5928a0e87d073abc0c0c94a341c921e'
2019-05-02 22:41:50 +00:00
meeh
811d1ccf9d Mac OSX Launcher: Moving utils classes to common directory between sub-projects + Swift 4.2 update. 2019-05-02 22:41:25 +00:00
meeh
2af1f68d84 Mac OSX Launcher: Misc metadata updates for the StartupItemApp sub-bundle. 2019-05-02 22:40:18 +00:00
meeh
56eb11bc17 Mac OSX Launcher: Adding Swift 4.2 support to the preferences UI classes. 2019-05-02 22:39:11 +00:00
meeh
214efb8ef9 Mac OSX Launcher: Moved Objective-C & C++ files to a better location. 2019-05-02 19:30:56 +00:00
meeh
d1631643a5 Mac OSX Launcher: Misc updates related to router management. 2019-05-02 19:26:52 +00:00
meeh
315d7728d8 Mac OSX Launcher: Sparkle License 2019-05-02 19:10:19 +00:00
meeh
647f9e728f merge of '89268c439b2c0098fe4dd039cb032f5c5717a2e5'
and 'de08714d459702cd7ba8c86570c747dca157ed26'
2019-05-02 16:16:16 +00:00
meeh
fa2897d2f8 Mac OSX Launcher: Delay extension for the DispatchQueue Cocoa/OSX class. 2019-05-02 16:16:11 +00:00
meeh
539f880f9b merge of '4ae3e891f8510b146feae122bacc862468db060e'
and '666d27bab7047baeaa2c753159098eda75635c5e'
2019-05-02 16:14:46 +00:00
meeh
9caa7a61b0 Mac OSX Launcher: EditorTableView for the 2019 redesign/UI improvements. 2019-05-02 16:14:38 +00:00
zzz
52b14142bb Android: Catch ISE from PRNG at shutdown (ticket #2077) 2019-05-02 14:59:16 +00:00
zzz
7f60ee9f8b Console: NTCP2 check 2019-05-02 14:25:43 +00:00
zzz
b9726a0af8 UPnP: Remove finalize() in HTTPSocket (ticket #2490) 2019-05-02 14:08:25 +00:00
zzz
bb86c56e77 NTCP: Tweak previous fix to prevent leak (ticket #2476) 2019-05-02 12:25:18 +00:00
zzz
8cdeff74c7 GeoIP Maxmind 2019-04-29 2019-05-02 12:17:59 +00:00
zzz
acf5c314de NTCP: Rare EventPumper 100% CPU fix (ticket #2476) 2019-05-02 11:55:04 +00:00
zzz
20413f00c0 Build: Fix installers broken by removal of apparmor file 2019-04-28 14:44:28 +00:00
zzz
aa551acec4 Console: Remove metadata from new icons 2019-04-27 12:17:08 +00:00
zzz
f088ea1263 Build: Fix Precise build 2019-04-26 12:33:15 +00:00
zzz
46e31746b4 Build: Drop unmaintained sample apparmor script (ticket #2319)
We support apparmor for Debian package installs only.
2019-04-25 16:35:19 +00:00
zzz
981737f8ed i2ptunnel: Force connect delay and bulk profile for most
client tunnel types, and hide from UI
Reduce delay
Set IRC to bulk
2019-04-25 16:16:32 +00:00
str4d
5f01796bae Travis CI: Run tests against OpenJDK 12 2019-04-25 15:36:07 +00:00
zzz
b2575643a8 Transport: Disable NTCP 1 by default 2019-04-25 13:29:14 +00:00
zzz
baeaa65829 update po source for tx 2019-04-24 14:25:43 +00:00
zzz
5afa32a393 Crypto: Catch ProviderException in KeyStoreUtil (ticket #2479) 2019-04-24 12:23:35 +00:00
zzz
ca0f12782b New backup news server 2019-04-23 18:33:57 +00:00
zzz
148ed1e3a0 rh.bat fix 2019-04-23 17:25:44 +00:00
zzz
6f86522c2b Build: Add script to edit windows installer resources 2019-04-23 16:26:17 +00:00
zzz
5db67f13e1 Util: Dump system properties in SystemVersion 2019-04-23 13:24:03 +00:00
zzz
21504f1539 Build:
- Switch to IzPack 5.1.3 for building releases (ticket #1864)
 - Use izpack2exe for Windows installer (ticket #2403)
2019-04-22 18:01:47 +00:00
str4d
fd311c7e1a Gradle: Fix getBuiltBy() to work when override.properties does not exist 2019-04-21 22:31:45 +00:00
str4d
7c71ff106b Tests: Fix ministreaming tests after access filtering changes 2019-04-21 22:27:00 +00:00
str4d
d13bf0b72a Gradle: Use tested version of Mockito
The Ant JUnit tests have been tested previously with 2.5.0 as working.
2.11.0 is causing issues that are manifesting as Gradle-specific test
failures. We can upgrade this explicitly when we also upgrade the
dependency in the Ant-based CI system.
2019-04-21 22:08:34 +00:00
str4d
9e0934f958 Build: Fix titles in ministreaming and streaming JAR manifests 2019-04-21 21:03:39 +00:00
str4d
1cc330ba66 Gradle: Generate attributes for JAR manifests 2019-04-21 21:01:28 +00:00
str4d
967dde4395 Gradle: Generate reproducible archives 2019-04-21 18:09:20 +00:00
str4d
278870606b Gradle: Fix deprecations 2019-04-21 16:38:09 +00:00
str4d
e70a2c765b Update Jetty and Tomcat versions in Gradle build scripts 2019-04-21 16:37:28 +00:00
zzz
31856e8895 Router: Update NTCP checks for NTCP2
Remove old check for 0.6.1.32 and earlier routers
2019-04-20 18:36:43 +00:00
zzz
22aefa2042 Console, SusiDNS: New icons from Sadie
Source: https://github.com/feathericons/feather
Feather is licensed under the MIT License.
https://raw.githubusercontent.com/feathericons/feather/master/LICENSE
All icons converted from SVG to PNG, brightness adjusted, colourized with #848484 and resized
Some are combined and modified
2019-04-20 14:23:52 +00:00
zab2
aeded8c495 Add the blue outproxy to the default proxy list 2019-04-20 08:34:08 +00:00
zzz
3248a15d59 Debian: Update Bionic/Cosmic to include patch for Jetty 9.4 2019-04-19 13:55:38 +00:00
zzz
5c81c00a18 Utils: CoDel minor speedup (ticket #2398) 2019-04-18 13:53:27 +00:00
zzz
ea7ddaf6d5 Console: Improve error message when graphs disabled (ticket #2452) 2019-04-18 13:17:45 +00:00
zzz
a8ad30b335 PeerManager API cleanup (ticket #2456) 2019-04-18 12:46:51 +00:00
zzz
67570db664 Transport: More fixes for NTCP when SSU disabled (ticket #1417) 2019-04-17 17:45:49 +00:00
zzz
87d8d69a20 Console: New icons from Sadie
Source: https://github.com/feathericons/feather
Feather is licensed under the MIT License.
https://raw.githubusercontent.com/feathericons/feather/master/LICENSE
All icons converted from SVG to PNG, brightness adjusted, colourized with #848484 and resized
Some are combined and modified
2019-04-16 11:10:29 +00:00
zab2
e967b26f5a update javadoc 2019-04-16 02:30:56 +00:00
zab2
e5540d051f proper fix for memory bug 2019-04-16 00:37:29 +00:00
zab2
7ce81db9a8 forget the known destinations when reloading 2019-04-15 23:40:02 +00:00
zzz
e42e04c0f0 Console: Don't display I2CP error during soft restart (ticket #2468) 2019-04-15 12:49:07 +00:00
zzz
d32d5b5f29 NamingService: Fix class selection in app context (ticket #2469) 2019-04-15 12:34:41 +00:00
zzz
8d00774b5e Tomcat 8.5.40 2019-04-15 11:45:52 +00:00
zab2
89b38f4fff add my certificate for plugins 2019-04-13 19:41:40 +00:00
zzz
0dbc809111 i2ptunnel: Fix saving encrypted LS config
Disable registration authentication when encrypted
2019-04-13 19:02:35 +00:00
zzz
64c7625524 i2ptunnel: Hide blinded-with-password config 2019-04-12 12:08:09 +00:00
zzz
071e702e56 i2ptunnel: Hide I2CP config in router context 2019-04-11 20:16:44 +00:00
zzz
363317fc26 i2ptunnel: Disallow any encrypted LS for offline keys 2019-04-11 15:59:11 +00:00
zzz
f4d7a6d0d4 i2ptunnel: Disallow encrypted LS for offline keys 2019-04-11 15:38:03 +00:00
zzz
b5a4f1626f whitespace 2019-04-11 15:13:58 +00:00
zzz
73790e2353 i2ptunnel: Fix NPE creating server tunnel
Add Red25519 sigtype option for servers
Fix if clause in editClient
2019-04-11 14:33:38 +00:00
zzz
dd5f8b45ef i2ptunnel: jsp whitespace removal 2019-04-11 14:00:42 +00:00
zzz
2960156b33 Blinding: Missed PKF file from last checkin
Add to CLI
2019-04-11 11:44:57 +00:00
zzz
9a72c4b2d1 encrypt mode checks 2019-04-10 19:56:59 +00:00
zzz
7d4acb62d0 i2ptunnel: Display encrypted b32
Blinding: Allow secret flag without attached secret
2019-04-10 19:52:03 +00:00
zzz
cddace2a1d log tweak 2019-04-10 18:31:24 +00:00
zzz
859584c2b3 NTCP2: Allow longer padding in msg 1 if NTCP1 disabled 2019-04-10 18:28:51 +00:00
zzz
6237fc89ad Jetty: Hide sizes and dates of directories in listings 2019-04-10 18:25:20 +00:00
zzz
cde53537af i2ptunnel: Config UI for encrypted ls2 2019-04-08 20:37:58 +00:00
zzz
5490de1d61 Router: Replace GarlicConfig setters with constructor args 2019-04-08 16:12:14 +00:00
zab2
488e89a0b4 merge of '42afa0510b2e7c8b0db05507c44b689084606ba9'
and '8109f9041b31355f5e1f788378f43f20a4ef22b3'
2019-04-08 15:46:40 +00:00
zab2
4774cf6c37 Order recorded destinations pt2 2019-04-08 15:46:23 +00:00
zzz
7c7b0cb7fd Util: Fix memory leak in compressor (ticket #2471) 2019-04-08 15:37:20 +00:00
zab2
6aeb89ccd0 Order recorded destinations 2019-04-08 08:48:40 +00:00
zzz
6cc39a2672 Build: Fix up javadoc targets in sub-build.xml files for maven central 2019-04-07 18:09:04 +00:00
zab2
cca68f9b79 bump -4 for acces filter fix 2019-04-06 15:35:31 +00:00
zab2
904bf2a90b Only inspect the last threshold.seconds when determining if there is a breach. Otherwise older breaches would be counted as current 2019-04-06 15:35:20 +00:00
zab2
8a001adf59 Move all disk i/o to a single thread to prevent very rare errors when running multiple tunnels 2019-04-06 15:25:37 +00:00
zab2
2c602fa46b access list cannot be defined from ui 2019-04-05 18:20:59 +00:00
zab2
1c90985f93 recorder -> record 2019-04-04 09:29:54 +00:00
zab2
3498ab05f4 define thresholds in seconds, not minutes 2019-04-04 07:31:54 +00:00
zab2
d809b592c9 display filter definition parsing errors in the UI message box 2019-04-03 15:14:39 +00:00
zzz
c3aa459872 merge of 'cbd8a21f0033ee2af8c73bd2a312059869142c83'
and 'debf8ccdb50ef7789027ba5588aa534a1195f3a9'
2019-04-03 13:27:35 +00:00
zzz
d389b3b57c I2PTunnel: Start/stop POST throttle timer 2019-04-03 13:21:41 +00:00
zab2
76ee5774c4 make filter definition text field longer 2019-04-03 12:31:44 +00:00
zab2
b7d980df06 bump -3 for access filter 2019-04-02 17:39:32 +00:00
zab2
491cd0aa46 propagate from branch 'i2p.i2p.zab.2464' (head 47c50de0eaf4a41d0c0b2df3505ff3b885163791)
to branch 'i2p.i2p' (head a34db176d9f6313db1b8fd16926c8c2ca7e12e09)
2019-04-02 17:32:39 +00:00
zab2
e380b26798 Say that it's an absolute file 2019-04-02 16:51:26 +00:00
zab2
4790a14542 change UI to allow same filter definition to be used in multiple tunnels 2019-04-02 16:04:33 +00:00
zab2
194df9d88c link to format spec 2019-04-01 15:46:49 +00:00
zzz
567bccb51c Debian: Fixes for precise/trusty/jessie (ticket #2470) 2019-03-31 12:29:26 +00:00
zzz
0e8e3688f7 Data: Implement Destroyable for private keys (ticket #2462) 2019-03-31 12:23:19 +00:00
zzz
d3170de74a SAM prep for b33 2019-03-31 12:20:13 +00:00
zzz
908bf26151 javadoc fix 2019-03-31 12:18:44 +00:00
zab2
e55702b219 stop the filter in destroy method 2019-03-30 15:08:28 +00:00
zab2
c0c95827ef add logic to start and stop filter timers 2019-03-29 16:27:10 +00:00
zab2
fc9ad32878 Make the config format consistent (threshold rule [target]) 2019-03-29 15:36:03 +00:00
zzz
7d40dfe1e5 CLI tweak 2019-03-29 12:55:17 +00:00
zab2
2304e9b558 prettier html 2019-03-29 12:54:44 +00:00
zzz
944fe4794e Crypto: new SigContext (WIP) (proposal #148) 2019-03-29 12:54:12 +00:00
zzz
7501e3feea javadoc fix 2019-03-29 12:51:19 +00:00
zzz
eb0920e2c7 NetDB: Persistence for blinding cache 2019-03-29 12:50:41 +00:00
zab2
956a714d6e package.html 2019-03-29 12:44:44 +00:00
zab2
3f990b0bc8 html in javadoc 2019-03-29 12:42:45 +00:00
zab2
3dbe8f2003 document format 2019-03-28 19:47:08 +00:00
zab2
d90fc421fd javadoc 2019-03-28 18:57:42 +00:00
zab2
85db853d74 use curly braces around one-line for and while loops 2019-03-28 17:25:12 +00:00
zab2
440d5571fa Clear all state if the tunnel is closed 2019-03-28 17:22:08 +00:00
zab2
910a0d859d fix b32 parsing 2019-03-28 17:10:07 +00:00
zab2
c5f9aea557 do not use equalsIgnoreCase 2019-03-28 16:59:56 +00:00
zab2
84ea533b11 use DataHelper.split instead of String.split 2019-03-28 16:58:34 +00:00
zab2
fd2819c754 Use Hash objects instead of Strings representing b32s 2019-03-28 16:44:55 +00:00
zab2
fd6cb07e5d use SecureFileOutputStream 2019-03-28 16:25:36 +00:00
zab2
6d2270a1ed Cancel timers if tunnel is stopped 2019-03-28 15:32:49 +00:00
zab2
94bde1d821 Exception to be thrown in case of invalid filter definition 2019-03-28 14:46:19 +00:00
zzz
ba801be24f Debconf translation update from
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925515
2019-03-28 13:49:21 +00:00
zab2
e919271247 revert accidental commit 2019-03-28 13:37:51 +00:00
zab2
d2bdbcd27d correct io pattern 2019-03-28 13:31:39 +00:00
zab2
97eb5a56ab add the UI bits of the access rules 2019-03-28 02:04:21 +00:00
zab2
473ced4d4a disable splitting by tabs for now 2019-03-27 15:19:45 +00:00
zab2
c7771095d3 hook up loading of filter definitions for server tunnels 2019-03-27 15:04:04 +00:00
zzz
ea127d3fd4 NetDB: Fix b33 lookup looping after failure 2019-03-27 13:58:56 +00:00
zab2
b35762b4bb factory to rule them all 2019-03-27 13:24:55 +00:00
zab2
3f6fc7c0fb wip on parser of filter definitions 2019-03-27 13:05:31 +00:00
zzz
82eea0a8f9 NetDB: Cache blinding data for lookups and decryption (proposal #123) 2019-03-27 12:51:10 +00:00
zab2
670016e79c wip on parser of filter definitions 2019-03-27 12:45:26 +00:00
zzz
14492d7269 log fix 2019-03-27 12:38:40 +00:00
zzz
de9d968b76 DatabaseEntry: Change from volatile to synched 2019-03-27 12:32:23 +00:00
zzz
7bb7677604 SelfSignedGenerator: improve previous fix 2019-03-27 12:26:05 +00:00
zab2
841b16ef72 Access list may not exist 2019-03-27 11:39:17 +00:00
zab2
0d0dd1e241 hook up periodic events to ST2 2019-03-27 11:16:50 +00:00
zab2
62f7b2cece Skeleton architecture of access filter 2019-03-27 10:06:49 +00:00
zab2
a5e568ffa1 Hooks into streaming for filtering of incoming connections 2019-03-26 15:34:15 +00:00
zzz
64039ee3c2 button style 2019-03-23 17:43:57 +00:00
zzz
ce043943d9 SusiDNS: Add import feature (ticket #2447)
Box overlap issue remains todo, see ticket #2419
2019-03-23 16:42:37 +00:00
zzz
fea5bd4ada SelfSignedGenerator:
- Fix generation with Ed25519ph keys (ticket #2465)
- Increase serial number from 63 to 71 bits
2019-03-23 14:26:29 +00:00
zzz
00d4525325 Data: Initial work on b32 format for blinded leasesets (proposal 149, WIP) 2019-03-23 13:39:47 +00:00
zzz
f17776ec54 i2ptunnel: Escape {} in URLs (ticket #2130) 2019-03-22 15:41:16 +00:00
zzz
05845481d1 Debian files for 0.9.39 2019-03-22 15:28:48 +00:00
zzz
bb5a89219a 0.9.39 2019-03-21 12:11:48 +00:00
zzz
c3ebc00a86 bump for review 2019-03-17 15:56:49 +00:00
zzz
a57c277af0 Pull translations 2019-03-17 15:51:16 +00:00
zzz
2b00bfa58b Fix Debian builds with Jetty 9.4.15 (ticket #2457) 2019-03-16 16:54:36 +00:00
zzz
8962ea058f Doc updates, BuildTime update 2019-03-15 11:34:41 +00:00
zzz
7511de68a4 Router: Remove unused test support for AES disabled 2019-03-14 15:19:23 +00:00
zzz
0b5a36d5eb GeoIP update 2019-03-11 2019-03-14 13:23:15 +00:00
zzz
1f861c14a9 javadoc fix 2019-03-13 11:23:37 +00:00
zzz
d7d1dcb539 Crypto: Ed25519 check for S < L as in RFC 8032 2019-03-12 12:55:58 +00:00
zzz
91c59dfb6b Crypto: Fix Ed25519ph conversion 2019-03-12 12:37:28 +00:00
slumlord
9d17066175 Update hyperlinks for forum to point to i2pforum.i2p 2019-03-12 06:22:49 +00:00
zab2
7db602d959 Make I2pTunnel wait for router to reach RUNNING state (ticket #2377) 2019-03-11 20:00:04 +00:00
zzz
7e6fd01eef New home page icons from Sadie
Source: https://github.com/feathericons/feather#license Feather is licensed under the MIT License.
License: https://raw.githubusercontent.com/feathericons/feather/master/LICENSE
All icons converted from SVG to PNG, brightness adjusted, colourized with #848484 and resized to 32x32
modifications:
group_gear - feather icon code layered with message - square. Message- square icon resized. 
plugin_link - feather icon coffee layered with square. Coffee icon cropped to leave" prongs" 
plugin. - feather icon coffee layered with plus square. Coffee icon cropped to create "prongs"
i2psnark - feather icon underline - layer added, "U" rotated , line cut and copied over, them cut out to create "magnet.
2019-03-11 15:56:25 +00:00
zzz
365f5a8c7b UPnP redundant casts 2019-03-10 12:58:23 +00:00
zzz
30dbe24777 LS2: Allow UTF-8 for blinding secret 2019-03-10 12:11:13 +00:00
meeh
e36a3b318a Mac OSX Launcher:
* Fixed startup option so the launcher can start at OSX login/bootup.
* Added I2P Browser to the list of "firefox" browsers to detect.
* Changed hardcoded path lookup to native "registry" lookup for firefox application.
* Made the advanced preferences table editable by the user.
* Cleanup of old and/or unused code.
* Bugfixes.
2019-03-10 11:16:56 +00:00
zzz
5d389c8855 I2CP: Add support for blinding secret 2019-03-09 16:40:15 +00:00
zzz
d6a53cc3a6 Data: Consolidate offline key check
i2ptunnel: Prevent registration auth if key offline
2019-03-09 11:47:03 +00:00
zzz
409207e02d more selectors 2019-03-07 15:01:10 +00:00
zzz
95366c06ce NetDB: Minor performance improvement in selectors
log tweaks
2019-03-07 14:46:20 +00:00
zzz
5b1b4acd2c NetDB: Fix flood version check, add version check for RedDSA 2019-03-06 15:28:47 +00:00
zzz
10bae6a07b Data: Update Encrypted LS2 blinding and encryption to match current proposal 123
Hide b32 in console for encrypted LS2
2019-03-05 15:43:23 +00:00
zzz
bfafdd34be NetDB: Fix tunnel selection for verify of encrypted ls2 store
Fix NPE handling lookup of encrypted ls2
2019-03-04 19:04:42 +00:00
zzz
0b2896516e Console: Fix NPEs displaying encrypted LS2 2019-03-04 18:37:01 +00:00
zzz
268a3ee5f5 NetDB: Fix finding tunnels to publish encrypted LS2
log tweaks
2019-03-04 17:38:26 +00:00
zzz
ad1600eb51 log tweaks 2019-03-04 17:37:29 +00:00
zzz
f1ed870a4a Data: Fix NPE in debug logging 2019-03-04 17:17:44 +00:00
zzz
5d3b7c1c53 NetDB: Call fail callback when lookup is negative cached (thx zab) 2019-03-04 17:07:45 +00:00
zzz
cd97718682 I2CP, NetDB: More encrypted LS2 fixes (WIP)
Marked encrypted LS hash as local
Fix isCurrent() on encrypted LS
Fix unpublish of encrypted LS
2019-03-04 17:06:01 +00:00
zzz
54d9a29855 I2CP, NetDB, Console: Encrypted LS2 handling fixes (WIP)
log tweaks
2019-03-02 21:52:12 +00:00
zzz
7cbb43ab75 I2CP: Encrypted LS2 handling fixes, log tweaks (WIP)
Add number of privkeys field to CreateLeaseSet2 message
Check all privkeys, not just the first, on router side
2019-03-02 19:53:16 +00:00
zab2
335736b2b7 Fix log strings 2019-03-02 18:13:55 +00:00
zzz
f0b9986e67 Enc LS2 debug logging changes 2019-03-02 16:00:56 +00:00
zzz
82d187438f Streaming: Fix sending messages with expired times (ticket #2451) 2019-03-01 18:00:54 +00:00
zzz
d1617dd0b6 Console: Fix router logs not shown if first msg is a dup 2019-02-28 16:55:16 +00:00
zzz
21c7a341fb Console: Change fallback client names to use b32
instead of truncated b64. Anchors remain b64.
2019-02-28 16:07:58 +00:00
zzz
302adc2d16 Console: Drop icons for deleted /home items 2019-02-27 15:15:55 +00:00
zzz
c8b7e829db Console: Handle zero SSU RTT on /peers (ticket #2443)
PeerState minor cleanups
2019-02-26 17:38:34 +00:00
zzz
cf1c0cb3ed SSU: Fix RTT/RTO calculations (ticket #2443) 2019-02-26 17:17:00 +00:00
zzz
566df1c275 SSU: Fix scheduling of peer test at startup (ticket #2441) 2019-02-26 16:19:36 +00:00
zzz
16421fa0b6 NTCP: Fix number of SendFinisher threads (ticket #2438) 2019-02-25 15:58:29 +00:00
zzz
3c911ee298 I2CP: Strip i2p.reseedURL from session options take 2 2019-02-25 15:10:34 +00:00
zzz
a12058db3a I2CP: Strip i2p.reseedURL from session options 2019-02-25 15:05:14 +00:00
zzz
7ce539a815 NetDB: Fix dup publish of RI at startup
Improve locking for checking address change
Publish RI after netdb is ready
log tweaks
2019-02-25 14:40:59 +00:00
zzz
b76b2ef206 Console: Flip order of router logs 2019-02-23 18:02:00 +00:00
zzz
32797dd415 NTCP: Loop in pumper if more to write (ticket #2440) 2019-02-23 17:06:01 +00:00
zzz
e1385a71e2 minor speedup 2019-02-23 17:03:52 +00:00
zzz
9cd90b0530 NetDB: Use published date, not earliest lease expiration, for LS2 comparisons
Fix earliest LS expiration adjustment when publishing for LS2,
so .38 routers won't reject as not newer
Don't start new store after verify fail if we've already done so
Increase flood candidates for LS2
Version checks for encrypted LS2
FVSJ cleanups
log tweaks, javadocs
2019-02-23 17:03:04 +00:00
zzz
5440a3402f I2CP: Force i2cp.leaseSetType option for offline keys 2019-02-21 16:16:27 +00:00
zzz
9fafc253b7 Data: Always set unpublished flag for inner LS (Enc LS2)
Fix setDestination()
2019-02-21 14:58:58 +00:00
zzz
b37160fa8d Crypto: Keygen for RedDSA, allow RedDSA for unblinded keys (Enc LS2) 2019-02-21 14:19:38 +00:00
zzz
7fbe1ced5a Crypto: Sign/verify/encrypt/decrypt for Encrypted LS2
generateAlpha() method for arbitrary date
2019-02-20 22:49:14 +00:00
zzz
17270b1502 Crypto: RedDSAEngine and generateAlpha() for Encrypted LS2 2019-02-20 15:00:54 +00:00
zzz
e34b646231 Crypto: New ChaCha20 wrapper around ChaChaCore, for use with Encrypted LS2 2019-02-19 19:11:34 +00:00
zzz
14ac8fe545 Crypto: Move ChaChaCore from router to core, in prep for use with Encrypted LS2 2019-02-19 16:00:47 +00:00
zzz
b3c5974693 Crypto: Implement blinding (proposal 123)
Add sig type 11 for blinded keys
2019-02-19 13:12:26 +00:00
slumlord
af46e48563 Fix i2psnark-standalone.zip build which broke after themes were removed 2019-02-19 06:33:16 +00:00
zzz
2aa093754d Tomcat 8.5.38 2019-02-18 18:44:37 +00:00
zzz
ab7f61d220 Console: Drop midnight and classic themes (ticket #2272) 2019-02-18 18:14:28 +00:00
zzz
2d67d11537 Transport: Fixes for NTCP when SSU disabled (ticket #1417)
Delay port forwarding until after UPnP rescan complete
WIP
2019-02-18 17:55:17 +00:00
str4d
d244d17363 Gradle: Optionally include jbigi at runtime for core
This enables running the benchmarks with jbigi present:

./gradlew -Pwith.jbigi jmh --no-daemon
2019-02-17 15:42:15 +00:00
str4d
e662f09838 Gradle: Create jbigi configuration 2019-02-17 15:41:17 +00:00
str4d
ad5301ae10 Gradle: Integrate JMH benchmarks
Run with ./gradlew jmh --no-daemon
2019-02-17 09:49:03 +00:00
str4d
def939284c Gradle: Disable ScalaTests when TARGET_JAVA_HOME is set
Previously, ScalaTests were only disabled when running Gradle with JDK 7.
Gradle 5+ only runs on JDK 8+, so when cross-compiling and testing JDK 7
we need to check for this state and disable ScalaTests.
2019-02-17 09:30:53 +00:00
str4d
f9c13968a8 Travis CI: Test against JDK 9+ 2019-02-17 09:23:12 +00:00
str4d
4f6b58e5af Gradle: Configure --release compiler flag after project evaluation 2019-02-17 02:35:26 +00:00
str4d
2556c7755b Travis CI: Update config to handle cross-compilation 2019-02-17 02:33:19 +00:00
str4d
9731c203bd Gradle: Improve cross-compilation support
JDK 9+ have a --release flag that correctly configures the bootClasspath.
For JDK 8 we now enforce manual configuration.
2019-02-17 02:13:32 +00:00
str4d
a1b67e3720 Gradle: Parse router version from Java source 2019-02-17 01:56:24 +00:00
str4d
56c1739d54 Gradle: Use plugins DSL where possible 2019-02-17 01:27:05 +00:00
str4d
1ae987927b Upgrade Gradle wrapper to 5.2.1 2019-02-17 01:16:20 +00:00
zzz
51b27bbf0c Console: Hide disabled transports on /peers 2019-02-08 13:58:38 +00:00
zzz
5b78b53fe8 SSU: EstablishmentManager fixes (ticket #2397) 2019-02-08 13:24:42 +00:00
zzz
3ba0fcf6da SAM: Support offline keys 2019-02-07 20:27:42 +00:00
zzz
7544d0a590 Streaming: Fix exception after sig verify fail
log tweaks
2019-02-07 18:14:18 +00:00
zzz
636016d107 NTCP: Add option to disable NTCP1 (ticket #2328)
Don't bid for outbound-only NTCP2 addresses
Fix NTCP2 cost when transitioning to inbound
2019-02-07 14:54:56 +00:00
zzz
b310c60188 Javadoc fixes 2019-02-06 12:48:33 +00:00
zzz
19cb85a74d i2pcontrol: Javadoc fixes 2019-02-06 12:45:21 +00:00
zzz
490b81c1a1 Crypto: Shortcut GroupElement representation conversion 2019-02-06 12:35:27 +00:00
zzz
3a30f07483 I2CP: Prevent use of repliable datagrams with offline keys 2019-02-06 11:54:29 +00:00
zzz
61c62424c2 Build: Add targets for alternate debian distros (ticket #2410) 2019-02-06 11:48:48 +00:00
zzz
16ccc1bea5 remove exchanged.i2p 2019-02-06 11:46:23 +00:00
zzz
b82702393f NTCP: Speed up allowConnection() (ticket #2381) 2019-02-05 16:44:09 +00:00
zzz
8a77db15d5 Transport: Clean up unreachable() methods (ticket #2382) 2019-02-05 15:39:00 +00:00
zzz
beb0879f24 Router: OutNetMessage cleanup (ticket #2386) 2019-02-05 15:19:29 +00:00
zzz
6f75680a7e SSU: PacketHandler cleanup (ticket #2383) 2019-02-05 14:57:10 +00:00
zzz
a756c12432 I2CP: Change format and message type of CreateLeaseSet2 message
to match spec changes
2019-02-04 21:58:27 +00:00
zzz
ead49256c7 Data: Represent blinding secret as a SigningPrivateKey 2019-02-04 16:58:41 +00:00
zzz
0e029f84b0 I2CP: Fix LS2 NPE 2019-02-03 19:03:28 +00:00
zzz
bd6cf53d53 i2ptunnel: Fix HTTP websockets by passing through
Connection headers containing "upgrade" (ticket #2422)
Server-side change only. Client-side in previous commit.
2019-02-03 17:29:16 +00:00
zzz
e20a6a9685 i2ptunnel: Fix HTTP websockets by passing through
Connection headers containing "upgrade" (ticket #2422)
Client-side change only. Server-side todo.
2019-02-03 16:31:26 +00:00
zzz
0e710f8785 Streaming: Support offline signatures (proposal 123)
Don't send FROM in RESET, not required since 0.9.20
Send RESET when SYN signature verification fails
Use cached buffers for signature verification
Move setOptionalFrom() from Packet to PacketLocal
Always verify packets with signatures, even if not required
AIOOBE checks
cleanups, log tweaks
2019-02-03 13:41:42 +00:00
zzz
7d11fb269e I2CP: Remove revocation private key from CreateLeaseset2 message
Use correct key to sign SessionConfig with offline keys
LeaseSetKeys cleanups
2019-02-03 12:59:53 +00:00
zzz
d7808cd16d Data: Fix length for offline sig verification 2019-02-03 12:49:56 +00:00
zzz
f288682436 Test: Disable NTP in LocalClientManager 2019-02-03 12:47:33 +00:00
zzz
19defbe05d Debian: Fix build of i2pcontrol 2019-02-02 13:28:59 +00:00
zzz
175ea0f0c2 i2ptunnel: Update clearnet UA to match current TBB 2019-02-01 19:07:22 +00:00
zzz
30015c1933 i2ptunnel: Handle PUT like POST 2019-02-01 13:49:13 +00:00
zzz
4f8455040e i2ptunnel: Caching of outproxy selection, avoid last-failed outproxy 2019-02-01 13:39:57 +00:00
zzz
428fb269f0 Debian: AppArmor fix for Oracle JVM (ticket #2319)
Allow any JRE or JDK to work
2019-02-01 13:11:12 +00:00
zzz
ec5e2dba94 i2ptunnel: More localhost checks 2019-02-01 13:03:40 +00:00
zzz
316011e047 Debian: Fix version detection of Tomcat 9 required for reproducible builds 2019-01-31 11:55:43 +00:00
zzz
68567cb531 Build: Fix javac.classpath in junit.compileTest targets (ticket #2333) 2019-01-30 20:51:17 +00:00
zzz
4eb9368830 I2CP: Fixes for CreateLeaseset2 message with multiple keys 2019-01-30 20:23:09 +00:00
zzz
c555bb6c93 i2cp.leaseSetEncType param:
Support comma-separated values,
check param in session config,
support stored EncTypes in private keys.
Show types and multiple keys on LS debug page
2019-01-30 19:33:15 +00:00
zzz
1bb57c4103 EdDSA minor cleanup 2019-01-29 13:51:42 +00:00
zzz
a51a6d57f9 rename class 2019-01-29 13:28:11 +00:00
zzz
8465fe7717 fix build warnings 2019-01-28 15:22:17 +00:00
zzz
0801d20fd1 EdDSA: Make more classes serializable (Github PR #68) 2019-01-28 15:21:15 +00:00
zzz
9055982cf0 bump after prop 2019-01-28 15:17:51 +00:00
zzz
8c9ce56837 propagate from branch 'i2p.i2p.zzz.i2pcontrol' (head 1334d424003d201aa352cf57a6ba2f61241ef363)
to branch 'i2p.i2p' (head fe8a90fdbdd491e16040e3ed91a35faa72fd78f2)
2019-01-28 15:10:30 +00:00
zzz
0a8ab44139 I2PControl: Add manifest for jar build
Stub out socketJar build
2019-01-28 14:14:29 +00:00
zzz
24fd48815a I2PControl:
Disable webapp by default
Add link in Services section of sidebar
Add definition in PortMapper
Add stub controller for socket implementation, WIP
Javadocs
2019-01-28 13:31:54 +00:00
zzz
3fca0f6f99 LS2: Honor unpublished flag 2019-01-27 16:13:05 +00:00
zzz
3cd12ecefc LS2: Select first supported encryption key from leaseset
OCMOSJ: Fail if unsupported crypto or bad ls type
2019-01-27 15:59:34 +00:00
zzz
0889a751db NDT:
Catch exception on DNS lookup failure (ticket #2399)
Add support for specifying server in CLI (ticket #2413)
Finals and javadocs
2019-01-27 14:25:48 +00:00
zzz
efb1b7c24a Debian: Fix PPA builds for precise and trusty (ticket #2408)
Reverts fix for #2329 for these distros
2019-01-26 18:34:10 +00:00
zzz
3527f251c8 Debian: Add build option for libtomcat9 (ticket #2364) 2019-01-24 14:15:04 +00:00
zzz
6cdc515cfd Fix Debian control files (ticket #2401) 2019-01-24 12:43:02 +00:00
zzz
57de4b1805 Debian files for 0.9.38 2019-01-24 12:29:22 +00:00
meeh
609d5944bb Mac OSX Launcher: 0.1.3 Release commit. 2019-01-22 19:25:33 +00:00
zzz
88d9f1d509 0.9.38 2019-01-22 11:54:19 +00:00
zzz
5c0aab4190 Minor fixes after review 2019-01-21 21:57:14 +00:00
zzz
33e96d7841 Reseed: Update SSL cert 2019-01-21 21:56:34 +00:00
zzz
d00e3c77ab Debian: Add source param to javadoc target, fixes build on sid 2019-01-20 13:28:22 +00:00
zzz
318ebb3fc5 Debian: Replace ttf-dejavu with fonts-dejavu (ticket #2395) 2019-01-20 13:24:01 +00:00
zzz
f224a770f0 bump for review 2019-01-18 20:47:08 +00:00
zzz
ebcf187df6 Pull translations 2019-01-18 20:41:44 +00:00
zzz
b3cfc89fa2 remove old file from test script 2019-01-18 20:34:09 +00:00
meeh
e57606a9f6 Mac OSX Launcher: Added Carthage file + shell script bumpInfoPlist.sh 2019-01-18 16:30:46 +00:00
meeh
a36777882e Mac OSX Launcher: Misc changes + xcode project file update 2019-01-18 16:30:03 +00:00
meeh
605f9872cd Mac OSX Launcher: UI code updates, integration of firefox manager. 2019-01-18 16:29:12 +00:00
meeh
52125917b4 Mac OSX Launcher: Storyboard updates, added firefox button, preferences changes etc. 2019-01-18 16:28:17 +00:00
meeh
ba853a8c97 Mac OSX Launcher: The firefox manager code 2019-01-18 16:26:08 +00:00
meeh
6ad64d5b44 Mac OSX Launcher: Adding the "launcher launcher" for startup functionality. 2019-01-18 16:25:01 +00:00
zzz
272588d820 Debian: Add Disco files, refresh patch for Jetty 9.4 2019-01-18 14:32:28 +00:00
zzz
344c812666 NTCP: Stop X25519KeyFactory on shutdown (ticket #2388) 2019-01-18 12:15:43 +00:00
zzz
b4e2619c3b Plugins: Fix loading of webapp configuration classes
on Jetty 9.4 by whitelisting them as allowed server classes
(ticket #2385)
2019-01-18 11:35:36 +00:00
zzz
6ca383071b Debian: AppArmor updates (ticket #2319) 2019-01-16 20:10:36 +00:00
zzz
d851631494 SusiMail: Fix sending mail with attachments (ticket #2373)
Fix deleting attachments from drafts
Fix dup attachments after clicking add attachment without browsing first
Fix update of draft folder after saving as draft
Change text of add attachment button for clarity
Debug logging
2019-01-15 17:18:59 +00:00
zzz
16f4f04092 change firefox profile installer link 2019-01-15 16:05:40 +00:00
zzz
ca86bbe4f7 EncType javadoc update 2019-01-14 15:58:40 +00:00
zab2
cf27938983 fix compilation with Gradle to account for GeoIP2 and systray changes 2019-01-13 14:04:03 +00:00
zzz
4283d71b92 I2CP: Set LS2 unpublished bit, show in debug output 2019-01-13 13:14:58 +00:00
zzz
10f2d838c9 SSU: More consolidation of clock().now() calls 2019-01-12 13:45:38 +00:00
zzz
f5ca17c844 NetDB: Use isSlow() in floodfill criteria 2019-01-12 13:43:09 +00:00
zzz
b62732b5b3 Console: More LS2 debug output
I2CP: Bump min LS2 router version for release
2019-01-11 14:44:33 +00:00
zzz
47beb8250e propagate from branch 'i2p.i2p' (head ff155397f79c33f8f6767c2c120e57cb7dd30d88)
to branch 'i2p.i2p.zzz.i2pcontrol' (head 9e68613e29f1a3bd5a4e2b3d8c5637b48f499e5e)
2019-01-11 13:51:41 +00:00
zzz
17228def91 I2CP: Remove client-side-only options from those sent to router 2019-01-10 17:08:35 +00:00
zzz
5ca98022ab I2CP: Router-side stub for enc. ls2; throw for now 2019-01-10 16:21:48 +00:00
zzz
0c15936b5d I2CP: Router-side fix for meta LS2 2019-01-10 15:37:11 +00:00
zzz
e02a0dfc5b NTCP: Avoid Java 8/9 bootclasspath issue 2019-01-10 14:17:18 +00:00
zzz
0d330caf9a I2CP: Basic router-side handling of meta LS2
Improve error handling of LS2 params client-side
Methods to remember blinded key in LS2
2019-01-10 13:39:18 +00:00
zzz
8cd7e7de65 poupdate-source for 0.9.38
Fix poupdate script to not pick up tags in 3rd party libs
2019-01-09 19:03:41 +00:00
zzz
671e9dd711 I2CP: Stub out client-side creation of meta and enc. LS2 2019-01-09 18:41:36 +00:00
zzz
4ff9092bd9 Wrapper: Increase default heap to 256 MB 2019-01-09 13:29:36 +00:00
zzz
fb8665b9bd Console: Fix broken image link on /configui 2019-01-09 13:09:49 +00:00
zzz
2c7033001e Console: Remove firefox anchor in link 2019-01-09 13:08:45 +00:00
zzz
30ea6f3ffa Console: Remove test code that forces wizard run on dev builds 2019-01-09 13:07:59 +00:00
zzz
5634055d4b Crypto: Stub out EdDSA blinding (proposal 123) 2019-01-05 14:22:46 +00:00
zzz
3b7284c9cd I2CP: Add support for multiple private keys in CreateLS2Message 2019-01-04 14:30:38 +00:00
zzz
74ed974145 NetDb: Prevent ISJ deadlock (ticket #2366) 2019-01-04 13:48:38 +00:00
zzz
4786081026 Build: Check cert validity
Reseed updates
2019-01-04 12:15:58 +00:00
zzz
150cee9a08 Data: Add type byte to MetaLease,
add EmptyProperties to reduce object churn,
undeprecate getSigningKey(),
reduce loadProps() buffer size
2019-01-02 14:29:10 +00:00
zzz
941a994482 remove temp wizard text 2019-01-02 13:23:30 +00:00
zzz
d10d722763 Wizard: Styling, fix links, change button icons
back.png: Arrow flipped from go.png in Gimp, same license
2019-01-02 13:19:12 +00:00
zzz
9951e3467e Data: More work on Encrypted LS2 (proposal 123) 2019-01-02 11:50:05 +00:00
zzz
62fd0497f8 Debian: Split up conffiles into subpackages 2019-01-01 21:01:40 +00:00
zzz
a0d2288ded Debian: Remove obsolete systray.config 2019-01-01 20:20:35 +00:00
zzz
149359fdc3 Data: Fix LS2 size(), fix Meta LS2, fix date rouding 2019-01-01 20:17:56 +00:00
zzz
4ae57f4f01 Data: Fix LS2 support for unknown enc. types (proposal 123) 2019-01-01 17:48:31 +00:00
zzz
d95d81aea7 Data: Add support for LS2 multiple encryption keys (proposal 123) 2019-01-01 17:14:37 +00:00
zzz
92ad4d1ce3 NBI: Add lookup tables for ARMv8 2019-01-01 15:41:11 +00:00
zzz
3c0ba5ce9c Console: Add warning for OpenJDK Zero VM 2019-01-01 15:01:22 +00:00
zzz
f221e724b9 Console: New light background (ticket #738) thx Alex 2019-01-01 14:43:19 +00:00
slumlord
0fdede8657 Fix _isArm 2018-12-30 13:17:19 +00:00
zzz
47629bf2cf Console: Update ARM warning (ticket #2368), remove Java 11 warning 2018-12-24 13:24:58 +00:00
zzz
0474876b58 NDT: Fix deprecation 2018-12-24 13:21:05 +00:00
zzz
edae8e3e0b Sybil: Translate strings that we already have tagged elsewhere 2018-12-23 15:02:45 +00:00
zzz
1411d0cff3 Sybil: Change persistence format to prevent errors in some locales 2018-12-23 14:40:13 +00:00
zzz
aad80eb2a3 Console: _action cannot be null in processForm()
GraphHelper minor cleanup
2018-12-23 13:38:54 +00:00
zzz
af49a90303 Sybil: Add background run form 2018-12-23 13:21:27 +00:00
zzz
fa6a4ca1d1 Console: Convert NetDbHelper to a FormHandler,
change SybilRenderer forms to POST,
only collect RIs on required Sybil tabs
2018-12-23 12:19:32 +00:00
zzz
e122393914 FormHandler: move things around 2018-12-23 11:08:50 +00:00
zzz
2d026d5ae7 Console: isAdvanced() cleanup 2018-12-23 10:17:46 +00:00
zzz
367e5ac679 javadoc fix 2018-12-21 12:15:07 +00:00
zzz
f3a4b115f3 Console: More links on sybil page 2018-12-21 11:37:09 +00:00
zzz
9f64cc7c60 TLSv1.3 notes 2018-12-21 11:35:15 +00:00
zzz
03651292fb thread name change 2018-12-21 11:33:55 +00:00
zzz
94fd60db10 Transports: Improve banning of routers from wrong network 2018-12-21 11:32:17 +00:00
zzz
18b7d97584 new reseed 2018-12-20 11:02:20 +00:00
zzz
021375b5d5 NTCP: More now() calls out of loops 2018-12-20 10:58:30 +00:00
zab2
8a0602732d Get call to system timer out of tight loop when counting connections 2018-12-19 10:51:53 +00:00
zzz
20876ff307 Sybil page date formatting 2018-12-17 14:43:02 +00:00
zzz
bf3a7d6ef7 Data: More work on Encrypted LS2 (proposal 123) 2018-12-17 13:59:49 +00:00
zzz
35a771c764 NTCP2: Use new HKDF class 2018-12-17 13:16:54 +00:00
zzz
eb8178ea3b Sybil: Linkify IP reasons
Adjust IP points
2018-12-17 11:46:14 +00:00
zzz
3867beb198 GeoIP: Fix NPE (thx parg) 2018-12-17 11:24:27 +00:00
zzz
cae5dcd69c Sybil: Refactoring part 6
Make Analysis class a JobImpl, run on configured frequency
Bug fixes and cleanups
2018-12-17 11:23:08 +00:00
zzz
2a805dddf5 Sybil: Refactoring part 5
Make Analysis class singleton, hang off ClientAppManager
prep for offline scheduling
2018-12-16 14:44:37 +00:00
zzz
fa0d63f40f Sybil: Refactoring to separate analysis and display, part 4
Load/store offline analysis
Split up sections into separate tabs
2018-12-16 13:20:59 +00:00
zzz
9437e2cb79 Sybil: Refactoring to separate analysis and display, part 3 2018-12-15 17:49:52 +00:00
zzz
3054a240bb Sybil: More refactoring to separate analysis and display 2018-12-15 16:54:01 +00:00
zzz
5d06de8608 Sybil: Class for persisting results, related refactoring 2018-12-14 16:54:10 +00:00
zzz
468871f21e Crypto: Add HKDF class for LS2 and NTCP2 (proposal 123)
Minor speedup in HMAC256
2018-12-13 14:39:08 +00:00
zzz
6c3c227c1b Debian: Add alt files for sid (ticket #2098)
Fixes compatibility with Jetty 9.4
Patch from Emmanuel Bourg, see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916177
Briefly tested by mhatta
2018-12-13 14:30:22 +00:00
zzz
9738db7254 UrlLauncher:
- Use arrays for exec
- Randomize temp file name
- Require quotes around args containing spaces in routerconsole.browser property
- Add debug logging
- Add chromium-browser to the default list
- Parse and use full command line from Windows registry
- Replace %1 with url in registry line and routerconsole.browser property
ShellCommand:
- Switch to i2p logging
2018-12-12 20:12:07 +00:00
zzz
51bf23a34c DTG: Use UrlLauncher to launch browser 2018-12-12 15:17:51 +00:00
zzz
5eda30644f Util: Add another ShellCommand String[] method
to be used by UrlLauncher
2018-12-12 13:59:27 +00:00
zzz
2746ed5ce2 Installer: Drop unused systray.config 2018-12-12 13:56:47 +00:00
zzz
fd23b23e56 Crypto: HMAC-SHA256 cleanup
Add byte[] key method to reduce object churn in NTCP2
Un-deprecate in context
2018-12-11 12:19:46 +00:00
zzz
a63d2dccb2 Transports: Log tweaks 2018-12-11 11:35:45 +00:00
zzz
0f6f8f90c9 Utils: Code to simulate IPv6-only 2018-12-11 11:32:52 +00:00
zzz
87c97b2a0a Debian: Add conffiles list
Users shouldn't be editing these, they are the site templates
that are copied to the config dir on first run, but if they are changed,
the user will have the chance to save the changes on upgrade.
2018-12-11 11:28:00 +00:00
zzz
6f4d76e871 editorconfig update 2018-12-11 11:22:43 +00:00
zzz
c1850cc4f3 Utils: Enable TLSv1.3 for SSL sockets
(available in Java 11)
2018-12-11 11:19:36 +00:00
zzz
399899e7e7 NetDb: Allow longer expiration for Meta LS2 2018-12-08 18:24:14 +00:00
zzz
bdc4d82eb2 Transport: Don't set status to disconnected if IPv6-only but not configured IPv6-only 2018-12-08 17:35:29 +00:00
zzz
2200cf6627 Transport: Don't repeatedly publish RI if IPv6-only but not configured IPv6-only 2018-12-08 17:28:54 +00:00
meeh
d382f1214e merge of 'a2e8a7d9b157e9a7d5ab0e4356b7b046715a4243'
and 'c3ae5fc1d281c2f9c6357dd72bfc2147bae71877'
2018-12-08 14:38:18 +00:00
meeh
36a5790b87 Mac OS X Launcher: Misc minor updates to Preferences 2018-12-08 14:37:59 +00:00
zzz
5d100417c4 Console: Hide I2CP config if disabled 2018-12-08 14:30:04 +00:00
meeh
b946bb0679 Mac OS X Launcher: Webkit header + I2P version inside Info.plist 2018-12-08 09:17:09 +00:00
meeh
c3b8317edb Mac OS X Launcher: Adding optional Dock Icon functionality 2018-12-08 09:16:28 +00:00
meeh
f90e2ee659 Mac OS X Launcher: Xcode metadata project file update 2018-12-08 09:15:33 +00:00
meeh
3bad8f33c4 Mac OS X Launcher: Remove unneeded entitlement 2018-12-08 09:15:04 +00:00
meeh
dfcc616cb3 Mac OS X Launcher: Misc changes in ObjC, forwarding sendUserNotification to Swift. 2018-12-08 09:14:33 +00:00
meeh
a0d356bc56 Mac OS X Launcher: Changes in path lookups (many via Preferences), launchd template changes and java arguments for the router itself. 2018-12-08 09:12:24 +00:00
meeh
f4496a0c4c Mac OS X Launcher: Unfinished experimental code, adding so other people can compile the xcode project. 2018-12-08 09:10:43 +00:00
meeh
8841fed1f1 Mac OS X Launcher: Updated version.h template file to embedd i2p version as NSString in build time. 2018-12-08 09:09:37 +00:00
meeh
eca5805195 Mac OS X Launcher: Adding selectors for Preferences window launch, and for view of experimental console webview. 2018-12-08 09:08:22 +00:00
meeh
b8681ddf9d Mac OS X Launcher: Misc updates to the Launchd code, also moved it to a own directory for cleaner source view. 2018-12-08 09:07:03 +00:00
meeh
68ad4eec14 Mac OS X Launcher: Adding user interface classes for the different Preferences views so far. 2018-12-08 09:05:55 +00:00
meeh
a192679638 Mac OS X Launcher: Adding Preferences class which works as an interface towards apple's "defaults" preferences system 2018-12-08 09:04:54 +00:00
meeh
7058bd85fa Mac OS X Launcher: Adding Preferences button to existing storyboard view 2018-12-08 09:03:42 +00:00
meeh
92c42db787 Mac OS X Launcher: Adding Preference storyboard 2018-12-08 09:03:13 +00:00
zzz
926bce78a7 I2CP: Set and validate offline sig in SessionConfig 2018-12-05 15:27:36 +00:00
zzz
d054c6bc04 I2CP: Set offline keys in generated LS2
(router side to follow)
Propagate error from disconnect message to session listener
Refactor RLSMH options
2018-12-05 13:50:07 +00:00
zzz
2876da2565 I2CP, Data: Initial support for LS2 offline keys in I2PSession and PrivateKeyFile 2018-12-04 20:59:38 +00:00
zzz
177f595f33 Javadoc fixes
NDT log tweaks
2018-12-04 20:34:51 +00:00
zzz
7c5162e155 I2CP: Move the port 7654 definition 2018-12-03 16:17:30 +00:00
zzz
5e7a277e98 I2CP: Consolidate all the port 7654 definitions 2018-12-03 15:22:36 +00:00
zzz
af2eea5916 NetDb: Don't send our RI in response to DSM when shutting down
reverts change from 2015
2018-12-03 12:23:57 +00:00
zzz
633a75e286 Wizard: Update text 2018-12-03 12:03:27 +00:00
zzz
6e053689b9 Transport: Add methods to force-disconnect a peer 2018-12-02 19:14:36 +00:00
zzz
ee722b7688 Router: Allow LS2 DSM down a tunnel 2018-12-02 18:53:13 +00:00
zzz
e6912453e0 DataHelper: Minor efficiency improvements in Properties methods 2018-12-02 15:21:30 +00:00
zzz
7c928f99ea Router: Only flood LS2 to router that supports it
Use same version check in StoreJob for flooding
2018-12-01 18:31:58 +00:00
zzz
9efa0eaa40 Router: Only send/verify LS2 with router that supports it
Remove old commented-out code
2018-12-01 18:18:59 +00:00
zzz
700d4d3b48 Console: Don't output tunnel IDs for meta LS
Router: Don't try to send to a meta LS in OCMOSJ
2018-12-01 16:27:53 +00:00
zzz
026ddb3278 Router: Add preliminary support for more LS2 types (proposal 123)
I2CP: Don't require privkeys for meta in CLS2 message
2018-12-01 13:13:51 +00:00
zzz
79440f84eb I2CP: Add preliminary support for LS2 (proposal 123) 2018-12-01 11:40:10 +00:00
zzz
922515dfe4 Crypto: Add X25519 keygen support 2018-11-30 17:29:08 +00:00
zzz
f1689187a4 Data: Check data length in typed constructors
Check for type match in KeyPair
Mark placeholder EncTypes 1-3 as unavailable
2018-11-30 15:56:27 +00:00
zzz
2487bca47c Crypto: Change X25519 key classes from Java keys to I2P keys,
in prep for new crypto (Proposal 144)
Add EncType
Fix PrivateKey constructor w/ EncType
Add support to KeyGenerator
2018-11-30 15:15:31 +00:00
zzz
cc4da1b4da Crypto: Move Curve25519 from router to core,
in prep for new crypto
2018-11-30 13:51:50 +00:00
zzz
a8bacd8727 Data: Change LS2 sign/verify to match proposal changes 2018-11-27 12:34:41 +00:00
zzz
b93be8bb4a Crypto: Define ElG length constants 2018-11-25 15:23:17 +00:00
zzz
9badfd07bf Utils: Catch ProviderException in SelfSignedGenerator (ticket #2344) 2018-11-25 15:17:27 +00:00
zzz
dc8a822b0e GeoIP: Reduce object churn, add test to command line tools 2018-11-25 15:16:18 +00:00
zzz
43e0d4f910 Reseed: Drop manas.ca reseeds as requested 2018-11-25 15:13:12 +00:00
zzz
d4caafb592 Bundle I2PControl 0.12, as a console webapp
Includes mods to use org.json.simple package.
See licenses/LICENSE-Apache2.0.txt
Includes jBCrypt:
Copyright (c) 2006 Damien Miller <djm@mindrot.org>
See licenses/LICENSE-jBCrypt.txt
Includes jsonrpc2 libs:
See licenses/LICENSE-Apache2.0.txt
http://software.dzhuvinov.com/json-rpc-2.0-server.html
Jars from maven central:
jsonrpc2-base-1.38.1-sources.jar  22-Oct-2017
jsonrpc2-server-1.11-sources.jar  16-Mar-2015
2018-11-25 13:26:43 +00:00
zzz
d6e350184c Test: Move ElGamalTest from core to router to follow tested class 2018-11-23 14:22:08 +00:00
zzz
535f2daab0 Router: Move ElGamalAESEngine from core to router
Client end-to-end crypto removed 13 years ago
Not used by any client, app, or plugin.
2018-11-23 13:04:28 +00:00
zzz
5c0c69c654 GeoIP: Add MaxMind GeoLite2-Country database 2018113, gzipped
Database and Contents Copyright (c) 2018 MaxMind, Inc.
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
This database incorporates GeoNames [http://www.geonames.org] geographical data,
which is made available under the Creative Commons Attribution 3.0 License.
To view a copy of this license, visit http://www.creativecommons.org/licenses/by/3.0/us/.
- Drop old ipv4 and ipv6 data files and build scripts
- Build changes for new file
2018-11-20 14:25:49 +00:00
zzz
ef44c36f0c GeoIP: Hook maxmind geoip2 code into transport lookup. 2018-11-20 14:14:34 +00:00
zzz
f1297e7c62 GeoIP2: License and javadocs 2018-11-20 11:07:33 +00:00
zzz
21ca75da14 Modify GeoIP2-java
to remove the dependency on the large com.fasterxml.jackson.databind JSON package,
and use POJOs instead.
Add main() for testing
2018-11-20 11:05:46 +00:00
zzz
3923db0677 Modify MaxMind-DB-Reader-java
to remove the dependency on the large com.fasterxml.jackson.databind JSON package,
and use POJOs instead.
2018-11-20 11:03:47 +00:00
zzz
98de1ae404 This is GeoIP2-java release 2.12.0 2018-04-11
retrieved from <a href="https://github.com/maxmind/GeoIP2-java">github</a>.
For reading MaxMind GeoLite2 database files.
Contains only the DatabaseReader class from that package.
Unmodified as a baseline for future merges.
Does not compile.
To be heavily modified to remove the dependency on the large
com.fasterxml.jackson.databind JSON package,
and use POJOs instead, see following revs.
Apache 2.0 license.
2018-11-20 10:59:43 +00:00
zzz
76921b1e3e This is MaxMind-DB-Reader-java release 1.2.2 2017-02-17
retrieved from <a href="https://github.com/maxmind/MaxMind-DB-Reader-java">github</a>.
For reading MaxMind GeoLite2 database files.
Unmodified as a baseline for future merges.
Does not compile.
To be heavily modified to remove the dependency on the large
com.fasterxml.jackson.databind JSON package,
and use POJOs instead, see following revs.
Apache 2.0 license.
2018-11-20 10:57:33 +00:00
zzz
97e7a98aed JSON javadoc fixes 2018-11-19 14:59:14 +00:00
zzz
d263e42e1e Debian: Add libjson-simple-java dependency 2018-11-19 14:58:20 +00:00
zzz
54184f2889 Util: Switch users of net.minidev.json to com.json.simple
Tested with bundled 1.1.1 and Debian/Ubuntu 2.3.0
2018-11-19 14:48:21 +00:00
zzz
af9ce6d173 Change json lib from net.minidev.json to com.json.simple
because libjson-simple-java is in Debian (jessie+) and Ubuntu (trusty+).
Version 1.1.1 (Feb. 2012) from:
https://github.com/cliftonlabs/json-simple
https://github.com/fangyidong/json-simple/releases
License: Apache 2 (same as minidev)
Release info:
https://cliftonlabs.github.io/json-simple/
Current version 2.3.0 (in buster/sid/bionic+) is compatible.
The 3.x branch is incompatible.

No known external users of minidev (JSON_SMART) which was added in April 2018
(0.9.35) for DoH and the eventual bundling of i2pcontrol.
The i2pcontrol plugin was switched from json-simple to minidev in early 2018,
but it bundles the minidev source. When we bundle, we can switch it back.

Does not compile; see checkins to follow.
2018-11-19 14:44:31 +00:00
zzz
a1baf856f9 Wizard: Fix cancel test button 2018-11-18 16:13:47 +00:00
zzz
13d80e604d Wizard: Ajax fixes for IE (thx zlatinb) (summary bar also)
Form notices on results panel
Hide results if skipped
2018-11-18 13:43:18 +00:00
zzz
09ea40ce8e bump -5 2018-11-17 12:33:00 +00:00
zzz
bbccb476c0 NTCP2 unused code 2018-11-17 10:26:59 +00:00
zzz
0526d6fd15 add bw test to commandline 2018-11-17 10:25:20 +00:00
zzz
c5bd0bd079 NDT: Add support for test over SSL
error handling
log tweaks
2018-11-17 10:19:55 +00:00
zzz
6963d1f746 NDT: Fix NPE caused by last checkin 2018-11-16 21:36:46 +00:00
zzz
a5c38ba6e3 NDT: Remove Swing call 2018-11-16 19:47:36 +00:00
zzz
bfb6eba90c NDT: Thread tweaks 2018-11-16 19:43:11 +00:00
zzz
c07f68e622 NDT: Fix locale, spoof OS, fix log init 2018-11-16 19:27:57 +00:00
zzz
9b9810ea1e MLab: Switch to name server that supports SSL
swingemu cleanups
2018-11-16 17:12:32 +00:00
zzz
9a254aec55 NDT: Restore logging removed in last rev 2018-11-16 15:08:20 +00:00
zzz
aa11211e5e Wizard: Improve ajax
Drop unused test wrapper
Enable first run detection
Spelling fix
2018-11-16 14:34:11 +00:00
zzz
f1e9bf8222 bump -4 2018-11-15 19:45:21 +00:00
zzz
812baf8bd9 NDT log tweaks 2018-11-15 19:39:08 +00:00
zzz
5fe2019897 basic XHR 2018-11-15 19:05:40 +00:00
zzz
aebf7735fe NDT: remove unused user-agent code 2018-11-15 18:04:18 +00:00
zzz
bdbadcd8af Wizard: Warn if trying to start NDT twice 2018-11-15 17:53:50 +00:00
zzz
54a1609760 Wizard: Signal bwlimiter after config change
Remove debug log in form handler
2018-11-15 17:41:57 +00:00
zzz
0369d321d3 Wizard: Hook test results to form
More fixes and cleanups
2018-11-15 16:45:21 +00:00
zzz
62c712c462 Wizard: More test results 2018-11-15 15:07:17 +00:00
zzz
dc343b05a2 MLab/NDT: Hook test to wizard
Make helper the session scope, not handler
Reduce whitespace in formhandler.jsi
Notes on why FormHandler can't be session scope
Ajax still TODO
2018-11-15 14:24:46 +00:00
zzz
6462e2a292 MLab/NDT: Prep for connecting to wizard, fixes, cleanups 2018-11-14 14:48:10 +00:00
zzz
a35ad5fc57 javadocs 2018-11-13 19:37:38 +00:00
zzz
d95c284d3e MLab/NDT: static instance, log fixes, cleanups 2018-11-13 19:20:10 +00:00
zzz
84c0aa4072 javadoc 2018-11-13 19:18:42 +00:00
zzz
cec94e934a Console: Remove some config items from home page 2018-11-13 18:01:26 +00:00
zzz
b695242daf Router: LS2 handling for proposal 123 2018-11-13 18:00:05 +00:00
zzz
ddfc7c05ef Data: support non-string values in DataHelper.toString(Map) 2018-11-13 17:53:33 +00:00
zzz
9377b57c9e ElG minor cleanup 2018-11-13 17:51:52 +00:00
zzz
2bfbcf1ae9 jsi whitespace removal 2018-11-13 17:48:58 +00:00
zzz
f8f6375738 New install setup wizard
Work in progress, run on first install disabled.
Language and bw settings should work,
other panes todo.
2018-11-13 17:46:18 +00:00
zzz
c074467163 MLabRunner, adapted from Vuze/BiglyBT MLabPlugin.java
Github rev e927dca, Aug. 18, 2018.
From: https://github.com/BiglySoftware/BiglyBT-plugin-mlab
License: GPLv2
Work in progress, command line test works,
not hooked up to console yet, awaiting wizard
Build changes to copy in translation files,
and put the javadocs in the right place.
2018-11-13 17:26:38 +00:00
zzz
92787f8fcc swingemu fix to compile Tcpbw100 from 3.7.0.2 2018-11-13 17:21:54 +00:00
zzz
71d8f0e4d4 Vuze/BiglyBT Swing emulation layer for NDT Applet.
This is a simple shim to allow running the NDT Applet code
with minimal modifications.
From BiglyBT MLab plugin:
Github rev e927dca, Aug. 18, 2018.
From https://github.com/BiglySoftware/BiglyBT-plugin-mlab
This is for Tcpbw100 from NDT 3.6.2b;
not sufficient to compile Tcpbw100 from 3.7.0.2,
changes to follow.
License: GPLv2.
2018-11-13 17:20:33 +00:00
zzz
e20401373c NDT changes adapted from Vuze/BiglyBT, and changes for I2P.
Vuze/Bigly is based on NDT 3.6.2b, so their changes are
manually merged here.
This rev does not compile, requires swingemu package to follow.
Changes:
- Add external start hook to Tcpbw100 from BiglyBT
- Replace all Swing/AWT classes with emulations from BiglyBT
  (included in next checkin)
- Leave classes in edu.internet2.ndt package rather than
  moving to com.vuze.plugins.mlab heirarchy as Vuze/BiglyBT did
- Change IPv6 support setting to use I2P class for detection
- Change in-progress field to an AtomicBoolean
- Change from System to I2P logging
- Change JSON library package
- Comment out some applet code
- Javadoc fixes
2018-11-13 17:08:56 +00:00
zzz
6f7881c7ea Web100 Network Diagnostic Tool (NDT) Java Applet
Version 3.7.0.2 (May 20, 2015)
From: https://github.com/ndt-project/ndt/releases
Unmodified, as baseline for future merges.
Will not compile, changes adapted from BiglyBT to follow.
Copyright 2003 University of Chicago.
3-clause license with requirement that:
  Modified copies and works based on the Software must carry prominent
  notices stating that you changed specified portions of the Software.
See LICENSE.txt and licenses/LICENSE-NDT.txt
2018-11-13 16:58:05 +00:00
meeh
e326011a93 merge of '917225cb79561b9c536091f9c0790633ebbca610'
and 'c9243853a4211ebe92d964f7aa6ba57e624d6ab8'
2018-10-14 01:46:17 +00:00
zzz
e9ec043bf4 Data: Encrypted LS2, other LS2 changes 2018-10-13 14:36:39 +00:00
zzz
e391992251 Data: MetaLeaseSet2 data structure, LS2 test enhancements 2018-10-13 12:46:45 +00:00
zzz
02f5733eee Data: Prop 123 Meta Lease 2018-10-13 11:40:14 +00:00
zzz
a9f957504e Data: Lease2 and LeaseSet2 data structures, prop. 123 store types 2018-10-13 10:49:50 +00:00
zzz
f0b3815767 Data: Prep Lease and LeaseSet for subclassing 2018-10-13 10:41:16 +00:00
zzz
ee57bd7363 Data: Add encryption types for PublicKey, PrivateKey 2018-10-13 10:39:20 +00:00
zzz
4c970fa0aa Data: SPK log tweaks 2018-10-13 10:35:30 +00:00
zzz
0a99784221 Build: Add javac.classpath to junit.compileTest targets (ticket #2333) 2018-10-13 09:32:51 +00:00
meeh
eed8011725 OSX Launcher: dmg create script update 2018-10-13 04:06:44 +00:00
meeh
f8fb4a66dd OSX Launcher: Remove restart button 2018-10-13 04:06:02 +00:00
meeh
4f8af55378 OSX Launcher: Storyboard update 2018-10-13 04:05:38 +00:00
meeh
530470972f OSX Launcher: general cleanup, responsibility delegation, and fixes 2018-10-13 03:54:01 +00:00
meeh
a9bf9e0657 OSX Launcher: make deployer an property so it's not deleted in mid-extract by GC. 2018-10-13 03:52:40 +00:00
meeh
e2d22645e1 OSX Launcher:
* UI Bugfixes/features
    * restart might work
    * open console button should work
    * cleanup
2018-10-13 03:51:22 +00:00
meeh
5f077891ae OSX Launcher: Storyboard update 2018-10-13 03:47:28 +00:00
meeh
1a00f73191 OSX Launcher: Extended start/stop/load/unload to be able to set terminationHandler for more reliable execution. 2018-10-12 20:52:24 +00:00
meeh
d8cfe21e92 OSX Launcher: make some string functions inline 2018-10-12 20:07:59 +00:00
meeh
ee9976c288 OSX Launcher: Xcode UI elements update. 2018-10-12 20:07:36 +00:00
meeh
10707c6d71 merge of '1f8e31dab7ed66ddd8f332fca5784b4934d0c9b0'
and '4197dba37e7c738c7b1125b3e407a7bc0b2c972a'
2018-10-11 17:04:49 +00:00
meeh
8e988c39e9 OSX Launcher: Updated build instructions in readme 2018-10-11 17:03:11 +00:00
meeh
e3ab9f8e91 OSX Launcher: Swift GUI code updates, most related to the new launch method. 2018-10-11 17:02:42 +00:00
meeh
96d31995e1 OSX Launcher: cleanup and restructuring the main swift file 2018-10-11 17:01:21 +00:00
meeh
3988a8645d OSX Launcher: major updates to the glue between 'backend' and GUI. Implemented the use of the new LaunchAgent classes 2018-10-11 16:59:59 +00:00
meeh
b25dec12d1 OSX Launcher: some changes to the Swift<->Objective-C bridge 2018-10-11 16:58:20 +00:00
meeh
f57f8c6083 Some more xcode metadata files 2018-10-11 16:56:26 +00:00
meeh
2862be564e XCode metadata files update 2018-10-11 16:55:36 +00:00
meeh
45b4f426a8 OSX Launcher: Big rewrite of swift code where it now has the capability of creating services.
The router management has been much easier with this approach as it uses launchd to do the dirty work.
This code also uses java_home as a wrapper instead of locating the java binary by itself. This also contribute to the improvements.
2018-10-11 16:55:07 +00:00
meeh
51cbd8ef87 Dropping unused swift class 2018-10-11 16:49:51 +00:00
meeh
8b2c3de795 OSX Launcher: Cleaning up DetectJava.swift 2018-10-11 16:49:19 +00:00
meeh
969bc2dee3 OSX Launcher: String extensions update 2018-10-11 16:48:10 +00:00
zzz
77e539a73c Docs: Add maven doc from str4d via mattermost
Update dependencies doc
2018-10-11 14:33:23 +00:00
zzz
2de36ee343 Console: Remove static Server ref, hang off RCR 2018-10-11 13:10:33 +00:00
meeh
7dbf568212 OSX Launcher: Refactor deployment code to own file, + code cleanups. 2018-10-11 11:55:05 +00:00
meeh
7e9d1939b1 OSX Launcher: Storyboard update 2018-10-11 11:51:55 +00:00
meeh
48877079ca OSX Launcher: Log all events for debugging 2018-10-11 11:50:00 +00:00
zzz
e68182a157 Build: Provide option to prevent Class-Path in manifests (ticket #2317) 2018-10-10 12:30:34 +00:00
zzz
06914f9fd4 Sybil: Take HTML out of reason string for easier parsing and storage 2018-10-09 16:56:50 +00:00
zzz
8332385f05 Sybil: More prep and refactor for background analysis
Put dest name in too-close reasons
2018-10-09 16:37:29 +00:00
zzz
19b1b3cec4 Sybil: Prep for background analysis
sort threat points
consolidate strings
2018-10-09 14:55:13 +00:00
zzz
bdd7c35ab3 Console: Remove static StatSummarizer ref, hang off ClientAppManager 2018-10-08 19:31:54 +00:00
zzz
184b6179e5 i2psnark: Sync field access (findbugs) 2018-10-08 14:24:46 +00:00
zzz
6fccfc990a Use Double.compare() in comparators (findbugs) 2018-10-08 13:34:15 +00:00
zzz
524c375944 Data: Drop long-deprecated and unused boolean methods and related tests 2018-10-08 12:43:58 +00:00
zzz
5041bb8531 netdb class cleanup 2018-10-08 12:13:24 +00:00
zzz
7dfee5f0ab NTCP2 log tweak 2018-10-07 19:50:59 +00:00
zzz
e3d456c733 Debian: Don't override dh_builddeb (ticket #2329) 2018-10-07 15:54:12 +00:00
zzz
e2a41b7748 Console: Sort RAs in Sybil tool 2018-10-07 14:52:24 +00:00
zzz
477fa9ef3a Build: Fix build config with-libtomcat8-java but not with-libjetty9-java,
by copying required jetty jar to jetty-apache-jsp.jar
2018-10-07 14:29:47 +00:00
zzz
0cd67acd19 Console: /netdb fixes (ticket #2326):
- 'O' cap search won't include P/X
- Fix highlighted tab for transport search
- Use POST instead of GET
2018-10-06 22:59:58 +00:00
zzz
aafccc0132 Console: Fix SSU sort links broken in last checkin 2018-10-06 17:40:05 +00:00
zzz
ff1e53a0e3 Console: Fix bw cap display for P/X on /tunnels 2018-10-06 17:09:14 +00:00
zzz
b8d33f7426 Console: Tab /peers, fix html errors 2018-10-06 16:50:32 +00:00
zzz
8dc3163c73 flip sections on /confighome 2018-10-06 13:33:19 +00:00
zzz
960636c6bf Console: Sort addresses in RIs, remove note about O cap 2018-10-06 13:25:22 +00:00
zzz
e528775768 debian changelogs 2018-10-05 18:41:48 +00:00
3531 changed files with 379763 additions and 438909 deletions

View File

@@ -26,6 +26,12 @@ indent_style = tab
[apps/BOB/**/*.java]
indent_style = tab
[apps/routerconsole/java/src/com/vuze/plugins/mlab/tools/ndt/swingemu/*.java]
indent_style = tab
[apps/routerconsole/java/src/edu/internet2/ndt/*.java]
indent_style = tab
[apps/routerconsole/jsp/{createreseed.jsp,exportfamily.jsp,flags.jsp,index.jsp,viewhistory.jsp,viewrouterlog.jsp,viewstat.jsp,viewtheme.jsp,viewwrapperlog.jsp}]
insert_final_newline = false
@@ -44,7 +50,11 @@ indent_size = 2
[core/java/src/gnu/getopt/*.properties]
charset = iso-8859-1
[core/java/src/net/minidev/**/*.java]
[core/java/src/org/json/simple/**/*.java]
end_of_line = crlf
indent_style = tab
[core/java/src/com/southernstorm/**/*.java]
indent_style = tab
[router/java/src/org/cybergarage/**/*.java]

6
.gitignore vendored
View File

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

24
.gitlab-ci.yml Normal file
View File

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

6
.idea/ant.xml generated
View File

@@ -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
View File

@@ -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>

View File

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

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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
View File

@@ -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
View File

@@ -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>

View File

@@ -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>

View File

@@ -1,27 +1,18 @@
language: java
dist: bionic
jdk:
- oraclejdk9
- openjdk8
- oraclejdk11
matrix:
include:
- jdk: oraclejdk8
- jdk: oraclejdk11
addons:
sonarcloud:
organization: "i2p"
- jdk: openjdk7
sudo: required
before_install: # Work around missing crypto in openjdk7
- sudo wget "https://bouncycastle.org/download/bcprov-ext-jdk15on-158.jar" -O "${JAVA_HOME}/jre/lib/ext/bcprov-ext-jdk15on-158.jar"
- sudo perl -pi.bak -e 's/^(security\.provider\.)([0-9]+)/$1.($2+1)/ge' /etc/java-7-openjdk/security/java.security
- echo "security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider" | sudo tee -a /etc/java-7-openjdk/security/java.security
before_install:
- |
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ]; then
sed -i "1iplugins {\n id 'org.sonarqube' version '2.6.1'\n}\n" build.gradle
fi
before_install:
- sed -i "1iplugins {\n id 'org.sonarqube' version '3.0'\n}\n" build.gradle
- jdk: openjdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
@@ -33,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)

View File

@@ -1,3 +1,6 @@
;; warning - conversions for all Java bundles:
;; id->in, he->iw, iy, yi->ji
[I2P.i2ptunnel]
source_file = apps/i2ptunnel/locale/messages_en.po
source_lang = en
@@ -6,6 +9,7 @@ trans.cs = apps/i2ptunnel/locale/messages_cs.po
trans.da = apps/i2ptunnel/locale/messages_da.po
trans.de = apps/i2ptunnel/locale/messages_de.po
trans.es = apps/i2ptunnel/locale/messages_es.po
trans.fa = apps/i2ptunnel/locale/messages_fa.po
trans.fi = apps/i2ptunnel/locale/messages_fi.po
trans.fr = apps/i2ptunnel/locale/messages_fr.po
trans.hu = apps/i2ptunnel/locale/messages_hu.po
@@ -23,6 +27,7 @@ trans.pt_BR = apps/i2ptunnel/locale/messages_pt_BR.po
trans.ro = apps/i2ptunnel/locale/messages_ro.po
trans.ru_RU = apps/i2ptunnel/locale/messages_ru.po
trans.sk = apps/i2ptunnel/locale/messages_sk.po
trans.sq = apps/i2ptunnel/locale/messages_sq.po
trans.sv_SE = apps/i2ptunnel/locale/messages_sv.po
trans.tr_TR = apps/i2ptunnel/locale/messages_tr.po
trans.uk_UA = apps/i2ptunnel/locale/messages_uk.po
@@ -38,6 +43,7 @@ trans.cs = apps/i2ptunnel/locale-proxy/messages_cs.po
trans.de = apps/i2ptunnel/locale-proxy/messages_de.po
trans.el = apps/i2ptunnel/locale-proxy/messages_el.po
trans.es = apps/i2ptunnel/locale-proxy/messages_es.po
trans.fa = apps/i2ptunnel/locale-proxy/messages_fa.po
trans.fi = apps/i2ptunnel/locale-proxy/messages_fi.po
trans.fr = apps/i2ptunnel/locale-proxy/messages_fr.po
trans.hu = apps/i2ptunnel/locale-proxy/messages_hu.po
@@ -60,16 +66,92 @@ trans.uk_UA = apps/i2ptunnel/locale-proxy/messages_uk.po
trans.vi = apps/i2ptunnel/locale-proxy/messages_vi.po
trans.zh_CN = apps/i2ptunnel/locale-proxy/messages_zh.po
[I2P.core]
type = PO
source_file = core/locale/messages_en.po
source_lang = en
trans.ar = core/locale/messages_ar.po
trans.az = core/locale/messages_az.po
trans.cs = core/locale/messages_cs.po
trans.da = core/locale/messages_da.po
trans.de = core/locale/messages_de.po
trans.el = core/locale/messages_el.po
trans.es = core/locale/messages_es.po
trans.et_EE = core/locale/messages_et.po
trans.fa = core/locale/messages_fa.po
trans.fi = core/locale/messages_fi.po
trans.fr = core/locale/messages_fr.po
trans.hu = core/locale/messages_hu.po
;; Java converts id to in
trans.id = core/locale/messages_in.po
trans.it = core/locale/messages_it.po
trans.ja = core/locale/messages_ja.po
trans.ko = core/locale/messages_ko.po
trans.ku = core/locale/messages_ku.po
trans.nb = core/locale/messages_nb.po
trans.nl = core/locale/messages_nl.po
trans.pl = core/locale/messages_pl.po
trans.pt = core/locale/messages_pt.po
trans.pt_BR = core/locale/messages_pt_BR.po
trans.ro = core/locale/messages_ro.po
trans.ru_RU = core/locale/messages_ru.po
trans.sv_SE = core/locale/messages_sv.po
trans.tk = core/locale/messages_tk.po
trans.tr_TR = core/locale/messages_tr.po
trans.uk_UA = core/locale/messages_uk.po
trans.vi = core/locale/messages_vi.po
trans.zh_CN = core/locale/messages_zh.po
trans.zh_TW = core/locale/messages_zh_TW.po
[I2P.router]
type = PO
source_file = router/locale/messages_en.po
source_lang = en
trans.ar = router/locale/messages_ar.po
trans.az = router/locale/messages_az.po
trans.cs = router/locale/messages_cs.po
trans.da = router/locale/messages_da.po
trans.de = router/locale/messages_de.po
trans.el = router/locale/messages_el.po
trans.es = router/locale/messages_es.po
trans.et_EE = router/locale/messages_et.po
trans.fa = router/locale/messages_fa.po
trans.fi = router/locale/messages_fi.po
trans.fr = router/locale/messages_fr.po
trans.hu = router/locale/messages_hu.po
;; Java converts id to in
trans.id = router/locale/messages_in.po
trans.it = router/locale/messages_it.po
trans.ja = router/locale/messages_ja.po
trans.ko = router/locale/messages_ko.po
trans.ku = router/locale/messages_ku.po
trans.nb = router/locale/messages_nb.po
trans.nl = router/locale/messages_nl.po
trans.pl = router/locale/messages_pl.po
trans.pt = router/locale/messages_pt.po
trans.pt_BR = router/locale/messages_pt_BR.po
trans.ro = router/locale/messages_ro.po
trans.ru_RU = router/locale/messages_ru.po
trans.sv_SE = router/locale/messages_sv.po
trans.tk = router/locale/messages_tk.po
trans.tr_TR = router/locale/messages_tr.po
trans.uk_UA = router/locale/messages_uk.po
trans.vi = router/locale/messages_vi.po
trans.zh_CN = router/locale/messages_zh.po
trans.zh_TW = router/locale/messages_zh_TW.po
[I2P.routerconsole]
source_file = apps/routerconsole/locale/messages_en.po
source_lang = en
trans.ar = apps/routerconsole/locale/messages_ar.po
trans.az = apps/routerconsole/locale/messages_az.po
trans.cs = apps/routerconsole/locale/messages_cs.po
trans.da = apps/routerconsole/locale/messages_da.po
trans.de = apps/routerconsole/locale/messages_de.po
trans.el = apps/routerconsole/locale/messages_el.po
trans.es = apps/routerconsole/locale/messages_es.po
trans.et_EE = apps/routerconsole/locale/messages_et.po
trans.fa = apps/routerconsole/locale/messages_fa.po
trans.fi = apps/routerconsole/locale/messages_fi.po
trans.fr = apps/routerconsole/locale/messages_fr.po
trans.hu = apps/routerconsole/locale/messages_hu.po
@@ -101,15 +183,18 @@ trans.cs = apps/routerconsole/locale-news/messages_cs.po
trans.de = apps/routerconsole/locale-news/messages_de.po
trans.el = apps/routerconsole/locale-news/messages_el.po
trans.es = apps/routerconsole/locale-news/messages_es.po
trans.fa = apps/routerconsole/locale-news/messages_fa.po
trans.fi = apps/routerconsole/locale-news/messages_fi.po
trans.fr = apps/routerconsole/locale-news/messages_fr.po
trans.gl = apps/routerconsole/locale-news/messages_gl.po
trans.he = apps/routerconsole/locale-news/messages_he.po
;; Java converts he to iw
trans.he = apps/routerconsole/locale-news/messages_iw.po
;; Java converts id to in
trans.id = apps/routerconsole/locale-news/messages_in.po
trans.it = apps/routerconsole/locale-news/messages_it.po
trans.ja = apps/routerconsole/locale-news/messages_ja.po
trans.ko = apps/routerconsole/locale-news/messages_ko.po
trans.ku = apps/routerconsole/locale-news/messages_ku.po
trans.mg = apps/routerconsole/locale-news/messages_mg.po
trans.nb = apps/routerconsole/locale-news/messages_nb.po
trans.nl = apps/routerconsole/locale-news/messages_nl.po
@@ -122,6 +207,7 @@ trans.sk = apps/routerconsole/locale-news/messages_sk.po
trans.sq = apps/routerconsole/locale-news/messages_sq.po
trans.sr = apps/routerconsole/locale-news/messages_sr.po
trans.sv_SE = apps/routerconsole/locale-news/messages_sv.po
trans.tk = apps/routerconsole/locale-news/messages_tk.po
trans.tr_TR = apps/routerconsole/locale-news/messages_tr.po
trans.uk_UA = apps/routerconsole/locale-news/messages_uk.po
trans.zh_CN = apps/routerconsole/locale-news/messages_zh.po
@@ -133,7 +219,9 @@ source_file = apps/routerconsole/locale-countries/messages_en.po
source_lang = en
trans.ar = apps/routerconsole/locale-countries/messages_ar.po
trans.az = apps/routerconsole/locale-countries/messages_az.po
trans.bg = apps/routerconsole/locale-countries/messages_bg.po
trans.ca = apps/routerconsole/locale-countries/messages_ca.po
trans.cs = apps/routerconsole/locale-countries/messages_cs.po
trans.da = apps/routerconsole/locale-countries/messages_da.po
trans.de = apps/routerconsole/locale-countries/messages_de.po
trans.el = apps/routerconsole/locale-countries/messages_el.po
@@ -143,13 +231,17 @@ trans.fa = apps/routerconsole/locale-countries/messages_fa.po
trans.fi = apps/routerconsole/locale-countries/messages_fi.po
trans.fr = apps/routerconsole/locale-countries/messages_fr.po
trans.gl = apps/routerconsole/locale-countries/messages_gl.po
trans.hi = apps/routerconsole/locale-countries/messages_hi.po
trans.hr = apps/routerconsole/locale-countries/messages_hr.po
trans.hu = apps/routerconsole/locale-countries/messages_hu.po
;; Java converts he to iw
trans.he = apps/routerconsole/locale-countries/messages_iw.po
;; Java converts id to in
trans.id = apps/routerconsole/locale-countries/messages_in.po
trans.it = apps/routerconsole/locale-countries/messages_it.po
trans.ja = apps/routerconsole/locale-countries/messages_ja.po
trans.ko = apps/routerconsole/locale-countries/messages_ko.po
trans.ku = apps/routerconsole/locale-countries/messages_ku.po
trans.mg = apps/routerconsole/locale-countries/messages_mg.po
trans.nb = apps/routerconsole/locale-countries/messages_nb.po
trans.nl = apps/routerconsole/locale-countries/messages_nl.po
@@ -160,7 +252,9 @@ trans.ro = apps/routerconsole/locale-countries/messages_ro.po
trans.ru_RU = apps/routerconsole/locale-countries/messages_ru.po
trans.sk = apps/routerconsole/locale-countries/messages_sk.po
trans.sq = apps/routerconsole/locale-countries/messages_sq.po
trans.sr = apps/routerconsole/locale-countries/messages_sr.po
trans.sv_SE = apps/routerconsole/locale-countries/messages_sv.po
trans.tk = apps/routerconsole/locale-countries/messages_tk.po
trans.tr_TR = apps/routerconsole/locale-countries/messages_tr.po
trans.uk_UA = apps/routerconsole/locale-countries/messages_uk.po
trans.vi = apps/routerconsole/locale-countries/messages_vi.po
@@ -175,6 +269,7 @@ trans.cs = apps/i2psnark/locale/messages_cs.po
trans.de = apps/i2psnark/locale/messages_de.po
trans.el = apps/i2psnark/locale/messages_el.po
trans.es = apps/i2psnark/locale/messages_es.po
trans.fa = apps/i2psnark/locale/messages_fa.po
trans.fi = apps/i2psnark/locale/messages_fi.po
trans.fr = apps/i2psnark/locale/messages_fr.po
trans.hu = apps/i2psnark/locale/messages_hu.po
@@ -197,6 +292,7 @@ trans.tr_TR = apps/i2psnark/locale/messages_tr.po
trans.uk_UA = apps/i2psnark/locale/messages_uk.po
trans.vi = apps/i2psnark/locale/messages_vi.po
trans.zh_CN = apps/i2psnark/locale/messages_zh.po
trans.zh_TW = apps/i2psnark/locale/messages_zh_TW.po
[I2P.susidns]
source_file = apps/susidns/locale/messages_en.po
@@ -207,6 +303,7 @@ trans.da = apps/susidns/locale/messages_da.po
trans.de = apps/susidns/locale/messages_de.po
trans.el = apps/susidns/locale/messages_el.po
trans.es = apps/susidns/locale/messages_es.po
trans.fa = apps/susidns/locale/messages_fa.po
trans.fi = apps/susidns/locale/messages_fi.po
trans.fr = apps/susidns/locale/messages_fr.po
trans.gl = apps/susidns/locale/messages_gl.po
@@ -241,6 +338,7 @@ trans.da = apps/desktopgui/locale/messages_da.po
trans.de = apps/desktopgui/locale/messages_de.po
trans.el = apps/desktopgui/locale/messages_el.po
trans.es = apps/desktopgui/locale/messages_es.po
trans.es_AR = apps/desktopgui/locale/messages_es_AR.po
trans.fa = apps/desktopgui/locale/messages_fa.po
trans.fi = apps/desktopgui/locale/messages_fi.po
trans.fr = apps/desktopgui/locale/messages_fr.po
@@ -251,6 +349,7 @@ trans.id = apps/desktopgui/locale/messages_in.po
trans.it = apps/desktopgui/locale/messages_it.po
trans.ja = apps/desktopgui/locale/messages_ja.po
trans.ko = apps/desktopgui/locale/messages_ko.po
trans.ku = apps/desktopgui/locale/messages_ku.po
trans.mg = apps/desktopgui/locale/messages_mg.po
trans.nb = apps/desktopgui/locale/messages_nb.po
trans.nl = apps/desktopgui/locale/messages_nl.po
@@ -260,27 +359,36 @@ trans.pt_BR = apps/desktopgui/locale/messages_pt_BR.po
trans.ro = apps/desktopgui/locale/messages_ro.po
trans.ru_RU = apps/desktopgui/locale/messages_ru.po
trans.sk = apps/desktopgui/locale/messages_sk.po
trans.sr = apps/desktopgui/locale/messages_sr.po
trans.sv_SE = apps/desktopgui/locale/messages_sv.po
trans.sq = apps/desktopgui/locale/messages_sq.po
trans.uk_UA = apps/desktopgui/locale/messages_uk.po
trans.tk = apps/desktopgui/locale/messages_tk.po
trans.tr_TR = apps/desktopgui/locale/messages_tr.po
trans.vi = apps/desktopgui/locale/messages_vi.po
trans.zh_CN = apps/desktopgui/locale/messages_zh.po
trans.zh_TW = apps/desktopgui/locale/messages_zh_TW.po
[I2P.susimail]
source_file = apps/susimail/locale/messages_en.po
source_lang = en
trans.ar = apps/susimail/locale/messages_ar.po
trans.az = apps/susimail/locale/messages_az.po
trans.bg = apps/susimail/locale/messages_bg.po
trans.ca = apps/susimail/locale/messages_ca.po
trans.cs = apps/susimail/locale/messages_cs.po
trans.da = apps/susimail/locale/messages_da.po
trans.de = apps/susimail/locale/messages_de.po
trans.el = apps/susimail/locale/messages_el.po
trans.es = apps/susimail/locale/messages_es.po
trans.fa = apps/susimail/locale/messages_fa.po
trans.fi = apps/susimail/locale/messages_fi.po
trans.fr = apps/susimail/locale/messages_fr.po
trans.gl = apps/susimail/locale/messages_gl.po
trans.hr = apps/susimail/locale/messages_hr.po
trans.hu = apps/susimail/locale/messages_hu.po
;; Java converts he to iw
trans.he = apps/susimail/locale/messages_iw.po
;; Java converts id to in
trans.id = apps/susimail/locale/messages_in.po
trans.it = apps/susimail/locale/messages_it.po
@@ -296,6 +404,7 @@ trans.ro = apps/susimail/locale/messages_ro.po
trans.ru_RU = apps/susimail/locale/messages_ru.po
trans.sk = apps/susimail/locale/messages_sk.po
trans.sq = apps/susimail/locale/messages_sq.po
trans.sr = apps/susimail/locale/messages_sr.po
trans.sv_SE = apps/susimail/locale/messages_sv.po
trans.tr_TR = apps/susimail/locale/messages_tr.po
trans.uk_UA = apps/susimail/locale/messages_uk.po
@@ -330,6 +439,7 @@ trans.ru_RU = debian/po/ru.po
trans.sk = debian/po/sk.po
trans.sq = debian/po/sq.po
trans.sv_SE = debian/po/sv.po
trans.tk = debian/po/tk.po
trans.tr_TR = debian/po/tr.po
trans.uk_UA = debian/po/uk.po
trans.zh_CN = debian/po/zh.po
@@ -396,6 +506,7 @@ trans.id = core/java/src/gnu/getopt/MessagesBundle_in.properties
trans.it = core/java/src/gnu/getopt/MessagesBundle_it.properties
trans.ja = core/java/src/gnu/getopt/MessagesBundle_ja.properties
trans.ko = core/java/src/gnu/getopt/MessagesBundle_ko.properties
trans.ku = core/java/src/gnu/getopt/MessagesBundle_ku.properties
trans.nb = core/java/src/gnu/getopt/MessagesBundle_nb.properties
trans.nl = core/java/src/gnu/getopt/MessagesBundle_nl.properties
trans.pl = core/java/src/gnu/getopt/MessagesBundle_pl.properties
@@ -421,9 +532,11 @@ trans.ca = apps/ministreaming/locale/messages_ca.po
trans.cs = apps/ministreaming/locale/messages_cs.po
trans.de = apps/ministreaming/locale/messages_de.po
trans.es = apps/ministreaming/locale/messages_es.po
trans.fa = apps/ministreaming/locale/messages_fa.po
trans.fi = apps/ministreaming/locale/messages_fi.po
trans.fr = apps/ministreaming/locale/messages_fr.po
trans.gl = apps/ministreaming/locale/messages_gl.po
trans.hu = apps/ministreaming/locale/messages_hu.po
;; Java converts id to in
trans.id = apps/ministreaming/locale/messages_in.po
trans.it = apps/ministreaming/locale/messages_it.po
@@ -436,6 +549,7 @@ trans.pt_BR = apps/ministreaming/locale/messages_pt_BR.po
trans.ro = apps/ministreaming/locale/messages_ro.po
trans.ru_RU = apps/ministreaming/locale/messages_ru.po
trans.sv_SE = apps/ministreaming/locale/messages_sv.po
trans.tk = apps/ministreaming/locale/messages_tk.po
trans.tr_TR = apps/ministreaming/locale/messages_tr.po
trans.uk_UA = apps/ministreaming/locale/messages_uk.po
trans.zh_CN = apps/ministreaming/locale/messages_zh.po
@@ -443,6 +557,7 @@ trans.zh_CN = apps/ministreaming/locale/messages_zh.po
[I2P.manpages]
;;
;; after adding languages here, add to debian/*.manpages also
;; You must run installer/resources/poupdate-man.sh first.
;;
type = PO
source_file = installer/resources/locale-man/man.pot
@@ -460,6 +575,7 @@ trans.nl = installer/resources/locale-man/man_nl.po
trans.pl = installer/resources/locale-man/man_pl.po
trans.pt = installer/resources/locale-man/man_pt.po
trans.pt_BR = installer/resources/locale-man/man_pt_BR.po
trans.ro = installer/resources/locale-man/man_ro.po
trans.ru_RU = installer/resources/locale-man/man_ru.po
trans.sv_SE = installer/resources/locale-man/man_sv.po
trans.tr_TR = installer/resources/locale-man/man_tr.po
@@ -467,26 +583,30 @@ trans.zh_CN = installer/resources/locale-man/man_zh.po
[I2P.eepsite]
;;
;; For any new translations, add links in index.html,
;; For any new translations, add links in installer/resources/eepsite/docroot/help/index.html
;; and copy new flags in build.xml copyflags-unlesspkg target,
;; and add to debian/i2p-router.links and debian-alt/*/i2p-router.links
;;
type = HTML
source_file = installer/resources/eepsite/docroot/help/index.html
source_lang = en
trans.ar = installer/resources/eepsite/docroot/help/index_ar.html
;; File contains local changes to fix RTL issues.
;; Merge locally or make changes on TX side before re-enabling
;;trans.ar = installer/resources/eepsite/docroot/help/index_ar.html
trans.az = installer/resources/eepsite/docroot/help/index_az.html
trans.de = installer/resources/eepsite/docroot/help/index_de.html
;; not yet translated on TX, use old page
;;trans.es = installer/resources/eepsite/docroot/help/index_es.html
trans.fr = installer/resources/eepsite/docroot/help/index_fr.html
trans.hu = installer/resources/eepsite/docroot/help/index_hu.html
;; Java converts id to in
trans.id = installer/resources/eepsite/docroot/help/index_in.html
trans.it = installer/resources/eepsite/docroot/help/index_it.html
;; not yet translated on TX, use old page
;;trans.nl = installer/resources/eepsite/docroot/help/index_nl.html
trans.pl = installer/resources/eepsite/docroot/help/index_nl.html
trans.pt = installer/resources/eepsite/docroot/help/index_nl.html
trans.pl = installer/resources/eepsite/docroot/help/index_pl.html
trans.pt = installer/resources/eepsite/docroot/help/index_pt.html
trans.ro = installer/resources/eepsite/docroot/help/index_ro.html
trans.ru_RU = installer/resources/eepsite/docroot/help/index_ru.html
;; not yet translated on TX, use old page
;;trans.sv_SE = installer/resources/eepsite/docroot/help/index_sv.html
@@ -499,17 +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.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.tr_TR = installer/resources/readme/readme_tr.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

View File

@@ -15,7 +15,7 @@ If you're having trouble, check the
website at https://geti2p.net/, or get on irc://irc.freenode.net/#i2p
I2P will create and store files and configuration data in the user directory
~/.i2p/ on Linux and %APPDATA%\I2P\ on Windows. This directory is created
~/.i2p/ on Linux and %LOCALAPPDATA%\I2P\ on Windows. This directory is created
when I2P is run for the first time. It also creates files in the system
temporary directory specified by the Java Virtual Machine.
To change the location of these directories, or to configure I2P to
@@ -40,7 +40,7 @@ To uninstall I2P:
rm -rf $I2PInstallDir ~/.i2p
Supported JVMs:
All platforms: Java 1.7 or higher required
All platforms: Java 1.8 or higher required
Windows: OpenJDK or Oracle from http://java.com/download
Linux: OpenJDK or Oracle from http://java.com/download
FreeBSD: OpenJDK or Oracle from http://java.com/download

View File

@@ -1,10 +1,10 @@
I2P source installation instructions
Prerequisites to build from source:
Java SDK (preferably Oracle/Sun or OpenJDK) 1.7.0 or higher
Java SDK (preferably Oracle or OpenJDK) 8 or higher
Non-linux operating systems and JVMs: See https://trac.i2p2.de/wiki/java
Certain subsystems for embedded (core, router, mstreaming, streaming, i2ptunnel) require only Java 1.6
Apache Ant 1.7.0 or higher
Apache Ant 1.9.8 or higher
The xgettext, msgfmt, and msgmerge tools installed
from the GNU gettext package http://www.gnu.org/software/gettext/
Build environment must use a UTF-8 locale.

View File

@@ -36,10 +36,6 @@ Public domain except as listed below:
Copyright (c) 2003, TheCrypto
See licenses/LICENSE-ElGamalDSA.txt
HMAC:
Copyright (c) 2000 - 2004 The Legion Of The Bouncy Castle
See licenses/LICENSE-SHA256.txt
ElGamal:
Copyright (c) 2000 - 2013 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
See licenses/LICENSE-SHA256.txt
@@ -82,14 +78,28 @@ Public domain except as listed below:
Copyright (c) 1998 by Aaron M. Renn (arenn@urbanophile.com)
See licenses/LICENSE-LGPLv2.1.txt
EdDSA-Java:
See licenses/LICENSE-CC0-1.0-Universal.txt
HostnameVerifier:
From Apache HttpClient 4.4.1 and HttpCore 4.4.1
See licenses/LICENSE-Apache2.0.txt
json-smart-v1 1.3.1+
Copyright 2011 JSON-SMART authors
json-simple 2.3.0
(not included in most distribution packages)
Copyright 2016 Clifton Labs
See licenses/LICENSE-Apache2.0.txt
Noise library:
Copyright (C) 2016 Southern Storm Software, Pty Ltd.
See licenses/LICENSE-Noise.txt
MiniDNS library 1.0.0
This software may be used under the terms of (at your choice)
- LGPL version 2 (or later) (see licenses/LICENSE-LGPL2.1.txt)
- Apache Software licence (see licenses/LICENSE-Apache2.0.txt)
- DWTFYWTPL
Router (router.jar):
Public domain except as listed below:
@@ -104,10 +114,24 @@ Public domain except as listed below:
GeoIP API 1.3.1:
See licenses/LICENSE-LGPLv2.1.txt
GeoIP2-java 2.12.0:
See licenses/LICENSE-Apache2.0.txt
Maxmind-DB-Reader-java 1.2.2:
See licenses/LICENSE-Apache2.0.txt
Noise library:
Copyright (C) 2016 Southern Storm Software, Pty Ltd.
See licenses/LICENSE-Noise.txt
SparseArray:
Copyright (C) 2006 The Android Open Source Project
See licenses/LICENSE-Apache2.0.txt
SSU HMAC:
Copyright (c) 2000 - 2004 The Legion Of The Bouncy Castle
See licenses/LICENSE-SHA256.txt
Installer:
(not included in distribution packages)
@@ -154,19 +178,18 @@ Installer:
GeoIP Data:
(not included in most distribution packages)
GeoLite databases are licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
http://creativecommons.org/licenses/by-sa/3.0/
This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/
See licenses/LICENSE-GeoIP.txt
IP Geolocation by DB-IP https://db-ip.com/
See https://creativecommons.org/licenses/by/4.0/
Launchers:
(not included in distribution packages)
Copyright (c) 2002-2018 EPFL, Lausanne / Lightbend, Inc. , unless otherwise specified.
See licenses/LICENSE-Scala.md
Java Service Wrapper Community Edition 32-bit 3.5.34:
Java Service Wrapper Community Edition 3.5.44:
(Windows: 3.5.25)
(not included in most distribution packages)
Copyright (C) 1999-2017 Tanuki Software, Ltd. All Rights Reserved.
Copyright (C) 1999-2020 Tanuki Software, Ltd. All Rights Reserved.
See licenses/LICENSE-Wrapper.txt
@@ -176,7 +199,7 @@ Jbigi Libraries (jbigi.jar):
GMP 4.3.2 / 5.0.2:
Copyright 1991, 1996, 1999, 2000, 2007 Free Software Foundation, Inc.
See licenses/LICENSE-LGPLv3.txt
GMP 6.0.0:
GMP 6.0.0 / 6.1.2 / 6.2.0:
See licenses/LICENSE-GPLv2.txt
@@ -203,6 +226,14 @@ Applications:
See https://glassfish.dev.java.net/public/CDDL+GPL.html
See licenses/LICENSE-GPLv2.txt
I2PControl
See licenses/LICENSE-Apache2.0.txt
Includes jBCrypt:
Copyright (c) 2006 Damien Miller <djm@mindrot.org>
See licenses/LICENSE-jBCrypt.txt
Includes jsonrpc2 1.38.1 (base) 1.11 (server)
See licenses/LICENSE-Apache2.0.txt
I2PSnark (i2psnark.jar, i2psnark.war):
Copyright (C) 2003 Mark J. Wielaard
GPLv2 (or any later version)
@@ -230,23 +261,22 @@ Applications:
Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
Copyright (c) 2008 Alexander von Gernler. All rights reserved.
See licenses/LICENSE-BSD.txt
Zxing 3.3.0:
Zxing 3.4.1:
See licenses/LICENSE-Apache2.0.txt
Jetty 9.2.25.v20180606 (jetty-*.jar, org.mortbay.*.jar):
Jetty 9.3.29.v20201019 (jetty-*.jar, org.mortbay.*.jar):
(not included in most distribution packages, except for jetty-i2p.jar)
See licenses/ABOUT-Jetty.html
See licenses/NOTICE-Jetty.html
See licenses/LICENSE-Apache2.0.txt
See licenses/LICENSE-ECLIPSE-1.0.html
JRobin 1.6.0-1 (jrobin.jar):
RRD4J 3.6 (jrobin.jar):
Copyright (c) 2001-2005 Sasa Markovic and Ciaran Treanor.
Copyright (c) 2011 The OpenNMS Group, Inc.
Copyright 2011 The RRD4J Authors.
See licenses/LICENSE-Apache2.0.txt
See licenses/LICENSE-LGPLv2.1.txt
DeallocationHelper:
Copyright (c) 2006-2016 Julien Gouesse
See licenses/LICENSE-GPLv2.txt
Ministreaming Lib (mstreaming.jar):
By mihi.
@@ -269,14 +299,26 @@ Applications:
- All other flag icons: public domain, courtesy mjames@gmail.com http://www.famfamfam.com/
FatCow icons: See licenses/LICENSE-FatCowIcons.txt
Fugue Icons: See licenses/LICENSE-FugueIcons.txt
Feather icons: Copyright (c) 2013-2017 Cole Bemis; see licenses/LICENSE-Feather.txt
Fontawesome icons: Copyright (c) 2018 @fontawesome(company) see licenses/LICENSE-fontawesome.txt
Router Console unthemed, light, and dark theme logos:
Copyright (c) 2019 The Invisible Internet Project. All rights reserved.
Creative Commons Attribution-ShareAlike 4.0 International License
See https://creativecommons.org/licenses/by-sa/4.0/
Router Console and I2PSnark themes:
Some images licensed under a Creative Commons 2.0 license.
Silk icons: See licenses/LICENSE-SilkIcons.txt
I2PSnark light theme:
"Creative Commons Cat" licensed under a Creative Commons Attribution 3.0 Unported License.
Original photo by Boaz Arad. http://www.luxphile.com/2011/01/creative-commons-cat.html
Router Console M-Lab subsystem:
Copyright 2010 Vuze, Inc. All rights reserved.
See licenses/LICENSE-GPLv2.txt
Router Console NDT subsystem:
Copyright (c) 2003 University of Chicago. All rights reserved.
See licenses/LICENSE-NDT.txt
Notice: I2P has changed specified portions of the Software, including the package edu.internet2.ndt.
SAM (sam.jar):
Public domain.
@@ -297,9 +339,9 @@ Applications:
Systray (systray.jar):
Public domain.
Tomcat 8.5.34 (jasper-runtime.jar):
Tomcat 9.0.40 (jasper-runtime.jar):
(not included in most distribution packages)
Copyright 1999-2018 The Apache Software Foundation
Copyright 1999-2020 The Apache Software Foundation
See licenses/LICENSE-Apache2.0.txt
See licenses/NOTICE-Tomcat.txt

View File

@@ -2,19 +2,19 @@
This is the source code for the reference Java implementation of I2P.
Latest release: https://geti2p.net/download
Latest release: [https://geti2p.net/download](https://geti2p.net/download)
## Installing
See INSTALL.txt or https://geti2p.net/download for installation instructions.
See [INSTALL.txt](INSTALL.txt) or [https://geti2p.net/download](https://geti2p.net/download) for installation instructions.
## Documentation
https://geti2p.net/how
[https://geti2p.net/how](https://geti2p.net/how)
FAQ: https://geti2p.net/faq
FAQ: [https://geti2p.net/faq](https://geti2p.net/faq)
API: http://docs.i2p-projekt.de/javadoc/
API: [http://docs.i2p-projekt.de/javadoc/](http://docs.i2p-projekt.de/javadoc/)
or run 'ant javadoc' then start at build/javadoc/index.html
## How to contribute / Hack on I2P
@@ -23,17 +23,17 @@ Please check out [HACKING.md](docs/HACKING.md) and other documents in the docs d
## Building packages from source
To get development branch from source control: https://geti2p.net/newdevelopers
To get development branch from source control: [https://geti2p.net/newdevelopers](https://geti2p.net/newdevelopers)
### Prerequisites
- Java SDK (preferably Oracle/Sun or OpenJDK) 1.7.0 or higher
- Non-linux operating systems and JVMs: See https://trac.i2p2.de/wiki/java
- Java SDK (preferably Oracle or OpenJDK) 8 or higher
- Non-linux operating systems and JVMs: See [https://trac.i2p2.de/wiki/java](https://trac.i2p2.de/wiki/java)
- Certain subsystems for embedded (core, router, mstreaming, streaming, i2ptunnel)
require only Java 1.6
- Apache Ant 1.7.0 or higher
require only Java 6
- Apache Ant 1.9.8 or higher
- The xgettext, msgfmt, and msgmerge tools installed from the GNU gettext package
http://www.gnu.org/software/gettext/
[http://www.gnu.org/software/gettext/](http://www.gnu.org/software/gettext/)
- Build environment must use a UTF-8 locale.
### Ant build process
@@ -68,13 +68,13 @@ your `~/.gradle/gradle.properties`:
Need help? See the IRC channel #i2p on irc.freenode.net
Bug reports: https://trac.i2p2.de/report/1
Bug reports: [https://trac.i2p2.de/report/1](https://trac.i2p2.de/report/1)
Contact information, security issues, press inquiries: https://geti2p.net/en/contact
Contact information, security issues, press inquiries: [https://geti2p.net/en/contact](https://geti2p.net/en/contact)
Twitter: @i2p, @geti2p
Twitter: [@i2p](https://twitter.com/i2p), [@geti2p](https://twitter.com/GetI2P)
## Licenses
See LICENSE.txt
See [LICENSE.txt](LICENSE.txt)

View File

@@ -1,8 +1,8 @@
Prerequisites to build from source:
Java SDK (preferably Oracle/Sun or OpenJDK) 1.7.0 or higher
Java SDK (preferably Oracle or OpenJDK) 8 or higher
Non-linux operating systems and JVMs: See https://trac.i2p2.de/wiki/java
Certain subsystems for embedded (core, router, mstreaming, streaming, i2ptunnel) require only Java 1.6
Apache Ant 1.7.0 or higher
Certain subsystems for embedded (core, router, mstreaming, streaming, i2ptunnel) require only Java 6
Apache Ant 1.9.8 or higher
The xgettext, msgfmt, and msgmerge tools installed
from the GNU gettext package http://www.gnu.org/software/gettext/
Build environment must use a UTF-8 locale.

View File

@@ -39,8 +39,9 @@ is divided into following sections:
<property file="${user.properties.file}"/>
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
<property name="default.javac.source" value="1.8"/>
<property name="default.javac.target" value="1.8"/>
<property name="javac.release" value="8"/>
</target>
<target depends="-pre-init,-init-private,-init-user" name="-init-project">
<property file="nbproject/configs/${config}.properties"/>
@@ -155,7 +156,7 @@ is divided into following sections:
<attribute default="/does/not/exist" name="sourcepath"/>
<element name="customize" optional="true"/>
<sequential>
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" release="${javac.release}">
<classpath>
<path path="@{classpath}"/>
</classpath>

View File

@@ -29,28 +29,19 @@ endorsed.classpath=
excludes=**/*.html,**/*.txt
file.reference.build-javadoc=../../i2p.i2p/build/javadoc
file.reference.i2p.jar=../../core/java/build/i2p.jar
file.reference.i2ptunnel.jar=../i2ptunnel/java/build/i2ptunnel.jar
file.reference.jbigi.jar=../../build/jbigi.jar
file.reference.mstreaming.jar=../ministreaming/java/build/mstreaming.jar
file.reference.router.jar=../../router/java/build/router.jar
file.reference.streaming.jar=../streaming/java/build/streaming.jar
file.reference.wrapper.jar=../../installer/lib/wrapper/all/wrapper.jar
includes=**
jar.compress=true
javac.classpath=\
${file.reference.router.jar}:\
${file.reference.i2ptunnel.jar}:\
${file.reference.mstreaming.jar}:\
${file.reference.streaming.jar}:\
${file.reference.wrapper.jar}:\
${file.reference.i2p.jar}:\
${file.reference.router.jar}
${file.reference.i2p.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.version=1.7
javac.version=1.8
javac.source=${javac.version}
javac.target=${javac.version}
javac.release=8
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\

View File

@@ -4,7 +4,7 @@
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>BOB</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<minimum-ant-version>1.9.8</minimum-ant-version>
<source-roots>
<root id="src.dir"/>
</source-roots>

View File

@@ -38,6 +38,7 @@ import net.i2p.I2PAppContext;
import net.i2p.app.*;
import net.i2p.client.I2PClient;
import net.i2p.util.I2PAppThread;
import net.i2p.util.Log;
import net.i2p.util.PortMapper;
import net.i2p.util.SimpleTimer2;
@@ -111,7 +112,9 @@ import net.i2p.util.SimpleTimer2;
* BOB, main command socket listener, launches the command parser engine.
*
* @author sponge
* @deprecated Please port applications to SAMv3
*/
@Deprecated
public class BOB implements Runnable, ClientApp {
public final static String PROP_CONFIG_LOCATION = "BOB.config";
@@ -140,6 +143,7 @@ public class BOB implements Runnable, ClientApp {
private volatile ServerSocket listener;
private volatile Thread _runner;
private volatile boolean _warned;
/**
* Stop BOB gracefully
@@ -242,7 +246,7 @@ public class BOB implements Runnable, ClientApp {
save = true;
}
if (!props.containsKey(I2PClient.PROP_TCP_PORT)) {
props.setProperty(I2PClient.PROP_TCP_PORT, "7654");
props.setProperty(I2PClient.PROP_TCP_PORT, Integer.toString(I2PClient.DEFAULT_LISTEN_PORT));
save = true;
}
if (!props.containsKey(PROP_BOB_PORT)) {
@@ -342,6 +346,12 @@ public class BOB implements Runnable, ClientApp {
}
if (g) {
if (!_warned) {
_warned = true;
String s = "BOB is deprecated. Please port applications to SAMv3.";
_context.logManager().getLog(BOB.class).logAlways(Log.WARN, s);
_log.warn(s);
}
DoCMDS conn_c = new DoCMDS(spin, lock, server, props, database, _log);
Thread t = new I2PAppThread(conn_c);
t.setName("BOB.DoCMDS " + i);

View File

@@ -96,12 +96,14 @@ public class MUXlisten implements Runnable {
}
String i2cpHost = Q.getProperty(I2PClient.PROP_TCP_HOST, "127.0.0.1");
int i2cpPort = 7654;
String i2cpPortStr = Q.getProperty(I2PClient.PROP_TCP_PORT, "7654");
try {
i2cpPort = Integer.parseInt(i2cpPortStr);
} catch (NumberFormatException nfe) {
throw new IllegalArgumentException("Invalid I2CP port specified [" + i2cpPortStr + "]");
int i2cpPort = I2PClient.DEFAULT_LISTEN_PORT;
String i2cpPortStr = Q.getProperty(I2PClient.PROP_TCP_PORT);
if (i2cpPortStr != null) {
try {
i2cpPort = Integer.parseInt(i2cpPortStr);
} catch (NumberFormatException nfe) {
throw new IllegalArgumentException("Invalid I2CP port specified [" + i2cpPortStr + "]");
}
}
if (this.come_in) {

View File

@@ -1,5 +1,5 @@
<html>
<body>
<p>BOB, the Basic Open Bridge, allows TCP applications to talk over I2P.</p>
<p>BOB, the Basic Open Bridge, allows TCP applications to talk over I2P - DEPRECATED - Please port applications to SAMv3.</p>
</body>
</html>

View File

@@ -1,43 +0,0 @@
addressbook v2.0.2 - A simple name resolution mechanism for I2P
addressbook is a simple implementation of subscribable address books for I2P.
Addresses are stored in userhosts.txt and a second copy of the address book is
placed on your eepsite as hosts.txt.
subscriptions.txt contains a list of urls to check for new addresses.
Since the urls are checked in order, and conflicting addresses are not added,
addressbook.subscriptions can be considered to be ranked in order of trust.
The system created by addressbook is similar to the early days of DNS,
when everyone ran a local name server. The major difference is the lack of
authority. Name cannot be guaranteed to be globally unique, but in practise
they probably will be, for a variety of social reasons.
Requirements
************
i2p with a running http proxy
Installation and Usage
**********************
1. Unzip addressbook-%ver.zip into your i2p directory.
2. Restart your router.
The addressbook daemon will automatically run while the router is up.
Aside from the daemon itself, the other elements of the addressbook interface
are the config.txt, myhosts.txt, and subscriptions.txt files found in the addressbook
directory.
config.txt is the configuration file for addressbook.
myhosts.txt is the addressbook master address book. Addresses placed in this file
take precidence over those in the router address book and in remote address books.
If changes are made to this file, they will be reflected in the router address book
and published address book after the next update. Do not make changes directly to the
router address book, as they could be lost during an update.
subscriptions.txt is the subscription list for addressbook. Each entry is an absolute
url to a file in hosts.txt format. Since the list is checked in order, url's should be
listed in order of trust.

View File

@@ -7,7 +7,8 @@
<property name="jar" value="addressbook.jar"/>
<property name="war" value="addressbook.war"/>
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.7" />
<property name="javac.version" value="1.8" />
<property name="javac.release" value="8" />
<target name="all" depends="jar, emptyWar"/>
@@ -40,7 +41,9 @@
<target name="compile" depends="init, depend, warUpToDate">
<javac debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
release="${javac.release}"
includeAntRuntime="false"
encoding="UTF-8"
srcdir="${src}" destdir="${build}">
<compilerarg line="${javac.compilerargs}" />
<classpath>

View File

@@ -1,48 +0,0 @@
# This is the configuration file for addressbook.
#
# Options
# *******
# All paths are realitive to i2p/addressbook. Default value for
# each option is given in parentheses.
#
# proxy_host The hostname of your I2P http proxy.
# (localhost)
#
# proxy_port The port of your I2P http proxy. (4444)
#
# master_addressbook The path to your master address book, used for local
# changes only. (myhosts.txt)
#
# router_addressbook The path to the address book used by the router.
# Contains the addresses from your master address book
# and your subscribed address books. (../userhosts.txt)
#
# private_addressbook The path to the private address book used by the router.
# This is used only by the router and SusiDNS.
# It is not published by addressbook. (../privatehosts.txt)
#
# published_addressbook The path to the copy of your address book made
# available on i2p. (../eepsite/docroot/hosts.txt)
#
# log The path to your addressbook log. (log.txt)
#
# subscriptions The path to your subscription file. (subscriptions.txt)
#
# etags The path to the etags header storage file. (etags)
#
# last_modified The path to the last-modified header storage file.
# (last_modified)
#
# update_delay The time (in hours) between each update. (1)
proxy_host=localhost
proxy_port=4444
master_addressbook=myhosts.txt
router_addressbook=../userhosts.txt
private_addressbook=../privatehosts.txt
published_addressbook=../eepsite/docroot/hosts.txt
log=log.txt
subscriptions=subscriptions.txt
etags=etags
last_modified=last_modified
update_delay=1

View File

@@ -166,6 +166,10 @@ class ConfigParser {
Map<String, String> result;
try {
result = parse(file);
// migrate
String local = result.remove("master_addressbook");
if (local != null)
result.put("local_addressbook", local);
for (Map.Entry<String, String> entry : map.entrySet()) {
if (!result.containsKey(entry.getKey()))
result.put(entry.getKey(), entry.getValue());

View File

@@ -67,8 +67,8 @@ class Daemon {
* Update the router and published address books using remote data from the
* subscribed address books listed in subscriptions.
*
* @param master
* The master AddressBook. This address book is never
* @param local
* The local AddressBook. This address book is never
* overwritten, so it is safe for the user to write to.
* It is only merged to the published addressbook.
* May be null.
@@ -87,7 +87,7 @@ class Daemon {
* The log to write changes and conflicts to.
* May be null.
*/
public static void update(AddressBook master, AddressBook router,
public static void update(AddressBook local, AddressBook router,
File published, SubscriptionList subscriptions, Log log) {
for (AddressBook book : subscriptions) {
// yes, the EepGet fetch() is done in next()
@@ -95,8 +95,8 @@ class Daemon {
}
router.write();
if (published != null) {
if (master != null)
router.merge(master, true, null);
if (local != null)
router.merge(local, true, null);
router.write(published);
}
subscriptions.write();
@@ -105,7 +105,7 @@ class Daemon {
/**
* Update the router and published address books using remote data from the
* subscribed address books listed in subscriptions.
* Merging of the "master" addressbook is NOT supported.
* Merging of the "local" addressbook is NOT supported.
*
* @param router
* The NamingService to update, generally the root NamingService from the context.
@@ -751,17 +751,17 @@ class Daemon {
if (Boolean.parseBoolean(settings.get("update_direct"))) {
// Direct hosts.txt access
File routerFile = new File(home, settings.get("router_addressbook"));
AddressBook master;
AddressBook local;
if (should_publish) {
File masterFile = new File(home, settings.get("master_addressbook"));
master = new AddressBook(masterFile);
File localFile = new File(home, settings.get("local_addressbook"));
local = new AddressBook(localFile);
} else {
master = null;
local = null;
}
AddressBook router = new AddressBook(routerFile);
update(master, router, published, subscriptions, log);
update(local, router, published, subscriptions, log);
} else {
// Naming service - no merging of master to router and published is supported.
// Naming service - no merging of local to router and published is supported.
update(getNamingService(settings.get("naming_service")), published, subscriptions, log);
}
}
@@ -841,7 +841,7 @@ class Daemon {
Map<String, String> defaultSettings = new HashMap<String, String>();
defaultSettings.put("proxy_host", "127.0.0.1");
defaultSettings.put("proxy_port", "4444");
defaultSettings.put("master_addressbook", "../userhosts.txt");
defaultSettings.put("local_addressbook", "../userhosts.txt");
defaultSettings.put("router_addressbook", "../hosts.txt");
defaultSettings.put("published_addressbook", "../eepsite/docroot/hosts.txt");
defaultSettings.put("should_publish", "false");
@@ -856,10 +856,10 @@ class Daemon {
if (!homeFile.exists()) {
boolean created = homeFile.mkdirs();
if (created)
System.out.println("INFO: Addressbook directory " + homeFile.getName() + " created");
else
System.out.println("ERROR: Addressbook directory " + homeFile.getName() + " could not be created");
if (!created)
System.out.println("ERROR: Addressbook directory " + homeFile.getAbsolutePath() + " could not be created");
//else
// System.out.println("INFO: Addressbook directory " + homeFile.getAbsolutePath() + " created");
}
File settingsFile = new File(homeFile, settingsLocation);
@@ -868,7 +868,7 @@ class Daemon {
// wait
try {
Thread.sleep(5*60*1000 + I2PAppContext.getGlobalContext().random().nextLong(5*60*1000));
// Static method, and redundent Thread.currentThread().sleep(5*60*1000);
// Static method, and redundant Thread.currentThread().sleep(5*60*1000);
} catch (InterruptedException ie) {}
while (_running) {

View File

@@ -138,9 +138,11 @@ public class BlockfileNamingService extends DummyNamingService {
private static final String VERSION = "4";
private static final String PROP_ADDED = "a";
private static final String PROP_MODDED = "m";
// See susidns
//private static final String PROP_MODDED = "m";
private static final String PROP_SOURCE = "s";
private static final String PROP_VALIDATED = "v";
// See susidns
//private static final String PROP_VALIDATED = "v";
private static final String DUMMY = "";
private static final int NEGATIVE_CACHE_SIZE = 32;
@@ -1395,6 +1397,11 @@ public class BlockfileNamingService extends DummyNamingService {
p = de.propsList.get(i);
d = de.destList.get(i);
}
out.write("# ");
out.write(key);
out.write(": ");
out.write(d.toBase32());
out.write(nl);
out.write(key);
out.write('=');
out.write(d.toBase64());
@@ -2062,9 +2069,8 @@ public class BlockfileNamingService extends DummyNamingService {
}
if (baos.size() > 65535)
throw new DataFormatException("Properties too big (65535 max): " + baos.size());
byte propBytes[] = baos.toByteArray();
DataHelper.writeLong(rawStream, 2, propBytes.length);
rawStream.write(propBytes);
DataHelper.writeLong(rawStream, 2, baos.size());
baos.writeTo(rawStream);
} else {
DataHelper.writeLong(rawStream, 2, 0);
}

View File

@@ -19,7 +19,7 @@ the API may be subject to change.
Contact I2P developers if you are considering use in another application.
Following is the original documentation copied from metanotion website.
</p>
<h1>Metanotion BlockFile Database</h1>
<h2>Metanotion BlockFile Database</h2>
<p>A 100% Java 1.3, BSD Licensed, embeddable single file database engine in 32KB. This database was designed for PDA based and J2ME applications.</p>
<h2>Table of Contents</h2>
@@ -32,18 +32,18 @@ Following is the original documentation copied from metanotion website.
<li><a href="#download">Download</a></li>
</ul>
<a name="features"><h2>Features</h2></a>
<h2 id="features">Features</h2>
<ul>
<li>100% Java 1.3. No JNI.</li>
<li>Will work with any "file" as long as you can approximate something like <a href="http://java.sun.com/j2se/1.3/docs/api/java/io/RandomAccessFile.html">java.io.RandomAccessFile</a>, you can use this.</li>
<li>BSD Licensed. Yes, this means you can use it for free in a commercial project. However, if you base some really cool mobile technology startup on this code we'll gladly accept stock options...</p>
<li>BSD Licensed. Yes, this means you can use it for free in a commercial project. However, if you base some really cool mobile technology startup on this code we'll gladly accept stock options...</li>
<li>No dependence on file API's(useful for mobile apps)</li>
<li>Small. 32KB in a JAR file. &lt;2000 lines of code.</li>
<li>Reasonably fast. This is used in an app running on a sub 200MHz StrongARM PocketPC, and quite handily deals with 70,000 records. The load time is a little slow, but its been tested with a <a href="http://java.sun.com/javame/reference/apis.jsp">CDC 1.0/Personal Profile</a> device.
</li>
</ul>
<a name="unfeatures"><h2>Unfeatures</h2></a>
<h2 id="unfeatures">Unfeatures</h2>
<p>A good, ACID database is a nice thing to work with. Unfortunately, in the goal to make this small, fast, and work with minimal dependencies, something had to give. So I list things which this database will likely never have. Of course, since it is BSD Licensed, patches welcome...</p>
<ul>
@@ -53,11 +53,11 @@ Following is the original documentation copied from metanotion website.
<li>No use of reflection or automagical serialization tricks.</li>
</ul>
<a name="future"><h2>Future Plans</h2></a>
<h2 id="future">Future Plans</h2>
<p>There are still bugs(none known...). The app that this was written for is still in testing, but we should most of the issues sorted by the time we deploy it in a few weeks(early November, 2006). Some loading speed issues on large record sets, and memory usage could still be improved. All this and feedback from other uses will direct this products evolution.</p>
<p>What is currently up here is not "1.0" code, but we will release a labeled "1.0" version once we feel happy with the state of the codebase.</p>
<a name="design"><h2>What KIND of database is this?</h2></a>
<h2 id="design">What KIND of database is this?</h2>
<p>You probably store at least part of your application data in memory in a class from the <a href="http://java.sun.com/j2se/1.4.2/docs/guide/collections/">Java Collections Framework</a>. The BlockFile database stores data in a <a href="http://en.wikipedia.org/wiki/Skip_list">Skip</a> <a href="http://eternallyconfuzzled.com/tuts/skip.html">List</a> that almost implements <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/SortedMap.html">java.util.SortedMap</a>. You can create and store as many named(with a string) SkipList in the database as you want.</p>
<p>To serialize your data, you have to either extend our SerialStreams class or implement our Serializer interface. We could have done something cool and fancy with reflection(and other cool stuff with Java 1.5), but that would probably not do the Right Thing&trade; most of the time. As you can see, there's not a lot to it anyway:</p>
<h3>net.metanotion.io.SerialStreams</h3>
@@ -91,9 +91,8 @@ public class SkipList {
public ListIterator find(Comparable key) ...
}
</pre>
</p>
<a name="examples"><h2>Examples</h2></a>
<h2 id="examples">Examples</h2>
<p>Better documentation is forthcoming, but there really isn't much to know. The entire public interface to the library is on this page. Where possible, it sticks to idiomatic Java and standard interfaces.</p>
<ul>
<li>Open a database:
@@ -146,8 +145,8 @@ public class BlockFile implements Closeable {
<p>So, in other words, if you can provide an implementation of this interface, you can use the BlockFile database. This frees it from dependence on the RandomAccessFile class. If you don't see why this is useful and you're going to be using "files" on PDA's and phone's, well, you'll understand soon enough...</p>
<a name="download"><h2>Download</h2></a>
<h3>Bugfix and cleanup Release 10/6/2006</h2>
<h2 id="download">Download</h2>
<h3>Bugfix and cleanup Release 10/6/2006</h3>
<p>An unnecessary class was removed, some junk methods removed, and a couple of JDK compatability issues were fixed. The StringBytes class was switched to ASCII(from UTF-8) for better compatibility.</p>
<ul>
<li><a href="http://www.metanotion.net/software/sandbox/BlockFile.2006.10.06.jar">BlockFile binary JAR, version 0.1.1</a></li>
@@ -160,7 +159,7 @@ public class BlockFile implements Closeable {
<li><a href="http://www.metanotion.net/software/sandbox/BlockFile.src.2006.09.28.zip">BlockFile source code</a></li>
</ul>
<hr />
<center>&copy; 2006 <a href="http://www.metanotion.net/">Metanotion Software</a></center>
<hr>
<p>&copy; 2006 <a href="http://www.metanotion.net/">Metanotion Software</a></p>
</body>
</html>

View File

@@ -1,10 +0,0 @@
# addressbook master address book. Addresses placed in this file take precidence
# over those in the router address book and in remote address books. If changes
# are made to this file, they will be reflected in the router address book and
# published address book after the next update.
#
# Do not make changes directly to the router address book, as they could be lost
# during an update.
#
# This file takes addresses in the hosts.txt format, i.e.
# example.i2p=somereallylongbase64thingAAAA

View File

@@ -1,7 +0,0 @@
# Subscription list for addressbook
#
# Each entry is an absolute url to a file in hosts.txt format.
# Since the list is checked in order, url's should be listed in order of trust.
#
http://dev.i2p/i2p/hosts.txt
http://duck.i2p/hosts.txt

View File

@@ -1,99 +0,0 @@
#Last Modified: Sun Dec 06 12:30:32 2015
# vim:syntax=apparmor et ts=8 sw=4
#include <tunables/global>
$INSTALL_PATH/{i2prouter,runplain.sh} flags=(complain) {
#include <abstractions/base>
#include <abstractions/fonts>
#include <abstractions/nameservice>
#include <abstractions/ssl_certs>
capability sys_ptrace,
network inet stream,
network inet6 stream,
$INSTALL_PATH/ r,
$INSTALL_PATH/{i2psvc,wrapper} rmix,
owner $INSTALL_PATH/** rwkm,
# Needed for Java
owner @{PROC} r,
owner @{PROC}/[0-9]*/ r,
owner @{PROC}/[0-9]*/status r,
owner @{PROC}/[0-9]*/stat r,
owner @{PROC}/[0-9]*/cmdline r,
@{PROC}/uptime r,
@{PROC}/sys/kernel/pid_max r,
/sys/devices/system/cpu/ r,
/sys/devices/system/cpu/** r,
/dev/random r,
/dev/urandom r,
@{PROC}/1/comm r,
/etc/ssl/certs/java/** r,
/etc/timezone r,
/usr/share/javazi/** r,
# Debian
/etc/java-{6,7,8}-openjdk/** r,
/usr/lib/jvm/default-java/jre/bin/java rix,
# Debian, Ubuntu, openSUSE
/usr/lib{,32,64}/jvm/java-*-openjdk-*/jre/bin/java rix,
/usr/lib{,32,64}/jvm/java-*-openjdk-*/jre/bin/keytool rix,
# Raspbian
/usr/lib/jvm/jdk-*-oracle-*/jre/bin/java rix,
/usr/lib/jvm/jdk-*-oracle-*/jre/bin/keytool rix,
# Fonts are needed for I2P's graphs
/usr/share/java/java-atk-wrapper.jar r,
# Used by some plugins
/usr/share/java/eclipse-ecj-*.jar r,
/{,var/}tmp/ rwm,
owner /{,var/}tmp/** rwkm,
/{,usr/}bin/{,b,d}ash rix,
/{,usr/}bin/cat rix,
/{,usr/}bin/cut rix,
/{,usr/}bin/dirname rix,
/{,usr/}bin/expr rix,
/{,usr/}bin/{,g,m}awk rix,
/{,usr/}bin/grep rix,
/{,usr/}bin/id rix,
/{,usr/}bin/ldd rix,
/{,usr/}bin/ls rix,
/{,usr/}bin/mkdir rix,
/{,usr/}bin/nohup rix,
/{,usr/}bin/ps rix,
/{,usr/}bin/rm rix,
/{,usr/}bin/sed rix,
/{,usr/}bin/sleep rix,
/{,usr/}bin/tail rix,
/{,usr/}bin/tr rix,
/{,usr/}bin/uname rix,
/{,usr/}bin/which rix,
@{HOME}/.java/fonts/** r,
owner @{HOME}/.i2p/ rw,
owner @{HOME}/.i2p/** rwk,
# Prevent spamming the logs
deny owner @{HOME}/.java/ wk,
deny @{HOME}/.fontconfig/ wk,
deny @{HOME}/.java/fonts/** w,
deny /dev/tty rw,
deny /dev/pts/[0-9]* rw,
deny @{PROC}/[0-9]*/fd/ r,
deny /usr/local/share/fonts/ r,
deny /var/cache/fontconfig/ wk,
# Used by some versions of the Tanuki wrapper but never used by I2P
deny /usr/share/java/hamcrest*.jar r,
deny /usr/share/java/junit*.jar r,
}

View File

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

View File

@@ -7,7 +7,8 @@
<property name="jar" value="desktopgui.jar"/>
<property name="javadoc" value="javadoc"/>
<property name="javac.compilerargs" value=""/>
<property name="javac.version" value="1.7" />
<property name="javac.version" value="1.8" />
<property name="javac.release" value="8" />
<property name="require.gettext" value="true" />
<condition property="no.bundle">
@@ -27,13 +28,16 @@
<target name="compile" depends="init">
<javac debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
release="${javac.release}"
includeAntRuntime="false"
encoding="UTF-8"
srcdir="${src}" destdir="${build}">
<compilerarg line="${javac.compilerargs}" />
<classpath>
<pathelement location="../../core/java/build/i2p.jar" />
<pathelement location="../../installer/lib/wrapper/all/wrapper.jar" />
<pathelement location="../../router/java/build/router.jar" />
<pathelement location="../systray/java/build/systray.jar" />
</classpath>
</javac>
</target>
@@ -50,7 +54,9 @@
<arg value="./bundle-messages.sh" />
</exec>
<javac source="${javac.version}" target="${javac.version}"
release="${javac.release}"
includeAntRuntime="false"
encoding="UTF-8"
srcdir="${build}/messages-src" destdir="${build}">
<compilerarg line="${javac.compilerargs}" />
</javac>
@@ -74,12 +80,14 @@
<!-- set if unset -->
<property name="workspace.changes.tr" value="" />
<!-- ideal for linux: 24x24, but transparency doesn't work -->
<copy tofile="${build}/desktopgui/resources/images/logo.png" file="../../installer/resources/themes/console/images/itoopie_xsm.png" />
<copy tofile="${build}/desktopgui/resources/images/logo.png" file="../../apps/routerconsole/jsp/themes/console/images/itoopie_xsm.png" />
<copy todir="${build}/desktopgui/resources/images" file="images/itoopie_black_24.png" />
<copy todir="${build}/desktopgui/resources/images" file="images/itoopie_white_24.png" />
<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}" />

7
apps/desktopgui/bundle-messages.sh Normal file → Executable file
View 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
@@ -105,12 +106,12 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."
msgfmt -V | grep -q '0\.19'
msgfmt -V | grep -q -E ' 0\.((19)|[2-9])'
if [ $? -ne 0 ]
then
# slow way
# convert to class files in build
msgfmt --java --statistics -r $CLASS -l $LG -d build $i
msgfmt --java2 --statistics -r $CLASS -l $LG -d build $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
@@ -128,7 +129,7 @@ do
TDY=$TD2/net/i2p/desktopgui
rm -rf $TD
mkdir -p $TD $TDY
msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
msgfmt --java2 --statistics --source -r $CLASS -l $LG -d $TD $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"

View File

@@ -0,0 +1,94 @@
# I2P
# Copyright (C) 2009 The I2P Project
# This file is distributed under the same license as the desktopgui package.
# To contribute translations, see http://www.i2p2.de/newdevelopers
#
# Translators:
# kaze kaze <kaze@rlab.be>, 2017
msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-25 12:29+0000\n"
"PO-Revision-Date: 2017-11-16 15:29+0000\n"
"Last-Translator: kaze kaze <kaze@rlab.be>\n"
"Language-Team: Spanish (Argentina) (http://www.transifex.com/otf/I2P/language/es_AR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: es_AR\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:31
#: src/net/i2p/desktopgui/ExternalTrayManager.java:59
msgid "Start I2P"
msgstr "Iniciando I2P..."
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
msgid "I2P is starting!"
msgstr "I2P esta iniciando!"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
msgid "Starting"
msgstr "Iniciando"
#: src/net/i2p/desktopgui/InternalTrayManager.java:55
#: src/net/i2p/desktopgui/InternalTrayManager.java:207
msgid "Launch I2P Browser"
msgstr "Lanzar el Navegador I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:76
#: src/net/i2p/desktopgui/InternalTrayManager.java:228
msgid "Configure I2P System Tray"
msgstr "Configurar la Bandeja de Sistema de I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:77
#: src/net/i2p/desktopgui/InternalTrayManager.java:229
msgid "Disable"
msgstr "Deshabilitar"
#: src/net/i2p/desktopgui/InternalTrayManager.java:93
#: src/net/i2p/desktopgui/InternalTrayManager.java:245
msgid "Restart I2P"
msgstr "Riniciar I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:110
#: src/net/i2p/desktopgui/InternalTrayManager.java:262
msgid "Stop I2P"
msgstr "Detener I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:126
#: src/net/i2p/desktopgui/InternalTrayManager.java:278
msgid "Restart I2P Immediately"
msgstr " Reiniciar I2P inmediatamente "
#: src/net/i2p/desktopgui/InternalTrayManager.java:143
#: src/net/i2p/desktopgui/InternalTrayManager.java:295
msgid "Stop I2P Immediately"
msgstr " Detener I2P inmediatamente "
#: src/net/i2p/desktopgui/InternalTrayManager.java:157
#: src/net/i2p/desktopgui/InternalTrayManager.java:309
msgid "Cancel I2P Shutdown"
msgstr "Cancelar el Apagado de I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:363
#, java-format
msgid "Shutdown in {0}"
msgstr "Apagar en {0}"
#: src/net/i2p/desktopgui/InternalTrayManager.java:365
msgid "Shutdown imminent"
msgstr "Apagado inminente"
#. status translations are in the console bundle
#: src/net/i2p/desktopgui/InternalTrayManager.java:370
msgid "Network"
msgstr "Red"
#. Windows typically has tooltips; Linux (at least Ubuntu) doesn't
#: src/net/i2p/desktopgui/TrayManager.java:63
msgid "I2P: Right-click for menu"
msgstr "I2P Clic derecho para el menú"

View File

@@ -6,19 +6,20 @@
# Translators:
# Amir H. Firouzian, 2017
# NoProfile, 2016
# Reza Ghasemi, 2019
msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-25 12:29+0000\n"
"PO-Revision-Date: 2018-01-05 02:54+0000\n"
"Last-Translator: Amir H. Firouzian\n"
"PO-Revision-Date: 2019-07-02 14:46+0000\n"
"Last-Translator: Reza Ghasemi\n"
"Language-Team: Persian (http://www.transifex.com/otf/I2P/language/fa/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fa\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:31
#: src/net/i2p/desktopgui/ExternalTrayManager.java:59
@@ -53,7 +54,7 @@ msgstr "غیرفعال کن"
#: src/net/i2p/desktopgui/InternalTrayManager.java:93
#: src/net/i2p/desktopgui/InternalTrayManager.java:245
msgid "Restart I2P"
msgstr ""
msgstr "راه اندازی مجدد I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:110
#: src/net/i2p/desktopgui/InternalTrayManager.java:262
@@ -63,17 +64,17 @@ msgstr "توقف I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:126
#: src/net/i2p/desktopgui/InternalTrayManager.java:278
msgid "Restart I2P Immediately"
msgstr ""
msgstr "راه اندازی مجدد I2P بلافاصله"
#: src/net/i2p/desktopgui/InternalTrayManager.java:143
#: src/net/i2p/desktopgui/InternalTrayManager.java:295
msgid "Stop I2P Immediately"
msgstr ""
msgstr "توقف I2P بلافاصله"
#: src/net/i2p/desktopgui/InternalTrayManager.java:157
#: src/net/i2p/desktopgui/InternalTrayManager.java:309
msgid "Cancel I2P Shutdown"
msgstr ""
msgstr "لغو خاموش کردن I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:363
#, java-format
@@ -87,7 +88,7 @@ msgstr ""
#. status translations are in the console bundle
#: src/net/i2p/desktopgui/InternalTrayManager.java:370
msgid "Network"
msgstr ""
msgstr "شبکه"
#. Windows typically has tooltips; Linux (at least Ubuntu) doesn't
#: src/net/i2p/desktopgui/TrayManager.java:63

View File

@@ -4,12 +4,13 @@
# To contribute translations, see http://www.i2p2.de/newdevelopers
#
# Translators:
# AO <ao@localizationlab.org>, 2019
# blabla <blabla@trash-mail.com>, 2011
# Boxoa590, 2013
# ducki2p <ducki2p@gmail.com>, 2011
# foo <foo@bar>, 2009
# French language coordinator <french.coordinator@rbox.me>, 2017
# French language coordinator <french.coordinator@rbox.me>, 2017
# AO <ao@localizationlab.org>, 2017
# AO <ao@localizationlab.org>, 2017
# Boxoa590, 2013
# Towinet, 2016
msgid ""
@@ -17,8 +18,8 @@ msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-25 12:29+0000\n"
"PO-Revision-Date: 2017-10-25 17:51+0000\n"
"Last-Translator: French language coordinator <french.coordinator@rbox.me>\n"
"PO-Revision-Date: 2019-12-03 16:10+0000\n"
"Last-Translator: AO <ao@localizationlab.org>\n"
"Language-Team: French (http://www.transifex.com/otf/I2P/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -34,7 +35,7 @@ msgstr "Démarrer I2P"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
msgid "I2P is starting!"
msgstr "I2P démarre !"
msgstr "I2P démarre!"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
@@ -98,4 +99,4 @@ msgstr "Réseau"
#. Windows typically has tooltips; Linux (at least Ubuntu) doesn't
#: src/net/i2p/desktopgui/TrayManager.java:63
msgid "I2P: Right-click for menu"
msgstr "I2P : clic droit pour obtenir le menu"
msgstr "I2P : clic droit pour obtenir le menu"

View File

@@ -0,0 +1,94 @@
# I2P
# Copyright (C) 2009 The I2P Project
# This file is distributed under the same license as the desktopgui package.
# To contribute translations, see http://www.i2p2.de/newdevelopers
#
# Translators:
# Zagros <zagros21@cmail.nu>, 2020
msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-25 12:29+0000\n"
"PO-Revision-Date: 2020-09-23 21:02+0000\n"
"Last-Translator: Zagros <zagros21@cmail.nu>\n"
"Language-Team: Kurdish (http://www.transifex.com/otf/I2P/language/ku/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ku\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:31
#: src/net/i2p/desktopgui/ExternalTrayManager.java:59
msgid "Start I2P"
msgstr "I2P بەکاربخە"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
msgid "I2P is starting!"
msgstr "وا I2P دەستپێدەکات!"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
msgid "Starting"
msgstr "دەستپێکردن"
#: src/net/i2p/desktopgui/InternalTrayManager.java:55
#: src/net/i2p/desktopgui/InternalTrayManager.java:207
msgid "Launch I2P Browser"
msgstr "وێبگەڕی I2P بکەوە"
#: src/net/i2p/desktopgui/InternalTrayManager.java:76
#: src/net/i2p/desktopgui/InternalTrayManager.java:228
msgid "Configure I2P System Tray"
msgstr ""
#: src/net/i2p/desktopgui/InternalTrayManager.java:77
#: src/net/i2p/desktopgui/InternalTrayManager.java:229
msgid "Disable"
msgstr "ناچالاکبکە"
#: src/net/i2p/desktopgui/InternalTrayManager.java:93
#: src/net/i2p/desktopgui/InternalTrayManager.java:245
msgid "Restart I2P"
msgstr "I2P بەکاربخەوە"
#: src/net/i2p/desktopgui/InternalTrayManager.java:110
#: src/net/i2p/desktopgui/InternalTrayManager.java:262
msgid "Stop I2P"
msgstr "I2P بوەستێنە"
#: src/net/i2p/desktopgui/InternalTrayManager.java:126
#: src/net/i2p/desktopgui/InternalTrayManager.java:278
msgid "Restart I2P Immediately"
msgstr "دەستبەجێ I2P بەکاربخەوە"
#: src/net/i2p/desktopgui/InternalTrayManager.java:143
#: src/net/i2p/desktopgui/InternalTrayManager.java:295
msgid "Stop I2P Immediately"
msgstr "دەستبەجێ I2P بوەستێنە"
#: src/net/i2p/desktopgui/InternalTrayManager.java:157
#: src/net/i2p/desktopgui/InternalTrayManager.java:309
msgid "Cancel I2P Shutdown"
msgstr "کووژاندنەوە I2P هەڵبوەشێنەوە"
#: src/net/i2p/desktopgui/InternalTrayManager.java:363
#, java-format
msgid "Shutdown in {0}"
msgstr "دەکووژێتەوە لە {0}"
#: src/net/i2p/desktopgui/InternalTrayManager.java:365
msgid "Shutdown imminent"
msgstr "دەستبەجێ کووژانەوە"
#. status translations are in the console bundle
#: src/net/i2p/desktopgui/InternalTrayManager.java:370
msgid "Network"
msgstr "ڕایەڵە"
#. Windows typically has tooltips; Linux (at least Ubuntu) doesn't
#: src/net/i2p/desktopgui/TrayManager.java:63
msgid "I2P: Right-click for menu"
msgstr "I2P: کرتەی ڕاست بکە بۆ لیستەکان"

View File

@@ -10,8 +10,8 @@ msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-25 12:29+0000\n"
"PO-Revision-Date: 2017-06-30 21:32+0000\n"
"Last-Translator: zzzi2p\n"
"PO-Revision-Date: 2019-05-01 07:33+0000\n"
"Last-Translator: Giovanni Pellerano <giovanni.pellerano@evilaliv3.org>\n"
"Language-Team: Malagasy (http://www.transifex.com/otf/I2P/language/mg/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -47,7 +47,7 @@ msgstr ""
#: src/net/i2p/desktopgui/InternalTrayManager.java:77
#: src/net/i2p/desktopgui/InternalTrayManager.java:229
msgid "Disable"
msgstr ""
msgstr "Désactiver"
#: src/net/i2p/desktopgui/InternalTrayManager.java:93
#: src/net/i2p/desktopgui/InternalTrayManager.java:245

View File

@@ -4,14 +4,14 @@
# To contribute translations, see http://www.i2p2.de/newdevelopers
#
# Translators:
# Besnik <besnik@programeshqip.org>, 2016
# Besnik <besnik@programeshqip.org>, 2016,2019
# Shpetim <shpetim@privacysolutions.no>, 2014
msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-25 12:29+0000\n"
"PO-Revision-Date: 2017-06-30 21:32+0000\n"
"PO-Revision-Date: 2019-01-10 14:28+0000\n"
"Last-Translator: Besnik <besnik@programeshqip.org>\n"
"Language-Team: Albanian (http://www.transifex.com/otf/I2P/language/sq/)\n"
"MIME-Version: 1.0\n"
@@ -92,4 +92,4 @@ msgstr "Rrjet"
#. Windows typically has tooltips; Linux (at least Ubuntu) doesn't
#: src/net/i2p/desktopgui/TrayManager.java:63
msgid "I2P: Right-click for menu"
msgstr "I2P: Djathtas-klikoni për menu"
msgstr "I2P: Djathtasklikoni për menu"

View File

@@ -0,0 +1,94 @@
# I2P
# Copyright (C) 2009 The I2P Project
# This file is distributed under the same license as the desktopgui package.
# To contribute translations, see http://www.i2p2.de/newdevelopers
#
# Translators:
# Slobodan Simić <slsimic@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-25 12:29+0000\n"
"PO-Revision-Date: 2019-07-11 00:36+0000\n"
"Last-Translator: Aleksa Ristić\n"
"Language-Team: Serbian (http://www.transifex.com/otf/I2P/language/sr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sr\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:31
#: src/net/i2p/desktopgui/ExternalTrayManager.java:59
msgid "Start I2P"
msgstr "Покрени И2П"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
msgid "I2P is starting!"
msgstr "И2П се покреће!"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
msgid "Starting"
msgstr "Покрећем"
#: src/net/i2p/desktopgui/InternalTrayManager.java:55
#: src/net/i2p/desktopgui/InternalTrayManager.java:207
msgid "Launch I2P Browser"
msgstr "Покрени И2П прегледач"
#: src/net/i2p/desktopgui/InternalTrayManager.java:76
#: src/net/i2p/desktopgui/InternalTrayManager.java:228
msgid "Configure I2P System Tray"
msgstr "Подеси И2П системску касету"
#: src/net/i2p/desktopgui/InternalTrayManager.java:77
#: src/net/i2p/desktopgui/InternalTrayManager.java:229
msgid "Disable"
msgstr "Искључи"
#: src/net/i2p/desktopgui/InternalTrayManager.java:93
#: src/net/i2p/desktopgui/InternalTrayManager.java:245
msgid "Restart I2P"
msgstr "Поново покрени И2П"
#: src/net/i2p/desktopgui/InternalTrayManager.java:110
#: src/net/i2p/desktopgui/InternalTrayManager.java:262
msgid "Stop I2P"
msgstr "Заустави И2П"
#: src/net/i2p/desktopgui/InternalTrayManager.java:126
#: src/net/i2p/desktopgui/InternalTrayManager.java:278
msgid "Restart I2P Immediately"
msgstr "Рестартуј И2П одмах"
#: src/net/i2p/desktopgui/InternalTrayManager.java:143
#: src/net/i2p/desktopgui/InternalTrayManager.java:295
msgid "Stop I2P Immediately"
msgstr "Заустави И2П одмах"
#: src/net/i2p/desktopgui/InternalTrayManager.java:157
#: src/net/i2p/desktopgui/InternalTrayManager.java:309
msgid "Cancel I2P Shutdown"
msgstr "Откажи И2П гашење"
#: src/net/i2p/desktopgui/InternalTrayManager.java:363
#, java-format
msgid "Shutdown in {0}"
msgstr "Гашење за {0}"
#: src/net/i2p/desktopgui/InternalTrayManager.java:365
msgid "Shutdown imminent"
msgstr "Гашење неизбежно"
#. status translations are in the console bundle
#: src/net/i2p/desktopgui/InternalTrayManager.java:370
msgid "Network"
msgstr "Мрежа"
#. Windows typically has tooltips; Linux (at least Ubuntu) doesn't
#: src/net/i2p/desktopgui/TrayManager.java:63
msgid "I2P: Right-click for menu"
msgstr "И2П: десни клик за мени"

View File

@@ -0,0 +1,94 @@
# I2P
# Copyright (C) 2009 The I2P Project
# This file is distributed under the same license as the desktopgui package.
# To contribute translations, see http://www.i2p2.de/newdevelopers
#
# Translators:
# Alperen Yavuz <mingyu@yaani.com>, 2020
msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-25 12:29+0000\n"
"PO-Revision-Date: 2020-08-26 20:48+0000\n"
"Last-Translator: Alperen Yavuz <mingyu@yaani.com>\n"
"Language-Team: Turkmen (http://www.transifex.com/otf/I2P/language/tk/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: tk\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:31
#: src/net/i2p/desktopgui/ExternalTrayManager.java:59
msgid "Start I2P"
msgstr "I2P başlaň"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
msgid "I2P is starting!"
msgstr "I2P başlaýar!"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
msgid "Starting"
msgstr "Başlamak"
#: src/net/i2p/desktopgui/InternalTrayManager.java:55
#: src/net/i2p/desktopgui/InternalTrayManager.java:207
msgid "Launch I2P Browser"
msgstr "I2P brauzerini işe giriziň"
#: src/net/i2p/desktopgui/InternalTrayManager.java:76
#: src/net/i2p/desktopgui/InternalTrayManager.java:228
msgid "Configure I2P System Tray"
msgstr "I2P ulgam lýubkasyny sazlaň"
#: src/net/i2p/desktopgui/InternalTrayManager.java:77
#: src/net/i2p/desktopgui/InternalTrayManager.java:229
msgid "Disable"
msgstr "Öçüriň"
#: src/net/i2p/desktopgui/InternalTrayManager.java:93
#: src/net/i2p/desktopgui/InternalTrayManager.java:245
msgid "Restart I2P"
msgstr "I2P-i täzeden açyň"
#: src/net/i2p/desktopgui/InternalTrayManager.java:110
#: src/net/i2p/desktopgui/InternalTrayManager.java:262
msgid "Stop I2P"
msgstr "I2P bes et"
#: src/net/i2p/desktopgui/InternalTrayManager.java:126
#: src/net/i2p/desktopgui/InternalTrayManager.java:278
msgid "Restart I2P Immediately"
msgstr "I2P derrew täzeden açyň"
#: src/net/i2p/desktopgui/InternalTrayManager.java:143
#: src/net/i2p/desktopgui/InternalTrayManager.java:295
msgid "Stop I2P Immediately"
msgstr "Derrew I2P duruzyň"
#: src/net/i2p/desktopgui/InternalTrayManager.java:157
#: src/net/i2p/desktopgui/InternalTrayManager.java:309
msgid "Cancel I2P Shutdown"
msgstr "I2P ýapmagy ýatyryň"
#: src/net/i2p/desktopgui/InternalTrayManager.java:363
#, java-format
msgid "Shutdown in {0}"
msgstr "{0} in ýapmak"
#: src/net/i2p/desktopgui/InternalTrayManager.java:365
msgid "Shutdown imminent"
msgstr "Öçürmek ýakyn"
#. status translations are in the console bundle
#: src/net/i2p/desktopgui/InternalTrayManager.java:370
msgid "Network"
msgstr "Tor"
#. Windows typically has tooltips; Linux (at least Ubuntu) doesn't
#: src/net/i2p/desktopgui/TrayManager.java:63
msgid "I2P: Right-click for menu"
msgstr "I2P: Menýu üçin sag basyň"

View File

@@ -6,14 +6,14 @@
# Translators:
# ducki2p <ducki2p@gmail.com>, 2011
# walking <walking@i2pmail.org>, 2011
# YF <yfdyh000@gmail.com>, 2016
# YFdyh000 <yfdyh000@gmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-25 12:29+0000\n"
"PO-Revision-Date: 2017-06-30 21:32+0000\n"
"Last-Translator: YF <yfdyh000@gmail.com>\n"
"PO-Revision-Date: 2019-06-20 03:18+0000\n"
"Last-Translator: Beta Ba <linsui555@gmail.com>\n"
"Language-Team: Chinese (China) (http://www.transifex.com/otf/I2P/language/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -39,7 +39,7 @@ msgstr "正在启动"
#: src/net/i2p/desktopgui/InternalTrayManager.java:55
#: src/net/i2p/desktopgui/InternalTrayManager.java:207
msgid "Launch I2P Browser"
msgstr "正在启动I2P浏览器"
msgstr "启动 I2P 浏览器"
#: src/net/i2p/desktopgui/InternalTrayManager.java:76
#: src/net/i2p/desktopgui/InternalTrayManager.java:228

View File

@@ -0,0 +1,94 @@
# I2P
# Copyright (C) 2009 The I2P Project
# This file is distributed under the same license as the desktopgui package.
# To contribute translations, see http://www.i2p2.de/newdevelopers
#
# Translators:
# 黃彥儒 <r1235613@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-25 12:29+0000\n"
"PO-Revision-Date: 2018-10-04 00:43+0000\n"
"Last-Translator: erinm\n"
"Language-Team: Chinese (Taiwan) (http://www.transifex.com/otf/I2P/language/zh_TW/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_TW\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:31
#: src/net/i2p/desktopgui/ExternalTrayManager.java:59
msgid "Start I2P"
msgstr "啟動I2P"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
msgid "I2P is starting!"
msgstr "I2P已啟動"
#: src/net/i2p/desktopgui/ExternalTrayManager.java:44
#: src/net/i2p/desktopgui/ExternalTrayManager.java:72
msgid "Starting"
msgstr "啟動中"
#: src/net/i2p/desktopgui/InternalTrayManager.java:55
#: src/net/i2p/desktopgui/InternalTrayManager.java:207
msgid "Launch I2P Browser"
msgstr "開啟I2P瀏覽器"
#: src/net/i2p/desktopgui/InternalTrayManager.java:76
#: src/net/i2p/desktopgui/InternalTrayManager.java:228
msgid "Configure I2P System Tray"
msgstr "設定I2P系統文件夾"
#: src/net/i2p/desktopgui/InternalTrayManager.java:77
#: src/net/i2p/desktopgui/InternalTrayManager.java:229
msgid "Disable"
msgstr "停用"
#: src/net/i2p/desktopgui/InternalTrayManager.java:93
#: src/net/i2p/desktopgui/InternalTrayManager.java:245
msgid "Restart I2P"
msgstr "重啟I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:110
#: src/net/i2p/desktopgui/InternalTrayManager.java:262
msgid "Stop I2P"
msgstr "停止I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:126
#: src/net/i2p/desktopgui/InternalTrayManager.java:278
msgid "Restart I2P Immediately"
msgstr "強制重啟I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:143
#: src/net/i2p/desktopgui/InternalTrayManager.java:295
msgid "Stop I2P Immediately"
msgstr "強制終止I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:157
#: src/net/i2p/desktopgui/InternalTrayManager.java:309
msgid "Cancel I2P Shutdown"
msgstr "取消停止I2P"
#: src/net/i2p/desktopgui/InternalTrayManager.java:363
#, java-format
msgid "Shutdown in {0}"
msgstr "關閉於 {0}"
#: src/net/i2p/desktopgui/InternalTrayManager.java:365
msgid "Shutdown imminent"
msgstr "強制關閉"
#. status translations are in the console bundle
#: src/net/i2p/desktopgui/InternalTrayManager.java:370
msgid "Network"
msgstr "網路"
#. Windows typically has tooltips; Linux (at least Ubuntu) doesn't
#: src/net/i2p/desktopgui/TrayManager.java:63
msgid "I2P: Right-click for menu"
msgstr "I2P右鍵開啟選單"

View File

@@ -6,16 +6,15 @@ import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.SwingWorker;
import net.i2p.apps.systray.UrlLauncher;
import net.i2p.data.DataHelper;
import net.i2p.desktopgui.router.RouterManager;
import net.i2p.desktopgui.util.BrowseException;
import net.i2p.desktopgui.util.I2PDesktop;
import net.i2p.router.RouterContext;
import net.i2p.util.Log;
import net.i2p.util.PortMapper;
@@ -433,15 +432,16 @@ class InternalTrayManager extends TrayManager {
* and launch the browser at it.
*
* Modified from I2PTunnelHTTPClientBase.
* TODO perhaps move this to a new PortMapper method.
*
* @since 0.9.26
*/
private void launchBrowser() {
// null args ok
UrlLauncher launcher = new UrlLauncher(_context, null, null);
String url = _context.portMapper().getConsoleURL();
try {
I2PDesktop.browse(url);
} catch (BrowseException e1) {
launcher.openUrl(url);
} catch (IOException e1) {
log.log(Log.WARN, "Failed to open browser!", e1);
}
}

View File

@@ -17,7 +17,6 @@ import net.i2p.app.ClientAppManager;
import net.i2p.app.ClientAppState;
import static net.i2p.app.ClientAppState.*;
import net.i2p.desktopgui.router.RouterManager;
import net.i2p.desktopgui.util.*;
import net.i2p.router.RouterContext;
import net.i2p.router.app.RouterApp;
import net.i2p.util.Log;

View File

@@ -1,23 +0,0 @@
package net.i2p.desktopgui.util;
public class BrowseException extends Exception {
private static final long serialVersionUID = 1L;
public BrowseException() {
super();
}
public BrowseException(String s) {
super(s);
}
public BrowseException(String s, Throwable t) {
super(s, t);
}
public BrowseException(Throwable t) {
super(t);
}
}

View File

@@ -1,27 +0,0 @@
package net.i2p.desktopgui.util;
import java.awt.Desktop;
import java.awt.Desktop.Action;
import java.net.URI;
public class I2PDesktop {
public static void browse(String url) throws BrowseException {
if(Desktop.isDesktopSupported()) {
Desktop desktop = Desktop.getDesktop();
if(desktop.isSupported(Action.BROWSE)) {
try {
desktop.browse(new URI(url));
} catch (Exception e) {
throw new BrowseException();
}
}
else {
throw new BrowseException();
}
}
else {
throw new BrowseException();
}
}
}

153
apps/i2pcontrol/build.xml Normal file
View File

@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="source">
<property name="i2pbase" value="../.."/>
<property name="i2plib" value="${i2pbase}/build"/>
<property name="jettylib" value="${i2pbase}/apps/jetty/jettylib"/>
<property name="wrapperlib" value="${i2pbase}/installer/lib/wrapper/all"/>
<!--
Supports four build options:
1) war (jsonrpc.war) for running under the console
2) jar (i2pcontrol.jar) for starting and running on its own Jetty instance,
no console dependency
3) socketJar (i2pcontrol.jar) for running on a ServerSocket (JSON splitting),
no Jetty dependency (Work in progress)
4) TODO xxxjar with bundled, small non-Jetty server, similar to I2PTunnelHTTPClient?
-->
<path id="cp">
<pathelement location="${i2plib}/i2p.jar" />
<pathelement location="${i2plib}/router.jar" />
<pathelement location="${jettylib}/org.mortbay.jetty.jar" />
<pathelement location="${jettylib}/javax.servlet.jar" />
<pathelement location="${jettylib}/jetty-servlet.jar" />
<pathelement location="${wrapperlib}/wrapper.jar" />
<!-- following jar only present for debian builds -->
<pathelement location="../../core/java/build/json-simple.jar" />
</path>
<path id="cpSocket">
<pathelement location="${i2plib}/i2p.jar" />
<pathelement location="${i2plib}/router.jar" />
<!-- TODO get rid of wraper dependency also -->
<pathelement location="${wrapperlib}/wrapper.jar" />
<!-- following jar only present for debian builds -->
<pathelement location="../../core/java/build/json-simple.jar" />
</path>
<target name="all" depends="clean, build" />
<target name="build" depends="jar" />
<condition property="depend.available">
<typefound name="depend" />
</condition>
<target name="builddep" if="depend.available">
<depend
cache="${i2pbase}/build"
srcdir="./java"
classpath="${cp}"
destdir="./build/obj" >
</depend>
</target>
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.8" />
<property name="javac.release" value="8" />
<target name="compile" depends="builddep" >
<mkdir dir="./build" />
<mkdir dir="./build/obj" />
<javac
srcdir="./java"
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
release="${javac.release}"
includeAntRuntime="false"
encoding="UTF-8"
destdir="./build/obj"
classpath="${cp}">
<compilerarg line="${javac.compilerargs}" />
<classpath refid="cp"/>
</javac>
</target>
<!--
More TODO here. jsonrpc2 lib uses MessageContext which depends on servlet
-->
<target name="compileSocketJar" depends="builddep" >
<mkdir dir="./build" />
<mkdir dir="./build/obj" />
<javac
sourcepath=""
srcdir="./java"
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
release="${javac.release}"
includeAntRuntime="false"
encoding="UTF-8"
destdir="./build/obj"
classpath="${cpSocket}">
<compilerarg line="${javac.compilerargs}" />
<classpath refid="cpSocket" />
<exclude name="**/I2PControlController.java" />
<exclude name="**/HostCheckHandler.java" />
<exclude name="**/JSONRPC2Servlet.java" />
</javac>
</target>
<target name="jar" depends="compile">
<!-- set if unset -->
<property name="workspace.changes.tr" value="" />
<jar destfile="build/i2pcontrol.jar" basedir="./build/obj" includes="**/*.class" >
<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}" />
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
<attribute name="X-Compile-Source-JDK" value="${javac.version}" />
<attribute name="X-Compile-Target-JDK" value="${javac.version}" />
</manifest>
</jar>
</target>
<target name="socketJar" depends="compileSocketJar">
<!-- set if unset -->
<property name="workspace.changes.tr" value="" />
<jar destfile="build/i2pcontrol.jar" basedir="./build/obj" includes="**/*.class" >
<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}" />
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
<attribute name="X-Compile-Source-JDK" value="${javac.version}" />
<attribute name="X-Compile-Target-JDK" value="${javac.version}" />
</manifest>
</jar>
</target>
<target name="war" depends="compile" >
<!-- set if unset -->
<property name="workspace.changes.tr" value="" />
<war destfile="build/jsonrpc.war" webxml="web.xml" >
<classes dir="./build/obj" excludes="net/i2p/i2pcontrol/I2PControlController.class net/i2p/i2pcontrol/HostCheckHandler.class net/i2p/i2pcontrol/SocketController*.class" />
<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}" />
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
<attribute name="X-Compile-Source-JDK" value="${javac.version}" />
<attribute name="X-Compile-Target-JDK" value="${javac.version}" />
</manifest>
</war>
</target>
<target name="clean">
<delete dir="./build" />
</target>
<target name="cleandep" depends="clean">
</target>
<target name="distclean" depends="clean">
</target>
</project>

View File

@@ -0,0 +1,274 @@
package com.thetransactioncompany.jsonrpc2;
import org.json.simple.JsonObject;
/**
* Represents a JSON-RPC 2.0 error that occurred during the processing of a
* request. This class is immutable.
*
* <p>The protocol expects error objects to be structured like this:
*
* <ul>
* <li>{@code code} An integer that indicates the error type.
* <li>{@code message} A string providing a short description of the
* error. The message should be limited to a concise single sentence.
* <li>{@code data} Additional information, which may be omitted. Its
* contents is entirely defined by the application.
* </ul>
*
* <p>Note that the "Error" word in the class name was put there solely to
* comply with the parlance of the JSON-RPC spec. This class doesn't inherit
* from {@code java.lang.Error}. It's a regular subclass of
* {@code java.lang.Exception} and, if thrown, it's to indicate a condition
* that a reasonable application might want to catch.
*
* <p>This class also includes convenient final static instances for all
* standard JSON-RPC 2.0 errors:
*
* <ul>
* <li>{@link #PARSE_ERROR} JSON parse error (-32700)
* <li>{@link #INVALID_REQUEST} Invalid JSON-RPC 2.0 Request (-32600)
* <li>{@link #METHOD_NOT_FOUND} Method not found (-32601)
* <li>{@link #INVALID_PARAMS} Invalid parameters (-32602)
* <li>{@link #INTERNAL_ERROR} Internal error (-32603)
* </ul>
*
* <p>Note that the range -32099..-32000 is reserved for additional server
* errors.
*
* <p id="map">The mapping between JSON and Java entities (as defined by the
* underlying JSON Smart library):
* <pre>
* true|false &lt;---&gt; java.lang.Boolean
* number &lt;---&gt; java.lang.Number
* string &lt;---&gt; java.lang.String
* array &lt;---&gt; java.util.List
* object &lt;---&gt; java.util.Map
* null &lt;---&gt; null
* </pre>
*
* @author Vladimir Dzhuvinov
*/
public class JSONRPC2Error extends Exception {
/**
* Serial version UID.
*/
private static final long serialVersionUID = 4682571044532698806L;
/**
* JSON parse error (-32700).
*/
public static final JSONRPC2Error PARSE_ERROR = new JSONRPC2Error(-32700, "JSON parse error");
/**
* Invalid JSON-RPC 2.0 request error (-32600).
*/
public static final JSONRPC2Error INVALID_REQUEST = new JSONRPC2Error(-32600, "Invalid request");
/**
* Method not found error (-32601).
*/
public static final JSONRPC2Error METHOD_NOT_FOUND = new JSONRPC2Error(-32601, "Method not found");
/**
* Invalid parameters error (-32602).
*/
public static final JSONRPC2Error INVALID_PARAMS = new JSONRPC2Error(-32602, "Invalid parameters");
/**
* Internal JSON-RPC 2.0 error (-32603).
*/
public static final JSONRPC2Error INTERNAL_ERROR = new JSONRPC2Error(-32603, "Internal error");
/**
* The error code.
*/
private final int code;
/**
* The optional error data.
*/
private final Object data;
/**
* Appends the specified string to the message of a JSON-RPC 2.0 error.
*
* @param err The JSON-RPC 2.0 error. Must not be {@code null}.
* @param apx The string to append to the original error message.
*
* @return A new JSON-RPC 2.0 error with the appended message.
*/
@Deprecated
public static JSONRPC2Error appendMessage(final JSONRPC2Error err, final String apx) {
return new JSONRPC2Error(err.getCode(), err.getMessage() + apx, err.getData());
}
/**
* Sets the specified data to a JSON-RPC 2.0 error.
*
* @param err The JSON-RPC 2.0 error to have its data field set. Must
* not be {@code null}.
* @param data Optional error data, must <a href="#map">map</a> to a
* valid JSON type.
*
* @return A new JSON-RPC 2.0 error with the set data.
*/
@Deprecated
public static JSONRPC2Error setData(final JSONRPC2Error err, final Object data) {
return new JSONRPC2Error(err.getCode(), err.getMessage(), data);
}
/**
* Creates a new JSON-RPC 2.0 error with the specified code and
* message. The optional data is omitted.
*
* @param code The error code (standard pre-defined or
* application-specific).
* @param message The error message.
*/
public JSONRPC2Error(int code, String message) {
this(code, message, null);
}
/**
* Creates a new JSON-RPC 2.0 error with the specified code,
* message and data.
*
* @param code The error code (standard pre-defined or
* application-specific).
* @param message The error message.
* @param data Optional error data, must <a href="#map">map</a>
* to a valid JSON type.
*/
public JSONRPC2Error(int code, String message, Object data) {
super(message);
this.code = code;
this.data = data;
}
/**
* Gets the JSON-RPC 2.0 error code.
*
* @return The error code.
*/
public int getCode() {
return code;
}
/**
* Gets the JSON-RPC 2.0 error data.
*
* @return The error data, {@code null} if none was specified.
*/
public Object getData() {
return data;
}
/**
* Sets the specified data to a JSON-RPC 2.0 error.
*
* @param data Optional error data, must <a href="#map">map</a> to a
* valid JSON type.
*
* @return A new JSON-RPC 2.0 error with the set data.
*/
public JSONRPC2Error setData(final Object data) {
return new JSONRPC2Error(code, getMessage(), data);
}
/**
* Appends the specified string to the message of this JSON-RPC 2.0
* error.
*
* @param apx The string to append to the original error message.
*
* @return A new JSON-RPC 2.0 error with the appended message.
*/
public JSONRPC2Error appendMessage(final String apx) {
return new JSONRPC2Error(code, getMessage() + apx, data);
}
/**
* @see #toJSONObject
*/
@Deprecated
public JsonObject toJSON() {
return toJSONObject();
}
/**
* Returns a JSON object representation of this JSON-RPC 2.0 error.
*
* @return A JSON object representing this error object.
*/
public JsonObject toJSONObject() {
JsonObject out = new JsonObject();
out.put("code", code);
out.put("message", super.getMessage());
if (data != null)
out.put("data", data);
return out;
}
/**
* Serialises the error object to a JSON string.
*
* @return A JSON-encoded string representing this error object.
*/
@Override
public String toString() {
return toJSON().toString();
}
/**
* Overrides {@code Object.equals()}.
*
* @param object The object to compare to.
*
* @return {@code true} if both objects are instances if this class and
* their error codes are identical, {@code false} if not.
*/
@Override
public boolean equals(Object object) {
return object != null &&
object instanceof JSONRPC2Error &&
code == ((JSONRPC2Error)object).getCode();
}
}

View File

@@ -0,0 +1,250 @@
package com.thetransactioncompany.jsonrpc2;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.json.simple.JsonObject;
/**
* The base abstract class for JSON-RPC 2.0 requests, notifications and
* responses. Provides common methods for parsing (from JSON string) and
* serialisation (to JSON string) of these three message types.
*
* <p>Example parsing and serialisation back to JSON:
*
* <pre>
* String jsonString = "{\"method\":\"progressNotify\",\"params\":[\"75%\"],\"jsonrpc\":\"2.0\"}";
*
* JSONRPC2Message message = null;
*
* // parse
* try {
* message = JSONRPC2Message.parse(jsonString);
* } catch (JSONRPC2ParseException e) {
* // handle parse exception
* }
*
* if (message instanceof JSONRPC2Request)
* System.out.println("The message is a request");
* else if (message instanceof JSONRPC2Notification)
* System.out.println("The message is a notification");
* else if (message instanceof JSONRPC2Response)
* System.out.println("The message is a response");
*
* // serialise back to JSON string
* System.out.println(message);
*
* </pre>
*
* <p id="map">The mapping between JSON and Java entities (as defined by the
* underlying JSON Smart library):
*
* <pre>
* true|false &lt;---&gt; java.lang.Boolean
* number &lt;---&gt; java.lang.Number
* string &lt;---&gt; java.lang.String
* array &lt;---&gt; java.util.List
* object &lt;---&gt; java.util.Map
* null &lt;---&gt; null
* </pre>
*
* @author Vladimir Dzhuvinov
*/
public abstract class JSONRPC2Message {
/**
* Map of non-standard JSON-RPC 2.0 message attributes, {@code null} if
* none.
*/
private Map <String,Object> nonStdAttributes = null;
/**
* Provides common parsing of JSON-RPC 2.0 requests, notifications
* and responses. Use this method if you don't know which type of
* JSON-RPC message the input JSON string represents.
*
* <p>Batched requests / notifications are not supported.
*
* <p>This method is thread-safe.
*
* <p>If you are certain about the message type use the dedicated
* {@link JSONRPC2Request#parse}, {@link JSONRPC2Notification#parse}
* or {@link JSONRPC2Response#parse} methods. They are more efficient
* and provide a more detailed parse error reporting.
*
* <p>The member order of parsed JSON objects will not be preserved
* (for efficiency reasons) and the JSON-RPC 2.0 version field must be
* set to "2.0". To change this behaviour check the optional {@link
* #parse(String,boolean,boolean)} method.
*
* @param jsonString A JSON string representing a JSON-RPC 2.0 request,
* notification or response, UTF-8 encoded. Must not
* be {@code null}.
*
* @return An instance of {@link JSONRPC2Request},
* {@link JSONRPC2Notification} or {@link JSONRPC2Response}.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Message parse(final String jsonString)
throws JSONRPC2ParseException {
return parse(jsonString, false, false);
}
/**
* Provides common parsing of JSON-RPC 2.0 requests, notifications
* and responses. Use this method if you don't know which type of
* JSON-RPC message the input string represents.
*
* <p>Batched requests / notifications are not supported.
*
* <p>This method is thread-safe.
*
* <p>If you are certain about the message type use the dedicated
* {@link JSONRPC2Request#parse}, {@link JSONRPC2Notification#parse}
* or {@link JSONRPC2Response#parse} methods. They are more efficient
* and provide a more detailed parse error reporting.
*
* @param jsonString A JSON string representing a JSON-RPC 2.0
* request, notification or response, UTF-8
* encoded. Must not be {@code null}.
* @param preserveOrder If {@code true} the member order of JSON objects
* in parameters and results must be preserved.
* @param ignoreVersion If {@code true} the {@code "jsonrpc":"2.0"}
* version field in the JSON-RPC 2.0 message will
* not be checked.
*
* @return An instance of {@link JSONRPC2Request},
* {@link JSONRPC2Notification} or {@link JSONRPC2Response}.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Message parse(final String jsonString, final boolean preserveOrder, final boolean ignoreVersion)
throws JSONRPC2ParseException {
JSONRPC2Parser parser = new JSONRPC2Parser(preserveOrder, ignoreVersion);
return parser.parseJSONRPC2Message(jsonString);
}
/**
* Appends a non-standard attribute to this JSON-RPC 2.0 message. This is
* done by adding a new member (key / value pair) to the top level JSON
* object representing the message.
*
* <p>You may use this method to add meta and debugging attributes,
* such as the request processing time, to a JSON-RPC 2.0 message.
*
* @param name The attribute name. Must not conflict with the existing
* "method", "id", "params", "result", "error" and "jsonrpc"
* attributes reserved by the JSON-RPC 2.0 protocol, else
* an {@code IllegalArgumentException} will be thrown. Must
* not be {@code null} either.
* @param value The attribute value. Must be of type String, boolean,
* number, List, Map or null, else an
* {@code IllegalArgumentException} will be thrown.
*/
public void appendNonStdAttribute(final String name, final Object value) {
// Name check
if (name == null ||
name.equals("method") ||
name.equals("id") ||
name.equals("params") ||
name.equals("result") ||
name.equals("error") ||
name.equals("jsonrpc") )
throw new IllegalArgumentException("Non-standard attribute name violation");
// Value check
if ( value != null &&
! (value instanceof Boolean) &&
! (value instanceof Number) &&
! (value instanceof String) &&
! (value instanceof List) &&
! (value instanceof Map) )
throw new IllegalArgumentException("Illegal non-standard attribute value, must map to a valid JSON type");
if (nonStdAttributes == null)
nonStdAttributes = new HashMap<String,Object>();
nonStdAttributes.put(name, value);
}
/**
* Retrieves a non-standard JSON-RPC 2.0 message attribute.
*
* @param name The name of the non-standard attribute to retrieve. Must
* not be {@code null}.
*
* @return The value of the non-standard attribute (may also be
* {@code null}, {@code null} if not found.
*/
public Object getNonStdAttribute(final String name) {
if (nonStdAttributes == null)
return null;
return nonStdAttributes.get(name);
}
/**
* Retrieves the non-standard JSON-RPC 2.0 message attributes.
*
* @return The non-standard attributes as a map, {@code null} if none.
*/
public Map<String,Object> getNonStdAttributes() {
return nonStdAttributes;
}
/**
* Returns a JSON object representing this JSON-RPC 2.0 message.
*
* @return The JSON object.
*/
public abstract JsonObject toJSONObject();
/**
* Returns a JSON string representation of this JSON-RPC 2.0 message.
*
* @see #toString
*
* @return The JSON object string representing this JSON-RPC 2.0
* message.
*/
public String toJSONString() {
return toString();
}
/**
* Serialises this JSON-RPC 2.0 message to a JSON object string.
*
* @return The JSON object string representing this JSON-RPC 2.0
* message.
*/
@Override
public String toString() {
return toJSONObject().toJson();
}
}

View File

@@ -0,0 +1,448 @@
package com.thetransactioncompany.jsonrpc2;
import java.util.List;
import java.util.Map;
import org.json.simple.JsonObject;
/**
* Represents a JSON-RPC 2.0 notification.
*
* <p>Notifications provide a mean for calling a remote procedure without
* generating a response. Note that notifications are inherently unreliable
* as no confirmation is sent back to the caller.
*
* <p>Notifications have the same JSON structure as requests, except that they
* lack an identifier:
* <ul>
* <li>{@code method} The name of the remote method to call.
* <li>{@code params} The required method parameters (if any), which can
* be packed into a JSON array or object.
* <li>{@code jsonrpc} A string indicating the JSON-RPC protocol version
* set to "2.0".
* </ul>
*
* <p>Here is a sample JSON-RPC 2.0 notification string:
*
* <pre>
* {
* "method" : "progressNotify",
* "params" : ["75%"],
* "jsonrpc" : "2.0"
* }
* </pre>
*
* <p>This class provides two methods to obtain a request object:
* <ul>
* <li>Pass a JSON-RPC 2.0 notification string to the static
* {@link #parse} method, or
* <li>Invoke one of the constructors with the appropriate arguments.
* </ul>
*
* <p>Example 1: Parsing a notification string:
*
* <pre>
* String jsonString = "{\"method\":\"progressNotify\",\"params\":[\"75%\"],\"jsonrpc\":\"2.0\"}";
*
* JSONRPC2Notification notification = null;
*
* try {
* notification = JSONRPC2Notification.parse(jsonString);
*
* } catch (JSONRPC2ParseException e) {
* // handle exception
* }
* </pre>
*
* <p>Example 2: Recreating the above request:
*
* <pre>
* String method = "progressNotify";
* List&lt;Object&gt; params = new Vector&lt;Object&gt;();
* params.add("75%");
*
* JSONRPC2Notification notification = new JSONRPC2Notification(method, params);
*
* System.out.println(notification);
* </pre>
*
* <p id="map">The mapping between JSON and Java entities (as defined by the
* underlying JSON Smart library):
*
* <pre>
* true|false &lt;---&gt; java.lang.Boolean
* number &lt;---&gt; java.lang.Number
* string &lt;---&gt; java.lang.String
* array &lt;---&gt; java.util.List
* object &lt;---&gt; java.util.Map
* null &lt;---&gt; null
* </pre>
*
* @author Vladimir Dzhuvinov
*/
public class JSONRPC2Notification extends JSONRPC2Message {
/**
* The requested method name.
*/
private String method;
/**
* The positional parameters, {@code null} if none.
*/
private List<Object> positionalParams;
/**
* The named parameters, {@code null} if none.
*/
private Map<String,Object> namedParams;
/**
* Parses a JSON-RPC 2.0 notification string. This method is
* thread-safe.
*
* @param jsonString The JSON-RPC 2.0 notification string, UTF-8
* encoded. Must not be {@code null}.
*
* @return The corresponding JSON-RPC 2.0 notification object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Notification parse(final String jsonString)
throws JSONRPC2ParseException {
return parse(jsonString, false, false, false);
}
/**
* Parses a JSON-RPC 2.0 notification string. This method is
* thread-safe.
*
* @param jsonString The JSON-RPC 2.0 notification string, UTF-8
* encoded. Must not be {@code null}.
* @param preserveOrder {@code true} to preserve the order of JSON
* object members in parameters.
*
* @return The corresponding JSON-RPC 2.0 notification object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Notification parse(final String jsonString,
final boolean preserveOrder)
throws JSONRPC2ParseException {
return parse(jsonString, preserveOrder, false, false);
}
/**
* Parses a JSON-RPC 2.0 notification string. This method is
* thread-safe.
*
* @param jsonString The JSON-RPC 2.0 notification string, UTF-8
* encoded. Must not be {@code null}.
* @param preserveOrder {@code true} to preserve the order of JSON
* object members in parameters.
* @param ignoreVersion {@code true} to skip a check of the
* {@code "jsonrpc":"2.0"} version attribute in the
* JSON-RPC 2.0 message.
*
* @return The corresponding JSON-RPC 2.0 notification object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Notification parse(final String jsonString,
final boolean preserveOrder,
final boolean ignoreVersion)
throws JSONRPC2ParseException {
return parse(jsonString, preserveOrder, ignoreVersion, false);
}
/**
* Parses a JSON-RPC 2.0 notification string. This method is
* thread-safe.
*
* @param jsonString The JSON-RPC 2.0 notification string,
* UTF-8 encoded. Must not be {@code null}.
* @param preserveOrder {@code true} to preserve the order of
* JSON object members in parameters.
* @param ignoreVersion {@code true} to skip a check of the
* {@code "jsonrpc":"2.0"} version
* attribute in the JSON-RPC 2.0 message.
* @param parseNonStdAttributes {@code true} to parse non-standard
* attributes found in the JSON-RPC 2.0
* message.
*
* @return The corresponding JSON-RPC 2.0 notification object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Notification parse(final String jsonString,
final boolean preserveOrder,
final boolean ignoreVersion,
final boolean parseNonStdAttributes)
throws JSONRPC2ParseException {
JSONRPC2Parser parser = new JSONRPC2Parser(preserveOrder, ignoreVersion, parseNonStdAttributes);
return parser.parseJSONRPC2Notification(jsonString);
}
/**
* Constructs a new JSON-RPC 2.0 notification with no parameters.
*
* @param method The name of the requested method. Must not be
* {@code null}.
*/
public JSONRPC2Notification(final String method) {
setMethod(method);
setParams(null);
}
/**
* Constructs a new JSON-RPC 2.0 notification with positional (JSON
* array) parameters.
*
* @param method The name of the requested method. Must not
* be {@code null}.
* @param positionalParams The positional (JSON array) parameters,
* {@code null} if none.
*/
public JSONRPC2Notification(final String method,
final List<Object> positionalParams) {
setMethod(method);
setPositionalParams(positionalParams);
}
/**
* Constructs a new JSON-RPC 2.0 notification with named (JSON object)
* parameters.
*
* @param method The name of the requested method.
* @param namedParams The named (JSON object) parameters, {@code null}
* if none.
*/
public JSONRPC2Notification(final String method,
final Map <String,Object> namedParams) {
setMethod(method);
setNamedParams(namedParams);
}
/**
* Gets the name of the requested method.
*
* @return The method name.
*/
public String getMethod() {
return method;
}
/**
* Sets the name of the requested method.
*
* @param method The method name. Must not be {@code null}.
*/
public void setMethod(final String method) {
// The method name is mandatory
if (method == null)
throw new IllegalArgumentException("The method name must not be null");
this.method = method;
}
/**
* Gets the parameters type ({@link JSONRPC2ParamsType#ARRAY positional},
* {@link JSONRPC2ParamsType#OBJECT named} or
* {@link JSONRPC2ParamsType#NO_PARAMS none}).
*
* @return The parameters type.
*/
public JSONRPC2ParamsType getParamsType() {
if (positionalParams == null && namedParams == null)
return JSONRPC2ParamsType.NO_PARAMS;
if (positionalParams != null)
return JSONRPC2ParamsType.ARRAY;
if (namedParams != null)
return JSONRPC2ParamsType.OBJECT;
else
return JSONRPC2ParamsType.NO_PARAMS;
}
/**
* Gets the notification parameters.
*
* <p>This method was deprecated in version 1.30. Use
* {@link #getPositionalParams} or {@link #getNamedParams} instead.
*
* @return The parameters as {@code List&lt;Object&gt;} for positional
* (JSON array), {@code Map&lt;String,Object&gt;} for named
* (JSON object), or {@code null} if none.
*/
@Deprecated
public Object getParams() {
switch (getParamsType()) {
case ARRAY:
return positionalParams;
case OBJECT:
return namedParams;
default:
return null;
}
}
/**
* Gets the positional (JSON array) parameters.
*
* @since 1.30
*
* @return The positional (JSON array) parameters, {@code null} if none
* or named.
*/
public List<Object> getPositionalParams() {
return positionalParams;
}
/**
* Gets the named parameters.
*
* @since 1.30
*
* @return The named (JSON object) parameters, {@code null} if none or
* positional.
*/
public Map<String,Object> getNamedParams() {
return namedParams;
}
/**
* Sets the notification parameters.
*
* <p>This method was deprecated in version 1.30. Use
* {@link #setPositionalParams} or {@link #setNamedParams} instead.
*
* @param params The parameters. For positional (JSON array) pass a
* {@code List&lt;Object&gt;}. For named (JSON object)
* pass a {@code Map&lt;String,Object&gt;}. If there are
* no parameters pass {@code null}.
*/
@Deprecated
@SuppressWarnings("unchecked")
public void setParams(final Object params) {
if (params == null) {
positionalParams = null;
namedParams = null;
} else if (params instanceof List) {
positionalParams = (List<Object>) params;
} else if (params instanceof Map) {
namedParams = (Map<String, Object>) params;
} else {
throw new IllegalArgumentException("The notification parameters must be of type List, Map or null");
}
}
/**
* Sets the positional (JSON array) request parameters.
*
* @since 1.30
*
* @param positionalParams The positional (JSON array) request
* parameters, {@code null} if none.
*/
public void setPositionalParams(final List<Object> positionalParams) {
if (positionalParams == null)
return;
this.positionalParams = positionalParams;
}
/**
* Sets the named (JSON object) request parameters.
*
* @since 1.30
*
* @param namedParams The named (JSON object) request parameters,
* {@code null} if none.
*/
public void setNamedParams(final Map<String,Object> namedParams) {
if (namedParams == null)
return;
this.namedParams = namedParams;
}
@Override
public JsonObject toJSONObject() {
JsonObject notf = new JsonObject();
notf.put("method", method);
// The params can be omitted if none
switch (getParamsType()) {
case ARRAY:
notf.put("params", positionalParams);
break;
case OBJECT:
notf.put("params", namedParams);
break;
}
notf.put("jsonrpc", "2.0");
Map <String,Object> nonStdAttributes = getNonStdAttributes();
if (nonStdAttributes != null) {
for (final Map.Entry<String,Object> attr: nonStdAttributes.entrySet())
notf.put(attr.getKey(), attr.getValue());
}
return notf;
}
}

View File

@@ -0,0 +1,37 @@
package com.thetransactioncompany.jsonrpc2;
/**
* Enumeration of the three parameter types in JSON-RPC 2.0 requests and
* notifications.
*
* <ul>
* <li>{@link #NO_PARAMS} The method takes no parameters.
* <li>{@link #ARRAY} The method takes positional parameters, packed as a
* JSON array, e.g. {@code ["val1", "val2", ...]}.
* <li>{@link #OBJECT} The method takes named parameters, packed as a JSON
* object, e.g. {@code {"param1":"val1", "param2":"val2", ...}}.
* </ul>
*
* @author Vladimir Dzhuvinov
*/
public enum JSONRPC2ParamsType {
/**
* No parameters.
*/
NO_PARAMS,
/**
* Positional parameters, packed as a JSON array.
*/
ARRAY,
/**
* Named parameters, packed as a JSON object.
*/
OBJECT
}

View File

@@ -0,0 +1,113 @@
package com.thetransactioncompany.jsonrpc2;
/**
* Thrown to indicate an exception during the parsing of a JSON-RPC 2.0
* message string.
*
* @author Vladimir Dzhuvinov
*/
public class JSONRPC2ParseException extends Exception {
/**
* Serial version UID.
*/
private static final long serialVersionUID = 3376608778436136410L;
/**
* Indicates a parse exception caused by a JSON message not conforming
* to the JSON-RPC 2.0 protocol.
*/
public static final int PROTOCOL = 0;
/**
* Indicates a parse exception caused by invalid JSON.
*/
public static final int JSON = 1;
/**
* The parse exception cause type. Default is {@link #PROTOCOL}.
*/
private int causeType = PROTOCOL;
/**
* The string that could't be parsed.
*/
private String unparsableString = null;
/**
* Creates a new parse exception with the specified message. The cause
* type is set to {@link #PROTOCOL}.
*
* @param message The exception message.
*/
public JSONRPC2ParseException(final String message) {
super(message);
}
/**
* Creates a new parse exception with the specified message and the
* original string that didn't parse. The cause type is set to
* {@link #PROTOCOL}.
*
* @param message The exception message.
* @param unparsableString The unparsable string.
*/
public JSONRPC2ParseException(final String message, final String unparsableString) {
super(message);
this.unparsableString = unparsableString;
}
/**
* Creates a new parse exception with the specified message, cause type
* and the original string that didn't parse.
*
* @param message The exception message.
* @param causeType The exception cause type, either
* {@link #PROTOCOL} or {@link #JSON}.
* @param unparsableString The unparsable string.
*/
public JSONRPC2ParseException(final String message, final int causeType, final String unparsableString) {
super(message);
if (causeType != PROTOCOL && causeType != JSON)
throw new IllegalArgumentException("Cause type must be either PROTOCOL or JSON");
this.causeType = causeType;
this.unparsableString = unparsableString;
}
/**
* Gets the parse exception cause type.
*
* @return The cause type, either {@link #PROTOCOL} or {@link #JSON}.
*/
public int getCauseType() {
return causeType;
}
/**
* Gets original string that caused the parse exception (if specified).
*
* @return The string that didn't parse, {@code null} if none.
*/
public String getUnparsableString() {
return unparsableString;
}
}

View File

@@ -0,0 +1,640 @@
package com.thetransactioncompany.jsonrpc2;
import java.util.List;
import java.util.Map;
import org.json.simple.Jsoner;
import org.json.simple.DeserializationException;
/**
* Parses JSON-RPC 2.0 request, notification and response messages.
*
* <p>Parsing of batched requests / notifications is not supported.
*
* <p>This class is not thread-safe. A parser instance should not be used by
* more than one thread unless properly synchronised. Alternatively, you may
* use the thread-safe {@link JSONRPC2Message#parse} and its sister methods.
*
* <p>Example:
*
* <pre>
* String jsonString = "{\"method\":\"makePayment\"," +
* "\"params\":{\"recipient\":\"Penny Adams\",\"amount\":175.05}," +
* "\"id\":\"0001\","+
* "\"jsonrpc\":\"2.0\"}";
*
* JSONRPC2Request req = null;
*
* JSONRPC2Parser parser = new JSONRPC2Parser();
*
* try {
* req = parser.parseJSONRPC2Request(jsonString);
*
* } catch (JSONRPC2ParseException e) {
* // handle exception
* }
*
* </pre>
*
* <p id="map">The mapping between JSON and Java entities (as defined by the
* underlying JSON Smart library):
*
* <pre>
* true|false &lt;---&gt; java.lang.Boolean
* number &lt;---&gt; java.lang.Number
* string &lt;---&gt; java.lang.String
* array &lt;---&gt; java.util.List
* object &lt;---&gt; java.util.Map
* null &lt;---&gt; null
* </pre>
*
* @author Vladimir Dzhuvinov
*/
public class JSONRPC2Parser {
/**
* If {@code true} the order of the parsed JSON object members must be
* preserved.
*/
private boolean preserveOrder;
/**
* If {@code true} the {@code "jsonrpc":"2.0"} version attribute in the
* JSON-RPC 2.0 message must be ignored during parsing.
*/
private boolean ignoreVersion;
/**
* If {@code true} non-standard JSON-RPC 2.0 message attributes must be
* parsed too.
*/
private boolean parseNonStdAttributes;
/**
* Creates a new JSON-RPC 2.0 message parser.
*
* <p>The member order of parsed JSON objects in parameters and results
* will not be preserved; strict checking of the 2.0 JSON-RPC version
* attribute will be enforced; non-standard message attributes will be
* ignored. Check the other constructors if you want to specify
* different behaviour.
*/
public JSONRPC2Parser() {
this(false, false, false);
}
/**
* Creates a new JSON-RPC 2.0 message parser.
*
* <p>Strict checking of the 2.0 JSON-RPC version attribute will be
* enforced; non-standard message attributes will be ignored. Check the
* other constructors if you want to specify different behaviour.
*
* @param preserveOrder If {@code true} the member order of JSON objects
* in parameters and results will be preserved.
*/
public JSONRPC2Parser(final boolean preserveOrder) {
this(preserveOrder, false, false);
}
/**
* Creates a new JSON-RPC 2.0 message parser.
*
* <p>Non-standard message attributes will be ignored. Check the other
* constructors if you want to specify different behaviour.
*
* @param preserveOrder If {@code true} the member order of JSON objects
* in parameters and results will be preserved.
* @param ignoreVersion If {@code true} the {@code "jsonrpc":"2.0"}
* version attribute in the JSON-RPC 2.0 message
* will not be checked.
*/
public JSONRPC2Parser(final boolean preserveOrder,
final boolean ignoreVersion) {
this(preserveOrder, ignoreVersion, false);
}
/**
* Creates a new JSON-RPC 2.0 message parser.
*
* <p>This constructor allows full specification of the available
* JSON-RPC message parsing properties.
*
* @param preserveOrder If {@code true} the member order of JSON
* objects in parameters and results will
* be preserved.
* @param ignoreVersion If {@code true} the
* {@code "jsonrpc":"2.0"} version
* attribute in the JSON-RPC 2.0 message
* will not be checked.
* @param parseNonStdAttributes If {@code true} non-standard attributes
* found in the JSON-RPC 2.0 messages will
* be parsed too.
*/
public JSONRPC2Parser(final boolean preserveOrder,
final boolean ignoreVersion,
final boolean parseNonStdAttributes) {
this.preserveOrder = preserveOrder;
this.ignoreVersion = ignoreVersion;
this.parseNonStdAttributes = parseNonStdAttributes;
}
/**
* Parses a JSON object string. Provides the initial parsing of
* JSON-RPC 2.0 messages. The member order of JSON objects will be
* preserved if {@link #preserveOrder} is set to {@code true}.
*
* @param jsonString The JSON string to parse. Must not be
* {@code null}.
*
* @return The parsed JSON object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
@SuppressWarnings("unchecked")
private Map<String,Object> parseJSONObject(final String jsonString)
throws JSONRPC2ParseException {
if (jsonString.trim().length()==0)
throw new JSONRPC2ParseException("Invalid JSON: Empty string",
JSONRPC2ParseException.JSON,
jsonString);
Object json;
// Parse the JSON string
try {
json = Jsoner.deserialize(jsonString);
} catch (DeserializationException e) {
// Terse message, do not include full parse exception message
throw new JSONRPC2ParseException("Invalid JSON",
JSONRPC2ParseException.JSON,
jsonString);
}
if (json instanceof List)
throw new JSONRPC2ParseException("JSON-RPC 2.0 batch requests/notifications not supported", jsonString);
if (! (json instanceof Map))
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 message: Message must be a JSON object", jsonString);
return (Map<String,Object>)json;
}
/**
* Ensures the specified parameter is a {@code String} object set to
* "2.0". This method is intended to check the "jsonrpc" attribute
* during parsing of JSON-RPC messages.
*
* @param version The version parameter. Must not be {@code null}.
* @param jsonString The original JSON string.
*
* @throws JSONRPC2ParseException If the parameter is not a string that
* equals "2.0".
*/
private static void ensureVersion2(final Object version, final String jsonString)
throws JSONRPC2ParseException {
if (version == null)
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0: Version string missing", jsonString);
else if (! (version instanceof String))
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0: Version not a JSON string", jsonString);
else if (! version.equals("2.0"))
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0: Version must be \"2.0\"", jsonString);
}
/**
* Provides common parsing of JSON-RPC 2.0 requests, notifications
* and responses. Use this method if you don't know which type of
* JSON-RPC message the input string represents.
*
* <p>If a particular message type is expected use the dedicated
* {@link #parseJSONRPC2Request}, {@link #parseJSONRPC2Notification}
* and {@link #parseJSONRPC2Response} methods. They are more efficient
* and would provide you with more detailed parse error reporting.
*
* @param jsonString A JSON string representing a JSON-RPC 2.0 request,
* notification or response, UTF-8 encoded. Must not
* be {@code null}.
*
* @return An instance of {@link JSONRPC2Request},
* {@link JSONRPC2Notification} or {@link JSONRPC2Response}.
*
* @throws JSONRPC2ParseException With detailed message if the parsing
* failed.
*/
public JSONRPC2Message parseJSONRPC2Message(final String jsonString)
throws JSONRPC2ParseException {
// Try each of the parsers until one succeeds (or all fail)
try {
return parseJSONRPC2Request(jsonString);
} catch (JSONRPC2ParseException e) {
// throw on JSON error, ignore on protocol error
if (e.getCauseType() == JSONRPC2ParseException.JSON)
throw e;
}
try {
return parseJSONRPC2Notification(jsonString);
} catch (JSONRPC2ParseException e) {
// throw on JSON error, ignore on protocol error
if (e.getCauseType() == JSONRPC2ParseException.JSON)
throw e;
}
try {
return parseJSONRPC2Response(jsonString);
} catch (JSONRPC2ParseException e) {
// throw on JSON error, ignore on protocol error
if (e.getCauseType() == JSONRPC2ParseException.JSON)
throw e;
}
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 message",
JSONRPC2ParseException.PROTOCOL,
jsonString);
}
/**
* Parses a JSON-RPC 2.0 request string.
*
* @param jsonString The JSON-RPC 2.0 request string, UTF-8 encoded.
* Must not be {@code null}.
*
* @return The corresponding JSON-RPC 2.0 request object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
@SuppressWarnings("unchecked")
public JSONRPC2Request parseJSONRPC2Request(final String jsonString)
throws JSONRPC2ParseException {
// Initial JSON object parsing
Map<String,Object> jsonObject = parseJSONObject(jsonString);
// Check for JSON-RPC version "2.0"
Object version = jsonObject.remove("jsonrpc");
if (! ignoreVersion)
ensureVersion2(version, jsonString);
// Extract method name
Object method = jsonObject.remove("method");
if (method == null)
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 request: Method name missing", jsonString);
else if (! (method instanceof String))
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 request: Method name not a JSON string", jsonString);
else if (((String)method).length() == 0)
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 request: Method name is an empty string", jsonString);
// Extract ID
if (! jsonObject.containsKey("id"))
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 request: Missing identifier", jsonString);
Object id = jsonObject.remove("id");
if ( id != null &&
!(id instanceof Number ) &&
!(id instanceof Boolean) &&
!(id instanceof String ) )
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 request: Identifier not a JSON scalar", jsonString);
// Extract params
Object params = jsonObject.remove("params");
JSONRPC2Request request;
if (params == null)
request = new JSONRPC2Request((String)method, id);
else if (params instanceof List)
request = new JSONRPC2Request((String)method, (List<Object>)params, id);
else if (params instanceof Map)
request = new JSONRPC2Request((String)method, (Map<String,Object>)params, id);
else
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 request: Method parameters have unexpected JSON type", jsonString);
// Extract remaining non-std params?
if (parseNonStdAttributes) {
for (Map.Entry<String,Object> entry: jsonObject.entrySet()) {
request.appendNonStdAttribute(entry.getKey(), entry.getValue());
}
}
return request;
}
/**
* Parses a JSON-RPC 2.0 notification string.
*
* @param jsonString The JSON-RPC 2.0 notification string, UTF-8
* encoded. Must not be {@code null}.
*
* @return The corresponding JSON-RPC 2.0 notification object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
@SuppressWarnings("unchecked")
public JSONRPC2Notification parseJSONRPC2Notification(final String jsonString)
throws JSONRPC2ParseException {
// Initial JSON object parsing
Map<String,Object> jsonObject = parseJSONObject(jsonString);
// Check for JSON-RPC version "2.0"
Object version = jsonObject.remove("jsonrpc");
if (! ignoreVersion)
ensureVersion2(version, jsonString);
// Extract method name
Object method = jsonObject.remove("method");
if (method == null)
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 notification: Method name missing", jsonString);
else if (! (method instanceof String))
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 notification: Method name not a JSON string", jsonString);
else if (((String)method).length() == 0)
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 notification: Method name is an empty string", jsonString);
// Extract params
Object params = jsonObject.get("params");
JSONRPC2Notification notification;
if (params == null)
notification = new JSONRPC2Notification((String)method);
else if (params instanceof List)
notification = new JSONRPC2Notification((String)method, (List<Object>)params);
else if (params instanceof Map)
notification = new JSONRPC2Notification((String)method, (Map<String,Object>)params);
else
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 notification: Method parameters have unexpected JSON type", jsonString);
// Extract remaining non-std params?
if (parseNonStdAttributes) {
for (Map.Entry<String,Object> entry: jsonObject.entrySet()) {
notification.appendNonStdAttribute(entry.getKey(), entry.getValue());
}
}
return notification;
}
/**
* Parses a JSON-RPC 2.0 response string.
*
* @param jsonString The JSON-RPC 2.0 response string, UTF-8 encoded.
* Must not be {@code null}.
*
* @return The corresponding JSON-RPC 2.0 response object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
@SuppressWarnings("unchecked")
public JSONRPC2Response parseJSONRPC2Response(final String jsonString)
throws JSONRPC2ParseException {
// Initial JSON object parsing
Map<String,Object> jsonObject = parseJSONObject(jsonString);
// Check for JSON-RPC version "2.0"
Object version = jsonObject.remove("jsonrpc");
if (! ignoreVersion)
ensureVersion2(version, jsonString);
// Extract request ID
Object id = jsonObject.remove("id");
if ( id != null &&
! (id instanceof Boolean) &&
! (id instanceof Number ) &&
! (id instanceof String ) )
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 response: Identifier not a JSON scalar", jsonString);
// Extract result/error and create response object
// Note: result and error are mutually exclusive
JSONRPC2Response response;
if (jsonObject.containsKey("result") && ! jsonObject.containsKey("error")) {
// Success
Object res = jsonObject.remove("result");
response = new JSONRPC2Response(res, id);
}
else if (! jsonObject.containsKey("result") && jsonObject.containsKey("error")) {
// Error JSON object
Object errorJSON = jsonObject.remove("error");
if (errorJSON == null)
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 response: Missing error object", jsonString);
if (! (errorJSON instanceof Map))
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 response: Error object not a JSON object");
Map<String,Object> error = (Map<String,Object>)errorJSON;
int errorCode;
try {
errorCode = ((Number)error.get("code")).intValue();
} catch (Exception e) {
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 response: Error code missing or not an integer", jsonString);
}
String errorMessage;
try {
errorMessage = (String)error.get("message");
} catch (Exception e) {
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 response: Error message missing or not a string", jsonString);
}
Object errorData = error.get("data");
response = new JSONRPC2Response(new JSONRPC2Error(errorCode, errorMessage, errorData), id);
}
else if (jsonObject.containsKey("result") && jsonObject.containsKey("error")) {
// Invalid response
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 response: You cannot have result and error at the same time", jsonString);
}
else if (! jsonObject.containsKey("result") && ! jsonObject.containsKey("error")){
// Invalid response
throw new JSONRPC2ParseException("Invalid JSON-RPC 2.0 response: Neither result nor error specified", jsonString);
}
else {
throw new AssertionError();
}
// Extract remaining non-std params?
if (parseNonStdAttributes) {
for (Map.Entry<String,Object> entry: jsonObject.entrySet()) {
response.appendNonStdAttribute(entry.getKey(), entry.getValue());
}
}
return response;
}
/**
* Controls the preservation of JSON object member order in parsed
* JSON-RPC 2.0 messages.
*
* @param preserveOrder {@code true} to preserve the order of JSON
* object members, else {@code false}.
*/
public void preserveOrder(final boolean preserveOrder) {
this.preserveOrder = preserveOrder;
}
/**
* Returns {@code true} if the order of JSON object members in parsed
* JSON-RPC 2.0 messages is preserved, else {@code false}.
*
* @return {@code true} if order is preserved, else {@code false}.
*/
public boolean preservesOrder() {
return preserveOrder;
}
/**
* Specifies whether to ignore the {@code "jsonrpc":"2.0"} version
* attribute during parsing of JSON-RPC 2.0 messages.
*
* <p>You may with to disable strict 2.0 version checking if the parsed
* JSON-RPC 2.0 messages don't include a version attribute or if you
* wish to achieve limited compatibility with older JSON-RPC protocol
* versions.
*
* @param ignore {@code true} to skip checks of the
* {@code "jsonrpc":"2.0"} version attribute in parsed
* JSON-RPC 2.0 messages, else {@code false}.
*/
public void ignoreVersion(final boolean ignore) {
ignoreVersion = ignore;
}
/**
* Returns {@code true} if the {@code "jsonrpc":"2.0"} version
* attribute in parsed JSON-RPC 2.0 messages is ignored, else
* {@code false}.
*
* @return {@code true} if the {@code "jsonrpc":"2.0"} version
* attribute in parsed JSON-RPC 2.0 messages is ignored, else
* {@code false}.
*/
public boolean ignoresVersion() {
return ignoreVersion;
}
/**
* Specifies whether to parse non-standard attributes found in JSON-RPC
* 2.0 messages.
*
* @param enable {@code true} to parse non-standard attributes, else
* {@code false}.
*/
public void parseNonStdAttributes(final boolean enable) {
parseNonStdAttributes = enable;
}
/**
* Returns {@code true} if non-standard attributes in JSON-RPC 2.0
* messages are parsed.
*
* @return {@code true} if non-standard attributes are parsed, else
* {@code false}.
*/
public boolean parsesNonStdAttributes() {
return parseNonStdAttributes;
}
}

View File

@@ -0,0 +1,507 @@
package com.thetransactioncompany.jsonrpc2;
import java.util.List;
import java.util.Map;
import org.json.simple.JsonObject;
/**
* Represents a JSON-RPC 2.0 request.
*
* <p>A request carries four pieces of data:
* <ul>
* <li>{@code method} The name of the remote method to call.
* <li>{@code params} The required method parameters (if any), which can
* be packed into a JSON array or object.
* <li>{@code id} An identifier which is echoed back to the client with
* the response.
* <li>{@code jsonrpc} A string indicating the JSON-RPC protocol version
* set to "2.0".
* </ul>
*
* <p>Here is a sample JSON-RPC 2.0 request string:
*
* <pre>
* {
* "method" : "makePayment",
* "params" : { "recipient" : "Penny Adams", "amount":175.05 },
* "id" : "0001",
* "jsonrpc" : "2.0"
* }
* </pre>
*
* <p>This class provides two methods to obtain a request object:
* <ul>
* <li>Pass a JSON-RPC 2.0 request string to the static
* {@link #parse} method, or
* <li>Invoke one of the constructors with the appropriate arguments.
* </ul>
*
* <p>Example 1: Parsing a request string:
*
* <pre>
* String jsonString = "{\"method\":\"makePayment\"," +
* "\"params\":{\"recipient\":\"Penny Adams\",\"amount\":175.05}," +
* "\"id\":\"0001\","+
* "\"jsonrpc\":\"2.0\"}";
*
* JSONRPC2Request req = null;
*
* try {
* req = JSONRPC2Request.parse(jsonString);
*
* } catch (JSONRPC2ParseException e) {
* // handle exception
* }
* </pre>
*
* <p>Example 2: Recreating the above request:
*
* <pre>
* String method = "makePayment";
* Map&lt;String,Object&gt; params = new HashMap&lt;String,Object&gt;();
* params.put("recipient", "Penny Adams");
* params.put("amount", 175.05);
* String id = "0001";
*
* JSONRPC2Request req = new JSONRPC2Request(method, params, id);
*
* System.out.println(req);
* </pre>
*
* <p id="map">The mapping between JSON and Java entities (as defined by the
* underlying JSON Smart library):
*
* <pre>
* true|false &lt;---&gt; java.lang.Boolean
* number &lt;---&gt; java.lang.Number
* string &lt;---&gt; java.lang.String
* array &lt;---&gt; java.util.List
* object &lt;---&gt; java.util.Map
* null &lt;---&gt; null
* </pre>
*
* @author Vladimir Dzhuvinov
*/
public class JSONRPC2Request extends JSONRPC2Message {
/**
* The method name.
*/
private String method;
/**
* The positional parameters, {@code null} if none.
*/
private List<Object> positionalParams;
/**
* The named parameters, {@code null} if none.
*/
private Map<String,Object> namedParams;
/**
* The request identifier.
*/
private Object id;
/**
* Parses a JSON-RPC 2.0 request string. This method is thread-safe.
*
* @param jsonString The JSON-RPC 2.0 request string, UTF-8 encoded.
* Must not be {@code null}.
*
* @return The corresponding JSON-RPC 2.0 request object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Request parse(final String jsonString)
throws JSONRPC2ParseException {
return parse(jsonString, false, false, false);
}
/**
* Parses a JSON-RPC 2.0 request string. This method is thread-safe.
*
* @param jsonString The JSON-RPC 2.0 request string, UTF-8 encoded.
* Must not be {@code null}.
* @param preserveOrder {@code true} to preserve the order of JSON
* object members in parameters.
*
* @return The corresponding JSON-RPC 2.0 request object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Request parse(final String jsonString,
final boolean preserveOrder)
throws JSONRPC2ParseException {
return parse(jsonString, preserveOrder, false, false);
}
/**
* Parses a JSON-RPC 2.0 request string. This method is thread-safe.
*
* @param jsonString The JSON-RPC 2.0 request string, UTF-8 encoded.
* Must not be {@code null}.
* @param preserveOrder {@code true} to preserve the order of JSON
* object members in parameters.
* @param ignoreVersion {@code true} to skip a check of the
* {@code "jsonrpc":"2.0"} version attribute in the
* JSON-RPC 2.0 message.
*
* @return The corresponding JSON-RPC 2.0 request object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Request parse(final String jsonString,
final boolean preserveOrder,
final boolean ignoreVersion)
throws JSONRPC2ParseException {
return parse(jsonString, preserveOrder, ignoreVersion, false);
}
/**
* Parses a JSON-RPC 2.0 request string. This method is thread-safe.
*
* @param jsonString The JSON-RPC 2.0 request string, UTF-8
* encoded. Must not be {@code null}.
* @param preserveOrder {@code true} to preserve the order of
* JSON object members in parameters.
* @param ignoreVersion {@code true} to skip a check of the
* {@code "jsonrpc":"2.0"} version
* attribute in the JSON-RPC 2.0 message.
* @param parseNonStdAttributes {@code true} to parse non-standard
* attributes found in the JSON-RPC 2.0
* message.
*
* @return The corresponding JSON-RPC 2.0 request object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Request parse(final String jsonString,
final boolean preserveOrder,
final boolean ignoreVersion,
final boolean parseNonStdAttributes)
throws JSONRPC2ParseException {
JSONRPC2Parser parser = new JSONRPC2Parser(preserveOrder,
ignoreVersion,
parseNonStdAttributes);
return parser.parseJSONRPC2Request(jsonString);
}
/**
* Constructs a new JSON-RPC 2.0 request with no parameters.
*
* @param method The name of the requested method. Must not be
* {@code null}.
* @param id The request identifier echoed back to the caller.
* The value must <a href="#map">map</a> to a JSON
* scalar ({@code null} and fractions, however, should
* be avoided).
*/
public JSONRPC2Request(final String method, final Object id) {
setMethod(method);
setID(id);
}
/**
* Constructs a new JSON-RPC 2.0 request with positional (JSON array)
* parameters.
*
* @param method The name of the requested method. Must not
* be {@code null}.
* @param positionalParams The positional (JSON array) parameters,
* {@code null} if none.
* @param id The request identifier echoed back to the
* caller. The value must <a href="#map">map</a>
* to a JSON scalar ({@code null} and
* fractions, however, should be avoided).
*/
public JSONRPC2Request(final String method,
final List<Object> positionalParams,
final Object id) {
setMethod(method);
setPositionalParams(positionalParams);
setID(id);
}
/**
* Constructs a new JSON-RPC 2.0 request with named (JSON object)
* parameters.
*
* @param method The name of the requested method.
* @param namedParams The named (JSON object) parameters, {@code null}
* if none.
* @param id The request identifier echoed back to the caller.
* The value must <a href="#map">map</a> to a JSON
* scalar ({@code null} and fractions, however,
* should be avoided).
*/
public JSONRPC2Request(final String method,
final Map <String,Object> namedParams,
final Object id) {
setMethod(method);
setNamedParams(namedParams);
setID(id);
}
/**
* Gets the name of the requested method.
*
* @return The method name.
*/
public String getMethod() {
return method;
}
/**
* Sets the name of the requested method.
*
* @param method The method name. Must not be {@code null}.
*/
public void setMethod(final String method) {
// The method name is mandatory
if (method == null)
throw new IllegalArgumentException("The method name must not be null");
this.method = method;
}
/**
* Gets the parameters type ({@link JSONRPC2ParamsType#ARRAY positional},
* {@link JSONRPC2ParamsType#OBJECT named} or
* {@link JSONRPC2ParamsType#NO_PARAMS none}).
*
* @return The parameters type.
*/
public JSONRPC2ParamsType getParamsType() {
if (positionalParams == null && namedParams == null)
return JSONRPC2ParamsType.NO_PARAMS;
if (positionalParams != null)
return JSONRPC2ParamsType.ARRAY;
if (namedParams != null)
return JSONRPC2ParamsType.OBJECT;
else
return JSONRPC2ParamsType.NO_PARAMS;
}
/**
* Gets the request parameters.
*
* <p>This method was deprecated in version 1.30. Use
* {@link #getPositionalParams} or {@link #getNamedParams} instead.
*
* @return The parameters as {@code List&lt;Object&gt;} for positional
* (JSON array), {@code Map&lt;String,Object&gt;} for named
* (JSON object), or {@code null} if none.
*/
@Deprecated
public Object getParams() {
switch (getParamsType()) {
case ARRAY:
return positionalParams;
case OBJECT:
return namedParams;
default:
return null;
}
}
/**
* Gets the positional (JSON array) parameters.
*
* @since 1.30
*
* @return The positional (JSON array) parameters, {@code null} if none
* or named.
*/
public List<Object> getPositionalParams() {
return positionalParams;
}
/**
* Gets the named parameters.
*
* @since 1.30
*
* @return The named (JSON object) parameters, {@code null} if none or
* positional.
*/
public Map<String,Object> getNamedParams() {
return namedParams;
}
/**
* Sets the request parameters.
*
* <p>This method was deprecated in version 1.30. Use
* {@link #setPositionalParams} or {@link #setNamedParams} instead.
*
* @param params The parameters. For positional (JSON array) pass a
* {@code List&lt;Object&gt;}. For named (JSON object)
* pass a {@code Map&lt;String,Object&gt;}. If there are
* no parameters pass {@code null}.
*/
@Deprecated
@SuppressWarnings("unchecked")
public void setParams(final Object params) {
if (params == null) {
positionalParams = null;
namedParams = null;
} else if (params instanceof List) {
positionalParams = (List<Object>) params;
} else if (params instanceof Map) {
namedParams = (Map<String, Object>) params;
} else {
throw new IllegalArgumentException("The request parameters must be of type List, Map or null");
}
}
/**
* Sets the positional (JSON array) request parameters.
*
* @since 1.30
*
* @param positionalParams The positional (JSON array) request
* parameters, {@code null} if none.
*/
public void setPositionalParams(final List<Object> positionalParams) {
if (positionalParams == null)
return;
this.positionalParams = positionalParams;
}
/**
* Sets the named (JSON object) request parameters.
*
* @since 1.30
*
* @param namedParams The named (JSON object) request parameters,
* {@code null} if none.
*/
public void setNamedParams(final Map<String,Object> namedParams) {
if (namedParams == null)
return;
this.namedParams = namedParams;
}
/**
* Gets the request identifier.
*
* @return The request identifier ({@code Number}, {@code Boolean},
* {@code String}) or {@code null}.
*/
public Object getID() {
return id;
}
/**
* Sets the request identifier (ID).
*
* @param id The request identifier echoed back to the caller.
* The value must <a href="#map">map</a> to a JSON
* scalar ({@code null} and fractions, however, should
* be avoided).
*/
public void setID(final Object id) {
if (id == null ||
id instanceof Boolean ||
id instanceof Number ||
id instanceof String
) {
this.id = id;
} else {
this.id = id.toString();
}
}
@Override
public JsonObject toJSONObject() {
JsonObject req = new JsonObject();
req.put("method", method);
// The params can be omitted if none
switch (getParamsType()) {
case ARRAY:
req.put("params", positionalParams);
break;
case OBJECT:
req.put("params", namedParams);
break;
}
req.put("id", id);
req.put("jsonrpc", "2.0");
Map <String,Object> nonStdAttributes = getNonStdAttributes();
if (nonStdAttributes != null) {
for (final Map.Entry<String,Object> attr: nonStdAttributes.entrySet())
req.put(attr.getKey(), attr.getValue());
}
return req;
}
}

View File

@@ -0,0 +1,414 @@
package com.thetransactioncompany.jsonrpc2;
import java.util.Map;
import org.json.simple.JsonObject;
/**
* Represents a JSON-RPC 2.0 response.
*
* <p>A response is returned to the caller after a JSON-RPC 2.0 request has
* been processed (notifications, however, don't produce a response). The
* response can take two different forms depending on the outcome:
*
* <ul>
* <li>The request was successful. The corresponding response returns
* a JSON object with the following information:
* <ul>
* <li>{@code result} The result, which can be of any JSON type
* - a number, a boolean value, a string, an array, an object
* or null.
* <li>{@code id} The request identifier which is echoed back back
* to the caller.
* <li>{@code jsonrpc} A string indicating the JSON-RPC protocol
* version set to "2.0".
* </ul>
* <li>The request failed. The returned JSON object contains:
* <ul>
* <li>{@code error} An object with:
* <ul>
* <li>{@code code} An integer indicating the error type.
* <li>{@code message} A brief error messsage.
* <li>{@code data} Optional error data.
* </ul>
* <li>{@code id} The request identifier. If it couldn't be
* determined, e.g. due to a request parse error, the ID is
* set to {@code null}.
* <li>{@code jsonrpc} A string indicating the JSON-RPC protocol
* version set to "2.0".
* </ul>
* </ul>
*
* <p>Here is an example JSON-RPC 2.0 response string where the request
* has succeeded:
*
* <pre>
* {
* "result" : true,
* "id" : "req-002",
* "jsonrpc" : "2.0"
* }
* </pre>
*
*
* <p>And here is an example JSON-RPC 2.0 response string indicating a failure:
*
* <pre>
* {
* "error" : { "code" : -32601, "message" : "Method not found" },
* "id" : "req-003",
* "jsonrpc" : "2.0"
* }
* </pre>
*
* <p>A response object is obtained either by passing a valid JSON-RPC 2.0
* response string to the static {@link #parse} method or by invoking the
* appropriate constructor.
*
* <p>Here is how parsing is done:
*
* <pre>
* String jsonString = "{\"result\":true,\"id\":\"req-002\",\"jsonrpc\":\"2.0\"}";
*
* JSONRPC2Response response = null;
*
* try {
* response = JSONRPC2Response.parse(jsonString);
*
* } catch (JSONRPC2Exception e) {
* // handle exception
* }
* </pre>
*
* <p>And here is how you can replicate the above example response strings:
*
* <pre>
* // success example
* JSONRPC2Response resp = new JSONRPC2Response(true, "req-002");
* System.out.println(resp);
*
* // failure example
* JSONRPC2Error err = new JSONRPC2Error(-32601, "Method not found");
* resp = new JSONRPC2Response(err, "req-003");
* System.out.println(resp);
*
* </pre>
*
* <p id="map">The mapping between JSON and Java entities (as defined by the
* underlying JSON Smart library):
*
* <pre>
* true|false &lt;---&gt; java.lang.Boolean
* number &lt;---&gt; java.lang.Number
* string &lt;---&gt; java.lang.String
* array &lt;---&gt; java.util.List
* object &lt;---&gt; java.util.Map
* null &lt;---&gt; null
* </pre>
*
* @author Vladimir Dzhuvinov
*/
public class JSONRPC2Response extends JSONRPC2Message {
/**
* The result.
*/
private Object result = null;
/**
* The error object.
*/
private JSONRPC2Error error = null;
/**
* The echoed request identifier.
*/
private Object id = null;
/**
* Parses a JSON-RPC 2.0 response string. This method is thread-safe.
*
* @param jsonString The JSON-RPC 2.0 response string, UTF-8 encoded.
* Must not be {@code null}.
*
* @return The corresponding JSON-RPC 2.0 response object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Response parse(final String jsonString)
throws JSONRPC2ParseException {
return parse(jsonString, false, false, false);
}
/**
* Parses a JSON-RPC 2.0 response string. This method is thread-safe.
*
* @param jsonString The JSON-RPC 2.0 response string, UTF-8 encoded.
* Must not be {@code null}.
* @param preserveOrder {@code true} to preserve the order of JSON
* object members in results.
*
* @return The corresponding JSON-RPC 2.0 response object.
*
* @throws JSONRPC2ParseException With detailed message if parsing
* failed.
*/
public static JSONRPC2Response parse(final String jsonString,
final boolean preserveOrder)
throws JSONRPC2ParseException {
return parse(jsonString, preserveOrder, false, false);
}
/**
* Parses a JSON-RPC 2.0 response string. This method is thread-safe.
*
* @param jsonString The JSON-RPC 2.0 response string, UTF-8 encoded.
* Must not be {@code null}.
* @param preserveOrder {@code true} to preserve the order of JSON
* object members in results.
* @param ignoreVersion {@code true} to skip a check of the
* {@code "jsonrpc":"2.0"} version attribute in the
* JSON-RPC 2.0 message.
*
* @return The corresponding JSON-RPC 2.0 response object.
*
* @throws JSONRPC2ParseException With detailed message if the parsing
* failed.
*/
public static JSONRPC2Response parse(final String jsonString,
final boolean preserveOrder,
final boolean ignoreVersion)
throws JSONRPC2ParseException {
return parse(jsonString, preserveOrder, ignoreVersion, false);
}
/**
* Parses a JSON-RPC 2.0 response string. This method is thread-safe.
*
* @param jsonString The JSON-RPC 2.0 response string, UTF-8
* encoded. Must not be {@code null}.
* @param preserveOrder {@code true} to preserve the order of
* JSON object members in results.
* @param ignoreVersion {@code true} to skip a check of the
* {@code "jsonrpc":"2.0"} version
* attribute in the JSON-RPC 2.0 message.
* @param parseNonStdAttributes {@code true} to parse non-standard
* attributes found in the JSON-RPC 2.0
* message.
*
* @return The corresponding JSON-RPC 2.0 response object.
*
* @throws JSONRPC2ParseException With detailed message if the parsing
* failed.
*/
public static JSONRPC2Response parse(final String jsonString,
final boolean preserveOrder,
final boolean ignoreVersion,
final boolean parseNonStdAttributes)
throws JSONRPC2ParseException {
JSONRPC2Parser parser = new JSONRPC2Parser(preserveOrder, ignoreVersion, parseNonStdAttributes);
return parser.parseJSONRPC2Response(jsonString);
}
/**
* Creates a new JSON-RPC 2.0 response to a successful request.
*
* @param result The result. The value can <a href="#map">map</a>
* to any JSON type. May be {@code null}.
* @param id The request identifier echoed back to the caller. May
* be {@code null} though not recommended.
*/
public JSONRPC2Response(final Object result, final Object id) {
setResult(result);
setID(id);
}
/**
* Creates a new JSON-RPC 2.0 response to a successful request which
* result is {@code null}.
*
* @param id The request identifier echoed back to the caller. May be
* {@code null} though not recommended.
*/
public JSONRPC2Response(final Object id) {
setResult(null);
setID(id);
}
/**
* Creates a new JSON-RPC 2.0 response to a failed request.
*
* @param error A JSON-RPC 2.0 error instance indicating the
* cause of the failure. Must not be {@code null}.
* @param id The request identifier echoed back to the caller.
* Pass a {@code null} if the request identifier couldn't
* be determined (e.g. due to a parse error).
*/
public JSONRPC2Response(final JSONRPC2Error error, final Object id) {
setError(error);
setID(id);
}
/**
* Indicates a successful JSON-RPC 2.0 request and sets the result.
* Note that if the response was previously indicating failure this
* will turn it into a response indicating success. Any previously set
* error data will be invalidated.
*
* @param result The result. The value can <a href="#map">map</a> to
* any JSON type. May be {@code null}.
*/
public void setResult(final Object result) {
// result and error are mutually exclusive
this.result = result;
this.error = null;
}
/**
* Gets the result of the request. The returned value has meaning
* only if the request was successful. Use the
* {@link #getError getError} method to check this.
*
* @return The result.
*/
public Object getResult() {
return result;
}
/**
* Indicates a failed JSON-RPC 2.0 request and sets the error details.
* Note that if the response was previously indicating success this
* will turn it into a response indicating failure. Any previously set
* result data will be invalidated.
*
* @param error A JSON-RPC 2.0 error instance indicating the cause of
* the failure. Must not be {@code null}.
*/
public void setError(final JSONRPC2Error error) {
if (error == null)
throw new IllegalArgumentException("The error object cannot be null");
// result and error are mutually exclusive
this.error = error;
this.result = null;
}
/**
* Gets the error object indicating the cause of the request failure.
* If a {@code null} is returned, the request succeeded and there was
* no error.
*
* @return A JSON-RPC 2.0 error object, {@code null} if the response
* indicates success.
*/
public JSONRPC2Error getError() {
return error;
}
/**
* A convinience method to check if the response indicates success or
* failure of the request. Alternatively, you can use the
* {@code #getError} method for this purpose.
*
* @return {@code true} if the request succeeded, {@code false} if
* there was an error.
*/
public boolean indicatesSuccess() {
return error == null;
}
/**
* Sets the request identifier echoed back to the caller.
*
* @param id The value must <a href="#map">map</a> to a JSON scalar.
* Pass a {@code null} if the request identifier couldn't
* be determined (e.g. due to a parse error).
*/
public void setID(final Object id) {
if (id == null ||
id instanceof Boolean ||
id instanceof Number ||
id instanceof String
) {
this.id = id;
} else {
this.id = id.toString();
}
}
/**
* Gets the request identifier that is echoed back to the caller.
*
* @return The request identifier. If there was an error during the
* the request retrieval (e.g. parse error) and the identifier
* couldn't be determined, the value will be {@code null}.
*/
public Object getID() {
return id;
}
@Override
public JsonObject toJSONObject() {
JsonObject out = new JsonObject();
// Result and error are mutually exclusive
if (error != null) {
out.put("error", error.toJSONObject());
}
else {
out.put("result", result);
}
out.put("id", id);
out.put("jsonrpc", "2.0");
Map <String,Object> nonStdAttributes = getNonStdAttributes();
if (nonStdAttributes != null) {
for (final Map.Entry<String,Object> attr: nonStdAttributes.entrySet())
out.put(attr.getKey(), attr.getValue());
}
return out;
}
}

View File

@@ -0,0 +1,32 @@
/**
* Classes to represent, parse and serialise JSON-RPC 2.0 requests,
* notifications and responses.
*
* <p>JSON-RPC is a protocol for
* <a href="http://en.wikipedia.org/wiki/Remote_procedure_call">remote
* procedure calls</a> (RPC) using <a href="http://www.json.org" >JSON</a>
* - encoded requests and responses. It can be easily relayed over HTTP
* and is of JavaScript origin, making it ideal for use in dynamic web
* applications in the spirit of Ajax and Web 2.0.
*
* <p>This package implements <b>version 2.0</b> of the protocol, with the
* exception of <i>batching / multicall</i>. This feature is deliberately left
* out as it tends to confuse users (judging by posts in the JSON-RPC forum).
*
* <p>See the <a href="http://www.jsonrpc.org/specification">JSON-RPC 2.0
* specification</a> for more information or write to the
* <a href="https://groups.google.com/forum/#!forum/json-rpc">user group</a> if
* you have questions.
*
* <p><b>Package dependencies:</b> The classes in this package rely on the
* {@code org.json.simple} and {@code org.json.simple.parser} packages
* (version 1.1.1 and compabile) for JSON encoding and decoding. You can obtain
* them from the <a href="http://code.google.com/p/json-smart/">JSON-Smart</a>
* website.
*
* @author Vladimir Dzhuvinov
*/
package com.thetransactioncompany.jsonrpc2;

View File

@@ -0,0 +1,263 @@
package com.thetransactioncompany.jsonrpc2.server;
import java.util.Hashtable;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Notification;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;
/**
* Dispatcher for JSON-RPC 2.0 requests and notifications. This class is
* tread-safe.
*
* <p>Use the {@code register()} methods to add a request or notification
* handler for an RPC method.
*
* <p>Use the {@code process()} methods to have an incoming request or
* notification processed by the matching handler.
*
* <p>The {@code reportProcTime()} method enables reporting of request
* processing time (in microseconds) by appending a non-standard "xProcTime"
* attribute to the resulting JSON-RPC 2.0 response message.
*
* <p>Example:
*
* <pre>
* {
* "result" : "xyz",
* "id" : 1,
* "jsonrpc" : "2.0",
* "xProcTime" : "189 us"
* }
* </pre>
*
* <p>Note: The dispatch(...) methods were deprecated in version 1.7. Use
* process(...) instead.
*
* @author Vladimir Dzhuvinov
*/
public class Dispatcher implements RequestHandler, NotificationHandler {
/**
* Hashtable of request name / handler pairs.
*/
private final Hashtable<String,RequestHandler> requestHandlers;
/**
* Hashtable of notification name / handler pairs.
*/
private final Hashtable<String,NotificationHandler> notificationHandlers;
/**
* Controls reporting of request processing time by appending a
* non-standard "xProcTime" attribute to the JSON-RPC 2.0 response.
*/
private boolean reportProcTime = false;
/**
* Creates a new dispatcher with no registered handlers.
*/
public Dispatcher() {
requestHandlers = new Hashtable<String,RequestHandler>();
notificationHandlers = new Hashtable<String,NotificationHandler>();
}
/**
* Registers a new JSON-RPC 2.0 request handler.
*
* @param handler The request handler to register. Must not be
* {@code null}.
*
* @throws IllegalArgumentException On attempting to register a handler
* that duplicates an existing request
* name.
*/
public void register(final RequestHandler handler) {
for (String name: handler.handledRequests()) {
if (requestHandlers.containsKey(name))
throw new IllegalArgumentException("Cannot register a duplicate JSON-RPC 2.0 handler for request " + name);
requestHandlers.put(name, handler);
}
}
/**
* Registers a new JSON-RPC 2.0 notification handler.
*
* @param handler The notification handler to register. Must not be
* {@code null}.
*
* @throws IllegalArgumentException On attempting to register a handler
* that duplicates an existing
* notification name.
*/
public void register(final NotificationHandler handler) {
for (String name: handler.handledNotifications()) {
if (notificationHandlers.containsKey(name))
throw new IllegalArgumentException("Cannot register a duplicate JSON-RPC 2.0 handler for notification " + name);
notificationHandlers.put(name, handler);
}
}
@Override
public String[] handledRequests() {
java.util.Set<String> var = requestHandlers.keySet();
return var.toArray(new String[var.size()]);
}
@Override
public String[] handledNotifications() {
java.util.Set<String> var = notificationHandlers.keySet();
return var.toArray(new String[var.size()]);
}
/**
* Gets the handler for the specified JSON-RPC 2.0 request name.
*
* @param requestName The request name to lookup.
*
* @return The corresponding request handler or {@code null} if none
* was found.
*/
public RequestHandler getRequestHandler(final String requestName) {
return requestHandlers.get(requestName);
}
/**
* Gets the handler for the specified JSON-RPC 2.0 notification name.
*
* @param notificationName The notification name to lookup.
*
* @return The corresponding notification handler or {@code null} if
* none was found.
*/
public NotificationHandler getNotificationHandler(final String notificationName) {
return notificationHandlers.get(notificationName);
}
/**
* @deprecated
*/
public JSONRPC2Response dispatch(final JSONRPC2Request request, final MessageContext requestCtx) {
return process(request, requestCtx);
}
@Override
public JSONRPC2Response process(final JSONRPC2Request request, final MessageContext requestCtx) {
long startNanosec = 0;
// Measure request processing time?
if (reportProcTime)
startNanosec = System.nanoTime();
final String method = request.getMethod();
RequestHandler handler = getRequestHandler(method);
if (handler == null) {
// We didn't find a handler for the requested RPC
Object id = request.getID();
return new JSONRPC2Response(JSONRPC2Error.METHOD_NOT_FOUND, id);
}
// Process the request
JSONRPC2Response response = handler.process(request, requestCtx);
if (reportProcTime) {
final long procTimeNanosec = System.nanoTime() - startNanosec;
response.appendNonStdAttribute("xProcTime", procTimeNanosec / 1000 + " us");
}
return response;
}
/**
* @deprecated
*/
public void dispatch(final JSONRPC2Notification notification, final MessageContext notificationCtx) {
process(notification, notificationCtx);
}
@Override
public void process(final JSONRPC2Notification notification, final MessageContext notificationCtx) {
final String method = notification.getMethod();
NotificationHandler handler = getNotificationHandler(method);
if (handler == null) {
// We didn't find a handler for the requested RPC
return;
}
// Process the notification
handler.process(notification, notificationCtx);
}
/**
* Controls reporting of request processing time by appending a
* non-standard "xProcTime" attribute to the JSON-RPC 2.0 response.
* Reporting is disabled by default.
*
* @param enable {@code true} to enable proccessing time reporting,
* {@code false} to disable it.
*/
public void reportProcTime(final boolean enable) {
reportProcTime = enable;
}
/**
* Returns {@code true} if reporting of request processing time is
* enabled. See the {@link #reportProcTime} description for more
* information.
*
* @return {@code true} if reporting of request processing time is
* enabled, else {@code false}.
*/
public boolean reportsProcTime() {
return reportProcTime;
}
}

View File

@@ -0,0 +1,428 @@
package com.thetransactioncompany.jsonrpc2.server;
import java.net.InetAddress;
import java.net.URLConnection;
import java.security.Principal;
import java.security.cert.X509Certificate;
import javax.net.ssl.HttpsURLConnection;
import javax.servlet.http.HttpServletRequest;
/**
* Context information about JSON-RPC 2.0 request and notification messages.
* This class is immutable.
*
* <ul>
* <li>The client's host name.
* <li>The client's IP address.
* <li>Whether the request / notification was transmitted securely (e.g.
* via HTTPS).
* <li>The client principal(s) (user), if authenticated.
* </ul>
*
* @author Vladimir Dzhuvinov
*/
public class MessageContext {
/**
* The client hostname, {@code null} if none was specified.
*/
private String clientHostName = null;
/**
* The client IP address, {@code null} if none was specified.
*/
private String clientInetAddress = null;
/**
* Indicates whether the request was received over a secure channel
* (typically HTTPS).
*/
private boolean secure = false;
/**
* The authenticated client principals, {@code null} if none were
* specified.
*/
private Principal[] principals = null;
/**
* Minimal implementation of the {@link java.security.Principal}
* interface.
*/
public class BasicPrincipal implements Principal {
/**
* The principal name.
*/
private String name;
/**
* Creates a new principal.
*
* @param name The principal name, must not be {@code null} or
* empty string.
*
* @throws IllegalArgumentException On a {@code null} or empty
* principal name.
*/
public BasicPrincipal(final String name) {
if (name == null || name.trim().isEmpty())
throw new IllegalArgumentException("The principal name must be defined");
this.name = name;
}
/**
* Checks for equality.
*
* @param another The object to compare to.
*/
public boolean equals(final Object another) {
return another != null &&
another instanceof Principal &&
((Principal)another).getName().equals(this.getName());
}
/**
* Returns a hash code for this principal.
*
* @return The hash code.
*/
public int hashCode() {
return getName().hashCode();
}
/**
* Returns the principal name.
*
* @return The principal name.
*/
public String getName() {
return name;
}
}
/**
* Creates a new JSON-RPC 2.0 request / notification context.
*
* @param clientHostName The client host name, {@code null} if
* unknown.
* @param clientInetAddress The client IP address, {@code null} if
* unknown.
* @param secure Specifies a request received over HTTPS.
* @param principalName Specifies the authenticated client principle
* name, {@code null} if unknown. The name must
* not be an empty or blank string.
*/
public MessageContext(final String clientHostName,
final String clientInetAddress,
final boolean secure,
final String principalName) {
this.clientHostName = clientHostName;
this.clientInetAddress = clientInetAddress;
this.secure = secure;
if (principalName != null) {
principals = new Principal[1];
principals[0] = new BasicPrincipal(principalName);
}
}
/**
* Creates a new JSON-RPC 2.0 request / notification context.
*
* @param clientHostName The client host name, {@code null} if
* unknown.
* @param clientInetAddress The client IP address, {@code null} if
* unknown.
* @param secure Specifies a request received over HTTPS.
* @param principalNames Specifies the authenticated client principle
* names, {@code null} if unknown. The names
* must not be an empty or blank string.
*/
public MessageContext(final String clientHostName,
final String clientInetAddress,
final boolean secure,
final String[] principalNames) {
this.clientHostName = clientHostName;
this.clientInetAddress = clientInetAddress;
this.secure = secure;
if (principalNames != null) {
principals = new Principal[principalNames.length];
for (int i=0; i < principals.length; i++)
principals[0] = new BasicPrincipal(principalNames[i]);
}
}
/**
* Creates a new JSON-RPC 2.0 request / notification context. No
* authenticated client principal is specified.
*
* @param clientHostName The client host name, {@code null} if
* unknown.
* @param clientInetAddress The client IP address, {@code null} if
* unknown.
* @param secure Specifies a request received over HTTPS.
*/
public MessageContext(final String clientHostName,
final String clientInetAddress,
final boolean secure) {
this.clientHostName = clientHostName;
this.clientInetAddress = clientInetAddress;
this.secure = secure;
}
/**
* Creates a new JSON-RPC 2.0 request / notification context. Indicates
* an insecure transport (plain HTTP) and no authenticated client
* principal.
*
* @param clientHostName The client host name, {@code null} if
* unknown.
* @param clientInetAddress The client IP address, {@code null} if
* unknown.
*/
public MessageContext(final String clientHostName,
final String clientInetAddress) {
this.clientHostName = clientHostName;
this.clientInetAddress = clientInetAddress;
this.secure = false;
}
/**
* Creates a new JSON-RPC 2.0 request / notification context. Indicates
* an insecure transport (plain HTTP) and no authenticated client
* principal. Not client host name / IP is specified.
*/
public MessageContext() {
this.secure = false;
}
/**
* Creates a new JSON-RPC 2.0 request / notification context from the
* specified HTTP request.
*
* @param httpRequest The HTTP request.
*/
public MessageContext(final HttpServletRequest httpRequest) {
clientInetAddress = httpRequest.getRemoteAddr();
clientHostName = httpRequest.getRemoteHost();
if (clientHostName != null && clientHostName.equals(clientInetAddress))
clientHostName = null; // not resolved actually
secure = httpRequest.isSecure();
X509Certificate[] certs = (X509Certificate[])httpRequest.getAttribute("javax.servlet.request.X509Certificate");
if (certs != null && certs.length > 0) {
principals = new Principal[certs.length];
for (int i=0; i < principals.length; i++)
principals[i] = certs[i].getSubjectX500Principal();
}
}
/**
* Creates a new JSON-RPC 2.0 request / notification context from the
* specified URL connection. Use this constructor in cases when the
* HTTP server is the origin of the JSON-RPC 2.0 requests /
* notifications. If the IP address of the HTTP server cannot be
* resolved {@link #getClientInetAddress} will return {@code null}.
*
* @param connection The URL connection, must be established and not
* {@code null}.
*/
public MessageContext(final URLConnection connection) {
clientHostName = connection.getURL().getHost();
InetAddress ip = null;
if (clientHostName != null) {
try {
ip = InetAddress.getByName(clientHostName);
} catch (Exception e) {
// UnknownHostException, SecurityException
// ignore
}
}
if (ip != null)
clientInetAddress = ip.getHostAddress();
if (connection instanceof HttpsURLConnection) {
secure = true;
HttpsURLConnection httpsConnection = (HttpsURLConnection)connection;
Principal prn = null;
try {
prn = httpsConnection.getPeerPrincipal();
} catch (Exception e) {
// SSLPeerUnverifiedException, IllegalStateException
// ignore
}
if (prn != null) {
principals = new Principal[1];
principals[0] = prn;
}
}
}
/**
* Gets the host name of the client that sent the request /
* notification.
*
* @return The client host name, {@code null} if unknown.
*/
public String getClientHostName() {
return clientHostName;
}
/**
* Gets the IP address of the client that sent the request /
* notification.
*
* @return The client IP address, {@code null} if unknown.
*/
public String getClientInetAddress() {
return clientInetAddress;
}
/**
* Indicates whether the request / notification was received over a
* secure HTTPS connection.
*
* @return {@code true} If the request was received over HTTPS,
* {@code false} if it was received over plain HTTP.
*/
public boolean isSecure() {
return secure;
}
/**
* Returns the first authenticated client principal, {@code null} if
* none.
*
* @return The first client principal, {@code null} if none.
*/
public Principal getPrincipal() {
if (principals != null)
return principals[0];
else
return null;
}
/**
* Returns the authenticated client principals, {@code null} if
* none.
*
* @return The client principals, {@code null} if none.
*/
public Principal[] getPrincipals() {
return principals;
}
/**
* Returns the first authenticated client principal name, {@code null}
* if none.
*
* @return The first client principal name, {@code null} if none.
*/
public String getPrincipalName() {
if (principals != null)
return principals[0].getName();
else
return null;
}
/**
* Returns the authenticated client principal names, {@code null}
* if none.
*
* @return The client principal names, {@code null} if none.
*/
public String[] getPrincipalNames() {
String[] names = new String[principals.length];
for (int i=0; i < names.length; i++)
names[i] = principals[i].getName();
return names;
}
@Override
public String toString() {
String s = "[host=" + clientHostName + " hostIP=" + clientInetAddress + " secure=" + secure;
if (principals != null) {
int i = 0;
for (Principal p: principals)
s += " principal[" + (i++) + "]=" + p;
}
return s + "]";
}
}

View File

@@ -0,0 +1,35 @@
package com.thetransactioncompany.jsonrpc2.server;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Notification;
/**
* Interface for handling JSON-RPC 2.0 notifications.
*
* @author Vladimir Dzhuvinov
*/
public interface NotificationHandler {
/**
* Gets the names of the handled JSON-RPC 2.0 notification methods.
*
* @return The names of the handled JSON-RPC 2.0 notification methods.
*/
public String[] handledNotifications();
/**
* Processes a JSON-RPC 2.0 notification.
*
* <p>Note that JSON-RPC 2.0 notifications don't produce a response!
*
* @param notification A valid JSON-RPC 2.0 notification instance.
* Must not be {@code null}.
* @param notificationCtx Context information about the notification
* message, may be {@code null} if undefined.
*/
public void process(final JSONRPC2Notification notification, final MessageContext notificationCtx);
}

View File

@@ -0,0 +1,36 @@
package com.thetransactioncompany.jsonrpc2.server;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;
/**
* Interface for handling JSON-RPC 2.0 requests.
*
* @author Vladimir Dzhuvinov
*/
public interface RequestHandler {
/**
* Gets the names of the handled JSON-RPC 2.0 request methods.
*
* @return The names of the handled JSON-RPC 2.0 request methods.
*/
public String[] handledRequests();
/**
* Processes a JSON-RPC 2.0 request.
*
* @param request A valid JSON-RPC 2.0 request instance. Must not be
* {@code null}.
* @param requestCtx Context information about the request message, may
* be {@code null} if undefined.
*
* @return The resulting JSON-RPC 2.0 response. It indicates success
* or an error, such as METHOD_NOT_FOUND.
*/
public JSONRPC2Response process(final JSONRPC2Request request, final MessageContext requestCtx);
}

View File

@@ -0,0 +1,34 @@
/**
* Simple server framework for processing JSON-RPC 2.0 requests and
* notifications.
*
* <p>Usage:
*
* <ol>
* <li>Implement {@link com.thetransactioncompany.jsonrpc2.server.RequestHandler request}
* and / or {@link com.thetransactioncompany.jsonrpc2.server.NotificationHandler notification}
* handlers for the various expected JSON-RPC 2.0 messages. A handler
* may process one or more request/notification methods (identified by
* method name).
* <li>Create a new {@link com.thetransactioncompany.jsonrpc2.server.Dispatcher}
* and register the handlers with it.
* <li>Pass the received JSON-RPC 2.0 requests and notifications to the
* appropriate {@code Dispatcher.dispatch(...)} method, then, if the
* message is a request, pass the resulting JSON-RPC 2.0 response back
* to the client.
* </ol>
*
* <p>Direct package dependencies:
*
* <ul>
* <li><b><a href="http://software.dzhuvinov.com/json-rpc-2.0-base.html">JSON-RPC 2.0 Base</a></b>
* [<i>com.thetransactioncompany.jsonrpc2</i>] to construct and represent
* JSON-RPC 2.0 messages.
* <li><b>Java Servlet API</b> [<i>javax.servlet.http</i>] for constructing
* {@link com.thetransactioncompany.jsonrpc2.server.MessageContext}
* objects from HTTP servlet requests.
* </ul>
*
* @author Vladimir Dzhuvinov
*/
package com.thetransactioncompany.jsonrpc2.server;

View File

@@ -0,0 +1,80 @@
package com.thetransactioncompany.jsonrpc2.util;
/**
* The base abstract class for the JSON-RPC 2.0 parameter retrievers.
*
* @author Vladimir Dzhuvinov
*/
public abstract class ParamsRetriever {
/**
* Returns the parameter count.
*
* @return The parameters count.
*/
public abstract int size();
/**
* Matches a string against an array of acceptable values.
*
* @param input The string to match.
* @param enumStrings The acceptable string values. Must not be
* {@code null}.
* @param ignoreCase {@code true} for a case insensitive match.
*
* @return The matching string value, {@code null} if no match was
* found.
*/
protected static String getEnumStringMatch(final String input,
final String[] enumStrings,
final boolean ignoreCase) {
for (final String en: enumStrings) {
if (ignoreCase) {
if (en.equalsIgnoreCase(input))
return en;
}
else {
if (en.equals(input))
return en;
}
}
return null;
}
/**
* Matches a string against an enumeration of acceptable values.
*
* @param input The string to match.
* @param enumClass The enumeration class specifying the acceptable
* string values. Must not be {@code null}.
* @param ignoreCase {@code true} for a case insensitive match.
*
* @return The matching enumeration constant, {@code null} if no match
* was found.
*/
protected static <T extends Enum<T>> T getEnumStringMatch(final String input,
final Class<T> enumClass,
final boolean ignoreCase) {
for (T en: enumClass.getEnumConstants()) {
if (ignoreCase) {
if (en.toString().equalsIgnoreCase(input))
return en;
}
else {
if (en.toString().equals(input))
return en;
}
}
return null;
}
}

View File

@@ -0,0 +1,44 @@
/**
* Utility classes for typed retrieval of JSON-RPC 2.0 request parameters on the
* server side.
*
* <p>The following parameter type conversion choices are available:
*
* <ul>
* <li>JSON true/false to Java {@code boolean}
* <li>JSON number to Java {@code int}, {@code long}, {@code float} or
* {@code double}
* <li>JSON string to {@code java.lang.String}
* <li>Predefined (enumerated) JSON string to a Java {@code enum} constant
* or {@code java.lang.String}
* <li>JSON array to Java {@code boolean[]}, {@code int[]}, {@code long[]},
* {@code float[]}, {@code double[]} or {@code string[]} array, or
* to mixed type {@code java.util.List}
* <li>JSON object to {@code java.util.Map}
* </ul>
*
* <p>If a parameter cannot be retrieved, either because it's missing or
* is of the wrong type, a standard
* {@link com.thetransactioncompany.jsonrpc2.JSONRPC2Error#INVALID_PARAMS}
* exception is thrown.
*
* <p>There are two concrete classes:
*
* <ul>
* <li>The {@link com.thetransactioncompany.jsonrpc2.util.PositionalParamsRetriever}
* class is for extracting <em>positional parameters</em> (packed in a
* JSON array).
* <li>The {@link com.thetransactioncompany.jsonrpc2.util.NamedParamsRetriever}
* class is for extracting <em>named parameters</em> (packed in a JSON
* object).
* </ul>
*
*
* <p><b>Package dependencies:</b> The classes in this package depend on the
* sister {@link com.thetransactioncompany.jsonrpc2} package.
*
* @author Vladimir Dzhuvinov
*/
package com.thetransactioncompany.jsonrpc2.util;

View File

@@ -0,0 +1,129 @@
package net.i2p.i2pcontrol;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.i2p.I2PAppContext;
import net.i2p.data.DataHelper;
import net.i2p.util.Log;
import org.apache.http.conn.util.InetAddressUtils;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.HandlerWrapper;
/**
* Block certain Host headers to prevent DNS rebinding attacks.
*
* This Handler wraps the ContextHandlerCollection, which handles
* all the webapps (not just routerconsole).
* Therefore, this protects all the webapps.
*
* This class is NOT used for the webapp or the bare ServerSocket implementation.
*
* @since 0.12 copied from routerconsole
*/
public class HostCheckHandler extends HandlerWrapper
{
private final I2PAppContext _context;
private final Set<String> _listenHosts;
/**
* MUST call setListenHosts() afterwards.
*/
public HostCheckHandler(I2PAppContext ctx) {
super();
_context = ctx;
_listenHosts = new HashSet<String>(8);
}
/**
* Set the legal hosts.
* Not synched. Call this BEFORE starting.
* If empty, all are allowed.
*
* @param hosts contains hostnames or IPs. But we allow all IPs anyway.
*/
public void setListenHosts(Set<String> hosts) {
_listenHosts.clear();
_listenHosts.addAll(hosts);
}
/**
* Block by Host header, pass everything else to the delegate.
*/
public void handle(String pathInContext,
Request baseRequest,
HttpServletRequest httpRequest,
HttpServletResponse httpResponse)
throws IOException, ServletException
{
String host = httpRequest.getHeader("Host");
if (!allowHost(host)) {
Log log = _context.logManager().getLog(HostCheckHandler.class);
host = DataHelper.stripHTML(getHost(host));
String s = "Console request denied.\n" +
" To allow access using the hostname \"" + host + "\", add the line \"" +
I2PControlController.PROP_ALLOWED_HOSTS + '=' + host +
"\" to I2PControl.conf and restart.";
log.logAlways(Log.WARN, s);
httpResponse.sendError(403, s);
return;
}
super.handle(pathInContext, baseRequest, httpRequest, httpResponse);
}
/**
* Should we allow a request with this Host header?
*
* ref: https://en.wikipedia.org/wiki/DNS_rebinding
*
* @param host the HTTP Host header, null ok
* @return true if OK
*/
private boolean allowHost(String host) {
if (host == null)
return true;
// common cases
if (host.equals("127.0.0.1:7650") ||
host.equals("localhost:7650"))
return true;
// all allowed?
if (_listenHosts.isEmpty())
return true;
host = getHost(host);
if (_listenHosts.contains(host))
return true;
// allow all IP addresses
if (InetAddressUtils.isIPv4Address(host) || InetAddressUtils.isIPv6Address(host))
return true;
//System.out.println(host + " not found in " + s);
return false;
}
/**
* Strip [] and port from a host header
*
* @param host the HTTP Host header non-null
*/
private static String getHost(String host) {
if (host.startsWith("[")) {
host = host.substring(1);
int brack = host.indexOf(']');
if (brack >= 0)
host = host.substring(0, brack);
} else {
int colon = host.indexOf(':');
if (colon >= 0)
host = host.substring(0, colon);
}
return host;
}
}

View File

@@ -0,0 +1,406 @@
package net.i2p.i2pcontrol;
/*
* Copyright 2010 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import net.i2p.I2PAppContext;
import net.i2p.app.ClientAppManager;
import net.i2p.app.ClientAppState;
import static net.i2p.app.ClientAppState.*;
import net.i2p.router.RouterContext;
import net.i2p.router.app.RouterApp;
import net.i2p.util.I2PSSLSocketFactory;
import net.i2p.util.Log;
import net.i2p.util.PortMapper;
import net.i2p.i2pcontrol.security.KeyStoreProvider;
import net.i2p.i2pcontrol.security.SecurityManager;
import net.i2p.i2pcontrol.servlets.JSONRPC2Servlet;
import net.i2p.i2pcontrol.servlets.configuration.ConfigurationManager;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import java.io.File;
import java.io.IOException;
import java.net.UnknownHostException;
import java.security.KeyStore;
import java.util.HashSet;
import java.util.Set;
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.
*
* Usage: I2PControlController -d $PLUGIN [start|stop]
*
* This class is NOT used for the webapp or the bare ServerSocket implementation.
*
* @author hottuna
*/
public class I2PControlController implements RouterApp {
// non-null
private final I2PAppContext _appContext;
// warning, null in app context
private final RouterContext _context;
private final ClientAppManager _mgr;
private final Log _log;
private final String _pluginDir;
private final ConfigurationManager _conf;
private final KeyStoreProvider _ksp;
private final SecurityManager _secMan;
private final Server _server;
private ClientAppState _state = UNINITIALIZED;
// only for main()
private static I2PControlController _instance;
static final String PROP_ALLOWED_HOSTS = "i2pcontrol.allowedhosts";
private static final String SVC_HTTPS_I2PCONTROL = "https_i2pcontrol";
private static final int DEFAULT_PORT = 7650;
/**
* RouterApp (new way)
*/
public I2PControlController(RouterContext ctx, ClientAppManager mgr, String args[]) {
_appContext = _context = ctx;
_mgr = mgr;
_log = _appContext.logManager().getLog(I2PControlController.class);
File pluginDir = new File(_context.getAppDir(), "plugins/I2PControl");
_pluginDir = pluginDir.getAbsolutePath();
_conf = new ConfigurationManager(_appContext, pluginDir, true);
_ksp = new KeyStoreProvider(_pluginDir);
_secMan = new SecurityManager(_appContext, _ksp, _conf);
_server = buildServer();
_state = INITIALIZED;
}
/**
* From main() (old way)
*/
public I2PControlController(File pluginDir) {
_appContext = I2PAppContext.getGlobalContext();
if (_appContext instanceof RouterContext)
_context = (RouterContext) _appContext;
else
_context = null;
_mgr = null;
_log = _appContext.logManager().getLog(I2PControlController.class);
_pluginDir = pluginDir.getAbsolutePath();
_conf = new ConfigurationManager(_appContext, pluginDir, true);
_ksp = new KeyStoreProvider(_pluginDir);
_secMan = new SecurityManager(_appContext, _ksp, _conf);
_server = buildServer();
_state = INITIALIZED;
}
/////// ClientApp methods
public synchronized void startup() {
changeState(STARTING);
try {
start(null);
changeState(RUNNING);
} catch (Exception e) {
changeState(START_FAILED, "Failed to start", e);
_log.error("Unable to start jetty server", e);
stop();
}
}
public synchronized void shutdown(String[] args) {
if (_state == STOPPED)
return;
changeState(STOPPING);
stop();
changeState(STOPPED);
}
public synchronized ClientAppState getState() {
return _state;
}
public String getName() {
return "I2PControl";
}
public String getDisplayName() {
return "I2PControl";
}
/////// end ClientApp methods
private void changeState(ClientAppState state) {
changeState(state, null, null);
}
private synchronized void changeState(ClientAppState state, String msg, Exception e) {
_state = state;
if (_mgr != null)
_mgr.notify(this, state, msg, e);
if (_context == null) {
if (msg != null)
System.out.println(state + ": " + msg);
if (e != null)
e.printStackTrace();
}
}
/**
* Deprecated, use constructor
*/
public static void main(String args[]) {
if (args.length != 3 || (!"-d".equals(args[0])))
throw new IllegalArgumentException("Usage: PluginController -d $PLUGINDIR [start|stop]");
if ("start".equals(args[2])) {
File pluginDir = new File(args[1]);
if (!pluginDir.exists())
throw new IllegalArgumentException("Plugin directory " + pluginDir.getAbsolutePath() + " does not exist");
synchronized(I2PControlController.class) {
if (_instance != null)
throw new IllegalStateException();
I2PControlController i2pcc = new I2PControlController(pluginDir);
try {
i2pcc.startup();
_instance = i2pcc;
} catch (Exception e) {
e.printStackTrace();
}
}
} else if ("stop".equals(args[2])) {
synchronized(I2PControlController.class) {
if (_instance != null) {
_instance.shutdown(null);
_instance = null;
}
}
} else {
throw new IllegalArgumentException("Usage: PluginController -d $PLUGINDIR [start|stop]");
}
}
private synchronized void start(String args[]) throws Exception {
_appContext.logManager().getLog(JSONRPC2Servlet.class).setMinimumPriority(Log.DEBUG);
_server.start();
_context.portMapper().register(SVC_HTTPS_I2PCONTROL,
_conf.getConf("i2pcontrol.listen.address", "127.0.0.1"),
_conf.getConf("i2pcontrol.listen.port", DEFAULT_PORT));
}
/**
* Builds a new server. Used for changing ports during operation and such.
* @return Server - A new server built from current configuration.
*/
private Connector buildDefaultListener(Server server) {
Connector ssl = buildSslListener(server, _conf.getConf("i2pcontrol.listen.address", "127.0.0.1"),
_conf.getConf("i2pcontrol.listen.port", DEFAULT_PORT));
return ssl;
}
/**
* Builds a new server. Used for changing ports during operation and such.
*
* Does NOT start the server. Must call start() on the returned server.
*
* @return Server - A new server built from current configuration.
*/
public Server buildServer() {
Server server = new Server();
Connector ssl = buildDefaultListener(server);
server.addConnector(ssl);
ServletHandler sh = new ServletHandler();
sh.addServletWithMapping(new ServletHolder(new JSONRPC2Servlet(_context, _secMan)), "/");
HostCheckHandler hch = new HostCheckHandler(_appContext);
Set<String> listenHosts = new HashSet<String>(8);
// fix up the allowed hosts set (see HostCheckHandler)
// empty set says all are valid
String address = _conf.getConf("i2pcontrol.listen.address", "127.0.0.1");
if (!(address.equals("0.0.0.0") ||
address.equals("::") ||
address.equals("0:0:0:0:0:0:0:0"))) {
listenHosts.add("localhost");
listenHosts.add("127.0.0.1");
listenHosts.add("::1");
listenHosts.add("0:0:0:0:0:0:0:1");
String allowed = _conf.getConf(PROP_ALLOWED_HOSTS, "");
if (!allowed.equals("")) {
StringTokenizer tok = new StringTokenizer(allowed, " ,");
while (tok.hasMoreTokens()) {
listenHosts.add(tok.nextToken());
}
}
}
hch.setListenHosts(listenHosts);
hch.setHandler(sh);
server.getServer().setHandler(hch);
_conf.writeConfFile();
return server;
}
/**
* Creates a SSLListener with all the default options. The listener will use all the default options.
* @param address - The address the listener will listen to.
* @param port - The port the listener will listen to.
* @return - Newly created listener
*/
private Connector buildSslListener(Server server, String address, int port) {
int listeners = 0;
if (server != null) {
listeners = server.getConnectors().length;
}
// the keystore path and password
SslContextFactory sslFactory = new SslContextFactory(_ksp.getKeyStoreLocation());
sslFactory.setKeyStorePassword(KeyStoreProvider.DEFAULT_KEYSTORE_PASSWORD);
// the X.509 cert password (if not present, verifyKeyStore() returned false)
sslFactory.setKeyManagerPassword(KeyStoreProvider.DEFAULT_CERTIFICATE_PASSWORD);
sslFactory.addExcludeProtocols(I2PSSLSocketFactory.EXCLUDE_PROTOCOLS.toArray(
new String[I2PSSLSocketFactory.EXCLUDE_PROTOCOLS.size()]));
sslFactory.addExcludeCipherSuites(I2PSSLSocketFactory.EXCLUDE_CIPHERS.toArray(
new String[I2PSSLSocketFactory.EXCLUDE_CIPHERS.size()]));
HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.setSecureScheme("https");
httpConfig.setSecurePort(port);
httpConfig.addCustomizer(new SecureRequestCustomizer());
// number of acceptors, (default) number of selectors
ServerConnector ssl = new ServerConnector(server, 1, 0,
new SslConnectionFactory(sslFactory, "http/1.1"),
new HttpConnectionFactory(httpConfig));
ssl.setHost(address);
ssl.setPort(port);
ssl.setIdleTimeout(90*1000); // default 10 sec
// all with same name will use the same thread pool
ssl.setName("I2PControl");
ssl.setName("SSL Listener-" + ++listeners);
return ssl;
}
/**
* Add a listener to the server
* If a listener listening to the same port as the provided listener
* uses already exists within the server, replace the one already used by
* the server with the provided listener.
* @param listener
* @throws Exception
*/
/****
public synchronized void replaceListener(Connector listener) throws Exception {
if (_server != null) {
stopServer();
}
_server = buildServer(listener);
}
****/
/**
* Get all listeners of the server.
* @return
*/
/****
public synchronized Connector[] getListeners() {
if (_server != null) {
return _server.getConnectors();
}
return new Connector[0];
}
****/
/**
* Removes all listeners
*/
/****
public synchronized void clearListeners() {
if (_server != null) {
for (Connector listen : getListeners()) {
_server.removeConnector(listen);
}
}
}
****/
/**
* Stop it
*/
private synchronized void stopServer()
{
try {
if (_server != null) {
_appContext.portMapper().unregister(SVC_HTTPS_I2PCONTROL);
_server.stop();
for (Connector listener : _server.getConnectors()) {
listener.stop();
}
_server.destroy();
}
} catch (Exception e) {
_log.error("Stopping server", e);
}
}
private synchronized void stop() {
_conf.writeConfFile();
_secMan.stopTimedEvents();
stopServer();
/****
// Get and stop all running threads
ThreadGroup threadgroup = Thread.currentThread().getThreadGroup();
Thread[] threads = new Thread[threadgroup.activeCount() + 3];
threadgroup.enumerate(threads, true);
for (Thread thread : threads) {
if (thread != null) {//&& thread.isAlive()){
thread.interrupt();
}
}
for (Thread thread : threads) {
if (thread != null) {
System.out.println("Active thread: " + thread.getName());
}
}
threadgroup.interrupt();
//Thread.currentThread().getThreadGroup().destroy();
****/
}
public String getPluginDir() {
return _pluginDir;
}
}

View File

@@ -0,0 +1,20 @@
package net.i2p.i2pcontrol;
import java.util.HashSet;
import java.util.Set;
public class I2PControlVersion {
/** The current version of I2PControl */
public final static String VERSION = "0.12.0";
/** The current version of the I2PControl API being primarily being implemented */
public final static int API_VERSION = 1;
/** The supported versions of the I2PControl API */
public final static Set<Integer> SUPPORTED_API_VERSIONS;
static {
SUPPORTED_API_VERSIONS = new HashSet<Integer>();
SUPPORTED_API_VERSIONS.add(1);
}
}

View File

@@ -0,0 +1,245 @@
package net.i2p.i2pcontrol;
/*
* Copyright 2010 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.security.KeyStore;
import java.util.ArrayList;
import java.util.List;
import net.i2p.I2PAppContext;
import net.i2p.app.ClientAppManager;
import net.i2p.app.ClientAppState;
import static net.i2p.app.ClientAppState.*;
import net.i2p.router.RouterContext;
import net.i2p.router.app.RouterApp;
import net.i2p.util.I2PSSLSocketFactory;
import net.i2p.util.Log;
import net.i2p.util.PortMapper;
import org.json.simple.Jsoner;
import org.json.simple.DeserializationException;
import net.i2p.i2pcontrol.security.KeyStoreProvider;
import net.i2p.i2pcontrol.security.SecurityManager;
import net.i2p.i2pcontrol.servlets.JSONRPC2Servlet;
import net.i2p.i2pcontrol.servlets.configuration.ConfigurationManager;
/**
* This handles the starting and stopping of a ServerSocket
* from a single static class so it can be called via clients.config.
*
* This class is NOT used for the webapp or the HTTP/HTTPS implementation.
*
* @author hottuna
*/
public class SocketController implements RouterApp {
// non-null
private final RouterContext _context;
private final ClientAppManager _mgr;
private final Log _log;
private final String _pluginDir;
private final ConfigurationManager _conf;
private final KeyStoreProvider _ksp;
private final SecurityManager _secMan;
private ServerSocket _server;
private final List<Socket> _listeners;
private ClientAppState _state = UNINITIALIZED;
// only for main()
private static SocketController _instance;
static final String PROP_ALLOWED_HOSTS = "i2pcontrol.allowedhosts";
private static final String SVC_SKT_I2PCONTROL = "skt_i2pcontrol";
private static final String SVC_SSL_I2PCONTROL = "skt_ssl_i2pcontrol";
private static final int DEFAULT_PORT = 7640;
/**
* RouterApp (new way)
*/
public SocketController(RouterContext ctx, ClientAppManager mgr, String args[]) throws IOException {
_context = ctx;
_mgr = mgr;
_log = _context.logManager().getLog(SocketController.class);
File pluginDir = new File(_context.getConfigDir(), "keystore/I2PControl");
_pluginDir = pluginDir.getAbsolutePath();
_conf = new ConfigurationManager(_context, pluginDir, true);
_ksp = new KeyStoreProvider(_pluginDir);
_secMan = new SecurityManager(_context, _ksp, _conf);
_listeners = new ArrayList<Socket>(4);
_state = INITIALIZED;
}
/////// ClientApp methods
public synchronized void startup() {
changeState(STARTING);
try {
start(null);
changeState(RUNNING);
} catch (Exception e) {
changeState(START_FAILED, "Failed to start", e);
_log.error("Unable to start socket server", e);
stop();
}
}
public synchronized void shutdown(String[] args) {
if (_state == STOPPED)
return;
changeState(STOPPING);
stop();
changeState(STOPPED);
}
public synchronized ClientAppState getState() {
return _state;
}
public String getName() {
return "I2PControl-Socket";
}
public String getDisplayName() {
return "I2PControl-Socket";
}
/////// end ClientApp methods
private void changeState(ClientAppState state) {
changeState(state, null, null);
}
private synchronized void changeState(ClientAppState state, String msg, Exception e) {
_state = state;
if (_mgr != null)
_mgr.notify(this, state, msg, e);
if (_context == null) {
if (msg != null)
System.out.println(state + ": " + msg);
if (e != null)
e.printStackTrace();
}
}
private synchronized void start(String args[]) throws Exception {
_context.logManager().getLog(JSONRPC2Servlet.class).setMinimumPriority(Log.DEBUG);
_server = buildServer();
_context.portMapper().register(SVC_SKT_I2PCONTROL,
_conf.getConf("i2pcontrol.listen.address", "127.0.0.1"),
_conf.getConf("i2pcontrol.listen.port", DEFAULT_PORT));
}
/**
* Builds a new server. Used for changing ports during operation and such.
*
* Does NOT start the server. Must call start() on the returned server.
*
* @return Server - A new server built from current configuration.
*/
public ServerSocket buildServer() throws IOException {
String address = _conf.getConf("i2pcontrol.listen.address", "127.0.0.1");
int port = _conf.getConf("i2pcontrol.listen.port", DEFAULT_PORT);
ServerSocket server = new ServerSocket(port, 0, InetAddress.getByName(address));
_conf.writeConfFile();
return server;
}
private class Server implements Runnable {
public void run() {
try {
while (true) {
Socket s = _server.accept();
synchronized (SocketController.this) {
_listeners.add(s);
}
new Handler(s);
}
} catch (IOException ioe) {
_log.error("i2pcontrol server", ioe);
} finally {
synchronized (SocketController.this) {
if (_server != null) {
try { _server.close(); } catch (IOException ioe) {}
}
}
}
}
}
private class Handler implements Runnable {
private final Socket s;
public Handler(Socket skt) { s = skt; }
public void run() {
try {
final BufferedReader reader = new BufferedReader(new InputStreamReader(s.getInputStream(), "UTF-8"));
while (true) {
Object o = Jsoner.deserialize(reader);
// TODO
System.out.println("i2pcontrol got: " + o);
}
} catch (DeserializationException pe) {
_log.error("i2pcontrol handler", pe);
return;
} catch (IOException ioe) {
_log.error("i2pcontrol handler", ioe);
return;
} finally {
synchronized (SocketController.this) {
_listeners.remove(s);
}
try { s.close(); } catch (IOException ioe) {}
}
}
}
/**
* Stop it
*/
private synchronized void stopServer()
{
try {
if (_server != null) {
_context.portMapper().unregister(SVC_SKT_I2PCONTROL);
try {
_server.close();
} catch (IOException ioe) {}
for (Socket listener : _listeners) {
try {
listener.close();
} catch (IOException ioe) {}
}
_listeners.clear();
}
} catch (Exception e) {
_log.error("Stopping server", e);
}
}
private synchronized void stop() {
_conf.writeConfFile();
_secMan.stopTimedEvents();
stopServer();
}
}

View File

@@ -0,0 +1,50 @@
package net.i2p.i2pcontrol.security;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class AuthToken {
static final int VALIDITY_TIME = 1; // Measured in days
private final SecurityManager _secMan;
private final String id;
private final Date expiry;
public AuthToken(SecurityManager secMan, String password) {
_secMan = secMan;
String hash = _secMan.getPasswdHash(password);
this.id = _secMan.getHash(hash + Calendar.getInstance().getTimeInMillis());
Calendar expiry = Calendar.getInstance();
expiry.add(Calendar.DAY_OF_YEAR, VALIDITY_TIME);
this.expiry = expiry.getTime();
}
public String getId() {
return id;
}
/**
* Checks whether the AuthToken has expired.
* @return True if AuthToken hasn't expired. False in any other case.
*/
public boolean isValid() {
return Calendar.getInstance().getTime().before(expiry);
}
public String getExpiryTime() {
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.applyPattern("yyyy-MM-dd HH:mm:ss");
return sdf.format(expiry);
}
@Override
public String toString() {
return id;
}
@Override
public int hashCode() {
return id.hashCode();
}
}

View File

@@ -0,0 +1,16 @@
package net.i2p.i2pcontrol.security;
public class ExpiredAuthTokenException extends Exception {
private static final long serialVersionUID = 2279019346592900289L;
private String expiryTime;
public ExpiredAuthTokenException(String str, String expiryTime) {
super(str);
this.expiryTime = expiryTime;
}
public String getExpirytime() {
return expiryTime;
}
}

View File

@@ -0,0 +1,9 @@
package net.i2p.i2pcontrol.security;
public class InvalidAuthTokenException extends Exception {
private static final long serialVersionUID = 7605321329341235577L;
public InvalidAuthTokenException(String str) {
super(str);
}
}

View File

@@ -0,0 +1,221 @@
package net.i2p.i2pcontrol.security;
import net.i2p.crypto.KeyStoreUtil;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
public class KeyStoreProvider {
public static final String DEFAULT_CERTIFICATE_ALGORITHM_STRING = "RSA";
public static final int DEFAULT_CERTIFICATE_KEY_LENGTH = 4096;
public static final int DEFAULT_CERTIFICATE_VALIDITY = 365 * 10;
public final static String DEFAULT_CERTIFICATE_DOMAIN = "localhost";
public final static String DEFAULT_CERTIFICATE_ALIAS = "I2PControl CA";
public static final String DEFAULT_KEYSTORE_NAME = "i2pcontrol.ks";
public static final String DEFAULT_KEYSTORE_PASSWORD = KeyStoreUtil.DEFAULT_KEYSTORE_PASSWORD;
public static final String DEFAULT_CERTIFICATE_PASSWORD = "nut'nfancy";
private final String _pluginDir;
private KeyStore _keystore;
public KeyStoreProvider(String pluginDir) {
_pluginDir = pluginDir;
}
public void initialize() {
KeyStoreUtil.createKeys(new File(getKeyStoreLocation()),
DEFAULT_KEYSTORE_PASSWORD,
DEFAULT_CERTIFICATE_ALIAS,
DEFAULT_CERTIFICATE_DOMAIN,
"i2pcontrol",
DEFAULT_CERTIFICATE_VALIDITY,
DEFAULT_CERTIFICATE_ALGORITHM_STRING,
DEFAULT_CERTIFICATE_KEY_LENGTH,
DEFAULT_CERTIFICATE_PASSWORD);
}
/**
* @param password unused
* @return null on failure
*/
public static X509Certificate readCert(KeyStore ks, String certAlias, String password) {
try {
X509Certificate cert = (X509Certificate) ks.getCertificate(certAlias);
if (cert == null) {
throw new RuntimeException("Got null cert from keystore!");
}
try {
cert.verify(cert.getPublicKey());
return cert;
} catch (Exception e) {
System.err.println("Failed to verify caCert certificate against caCert");
e.printStackTrace();
}
} catch (KeyStoreException e) {
e.printStackTrace();
}
return null;
}
/**
* @param password for the keystore
* @return null on failure
*/
/****
public static X509Certificate readCert(File keyStoreFile, String certAlias, String password) {
try {
KeyStore ks = getDefaultKeyStore();
ks.load(new FileInputStream(keyStoreFile), password.toCharArray());
X509Certificate cert = (X509Certificate) ks.getCertificate(certAlias);
if (cert == null) {
throw new RuntimeException("Got null cert from keystore!");
}
try {
cert.verify(cert.getPublicKey());
return cert;
} catch (Exception e) {
System.err.println("Failed to verify caCert certificate against caCert");
e.printStackTrace();
}
} catch (IOException e) {
System.err.println("Couldn't read keystore from: " + keyStoreFile.toString());
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (CertificateException e) {
e.printStackTrace();
} catch (KeyStoreException e) {
System.err.println("No certificate with alias: " + certAlias + " found.");
e.printStackTrace();
}
return null;
}
****/
/**
* @param password for the key
* @return null on failure, or throws RuntimeException...
*/
/****
public static PrivateKey readPrivateKey(KeyStore ks, String alias, String password) {
try {
// load the key entry from the keystore
Key key = ks.getKey(alias, password.toCharArray());
if (key == null) {
throw new RuntimeException("Got null key from keystore!");
}
PrivateKey privKey = (PrivateKey) key;
return privKey;
} catch (UnrecoverableKeyException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (KeyStoreException e) {
e.printStackTrace();
}
return null;
}
****/
/**
* @return null on failure
*/
/****
public static PrivateKey readPrivateKey(String alias, File keyStoreFile, String keyStorePassword, String keyPassword) {
try {
KeyStore ks = getDefaultKeyStore();
ks.load(new FileInputStream(keyStoreFile), keyStorePassword.toCharArray());
return readPrivateKey(ks, alias, keyStorePassword);
} catch (CertificateException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
System.err.println("Couldn't read keystore from: " + keyStoreFile.toString());
e.printStackTrace();
}
return null;
}
****/
/**
* @return null on failure
*/
/****
public static KeyStore writeCACertToKeyStore(KeyStore keyStore, String keyPassword, String alias, PrivateKey caPrivKey, X509Certificate caCert) {
try {
X509Certificate[] chain = new X509Certificate[1];
chain[0] = caCert;
keyStore.setKeyEntry(alias, caPrivKey, keyPassword.toCharArray(), chain);
File keyStoreFile = new File(I2PControlController.getPluginDir() + File.separator + DEFAULT_KEYSTORE_NAME);
keyStore.store(new FileOutputStream(keyStoreFile), DEFAULT_KEYSTORE_PASSWORD.toCharArray());
return keyStore;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (CertificateException e) {
e.printStackTrace();
} catch (KeyStoreException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
****/
/**
* @return null on failure
*/
public synchronized KeyStore getDefaultKeyStore() {
if (_keystore == null) {
File keyStoreFile = new File(getKeyStoreLocation());
InputStream is = null;
try {
_keystore = KeyStore.getInstance(KeyStore.getDefaultType());
if (keyStoreFile.exists()) {
is = new FileInputStream(keyStoreFile);
_keystore.load(is, DEFAULT_KEYSTORE_PASSWORD.toCharArray());
return _keystore;
}
initialize();
if (keyStoreFile.exists()) {
is = new FileInputStream(keyStoreFile);
_keystore.load(is, DEFAULT_KEYSTORE_PASSWORD.toCharArray());
return _keystore;
} else {
throw new IOException("KeyStore file " + keyStoreFile.getAbsolutePath() + " wasn't readable");
}
} catch (Exception e) {
// Ignore. Not an issue. Let's just create a new keystore instead.
} finally {
if (is != null) try { is.close(); } catch (IOException ioe) {}
}
return null;
} else {
return _keystore;
}
}
public String getKeyStoreLocation() {
File keyStoreFile = new File(_pluginDir, DEFAULT_KEYSTORE_NAME);
return keyStoreFile.getAbsolutePath();
}
}

View File

@@ -0,0 +1,252 @@
package net.i2p.i2pcontrol.security;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import net.i2p.I2PAppContext;
import net.i2p.crypto.SHA256Generator;
import net.i2p.data.Base64;
import net.i2p.data.DataHelper;
import net.i2p.util.Log;
import net.i2p.util.SimpleTimer2;
import org.mindrot.jbcrypt.BCrypt;
import net.i2p.i2pcontrol.servlets.configuration.ConfigurationManager;
import javax.net.SocketFactory;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.security.KeyStore;
import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
import java.util.HashMap;
import java.util.Iterator;
/**
* Manage the password storing for I2PControl.
*/
public class SecurityManager {
public final static String DEFAULT_AUTH_PASSWORD = "itoopie";
private final HashMap<String, AuthToken> authTokens;
private final SimpleTimer2.TimedEvent timer;
private final KeyStore _ks;
private final Log _log;
private final ConfigurationManager _conf;
private final I2PAppContext _context;
/**
* @param ksp may be null (if webapp)
*/
public SecurityManager(I2PAppContext ctx, KeyStoreProvider ksp, ConfigurationManager conf) {
_context = ctx;
_conf = conf;
_log = ctx.logManager().getLog(SecurityManager.class);
authTokens = new HashMap<String, AuthToken>();
timer = new Sweeper();
_ks = ksp != null ? ksp.getDefaultKeyStore() : null;
}
public void stopTimedEvents() {
timer.cancel();
synchronized (authTokens) {
authTokens.clear();
}
}
/**
* Return the X509Certificate of the server as a Base64 encoded string.
* @return base64 encode of X509Certificate
*/
/**** unused and incorrectly uses I2P Base64. Switch to CertUtil.exportCert() if needed.
public String getBase64Cert() {
X509Certificate caCert = KeyStoreProvider.readCert(_ks,
KeyStoreProvider.DEFAULT_CERTIFICATE_ALIAS,
KeyStoreProvider.DEFAULT_KEYSTORE_PASSWORD);
return getBase64FromCert(caCert);
}
****/
/**
* Return the X509Certificate as a base64 encoded string.
* @param cert
* @return base64 encode of X509Certificate
*/
/**** unused and incorrectly uses I2P Base64. Switch to CertUtil.exportCert() if needed.
private static String getBase64FromCert(X509Certificate cert) {
try {
return Base64.encode(cert.getEncoded());
} catch (CertificateEncodingException e) {
e.printStackTrace();
}
return null;
}
****/
/**
* Hash pwd with using BCrypt with the default salt.
* @param pwd
* @return BCrypt hash of salt and input string
*/
public String getPasswdHash(String pwd) {
String salt;
synchronized(_conf) {
salt = _conf.getConf("auth.salt", "");
if (salt.equals("")) {
salt = BCrypt.gensalt(10, _context.random());
_conf.setConf("auth.salt", salt);
_conf.writeConfFile();
}
}
return BCrypt.hashpw(pwd, salt);
}
/**
* Get saved password hash. Stores if not previously set.
* @return BCrypt hash of salt and password
* @since 0.12
*/
private String getSavedPasswdHash() {
String pw;
synchronized(_conf) {
pw = _conf.getConf("auth.password", "");
if (pw.equals("")) {
pw = getPasswdHash(DEFAULT_AUTH_PASSWORD);
_conf.setConf("auth.password", pw);
_conf.writeConfFile();
}
}
return pw;
}
/**
* Hash input one time with SHA-256, return Base64 encdoded string.
* @param string
* @return Base64 encoded string
*/
public String getHash(String string) {
SHA256Generator hashGen = _context.sha();
byte[] bytes = string.getBytes();
bytes = hashGen.calculateHash(bytes).toByteArray();
return Base64.encode(bytes);
}
/**
* Is this password correct?
* @return true if password is valid.
* @since 0.12
*/
public boolean isValid(String pwd) {
String storedPass = getSavedPasswdHash();
byte[] p1 = DataHelper.getASCII(getPasswdHash(pwd));
byte[] p2 = DataHelper.getASCII(storedPass);
return p1.length == p2.length && DataHelper.eqCT(p1, 0, p2, 0, p1.length);
}
/**
* Is this password correct?
* @return true if password is valid.
* @since 0.12
*/
public boolean isDefaultPasswordValid() {
return isValid(DEFAULT_AUTH_PASSWORD);
}
/**
* Add a Authentication Token if the provided password is valid.
* The token will be valid for one day.
* @return AuthToken if password is valid. If password is invalid null will be returned.
*/
public AuthToken validatePasswd(String pwd) {
if (isValid(pwd)) {
AuthToken token = new AuthToken(this, pwd);
synchronized (authTokens) {
authTokens.put(token.getId(), token);
}
return token;
} else {
return null;
}
}
/**
* Set new password. Old tokens will NOT remain valid, to encourage the new password being tested.
* @param newPasswd
* @return Returns true if a new password was set.
*/
public boolean setPasswd(String newPasswd) {
String newHash = getPasswdHash(newPasswd);
String oldHash = getSavedPasswdHash();
if (!newHash.equals(oldHash)) {
_conf.setConf("auth.password", newHash);
_conf.writeConfFile();
synchronized (authTokens) {
authTokens.clear();
}
return true;
}
return false;
}
/**
* Checks whether the AuthToken with the given ID exists and if it does whether is has expired.
* @param tokenID - The token to validate
* @throws InvalidAuthTokenException
* @throws ExpiredAuthTokenException
*/
public void verifyToken(String tokenID) throws InvalidAuthTokenException, ExpiredAuthTokenException {
synchronized (authTokens) {
AuthToken token = authTokens.get(tokenID);
if (token == null)
throw new InvalidAuthTokenException("AuthToken with ID: " + tokenID + " couldn't be found.");
if (!token.isValid()) {
authTokens.remove(tokenID);
throw new ExpiredAuthTokenException("AuthToken with ID: " + tokenID + " expired " + token.getExpiryTime(), token.getExpiryTime());
}
}
// Everything is fine. :)
}
/**
* Clean up old authorization tokens to keep the token store slim and fit.
* @author hottuna
*
*/
private class Sweeper extends SimpleTimer2.TimedEvent {
// Start running periodic task after 1 day, run periodically every 30 minutes.
public Sweeper() {
super(_context.simpleTimer2(), AuthToken.VALIDITY_TIME * 24*60*60*1000L);
}
public void timeReached() {
_log.debug("Starting cleanup job..");
synchronized (authTokens) {
for (Iterator<AuthToken> iter = authTokens.values().iterator(); iter.hasNext(); ) {
AuthToken token = iter.next();
if (!token.isValid())
iter.remove();
}
}
_log.debug("Cleanup job done.");
schedule(30*60*1000L);
}
}
}

View File

@@ -0,0 +1,264 @@
package net.i2p.i2pcontrol.servlets;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import com.thetransactioncompany.jsonrpc2.*;
import com.thetransactioncompany.jsonrpc2.server.Dispatcher;
import net.i2p.I2PAppContext;
import net.i2p.router.RouterContext;
import net.i2p.util.Log;
import net.i2p.util.PortMapper;
import net.i2p.i2pcontrol.I2PControlVersion;
import net.i2p.i2pcontrol.security.KeyStoreProvider;
import net.i2p.i2pcontrol.security.SecurityManager;
import net.i2p.i2pcontrol.servlets.jsonrpc2handlers.*;
import net.i2p.i2pcontrol.servlets.configuration.ConfigurationManager;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
/**
* Provide an JSON-RPC 2.0 API for remote controlling of I2P
*/
public class JSONRPC2Servlet extends HttpServlet {
private static final long serialVersionUID = -45075606818515212L;
private static final int BUFFER_LENGTH = 2048;
private static final String SVC_HTTP_I2PCONTROL = "http_i2pcontrol";
private static final String SVC_HTTPS_I2PCONTROL = "https_i2pcontrol";
private Dispatcher disp;
private Log _log;
private final SecurityManager _secMan;
private final ConfigurationManager _conf;
private final JSONRPC2Helper _helper;
private final RouterContext _context;
private final boolean _isWebapp;
private boolean _isHTTP, _isHTTPS;
/**
* Webapp
*/
public JSONRPC2Servlet() {
I2PAppContext ctx = I2PAppContext.getGlobalContext();
if (!ctx.isRouterContext())
throw new IllegalStateException();
_context = (RouterContext) ctx;
File appDir = ctx.getAppDir();
_conf = new ConfigurationManager(ctx, appDir, false);
// we don't really need a keystore
//File ksDir = new File(ctx.getConfigDir(), "keystore");
//ksDir.mkDir();
//KeyStoreProvider ksp = new KeyStoreProvider(ksDir.getAbsolutePath());
//_secMan = new SecurityManager(ctx, ksp, _conf);
_secMan = new SecurityManager(ctx, null, _conf);
_helper = new JSONRPC2Helper(_secMan);
_log = ctx.logManager().getLog(JSONRPC2Servlet.class);
_conf.writeConfFile();
_isWebapp = true;
}
/**
* Plugin
*/
public JSONRPC2Servlet(RouterContext ctx, SecurityManager secMan) {
_context = ctx;
_secMan = secMan;
_helper = new JSONRPC2Helper(_secMan);
if (ctx != null)
_log = ctx.logManager().getLog(JSONRPC2Servlet.class);
else
_log = I2PAppContext.getGlobalContext().logManager().getLog(JSONRPC2Servlet.class);
_conf = null;
_isWebapp = false;
}
@Override
public void init() throws ServletException {
super.init();
disp = new Dispatcher();
disp.register(new EchoHandler(_helper));
disp.register(new GetRateHandler(_helper));
disp.register(new AuthenticateHandler(_helper, _secMan));
disp.register(new NetworkSettingHandler(_context, _helper));
disp.register(new RouterInfoHandler(_context, _helper));
disp.register(new RouterManagerHandler(_context, _helper));
disp.register(new I2PControlHandler(_context, _helper, _secMan));
disp.register(new AdvancedSettingsHandler(_context, _helper));
if (_isWebapp) {
PortMapper pm = _context.portMapper();
int port = pm.getPort(PortMapper.SVC_CONSOLE);
if (port > 0) {
String host = pm.getHost(PortMapper.SVC_CONSOLE, "127.0.0.1");
pm.register(SVC_HTTP_I2PCONTROL, host, port);
_isHTTP = true;
}
port = pm.getPort(PortMapper.SVC_HTTPS_CONSOLE);
if (port > 0) {
String host = pm.getHost(PortMapper.SVC_HTTPS_CONSOLE, "127.0.0.1");
pm.register(SVC_HTTPS_I2PCONTROL, host, port);
_isHTTPS = true;
}
}
}
@Override
public void destroy() {
if (_isWebapp) {
PortMapper pm = _context.portMapper();
if (_isHTTP)
pm.unregister(SVC_HTTP_I2PCONTROL);
if (_isHTTPS)
pm.unregister(SVC_HTTPS_I2PCONTROL);
_secMan.stopTimedEvents();
_conf.writeConfFile();
}
super.destroy();
}
@Override
protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
setHeaders(httpServletResponse);
PrintWriter out = httpServletResponse.getWriter();
out.println("<html><head></head><body>");
out.println("<p>I2PControl RPC Service version " + I2PControlVersion.VERSION + " : Running");
if ("/password".equals(httpServletRequest.getServletPath())) {
out.println("<form method=\"POST\" action=\"password\">");
if (_secMan.isDefaultPasswordValid()) {
out.println("<p>The current API password is the default, \"" + _secMan.DEFAULT_AUTH_PASSWORD + "\". You should change it.");
} else {
out.println("<p>Current API password:<input name=\"password\" type=\"password\">");
}
out.println("<p>New API password (twice):<input name=\"password2\" type=\"password\">" +
"<input name=\"password3\" type=\"password\">" +
"<input name=\"save\" type=\"submit\" value=\"Change API Password\">" +
"<p>If you forget the API password, stop i2pcontrol, delete the file <tt>" + _conf.getConfFile() +
"</tt>, and restart i2pcontrol.");
out.println("</form>");
} else {
out.println("<p><a href=\"password\">Change API Password</a>");
}
out.println("</body></html>");
out.close();
}
/** @since 0.12 */
private void doPasswordChange(HttpServletRequest req, HttpServletResponse httpServletResponse) throws ServletException, IOException {
setHeaders(httpServletResponse);
PrintWriter out = httpServletResponse.getWriter();
out.println("<html><head></head><body>");
String pw = req.getParameter("password");
if (pw == null)
pw = _secMan.DEFAULT_AUTH_PASSWORD;
else
pw = pw.trim();
String pw2 = req.getParameter("password2");
String pw3 = req.getParameter("password3");
if (pw2 == null || pw3 == null) {
out.println("<p>Enter new password twice!");
} else {
pw2 = pw2.trim();
pw3 = pw3.trim();
if (!pw2.equals(pw3)) {
out.println("<p>New passwords don't match!");
} else if (pw2.length() <= 0) {
out.println("<p>Enter new password twice!");
} else if (_secMan.isValid(pw)) {
_secMan.setPasswd(pw2);
out.println("<p>API Password changed");
} else {
out.println("<p>Incorrect old password, not changed");
}
}
out.println("<p><a href=\"password\">Change API Password</a>");
out.println("</body></html>");
out.close();
}
/**
* @since 0.9.48
*/
private static void setHeaders(HttpServletResponse resp) {
resp.setContentType("text/html");
resp.setHeader("X-Frame-Options", "SAMEORIGIN");
resp.setHeader("Content-Security-Policy", "default-src 'self'; style-src 'self'; script-src 'self'; form-action 'self'; frame-ancestors 'self'; object-src 'none'; media-src 'none'");
resp.setHeader("X-XSS-Protection", "1; mode=block");
resp.setHeader("X-Content-Type-Options", "nosniff");
resp.setHeader("Pragma", "no-cache");
resp.setHeader("Cache-Control","no-cache");
}
@Override
protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
if ("/password".equals(httpServletRequest.getServletPath())) {
doPasswordChange(httpServletRequest, httpServletResponse);
return;
}
String req = getRequest(httpServletRequest.getInputStream());
httpServletResponse.setContentType("application/json");
PrintWriter out = httpServletResponse.getWriter();
JSONRPC2Message msg = null;
JSONRPC2Response jsonResp = null;
try {
msg = JSONRPC2Message.parse(req);
if (msg instanceof JSONRPC2Request) {
jsonResp = disp.process((JSONRPC2Request)msg, null);
jsonResp.toJSONObject().put("API", I2PControlVersion.API_VERSION);
if (_log.shouldDebug()) {
_log.debug("Request: " + msg);
_log.debug("Response: " + jsonResp);
}
}
else if (msg instanceof JSONRPC2Notification) {
disp.process((JSONRPC2Notification)msg, null);
if (_log.shouldDebug())
_log.debug("Notification: " + msg);
}
out.println(jsonResp);
out.close();
} catch (JSONRPC2ParseException e) {
_log.error("Unable to parse JSONRPC2Message: " + e.getMessage());
}
}
private String getRequest(ServletInputStream sis) throws IOException {
Writer writer = new StringWriter();
BufferedReader reader = new BufferedReader(new InputStreamReader(sis, "UTF-8"));
char[] readBuffer = new char[BUFFER_LENGTH];
int n;
while ((n = reader.read(readBuffer)) != -1) {
writer.write(readBuffer, 0, n);
}
return writer.toString();
}
}

View File

@@ -0,0 +1,219 @@
package net.i2p.i2pcontrol.servlets.configuration;
import net.i2p.I2PAppContext;
import net.i2p.data.DataHelper;
import net.i2p.util.Log;
import net.i2p.util.OrderedProperties;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
/**
* Manage the configuration of I2PControl.
* @author mathias
* modified: hottuna
*
*/
public class ConfigurationManager {
private final String CONFIG_FILE = "I2PControl.conf";
private final String WEBAPP_CONFIG_FILE = "i2pcontrol.config";
private final File configLocation;
private final Log _log;
private boolean _changed;
//Configurations with a String as value
private final Map<String, String> stringConfigurations = new HashMap<String, String>();
//Configurations with a Boolean as value
private final Map<String, Boolean> booleanConfigurations = new HashMap<String, Boolean>();
//Configurations with an Integer as value
private final Map<String, Integer> integerConfigurations = new HashMap<String, Integer>();
public ConfigurationManager(I2PAppContext ctx, File dir, boolean isPlugin) {
_log = ctx.logManager().getLog(ConfigurationManager.class);
if (isPlugin) {
configLocation = new File(dir, CONFIG_FILE);
} else {
configLocation = new File(dir, WEBAPP_CONFIG_FILE);
}
readConfFile();
}
/** @since 0.12 */
public File getConfFile() {
return configLocation;
}
/**
* Collects arguments of the form --word, --word=otherword and -blah
* to determine user parameters.
* @param settingNames Command line arguments to the application
*/
/****
public void loadArguments(String[] settingNames) {
for (int i = 0; i < settingNames.length; i++) {
String settingName = settingNames[i];
if (settingName.startsWith("--")) {
parseConfigStr(settingName.substring(2));
}
}
}
****/
/**
* Reads configuration from file, every line is parsed as key=value.
*/
public synchronized void readConfFile() {
try {
Properties input = new Properties();
// true: map to lower case
DataHelper.loadProps(input, configLocation, true);
parseConfigStr(input);
_changed = false;
} catch (FileNotFoundException e) {
if (_log.shouldInfo())
_log.info("Unable to find config file, " + configLocation);
} catch (IOException e) {
_log.error("Unable to read from config file, " + configLocation, e);
}
}
/**
* Write configuration into default config file.
* As of 0.12, doesn't actually write unless something changed.
*/
public synchronized void writeConfFile() {
if (!_changed)
return;
Properties tree = new OrderedProperties();
tree.putAll(stringConfigurations);
for (Entry<String, Integer> e : integerConfigurations.entrySet()) {
tree.put(e.getKey(), e.getValue().toString());
}
for (Entry<String, Boolean> e : booleanConfigurations.entrySet()) {
tree.put(e.getKey(), e.getValue().toString());
}
try {
DataHelper.storeProps(tree, configLocation);
_changed = false;
} catch (IOException e1) {
_log.error("Couldn't open file, " + configLocation + " for writing config.");
}
}
/**
* Try to parse the input as 'key=value',
* where value will (in order) be parsed as integer/boolean/string.
* @param str
*/
private void parseConfigStr(Properties input) {
for (Entry<Object, Object> entry : input.entrySet()) {
String key = (String) entry.getKey();
String value = (String) entry.getValue();
//Try parse as integer.
try {
int i = Integer.parseInt(value);
integerConfigurations.put(key, i);
continue;
} catch (NumberFormatException e) {}
//Check if value is a bool
if (value.toLowerCase().equals("true")) {
booleanConfigurations.put(key, Boolean.TRUE);
continue;
} else if (value.toLowerCase().equals("false")) {
booleanConfigurations.put(key, Boolean.FALSE);
continue;
}
stringConfigurations.put(key, value);
}
}
/**
* Check if a specific boolean configuration exists.
* @param settingName The key for the configuration.
* @param defaultValue If the configuration is not found, we use a default value.
* @return The value of a configuration: true if found, defaultValue if not found.
*/
public synchronized boolean getConf(String settingName, boolean defaultValue) {
Boolean value = booleanConfigurations.get(settingName);
if (value != null) {
return value;
} else {
booleanConfigurations.put(settingName, defaultValue);
_changed = true;
return defaultValue;
}
}
/**
* Check if a specific boolean configuration exists.
* @param settingName The key for the configuration.
* @param defaultValue If the configuration is not found, we use a default value.
* @return The value of a configuration: true if found, defaultValue if not found.
*/
public synchronized int getConf(String settingName, int defaultValue) {
Integer value = integerConfigurations.get(settingName);
if (value != null) {
return value;
} else {
integerConfigurations.put(settingName, defaultValue);
_changed = true;
return defaultValue;
}
}
/**
* Get a specific String configuration.
* @param settingName The key for the configuration.
* @param defaultValue If the configuration is not found, we use a default value.
* @return The value of the configuration, or the defaultValue.
*/
public synchronized String getConf(String settingName, String defaultValue) {
String value = stringConfigurations.get(settingName);
if (value != null) {
return value;
} else {
stringConfigurations.put(settingName, defaultValue);
_changed = true;
return defaultValue;
}
}
/**
* Set a specific int setting
* @param settingName
* @param nbr
*/
public synchronized void setConf(String settingName, int nbr) {
integerConfigurations.put(settingName, nbr);
_changed = true;
}
/**
* Set a specific string setting
* @param settingName
* @param str
*/
public synchronized void setConf(String settingName, String str) {
stringConfigurations.put(settingName, str);
_changed = true;
}
/**
* Set a specific boolean setting
* @param settingName
* @param bool
*/
public synchronized void setConf(String settingName, boolean bool) {
booleanConfigurations.put(settingName, bool);
_changed = true;
}
}

View File

@@ -0,0 +1,200 @@
package net.i2p.i2pcontrol.servlets.jsonrpc2handlers;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;
import com.thetransactioncompany.jsonrpc2.server.MessageContext;
import com.thetransactioncompany.jsonrpc2.server.RequestHandler;
import net.i2p.I2PAppContext;
import net.i2p.router.RouterContext;
import net.i2p.util.Log;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class AdvancedSettingsHandler implements RequestHandler {
private final RouterContext _context;
private final Log _log;
private final JSONRPC2Helper _helper;
private static final String[] requiredArgs = {};
public AdvancedSettingsHandler(RouterContext ctx, JSONRPC2Helper helper) {
_helper = helper;
_context = ctx;
if (ctx != null)
_log = ctx.logManager().getLog(AdvancedSettingsHandler.class);
else
_log = I2PAppContext.getGlobalContext().logManager().getLog(AdvancedSettingsHandler.class);
}
// Reports the method names of the handled requests
public String[] handledRequests() {
return new String[] {"AdvancedSettings"};
}
// Processes the requests
@SuppressWarnings("unchecked")
public JSONRPC2Response process(JSONRPC2Request req, MessageContext ctx) {
if (req.getMethod().equals("AdvancedSettings")) {
JSONRPC2Error err = _helper.validateParams(requiredArgs, req);
if (err != null) {
return new JSONRPC2Response(err, req.getID());
}
if (_context == null) {
return new JSONRPC2Response(new JSONRPC2Error(
JSONRPC2Error.INTERNAL_ERROR.getCode(),
"RouterContext was not initialized. Query failed"),
req.getID());
}
@SuppressWarnings("rawtypes")
Map<String, Object> inParams = req.getNamedParams();
Map outParams = new HashMap();
if (inParams.containsKey("setAll")) {
Object obj = inParams.get("setAll");
if (!(obj instanceof Map)) {
JSONRPC2Error rpcErr = new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"Value of \"setAll\" is not a Map");
return new JSONRPC2Response(rpcErr, req.getID());
}
@SuppressWarnings("rawtypes")
Map objMap = (Map) inParams.get("setAll");
if (objMap.size() > 0)
{
if (!(objMap.keySet().toArray()[0] instanceof String) &&
!(objMap.values().toArray()[0] instanceof String)) {
JSONRPC2Error rpcErr = new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"Map of settings does not contain String keys and values");
return new JSONRPC2Response(rpcErr, req.getID());
}
if (!checkTypes(objMap)) {
JSONRPC2Error rpcErr = new JSONRPC2Error(JSONRPC2Error.INTERNAL_ERROR.getCode(),
"Some of the supplied values are not strings");
return new JSONRPC2Response(rpcErr, req.getID());
}
Map<String, String> allSettings = (Map<String, String>) objMap;
boolean success = setAdvancedSettings(allSettings, true);
if (!success) {
JSONRPC2Error rpcErr = new JSONRPC2Error(JSONRPC2Error.INTERNAL_ERROR.getCode(),
"Failed to save new config");
return new JSONRPC2Response(rpcErr, req.getID());
}
} else {
// Empty list of settings submitted
boolean success = setAdvancedSettings(null, true);
if (!success) {
JSONRPC2Error rpcErr = new JSONRPC2Error(JSONRPC2Error.INTERNAL_ERROR.getCode(),
"Failed to save new config");
return new JSONRPC2Response(rpcErr, req.getID());
}
}
}
if (inParams.containsKey("getAll")) {
outParams.put("getAll", getAdvancedSettings());
}
if (inParams.containsKey("set")) {
Object obj = inParams.get("set");
if (!(obj instanceof Map)) {
JSONRPC2Error rpcErr = new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"Value of \"set\" is not a Map");
return new JSONRPC2Response(rpcErr, req.getID());
}
Map objMap = (Map) inParams.get("set");
if (objMap.size() > 0)
{
if (!(objMap.keySet().toArray()[0] instanceof String) &&
!(objMap.values().toArray()[0] instanceof String)) {
JSONRPC2Error rpcErr = new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"Map of settings does not contain String keys and values");
return new JSONRPC2Response(rpcErr, req.getID());
}
if (!checkTypes(objMap)) {
JSONRPC2Error rpcErr = new JSONRPC2Error(JSONRPC2Error.INTERNAL_ERROR.getCode(),
"Some of the supplied values are not strings");
return new JSONRPC2Response(rpcErr, req.getID());
}
Map<String, String> allSettings = (Map<String, String>) objMap;
boolean success = setAdvancedSettings(allSettings, false);
if (!success) {
JSONRPC2Error rpcErr = new JSONRPC2Error(JSONRPC2Error.INTERNAL_ERROR.getCode(),
"Failed to save new config");
return new JSONRPC2Response(rpcErr, req.getID());
}
} else {
// Empty list of settings submitted
JSONRPC2Error rpcErr = new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"Map of settings does not contain any entries");
return new JSONRPC2Response(rpcErr, req.getID());
}
}
if (inParams.containsKey("get")) {
Object obj = inParams.get("get");
if (!(obj instanceof String)) {
JSONRPC2Error rpcErr = new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"Value of \"get\" is not a string");
return new JSONRPC2Response(rpcErr, req.getID());
}
String getStr = (String) obj;
String getVal = getAdvancedSetting(getStr);
Map<String, String> outMap = new HashMap<String, String>();
outMap.put(getStr, getVal);
outParams.put("get", outMap);
}
return new JSONRPC2Response(outParams, req.getID());
} else {
// Method name not supported
return new JSONRPC2Response(JSONRPC2Error.METHOD_NOT_FOUND, req.getID());
}
}
private String getAdvancedSetting(String key) {
return _context.router().getConfigSetting(key);
}
private Map<String, String> getAdvancedSettings() {
return _context.router().getConfigMap();
}
private boolean checkTypes(Map<String, Object> newSettings) {
for (String key : newSettings.keySet()) {
if (!(newSettings.get(key) instanceof String)) {
return false;
}
}
return true;
}
private boolean setAdvancedSettings(Map<String, String> newSettings, boolean clearConfig) {
Set<String> unsetKeys = null;
if (clearConfig) {
unsetKeys = new HashSet<String>(_context.router().getConfigSettings());
for (String key : newSettings.keySet()) {
unsetKeys.remove(key);
}
}
return _context.router().saveConfig(newSettings, unsetKeys);
}
}

View File

@@ -0,0 +1,105 @@
package net.i2p.i2pcontrol.servlets.jsonrpc2handlers;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;
import com.thetransactioncompany.jsonrpc2.server.MessageContext;
import com.thetransactioncompany.jsonrpc2.server.RequestHandler;
import net.i2p.i2pcontrol.I2PControlVersion;
import net.i2p.i2pcontrol.security.AuthToken;
import net.i2p.i2pcontrol.security.SecurityManager;
import java.util.HashMap;
import java.util.Map;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
public class AuthenticateHandler implements RequestHandler {
private static final String[] requiredArgs = {"Password", "API"};
private final JSONRPC2Helper _helper;
private final SecurityManager _secMan;
public AuthenticateHandler(JSONRPC2Helper helper, SecurityManager secMan) {
_helper = helper;
_secMan = secMan;
}
// Reports the method names of the handled requests
public String[] handledRequests() {
return new String[] {"Authenticate"};
}
// Processes the requests
public JSONRPC2Response process(JSONRPC2Request req, MessageContext ctx) {
if (req.getMethod().equals("Authenticate")) {
JSONRPC2Error err = _helper.validateParams(requiredArgs, req, JSONRPC2Helper.USE_NO_AUTH);
if (err != null)
return new JSONRPC2Response(err, req.getID());
Map<String, Object> inParams = req.getNamedParams();
String pwd = (String) inParams.get("Password");
// Try get an AuthToken
AuthToken token = _secMan.validatePasswd(pwd);
if (token == null) {
return new JSONRPC2Response(JSONRPC2ExtendedError.INVALID_PASSWORD, req.getID());
}
Object api = inParams.get("API");
err = validateAPIVersion(api);
if (err != null)
return new JSONRPC2Response(err, req.getID());
Map<String, Object> outParams = new HashMap<String, Object>(4);
outParams.put("Token", token.getId());
outParams.put("API", I2PControlVersion.API_VERSION);
return new JSONRPC2Response(outParams, req.getID());
} else {
// Method name not supported
return new JSONRPC2Response(JSONRPC2Error.METHOD_NOT_FOUND, req.getID());
}
}
/**
* Validate the provided I2PControl API version against the ones supported by I2PControl.
*/
private static JSONRPC2Error validateAPIVersion(Object api) {
Integer apiVersion;
try {
apiVersion = ((Number) api).intValue();
} catch (ClassCastException e) {
e.printStackTrace();
return JSONRPC2ExtendedError.UNSPECIFIED_API_VERSION;
}
if (!I2PControlVersion.SUPPORTED_API_VERSIONS.contains(apiVersion)) {
String supportedAPIVersions = "";
for (Integer i : I2PControlVersion.SUPPORTED_API_VERSIONS) {
supportedAPIVersions += ", " + i;
}
return new JSONRPC2Error(JSONRPC2ExtendedError.UNSUPPORTED_API_VERSION.getCode(),
"The provided API version \'" + apiVersion + "\' is not supported. The supported versions are" + supportedAPIVersions + ".");
}
return null;
}
}

View File

@@ -0,0 +1,44 @@
package net.i2p.i2pcontrol.servlets.jsonrpc2handlers;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;
import com.thetransactioncompany.jsonrpc2.server.MessageContext;
import com.thetransactioncompany.jsonrpc2.server.RequestHandler;
import java.util.HashMap;
import java.util.Map;
public class EchoHandler implements RequestHandler {
private static final String[] requiredArgs = {"Echo"};
private final JSONRPC2Helper _helper;
public EchoHandler(JSONRPC2Helper helper) {
_helper = helper;
}
// Reports the method names of the handled requests
public String[] handledRequests() {
return new String[] {"Echo"};
}
// Processes the requests
public JSONRPC2Response process(JSONRPC2Request req, MessageContext ctx) {
if (req.getMethod().equals("Echo")) {
JSONRPC2Error err = _helper.validateParams(requiredArgs, req);
if (err != null)
return new JSONRPC2Response(err, req.getID());
Map<String, Object> inParams = req.getNamedParams();
String echo = (String) inParams.get("Echo");
Map<String, Object> outParams = new HashMap<String, Object>(4);
outParams.put("Result", echo);
return new JSONRPC2Response(outParams, req.getID());
}
else {
// Method name not supported
return new JSONRPC2Response(JSONRPC2Error.METHOD_NOT_FOUND, req.getID());
}
}
}

View File

@@ -0,0 +1,83 @@
package net.i2p.i2pcontrol.servlets.jsonrpc2handlers;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;
import com.thetransactioncompany.jsonrpc2.server.MessageContext;
import com.thetransactioncompany.jsonrpc2.server.RequestHandler;
import net.i2p.I2PAppContext;
import net.i2p.stat.Rate;
import net.i2p.stat.RateStat;
import java.util.HashMap;
import java.util.Map;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
public class GetRateHandler implements RequestHandler {
private static final String[] requiredArgs = {"Stat", "Period"};
private final JSONRPC2Helper _helper;
public GetRateHandler(JSONRPC2Helper helper) {
_helper = helper;
}
// Reports the method names of the handled requests
public String[] handledRequests() {
return new String[] {"GetRate"};
}
// Processes the requests
public JSONRPC2Response process(JSONRPC2Request req, MessageContext ctx) {
if (req.getMethod().equals("GetRate")) {
JSONRPC2Error err = _helper.validateParams(requiredArgs, req);
if (err != null)
return new JSONRPC2Response(err, req.getID());
Map<String, Object> inParams = req.getNamedParams();
String input = (String) inParams.get("Stat");
if (input == null) {
return new JSONRPC2Response(JSONRPC2Error.INVALID_PARAMS, req.getID());
}
Number p = (Number) inParams.get("Period");
if (p == null)
return new JSONRPC2Response(JSONRPC2Error.INVALID_PARAMS, req.getID());
long period = p.longValue();
RateStat rateStat = I2PAppContext.getGlobalContext().statManager().getRate(input);
// If RateStat or the requested period doesn't already exist, create them.
if (rateStat == null || rateStat.getRate(period) == null) {
long[] tempArr = new long[1];
tempArr[0] = period;
I2PAppContext.getGlobalContext().statManager().createRequiredRateStat(input, "I2PControl", "I2PControl", tempArr);
rateStat = I2PAppContext.getGlobalContext().statManager().getRate(input);
}
if (rateStat.getRate(period) == null)
return new JSONRPC2Response(JSONRPC2Error.INTERNAL_ERROR, req.getID());
Map<String, Object> outParams = new HashMap<String, Object>(4);
Rate rate = rateStat.getRate(period);
rate.coalesce();
outParams.put("Result", rate.getAverageValue());
return new JSONRPC2Response(outParams, req.getID());
}
return new JSONRPC2Response(JSONRPC2Error.METHOD_NOT_FOUND, req.getID());
}
}

View File

@@ -0,0 +1,205 @@
package net.i2p.i2pcontrol.servlets.jsonrpc2handlers;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;
import com.thetransactioncompany.jsonrpc2.server.MessageContext;
import com.thetransactioncompany.jsonrpc2.server.RequestHandler;
import net.i2p.I2PAppContext;
import net.i2p.i2pcontrol.I2PControlController;
import net.i2p.i2pcontrol.security.SecurityManager;
import net.i2p.i2pcontrol.servlets.configuration.ConfigurationManager;
import net.i2p.router.RouterContext;
import net.i2p.util.Log;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
public class I2PControlHandler implements RequestHandler {
private static final int BW_BURST_PCT = 110;
private static final int BW_BURST_TIME = 20;
private final RouterContext _context;
private final Log _log;
//private final ConfigurationManager _conf;
private final SecurityManager _secMan;
private final JSONRPC2Helper _helper;
public I2PControlHandler(RouterContext ctx, JSONRPC2Helper helper, SecurityManager secMan) {
_helper = helper;
_secMan = secMan;
_context = ctx;
if (ctx != null)
_log = ctx.logManager().getLog(I2PControlHandler.class);
else
_log = I2PAppContext.getGlobalContext().logManager().getLog(I2PControlHandler.class);
}
// Reports the method names of the handled requests
public String[] handledRequests() {
return new String[] {"I2PControl"};
}
// Processes the requests
public JSONRPC2Response process(JSONRPC2Request req, MessageContext ctx) {
if (req.getMethod().equals("I2PControl")) {
return process(req);
} else {
// Method name not supported
return new JSONRPC2Response(JSONRPC2Error.METHOD_NOT_FOUND, req.getID());
}
}
private JSONRPC2Response process(JSONRPC2Request req) {
JSONRPC2Error err = _helper.validateParams(null, req);
if (err != null)
return new JSONRPC2Response(err, req.getID());
/**** only if we enable host/port changes
if (_context == null) {
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INTERNAL_ERROR.getCode(),
"RouterContext was not initialized. Query failed"),
req.getID());
}
****/
Map<String, Object> inParams = req.getNamedParams();
Map<String, Object> outParams = new HashMap<String, Object>(4);
boolean restartNeeded = false;
boolean settingsSaved = false;
String inParam;
/****
if (inParams.containsKey("i2pcontrol.port")) {
Integer oldPort = _conf.getConf("i2pcontrol.listen.port", 7650);
if ((inParam = (String) inParams.get("i2pcontrol.port")) != null) {
if (oldPort == null || !inParam.equals(oldPort.toString())) {
Integer newPort;
try {
newPort = Integer.valueOf(inParam);
if (newPort < 1 || newPort > 65535) {
throw new NumberFormatException();
}
} catch (NumberFormatException e) {
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"\"i2pcontrol.port\" must be a string representing a number in the range 1-65535. " + inParam + " isn't valid."),
req.getID());
}
try {
SslSocketConnector ssl = I2PControlController.buildSslListener(_conf.getConf("i2pcontrol.listen.address", "127.0.0.1"), newPort);
I2PControlController.clearListeners();
I2PControlController.replaceListener(ssl);
_conf.setConf("i2pcontrol.listen.port", newPort);
ConfigurationManager.writeConfFile();
outParams.put("i2pcontrol.port", null);
settingsSaved = true;
} catch (Exception e) {
try {
_conf.setConf("i2pcontrol.listen.port", oldPort);
SslSocketConnector ssl = I2PControlController.buildSslListener(_conf.getConf("i2pcontrol.listen.address", "127.0.0.1"), oldPort);
I2PControlController.clearListeners();
I2PControlController.replaceListener(ssl);
} catch (Exception e2) {
_log.log(Log.CRIT, "Unable to resume server on previous listening port.");
}
_log.error("Client tried to set listen port to, " + newPort + " which isn't valid.", e);
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"\"i2pcontrol.port\" has been set to a port that is already in use, reverting. " +
inParam + " is an already used port.\n"
+ "Exception: " + e.toString()),
req.getID());
}
}
}
outParams.put("RestartNeeded", restartNeeded);
}
****/
if (inParams.containsKey("i2pcontrol.password")) {
if ((inParam = (String) inParams.get("i2pcontrol.password")) != null) {
if (_secMan.setPasswd(inParam)) {
outParams.put("i2pcontrol.password", null);
settingsSaved = true;
}
}
}
/****
if (inParams.containsKey("i2pcontrol.address")) {
String oldAddress = _conf.getConf("i2pcontrol.listen.address", "127.0.0.1");
if ((inParam = (String) inParams.get("i2pcontrol.address")) != null) {
if ((oldAddress == null || !inParam.equals(oldAddress.toString()) &&
(inParam.equals("0.0.0.0") || inParam.equals("127.0.0.1")))) {
InetAddress[] newAddress;
try {
newAddress = InetAddress.getAllByName(inParam);
} catch (UnknownHostException e) {
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"\"i2pcontrol.address\" must be a string representing a hostname or ipaddress. " + inParam + " isn't valid."),
req.getID());
}
try {
SslSocketConnector ssl = I2PControlController.buildSslListener(inParam, _conf.getConf("i2pcontrol.listen.port", 7650));
I2PControlController.clearListeners();
I2PControlController.replaceListener(ssl);
_conf.setConf("i2pcontrol.listen.address", inParam);
ConfigurationManager.writeConfFile();
outParams.put("i2pcontrol.address", null);
settingsSaved = true;
} catch (Exception e) {
_conf.setConf("i2pcontrol.listen.address", oldAddress);
try {
SslSocketConnector ssl = I2PControlController.buildSslListener(inParam, _conf.getConf("i2pcontrol.listen.port", 7650));
I2PControlController.clearListeners();
I2PControlController.replaceListener(ssl);
} catch (Exception e2) {
_log.log(Log.CRIT, "Unable to resume server on previous listening ip.");
}
_log.error("Client tried to set listen address to, " + newAddress.toString() + " which isn't valid.", e);
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"\"i2pcontrol.address\" has been set to an invalid address, reverting. "), req.getID());
}
}
} else {
outParams.put("i2pcontrol.address", oldAddress);
}
outParams.put("RestartNeeded", restartNeeded);
}
****/
outParams.put("SettingsSaved", settingsSaved);
return new JSONRPC2Response(outParams, req.getID());
}
}

View File

@@ -0,0 +1,123 @@
package net.i2p.i2pcontrol.servlets.jsonrpc2handlers;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* Represents a JSON-RPC 2.0 error that occured during the processing of a
* request.
*
* <p>The protocol expects error objects to be structured like this:
*
* <ul>
* <li>{@code code} An integer that indicates the error type.
* <li>{@code message} A string providing a short description of the
* error. The message should be limited to a concise single sentence.
* <li>{@code data} Additional information, which may be omitted. Its
* contents is entirely defined by the application.
* </ul>
*
* <p>Note that the "Error" word in the class name was put there solely to
* comply with the parlance of the JSON-RPC spec. This class doesn't inherit
* from {@code java.lang.Error}. It's a regular subclass of
* {@code java.lang.Exception} and, if thrown, it's to indicate a condition
* that a reasonable application might want to catch.
*
* <p>This class also includes convenient final static instances for all
* standard JSON-RPC 2.0 errors:
*
* <ul>
* <li>{@link #PARSE_ERROR} JSON parse error (-32700)
* <li>{@link #INVALID_REQUEST} Invalid JSON-RPC 2.0 Request (-32600)
* <li>{@link #METHOD_NOT_FOUND} Method not found (-32601)
* <li>{@link #INVALID_PARAMS} Invalid parameters (-32602)
* <li>{@link #INTERNAL_ERROR} Internal error (-32603)
* </ul>
*
* <p>Note that the range -32099..-32000 is reserved for additional server
* errors.
*
* <p id="map">The mapping between JSON and Java entities (as defined by the
* underlying JSON.simple library):
* <pre>
* true|false &lt;---&gt; java.lang.Boolean
* number &lt;---&gt; java.lang.Number
* string &lt;---&gt; java.lang.String
* array &lt;---&gt; java.util.List
* object &lt;---&gt; java.util.Map
* null &lt;---&gt; null
* </pre>
*
* <p>The JSON-RPC 2.0 specification and user group forum can be found
* <a href="http://groups.google.com/group/json-rpc">here</a>.
*
* @author <a href="http://dzhuvinov.com">Vladimir Dzhuvinov</a>
* @version 1.16 (2010-10-04)
*/
public class JSONRPC2ExtendedError extends JSONRPC2Error {
private static final long serialVersionUID = -6574632977222371077L;
/** Invalid JSON-RPC 2.0, implementation defined error (-32099 .. -32000) */
public static final JSONRPC2Error INVALID_PASSWORD = new JSONRPC2ExtendedError(-32001, "Invalid password provided.");
/** Invalid JSON-RPC 2.0, implementation defined error (-32099 .. -32000) */
public static final JSONRPC2Error NO_TOKEN = new JSONRPC2ExtendedError(-32002, "No authentication token presented.");
/** Invalid JSON-RPC 2.0, implementation defined error (-32099 .. -32000) */
public static final JSONRPC2Error INVALID_TOKEN = new JSONRPC2ExtendedError(-32003, "Authentication token doesn't exist.");
/** Invalid JSON-RPC 2.0, implementation defined error (-32099 .. -32000) */
public static final JSONRPC2Error TOKEN_EXPIRED = new JSONRPC2ExtendedError(-32004, "Provided authentication token was expired and will be removed.");
/** Invalid JSON-RPC 2.0, implementation defined error (-32099 .. -32000) */
public static final JSONRPC2Error UNSPECIFIED_API_VERSION = new JSONRPC2ExtendedError(-32005, "The version of the I2PControl API wasn't specified, but is required to be specified.");
/** Invalid JSON-RPC 2.0, implementation defined error (-32099 .. -32000) */
public static final JSONRPC2Error UNSUPPORTED_API_VERSION = new JSONRPC2ExtendedError(-32006, "The version of the I2PControl API specified is not supported by I2PControl.");
/**
* Creates a new JSON-RPC 2.0 error with the specified code and
* message. The optional data is omitted.
*
* @param code The error code (standard pre-defined or
* application-specific).
* @param message The error message.
*/
public JSONRPC2ExtendedError(int code, String message) {
super(code, message);
}
/**
* Creates a new JSON-RPC 2.0 error with the specified code,
* message and data.
*
* @param code The error code (standard pre-defined or
* application-specific).
* @param message The error message.
* @param data Optional error data, must <a href="#map">map</a>
* to a valid JSON type.
*/
public JSONRPC2ExtendedError(int code, String message, Object data) {
super(code, message, data);
}
}

View File

@@ -0,0 +1,111 @@
package net.i2p.i2pcontrol.servlets.jsonrpc2handlers;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2ParamsType;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import net.i2p.i2pcontrol.security.ExpiredAuthTokenException;
import net.i2p.i2pcontrol.security.InvalidAuthTokenException;
import net.i2p.i2pcontrol.security.SecurityManager;
import java.util.Map;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
public class JSONRPC2Helper {
public final static Boolean USE_NO_AUTH = false;
public final static Boolean USE_AUTH = true;
private final SecurityManager _secMan;
public JSONRPC2Helper(SecurityManager secMan) {
_secMan = secMan;
}
/**
* Check incoming request for required arguments, to make sure they are valid.
* @param requiredArgs - Array of names of required arguments. If null don't check for any parameters.
* @param req - Incoming JSONRPC2 request
* @param useAuth - If true, will validate authentication token.
* @return - null if no errors were found. Corresponding JSONRPC2Error if error is found.
*/
public JSONRPC2Error validateParams(String[] requiredArgs, JSONRPC2Request req, Boolean useAuth) {
// Error on unnamed parameters
if (req.getParamsType() != JSONRPC2ParamsType.OBJECT) {
return JSONRPC2Error.INVALID_PARAMS;
}
Map<String, Object> params = req.getNamedParams();
// Validate authentication token.
if (useAuth) {
JSONRPC2Error err = validateToken(params);
if (err != null) {
return err;
}
}
// If there exist any required arguments.
if (requiredArgs != null && requiredArgs.length > 0) {
String missingArgs = "";
for (int i = 0; i < requiredArgs.length; i++) {
if (!params.containsKey(requiredArgs[i])) {
missingArgs = missingArgs.concat(requiredArgs[i] + ",");
}
}
if (missingArgs.length() > 0) {
missingArgs = missingArgs.substring(0, missingArgs.length() - 1);
return new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(), "Missing parameter(s): " + missingArgs);
}
}
return null;
}
/**
* Check incoming request for required arguments, to make sure they are valid. Will authenticate req.
* @param requiredArgs - Array of names of required arguments. If null don't check for any parameters.
* @param req - Incoming JSONRPC2 request
* @return - null if no errors were found. Corresponding JSONRPC2Error if error is found.
*/
public JSONRPC2Error validateParams(String[] requiredArgs, JSONRPC2Request req) {
return validateParams(requiredArgs, req, JSONRPC2Helper.USE_AUTH);
}
/**
* Will check incoming parameters to make sure they contain a valid token.
* @param req - Parameters of incoming request
* @return null if everything is fine, JSONRPC2Error for any corresponding error.
*/
private JSONRPC2Error validateToken(Map<String, Object> params) {
String tokenID = (String) params.get("Token");
if (tokenID == null) {
return JSONRPC2ExtendedError.NO_TOKEN;
}
try {
_secMan.verifyToken(tokenID);
} catch (InvalidAuthTokenException e) {
return JSONRPC2ExtendedError.INVALID_TOKEN;
} catch (ExpiredAuthTokenException e) {
JSONRPC2Error err = new JSONRPC2ExtendedError(JSONRPC2ExtendedError.TOKEN_EXPIRED.getCode(),
"Provided authentication token expired " + e.getExpirytime() + ", will be removed.");
return err;
}
return null;
}
}

View File

@@ -0,0 +1,344 @@
package net.i2p.i2pcontrol.servlets.jsonrpc2handlers;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;
import com.thetransactioncompany.jsonrpc2.server.MessageContext;
import com.thetransactioncompany.jsonrpc2.server.RequestHandler;
import net.i2p.I2PAppContext;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.router.transport.FIFOBandwidthRefiller;
import net.i2p.router.transport.TransportManager;
import net.i2p.router.transport.ntcp.NTCPTransport;
import net.i2p.router.transport.udp.UDPTransport;
import net.i2p.util.Log;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
public class NetworkSettingHandler implements RequestHandler {
private static final int BW_BURST_PCT = 110;
private static final int BW_BURST_TIME = 20;
private final JSONRPC2Helper _helper;
private final RouterContext _context;
public NetworkSettingHandler(RouterContext ctx, JSONRPC2Helper helper) {
_helper = helper;
_context = ctx;
}
// Reports the method names of the handled requests
public String[] handledRequests() {
return new String[] {"NetworkSetting"};
}
// Processes the requests
public JSONRPC2Response process(JSONRPC2Request req, MessageContext ctx) {
if (req.getMethod().equals("NetworkSetting")) {
return process(req);
} else {
// Method name not supported
return new JSONRPC2Response(JSONRPC2Error.METHOD_NOT_FOUND, req.getID());
}
}
private JSONRPC2Response process(JSONRPC2Request req) {
JSONRPC2Error err = _helper.validateParams(null, req);
if (err != null)
return new JSONRPC2Response(err, req.getID());
if (_context == null) {
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INTERNAL_ERROR.getCode(),
"RouterContext was not initialized. Query failed"),
req.getID());
}
Map<String, Object> inParams = req.getNamedParams();
Map<String, Object> outParams = new HashMap<String, Object>(4);
boolean restartNeeded = false;
boolean settingsSaved = false;
String inParam;
if (inParams.containsKey("i2p.router.net.ntcp.port")) {
String oldNTCPPort = _context.getProperty(NTCPTransport.PROP_I2NP_NTCP_PORT);
if ((inParam = (String) inParams.get("i2p.router.net.ntcp.port")) != null) {
if (oldNTCPPort == null || !oldNTCPPort.equals(inParam.trim())) {
Integer newPort;
try {
newPort = Integer.valueOf(inParam);
if (newPort < 1 || newPort > 65535) {
throw new NumberFormatException();
}
} catch (NumberFormatException e) {
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"\"i2p.router.net.ntcp.port\" must be a string representing a number in the range 1-65535. " + inParam + " isn't valid."),
req.getID());
}
Map<String, String> config = new HashMap<String, String>();
config.put(NTCPTransport.PROP_I2NP_NTCP_PORT, String.valueOf(newPort));
config.put(NTCPTransport.PROP_I2NP_NTCP_AUTO_PORT, "false");
_context.router().saveConfig(config, null);
restartNeeded = true;
}
settingsSaved = true;
} else {
String sAutoPort = _context.getProperty(NTCPTransport.PROP_I2NP_NTCP_AUTO_PORT, "true");
boolean oldAutoPort = "true".equalsIgnoreCase(sAutoPort);
if (oldAutoPort) {
String oldSSUPort = "" + _context.getProperty(UDPTransport.PROP_INTERNAL_PORT, 8887);
outParams.put("i2p.router.net.ntcp.port", oldSSUPort);
} else {
outParams.put("i2p.router.net.ntcp.port", oldNTCPPort);
}
}
}
if (inParams.containsKey("i2p.router.net.ntcp.hostname")) {
String oldNTCPHostname = _context.getProperty(NTCPTransport.PROP_I2NP_NTCP_HOSTNAME);
if ((inParam = (String) inParams.get("i2p.router.net.ntcp.hostname")) != null) {
if (oldNTCPHostname == null || !oldNTCPHostname.equals(inParam.trim())) {
_context.router().saveConfig(NTCPTransport.PROP_I2NP_NTCP_HOSTNAME, inParam);
restartNeeded = true;
}
settingsSaved = true;
} else {
outParams.put("i2p.router.net.ntcp.hostname", oldNTCPHostname);
}
}
if (inParams.containsKey("i2p.router.net.ntcp.autoip")) {
String oldNTCPAutoIP = _context.getProperty(NTCPTransport.PROP_I2NP_NTCP_AUTO_IP);
if ((inParam = (String) inParams.get("i2p.router.net.ntcp.autoip")) != null) {
inParam = inParam.trim().toLowerCase();
if (oldNTCPAutoIP == null || !oldNTCPAutoIP.equals(inParam)) {
if ("always".equals(inParam) || "true".equals(inParam) || "false".equals(inParam)) {
_context.router().saveConfig(NTCPTransport.PROP_I2NP_NTCP_AUTO_IP, inParam);
restartNeeded = true;
} else {
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"\"i2p.router.net.ntcp.autoip\" can only be always, true or false. " + inParam + " isn't valid."),
req.getID());
}
}
settingsSaved = true;
} else {
outParams.put("i2p.router.net.ntcp.autoip", oldNTCPAutoIP);
}
}
if (inParams.containsKey("i2p.router.net.ssu.port")) {
String oldSSUPort = "" + _context.getProperty(UDPTransport.PROP_INTERNAL_PORT, 8887);
if ((inParam = (String) inParams.get("i2p.router.net.ssu.port")) != null) {
if (oldSSUPort == null || !oldSSUPort.equals(inParam.trim())) {
Integer newPort;
try {
newPort = Integer.valueOf(inParam);
if (newPort < 1 || newPort > 65535) {
throw new NumberFormatException();
}
} catch (NumberFormatException e) {
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"\"i2p.router.net.ssu.port\" must be a string representing a number in the range 1-65535. " + inParam + " isn't valid."),
req.getID());
}
Map<String, String> config = new HashMap<String, String>();
config.put(UDPTransport.PROP_EXTERNAL_PORT, String.valueOf(newPort));
config.put(UDPTransport.PROP_INTERNAL_PORT, String.valueOf(newPort));
_context.router().saveConfig(config, null);
restartNeeded = true;
}
settingsSaved = true;
} else {
outParams.put("i2p.router.net.ssu.port", oldSSUPort);
}
}
if (inParams.containsKey("i2p.router.net.ssu.hostname")) {
String oldSSUHostname = _context.getProperty(UDPTransport.PROP_EXTERNAL_HOST);
if ((inParam = (String) inParams.get("i2p.router.net.ssu.hostname")) != null) {
if (oldSSUHostname == null || !oldSSUHostname.equals(inParam.trim())) {
_context.router().saveConfig(UDPTransport.PROP_EXTERNAL_HOST, inParam);
restartNeeded = true;
}
settingsSaved = true;
} else {
outParams.put("i2p.router.net.ssu.hostname", oldSSUHostname);
}
}
if (inParams.containsKey("i2p.router.net.ssu.autoip")) {
String oldSSUAutoIP = _context.getProperty(UDPTransport.PROP_SOURCES);
if ((inParam = (String) inParams.get("i2p.router.net.ssu.autoip")) != null) {
inParam = inParam.trim().toLowerCase();
if (oldSSUAutoIP == null || !oldSSUAutoIP.equals(inParam)) {
if (inParam.equals("ssu") || inParam.equals("local,ssu") || inParam.equals("upnp,ssu") || inParam.equals("local,upnp,ssu")) {
_context.router().saveConfig(UDPTransport.PROP_SOURCES, inParam);
restartNeeded = true;
} else {
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"\"i2p.router.net.ssu.autoip\" can only be ssu/local,upnp,ssu/local/ssu/upnp,ssu. " + inParam + " isn't valid."),
req.getID());
}
}
settingsSaved = true;
} else {
outParams.put("i2p.router.net.ssu.autoip", oldSSUAutoIP);
}
}
// Non-setable key.
if (inParams.containsKey("i2p.router.net.ssu.detectedip")) {
if ((inParam = (String) inParams.get("i2p.router.net.ssu.autoip")) == null) {
byte[] ipBytes = _context.router().getRouterInfo().getTargetAddress("SSU").getIP();
try {
InetAddress i = InetAddress.getByAddress(ipBytes);
outParams.put("i2p.router.net.ssu.detectedip", i.getHostAddress());
} catch (UnknownHostException e) {
outParams.put("i2p.router.net.ssu.detectedip", "Failed to parse ip address");
}
}
}
if (inParams.containsKey("i2p.router.net.upnp")) {
String oldUPNP = _context.getProperty(TransportManager.PROP_ENABLE_UPNP);
if ((inParam = (String) inParams.get("i2p.router.net.upnp")) != null) {
if (oldUPNP == null || !oldUPNP.equals(inParam.trim())) {
_context.router().saveConfig(TransportManager.PROP_ENABLE_UPNP, inParam);
restartNeeded = true;
}
settingsSaved = true;
} else {
outParams.put("i2p.router.net.upnp", oldUPNP);
}
}
if (inParams.containsKey("i2p.router.net.bw.share")) {
String oldShare = _context.router().getConfigSetting(Router.PROP_BANDWIDTH_SHARE_PERCENTAGE);
if ((inParam = (String) inParams.get("i2p.router.net.bw.share")) != null) {
if (oldShare == null || !oldShare.equals(inParam.trim())) {
Integer percent;
try {
percent = Integer.parseInt(inParam);
if (percent < 0 || percent > 100 || inParam.length() == 0) {
throw new NumberFormatException();
}
} catch (NumberFormatException e) {
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"\"i2p.router.net.bw.share\" A positive integer must supplied, \"" + inParam + "\" isn't valid"),
req.getID());
}
_context.router().saveConfig(Router.PROP_BANDWIDTH_SHARE_PERCENTAGE, inParam);
}
settingsSaved = true;
} else {
outParams.put("i2p.router.net.bw.share", oldShare);
}
}
if (inParams.containsKey("i2p.router.net.bw.in")) {
String oldBWIn = _context.getProperty(FIFOBandwidthRefiller.PROP_INBOUND_BANDWIDTH);
if ((inParam = (String) inParams.get("i2p.router.net.bw.in")) != null) {
Integer rate;
try {
rate = Integer.parseInt(inParam);
if (rate < 0 || inParam.length() == 0) {
throw new NumberFormatException();
}
} catch (NumberFormatException e) {
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"\"i2p.router.net.bw.in\" A positive integer must supplied, " + inParam + " isn't valid"),
req.getID());
}
Integer burstRate = (rate * BW_BURST_PCT) / 100;
Integer burstSize = (burstRate * BW_BURST_TIME);
if (oldBWIn == null || !oldBWIn.equals(rate.toString())) {
Map<String, String> config = new HashMap<String, String>();
config.put(FIFOBandwidthRefiller.PROP_INBOUND_BANDWIDTH, rate.toString());
config.put(FIFOBandwidthRefiller.PROP_INBOUND_BURST_BANDWIDTH, burstRate.toString());
config.put(FIFOBandwidthRefiller.PROP_INBOUND_BANDWIDTH_PEAK, burstSize.toString());
_context.router().saveConfig(config, null);
_context.bandwidthLimiter().reinitialize();
}
settingsSaved = true;
} else {
outParams.put("i2p.router.net.bw.in", oldBWIn);
}
}
if (inParams.containsKey("i2p.router.net.bw.out")) {
String oldBWOut = _context.getProperty(FIFOBandwidthRefiller.PROP_OUTBOUND_BANDWIDTH);
if ((inParam = (String) inParams.get("i2p.router.net.bw.out")) != null) {
Integer rate;
try {
rate = Integer.parseInt(inParam);
if (rate < 0 || inParam.length() == 0)
throw new NumberFormatException();
} catch (NumberFormatException e) {
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),
"\"i2p.router.net.bw.out\" A positive integer must supplied, " + inParam + " isn't valid"),
req.getID());
}
Integer burstRate = (rate * BW_BURST_PCT) / 100;
Integer burstSize = (burstRate * BW_BURST_TIME);
if (oldBWOut == null || !oldBWOut.equals(rate.toString())) {
Map<String, String> config = new HashMap<String, String>();
config.put(FIFOBandwidthRefiller.PROP_OUTBOUND_BANDWIDTH, rate.toString());
config.put(FIFOBandwidthRefiller.PROP_OUTBOUND_BURST_BANDWIDTH, burstRate.toString());
config.put(FIFOBandwidthRefiller.PROP_OUTBOUND_BANDWIDTH_PEAK, burstSize.toString());
_context.router().saveConfig(config, null);
_context.bandwidthLimiter().reinitialize();
}
settingsSaved = true;
} else {
outParams.put("i2p.router.net.bw.out", oldBWOut);
}
}
if (inParams.containsKey("i2p.router.net.laptopmode")) {
String oldLaptopMode = _context.getProperty(UDPTransport.PROP_LAPTOP_MODE);
if ((inParam = (String) inParams.get("i2p.router.net.laptopmode")) != null) {
if (oldLaptopMode == null || !oldLaptopMode.equals(inParam.trim())) {
_context.router().saveConfig(UDPTransport.PROP_LAPTOP_MODE, String.valueOf(inParam));
}
settingsSaved = true;
} else {
outParams.put("i2p.router.net.laptopmode", oldLaptopMode);
}
}
if (settingsSaved)
_context.router().saveConfig();
outParams.put("SettingsSaved", settingsSaved);
outParams.put("RestartNeeded", restartNeeded);
return new JSONRPC2Response(outParams, req.getID());
}
}

View File

@@ -0,0 +1,213 @@
package net.i2p.i2pcontrol.servlets.jsonrpc2handlers;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;
import com.thetransactioncompany.jsonrpc2.server.MessageContext;
import com.thetransactioncompany.jsonrpc2.server.RequestHandler;
import net.i2p.I2PAppContext;
import net.i2p.data.router.RouterAddress;
import net.i2p.router.CommSystemFacade;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.router.RouterVersion;
import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade;
import net.i2p.router.transport.TransportUtil;
import net.i2p.router.transport.ntcp.NTCPTransport;
import java.util.HashMap;
import java.util.Map;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
public class RouterInfoHandler implements RequestHandler {
private final JSONRPC2Helper _helper;
private final RouterContext _context;
public RouterInfoHandler(RouterContext ctx, JSONRPC2Helper helper) {
_helper = helper;
_context = ctx;
}
// Reports the method names of the handled requests
public String[] handledRequests() {
return new String[] { "RouterInfo" };
}
// Processes the requests
public JSONRPC2Response process(JSONRPC2Request req, MessageContext ctx) {
if (req.getMethod().equals("RouterInfo")) {
return process(req);
} else {
// Method name not supported
return new JSONRPC2Response(JSONRPC2Error.METHOD_NOT_FOUND,
req.getID());
}
}
@SuppressWarnings("unchecked")
private JSONRPC2Response process(JSONRPC2Request req) {
JSONRPC2Error err = _helper.validateParams(null, req);
if (err != null)
return new JSONRPC2Response(err, req.getID());
if (_context == null) {
return new JSONRPC2Response(new JSONRPC2Error(
JSONRPC2Error.INTERNAL_ERROR.getCode(),
"RouterContext was not initialized. Query failed"),
req.getID());
}
Map<String, Object> inParams = req.getNamedParams();
Map outParams = new HashMap();
if (inParams.containsKey("i2p.router.version")) {
try {
Class rvClass = Class.forName("net.i2p.router.RouterVersion");
java.lang.reflect.Field field = rvClass.getDeclaredField("FULL_VERSION");
String fullVersion = (String) field.get(new RouterVersion());
outParams.put("i2p.router.version", fullVersion);
} catch (Exception e) {} // Ignore
}
if (inParams.containsKey("i2p.router.uptime")) {
Router router = _context.router();
if (router == null) {
outParams.put("i2p.router.uptime", 0);
} else {
outParams.put("i2p.router.uptime", router.getUptime());
}
}
if (inParams.containsKey("i2p.router.status")) {
outParams.put("i2p.router.status", _context.throttle().getTunnelStatus());
}
if (inParams.containsKey("i2p.router.net.status")) {
outParams.put("i2p.router.net.status", getNetworkStatus().ordinal());
}
if (inParams.containsKey("i2p.router.net.bw.inbound.1s")) {
outParams.put("i2p.router.net.bw.inbound.1s", _context.bandwidthLimiter().getReceiveBps());
}
if (inParams.containsKey("i2p.router.net.bw.outbound.1s")) {
outParams.put("i2p.router.net.bw.outbound.1s", _context.bandwidthLimiter().getSendBps());
}
if (inParams.containsKey("i2p.router.net.bw.inbound.15s")) {
outParams.put("i2p.router.net.bw.inbound.15s", _context.bandwidthLimiter().getReceiveBps15s());
}
if (inParams.containsKey("i2p.router.net.bw.outbound.15s")) {
outParams.put("i2p.router.net.bw.outbound.15s", _context.bandwidthLimiter().getSendBps15s());
}
if (inParams.containsKey("i2p.router.net.tunnels.participating")) {
outParams.put("i2p.router.net.tunnels.participating", _context.tunnelManager().getParticipatingCount());
}
if (inParams.containsKey("i2p.router.netdb.knownpeers")) {
// Why max(-1, 0) is used I don't know, it is the implementation used in the router console.
outParams.put("i2p.router.netdb.knownpeers", Math.max(_context.netDb().getKnownRouters() - 1, 0));
}
if (inParams.containsKey("i2p.router.netdb.activepeers")) {
outParams.put("i2p.router.netdb.activepeers", _context.commSystem().countActivePeers());
}
if (inParams.containsKey("i2p.router.netdb.fastpeers")) {
outParams.put("i2p.router.netdb.fastpeers", _context.profileOrganizer().countFastPeers());
}
if (inParams.containsKey("i2p.router.netdb.highcapacitypeers")) {
outParams.put("i2p.router.netdb.highcapacitypeers", _context.profileOrganizer().countHighCapacityPeers());
}
if (inParams.containsKey("i2p.router.netdb.isreseeding")) {
outParams.put("i2p.router.netdb.isreseeding", Boolean.valueOf(System.getProperty("net.i2p.router.web.ReseedHandler.reseedInProgress")).booleanValue());
}
return new JSONRPC2Response(outParams, req.getID());
}
private static enum NETWORK_STATUS {
OK,
TESTING,
FIREWALLED,
HIDDEN,
WARN_FIREWALLED_AND_FAST,
WARN_FIREWALLED_AND_FLOODFILL,
WARN_FIREWALLED_WITH_INBOUND_TCP,
WARN_FIREWALLED_WITH_UDP_DISABLED,
ERROR_I2CP,
ERROR_CLOCK_SKEW,
ERROR_PRIVATE_TCP_ADDRESS,
ERROR_SYMMETRIC_NAT,
ERROR_UDP_PORT_IN_USE,
ERROR_NO_ACTIVE_PEERS_CHECK_CONNECTION_AND_FIREWALL,
ERROR_UDP_DISABLED_AND_TCP_UNSET,
};
// Ripped out of SummaryHelper.java
private NETWORK_STATUS getNetworkStatus() {
if (_context.router().getUptime() > 60 * 1000
&& (!_context.router().gracefulShutdownInProgress())
&& !_context.clientManager().isAlive())
return (NETWORK_STATUS.ERROR_I2CP);
long skew = _context.commSystem().getFramedAveragePeerClockSkew(33);
// Display the actual skew, not the offset
if (Math.abs(skew) > 60 * 1000)
return NETWORK_STATUS.ERROR_CLOCK_SKEW;
if (_context.router().isHidden())
return (NETWORK_STATUS.HIDDEN);
int status = _context.commSystem().getStatus().getCode();
switch (status) {
case CommSystemFacade.STATUS_OK:
RouterAddress ra = _context.router().getRouterInfo().getTargetAddress("NTCP");
if (ra == null || TransportUtil.isPubliclyRoutable(ra.getIP(), true))
return NETWORK_STATUS.OK;
return NETWORK_STATUS.ERROR_PRIVATE_TCP_ADDRESS;
case CommSystemFacade.STATUS_DIFFERENT:
return NETWORK_STATUS.ERROR_SYMMETRIC_NAT;
case CommSystemFacade.STATUS_REJECT_UNSOLICITED:
if (_context.router().getRouterInfo().getTargetAddress("NTCP") != null)
return NETWORK_STATUS.WARN_FIREWALLED_WITH_INBOUND_TCP;
if (((FloodfillNetworkDatabaseFacade) _context.netDb()).floodfillEnabled())
return NETWORK_STATUS.WARN_FIREWALLED_AND_FLOODFILL;
if (_context.router().getRouterInfo().getCapabilities().indexOf('O') >= 0)
return NETWORK_STATUS.WARN_FIREWALLED_AND_FAST;
return NETWORK_STATUS.FIREWALLED;
case CommSystemFacade.STATUS_HOSED:
return NETWORK_STATUS.ERROR_UDP_PORT_IN_USE;
case CommSystemFacade.STATUS_UNKNOWN: // fallthrough
default:
ra = _context.router().getRouterInfo().getTargetAddress("SSU");
if (ra == null && _context.router().getUptime() > 5 * 60 * 1000) {
if (_context.commSystem().countActivePeers() <= 0)
return NETWORK_STATUS.ERROR_NO_ACTIVE_PEERS_CHECK_CONNECTION_AND_FIREWALL;
else if (_context.getProperty(NTCPTransport.PROP_I2NP_NTCP_HOSTNAME) == null || _context.getProperty(NTCPTransport.PROP_I2NP_NTCP_PORT) == null)
return NETWORK_STATUS.ERROR_UDP_DISABLED_AND_TCP_UNSET;
else
return NETWORK_STATUS.WARN_FIREWALLED_WITH_UDP_DISABLED;
}
return NETWORK_STATUS.TESTING;
}
}
}

View File

@@ -0,0 +1,231 @@
package net.i2p.i2pcontrol.servlets.jsonrpc2handlers;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Error;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Request;
import com.thetransactioncompany.jsonrpc2.JSONRPC2Response;
import com.thetransactioncompany.jsonrpc2.server.MessageContext;
import com.thetransactioncompany.jsonrpc2.server.RequestHandler;
import net.i2p.I2PAppContext;
import net.i2p.app.ClientAppManager;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.router.networkdb.reseed.ReseedChecker;
import net.i2p.update.UpdateManager;
import net.i2p.update.UpdateType;
import net.i2p.util.Log;
import org.tanukisoftware.wrapper.WrapperManager;
import java.util.HashMap;
import java.util.Map;
/*
* Copyright 2011 hottuna (dev@robertfoss.se)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
public class RouterManagerHandler implements RequestHandler {
private final JSONRPC2Helper _helper;
private final RouterContext _context;
private final static int SHUTDOWN_WAIT = 1500;
public RouterManagerHandler(RouterContext ctx, JSONRPC2Helper helper) {
_helper = helper;
_context = ctx;
}
// Reports the method names of the handled requests
public String[] handledRequests() {
return new String[] { "RouterManager" };
}
// Processes the requests
public JSONRPC2Response process(JSONRPC2Request req, MessageContext ctx) {
if (req.getMethod().equals("RouterManager")) {
return process(req);
} else {
// Method name not supported
return new JSONRPC2Response(JSONRPC2Error.METHOD_NOT_FOUND,
req.getID());
}
}
private JSONRPC2Response process(JSONRPC2Request req) {
JSONRPC2Error err = _helper.validateParams(null, req);
if (err != null)
return new JSONRPC2Response(err, req.getID());
if (_context == null) {
return new JSONRPC2Response(new JSONRPC2Error(
JSONRPC2Error.INTERNAL_ERROR.getCode(),
"RouterContext was not initialized. Query failed"),
req.getID());
}
Map<String, Object> inParams = req.getNamedParams();
final Map<String, Object> outParams = new HashMap<String, Object>(4);
if (inParams.containsKey("Shutdown")) {
outParams.put("Shutdown", null);
(new Thread() {
@Override
public void run() {
try {
Thread.sleep(SHUTDOWN_WAIT);
} catch (InterruptedException e) {}
_context.addShutdownTask(new UpdateWrapperManagerTask(Router.EXIT_HARD));
_context.router().shutdown(Router.EXIT_HARD);
}
}).start();
return new JSONRPC2Response(outParams, req.getID());
}
if (inParams.containsKey("Restart")) {
outParams.put("Restart", null);
(new Thread() {
@Override
public void run() {
try {
Thread.sleep(SHUTDOWN_WAIT);
} catch (InterruptedException e) {}
_context.addShutdownTask(new UpdateWrapperManagerTask(Router.EXIT_HARD_RESTART));
_context.router().shutdown(Router.EXIT_HARD_RESTART);
}
}).start();
return new JSONRPC2Response(outParams, req.getID());
}
if (inParams.containsKey("ShutdownGraceful")) {
outParams.put("ShutdownGraceful", null);
(new Thread() {
@Override
public void run() {
try {
Thread.sleep(SHUTDOWN_WAIT);
} catch (InterruptedException e) {}
_context.addShutdownTask(new UpdateWrapperManagerTask(Router.EXIT_GRACEFUL));
_context.router().shutdownGracefully();
}
}).start();
return new JSONRPC2Response(outParams, req.getID());
}
if (inParams.containsKey("RestartGraceful")) {
outParams.put("RestartGraceful", null);
(new Thread() {
@Override
public void run() {
try {
Thread.sleep(SHUTDOWN_WAIT);
} catch (InterruptedException e) {}
_context.addShutdownTask(new UpdateWrapperManagerTask(Router.EXIT_GRACEFUL_RESTART));
_context.router().shutdownGracefully(Router.EXIT_GRACEFUL_RESTART);
}
}).start();
return new JSONRPC2Response(outParams, req.getID());
}
if (inParams.containsKey("Reseed")) {
outParams.put("Reseed", null);
(new Thread() {
@Override
public void run() {
ReseedChecker reseeder = new ReseedChecker(_context);
reseeder.requestReseed();
}
}).start();
return new JSONRPC2Response(outParams, req.getID());
}
if (inParams.containsKey("FindUpdates")) {
Thread t = new Thread() {
@Override
public void run() {
ClientAppManager clmgr = I2PAppContext.getCurrentContext().clientAppManager();
if (clmgr == null) {
outParams.put("FindUpdates", "ClientAppManager is null");
return;
}
UpdateManager upmgr = (UpdateManager) clmgr.getRegisteredApp(UpdateManager.APP_NAME);
if (upmgr == null) {
outParams.put("FindUpdates", "UpdateManager is null");
return;
}
boolean updateIsAvailable = upmgr.checkAvailable(UpdateType.ROUTER_SIGNED) != null;
outParams.put("FindUpdates", updateIsAvailable);
}
};
t.start();
try {
t.join();
} catch (InterruptedException e) {}
return new JSONRPC2Response(outParams, req.getID());
}
if (inParams.containsKey("Update")) {
Thread t = new Thread() {
@Override
public void run() {
ClientAppManager clmgr = I2PAppContext.getCurrentContext().clientAppManager();
if (clmgr == null) {
outParams.put("Update", "ClientAppManager is null");
return;
}
UpdateManager upmgr = (UpdateManager) clmgr.getRegisteredApp(UpdateManager.APP_NAME);
if (upmgr == null) {
outParams.put("Update", "UpdateManager is null");
return;
}
boolean updateStarted = upmgr.update(UpdateType.ROUTER_SIGNED);
if (!updateStarted) {
outParams.put("Update", "Update not started");
return;
}
boolean isUpdating = upmgr.isUpdateInProgress(UpdateType.ROUTER_SIGNED);
while (isUpdating) {
try {
Thread.sleep(100);
} catch (Exception e) {}
isUpdating = upmgr.isUpdateInProgress(UpdateType.ROUTER_SIGNED);
}
outParams.put("Update", upmgr.getStatus());
}
};
t.start();
try {
t.join();
} catch (InterruptedException e) {}
return new JSONRPC2Response(outParams, req.getID());
}
return new JSONRPC2Response(outParams, req.getID());
}
public static class UpdateWrapperManagerTask implements Runnable {
private int _exitCode;
public UpdateWrapperManagerTask(int exitCode) {
_exitCode = exitCode;
}
public void run() {
try {
WrapperManager.signalStopped(_exitCode);
} catch (Throwable t) {
t.printStackTrace();
}
}
}
}

View File

@@ -0,0 +1,777 @@
// Copyright (c) 2006 Damien Miller <djm@mindrot.org>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package org.mindrot.jbcrypt;
import java.io.UnsupportedEncodingException;
import java.security.SecureRandom;
/**
* BCrypt implements OpenBSD-style Blowfish password hashing using
* the scheme described in "A Future-Adaptable Password Scheme" by
* Niels Provos and David Mazieres.
* <p>
* This password hashing system tries to thwart off-line password
* cracking using a computationally-intensive hashing algorithm,
* based on Bruce Schneier's Blowfish cipher. The work factor of
* the algorithm is parameterised, so it can be increased as
* computers get faster.
* <p>
* Usage is really simple. To hash a password for the first time,
* call the hashpw method with a random salt, like this:
* <p>
* <code>
* String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt());
* </code>
* <p>
* To check whether a plaintext password matches one that has been
* hashed previously, use the checkpw method:
* <p>
* <code>
* if (BCrypt.checkpw(candidate_password, stored_hash))
* &nbsp;&nbsp;&nbsp;&nbsp;System.out.println("It matches");
* else
* &nbsp;&nbsp;&nbsp;&nbsp;System.out.println("It does not match");
* </code>
* <p>
* The gensalt() method takes an optional parameter (log_rounds)
* that determines the computational complexity of the hashing:
* <p>
* <code>
* String strong_salt = BCrypt.gensalt(10)
* String stronger_salt = BCrypt.gensalt(12)
* </code>
* <p>
* The amount of work increases exponentially (2**log_rounds), so
* each increment is twice as much work. The default log_rounds is
* 10, and the valid range is 4 to 30.
*
* @author Damien Miller
* @version 0.2
*/
public class BCrypt {
// BCrypt parameters
private static final int GENSALT_DEFAULT_LOG2_ROUNDS = 10;
private static final int BCRYPT_SALT_LEN = 16;
// Blowfish parameters
private static final int BLOWFISH_NUM_ROUNDS = 16;
// Initial contents of key schedule
private static final int P_orig[] = {
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
0x9216d5d9, 0x8979fb1b
};
private static final int S_orig[] = {
0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a,
0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7,
0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0,
0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6
};
// bcrypt IV: "OrpheanBeholderScryDoubt". The C implementation calls
// this "ciphertext", but it is really plaintext or an IV. We keep
// the name to make code comparison easier.
static private final int bf_crypt_ciphertext[] = {
0x4f727068, 0x65616e42, 0x65686f6c,
0x64657253, 0x63727944, 0x6f756274
};
// Table for Base64 encoding
static private final char base64_code[] = {
'.', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9'
};
// Table for Base64 decoding
static private final byte index_64[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 0, 1, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, -1, -1,
-1, -1, -1, -1, -1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
-1, -1, -1, -1, -1, -1, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, -1, -1, -1, -1, -1
};
// Expanded Blowfish key
private int P[];
private int S[];
/**
* Encode a byte array using bcrypt's slightly-modified base64
* encoding scheme. Note that this is *not* compatible with
* the standard MIME-base64 encoding.
*
* @param d the byte array to encode
* @param len the number of bytes to encode
* @return base64-encoded string
* @exception IllegalArgumentException if the length is invalid
*/
private static String encode_base64(byte d[], int len)
throws IllegalArgumentException {
int off = 0;
StringBuffer rs = new StringBuffer();
int c1, c2;
if (len <= 0 || len > d.length)
throw new IllegalArgumentException ("Invalid len");
while (off < len) {
c1 = d[off++] & 0xff;
rs.append(base64_code[(c1 >> 2) & 0x3f]);
c1 = (c1 & 0x03) << 4;
if (off >= len) {
rs.append(base64_code[c1 & 0x3f]);
break;
}
c2 = d[off++] & 0xff;
c1 |= (c2 >> 4) & 0x0f;
rs.append(base64_code[c1 & 0x3f]);
c1 = (c2 & 0x0f) << 2;
if (off >= len) {
rs.append(base64_code[c1 & 0x3f]);
break;
}
c2 = d[off++] & 0xff;
c1 |= (c2 >> 6) & 0x03;
rs.append(base64_code[c1 & 0x3f]);
rs.append(base64_code[c2 & 0x3f]);
}
return rs.toString();
}
/**
* Look up the 3 bits base64-encoded by the specified character,
* range-checking againt conversion table
* @param x the base64-encoded value
* @return the decoded value of x
*/
private static byte char64(char x) {
if ((int)x < 0 || (int)x > index_64.length)
return -1;
return index_64[(int)x];
}
/**
* Decode a string encoded using bcrypt's base64 scheme to a
* byte array. Note that this is *not* compatible with
* the standard MIME-base64 encoding.
* @param s the string to decode
* @param maxolen the maximum number of bytes to decode
* @return an array containing the decoded bytes
* @throws IllegalArgumentException if maxolen is invalid
*/
private static byte[] decode_base64(String s, int maxolen)
throws IllegalArgumentException {
StringBuffer rs = new StringBuffer();
int off = 0, slen = s.length(), olen = 0;
byte ret[];
byte c1, c2, c3, c4, o;
if (maxolen <= 0)
throw new IllegalArgumentException ("Invalid maxolen");
while (off < slen - 1 && olen < maxolen) {
c1 = char64(s.charAt(off++));
c2 = char64(s.charAt(off++));
if (c1 == -1 || c2 == -1)
break;
o = (byte)(c1 << 2);
o |= (c2 & 0x30) >> 4;
rs.append((char)o);
if (++olen >= maxolen || off >= slen)
break;
c3 = char64(s.charAt(off++));
if (c3 == -1)
break;
o = (byte)((c2 & 0x0f) << 4);
o |= (c3 & 0x3c) >> 2;
rs.append((char)o);
if (++olen >= maxolen || off >= slen)
break;
c4 = char64(s.charAt(off++));
o = (byte)((c3 & 0x03) << 6);
o |= c4;
rs.append((char)o);
++olen;
}
ret = new byte[olen];
for (off = 0; off < olen; off++)
ret[off] = (byte)rs.charAt(off);
return ret;
}
/**
* Blowfish encipher a single 64-bit block encoded as
* two 32-bit halves
* @param lr an array containing the two 32-bit half blocks
* @param off the position in the array of the blocks
*/
private final void encipher(int lr[], int off) {
int i, n, l = lr[off], r = lr[off + 1];
l ^= P[0];
for (i = 0; i <= BLOWFISH_NUM_ROUNDS - 2;) {
// Feistel substitution on left word
n = S[(l >> 24) & 0xff];
n += S[0x100 | ((l >> 16) & 0xff)];
n ^= S[0x200 | ((l >> 8) & 0xff)];
n += S[0x300 | (l & 0xff)];
r ^= n ^ P[++i];
// Feistel substitution on right word
n = S[(r >> 24) & 0xff];
n += S[0x100 | ((r >> 16) & 0xff)];
n ^= S[0x200 | ((r >> 8) & 0xff)];
n += S[0x300 | (r & 0xff)];
l ^= n ^ P[++i];
}
lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1];
lr[off + 1] = l;
}
/**
* Cycically extract a word of key material
* @param data the string to extract the data from
* @param offp a "pointer" (as a one-entry array) to the
* current offset into data
* @return the next word of material from data
*/
private static int streamtoword(byte data[], int offp[]) {
int i;
int word = 0;
int off = offp[0];
for (i = 0; i < 4; i++) {
word = (word << 8) | (data[off] & 0xff);
off = (off + 1) % data.length;
}
offp[0] = off;
return word;
}
/**
* Initialise the Blowfish key schedule
*/
private void init_key() {
P = (int[])P_orig.clone();
S = (int[])S_orig.clone();
}
/**
* Key the Blowfish cipher
* @param key an array containing the key
*/
private void key(byte key[]) {
int i;
int koffp[] = { 0 };
int lr[] = { 0, 0 };
int plen = P.length, slen = S.length;
for (i = 0; i < plen; i++)
P[i] = P[i] ^ streamtoword(key, koffp);
for (i = 0; i < plen; i += 2) {
encipher(lr, 0);
P[i] = lr[0];
P[i + 1] = lr[1];
}
for (i = 0; i < slen; i += 2) {
encipher(lr, 0);
S[i] = lr[0];
S[i + 1] = lr[1];
}
}
/**
* Perform the "enhanced key schedule" step described by
* Provos and Mazieres in "A Future-Adaptable Password Scheme"
* http://www.openbsd.org/papers/bcrypt-paper.ps
* @param data salt information
* @param key password information
*/
private void ekskey(byte data[], byte key[]) {
int i;
int koffp[] = { 0 }, doffp[] = { 0 };
int lr[] = { 0, 0 };
int plen = P.length, slen = S.length;
for (i = 0; i < plen; i++)
P[i] = P[i] ^ streamtoword(key, koffp);
for (i = 0; i < plen; i += 2) {
lr[0] ^= streamtoword(data, doffp);
lr[1] ^= streamtoword(data, doffp);
encipher(lr, 0);
P[i] = lr[0];
P[i + 1] = lr[1];
}
for (i = 0; i < slen; i += 2) {
lr[0] ^= streamtoword(data, doffp);
lr[1] ^= streamtoword(data, doffp);
encipher(lr, 0);
S[i] = lr[0];
S[i + 1] = lr[1];
}
}
/**
* Perform the central password hashing step in the
* bcrypt scheme
* @param password the password to hash
* @param salt the binary salt to hash with the password
* @param log_rounds the binary logarithm of the number
* of rounds of hashing to apply
* @param cdata the plaintext to encrypt
* @return an array containing the binary hashed password
*/
public byte[] crypt_raw(byte password[], byte salt[], int log_rounds,
int cdata[]) {
int rounds, i, j;
int clen = cdata.length;
byte ret[];
if (log_rounds < 4 || log_rounds > 30)
throw new IllegalArgumentException ("Bad number of rounds");
rounds = 1 << log_rounds;
if (salt.length != BCRYPT_SALT_LEN)
throw new IllegalArgumentException ("Bad salt length");
init_key();
ekskey(salt, password);
for (i = 0; i != rounds; i++) {
key(password);
key(salt);
}
for (i = 0; i < 64; i++) {
for (j = 0; j < (clen >> 1); j++)
encipher(cdata, j << 1);
}
ret = new byte[clen * 4];
for (i = 0, j = 0; i < clen; i++) {
ret[j++] = (byte)((cdata[i] >> 24) & 0xff);
ret[j++] = (byte)((cdata[i] >> 16) & 0xff);
ret[j++] = (byte)((cdata[i] >> 8) & 0xff);
ret[j++] = (byte)(cdata[i] & 0xff);
}
return ret;
}
/**
* Hash a password using the OpenBSD bcrypt scheme
* @param password the password to hash
* @param salt the salt to hash with (perhaps generated
* using BCrypt.gensalt)
* @return the hashed password
*/
public static String hashpw(String password, String salt) {
BCrypt B;
String real_salt;
byte passwordb[], saltb[], hashed[];
char minor = (char)0;
int rounds, off = 0;
StringBuffer rs = new StringBuffer();
if (salt.charAt(0) != '$' || salt.charAt(1) != '2')
throw new IllegalArgumentException ("Invalid salt version");
if (salt.charAt(2) == '$')
off = 3;
else {
minor = salt.charAt(2);
if (minor != 'a' || salt.charAt(3) != '$')
throw new IllegalArgumentException ("Invalid salt revision");
off = 4;
}
// Extract number of rounds
if (salt.charAt(off + 2) > '$')
throw new IllegalArgumentException ("Missing salt rounds");
rounds = Integer.parseInt(salt.substring(off, off + 2));
real_salt = salt.substring(off + 3, off + 25);
try {
passwordb = (password + (minor >= 'a' ? "\000" : "")).getBytes("UTF-8");
} catch (UnsupportedEncodingException uee) {
throw new AssertionError("UTF-8 is not supported");
}
saltb = decode_base64(real_salt, BCRYPT_SALT_LEN);
B = new BCrypt();
hashed = B.crypt_raw(passwordb, saltb, rounds,
(int[])bf_crypt_ciphertext.clone());
rs.append("$2");
if (minor >= 'a')
rs.append(minor);
rs.append("$");
if (rounds < 10)
rs.append("0");
if (rounds > 30) {
throw new IllegalArgumentException(
"rounds exceeds maximum (30)");
}
rs.append(Integer.toString(rounds));
rs.append("$");
rs.append(encode_base64(saltb, saltb.length));
rs.append(encode_base64(hashed,
bf_crypt_ciphertext.length * 4 - 1));
return rs.toString();
}
/**
* Generate a salt for use with the BCrypt.hashpw() method
* @param log_rounds the log2 of the number of rounds of
* hashing to apply - the work factor therefore increases as
* 2**log_rounds.
* @param random an instance of SecureRandom to use
* @return an encoded salt value
*/
public static String gensalt(int log_rounds, SecureRandom random) {
StringBuffer rs = new StringBuffer();
byte rnd[] = new byte[BCRYPT_SALT_LEN];
random.nextBytes(rnd);
rs.append("$2a$");
if (log_rounds < 10)
rs.append("0");
if (log_rounds > 30) {
throw new IllegalArgumentException(
"log_rounds exceeds maximum (30)");
}
rs.append(Integer.toString(log_rounds));
rs.append("$");
rs.append(encode_base64(rnd, rnd.length));
return rs.toString();
}
/**
* Generate a salt for use with the BCrypt.hashpw() method
* @param log_rounds the log2 of the number of rounds of
* hashing to apply - the work factor therefore increases as
* 2**log_rounds.
* @return an encoded salt value
*/
public static String gensalt(int log_rounds) {
return gensalt(log_rounds, new SecureRandom());
}
/**
* Generate a salt for use with the BCrypt.hashpw() method,
* selecting a reasonable default for the number of hashing
* rounds to apply
* @return an encoded salt value
*/
public static String gensalt() {
return gensalt(GENSALT_DEFAULT_LOG2_ROUNDS);
}
/**
* Check that a plaintext password matches a previously hashed
* one
* @param plaintext the plaintext password to verify
* @param hashed the previously-hashed password
* @return true if the passwords match, false otherwise
*/
public static boolean checkpw(String plaintext, String hashed) {
byte hashed_bytes[];
byte try_bytes[];
try {
String try_pw = hashpw(plaintext, hashed);
hashed_bytes = hashed.getBytes("UTF-8");
try_bytes = try_pw.getBytes("UTF-8");
} catch (UnsupportedEncodingException uee) {
return false;
}
if (hashed_bytes.length != try_bytes.length)
return false;
byte ret = 0;
for (int i = 0; i < try_bytes.length; i++)
ret |= hashed_bytes[i] ^ try_bytes[i];
return ret == 0;
}
}

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