forked from I2P_Developers/i2p.i2p
* Console: Display full path to config file
* i2ptunnel: More escaping
This commit is contained in:
@@ -58,7 +58,7 @@ public class EditBean extends IndexBean {
|
|||||||
public String getTargetHost(int tunnel) {
|
public String getTargetHost(int tunnel) {
|
||||||
TunnelController tun = getController(tunnel);
|
TunnelController tun = getController(tunnel);
|
||||||
if (tun != null && tun.getTargetHost() != null)
|
if (tun != null && tun.getTargetHost() != null)
|
||||||
return tun.getTargetHost();
|
return DataHelper.escapeHTML(tun.getTargetHost());
|
||||||
else
|
else
|
||||||
return "127.0.0.1";
|
return "127.0.0.1";
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ public class EditBean extends IndexBean {
|
|||||||
public String getTargetPort(int tunnel) {
|
public String getTargetPort(int tunnel) {
|
||||||
TunnelController tun = getController(tunnel);
|
TunnelController tun = getController(tunnel);
|
||||||
if (tun != null && tun.getTargetPort() != null)
|
if (tun != null && tun.getTargetPort() != null)
|
||||||
return tun.getTargetPort();
|
return DataHelper.escapeHTML(tun.getTargetPort());
|
||||||
else
|
else
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -74,7 +74,7 @@ public class EditBean extends IndexBean {
|
|||||||
public String getSpoofedHost(int tunnel) {
|
public String getSpoofedHost(int tunnel) {
|
||||||
TunnelController tun = getController(tunnel);
|
TunnelController tun = getController(tunnel);
|
||||||
if (tun != null && tun.getSpoofedHost() != null)
|
if (tun != null && tun.getSpoofedHost() != null)
|
||||||
return tun.getSpoofedHost();
|
return DataHelper.escapeHTML(tun.getSpoofedHost());
|
||||||
else
|
else
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -295,44 +295,44 @@ public class EditBean extends IndexBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** all of these are @since 0.8.3 */
|
/** all of these are @since 0.8.3 */
|
||||||
public String getLimitMinute(int tunnel) {
|
public int getLimitMinute(int tunnel) {
|
||||||
return getProperty(tunnel, PROP_MAX_CONNS_MIN, "0");
|
return getProperty(tunnel, PROP_MAX_CONNS_MIN, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLimitHour(int tunnel) {
|
public int getLimitHour(int tunnel) {
|
||||||
return getProperty(tunnel, PROP_MAX_CONNS_HOUR, "0");
|
return getProperty(tunnel, PROP_MAX_CONNS_HOUR, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLimitDay(int tunnel) {
|
public int getLimitDay(int tunnel) {
|
||||||
return getProperty(tunnel, PROP_MAX_CONNS_DAY, "0");
|
return getProperty(tunnel, PROP_MAX_CONNS_DAY, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTotalMinute(int tunnel) {
|
public int getTotalMinute(int tunnel) {
|
||||||
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_MIN, "0");
|
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_MIN, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTotalHour(int tunnel) {
|
public int getTotalHour(int tunnel) {
|
||||||
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_HOUR, "0");
|
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_HOUR, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTotalDay(int tunnel) {
|
public int getTotalDay(int tunnel) {
|
||||||
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_DAY, "0");
|
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_DAY, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMaxStreams(int tunnel) {
|
public int getMaxStreams(int tunnel) {
|
||||||
return getProperty(tunnel, PROP_MAX_STREAMS, "0");
|
return getProperty(tunnel, PROP_MAX_STREAMS, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POST limits
|
* POST limits
|
||||||
* @since 0.9.9
|
* @since 0.9.9
|
||||||
*/
|
*/
|
||||||
public String getPostMax(int tunnel) {
|
public int getPostMax(int tunnel) {
|
||||||
return getProperty(tunnel, I2PTunnelHTTPServer.OPT_POST_MAX, "0");
|
return getProperty(tunnel, I2PTunnelHTTPServer.OPT_POST_MAX, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPostTotalMax(int tunnel) {
|
public int getPostTotalMax(int tunnel) {
|
||||||
return getProperty(tunnel, I2PTunnelHTTPServer.OPT_POST_TOTAL_MAX, "0");
|
return getProperty(tunnel, I2PTunnelHTTPServer.OPT_POST_TOTAL_MAX, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPostCheckTime(int tunnel) {
|
public int getPostCheckTime(int tunnel) {
|
||||||
@@ -371,8 +371,11 @@ public class EditBean extends IndexBean {
|
|||||||
TunnelController tun = getController(tunnel);
|
TunnelController tun = getController(tunnel);
|
||||||
if (tun != null) {
|
if (tun != null) {
|
||||||
Properties opts = getOptions(tun);
|
Properties opts = getOptions(tun);
|
||||||
if (opts != null)
|
if (opts != null) {
|
||||||
return opts.getProperty(prop, def);
|
String rv = opts.getProperty(prop);
|
||||||
|
if (rv != null)
|
||||||
|
return DataHelper.escapeHTML(rv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
@@ -19,4 +19,9 @@ public class ConfigAdvancedHelper extends HelperBase {
|
|||||||
}
|
}
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 0.9.14.1 */
|
||||||
|
public String getConfigFileName() {
|
||||||
|
return _context.router().getConfigFilename();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -38,6 +38,6 @@
|
|||||||
<br><b><%=intl._("NOTE")%>:</b> <%=intl._("Some changes may require a restart to take effect.")%>
|
<br><b><%=intl._("NOTE")%>:</b> <%=intl._("Some changes may require a restart to take effect.")%>
|
||||||
</div></form>
|
</div></form>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
To make changes, edit the router.config file.
|
<%=intl._("To make changes, edit the file {0}.", "<tt>" + advancedhelper.getConfigFileName() + "</tt>")%>
|
||||||
<% } // isAdvanced %>
|
<% } // isAdvanced %>
|
||||||
</div></div></div></body></html>
|
</div></div></div></body></html>
|
||||||
|
@@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 4;
|
public final static long BUILD = 5;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "-rc";
|
public final static String EXTRA = "-rc";
|
||||||
|
Reference in New Issue
Block a user