Skip to content

Commit

Permalink
Merge branch 'master' of i2pgit.org:i2p-hackers/i2p.i2p into i2p.i2p.…
Browse files Browse the repository at this point in the history
…2.4.0-revert-buildhandler-changes
  • Loading branch information
eyedeekay committed Nov 7, 2023
2 parents 8ae5427 + 3db4f23 commit b49dd4f
Show file tree
Hide file tree
Showing 39 changed files with 916 additions and 1,230 deletions.
1,192 changes: 635 additions & 557 deletions .tx/config

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private void saveChanges() {
private void saveFF() {
boolean saved = _context.router().saveConfig(ConfigAdvancedHelper.PROP_FLOODFILL_PARTICIPANT, _ff);
if (_ff.equals("false") || _ff.equals("true")) {
FloodfillNetworkDatabaseFacade fndf = _context.netDb();
FloodfillNetworkDatabaseFacade fndf = (FloodfillNetworkDatabaseFacade) _context.netDb();
boolean isFF = _ff.equals("true");
// this will rebuild the RI, log in the event log, etc.
fndf.setFloodfillEnabled(isFF);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public void renderStatusHTML(Writer out, int mode) throws IOException {
buf.append("<tr><td><b>")
.append("Caps").append(":</b></td><td>").append(_t("capabilities in the netDb, not used to determine profiles"))
.append("</td></tr>");
buf.append("<tr id=\"capabilities_key\"><td colspan=\"2\"><table><tbody>");
buf.append("<tr><td colspan=\"2\"><table id=\"capabilities_key\"><tbody>");
buf.append("<tr><td>&nbsp;</td>")
.append("<td><b>D</b></td><td>").append(_t("Congested")).append("</td>")
.append("<td><b>E</b></td><td>").append(_t("Severely congested")).append("</td>" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -985,13 +985,14 @@ public String getFirewallAndReseedStatus() {
.append("</b></div>");
}

// checker will be null for DummyNetworkDatabaseFacade
ReseedChecker checker = _context.netDb().reseedChecker();
String status = checker.getStatus();
String status = checker != null ? checker.getStatus() : "";
if (status.length() > 0) {
// Show status message even if not running, timer in ReseedChecker should remove after 20 minutes
buf.append("<div class=\"sb_notice\"><i>").append(status).append("</i></div>");
}
if (!checker.inProgress()) {
if (checker != null && !checker.inProgress()) {
// If a new reseed isn't running, and the last reseed had errors, show error message
String reseedErrorMessage = checker.getError();
if (reseedErrorMessage.length() > 0) {
Expand Down
7 changes: 4 additions & 3 deletions apps/routerconsole/jsp/css.jsi
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@
%><link rel="icon" href="<%=theThemePath%>images/favicon.ico">
<link id="pagestyle" href="<%=theThemePath%>console.css?<%=net.i2p.CoreVersion.VERSION%>" rel="stylesheet" type="text/css">
<%
if (intl.getLang().equals("zh")) {
String curlang = intl.getLang();
if (curlang.equals("zh")) {
// make the fonts bigger for chinese
%><link href="<%=theThemePath%>console_big.css?<%=net.i2p.CoreVersion.VERSION%>" rel="stylesheet" type="text/css">
<%
} else if (intl.getLang().equals("ar")) {
// Use RTL theme for Arabic
} else if (curlang.equals("ar") || curlang.equals("fa")) {
// Use RTL theme for Arabic and Persian
%><link href="<%=theThemePath%>console_ar.css?<%=net.i2p.CoreVersion.VERSION%>" rel="stylesheet" type="text/css">
<%
}
Expand Down
12 changes: 7 additions & 5 deletions apps/routerconsole/jsp/themes/console/dark/console.css
Original file line number Diff line number Diff line change
Expand Up @@ -5158,14 +5158,19 @@ table#thresholds td {
}

#profile_defs td:first-child {
width: 5% !important;
width: 8% !important;
white-space: nowrap;
text-align: right;
}

#profile_defs td:last-child {
white-space: normal;
line-height: 120%;
text-align: left;
}

#profile_defs td:nth-child(2)::first-letter {
text-transform: uppercase;
}

#thresholds th,
Expand All @@ -5186,10 +5191,7 @@ table#thresholds td {

#capabilities_key table td {
padding: 3px 5px !important;
}

#capabilities_key table td:nth-child(even) {
width: 16px;
text-align: left;
}

#capabilities_key b {
Expand Down
4 changes: 4 additions & 0 deletions apps/routerconsole/jsp/themes/console/dark/console_ar.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ input.search, input.search:focus {
background-position: right 4px center !important;
}

.routersummaryouter {
margin: 0 2px 10px 5px;
}

.routersummary img[src$="i2plogo.png"] {
margin-top: -2px !important;
margin-left: 0 !important;
Expand Down
12 changes: 3 additions & 9 deletions apps/routerconsole/jsp/themes/console/light/console.css
Original file line number Diff line number Diff line change
Expand Up @@ -6516,14 +6516,15 @@ ul#banlist {
}

#profile_defs td:first-child {
width: 5% !important;
width: 8% !important;
white-space: nowrap;
text-align: right;
}

#profile_defs td:last-child {
white-space: normal;
line-height: 120%;
text-align: left;
}

#profile_defs td:nth-child(2)::first-letter {
Expand All @@ -6548,14 +6549,7 @@ ul#banlist {

#capabilities_key table td {
padding: 3px 5px !important;
}

#capabilities_key table td:nth-child(even) {
width: 16px;
}

#capabilities_key td:nth-child(2)::first-letter {
text-transform: none;
text-align: left;
}

#capabilities_key b {
Expand Down
2 changes: 1 addition & 1 deletion apps/routerconsole/jsp/themes/console/light/console_ar.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ h2, h3 {
}

.routersummaryouter {
margin-right: -1px;
margin-right: 8px;
}

.routersummary {
Expand Down
41 changes: 8 additions & 33 deletions core/java/src/net/i2p/client/naming/LookupDest.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,6 @@ static Destination lookupHostname(I2PAppContext ctx, String hostname) throws I2P
return rv;
}

private static boolean deleteHostname(I2PAppContext ctx, String hostname) {
try {
Destination dest = lookupHostname(I2PAppContext.getGlobalContext(), hostname);
if (dest == null)
System.err.println("Destination not found!");
else {
NamingService ns = I2PAppContext.getGlobalContext().namingService();
if (ns != null)
return ns.remove(hostname, dest);
System.err.print("ns is null");
}
} catch (I2PSessionException ise) {
ise.printStackTrace();
}
return false;
}

/**
* @since 0.9.40 split out from above
*/
Expand Down Expand Up @@ -147,22 +130,14 @@ public static void main(String args[]) {
System.err.println("Usage: LookupDest hostname|b32");
System.exit(1);
}
if (args[0].length() == 1) {
try {
Destination dest = lookupHostname(I2PAppContext.getGlobalContext(), args[0]);
if (dest == null)
System.err.println("Destination not found!");
else
System.out.println(dest.toBase64());
} catch (I2PSessionException ise) {
ise.printStackTrace();
}
}
if (args[0].length() == 2) {
if (args[0] == "-d") {
deleteHostname(I2PAppContext.getGlobalContext(), args[1]);
}
try {
Destination dest = lookupHostname(I2PAppContext.getGlobalContext(), args[0]);
if (dest == null)
System.err.println("Destination not found!");
else
System.out.println(dest.toBase64());
} catch (I2PSessionException ise) {
ise.printStackTrace();
}

}
}
33 changes: 21 additions & 12 deletions core/java/src/net/i2p/data/DatabaseEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,27 @@ public abstract class DatabaseEntry extends DataStructureImpl {
// synch: this
private Hash _currentRoutingKey;
private long _routingKeyGenMod;
protected boolean _receivedAsPublished;
protected boolean _receivedAsReply;
private boolean _receivedAsPublished;
private boolean _receivedAsReply;

/**
* Hash of the client receiving the routerinfo, or null if it was sent directly.
*/
private Hash _receivedBy;

/**
* The Hash of the local client that received this LS,
* null if the router or unknown.
*
* @since 0.9.47
*/
public Hash getReceivedBy() {
return _receivedBy;
}

public void setReceivedBy(Hash receivedBy) {
this._receivedBy = receivedBy;
}

/**
* A common interface to the timestamp of the two subclasses.
Expand Down Expand Up @@ -134,16 +153,6 @@ public static boolean isLeaseSet(int type) {
type == KEY_TYPE_META_LS2;
}

/**
* Convenience method, is the type any variant of router info?
*
* @return true for any type of RouterInfo, false for LeaseSet, false for others
* @since x.x.x
*/
public boolean isRouterInfo() {
return (getType() == KEY_TYPE_ROUTERINFO);
}

/**
* Returns the raw payload data, excluding the signature, to be signed by sign().
*
Expand Down
15 changes: 3 additions & 12 deletions core/java/src/net/i2p/data/LeaseSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public class LeaseSet extends DatabaseEntry {
protected SigningPublicKey _signingKey;
// Keep leases in the order received, or else signature verification will fail!
protected final List<Lease> _leases;
private Hash _receivedBy;
// Store these since isCurrent() and getEarliestLeaseDate() are called frequently
private long _firstExpiration;
protected long _lastExpiration;
Expand Down Expand Up @@ -185,22 +184,14 @@ public void setSigningKey(SigningPublicKey key) {
_signingKey = key;
}

/**
* The Hash of the local client that received this LS,
* null if the router or unknown.
*
* @since 0.9.47
*/
public Hash getReceivedBy() { return _receivedBy; }

/**
* Also sets receivedAsReply to true
* @param localClient may be null
* @since 0.9.47
*/
public void setReceivedBy(Hash localClient) {
_receivedAsReply = true;
_receivedBy = localClient;
super.setReceivedBy(localClient);
super.setReceivedAsReply();
}

/**
Expand Down Expand Up @@ -331,7 +322,7 @@ protected byte[] getBytes() {
}
byte rv[] = out.toByteArray();
// if we are floodfill and this was published to us
if (_receivedAsPublished)
if (getReceivedAsPublished())
_byteified = rv;
return rv;
}
Expand Down
2 changes: 1 addition & 1 deletion core/java/src/net/i2p/data/LeaseSet2.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ protected byte[] getBytes() {
}
byte rv[] = out.toByteArray();
// if we are floodfill and this was published to us
if (_receivedAsPublished)
if (getReceivedAsPublished())
_byteified = rv;
return rv;
}
Expand Down
2 changes: 1 addition & 1 deletion core/java/src/net/i2p/util/SystemVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public static void main(String[] args) {
System.out.println("Java 9 : " + isJava9());
System.out.println("Java 10 : " + isJava10());
System.out.println("Java 11 : " + isJava11());
for (int i = 12; i <= 17; i++) {
for (int i = 12; i <= 22; i++) {
System.out.println("Java " + i + " : " + isJava(i));
}
System.out.println("Android : " + isAndroid());
Expand Down
15 changes: 15 additions & 0 deletions history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
2023-11-02 zzz
* NetDB: Enforce no RIs in subdbs (Gitlab #465)
- Throw IAE if attempting to store/publish RI to subdb
- Log warnings if attempting to lookup RI in subdb
- Revert changes to createPeerSelector()
- Revert peer selector changes in SearchJob and StoreJob
- Use common PeerSelector and KBucketSet for all dbs
- Revert/fix FloodfillVerifyStoreJob to looukp RIs in the main DB
- Don't start ExpireRoutersJob in subdbs
- Revert change in InboundMessageDistributor that was looking up RI in subdb
- Remove KNDF.isMainDb(), replace with !isClientDb()

2023-10-29 zzz
* Console: Netdb tab fixes and cleanup (Gitlab #465)

2023-10-28 zzz
* i2ptunnel:
- Remove nonstandard Proxy-Connection headers (Gitlab #452)
Expand Down
10 changes: 5 additions & 5 deletions installer/resources/checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- Review changes in English po files, fix up any necessary tagged strings in Java source
- Revert English po files with no actual changes (i.e. with line number changes only)
- Check in remaining English po files (and any files with changed strings)
- Push to Transifex: `tx push -s`
- Push to Transifex: `tx push --use-git-timestamps -s`
- Make announcement on Transifex with checkin deadline

- GeoIP: db-ip.com update is usually first of the month, time accordingly
Expand Down Expand Up @@ -47,15 +47,15 @@
- See README for setup
- `./create_new_entry.sh`
- Entry href should be the in-net link to the release blog post
- `tx push -s`
- `tx push --use-git-timestamps -s`
- `git commit`

2. Write the draft blog post and push to Transifex:

- Checkout i2p.www branch
- Write draft release announcement - see i2p2www/blog/README for instructions
- Top content should be the same as the news entry
- `tx push -s -r I2P.website_blog`
- `tx push --use-git-timestamps -s -r I2P.website_blog`
- `git commit`

3. Make announcement on Transifex asking for news translation
Expand All @@ -73,7 +73,7 @@
- Look for newly translated languages and resources on Transifex
- Add any new ones to .tx/config (use your own judgement on which to include
based on minimum translated percentage)
- `tx pull`
- `tx pull --use-git-timestamps`
- `ant testscripts` to verify that all updated translations are valid
- For any invalid that break the test, fix up the po file manually, or fix on
tx and pull again, or (if new) comment out in .tx/config (add a comment why)
Expand Down Expand Up @@ -266,7 +266,7 @@
8. Notify downstream Debian maintainer
9. Pull announcement translations:
- `tx pull -r I2P.website_blog`
- `tx pull --use-git-timestamps -r I2P.website_blog`
Do NOT forget this step!
- `./update-existing-po.sh`
- `git commit i2p2www/translations/ -m "Updated translations"`
13 changes: 0 additions & 13 deletions router/java/src/net/i2p/data/router/RouterInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,6 @@ public class RouterInfo extends DatabaseEntry {
public static final String PROP_CAPABILITIES = "caps";
public static final char CAPABILITY_HIDDEN = 'H';
private static final int MAX_ADDRESSES = 16;

/**
* Hash of the client receiving the routerinfo, or null if it was sent directly.
*/
private Hash _receivedBy;

public Hash getReceivedBy() {
return _receivedBy;
}

public void setReceivedBy(Hash _receivedBy) {
this._receivedBy = _receivedBy;
}

/** Public string of chars which serve as bandwidth capacity markers
* NOTE: individual chars defined in Router.java
Expand Down
2 changes: 1 addition & 1 deletion router/java/src/net/i2p/router/MultiRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private static void internalReseed() {

HashSet<RouterInfo> riSet = new HashSet<RouterInfo>();
for(Router r : _routers) {
riSet.addAll(r.getContext().netDbSegmentor().getRouters());
riSet.addAll(r.getContext().netDb().getRouters());
}
for(Router r : _routers) {
for(RouterInfo ri : riSet){
Expand Down
Loading

0 comments on commit b49dd4f

Please sign in to comment.