diff --git a/apps/BOB/nbproject/private/private.xml b/apps/BOB/nbproject/private/private.xml index c1f155a782bd6f432a8846f3d3b308ba6fa6856c..685ecc5a17a87bd05cb901d0467d30e36faba558 100644 --- a/apps/BOB/nbproject/private/private.xml +++ b/apps/BOB/nbproject/private/private.xml @@ -1,4 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/> + <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1"> + <file>file:/usblv/NetBeansProjects/wi2p.i2p/apps/BOB/src/net/i2p/BOB/BOB.java</file> + </open-files> </project-private> diff --git a/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java b/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java index 950f2e82714bd143ba8c99725d18ed07618a7268..bf7c146cb9e74e94e4279661db07840d5088b86e 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java +++ b/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java @@ -1,760 +1,760 @@ -package org.klomp.snark; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FilenameFilter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import java.util.StringTokenizer; -import java.util.TreeMap; - -import net.i2p.I2PAppContext; -import net.i2p.data.Base64; -import net.i2p.data.DataHelper; -import net.i2p.util.I2PAppThread; -import net.i2p.util.Log; - -/** - * Manage multiple snarks - */ -public class SnarkManager implements Snark.CompleteListener { - private static SnarkManager _instance = new SnarkManager(); - public static SnarkManager instance() { return _instance; } - - /** map of (canonical) filename to Snark instance (unsynchronized) */ - private final Map _snarks; - private final Object _addSnarkLock; - private /* FIXME final FIXME */ File _configFile; - private Properties _config; - private I2PAppContext _context; - private Log _log; - private final List _messages; - private I2PSnarkUtil _util; - private PeerCoordinatorSet _peerCoordinatorSet; - private ConnectionAcceptor _connectionAcceptor; - - public static final String PROP_I2CP_HOST = "i2psnark.i2cpHost"; - public static final String PROP_I2CP_PORT = "i2psnark.i2cpPort"; - public static final String PROP_I2CP_OPTS = "i2psnark.i2cpOptions"; - public static final String PROP_EEP_HOST = "i2psnark.eepHost"; - public static final String PROP_EEP_PORT = "i2psnark.eepPort"; - public static final String PROP_UPLOADERS_TOTAL = "i2psnark.uploaders.total"; - public static final String PROP_UPBW_MAX = "i2psnark.upbw.max"; - public static final String PROP_DIR = "i2psnark.dir"; - public static final String PROP_META_PREFIX = "i2psnark.zmeta."; - public static final String PROP_META_BITFIELD_SUFFIX = ".bitfield"; - - private static final String CONFIG_FILE = "i2psnark.config"; - public static final String PROP_AUTO_START = "i2snark.autoStart"; // oops - public static final String DEFAULT_AUTO_START = "false"; - public static final String PROP_LINK_PREFIX = "i2psnark.linkPrefix"; - public static final String DEFAULT_LINK_PREFIX = "file:///"; - - public static final int MIN_UP_BW = 2; - public static final int DEFAULT_MAX_UP_BW = 10; - - private SnarkManager() { - _snarks = new HashMap(); - _addSnarkLock = new Object(); - _context = I2PAppContext.getGlobalContext(); - _log = _context.logManager().getLog(SnarkManager.class); - _messages = new ArrayList(16); - _util = new I2PSnarkUtil(_context); - _configFile = new File(CONFIG_FILE); - if (!_configFile.isAbsolute()) - _configFile = new File(_context.getConfigDir(), CONFIG_FILE); - loadConfig(null); - } - - /** Caller _must_ call loadConfig(file) before this if setting new values - * for i2cp host/port or i2psnark.dir - */ - public void start() { - _peerCoordinatorSet = new PeerCoordinatorSet(); - _connectionAcceptor = new ConnectionAcceptor(_util); - int minutes = getStartupDelayMinutes(); - _messages.add("Adding torrents in " + minutes + (minutes == 1 ? " minute" : " minutes")); - I2PAppThread monitor = new I2PAppThread(new DirMonitor(), "Snark DirMonitor"); - monitor.setDaemon(true); - monitor.start(); - _context.addShutdownTask(new SnarkManagerShutdown()); - } - - /** hook to I2PSnarkUtil for the servlet */ - public I2PSnarkUtil util() { return _util; } - - private static final int MAX_MESSAGES = 5; - public void addMessage(String message) { - synchronized (_messages) { - _messages.add(message); - while (_messages.size() > MAX_MESSAGES) - _messages.remove(0); - } - if (_log.shouldLog(Log.INFO)) - _log.info("MSG: " + message); - } - - /** newest last */ - public List getMessages() { - synchronized (_messages) { - return new ArrayList(_messages); - } - } - - public boolean shouldAutoStart() { - return Boolean.valueOf(_config.getProperty(PROP_AUTO_START, DEFAULT_AUTO_START+"")).booleanValue(); - } - public String linkPrefix() { - return _config.getProperty(PROP_LINK_PREFIX, DEFAULT_LINK_PREFIX + getDataDir().getAbsolutePath() + File.separatorChar); - } - private int getStartupDelayMinutes() { return 3; } - public File getDataDir() { - String dir = _config.getProperty(PROP_DIR, "i2psnark"); - File f = new File(dir); - if (!f.isAbsolute()) - f = new File(_context.getAppDir(), dir); - return f; - } - - /** null to set initial defaults */ - public void loadConfig(String filename) { - if (_config == null) - _config = new Properties(); - if (filename != null) { - File cfg = new File(filename); - if (!cfg.isAbsolute()) - cfg = new File(_context.getConfigDir(), filename); - _configFile = cfg; - if (cfg.exists()) { - try { - DataHelper.loadProps(_config, cfg); - } catch (IOException ioe) { - _log.error("Error loading I2PSnark config '" + filename + "'", ioe); - } - } - } - // now add sane defaults - if (!_config.containsKey(PROP_I2CP_HOST)) - _config.setProperty(PROP_I2CP_HOST, "127.0.0.1"); - if (!_config.containsKey(PROP_I2CP_PORT)) - _config.setProperty(PROP_I2CP_PORT, "7654"); - if (!_config.containsKey(PROP_I2CP_OPTS)) - _config.setProperty(PROP_I2CP_OPTS, "inbound.length=2 inbound.lengthVariance=0 outbound.length=2 outbound.lengthVariance=0 inbound.quantity=3 outbound.quantity=3"); - if (!_config.containsKey(PROP_EEP_HOST)) - _config.setProperty(PROP_EEP_HOST, "127.0.0.1"); - if (!_config.containsKey(PROP_EEP_PORT)) - _config.setProperty(PROP_EEP_PORT, "4444"); - if (!_config.containsKey(PROP_UPLOADERS_TOTAL)) - _config.setProperty(PROP_UPLOADERS_TOTAL, "" + Snark.MAX_TOTAL_UPLOADERS); - if (!_config.containsKey(PROP_DIR)) - _config.setProperty(PROP_DIR, "i2psnark"); - if (!_config.containsKey(PROP_AUTO_START)) - _config.setProperty(PROP_AUTO_START, DEFAULT_AUTO_START); - updateConfig(); - } - - /** call from DirMonitor since loadConfig() is called before router I2CP is up */ - private void getBWLimit() { - if (!_config.containsKey(PROP_UPBW_MAX)) { - int[] limits = BWLimits.getBWLimits(_util.getI2CPHost(), _util.getI2CPPort()); - if (limits != null && limits[1] > 0) - _util.setMaxUpBW(limits[1]); - } - } - - private void updateConfig() { - String i2cpHost = _config.getProperty(PROP_I2CP_HOST); - int i2cpPort = getInt(PROP_I2CP_PORT, 7654); - String opts = _config.getProperty(PROP_I2CP_OPTS); - Map i2cpOpts = new HashMap(); - if (opts != null) { - StringTokenizer tok = new StringTokenizer(opts, " "); - while (tok.hasMoreTokens()) { - String pair = tok.nextToken(); - int split = pair.indexOf('='); - if (split > 0) - i2cpOpts.put(pair.substring(0, split), pair.substring(split+1)); - } - } - if (i2cpHost != null) { - _util.setI2CPConfig(i2cpHost, i2cpPort, i2cpOpts); - _log.debug("Configuring with I2CP options " + i2cpOpts); - } - //I2PSnarkUtil.instance().setI2CPConfig("66.111.51.110", 7654, new Properties()); - String eepHost = _config.getProperty(PROP_EEP_HOST); - int eepPort = getInt(PROP_EEP_PORT, 4444); - if (eepHost != null) - _util.setProxy(eepHost, eepPort); - _util.setMaxUploaders(getInt(PROP_UPLOADERS_TOTAL, Snark.MAX_TOTAL_UPLOADERS)); - _util.setMaxUpBW(getInt(PROP_UPBW_MAX, DEFAULT_MAX_UP_BW)); - getDataDir().mkdirs(); - } - - private int getInt(String prop, int defaultVal) { - String p = _config.getProperty(prop); - try { - if ( (p != null) && (p.trim().length() > 0) ) - return Integer.parseInt(p.trim()); - } catch (NumberFormatException nfe) { - // ignore - } - return defaultVal; - } - - public void updateConfig(String dataDir, boolean autoStart, String seedPct, String eepHost, - String eepPort, String i2cpHost, String i2cpPort, String i2cpOpts, - String upLimit, String upBW, boolean useOpenTrackers, String openTrackers) { - boolean changed = false; - if (eepHost != null) { - int port = _util.getEepProxyPort(); - try { port = Integer.parseInt(eepPort); } catch (NumberFormatException nfe) {} - String host = _util.getEepProxyHost(); - if ( (eepHost.trim().length() > 0) && (port > 0) && - ((!host.equals(eepHost) || (port != _util.getEepProxyPort()) )) ) { - _util.setProxy(eepHost, port); - changed = true; - _config.setProperty(PROP_EEP_HOST, eepHost); - _config.setProperty(PROP_EEP_PORT, eepPort+""); - addMessage("EepProxy location changed to " + eepHost + ":" + port); - } - } - if (upLimit != null) { - int limit = _util.getMaxUploaders(); - try { limit = Integer.parseInt(upLimit); } catch (NumberFormatException nfe) {} - if ( limit != _util.getMaxUploaders()) { - if ( limit >= Snark.MIN_TOTAL_UPLOADERS ) { - _util.setMaxUploaders(limit); - changed = true; - _config.setProperty(PROP_UPLOADERS_TOTAL, "" + limit); - addMessage("Total uploaders limit changed to " + limit); - } else { - addMessage("Minimum total uploaders limit is " + Snark.MIN_TOTAL_UPLOADERS); - } - } - } - if (upBW != null) { - int limit = _util.getMaxUpBW(); - try { limit = Integer.parseInt(upBW); } catch (NumberFormatException nfe) {} - if ( limit != _util.getMaxUpBW()) { - if ( limit >= MIN_UP_BW ) { - _util.setMaxUpBW(limit); - changed = true; - _config.setProperty(PROP_UPBW_MAX, "" + limit); - addMessage("Up BW limit changed to " + limit + "KBps"); - } else { - addMessage("Minimum Up BW limit is " + MIN_UP_BW + "KBps"); - } - } - } - if (i2cpHost != null) { - int oldI2CPPort = _util.getI2CPPort(); - String oldI2CPHost = _util.getI2CPHost(); - int port = oldI2CPPort; - try { port = Integer.parseInt(i2cpPort); } catch (NumberFormatException nfe) {} - String host = oldI2CPHost; - Map opts = new HashMap(); - if (i2cpOpts == null) i2cpOpts = ""; - StringTokenizer tok = new StringTokenizer(i2cpOpts, " \t\n"); - while (tok.hasMoreTokens()) { - String pair = tok.nextToken(); - int split = pair.indexOf('='); - if (split > 0) - opts.put(pair.substring(0, split), pair.substring(split+1)); - } - Map oldOpts = new HashMap(); - String oldI2CPOpts = _config.getProperty(PROP_I2CP_OPTS); - if (oldI2CPOpts == null) oldI2CPOpts = ""; - tok = new StringTokenizer(oldI2CPOpts, " \t\n"); - while (tok.hasMoreTokens()) { - String pair = tok.nextToken(); - int split = pair.indexOf('='); - if (split > 0) - oldOpts.put(pair.substring(0, split), pair.substring(split+1)); - } - - if ( (i2cpHost.trim().length() > 0) && (port > 0) && - ((!host.equals(i2cpHost) || - (port != _util.getI2CPPort()) || - (!oldOpts.equals(opts)))) ) { - boolean snarksActive = false; - Set names = listTorrentFiles(); - for (Iterator iter = names.iterator(); iter.hasNext(); ) { - Snark snark = getTorrent((String)iter.next()); - if ( (snark != null) && (!snark.stopped) ) { - snarksActive = true; - break; - } - } - if (snarksActive) { - addMessage("Cannot change the I2CP settings while torrents are active"); - _log.debug("i2cp host [" + i2cpHost + "] i2cp port " + port + " opts [" + opts - + "] oldOpts [" + oldOpts + "]"); - } else { - if (_util.connected()) { - _util.disconnect(); - addMessage("Disconnecting old I2CP destination"); - } - Properties p = new Properties(); - p.putAll(opts); - addMessage("I2CP settings changed to " + i2cpHost + ":" + port + " (" + i2cpOpts.trim() + ")"); - _util.setI2CPConfig(i2cpHost, port, p); - boolean ok = _util.connect(); - if (!ok) { - addMessage("Unable to connect with the new settings, reverting to the old I2CP settings"); - _util.setI2CPConfig(oldI2CPHost, oldI2CPPort, oldOpts); - ok = _util.connect(); - if (!ok) - addMessage("Unable to reconnect with the old settings!"); - } else { - addMessage("Reconnected on the new I2CP destination"); - _config.setProperty(PROP_I2CP_HOST, i2cpHost.trim()); - _config.setProperty(PROP_I2CP_PORT, "" + port); - _config.setProperty(PROP_I2CP_OPTS, i2cpOpts.trim()); - changed = true; - // no PeerAcceptors/I2PServerSockets to deal with, since all snarks are inactive - for (Iterator iter = names.iterator(); iter.hasNext(); ) { - String name = (String)iter.next(); - Snark snark = getTorrent(name); - if ( (snark != null) && (snark.acceptor != null) ) { - snark.acceptor.restart(); - addMessage("I2CP listener restarted for " + snark.meta.getName()); - } - } - } - } - changed = true; - } - } - if (shouldAutoStart() != autoStart) { - _config.setProperty(PROP_AUTO_START, autoStart + ""); - addMessage("Adjusted autostart to " + autoStart); - changed = true; - } - if (_util.shouldUseOpenTrackers() != useOpenTrackers) { - _config.setProperty(I2PSnarkUtil.PROP_USE_OPENTRACKERS, useOpenTrackers + ""); - addMessage((useOpenTrackers ? "En" : "Dis") + "abled open trackers - torrent restart required to take effect."); - changed = true; - } - if (openTrackers != null) { - if (openTrackers.trim().length() > 0 && !openTrackers.trim().equals(_util.getOpenTrackerString())) { - _config.setProperty(I2PSnarkUtil.PROP_OPENTRACKERS, openTrackers.trim()); - addMessage("Open Tracker list changed - torrent restart required to take effect."); - changed = true; - } - } - if (changed) { - saveConfig(); - } else { - addMessage("Configuration unchanged."); - } - } - - public void saveConfig() { - try { - synchronized (_configFile) { - DataHelper.storeProps(_config, _configFile); - } - } catch (IOException ioe) { - addMessage("Unable to save the config to '" + _configFile.getAbsolutePath() + "'."); - } - } - - public Properties getConfig() { return _config; } - - /** hardcoded for sanity. perhaps this should be customizable, for people who increase their ulimit, etc. */ - private static final int MAX_FILES_PER_TORRENT = 512; - - /** set of filenames that we are dealing with */ - public Set listTorrentFiles() { synchronized (_snarks) { return new HashSet(_snarks.keySet()); } } - /** - * Grab the torrent given the (canonical) filename - */ - public Snark getTorrent(String filename) { synchronized (_snarks) { return (Snark)_snarks.get(filename); } } - public void addTorrent(String filename) { addTorrent(filename, false); } - public void addTorrent(String filename, boolean dontAutoStart) { - if ((!dontAutoStart) && !_util.connected()) { - addMessage("Connecting to I2P"); - boolean ok = _util.connect(); - if (!ok) { - addMessage("Error connecting to I2P - check your I2CP settings!"); - return; - } - } - File sfile = new File(filename); - try { - filename = sfile.getCanonicalPath(); - } catch (IOException ioe) { - _log.error("Unable to add the torrent " + filename, ioe); - addMessage("ERR: Could not add the torrent '" + filename + "': " + ioe.getMessage()); - return; - } - File dataDir = getDataDir(); - Snark torrent = null; - synchronized (_snarks) { - torrent = (Snark)_snarks.get(filename); - } - // don't hold the _snarks lock while verifying the torrent - if (torrent == null) { - synchronized (_addSnarkLock) { - // double-check - synchronized (_snarks) { - if(_snarks.get(filename) != null) - return; - } - - FileInputStream fis = null; - try { - fis = new FileInputStream(sfile); - MetaInfo info = new MetaInfo(fis); - fis.close(); - fis = null; - - String rejectMessage = locked_validateTorrent(info); - if (rejectMessage != null) { - sfile.delete(); - addMessage(rejectMessage); - return; - } else { - torrent = new Snark(_util, filename, null, -1, null, null, this, - _peerCoordinatorSet, _connectionAcceptor, - false, dataDir.getPath()); - torrent.completeListener = this; - synchronized (_snarks) { - _snarks.put(filename, torrent); - } - } - } catch (IOException ioe) { - addMessage("Torrent in " + sfile.getName() + " is invalid: " + ioe.getMessage()); - if (sfile.exists()) - sfile.delete(); - return; - } finally { - if (fis != null) try { fis.close(); } catch (IOException ioe) {} - } - } - } else { - return; - } - // ok, snark created, now lets start it up or configure it further - File f = new File(filename); - if (!dontAutoStart && shouldAutoStart()) { - torrent.startTorrent(); - addMessage("Torrent added and started: '" + f.getName() + "'."); - } else { - addMessage("Torrent added: '" + f.getName() + "'."); - } - } - - /** - * Get the timestamp for a torrent from the config file - */ - public long getSavedTorrentTime(Snark snark) { - MetaInfo metainfo = snark.meta; - byte[] ih = metainfo.getInfoHash(); - String infohash = Base64.encode(ih); - infohash = infohash.replace('=', '$'); - String time = _config.getProperty(PROP_META_PREFIX + infohash + PROP_META_BITFIELD_SUFFIX); - if (time == null) - return 0; - int comma = time.indexOf(','); - if (comma <= 0) - return 0; - time = time.substring(0, comma); - try { return Long.parseLong(time); } catch (NumberFormatException nfe) {} - return 0; - } - - /** - * Get the saved bitfield for a torrent from the config file. - * Convert "." to a full bitfield. - */ - public BitField getSavedTorrentBitField(Snark snark) { - MetaInfo metainfo = snark.meta; - byte[] ih = metainfo.getInfoHash(); - String infohash = Base64.encode(ih); - infohash = infohash.replace('=', '$'); - String bf = _config.getProperty(PROP_META_PREFIX + infohash + PROP_META_BITFIELD_SUFFIX); - if (bf == null) - return null; - int comma = bf.indexOf(','); - if (comma <= 0) - return null; - bf = bf.substring(comma + 1).trim(); - int len = metainfo.getPieces(); - if (bf.equals(".")) { - BitField bitfield = new BitField(len); - for (int i = 0; i < len; i++) - bitfield.set(i); - return bitfield; - } - byte[] bitfield = Base64.decode(bf); - if (bitfield == null) - return null; - if (bitfield.length * 8 < len) - return null; - return new BitField(bitfield, len); - } - - /** - * Save the completion status of a torrent and the current time in the config file - * in the form "i2psnark.zmeta.$base64infohash=$time,$base64bitfield". - * The config file property key is appended with the Base64 of the infohash, - * with the '=' changed to '$' since a key can't contain '='. - * The time is a standard long converted to string. - * The status is either a bitfield converted to Base64 or "." for a completed - * torrent to save space in the config file and in memory. - */ - public void saveTorrentStatus(MetaInfo metainfo, BitField bitfield) { - byte[] ih = metainfo.getInfoHash(); - String infohash = Base64.encode(ih); - infohash = infohash.replace('=', '$'); - String now = "" + System.currentTimeMillis(); - String bfs; - if (bitfield.complete()) { - bfs = "."; - } else { - byte[] bf = bitfield.getFieldBytes(); - bfs = Base64.encode(bf); - } - _config.setProperty(PROP_META_PREFIX + infohash + PROP_META_BITFIELD_SUFFIX, now + "," + bfs); - saveConfig(); - } - - /** - * Remove the status of a torrent from the config file. - * This may help the config file from growing too big. - */ - public void removeTorrentStatus(MetaInfo metainfo) { - byte[] ih = metainfo.getInfoHash(); - String infohash = Base64.encode(ih); - infohash = infohash.replace('=', '$'); - _config.remove(PROP_META_PREFIX + infohash + PROP_META_BITFIELD_SUFFIX); - saveConfig(); - } - - private String locked_validateTorrent(MetaInfo info) throws IOException { - String announce = info.getAnnounce(); - // basic validation of url - if ((!announce.startsWith("http://")) || - (announce.indexOf(".i2p/") < 0)) // need to do better than this - return "Non-i2p tracker in " + info.getName() + ", deleting it from our list of trackers!"; - List files = info.getFiles(); - if ( (files != null) && (files.size() > MAX_FILES_PER_TORRENT) ) { - return "Too many files in " + info.getName() + " (" + files.size() + "), deleting it!"; - } else if (info.getPieces() <= 0) { - return "No pieces in " + info.getName() + "? deleting it!"; - } else if (info.getPieceLength(0) > Storage.MAX_PIECE_SIZE) { - return "Pieces are too large in " + info.getName() + " (" + DataHelper.formatSize(info.getPieceLength(0)) + - "B), deleting it."; - } else if (info.getTotalLength() > Storage.MAX_TOTAL_SIZE) { - System.out.println("torrent info: " + info.toString()); - List lengths = info.getLengths(); - if (lengths != null) - for (int i = 0; i < lengths.size(); i++) - System.out.println("File " + i + " is " + lengths.get(i) + " long."); - - return "Torrents larger than " + DataHelper.formatSize(Storage.MAX_TOTAL_SIZE) + - "B are not supported yet (because we're paranoid): " + info.getName() + ", deleting it!"; - } else { - // ok - return null; - } - } - - /** - * Stop the torrent, leaving it on the list of torrents unless told to remove it - */ - public Snark stopTorrent(String filename, boolean shouldRemove) { - File sfile = new File(filename); - try { - filename = sfile.getCanonicalPath(); - } catch (IOException ioe) { - _log.error("Unable to remove the torrent " + filename, ioe); - addMessage("ERR: Could not remove the torrent '" + filename + "': " + ioe.getMessage()); - return null; - } - int remaining = 0; - Snark torrent = null; - synchronized (_snarks) { - if (shouldRemove) - torrent = (Snark)_snarks.remove(filename); - else - torrent = (Snark)_snarks.get(filename); - remaining = _snarks.size(); - } - if (torrent != null) { - boolean wasStopped = torrent.stopped; - torrent.stopTorrent(); - if (remaining == 0) { - // should we disconnect/reconnect here (taking care to deal with the other thread's - // I2PServerSocket.accept() call properly?) - ////_util. - } - if (!wasStopped) - addMessage("Torrent stopped: '" + sfile.getName() + "'."); - } - return torrent; - } - /** - * Stop the torrent and delete the torrent file itself, but leaving the data - * behind. - */ - public void removeTorrent(String filename) { - Snark torrent = stopTorrent(filename, true); - if (torrent != null) { - File torrentFile = new File(filename); - torrentFile.delete(); - if (torrent.storage != null) - removeTorrentStatus(torrent.storage.getMetaInfo()); - addMessage("Torrent removed: '" + torrentFile.getName() + "'."); - } - } - - private class DirMonitor implements Runnable { - public void run() { - try { Thread.sleep(60*1000*getStartupDelayMinutes()); } catch (InterruptedException ie) {} - // the first message was a "We are starting up in 1m" - synchronized (_messages) { - if (_messages.size() == 1) - _messages.remove(0); - } - - // here because we need to delay until I2CP is up - // although the user will see the default until then - getBWLimit(); - while (true) { - File dir = getDataDir(); - _log.debug("Directory Monitor loop over " + dir.getAbsolutePath()); - try { - monitorTorrents(dir); - } catch (Exception e) { - _log.error("Error in the DirectoryMonitor", e); - } - try { Thread.sleep(60*1000); } catch (InterruptedException ie) {} - } - } - } - - /** two listeners */ - public void torrentComplete(Snark snark) { - File f = new File(snark.torrent); - long len = snark.meta.getTotalLength(); - addMessage("Download finished: " + f.getName() + " (size: " + DataHelper.formatSize(len) + "B)"); - updateStatus(snark); - } - - public void updateStatus(Snark snark) { - saveTorrentStatus(snark.meta, snark.storage.getBitField()); - } - - private void monitorTorrents(File dir) { - String fileNames[] = dir.list(TorrentFilenameFilter.instance()); - List foundNames = new ArrayList(0); - if (fileNames != null) { - for (int i = 0; i < fileNames.length; i++) { - try { - foundNames.add(new File(dir, fileNames[i]).getCanonicalPath()); - } catch (IOException ioe) { - _log.error("Error resolving '" + fileNames[i] + "' in '" + dir, ioe); - } - } - } - - Set existingNames = listTorrentFiles(); - // lets find new ones first... - for (int i = 0; i < foundNames.size(); i++) { - if (existingNames.contains(foundNames.get(i))) { - // already known. noop - } else { - if (shouldAutoStart() && !_util.connect()) - addMessage("Unable to connect to I2P!"); - addTorrent((String)foundNames.get(i), !shouldAutoStart()); - } - } - // now lets see which ones have been removed... - for (Iterator iter = existingNames.iterator(); iter.hasNext(); ) { - String name = (String)iter.next(); - if (foundNames.contains(name)) { - // known and still there. noop - } else { - // known, but removed. drop it - stopTorrent(name, true); - } - } - } - - private static final String DEFAULT_TRACKERS[] = { -// "Postman", "http://YRgrgTLGnbTq2aZOZDJQ~o6Uk5k6TK-OZtx0St9pb0G-5EGYURZioxqYG8AQt~LgyyI~NCj6aYWpPO-150RcEvsfgXLR~CxkkZcVpgt6pns8SRc3Bi-QSAkXpJtloapRGcQfzTtwllokbdC-aMGpeDOjYLd8b5V9Im8wdCHYy7LRFxhEtGb~RL55DA8aYOgEXcTpr6RPPywbV~Qf3q5UK55el6Kex-6VCxreUnPEe4hmTAbqZNR7Fm0hpCiHKGoToRcygafpFqDw5frLXToYiqs9d4liyVB-BcOb0ihORbo0nS3CLmAwZGvdAP8BZ7cIYE3Z9IU9D1G8JCMxWarfKX1pix~6pIA-sp1gKlL1HhYhPMxwyxvuSqx34o3BqU7vdTYwWiLpGM~zU1~j9rHL7x60pVuYaXcFQDR4-QVy26b6Pt6BlAZoFmHhPcAuWfu-SFhjyZYsqzmEmHeYdAwa~HojSbofg0TMUgESRXMw6YThK1KXWeeJVeztGTz25sL8AAAA.i2p/announce.php=http://tracker.postman.i2p/" -// , "eBook", "http://E71FRom6PZNEqTN2Lr8P-sr23b7HJVC32KoGnVQjaX6zJiXwhJy2HsXob36Qmj81TYFZdewFZa9mSJ533UZgGyQkXo2ahctg82JKYZfDe5uDxAn1E9YPjxZCWJaFJh0S~UwSs~9AZ7UcauSJIoNtpxrtbmRNVFLqnkEDdLZi26TeucfOmiFmIWnVblLniWv3tG1boE9Abd-6j3FmYVrRucYuepAILYt6katmVNOk6sXmno1Eynrp~~MBuFq0Ko6~jsc2E2CRVYXDhGHEMdt-j6JUz5D7S2RIVzDRqQyAZLKJ7OdQDmI31przzmne1vOqqqLC~1xUumZVIvF~yOeJUGNjJ1Vx0J8i2BQIusn1pQJ6UCB~ZtZZLQtEb8EPVCfpeRi2ri1M5CyOuxN0V5ekmPHrYIBNevuTCRC26NP7ZS5VDgx1~NaC3A-CzJAE6f1QXi0wMI9aywNG5KGzOPifcsih8eyGyytvgLtrZtV7ykzYpPCS-rDfITncpn5hliPUAAAA.i2p/pub/bt/announce.php=http://de-ebook-archiv.i2p/pub/bt/" -// , "Gaytorrents", "http://uxPWHbK1OIj9HxquaXuhMiIvi21iK0~ZiG9d8G0840ZXIg0r6CbiV71xlsqmdnU6wm0T2LySriM0doW2gUigo-5BNkUquHwOjLROiETnB3ZR0Ml4IGa6QBPn1aAq2d9~g1r1nVjLE~pcFnXB~cNNS7kIhX1d6nLgYVZf0C2cZopEow2iWVUggGGnAA9mHjE86zLEnTvAyhbAMTqDQJhEuLa0ZYSORqzJDMkQt90MV4YMjX1ICY6RfUSFmxEqu0yWTrkHsTtRw48l~dz9wpIgc0a0T9C~eeWvmBFTqlJPtQZwntpNeH~jF7nlYzB58olgV2HHFYpVYD87DYNzTnmNWxCJ5AfDorm6AIUCV2qaE7tZtI1h6fbmGpGlPyW~Kw5GXrRfJwNvr6ajwAVi~bPVnrBwDZezHkfW4slOO8FACPR28EQvaTu9nwhAbqESxV2hCTq6vQSGjuxHeOuzBOEvRWkLKOHWTC09t2DbJ94FSqETmZopTB1ukEmaxRWbKSIaAAAA.i2p/announce.php=http://gaytorrents.i2p/" -// , "NickyB", "http://9On6d3cZ27JjwYCtyJJbowe054d5tFnfMjv4PHsYs-EQn4Y4mk2zRixatvuAyXz2MmRfXG-NAUfhKr0KCxRNZbvHmlckYfT-WBzwwpiMAl0wDFY~Pl8cqXuhfikSG5WrqdPfDNNIBuuznS0dqaczf~OyVaoEOpvuP3qV6wKqbSSLpjOwwAaQPHjlRtNIW8-EtUZp-I0LT45HSoowp~6b7zYmpIyoATvIP~sT0g0MTrczWhbVTUZnEkZeLhOR0Duw1-IRXI2KHPbA24wLO9LdpKKUXed05RTz0QklW5ROgR6TYv7aXFufX8kC0-DaKvQ5JKG~h8lcoHvm1RCzNqVE-2aiZnO2xH08H-iCWoLNJE-Td2kT-Tsc~3QdQcnEUcL5BF-VT~QYRld2--9r0gfGl-yDrJZrlrihHGr5J7ImahelNn9PpkVp6eIyABRmJHf2iicrk3CtjeG1j9OgTSwaNmEpUpn4aN7Kx0zNLdH7z6uTgCGD9Kmh1MFYrsoNlTp4AAAA.i2p/bittorrent/announce.php=http://nickyb.i2p/bittorrent/" -// , "Orion", "http://gKik1lMlRmuroXVGTZ~7v4Vez3L3ZSpddrGZBrxVriosCQf7iHu6CIk8t15BKsj~P0JJpxrofeuxtm7SCUAJEr0AIYSYw8XOmp35UfcRPQWyb1LsxUkMT4WqxAT3s1ClIICWlBu5An~q-Mm0VFlrYLIPBWlUFnfPR7jZ9uP5ZMSzTKSMYUWao3ejiykr~mtEmyls6g-ZbgKZawa9II4zjOy-hdxHgP-eXMDseFsrym4Gpxvy~3Fv9TuiSqhpgm~UeTo5YBfxn6~TahKtE~~sdCiSydqmKBhxAQ7uT9lda7xt96SS09OYMsIWxLeQUWhns-C~FjJPp1D~IuTrUpAFcVEGVL-BRMmdWbfOJEcWPZ~CBCQSO~VkuN1ebvIOr9JBerFMZSxZtFl8JwcrjCIBxeKPBmfh~xYh16BJm1BBBmN1fp2DKmZ2jBNkAmnUbjQOqWvUcehrykWk5lZbE7bjJMDFH48v3SXwRuDBiHZmSbsTY6zhGY~GkMQHNGxPMMSIAAAA.i2p/bt/announce.php=http://orion.i2p/bt/" -// , "anonymity", "http://8EoJZIKrWgGuDrxA3nRJs1jsPfiGwmFWL91hBrf0HA7oKhEvAna4Ocx47VLUR9retVEYBAyWFK-eZTPcvhnz9XffBEiJQQ~kFSCqb1fV6IfPiV3HySqi9U5Caf6~hC46fRd~vYnxmaBLICT3N160cxBETqH3v2rdxdJpvYt8q4nMk9LUeVXq7zqCTFLLG5ig1uKgNzBGe58iNcsvTEYlnbYcE930ABmrzj8G1qQSgSwJ6wx3tUQNl1z~4wSOUMan~raZQD60lRK70GISjoX0-D0Po9WmPveN3ES3g72TIET3zc3WPdK2~lgmKGIs8GgNLES1cXTolvbPhdZK1gxddRMbJl6Y6IPFyQ9o4-6Rt3Lp-RMRWZ2TG7j2OMcNSiOmATUhKEFBDfv-~SODDyopGBmfeLw16F4NnYednvn4qP10dyMHcUASU6Zag4mfc2-WivrOqeWhD16fVAh8MoDpIIT~0r9XmwdaVFyLcjbXObabJczxCAW3fodQUnvuSkwzAAAA.i2p/anonymityTracker/announce.php=http://anonymityweb.i2p/anonymityTracker/" -// , "The freak's tracker", "http://mHKva9x24E5Ygfey2llR1KyQHv5f8hhMpDMwJDg1U-hABpJ2NrQJd6azirdfaR0OKt4jDlmP2o4Qx0H598~AteyD~RJU~xcWYdcOE0dmJ2e9Y8-HY51ie0B1yD9FtIV72ZI-V3TzFDcs6nkdX9b81DwrAwwFzx0EfNvK1GLVWl59Ow85muoRTBA1q8SsZImxdyZ-TApTVlMYIQbdI4iQRwU9OmmtefrCe~ZOf4UBS9-KvNIqUL0XeBSqm0OU1jq-D10Ykg6KfqvuPnBYT1BYHFDQJXW5DdPKwcaQE4MtAdSGmj1epDoaEBUa9btQlFsM2l9Cyn1hzxqNWXELmx8dRlomQLlV4b586dRzW~fLlOPIGC13ntPXogvYvHVyEyptXkv890jC7DZNHyxZd5cyrKC36r9huKvhQAmNABT2Y~pOGwVrb~RpPwT0tBuPZ3lHYhBFYmD8y~AOhhNHKMLzea1rfwTvovBMByDdFps54gMN1mX4MbCGT4w70vIopS9yAAAA.i2p/bytemonsoon/announce.php" -// , "mastertracker", "http://VzXD~stRKbL3MOmeTn1iaCQ0CFyTmuFHiKYyo0Rd~dFPZFCYH-22rT8JD7i-C2xzYFa4jT5U2aqHzHI-Jre4HL3Ri5hFtZrLk2ax3ji7Qfb6qPnuYkuiF2E2UDmKUOppI8d9Ye7tjdhQVCy0izn55tBaB-U7UWdcvSK2i85sauyw3G0Gfads1Rvy5-CAe2paqyYATcDmGjpUNLoxbfv9KH1KmwRTNH6k1v4PyWYYnhbT39WfKMbBjSxVQRdi19cyJrULSWhjxaQfJHeWx5Z8Ev4bSPByBeQBFl2~4vqy0S5RypINsRSa3MZdbiAAyn5tr5slWR6QdoqY3qBQgBJFZppy-3iWkFqqKgSxCPundF8gdDLC5ddizl~KYcYKl42y9SGFHIukH-TZs8~em0~iahzsqWVRks3zRG~tlBcX2U3M2~OJs~C33-NKhyfZT7-XFBREvb8Szmd~p66jDxrwOnKaku-G6DyoQipJqIz4VHmY9-y5T8RrUcJcM-5lVoMpAAAA.i2p/announce.php=http://tracker.mastertracker.i2p/" -// , "Galen", "http://5jpwQMI5FT303YwKa5Rd38PYSX04pbIKgTaKQsWbqoWjIfoancFdWCShXHLI5G5ofOb0Xu11vl2VEMyPsg1jUFYSVnu4-VfMe3y4TKTR6DTpetWrnmEK6m2UXh91J5DZJAKlgmO7UdsFlBkQfR2rY853-DfbJtQIFl91tbsmjcA5CGQi4VxMFyIkBzv-pCsuLQiZqOwWasTlnzey8GcDAPG1LDcvfflGV~6F5no9mnuisZPteZKlrv~~TDoXTj74QjByWc4EOYlwqK8sbU9aOvz~s31XzErbPTfwiawiaZ0RUI-IDrKgyvmj0neuFTWgjRGVTH8bz7cBZIc3viy6ioD-eMQOrXaQL0TCWZUelRwHRvgdPiQrxdYQs7ixkajeHzxi-Pq0EMm5Vbh3j3Q9kfUFW3JjFDA-MLB4g6XnjCbM5J1rC0oOBDCIEfhQkszru5cyLjHiZ5yeA0VThgu~c7xKHybv~OMXION7V8pBKOgET7ZgAkw1xgYe3Kkyq5syAAAA.i2p/tr/announce.php=http://galen.i2p/tr/" - "POSTMAN", "http://tracker2.postman.i2p/announce.php=http://tracker2.postman.i2p/" - ,"WELTERDE", "http://BGKmlDOoH3RzFbPRfRpZV2FjpVj8~3moFftw5-dZfDf2070TOe8Tf2~DAVeaM6ZRLdmFEt~9wyFL8YMLMoLoiwGEH6IGW6rc45tstN68KsBDWZqkTohV1q9XFgK9JnCwE~Oi89xLBHsLMTHOabowWM6dkC8nI6QqJC2JODqLPIRfOVrDdkjLwtCrsckzLybNdFmgfoqF05UITDyczPsFVaHtpF1sRggOVmdvCM66otyonlzNcJbn59PA-R808vUrCPMGU~O9Wys0i-NoqtIbtWfOKnjCRFMNw5ex4n9m5Sxm9e20UkpKG6qzEuvKZWi8vTLe1NW~CBrj~vG7I3Ok4wybUFflBFOaBabxYJLlx4xTE1zJIVxlsekmAjckB4v-cQwulFeikR4LxPQ6mCQknW2HZ4JQIq6hL9AMabxjOlYnzh7kjOfRGkck8YgeozcyTvcDUcUsOuSTk06L4kdrv8h2Cozjbloi5zl6KTbj5ZTciKCxi73Pn9grICn-HQqEAAAA.i2p/a=http://tracker.welterde.i2p/stats?mode=top5" - , "CRSTRACK", "http://b4G9sCdtfvccMAXh~SaZrPqVQNyGQbhbYMbw6supq2XGzbjU4NcOmjFI0vxQ8w1L05twmkOvg5QERcX6Mi8NQrWnR0stLExu2LucUXg1aYjnggxIR8TIOGygZVIMV3STKH4UQXD--wz0BUrqaLxPhrm2Eh9Hwc8TdB6Na4ShQUq5Xm8D4elzNUVdpM~RtChEyJWuQvoGAHY3ppX-EJJLkiSr1t77neS4Lc-KofMVmgI9a2tSSpNAagBiNI6Ak9L1T0F9uxeDfEG9bBSQPNMOSUbAoEcNxtt7xOW~cNOAyMyGydwPMnrQ5kIYPY8Pd3XudEko970vE0D6gO19yoBMJpKx6Dh50DGgybLQ9CpRaynh2zPULTHxm8rneOGRcQo8D3mE7FQ92m54~SvfjXjD2TwAVGI~ae~n9HDxt8uxOecAAvjjJ3TD4XM63Q9TmB38RmGNzNLDBQMEmJFpqQU8YeuhnS54IVdUoVQFqui5SfDeLXlSkh4vYoMU66pvBfWbAAAA.i2p/tracker/announce.php=http://crstrack.i2p/tracker/" - - }; - - /** comma delimited list of name=announceURL=baseURL for the trackers to be displayed */ - public static final String PROP_TRACKERS = "i2psnark.trackers"; - private static Map trackerMap = null; - /** sorted map of name to announceURL=baseURL */ - public Map getTrackers() { - if (trackerMap != null) // only do this once, can't be updated while running - return trackerMap; - Map rv = new TreeMap(); - String trackers = _config.getProperty(PROP_TRACKERS); - if ( (trackers == null) || (trackers.trim().length() <= 0) ) - trackers = _context.getProperty(PROP_TRACKERS); - if ( (trackers == null) || (trackers.trim().length() <= 0) ) { - for (int i = 0; i < DEFAULT_TRACKERS.length; i += 2) - rv.put(DEFAULT_TRACKERS[i], DEFAULT_TRACKERS[i+1]); - } else { - StringTokenizer tok = new StringTokenizer(trackers, ","); - while (tok.hasMoreTokens()) { - String pair = tok.nextToken(); - int split = pair.indexOf('='); - if (split <= 0) - continue; - String name = pair.substring(0, split).trim(); - String url = pair.substring(split+1).trim(); - if ( (name.length() > 0) && (url.length() > 0) ) - rv.put(name, url); - } - } - - trackerMap = rv; - return trackerMap; - } - - private static class TorrentFilenameFilter implements FilenameFilter { - private static final TorrentFilenameFilter _filter = new TorrentFilenameFilter(); - public static TorrentFilenameFilter instance() { return _filter; } - public boolean accept(File dir, String name) { - return (name != null) && (name.endsWith(".torrent")); - } - } - - public class SnarkManagerShutdown extends I2PAppThread { - @Override - public void run() { - Set names = listTorrentFiles(); - for (Iterator iter = names.iterator(); iter.hasNext(); ) { - Snark snark = getTorrent((String)iter.next()); - if ( (snark != null) && (!snark.stopped) ) - snark.stopTorrent(); - } - } - } -} +package org.klomp.snark; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.TreeMap; + +import net.i2p.I2PAppContext; +import net.i2p.data.Base64; +import net.i2p.data.DataHelper; +import net.i2p.util.I2PAppThread; +import net.i2p.util.Log; + +/** + * Manage multiple snarks + */ +public class SnarkManager implements Snark.CompleteListener { + private static SnarkManager _instance = new SnarkManager(); + public static SnarkManager instance() { return _instance; } + + /** map of (canonical) filename to Snark instance (unsynchronized) */ + private final Map _snarks; + private final Object _addSnarkLock; + private /* FIXME final FIXME */ File _configFile; + private Properties _config; + private I2PAppContext _context; + private Log _log; + private final List _messages; + private I2PSnarkUtil _util; + private PeerCoordinatorSet _peerCoordinatorSet; + private ConnectionAcceptor _connectionAcceptor; + + public static final String PROP_I2CP_HOST = "i2psnark.i2cpHost"; + public static final String PROP_I2CP_PORT = "i2psnark.i2cpPort"; + public static final String PROP_I2CP_OPTS = "i2psnark.i2cpOptions"; + public static final String PROP_EEP_HOST = "i2psnark.eepHost"; + public static final String PROP_EEP_PORT = "i2psnark.eepPort"; + public static final String PROP_UPLOADERS_TOTAL = "i2psnark.uploaders.total"; + public static final String PROP_UPBW_MAX = "i2psnark.upbw.max"; + public static final String PROP_DIR = "i2psnark.dir"; + public static final String PROP_META_PREFIX = "i2psnark.zmeta."; + public static final String PROP_META_BITFIELD_SUFFIX = ".bitfield"; + + private static final String CONFIG_FILE = "i2psnark.config"; + public static final String PROP_AUTO_START = "i2snark.autoStart"; // oops + public static final String DEFAULT_AUTO_START = "false"; + public static final String PROP_LINK_PREFIX = "i2psnark.linkPrefix"; + public static final String DEFAULT_LINK_PREFIX = "file:///"; + + public static final int MIN_UP_BW = 2; + public static final int DEFAULT_MAX_UP_BW = 10; + + private SnarkManager() { + _snarks = new HashMap(); + _addSnarkLock = new Object(); + _context = I2PAppContext.getGlobalContext(); + _log = _context.logManager().getLog(SnarkManager.class); + _messages = new ArrayList(16); + _util = new I2PSnarkUtil(_context); + _configFile = new File(CONFIG_FILE); + if (!_configFile.isAbsolute()) + _configFile = new File(_context.getConfigDir(), CONFIG_FILE); + loadConfig(null); + } + + /** Caller _must_ call loadConfig(file) before this if setting new values + * for i2cp host/port or i2psnark.dir + */ + public void start() { + _peerCoordinatorSet = new PeerCoordinatorSet(); + _connectionAcceptor = new ConnectionAcceptor(_util); + int minutes = getStartupDelayMinutes(); + _messages.add("Adding torrents in " + minutes + (minutes == 1 ? " minute" : " minutes")); + I2PAppThread monitor = new I2PAppThread(new DirMonitor(), "Snark DirMonitor"); + monitor.setDaemon(true); + monitor.start(); + _context.addShutdownTask(new SnarkManagerShutdown()); + } + + /** hook to I2PSnarkUtil for the servlet */ + public I2PSnarkUtil util() { return _util; } + + private static final int MAX_MESSAGES = 5; + public void addMessage(String message) { + synchronized (_messages) { + _messages.add(message); + while (_messages.size() > MAX_MESSAGES) + _messages.remove(0); + } + if (_log.shouldLog(Log.INFO)) + _log.info("MSG: " + message); + } + + /** newest last */ + public List getMessages() { + synchronized (_messages) { + return new ArrayList(_messages); + } + } + + public boolean shouldAutoStart() { + return Boolean.valueOf(_config.getProperty(PROP_AUTO_START, DEFAULT_AUTO_START+"")).booleanValue(); + } + public String linkPrefix() { + return _config.getProperty(PROP_LINK_PREFIX, DEFAULT_LINK_PREFIX + getDataDir().getAbsolutePath() + File.separatorChar); + } + private int getStartupDelayMinutes() { return 3; } + public File getDataDir() { + String dir = _config.getProperty(PROP_DIR, "i2psnark"); + File f = new File(dir); + if (!f.isAbsolute()) + f = new File(_context.getAppDir(), dir); + return f; + } + + /** null to set initial defaults */ + public void loadConfig(String filename) { + if (_config == null) + _config = new Properties(); + if (filename != null) { + File cfg = new File(filename); + if (!cfg.isAbsolute()) + cfg = new File(_context.getConfigDir(), filename); + _configFile = cfg; + if (cfg.exists()) { + try { + DataHelper.loadProps(_config, cfg); + } catch (IOException ioe) { + _log.error("Error loading I2PSnark config '" + filename + "'", ioe); + } + } + } + // now add sane defaults + if (!_config.containsKey(PROP_I2CP_HOST)) + _config.setProperty(PROP_I2CP_HOST, "127.0.0.1"); + if (!_config.containsKey(PROP_I2CP_PORT)) + _config.setProperty(PROP_I2CP_PORT, "7654"); + if (!_config.containsKey(PROP_I2CP_OPTS)) + _config.setProperty(PROP_I2CP_OPTS, "inbound.length=2 inbound.lengthVariance=0 outbound.length=2 outbound.lengthVariance=0 inbound.quantity=3 outbound.quantity=3"); + if (!_config.containsKey(PROP_EEP_HOST)) + _config.setProperty(PROP_EEP_HOST, "127.0.0.1"); + if (!_config.containsKey(PROP_EEP_PORT)) + _config.setProperty(PROP_EEP_PORT, "4444"); + if (!_config.containsKey(PROP_UPLOADERS_TOTAL)) + _config.setProperty(PROP_UPLOADERS_TOTAL, "" + Snark.MAX_TOTAL_UPLOADERS); + if (!_config.containsKey(PROP_DIR)) + _config.setProperty(PROP_DIR, "i2psnark"); + if (!_config.containsKey(PROP_AUTO_START)) + _config.setProperty(PROP_AUTO_START, DEFAULT_AUTO_START); + updateConfig(); + } + + /** call from DirMonitor since loadConfig() is called before router I2CP is up */ + private void getBWLimit() { + if (!_config.containsKey(PROP_UPBW_MAX)) { + int[] limits = BWLimits.getBWLimits(_util.getI2CPHost(), _util.getI2CPPort()); + if (limits != null && limits[1] > 0) + _util.setMaxUpBW(limits[1]); + } + } + + private void updateConfig() { + String i2cpHost = _config.getProperty(PROP_I2CP_HOST); + int i2cpPort = getInt(PROP_I2CP_PORT, 7654); + String opts = _config.getProperty(PROP_I2CP_OPTS); + Map i2cpOpts = new HashMap(); + if (opts != null) { + StringTokenizer tok = new StringTokenizer(opts, " "); + while (tok.hasMoreTokens()) { + String pair = tok.nextToken(); + int split = pair.indexOf('='); + if (split > 0) + i2cpOpts.put(pair.substring(0, split), pair.substring(split+1)); + } + } + if (i2cpHost != null) { + _util.setI2CPConfig(i2cpHost, i2cpPort, i2cpOpts); + _log.debug("Configuring with I2CP options " + i2cpOpts); + } + //I2PSnarkUtil.instance().setI2CPConfig("66.111.51.110", 7654, new Properties()); + String eepHost = _config.getProperty(PROP_EEP_HOST); + int eepPort = getInt(PROP_EEP_PORT, 4444); + if (eepHost != null) + _util.setProxy(eepHost, eepPort); + _util.setMaxUploaders(getInt(PROP_UPLOADERS_TOTAL, Snark.MAX_TOTAL_UPLOADERS)); + _util.setMaxUpBW(getInt(PROP_UPBW_MAX, DEFAULT_MAX_UP_BW)); + getDataDir().mkdirs(); + } + + private int getInt(String prop, int defaultVal) { + String p = _config.getProperty(prop); + try { + if ( (p != null) && (p.trim().length() > 0) ) + return Integer.parseInt(p.trim()); + } catch (NumberFormatException nfe) { + // ignore + } + return defaultVal; + } + + public void updateConfig(String dataDir, boolean autoStart, String seedPct, String eepHost, + String eepPort, String i2cpHost, String i2cpPort, String i2cpOpts, + String upLimit, String upBW, boolean useOpenTrackers, String openTrackers) { + boolean changed = false; + if (eepHost != null) { + int port = _util.getEepProxyPort(); + try { port = Integer.parseInt(eepPort); } catch (NumberFormatException nfe) {} + String host = _util.getEepProxyHost(); + if ( (eepHost.trim().length() > 0) && (port > 0) && + ((!host.equals(eepHost) || (port != _util.getEepProxyPort()) )) ) { + _util.setProxy(eepHost, port); + changed = true; + _config.setProperty(PROP_EEP_HOST, eepHost); + _config.setProperty(PROP_EEP_PORT, eepPort+""); + addMessage("EepProxy location changed to " + eepHost + ":" + port); + } + } + if (upLimit != null) { + int limit = _util.getMaxUploaders(); + try { limit = Integer.parseInt(upLimit); } catch (NumberFormatException nfe) {} + if ( limit != _util.getMaxUploaders()) { + if ( limit >= Snark.MIN_TOTAL_UPLOADERS ) { + _util.setMaxUploaders(limit); + changed = true; + _config.setProperty(PROP_UPLOADERS_TOTAL, "" + limit); + addMessage("Total uploaders limit changed to " + limit); + } else { + addMessage("Minimum total uploaders limit is " + Snark.MIN_TOTAL_UPLOADERS); + } + } + } + if (upBW != null) { + int limit = _util.getMaxUpBW(); + try { limit = Integer.parseInt(upBW); } catch (NumberFormatException nfe) {} + if ( limit != _util.getMaxUpBW()) { + if ( limit >= MIN_UP_BW ) { + _util.setMaxUpBW(limit); + changed = true; + _config.setProperty(PROP_UPBW_MAX, "" + limit); + addMessage("Up BW limit changed to " + limit + "KBps"); + } else { + addMessage("Minimum Up BW limit is " + MIN_UP_BW + "KBps"); + } + } + } + if (i2cpHost != null) { + int oldI2CPPort = _util.getI2CPPort(); + String oldI2CPHost = _util.getI2CPHost(); + int port = oldI2CPPort; + try { port = Integer.parseInt(i2cpPort); } catch (NumberFormatException nfe) {} + String host = oldI2CPHost; + Map opts = new HashMap(); + if (i2cpOpts == null) i2cpOpts = ""; + StringTokenizer tok = new StringTokenizer(i2cpOpts, " \t\n"); + while (tok.hasMoreTokens()) { + String pair = tok.nextToken(); + int split = pair.indexOf('='); + if (split > 0) + opts.put(pair.substring(0, split), pair.substring(split+1)); + } + Map oldOpts = new HashMap(); + String oldI2CPOpts = _config.getProperty(PROP_I2CP_OPTS); + if (oldI2CPOpts == null) oldI2CPOpts = ""; + tok = new StringTokenizer(oldI2CPOpts, " \t\n"); + while (tok.hasMoreTokens()) { + String pair = tok.nextToken(); + int split = pair.indexOf('='); + if (split > 0) + oldOpts.put(pair.substring(0, split), pair.substring(split+1)); + } + + if ( (i2cpHost.trim().length() > 0) && (port > 0) && + ((!host.equals(i2cpHost) || + (port != _util.getI2CPPort()) || + (!oldOpts.equals(opts)))) ) { + boolean snarksActive = false; + Set names = listTorrentFiles(); + for (Iterator iter = names.iterator(); iter.hasNext(); ) { + Snark snark = getTorrent((String)iter.next()); + if ( (snark != null) && (!snark.stopped) ) { + snarksActive = true; + break; + } + } + if (snarksActive) { + addMessage("Cannot change the I2CP settings while torrents are active"); + _log.debug("i2cp host [" + i2cpHost + "] i2cp port " + port + " opts [" + opts + + "] oldOpts [" + oldOpts + "]"); + } else { + if (_util.connected()) { + _util.disconnect(); + addMessage("Disconnecting old I2CP destination"); + } + Properties p = new Properties(); + p.putAll(opts); + addMessage("I2CP settings changed to " + i2cpHost + ":" + port + " (" + i2cpOpts.trim() + ")"); + _util.setI2CPConfig(i2cpHost, port, p); + boolean ok = _util.connect(); + if (!ok) { + addMessage("Unable to connect with the new settings, reverting to the old I2CP settings"); + _util.setI2CPConfig(oldI2CPHost, oldI2CPPort, oldOpts); + ok = _util.connect(); + if (!ok) + addMessage("Unable to reconnect with the old settings!"); + } else { + addMessage("Reconnected on the new I2CP destination"); + _config.setProperty(PROP_I2CP_HOST, i2cpHost.trim()); + _config.setProperty(PROP_I2CP_PORT, "" + port); + _config.setProperty(PROP_I2CP_OPTS, i2cpOpts.trim()); + changed = true; + // no PeerAcceptors/I2PServerSockets to deal with, since all snarks are inactive + for (Iterator iter = names.iterator(); iter.hasNext(); ) { + String name = (String)iter.next(); + Snark snark = getTorrent(name); + if ( (snark != null) && (snark.acceptor != null) ) { + snark.acceptor.restart(); + addMessage("I2CP listener restarted for " + snark.meta.getName()); + } + } + } + } + changed = true; + } + } + if (shouldAutoStart() != autoStart) { + _config.setProperty(PROP_AUTO_START, autoStart + ""); + addMessage("Adjusted autostart to " + autoStart); + changed = true; + } + if (_util.shouldUseOpenTrackers() != useOpenTrackers) { + _config.setProperty(I2PSnarkUtil.PROP_USE_OPENTRACKERS, useOpenTrackers + ""); + addMessage((useOpenTrackers ? "En" : "Dis") + "abled open trackers - torrent restart required to take effect."); + changed = true; + } + if (openTrackers != null) { + if (openTrackers.trim().length() > 0 && !openTrackers.trim().equals(_util.getOpenTrackerString())) { + _config.setProperty(I2PSnarkUtil.PROP_OPENTRACKERS, openTrackers.trim()); + addMessage("Open Tracker list changed - torrent restart required to take effect."); + changed = true; + } + } + if (changed) { + saveConfig(); + } else { + addMessage("Configuration unchanged."); + } + } + + public void saveConfig() { + try { + synchronized (_configFile) { + DataHelper.storeProps(_config, _configFile); + } + } catch (IOException ioe) { + addMessage("Unable to save the config to '" + _configFile.getAbsolutePath() + "'."); + } + } + + public Properties getConfig() { return _config; } + + /** hardcoded for sanity. perhaps this should be customizable, for people who increase their ulimit, etc. */ + private static final int MAX_FILES_PER_TORRENT = 512; + + /** set of filenames that we are dealing with */ + public Set listTorrentFiles() { synchronized (_snarks) { return new HashSet(_snarks.keySet()); } } + /** + * Grab the torrent given the (canonical) filename + */ + public Snark getTorrent(String filename) { synchronized (_snarks) { return (Snark)_snarks.get(filename); } } + public void addTorrent(String filename) { addTorrent(filename, false); } + public void addTorrent(String filename, boolean dontAutoStart) { + if ((!dontAutoStart) && !_util.connected()) { + addMessage("Connecting to I2P"); + boolean ok = _util.connect(); + if (!ok) { + addMessage("Error connecting to I2P - check your I2CP settings!"); + return; + } + } + File sfile = new File(filename); + try { + filename = sfile.getCanonicalPath(); + } catch (IOException ioe) { + _log.error("Unable to add the torrent " + filename, ioe); + addMessage("ERR: Could not add the torrent '" + filename + "': " + ioe.getMessage()); + return; + } + File dataDir = getDataDir(); + Snark torrent = null; + synchronized (_snarks) { + torrent = (Snark)_snarks.get(filename); + } + // don't hold the _snarks lock while verifying the torrent + if (torrent == null) { + synchronized (_addSnarkLock) { + // double-check + synchronized (_snarks) { + if(_snarks.get(filename) != null) + return; + } + + FileInputStream fis = null; + try { + fis = new FileInputStream(sfile); + MetaInfo info = new MetaInfo(fis); + fis.close(); + fis = null; + + String rejectMessage = locked_validateTorrent(info); + if (rejectMessage != null) { + sfile.delete(); + addMessage(rejectMessage); + return; + } else { + torrent = new Snark(_util, filename, null, -1, null, null, this, + _peerCoordinatorSet, _connectionAcceptor, + false, dataDir.getPath()); + torrent.completeListener = this; + synchronized (_snarks) { + _snarks.put(filename, torrent); + } + } + } catch (IOException ioe) { + addMessage("Torrent in " + sfile.getName() + " is invalid: " + ioe.getMessage()); + if (sfile.exists()) + sfile.delete(); + return; + } finally { + if (fis != null) try { fis.close(); } catch (IOException ioe) {} + } + } + } else { + return; + } + // ok, snark created, now lets start it up or configure it further + File f = new File(filename); + if (!dontAutoStart && shouldAutoStart()) { + torrent.startTorrent(); + addMessage("Torrent added and started: '" + f.getName() + "'."); + } else { + addMessage("Torrent added: '" + f.getName() + "'."); + } + } + + /** + * Get the timestamp for a torrent from the config file + */ + public long getSavedTorrentTime(Snark snark) { + MetaInfo metainfo = snark.meta; + byte[] ih = metainfo.getInfoHash(); + String infohash = Base64.encode(ih); + infohash = infohash.replace('=', '$'); + String time = _config.getProperty(PROP_META_PREFIX + infohash + PROP_META_BITFIELD_SUFFIX); + if (time == null) + return 0; + int comma = time.indexOf(','); + if (comma <= 0) + return 0; + time = time.substring(0, comma); + try { return Long.parseLong(time); } catch (NumberFormatException nfe) {} + return 0; + } + + /** + * Get the saved bitfield for a torrent from the config file. + * Convert "." to a full bitfield. + */ + public BitField getSavedTorrentBitField(Snark snark) { + MetaInfo metainfo = snark.meta; + byte[] ih = metainfo.getInfoHash(); + String infohash = Base64.encode(ih); + infohash = infohash.replace('=', '$'); + String bf = _config.getProperty(PROP_META_PREFIX + infohash + PROP_META_BITFIELD_SUFFIX); + if (bf == null) + return null; + int comma = bf.indexOf(','); + if (comma <= 0) + return null; + bf = bf.substring(comma + 1).trim(); + int len = metainfo.getPieces(); + if (bf.equals(".")) { + BitField bitfield = new BitField(len); + for (int i = 0; i < len; i++) + bitfield.set(i); + return bitfield; + } + byte[] bitfield = Base64.decode(bf); + if (bitfield == null) + return null; + if (bitfield.length * 8 < len) + return null; + return new BitField(bitfield, len); + } + + /** + * Save the completion status of a torrent and the current time in the config file + * in the form "i2psnark.zmeta.$base64infohash=$time,$base64bitfield". + * The config file property key is appended with the Base64 of the infohash, + * with the '=' changed to '$' since a key can't contain '='. + * The time is a standard long converted to string. + * The status is either a bitfield converted to Base64 or "." for a completed + * torrent to save space in the config file and in memory. + */ + public void saveTorrentStatus(MetaInfo metainfo, BitField bitfield) { + byte[] ih = metainfo.getInfoHash(); + String infohash = Base64.encode(ih); + infohash = infohash.replace('=', '$'); + String now = "" + System.currentTimeMillis(); + String bfs; + if (bitfield.complete()) { + bfs = "."; + } else { + byte[] bf = bitfield.getFieldBytes(); + bfs = Base64.encode(bf); + } + _config.setProperty(PROP_META_PREFIX + infohash + PROP_META_BITFIELD_SUFFIX, now + "," + bfs); + saveConfig(); + } + + /** + * Remove the status of a torrent from the config file. + * This may help the config file from growing too big. + */ + public void removeTorrentStatus(MetaInfo metainfo) { + byte[] ih = metainfo.getInfoHash(); + String infohash = Base64.encode(ih); + infohash = infohash.replace('=', '$'); + _config.remove(PROP_META_PREFIX + infohash + PROP_META_BITFIELD_SUFFIX); + saveConfig(); + } + + private String locked_validateTorrent(MetaInfo info) throws IOException { + String announce = info.getAnnounce(); + // basic validation of url + if ((!announce.startsWith("http://")) || + (announce.indexOf(".i2p/") < 0)) // need to do better than this + return "Non-i2p tracker in " + info.getName() + ", deleting it from our list of trackers!"; + List files = info.getFiles(); + if ( (files != null) && (files.size() > MAX_FILES_PER_TORRENT) ) { + return "Too many files in " + info.getName() + " (" + files.size() + "), deleting it!"; + } else if (info.getPieces() <= 0) { + return "No pieces in " + info.getName() + "? deleting it!"; + } else if (info.getPieceLength(0) > Storage.MAX_PIECE_SIZE) { + return "Pieces are too large in " + info.getName() + " (" + DataHelper.formatSize(info.getPieceLength(0)) + + "B), deleting it."; + } else if (info.getTotalLength() > Storage.MAX_TOTAL_SIZE) { + System.out.println("torrent info: " + info.toString()); + List lengths = info.getLengths(); + if (lengths != null) + for (int i = 0; i < lengths.size(); i++) + System.out.println("File " + i + " is " + lengths.get(i) + " long."); + + return "Torrents larger than " + DataHelper.formatSize(Storage.MAX_TOTAL_SIZE) + + "B are not supported yet (because we're paranoid): " + info.getName() + ", deleting it!"; + } else { + // ok + return null; + } + } + + /** + * Stop the torrent, leaving it on the list of torrents unless told to remove it + */ + public Snark stopTorrent(String filename, boolean shouldRemove) { + File sfile = new File(filename); + try { + filename = sfile.getCanonicalPath(); + } catch (IOException ioe) { + _log.error("Unable to remove the torrent " + filename, ioe); + addMessage("ERR: Could not remove the torrent '" + filename + "': " + ioe.getMessage()); + return null; + } + int remaining = 0; + Snark torrent = null; + synchronized (_snarks) { + if (shouldRemove) + torrent = (Snark)_snarks.remove(filename); + else + torrent = (Snark)_snarks.get(filename); + remaining = _snarks.size(); + } + if (torrent != null) { + boolean wasStopped = torrent.stopped; + torrent.stopTorrent(); + if (remaining == 0) { + // should we disconnect/reconnect here (taking care to deal with the other thread's + // I2PServerSocket.accept() call properly?) + ////_util. + } + if (!wasStopped) + addMessage("Torrent stopped: '" + sfile.getName() + "'."); + } + return torrent; + } + /** + * Stop the torrent and delete the torrent file itself, but leaving the data + * behind. + */ + public void removeTorrent(String filename) { + Snark torrent = stopTorrent(filename, true); + if (torrent != null) { + File torrentFile = new File(filename); + torrentFile.delete(); + if (torrent.storage != null) + removeTorrentStatus(torrent.storage.getMetaInfo()); + addMessage("Torrent removed: '" + torrentFile.getName() + "'."); + } + } + + private class DirMonitor implements Runnable { + public void run() { + try { Thread.sleep(60*1000*getStartupDelayMinutes()); } catch (InterruptedException ie) {} + // the first message was a "We are starting up in 1m" + synchronized (_messages) { + if (_messages.size() == 1) + _messages.remove(0); + } + + // here because we need to delay until I2CP is up + // although the user will see the default until then + getBWLimit(); + while (true) { + File dir = getDataDir(); + _log.debug("Directory Monitor loop over " + dir.getAbsolutePath()); + try { + monitorTorrents(dir); + } catch (Exception e) { + _log.error("Error in the DirectoryMonitor", e); + } + try { Thread.sleep(60*1000); } catch (InterruptedException ie) {} + } + } + } + + /** two listeners */ + public void torrentComplete(Snark snark) { + File f = new File(snark.torrent); + long len = snark.meta.getTotalLength(); + addMessage("Download finished: " + f.getName() + " (size: " + DataHelper.formatSize(len) + "B)"); + updateStatus(snark); + } + + public void updateStatus(Snark snark) { + saveTorrentStatus(snark.meta, snark.storage.getBitField()); + } + + private void monitorTorrents(File dir) { + String fileNames[] = dir.list(TorrentFilenameFilter.instance()); + List foundNames = new ArrayList(0); + if (fileNames != null) { + for (int i = 0; i < fileNames.length; i++) { + try { + foundNames.add(new File(dir, fileNames[i]).getCanonicalPath()); + } catch (IOException ioe) { + _log.error("Error resolving '" + fileNames[i] + "' in '" + dir, ioe); + } + } + } + + Set existingNames = listTorrentFiles(); + // lets find new ones first... + for (int i = 0; i < foundNames.size(); i++) { + if (existingNames.contains(foundNames.get(i))) { + // already known. noop + } else { + if (shouldAutoStart() && !_util.connect()) + addMessage("Unable to connect to I2P!"); + addTorrent((String)foundNames.get(i), !shouldAutoStart()); + } + } + // now lets see which ones have been removed... + for (Iterator iter = existingNames.iterator(); iter.hasNext(); ) { + String name = (String)iter.next(); + if (foundNames.contains(name)) { + // known and still there. noop + } else { + // known, but removed. drop it + stopTorrent(name, true); + } + } + } + + private static final String DEFAULT_TRACKERS[] = { +// "Postman", "http://YRgrgTLGnbTq2aZOZDJQ~o6Uk5k6TK-OZtx0St9pb0G-5EGYURZioxqYG8AQt~LgyyI~NCj6aYWpPO-150RcEvsfgXLR~CxkkZcVpgt6pns8SRc3Bi-QSAkXpJtloapRGcQfzTtwllokbdC-aMGpeDOjYLd8b5V9Im8wdCHYy7LRFxhEtGb~RL55DA8aYOgEXcTpr6RPPywbV~Qf3q5UK55el6Kex-6VCxreUnPEe4hmTAbqZNR7Fm0hpCiHKGoToRcygafpFqDw5frLXToYiqs9d4liyVB-BcOb0ihORbo0nS3CLmAwZGvdAP8BZ7cIYE3Z9IU9D1G8JCMxWarfKX1pix~6pIA-sp1gKlL1HhYhPMxwyxvuSqx34o3BqU7vdTYwWiLpGM~zU1~j9rHL7x60pVuYaXcFQDR4-QVy26b6Pt6BlAZoFmHhPcAuWfu-SFhjyZYsqzmEmHeYdAwa~HojSbofg0TMUgESRXMw6YThK1KXWeeJVeztGTz25sL8AAAA.i2p/announce.php=http://tracker.postman.i2p/" +// , "eBook", "http://E71FRom6PZNEqTN2Lr8P-sr23b7HJVC32KoGnVQjaX6zJiXwhJy2HsXob36Qmj81TYFZdewFZa9mSJ533UZgGyQkXo2ahctg82JKYZfDe5uDxAn1E9YPjxZCWJaFJh0S~UwSs~9AZ7UcauSJIoNtpxrtbmRNVFLqnkEDdLZi26TeucfOmiFmIWnVblLniWv3tG1boE9Abd-6j3FmYVrRucYuepAILYt6katmVNOk6sXmno1Eynrp~~MBuFq0Ko6~jsc2E2CRVYXDhGHEMdt-j6JUz5D7S2RIVzDRqQyAZLKJ7OdQDmI31przzmne1vOqqqLC~1xUumZVIvF~yOeJUGNjJ1Vx0J8i2BQIusn1pQJ6UCB~ZtZZLQtEb8EPVCfpeRi2ri1M5CyOuxN0V5ekmPHrYIBNevuTCRC26NP7ZS5VDgx1~NaC3A-CzJAE6f1QXi0wMI9aywNG5KGzOPifcsih8eyGyytvgLtrZtV7ykzYpPCS-rDfITncpn5hliPUAAAA.i2p/pub/bt/announce.php=http://de-ebook-archiv.i2p/pub/bt/" +// , "Gaytorrents", "http://uxPWHbK1OIj9HxquaXuhMiIvi21iK0~ZiG9d8G0840ZXIg0r6CbiV71xlsqmdnU6wm0T2LySriM0doW2gUigo-5BNkUquHwOjLROiETnB3ZR0Ml4IGa6QBPn1aAq2d9~g1r1nVjLE~pcFnXB~cNNS7kIhX1d6nLgYVZf0C2cZopEow2iWVUggGGnAA9mHjE86zLEnTvAyhbAMTqDQJhEuLa0ZYSORqzJDMkQt90MV4YMjX1ICY6RfUSFmxEqu0yWTrkHsTtRw48l~dz9wpIgc0a0T9C~eeWvmBFTqlJPtQZwntpNeH~jF7nlYzB58olgV2HHFYpVYD87DYNzTnmNWxCJ5AfDorm6AIUCV2qaE7tZtI1h6fbmGpGlPyW~Kw5GXrRfJwNvr6ajwAVi~bPVnrBwDZezHkfW4slOO8FACPR28EQvaTu9nwhAbqESxV2hCTq6vQSGjuxHeOuzBOEvRWkLKOHWTC09t2DbJ94FSqETmZopTB1ukEmaxRWbKSIaAAAA.i2p/announce.php=http://gaytorrents.i2p/" +// , "NickyB", "http://9On6d3cZ27JjwYCtyJJbowe054d5tFnfMjv4PHsYs-EQn4Y4mk2zRixatvuAyXz2MmRfXG-NAUfhKr0KCxRNZbvHmlckYfT-WBzwwpiMAl0wDFY~Pl8cqXuhfikSG5WrqdPfDNNIBuuznS0dqaczf~OyVaoEOpvuP3qV6wKqbSSLpjOwwAaQPHjlRtNIW8-EtUZp-I0LT45HSoowp~6b7zYmpIyoATvIP~sT0g0MTrczWhbVTUZnEkZeLhOR0Duw1-IRXI2KHPbA24wLO9LdpKKUXed05RTz0QklW5ROgR6TYv7aXFufX8kC0-DaKvQ5JKG~h8lcoHvm1RCzNqVE-2aiZnO2xH08H-iCWoLNJE-Td2kT-Tsc~3QdQcnEUcL5BF-VT~QYRld2--9r0gfGl-yDrJZrlrihHGr5J7ImahelNn9PpkVp6eIyABRmJHf2iicrk3CtjeG1j9OgTSwaNmEpUpn4aN7Kx0zNLdH7z6uTgCGD9Kmh1MFYrsoNlTp4AAAA.i2p/bittorrent/announce.php=http://nickyb.i2p/bittorrent/" +// , "Orion", "http://gKik1lMlRmuroXVGTZ~7v4Vez3L3ZSpddrGZBrxVriosCQf7iHu6CIk8t15BKsj~P0JJpxrofeuxtm7SCUAJEr0AIYSYw8XOmp35UfcRPQWyb1LsxUkMT4WqxAT3s1ClIICWlBu5An~q-Mm0VFlrYLIPBWlUFnfPR7jZ9uP5ZMSzTKSMYUWao3ejiykr~mtEmyls6g-ZbgKZawa9II4zjOy-hdxHgP-eXMDseFsrym4Gpxvy~3Fv9TuiSqhpgm~UeTo5YBfxn6~TahKtE~~sdCiSydqmKBhxAQ7uT9lda7xt96SS09OYMsIWxLeQUWhns-C~FjJPp1D~IuTrUpAFcVEGVL-BRMmdWbfOJEcWPZ~CBCQSO~VkuN1ebvIOr9JBerFMZSxZtFl8JwcrjCIBxeKPBmfh~xYh16BJm1BBBmN1fp2DKmZ2jBNkAmnUbjQOqWvUcehrykWk5lZbE7bjJMDFH48v3SXwRuDBiHZmSbsTY6zhGY~GkMQHNGxPMMSIAAAA.i2p/bt/announce.php=http://orion.i2p/bt/" +// , "anonymity", "http://8EoJZIKrWgGuDrxA3nRJs1jsPfiGwmFWL91hBrf0HA7oKhEvAna4Ocx47VLUR9retVEYBAyWFK-eZTPcvhnz9XffBEiJQQ~kFSCqb1fV6IfPiV3HySqi9U5Caf6~hC46fRd~vYnxmaBLICT3N160cxBETqH3v2rdxdJpvYt8q4nMk9LUeVXq7zqCTFLLG5ig1uKgNzBGe58iNcsvTEYlnbYcE930ABmrzj8G1qQSgSwJ6wx3tUQNl1z~4wSOUMan~raZQD60lRK70GISjoX0-D0Po9WmPveN3ES3g72TIET3zc3WPdK2~lgmKGIs8GgNLES1cXTolvbPhdZK1gxddRMbJl6Y6IPFyQ9o4-6Rt3Lp-RMRWZ2TG7j2OMcNSiOmATUhKEFBDfv-~SODDyopGBmfeLw16F4NnYednvn4qP10dyMHcUASU6Zag4mfc2-WivrOqeWhD16fVAh8MoDpIIT~0r9XmwdaVFyLcjbXObabJczxCAW3fodQUnvuSkwzAAAA.i2p/anonymityTracker/announce.php=http://anonymityweb.i2p/anonymityTracker/" +// , "The freak's tracker", "http://mHKva9x24E5Ygfey2llR1KyQHv5f8hhMpDMwJDg1U-hABpJ2NrQJd6azirdfaR0OKt4jDlmP2o4Qx0H598~AteyD~RJU~xcWYdcOE0dmJ2e9Y8-HY51ie0B1yD9FtIV72ZI-V3TzFDcs6nkdX9b81DwrAwwFzx0EfNvK1GLVWl59Ow85muoRTBA1q8SsZImxdyZ-TApTVlMYIQbdI4iQRwU9OmmtefrCe~ZOf4UBS9-KvNIqUL0XeBSqm0OU1jq-D10Ykg6KfqvuPnBYT1BYHFDQJXW5DdPKwcaQE4MtAdSGmj1epDoaEBUa9btQlFsM2l9Cyn1hzxqNWXELmx8dRlomQLlV4b586dRzW~fLlOPIGC13ntPXogvYvHVyEyptXkv890jC7DZNHyxZd5cyrKC36r9huKvhQAmNABT2Y~pOGwVrb~RpPwT0tBuPZ3lHYhBFYmD8y~AOhhNHKMLzea1rfwTvovBMByDdFps54gMN1mX4MbCGT4w70vIopS9yAAAA.i2p/bytemonsoon/announce.php" +// , "mastertracker", "http://VzXD~stRKbL3MOmeTn1iaCQ0CFyTmuFHiKYyo0Rd~dFPZFCYH-22rT8JD7i-C2xzYFa4jT5U2aqHzHI-Jre4HL3Ri5hFtZrLk2ax3ji7Qfb6qPnuYkuiF2E2UDmKUOppI8d9Ye7tjdhQVCy0izn55tBaB-U7UWdcvSK2i85sauyw3G0Gfads1Rvy5-CAe2paqyYATcDmGjpUNLoxbfv9KH1KmwRTNH6k1v4PyWYYnhbT39WfKMbBjSxVQRdi19cyJrULSWhjxaQfJHeWx5Z8Ev4bSPByBeQBFl2~4vqy0S5RypINsRSa3MZdbiAAyn5tr5slWR6QdoqY3qBQgBJFZppy-3iWkFqqKgSxCPundF8gdDLC5ddizl~KYcYKl42y9SGFHIukH-TZs8~em0~iahzsqWVRks3zRG~tlBcX2U3M2~OJs~C33-NKhyfZT7-XFBREvb8Szmd~p66jDxrwOnKaku-G6DyoQipJqIz4VHmY9-y5T8RrUcJcM-5lVoMpAAAA.i2p/announce.php=http://tracker.mastertracker.i2p/" +// , "Galen", "http://5jpwQMI5FT303YwKa5Rd38PYSX04pbIKgTaKQsWbqoWjIfoancFdWCShXHLI5G5ofOb0Xu11vl2VEMyPsg1jUFYSVnu4-VfMe3y4TKTR6DTpetWrnmEK6m2UXh91J5DZJAKlgmO7UdsFlBkQfR2rY853-DfbJtQIFl91tbsmjcA5CGQi4VxMFyIkBzv-pCsuLQiZqOwWasTlnzey8GcDAPG1LDcvfflGV~6F5no9mnuisZPteZKlrv~~TDoXTj74QjByWc4EOYlwqK8sbU9aOvz~s31XzErbPTfwiawiaZ0RUI-IDrKgyvmj0neuFTWgjRGVTH8bz7cBZIc3viy6ioD-eMQOrXaQL0TCWZUelRwHRvgdPiQrxdYQs7ixkajeHzxi-Pq0EMm5Vbh3j3Q9kfUFW3JjFDA-MLB4g6XnjCbM5J1rC0oOBDCIEfhQkszru5cyLjHiZ5yeA0VThgu~c7xKHybv~OMXION7V8pBKOgET7ZgAkw1xgYe3Kkyq5syAAAA.i2p/tr/announce.php=http://galen.i2p/tr/" + "POSTMAN", "http://tracker2.postman.i2p/announce.php=http://tracker2.postman.i2p/" + ,"WELTERDE", "http://BGKmlDOoH3RzFbPRfRpZV2FjpVj8~3moFftw5-dZfDf2070TOe8Tf2~DAVeaM6ZRLdmFEt~9wyFL8YMLMoLoiwGEH6IGW6rc45tstN68KsBDWZqkTohV1q9XFgK9JnCwE~Oi89xLBHsLMTHOabowWM6dkC8nI6QqJC2JODqLPIRfOVrDdkjLwtCrsckzLybNdFmgfoqF05UITDyczPsFVaHtpF1sRggOVmdvCM66otyonlzNcJbn59PA-R808vUrCPMGU~O9Wys0i-NoqtIbtWfOKnjCRFMNw5ex4n9m5Sxm9e20UkpKG6qzEuvKZWi8vTLe1NW~CBrj~vG7I3Ok4wybUFflBFOaBabxYJLlx4xTE1zJIVxlsekmAjckB4v-cQwulFeikR4LxPQ6mCQknW2HZ4JQIq6hL9AMabxjOlYnzh7kjOfRGkck8YgeozcyTvcDUcUsOuSTk06L4kdrv8h2Cozjbloi5zl6KTbj5ZTciKCxi73Pn9grICn-HQqEAAAA.i2p/a=http://tracker.welterde.i2p/stats?mode=top5" + , "CRSTRACK", "http://b4G9sCdtfvccMAXh~SaZrPqVQNyGQbhbYMbw6supq2XGzbjU4NcOmjFI0vxQ8w1L05twmkOvg5QERcX6Mi8NQrWnR0stLExu2LucUXg1aYjnggxIR8TIOGygZVIMV3STKH4UQXD--wz0BUrqaLxPhrm2Eh9Hwc8TdB6Na4ShQUq5Xm8D4elzNUVdpM~RtChEyJWuQvoGAHY3ppX-EJJLkiSr1t77neS4Lc-KofMVmgI9a2tSSpNAagBiNI6Ak9L1T0F9uxeDfEG9bBSQPNMOSUbAoEcNxtt7xOW~cNOAyMyGydwPMnrQ5kIYPY8Pd3XudEko970vE0D6gO19yoBMJpKx6Dh50DGgybLQ9CpRaynh2zPULTHxm8rneOGRcQo8D3mE7FQ92m54~SvfjXjD2TwAVGI~ae~n9HDxt8uxOecAAvjjJ3TD4XM63Q9TmB38RmGNzNLDBQMEmJFpqQU8YeuhnS54IVdUoVQFqui5SfDeLXlSkh4vYoMU66pvBfWbAAAA.i2p/tracker/announce.php=http://crstrack.i2p/tracker/" + + }; + + /** comma delimited list of name=announceURL=baseURL for the trackers to be displayed */ + public static final String PROP_TRACKERS = "i2psnark.trackers"; + private static Map trackerMap = null; + /** sorted map of name to announceURL=baseURL */ + public Map getTrackers() { + if (trackerMap != null) // only do this once, can't be updated while running + return trackerMap; + Map rv = new TreeMap(); + String trackers = _config.getProperty(PROP_TRACKERS); + if ( (trackers == null) || (trackers.trim().length() <= 0) ) + trackers = _context.getProperty(PROP_TRACKERS); + if ( (trackers == null) || (trackers.trim().length() <= 0) ) { + for (int i = 0; i < DEFAULT_TRACKERS.length; i += 2) + rv.put(DEFAULT_TRACKERS[i], DEFAULT_TRACKERS[i+1]); + } else { + StringTokenizer tok = new StringTokenizer(trackers, ","); + while (tok.hasMoreTokens()) { + String pair = tok.nextToken(); + int split = pair.indexOf('='); + if (split <= 0) + continue; + String name = pair.substring(0, split).trim(); + String url = pair.substring(split+1).trim(); + if ( (name.length() > 0) && (url.length() > 0) ) + rv.put(name, url); + } + } + + trackerMap = rv; + return trackerMap; + } + + private static class TorrentFilenameFilter implements FilenameFilter { + private static final TorrentFilenameFilter _filter = new TorrentFilenameFilter(); + public static TorrentFilenameFilter instance() { return _filter; } + public boolean accept(File dir, String name) { + return (name != null) && (name.endsWith(".torrent")); + } + } + + public class SnarkManagerShutdown extends I2PAppThread { + @Override + public void run() { + Set names = listTorrentFiles(); + for (Iterator iter = names.iterator(); iter.hasNext(); ) { + Snark snark = getTorrent((String)iter.next()); + if ( (snark != null) && (!snark.stopped) ) + snark.stopTorrent(); + } + } + } +} diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java index 04d534775bbbbb0c32c43245d1b9e7b738c47d34..696cdbe4488f395fc30540dc48f48e15a4dba553 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -85,8 +85,8 @@ public class I2PSnarkServlet extends HttpServlet { out.write("<meta http-equiv=\"refresh\" content=\"60;" + req.getRequestURI() + peerString + "\">\n"); out.write(HEADER); out.write("</head><body>"); - out.write("<center><div class=\"page\"><table border=\"0\" width=\"100%\"><tr><td align=\"center\" class=\"snarkTitle\"><a href=\"" + req.getRequestURI() + peerString + "\" title=\"I2PSnark (Manual Page Refresh)\"><img src=\"/themes/console/images/i2psnark.png\" alt=\"I2PSnark Anonymous BitTorrent Client\" border=\"0\" class=\"snarklogo\"></a></table>"); - out.write("<div class=\"snarknavbar\"><a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" target=\"_blank\">Forum</a>\n"); + out.write("<center><div class=\"page\">"); + out.write("<div class=\"snarknavbar\"><a href=\"" + req.getRequestURI() + peerString + "\" title=\"Refresh page\" class=\"snarkRefresh\">I2PSnark</a> <a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" target=\"_blank\">Forum</a>\n"); Map trackers = _manager.getTrackers(); for (Iterator iter = trackers.entrySet().iterator(); iter.hasNext(); ) { Map.Entry entry = (Map.Entry)iter.next(); @@ -112,18 +112,18 @@ public class I2PSnarkServlet extends HttpServlet { out.write(TABLE_HEADER); if (_manager.util().connected() && snarks.size() > 0) { if (peerParam != null) - out.write("(<a href=\"" + req.getRequestURI() + "\">Hide Peers</a>)<br />\n"); + out.write("(<a href=\"" + req.getRequestURI() + "\">Hide Peers</a>)<br>\n"); else - out.write("(<a href=\"" + req.getRequestURI() + "?p=1" + "\">Show Peers</a>)<br />\n"); + out.write("(<a href=\"" + req.getRequestURI() + "?p=1" + "\">Show Peers</a>)<br>\n"); } out.write(TABLE_HEADER2); - out.write("<th align=\"left\">"); + out.write("<th align=\"center\">"); if (_manager.util().connected()) out.write("<a href=\"" + uri + "?action=StopAll&nonce=" + _nonce + - "\" title=\"Stop all torrents and the i2p tunnel\">Stop All</a>"); + "\" title=\"Stop all torrents and the I2P tunnel\">Stop All</a>"); else if (snarks.size() > 0) out.write("<a href=\"" + uri + "?action=StartAll&nonce=" + _nonce + - "\" title=\"Start all torrents and the i2p tunnel\">Start All</a>"); + "\" title=\"Start all torrents and the I2P tunnel\">Start All</a>"); else out.write(" "); out.write("</th></tr></thead>\n"); @@ -460,7 +460,7 @@ public class I2PSnarkServlet extends HttpServlet { else { if (err.length() > MAX_DISPLAYED_ERROR_LENGTH) err = err.substring(0, MAX_DISPLAYED_ERROR_LENGTH) + "…"; - statusString = "TrackerErr<br />(" + err + ")"; + statusString = "TrackerErr<br>(" + err + ")"; } } else if (remaining <= 0) { if (isRunning && curPeers > 0 && !showPeers) @@ -492,7 +492,7 @@ public class I2PSnarkServlet extends HttpServlet { String rowClass = (row % 2 == 0 ? "snarkTorrentEven" : "snarkTorrentOdd"); out.write("<tr class=\"" + rowClass + "\">"); - out.write("<td align=\"left\" class=\"snarkTorrentStatus " + rowClass + "\">"); + out.write("<td align=\"center\" class=\"snarkTorrentStatus " + rowClass + "\">"); out.write(statusString + "</td>\n\t"); out.write("<td align=\"left\" class=\"snarkTorrentName " + rowClass + "\">"); @@ -526,7 +526,7 @@ public class I2PSnarkServlet extends HttpServlet { } out.write("</td>\n\t"); - out.write("<td align=\"right\" class=\"snarkTorrentETA " + rowClass + "\">"); + out.write("<td align=\"center\" class=\"snarkTorrentETA " + rowClass + "\">"); if(isRunning && remainingSeconds > 0) out.write(DataHelper.formatDuration(remainingSeconds*1000)); // (eta 6h) out.write("</td>\n\t"); @@ -546,7 +546,7 @@ public class I2PSnarkServlet extends HttpServlet { if(isRunning) out.write(formatSize(upBps) + "ps"); out.write("</td>\n\t"); - out.write("<td align=\"left\" class=\"snarkTorrentAction " + rowClass + "\">"); + out.write("<td align=\"center\" class=\"snarkTorrentAction " + rowClass + "\">"); String parameters = "&nonce=" + _nonce + "&torrent=" + Base64.encode(snark.meta.getInfoHash()); if (showPeers) parameters = parameters + "&p=1"; @@ -558,7 +558,7 @@ public class I2PSnarkServlet extends HttpServlet { out.write("<a href=\"" + uri + "?action=Start" + parameters + "\" title=\"Start the torrent\">Start</a> "); out.write("<a href=\"" + uri + "?action=Remove" + parameters - + "\" title=\"Remove the torrent from the active list, deleting the .torrent file\">Remove</a><br />"); + + "\" title=\"Remove the torrent from the active list, deleting the .torrent file\">Remove</a><br>"); out.write("<a href=\"" + uri + "?action=Delete" + parameters + "\" title=\"Delete the .torrent file and the associated data file(s)\">Delete</a> "); } @@ -571,9 +571,9 @@ public class I2PSnarkServlet extends HttpServlet { if (!peer.isConnected()) continue; out.write("<tr class=\"" + rowClass + "\">"); - out.write("<td class=\"snarkTorrentStatus " + rowClass + "\">"); + out.write("<td align=\"center\" class=\"snarkTorrentStatus " + rowClass + "\">"); out.write("</td>\n\t"); - out.write("<td align=\"right\" class=\"snarkTorrentStatus " + rowClass + "\">"); + out.write("<td align=\"center\" class=\"snarkTorrentStatus " + rowClass + "\">"); String ch = peer.toString().substring(0, 4); String client; if ("AwMD".equals(ch)) @@ -592,7 +592,7 @@ public class I2PSnarkServlet extends HttpServlet { client = "Robert"; else client = "Unknown (" + ch + ')'; - out.write("<font size=-1>" + client + "</font> <tt>" + peer.toString().substring(5, 9) + "</tt>"); + out.write("<font size=-1>" + client + "</font> " + peer.toString().substring(5, 9) + ""); if (showDebug) out.write(" inactive " + (peer.getInactiveTime() / 1000) + "s"); out.write("</td>\n\t"); @@ -660,13 +660,13 @@ public class I2PSnarkServlet extends HttpServlet { // *not* enctype="multipart/form-data", so that the input type=file sends the filename, not the file out.write("<form action=\"" + uri + "\" method=\"POST\">\n"); out.write("<input type=\"hidden\" name=\"nonce\" value=\"" + _nonce + "\" />\n"); - out.write("<div class=\"addtorrentsection\"><span class=\"snarkConfigTitle\">Add Torrent:</span><br />\n"); + out.write("<div class=\"addtorrentsection\"><span class=\"snarkConfigTitle\">Add Torrent:</span><br>\n"); out.write("From URL : <input type=\"text\" name=\"newURL\" size=\"80\" value=\"" + newURL + "\" /> \n"); // not supporting from file at the moment, since the file name passed isn't always absolute (so it may not resolve) - //out.write("From file: <input type=\"file\" name=\"newFile\" size=\"50\" value=\"" + newFile + "\" /><br />\n"); - out.write("<input type=\"submit\" value=\"Add torrent\" name=\"action\" /><br />\n"); - out.write("<span class=\"snarkAddInfo\">Alternately, you can copy .torrent files to " + _manager.getDataDir().getAbsolutePath() + "<br />\n"); - out.write("Removing that .torrent file will cause the torrent to stop.<br /></span>\n"); + //out.write("From file: <input type=\"file\" name=\"newFile\" size=\"50\" value=\"" + newFile + "\" /><br>\n"); + out.write("<input type=\"submit\" value=\"Add torrent\" name=\"action\" /><br>\n"); + out.write("<span class=\"snarkAddInfo\">Alternately, you can copy .torrent files to " + _manager.getDataDir().getAbsolutePath() + "<br>\n"); + out.write("Removing that .torrent file will cause the torrent to stop.<br></span>\n"); out.write("</form>\n</span></div>"); } @@ -680,11 +680,11 @@ public class I2PSnarkServlet extends HttpServlet { // *not* enctype="multipart/form-data", so that the input type=file sends the filename, not the file out.write("<form action=\"" + uri + "\" method=\"POST\">\n"); out.write("<input type=\"hidden\" name=\"nonce\" value=\"" + _nonce + "\" />\n"); - out.write("<span class=\"snarkConfigTitle\">Create Torrent:</span><br />\n"); - //out.write("From file: <input type=\"file\" name=\"newFile\" size=\"50\" value=\"" + newFile + "\" /><br />\n"); + out.write("<span class=\"snarkConfigTitle\">Create Torrent:</span><br>\n"); + //out.write("From file: <input type=\"file\" name=\"newFile\" size=\"50\" value=\"" + newFile + "\" /><br>\n"); out.write("Data to seed: " + _manager.getDataDir().getAbsolutePath() + File.separatorChar + "<input type=\"text\" name=\"baseFile\" size=\"20\" value=\"" + baseFile - + "\" title=\"File to seed (must be within the specified path)\" /><br />\n"); + + "\" title=\"File to seed (must be within the specified path)\" /><br>\n"); out.write("Tracker: <select name=\"announceURL\"><option value=\"\">Select a tracker</option>\n"); Map trackers = _manager.getTrackers(); for (Iterator iter = trackers.entrySet().iterator(); iter.hasNext(); ) { @@ -714,15 +714,15 @@ public class I2PSnarkServlet extends HttpServlet { out.write("<form action=\"" + uri + "\" method=\"POST\">\n"); out.write("<div class=\"configsection\"><span class=\"snarkConfig\">\n"); out.write("<input type=\"hidden\" name=\"nonce\" value=\"" + _nonce + "\" />\n"); - out.write("<span class=\"snarkConfigTitle\">Configuration:</span><br />\n"); + out.write("<span class=\"snarkConfigTitle\">Configuration:</span><br>\n"); out.write("Data directory: <input type=\"text\" size=\"40\" name=\"dataDir\" value=\"" + dataDir + "\" "); - out.write("title=\"Directory to store torrents and data\" disabled=\"true\" /> <i>(Edit i2psnark.config and restart to change)</i><br />\n"); + out.write("title=\"Directory to store torrents and data\" disabled=\"true\" /> <i>(Edit i2psnark.config and restart to change)</i><br>\n"); out.write("Auto start: <input type=\"checkbox\" class=\"optbox\" name=\"autoStart\" value=\"true\" " + (autoStart ? "checked " : "") + "title=\"If true, automatically start torrents that are added\" />"); //Auto add: <input type="checkbox" name="autoAdd" value="true" title="If true, automatically add torrents that are found in the data directory" /> //Auto stop: <input type="checkbox" name="autoStop" value="true" title="If true, automatically stop torrents that are removed from the data directory" /> - //out.write("<br />\n"); + //out.write("<br>\n"); /* out.write("Seed percentage: <select name=\"seedPct\" disabled=\"true\" >\n\t"); if (seedPct <= 0) @@ -737,28 +737,28 @@ public class I2PSnarkServlet extends HttpServlet { out.write("<option value=\"150\" selected=\"true\">150%</option>\n\t"); else out.write("<option value=\"150\">150%</option>\n\t"); - out.write("</select><br />\n"); + out.write("</select><br>\n"); */ out.write("Total uploader limit: <input type=\"text\" name=\"upLimit\" value=\"" - + _manager.util().getMaxUploaders() + "\" size=\"3\" maxlength=\"3\" /> peers<br />\n"); + + _manager.util().getMaxUploaders() + "\" size=\"3\" maxlength=\"3\" /> peers<br>\n"); out.write("Up bandwidth limit: <input type=\"text\" name=\"upBW\" value=\"" - + _manager.util().getMaxUpBW() + "\" size=\"3\" maxlength=\"3\" /> KBps <i>(Half <a href=\"/config.jsp\" target=\"blank\">available bandwidth</a> recommended.)</i><br />\n"); + + _manager.util().getMaxUpBW() + "\" size=\"3\" maxlength=\"3\" /> KBps <i>(Half <a href=\"/config.jsp\" target=\"blank\">available bandwidth</a> recommended.)</i><br>\n"); out.write("Use open trackers also: <input type=\"checkbox\" class=\"optbox\" name=\"useOpenTrackers\" value=\"true\" " + (useOpenTrackers ? "checked " : "") + "title=\"If true, uses open trackers in addition\" /> "); out.write("Announce URLs: <input type=\"text\" name=\"openTrackers\" value=\"" - + openTrackers + "\" size=\"50\" /><br />\n"); + + openTrackers + "\" size=\"50\" /><br>\n"); //out.write("\n"); out.write("EepProxy host: <input type=\"text\" name=\"eepHost\" value=\"" + _manager.util().getEepProxyHost() + "\" size=\"15\" /> "); out.write("port: <input type=\"text\" name=\"eepPort\" value=\"" - + _manager.util().getEepProxyPort() + "\" size=\"5\" maxlength=\"5\" /><br />\n"); + + _manager.util().getEepProxyPort() + "\" size=\"5\" maxlength=\"5\" /><br>\n"); out.write("I2CP host: <input type=\"text\" name=\"i2cpHost\" value=\"" + _manager.util().getI2CPHost() + "\" size=\"15\" /> "); out.write("port: <input type=\"text\" name=\"i2cpPort\" value=\"" + - + _manager.util().getI2CPPort() + "\" size=\"5\" maxlength=\"5\" /> <br />\n"); + + _manager.util().getI2CPPort() + "\" size=\"5\" maxlength=\"5\" /> <br>\n"); StringBuilder opts = new StringBuilder(64); Map options = new TreeMap(_manager.util().getI2CPOptions()); for (Iterator iter = options.entrySet().iterator(); iter.hasNext(); ) { @@ -768,7 +768,7 @@ public class I2PSnarkServlet extends HttpServlet { opts.append(key).append('=').append(val).append(' '); } out.write("I2CP opts: <input type=\"text\" name=\"i2cpOpts\" size=\"80\" value=\"" - + opts.toString() + "\" /><br />\n"); + + opts.toString() + "\" /><br>\n"); out.write("<input type=\"submit\" value=\"Save configuration\" name=\"action\" />\n"); out.write("</span>\n"); out.write("</form></div>"); @@ -795,11 +795,11 @@ public class I2PSnarkServlet extends HttpServlet { private static final String TABLE_HEADER = "<table border=\"0\" class=\"snarkTorrents\" width=\"100%\" cellpadding=\"0 10px\">\n" + "<thead>\n" + - "<tr><th align=\"left\">Status \n"; + "<tr><th align=\"center\">Status \n"; private static final String TABLE_HEADER2 = "</th>\n" + " <th align=\"left\">Torrent</th>\n" + - " <th align=\"right\">ETA</th>\n" + + " <th align=\"center\">ETA</th>\n" + " <th align=\"right\">Downloaded</th>\n" + " <th align=\"right\">Uploaded</th>\n" + " <th align=\"right\">Down Rate</th>\n" + diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java index 28484a57a8ff9d2a0cc26d96190a5a0f0c5efce2..7a80c181f61aa771aaa1ec00f2cdfd86d7a266c5 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java @@ -345,7 +345,7 @@ public class I2PTunnelConnectClient extends I2PTunnelClientBase implements Runna if (targetRequest != null) { out.write(targetRequest.getBytes()); if (usingWWWProxy) - out.write(("<br>WWW proxy: " + wwwProxy).getBytes()); + out.write(("<br />WWW proxy: " + wwwProxy).getBytes()); } out.write("</div>".getBytes()); out.write("\n</body></html>\n".getBytes()); diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index 59169a18cfc50874007d3868dc7dacc1c75409aa..075483529b6ec4a833810b28b8e8a759c18a64f9 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -388,7 +388,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable String conflictURL = protocol + alias + ".i2p/?" + initialFragments; out.write(header); out.write(("To visit the destination in your host database, click <a href=\"" + trustedURL + "\">here</a>. To visit the conflicting addresshelper link by temporarily giving it a random alias, click <a href=\"" + conflictURL + "\">here</a>.<P/>").getBytes()); - out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br>Generated on: ".getBytes()); + out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br />Generated on: ".getBytes()); out.write(new Date().toString().getBytes()); out.write("</i></div></body></html>\n".getBytes()); out.flush(); @@ -705,9 +705,9 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable out.write("\">http://".getBytes()); out.write(uri.getBytes()); out.write("</a>".getBytes()); - if (usingWWWProxy) out.write(("<br>WWW proxy: " + wwwProxy).getBytes()); + if (usingWWWProxy) out.write(("<br />WWW proxy: " + wwwProxy).getBytes()); if (showAddrHelper) { - out.write("<br><br>Click a link below to look for an address helper by using a \"jump\" service:<br>".getBytes()); + out.write("<br /><br />Click a link below to look for an address helper by using a \"jump\" service:<br />".getBytes()); for (int i = 0; i < jumpServers.length; i++) { // Skip jump servers we don't know String jumphost = jumpServers[i].substring(7); // "http://" @@ -719,7 +719,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable continue; } - out.write("<br><a href=\"".getBytes()); + out.write("<br /><a href=\"".getBytes()); out.write(jumpServers[i].getBytes()); out.write(uri.getBytes()); out.write("\">".getBytes()); @@ -729,7 +729,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable } } } - out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br>Generated on: ".getBytes()); + out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br />Generated on: ".getBytes()); out.write(new Date().toString().getBytes()); out.write("</i></div></body></html>\n".getBytes()); out.flush(); diff --git a/apps/i2ptunnel/jsp/editClient.jsp b/apps/i2ptunnel/jsp/editClient.jsp index 1b3c1eb81a99a31294b70d30ca6b100e1e122326..4957e3a576cb850c45cf38670cb548171449ca1a 100644 --- a/apps/i2ptunnel/jsp/editClient.jsp +++ b/apps/i2ptunnel/jsp/editClient.jsp @@ -192,7 +192,7 @@ <div id="tunnelAdvancedNetworking" class="panel"> <div class="header"> - <h4>Advanced networking options</h4> + <h4>Advanced networking options</h4><br /> <span class="comment">(NOTE: when this client proxy is configured to share tunnels, then these options are for all the shared proxy clients!)</span> </div> @@ -335,10 +335,10 @@ <table border="0"><tr><!-- I give up --> <td><input value="1" type="radio" id="startOnLoad" name="newDest" title="New Destination" <%=(editBean.getNewDest(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" /> - <td valign="center">Enable + <td>Enable <td><input value="0" type="radio" id="startOnLoad" name="newDest" title="New Destination" <%=(editBean.getNewDest(curTunnel) || editBean.getPersistentClientKey(curTunnel) ? "" : " checked=\"checked\"")%> class="tickbox" /> - <td valign="center">Disable + <td>Disable </table> </div> <div id="portField" class="rowItem"> @@ -411,7 +411,8 @@ <div class="header"></div> <div class="footer"> <div class="toolbox"> - <span class="comment">NOTE: If tunnel is currently running, most changes will not take effect until tunnel is stopped and restarted</span> + <span class="comment">NOTE: If tunnel is currently running, most changes will not take effect until tunnel is stopped and restarted.</span> + <div class="separator"><hr /></div> <input type="hidden" value="true" name="removeConfirm" /> <button id="controlSave" accesskey="S" class="control" type="submit" name="action" value="Save changes" title="Save Changes"><span class="accessKey">S</span>ave</button> <button id="controlDelete" <%=(editBean.allowJS() ? "onclick=\"if (!confirm('Are you sure you want to delete?')) { return false; }\" " : "")%>accesskey="D" class="control" type="submit" name="action" value="Delete this proxy" title="Delete this Proxy"><span class="accessKey">D</span>elete</button> diff --git a/apps/i2ptunnel/jsp/editServer.jsp b/apps/i2ptunnel/jsp/editServer.jsp index 2acc75183d1d52c8aa271e7b04035136511b1668..5d2cc3cd4bf19fac07649e2b32412abde47ac5d6 100644 --- a/apps/i2ptunnel/jsp/editServer.jsp +++ b/apps/i2ptunnel/jsp/editServer.jsp @@ -399,7 +399,8 @@ <div class="header"></div> <div class="footer"> <div class="toolbox"> - <span class="comment">NOTE: If tunnel is currently running, most changes will not take effect until tunnel is stopped and restarted</span> + <span class="comment">NOTE: If tunnel is currently running, most changes will not take effect until tunnel is stopped and restarted.</span> + <div class="separator"><hr /></div> <input type="hidden" value="true" name="removeConfirm" /> <button id="controlSave" accesskey="S" class="control" type="submit" name="action" value="Save changes" title="Save Changes"><span class="accessKey">S</span>ave</button> <button id="controlDelete" <%=(editBean.allowJS() ? "onclick=\"if (!confirm('Are you sure you want to delete?')) { return false; }\" " : "")%>accesskey="D" class="control" type="submit" name="action" value="Delete this proxy" title="Delete this Proxy"><span class="accessKey">D</span>elete</button> diff --git a/apps/i2ptunnel/jsp/index.jsp b/apps/i2ptunnel/jsp/index.jsp index 4c26bd3da8905240bab9fe9a014e1a1eb74bd908..45a3da56a532528952a06f5d704ef969273bb9f5 100644 --- a/apps/i2ptunnel/jsp/index.jsp +++ b/apps/i2ptunnel/jsp/index.jsp @@ -4,7 +4,7 @@ <jsp:setProperty name="indexBean" property="*" /> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <title>I2PTunnel Webmanager - List</title> + <title>I2P Tunnel Manager - List</title> <meta htt p-equiv="Content-Type" content="text/html; charset=UTF-8" /> @@ -106,7 +106,7 @@ p-equiv="Content-Type" content="text/html; charset=UTF-8" /> <a class="control" title="Test HTTP server through I2P" href="http://<%=indexBean.getDestHashBase32(curServer)%>.b32.i2p">Preview</a> <% } else if (indexBean.getTunnelStatus(curServer) == IndexBean.RUNNING) { - %><span class="text">Base32 Address:<br><%=indexBean.getDestHashBase32(curServer)%>.b32.i2p</span> + %><span class="text">Base32 Address:<br /><%=indexBean.getDestHashBase32(curServer)%>.b32.i2p</span> <% } else { %><span class="comment">No Preview</span> diff --git a/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkClient.java b/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkClient.java index 2269e585a9ad51ba3e3b54b463fcf3a2572f166d..fc4df49889aa31653df2a7d69d054683bc039763 100644 --- a/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkClient.java +++ b/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkClient.java @@ -117,7 +117,7 @@ public class StreamSinkClient { } /** - * Fire up the client. <code>Usage: StreamSinkClient [i2cpHost i2cpPort] sendSizeKB writeDelayMs serverDestFile [concurrentSends]</code> <br /> + * Fire up the client. <code>Usage: StreamSinkClient [i2cpHost i2cpPort] sendSizeKB writeDelayMs serverDestFile [concurrentSends]</code> <br> * <ul> * <li><b>sendSizeKB</b>: how many KB to send, or -1 for unlimited</li> * <li><b>writeDelayMs</b>: how long to wait between each .write (0 for no delay)</li> diff --git a/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkSend.java b/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkSend.java index 44bcb1b47e733d21cf3253bc3e2c73fad34dc0b2..e38ac372c524f6c08b285fb82e3720543349e281 100644 --- a/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkSend.java +++ b/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkSend.java @@ -104,7 +104,7 @@ public class StreamSinkSend { } /** - * Fire up the client. <code>Usage: StreamSinkClient sendFile writeDelayMs serverDestFile</code> <br /> + * Fire up the client. <code>Usage: StreamSinkClient sendFile writeDelayMs serverDestFile</code> <br> * <ul> * <li><b>sendFile</b>: filename to send</li> * <li><b>writeDelayMs</b>: how long to wait between each .write (0 for no delay)</li> diff --git a/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkServer.java b/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkServer.java index 4266fd911fdb85cb0b299518e4cae35e321469bb..c72313623d52dfc8cf64881797e560e3322d0ff8 100644 --- a/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkServer.java +++ b/apps/ministreaming/java/test/net/i2p/client/streaming/StreamSinkServer.java @@ -155,7 +155,7 @@ public class StreamSinkServer { } /** - * Fire up the streaming server. <code>Usage: StreamSinkServer [i2cpHost i2cpPort] sinkDir ourDestFile [numHandlers]</code><br /> + * Fire up the streaming server. <code>Usage: StreamSinkServer [i2cpHost i2cpPort] sinkDir ourDestFile [numHandlers]</code><br> * <ul> * <li><b>sinkDir</b>: Directory to store received files in</li> * <li><b>ourDestFile</b>: filename to write our binary destination to</li> diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigAdvancedHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigAdvancedHandler.java index 3f60e57a94eba0fb0e81c9c22813b70573372760..230e9ec0e3d14f970425d57083ee3f7a66f582ac 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigAdvancedHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigAdvancedHandler.java @@ -17,6 +17,7 @@ public class ConfigAdvancedHandler extends FormHandler { private boolean _shouldSave; private String _config; + @Override protected void processForm() { if (_shouldSave) { saveChanges(); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigAdvancedHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigAdvancedHelper.java index 5bffa2a2187c55ada62f78c67dc35a209319720b..a60a3409e19b7182c021bc8ea5926943e752303c 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigAdvancedHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigAdvancedHelper.java @@ -4,7 +4,6 @@ import java.util.Iterator; import java.util.Set; import java.util.TreeSet; -import net.i2p.router.RouterContext; public class ConfigAdvancedHelper extends HelperBase { public ConfigAdvancedHelper() {} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java index 285cdd3854214b0ce0038dcc070d5418a1e744a5..d2f4d8e64a029fdbd5b7b35b7889a17cbf745835 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java @@ -20,13 +20,14 @@ import org.mortbay.jetty.Server; * Saves changes to clients.config or webapps.config */ public class ConfigClientsHandler extends FormHandler { - private Log _log; + private Log configClient_log; private Map _settings; public ConfigClientsHandler() { - _log = ContextHelper.getContext(null).logManager().getLog(ConfigClientsHandler.class); + configClient_log = ContextHelper.getContext(null).logManager().getLog(ConfigClientsHandler.class); } + @Override protected void processForm() { if (_action.startsWith("Save Client")) { saveClientChanges(); @@ -80,7 +81,7 @@ public class ConfigClientsHandler extends FormHandler { return; } ClientAppConfig ca = (ClientAppConfig) clients.get(i); - LoadClientAppsJob.runClient(ca.className, ca.clientName, LoadClientAppsJob.parseArgs(ca.args), _log); + LoadClientAppsJob.runClient(ca.className, ca.clientName, LoadClientAppsJob.parseArgs(ca.args), configClient_log); addFormNotice("Client " + ca.clientName + " started."); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java index 47b301d28e86f8ee1208cfed2b045bb7a28e5de8..af71883eb6c50f4284cfc33cffa3a6ece1f30ed5 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java @@ -6,7 +6,6 @@ import java.util.Properties; import java.util.Set; import java.util.TreeSet; -import net.i2p.router.RouterContext; import net.i2p.router.startup.ClientAppConfig; public class ConfigClientsHelper extends HelperBase { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigConsoleHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigConsoleHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..758ddae056deb1678cdcd32d0398d9d57ffb270f --- /dev/null +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigConsoleHandler.java @@ -0,0 +1,61 @@ +package net.i2p.router.web; + +/** + * Handler to deal with console config. + * + */ +public class ConfigConsoleHandler extends FormHandler { + + private boolean _forceRestart; + private boolean _shouldSave; + private String _configPass; + // This is possibly the wrong place for this... + // private String _configPort; + + @Override + protected void processForm() { + if(_shouldSave) { + saveChanges(); + } else { + // noop + } + } + + public void setShouldsave(String moo) { + _shouldSave = true; + } + + public void setRestart(String moo) { + _forceRestart = true; + } + + public void setConfigPass(String val) { + _configPass = val.trim(); + } + + /** + * The user made changes to the config and wants to save them, so + * lets go ahead and do so. + * + */ + private void saveChanges() { + if(_configPass != null) { + _context.router().setConfigSetting("consolePassword", _configPass); + } else { + _context.router().setConfigSetting("consolePassword", ""); + } + + boolean saved = _context.router().saveConfig(); + if(saved) { + addFormNotice("Configuration saved successfully"); + } else { + addFormNotice("Error saving the configuration (applied but not saved) - please see the error logs"); + } + + if(_forceRestart) { + addFormNotice("Performing a soft restart"); + _context.router().restart(); + addFormNotice("Soft restart complete"); + } + } +} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigConsoleHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigConsoleHelper.java new file mode 100644 index 0000000000000000000000000000000000000000..78aac3b99ba5b2ca095612f8196dbafd7df857d8 --- /dev/null +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigConsoleHelper.java @@ -0,0 +1,14 @@ +package net.i2p.router.web; + + +public class ConfigConsoleHelper extends HelperBase { + private String consolePassword="consolePassword"; + + public ConfigConsoleHelper() {} + + public String getSettings() { + StringBuilder buf = new StringBuilder(4*1024); + buf.append(consolePassword); + return buf.toString(); + } +} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHandler.java index b43bc4d1f1ac61c98e80ef3dda1d1b839de0b857..9cb3bfcebb3c8175e1aab1d6ed759d5c534d397d 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHandler.java @@ -1,6 +1,5 @@ package net.i2p.router.web; -import net.i2p.I2PAppContext; import net.i2p.data.DataFormatException; import net.i2p.data.Hash; import net.i2p.data.SessionKey; @@ -13,6 +12,7 @@ public class ConfigKeyringHandler extends FormHandler { private String _peer; private String _key; + @Override protected void processForm() { if ("Add key".equals(_action)) { if (_peer == null || _key == null) { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHelper.java index 85c8ee42314830c32a04582ccd8b7ba4ce20f42b..8c147fcdd56ef37dbb345e01ceef27f211401292 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHelper.java @@ -4,7 +4,6 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; -import net.i2p.router.RouterContext; public class ConfigKeyringHelper extends HelperBase { public ConfigKeyringHelper() {} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java index a09f250a7368a1d5c982aab586a03de0c2205f25..347cfdab7f654cfe198d150d2d6fa3b273b4b34d 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java @@ -18,6 +18,7 @@ public class ConfigLoggingHandler extends FormHandler { private String _dateFormat; private String _fileSize; + @Override protected void processForm() { if (_shouldSave) { saveChanges(); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHelper.java index ab23fce6fbb593c142cd12c026fb21ee0c4797c8..e1e7907b03eeb5059e95e0a8f8f538914c7eace9 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHelper.java @@ -4,7 +4,6 @@ import java.util.Iterator; import java.util.Properties; import java.util.TreeSet; -import net.i2p.router.RouterContext; public class ConfigLoggingHelper extends HelperBase { public ConfigLoggingHelper() {} @@ -43,7 +42,7 @@ public class ConfigLoggingHelper extends HelperBase { String level = limits.getProperty(prefix); buf.append(prefix).append('=').append(level).append('\n'); } - buf.append("</textarea><br />\n"); + buf.append("</textarea><br>\n"); buf.append("<i>Add additional logging statements above. Example: net.i2p.router.tunnel=WARN</i><br>"); buf.append("<i>Or put entries in the logger.config file. Example: logger.record.net.i2p.router.tunnel=WARN</i><br>"); buf.append("<i>Valid levels are DEBUG, INFO, WARN, ERROR, CRIT</i>\n"); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java index 1067eba5493579a9d950f7fbb8217ac95a31521f..b14bab7f8216bd7eaed77809dc11d3f1bbef819c 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java @@ -1,12 +1,10 @@ package net.i2p.router.web; -import net.i2p.data.RouterInfo; import net.i2p.router.Router; import net.i2p.router.transport.FIFOBandwidthRefiller; import net.i2p.router.transport.TransportManager; import net.i2p.router.transport.udp.UDPTransport; import net.i2p.router.web.ConfigServiceHandler.UpdateWrapperManagerAndRekeyTask; -import net.i2p.time.Timestamper; /** * Handler to deal with form submissions from the main config form and act @@ -44,6 +42,7 @@ public class ConfigNetHandler extends FormHandler { private static final boolean _ratesOnly = false; // always false - delete me private static final String PROP_HIDDEN = Router.PROP_HIDDEN_HIDDEN; // see Router for other choice + @Override protected void processForm() { if (_saveRequested || ( (_action != null) && ("Save changes".equals(_action)) )) { saveChanges(); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java index bf47f3efa76e6967602b835c2f5862434f528504..48426e44888905dbce3e5d4721a0dc126c9cf030 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java @@ -4,7 +4,6 @@ import net.i2p.data.DataHelper; import net.i2p.data.RouterAddress; import net.i2p.router.CommSystemFacade; import net.i2p.router.Router; -import net.i2p.router.RouterContext; import net.i2p.router.transport.Addresses; import net.i2p.router.transport.TransportManager; import net.i2p.router.transport.udp.UDPAddress; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHandler.java index 48ec6e443115134966f01cfcaf48a8b4c996e78c..479aeb4c268f8e6e6fc4f89cf817de2550d12390 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHandler.java @@ -1,12 +1,8 @@ package net.i2p.router.web; -import net.i2p.I2PAppContext; -import net.i2p.data.DataHelper; import net.i2p.data.Hash; import net.i2p.data.Base64; -import net.i2p.router.Router; import net.i2p.router.peermanager.PeerProfile; -import net.i2p.util.Log; /** * @@ -16,6 +12,7 @@ public class ConfigPeerHandler extends FormHandler { private String _speed; private String _capacity; + @Override protected void processForm() { if ("Save Configuration".equals(_action)) { _context.router().saveConfig(); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHelper.java index 662a078b8140fb066c63658e29357a779ee1e194..9db6722b44aff4f7dcd9de8a2a3b22df16363795 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHelper.java @@ -4,7 +4,6 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; -import net.i2p.router.RouterContext; public class ConfigPeerHelper extends HelperBase { public ConfigPeerHelper() {} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigRestartBean.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigRestartBean.java index c9ab42ddee9e513357237f22217a15d776583dd1..ab9cbf0ff2b001a0bb5de8d65ad93ed5ff3747ba 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigRestartBean.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigRestartBean.java @@ -49,16 +49,16 @@ public class ConfigRestartBean { long timeRemaining = ctx.router().getShutdownTimeRemaining(); if (shuttingDown) { if (timeRemaining <= 0) { - return "<b>Shutdown imminent</b>"; + return "<center><b>Shutdown imminent</b></center>"; } else { - return "<b>Shutdown in " + DataHelper.formatDuration(timeRemaining) + "</b><br />" + return "<center><b>Shutdown in " + DataHelper.formatDuration(timeRemaining) + "</b></center><br>" + buttons(urlBase, systemNonce, "shutdownImmediate,Shutdown immediately,cancelShutdown,Cancel shutdown"); } } else if (restarting) { if (timeRemaining <= 0) { - return "<b>Restart imminent</b>"; + return "<center><b>Restart imminent</b></center>"; } else { - return "<b>Restart in " + DataHelper.formatDuration(timeRemaining) + "</b><br />" + return "<center><b>Restart in " + DataHelper.formatDuration(timeRemaining) + "</b></center><br>" + buttons(urlBase, systemNonce, "restartImmediate,Restart immediately,cancelShutdown,Cancel restart"); } } else { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java index 195889fad295a59d565fa55b59de01e8e0120f8d..76de0f5d49e55463edaff89e98816813e175fa1f 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java @@ -1,13 +1,10 @@ package net.i2p.router.web; -import java.io.File; -import java.io.FileWriter; import java.io.IOException; import java.util.List; import net.i2p.apps.systray.SysTray; import net.i2p.apps.systray.UrlLauncher; -import net.i2p.data.DataHelper; import net.i2p.router.Router; import net.i2p.router.startup.ClientAppConfig; @@ -49,6 +46,7 @@ public class ConfigServiceHandler extends FormHandler { } } + @Override protected void processForm() { if (_action == null) return; @@ -95,9 +93,9 @@ public class ConfigServiceHandler extends FormHandler { SysTray tray = SysTray.getInstance(); if (tray != null) { tray.show(); - addFormNotice("Systray enabled"); + addFormNotice("System tray icon enabled."); } else { - addFormNotice("Systray not supported on this platform"); + addFormNotice("System tray icon feature not supported on this platform. Sorry!"); } } catch (Throwable t) { addFormError("Warning: unable to contact the systray manager - " + t.getMessage()); @@ -107,9 +105,9 @@ public class ConfigServiceHandler extends FormHandler { SysTray tray = SysTray.getInstance(); if (tray != null) { tray.hide(); - addFormNotice("Systray disabled"); + addFormNotice("System tray icon disabled."); } else { - addFormNotice("Systray not supported on this platform"); + addFormNotice("System tray icon feature not supported on this platform. Sorry!"); } } catch (Throwable t) { addFormError("Warning: unable to contact the systray manager - " + t.getMessage()); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHandler.java index 00a384e73f711f73c44bab35ed00a7ccc52413ee..1d34a5db42fd6cd30c99caf766936eb5aaa016f1 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHandler.java @@ -28,6 +28,7 @@ public class ConfigStatsHandler extends FormHandler { _isFull = false; } + @Override protected void processForm() { saveChanges(); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java index a583c3ed4243c65f7ff6aeda8872656535f2b85d..9712d53f7b4d4df8da419d4c5e0d34463d65831b 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java @@ -8,7 +8,6 @@ import java.util.Map; import java.util.Set; import java.util.StringTokenizer; -import net.i2p.router.RouterContext; import net.i2p.stat.FrequencyStat; import net.i2p.stat.Rate; import net.i2p.stat.RateStat; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHandler.java index 0e59380e19aa565a7354757bde0f3c1abd64c91a..e54c926168f86c1241f711ce357d2b6b27c19382 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHandler.java @@ -14,7 +14,7 @@ import net.i2p.util.Log; * */ public class ConfigTunnelsHandler extends FormHandler { - private Log _log; + private Log configTunnel_log; private Map _settings; private boolean _shouldSave; @@ -22,6 +22,7 @@ public class ConfigTunnelsHandler extends FormHandler { _shouldSave = false; } + @Override protected void processForm() { if (_shouldSave) { saveChanges(); @@ -43,11 +44,11 @@ public class ConfigTunnelsHandler extends FormHandler { * */ private void saveChanges() { - _log = _context.logManager().getLog(ConfigTunnelsHandler.class); + configTunnel_log = _context.logManager().getLog(ConfigTunnelsHandler.class); boolean saveRequired = false; - if (_log.shouldLog(Log.DEBUG)) - _log.debug("Saving changes, with props = " + _settings + "."); + if (configTunnel_log.shouldLog(Log.DEBUG)) + configTunnel_log.debug("Saving changes, with props = " + _settings + "."); int updated = 0; int index = 0; @@ -110,16 +111,16 @@ public class ConfigTunnelsHandler extends FormHandler { } if ("exploratory".equals(poolName)) { - if (_log.shouldLog(Log.DEBUG)) { - _log.debug("Inbound exploratory settings: " + in); - _log.debug("Outbound exploratory settings: " + out); + if (configTunnel_log.shouldLog(Log.DEBUG)) { + configTunnel_log.debug("Inbound exploratory settings: " + in); + configTunnel_log.debug("Outbound exploratory settings: " + out); } _context.tunnelManager().setInboundSettings(in); _context.tunnelManager().setOutboundSettings(out); } else { - if (_log.shouldLog(Log.DEBUG)) { - _log.debug("Inbound settings for " + client.toBase64() + ": " + in); - _log.debug("Outbound settings for " + client.toBase64() + ": " + out); + if (configTunnel_log.shouldLog(Log.DEBUG)) { + configTunnel_log.debug("Inbound settings for " + client.toBase64() + ": " + in); + configTunnel_log.debug("Outbound settings for " + client.toBase64() + ": " + out); } _context.tunnelManager().setInboundSettings(client, in); _context.tunnelManager().setOutboundSettings(client, out); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHelper.java index e5e0a29225267ac14bebc49512806cd76ec89af0..0a7bc1b0a8bc2190d110ccfe4f496195d1fec3c7 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHelper.java @@ -5,7 +5,6 @@ import java.util.Properties; import java.util.Set; import net.i2p.data.Destination; -import net.i2p.router.RouterContext; import net.i2p.router.TunnelPoolSettings; public class ConfigTunnelsHelper extends HelperBase { @@ -75,7 +74,7 @@ public class ConfigTunnelsHelper extends HelperBase { out.getQuantity() + out.getBackupQuantity() >= WARN_QUANTITY) buf.append("<tr><th colspan=\"3\"><font color=\"red\">PERFORMANCE WARNING - Settings include high tunnel quantities.</font></th></tr>"); -buf.append("<tr><th></th><th><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound Tunnels\"/> Inbound</th><th><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound Tunnels\" title=\"Outbound\"/> Outbound</th></tr>\n"); +buf.append("<tr><th></th><th><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound Tunnels\"> Inbound</th><th><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound Tunnels\" title=\"Outbound\"> Outbound</th></tr>\n"); // buf.append("<tr><th></th><th>Inbound</th><th>Outbound</th></tr>\n"); @@ -177,7 +176,7 @@ buf.append("<tr><th></th><th><img src=\"/themes/console/images/inbound.png\" alt buf.append(prop).append("=").append(val).append(" "); } buf.append("\"/></td></tr>\n"); -// buf.append("<tr><td colspan=\"3\"><hr /></td></tr>\n"); +// buf.append("<tr><td colspan=\"3\"><br></td></tr>\n"); } private void renderOptions(StringBuilder buf, int min, int max, int now, String prefix, String name) { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHandler.java index ad7c1622e9d85c6528bfba886c90bc026d6d3db0..f6c1e01349a64ef40cbeadb4d6b96a7e4a35ab78 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHandler.java @@ -5,6 +5,7 @@ public class ConfigUIHandler extends FormHandler { private boolean _shouldSave; private String _config; + @Override protected void processForm() { if (_shouldSave) saveChanges(); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java index 11830975ba7079a5cf8ca9139a6267c1137a1d1a..7815f5cba1e08b2f286156a2475b04357fc3d84f 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java @@ -12,7 +12,7 @@ public class ConfigUIHelper extends HelperBase { buf.append("<input type=\"radio\" class=\"optbox\" name=\"theme\" "); if (theme.equals(current)) buf.append("checked=\"true\" "); - buf.append("value=\"").append(theme).append("\"/>").append(theme).append("<br />\n"); + buf.append("value=\"").append(theme).append("\"/>").append(theme).append("<br>\n"); } return buf.toString(); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java index d0a3fa92c361f657c073796dacf5c5e62cd007e2..080fc115b6bc44dcf87edd8b39f80453035c4664 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java @@ -49,6 +49,7 @@ public class ConfigUpdateHandler extends FormHandler { public static final String PROP_TRUSTED_KEYS = "router.trustedUpdateKeys"; + @Override protected void processForm() { if ("Check for update now".equals(_action)) { NewsFetcher fetcher = NewsFetcher.getInstance(I2PAppContext.getGlobalContext()); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java index 263e989374ce9b3272ab45deec377234ef87dea1..82d8461f15715cb4a1217ee816578bee7c7dc904 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java @@ -3,7 +3,6 @@ package net.i2p.router.web; import net.i2p.I2PAppContext; import net.i2p.crypto.TrustedUpdate; import net.i2p.data.DataHelper; -import net.i2p.router.RouterContext; public class ConfigUpdateHelper extends HelperBase { public ConfigUpdateHelper() {} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java index e9749750cd3de6a2fec8be8f18d910565af36048..c65a6beb3fe33d5932b1594ee5ab1d52cf80bf3f 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java @@ -1,14 +1,12 @@ package net.i2p.router.web; import java.io.IOException; -import java.io.Writer; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.TreeSet; import net.i2p.data.DataHelper; -import net.i2p.router.RouterContext; import net.i2p.stat.Rate; public class GraphHelper extends HelperBase { @@ -68,7 +66,7 @@ public class GraphHelper extends HelperBase { + "&periodCount=" + _periodCount + "&width=" + _width + "&height=" + (_height - 14) - + "\" title=\"Combined bandwidth graph\" /></a>\n"); + + "\" alt=\"Combined bandwidth graph\" title=\"Combined bandwidth graph\"></a>\n"); } for (Iterator iter = ordered.iterator(); iter.hasNext(); ) { @@ -82,7 +80,7 @@ public class GraphHelper extends HelperBase { + "&periodCount=" + (3 * _periodCount) + "&width=" + (3 * _width) + "&height=" + (3 * _height) - + "\" target=\"_blank\" />"); + + "\" target=\"_blank\">"); _out.write("<img class=\"statimage\" border=\"0\" width=\"" + (_width + 83) + "\" height=\"" + (_height + 92) + "\" src=\"viewstat.jsp?stat=" @@ -92,11 +90,12 @@ public class GraphHelper extends HelperBase { + "&periodCount=" + _periodCount + "&width=" + _width + "&height=" + _height - + "\" title=\"" + title + "\" /></a>\n"); + + "\" alt=\"" + title + + "\" title=\"" + title + "\"></a>\n"); } if (_refreshDelaySeconds > 0) // shorten the refresh by 3 seconds so we beat the iframe - _out.write("<meta http-equiv=\"refresh\" content=\"" + (_refreshDelaySeconds - 3) + "\" />\n"); + _out.write("<meta http-equiv=\"refresh\" content=\"" + (_refreshDelaySeconds - 3) + "\">\n"); } catch (IOException ioe) { ioe.printStackTrace(); @@ -105,17 +104,16 @@ public class GraphHelper extends HelperBase { } public String getForm() { try { - _out.write("<hr /><h3>Configure Graph Display</h3>"); - _out.write("<p />[<a href=\"configstats.jsp\">Select Stats to Graph</a>]<p />"); + _out.write("<br><h3>Configure Graph Display [<a href=\"configstats.jsp\">Select Stats</a>]</h3>"); _out.write("<form action=\"graphs.jsp\" method=\"GET\">"); - _out.write("Periods: <input size=\"3\" type=\"text\" name=\"periodCount\" value=\"" + _periodCount + "\" /><br />\n"); - _out.write("Plot averages: <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"false\" " + (_showEvents ? "" : "checked=\"true\" ") + " /> "); - _out.write("or plot events: <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"true\" "+ (_showEvents ? "checked=\"true\" " : "") + " /><br />\n"); + _out.write("Periods: <input size=\"3\" type=\"text\" name=\"periodCount\" value=\"" + _periodCount + "\"><br>\n"); + _out.write("Plot averages: <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"false\" " + (_showEvents ? "" : "checked=\"true\" ") + "> "); + _out.write("or plot events: <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"true\" "+ (_showEvents ? "checked=\"true\" " : "") + "><br>\n"); _out.write("Image sizes: width: <input size=\"4\" type=\"text\" name=\"width\" value=\"" + _width - + "\" /> pixels, height: <input size=\"4\" type=\"text\" name=\"height\" value=\"" + _height - + "\" /><br />\n"); - _out.write("Refresh delay: <select name=\"refreshDelay\"><option value=\"60\">1 minute</option><option value=\"120\">2 minutes</option><option value=\"300\">5 minutes</option><option value=\"600\">10 minutes</option><option value=\"1800\">30 minutes</option><option value=\"3600\">1 hour</option><option value=\"-1\">Never</option></select><br />\n"); - _out.write("<hr /><div class=\"formaction\"><input type=\"submit\" value=\"Redraw\" /></div></div>"); + + "\"> pixels, height: <input size=\"4\" type=\"text\" name=\"height\" value=\"" + _height + + "\"><br>\n"); + _out.write("Refresh delay: <select name=\"refreshDelay\"><option value=\"60\">1 minute</option><option value=\"120\">2 minutes</option><option value=\"300\">5 minutes</option><option value=\"600\">10 minutes</option><option value=\"1800\">30 minutes</option><option value=\"3600\">1 hour</option><option value=\"-1\">Never</option></select><br>\n"); + _out.write("<hr><div class=\"formaction\"><input type=\"submit\" value=\"Redraw\"></div></form>"); } catch (IOException ioe) { ioe.printStackTrace(); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/JobQueueHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/JobQueueHelper.java index cf8ed23520e12ce2d4c85209533e543e96263260..633e7db9fdba2f74678dcc419d935cb17dfd7019 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/JobQueueHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/JobQueueHelper.java @@ -3,9 +3,7 @@ package net.i2p.router.web; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; -import java.io.Writer; -import net.i2p.router.RouterContext; public class JobQueueHelper extends HelperBase { public JobQueueHelper() {} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java index ca1712f1c6146c3168a7c8b35ba1192babb5503b..f51c4e772dce1f209096d85ed4f5e48db0c0caef 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java @@ -10,7 +10,7 @@ public class LogsHelper extends HelperBase { public String getLogs() { String str = formatMessages(_context.logManager().getBuffer().getMostRecentMessages()); - return "Location: <code>" + _context.logManager().currentFile() + "</code><br /><br />" + str; + return "Location: <code>" + _context.logManager().currentFile() + "</code><br><br>" + str; } public String getCriticalLogs() { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NavHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/NavHelper.java index 1ae3029326abbee92c067fac548d36075a819cd2..cabb68f156e99c866798de28342684d251439d29 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NavHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NavHelper.java @@ -4,7 +4,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import net.i2p.router.RouterContext; public class NavHelper extends HelperBase { private static Map _apps = new HashMap(); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NetDbHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/NetDbHelper.java index 886ba6abb6dda80e96c60a736ed444debf83a61e..cffe6f1a7876838ce8fe5f5761c0d4bb53f2bb9e 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NetDbHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NetDbHelper.java @@ -3,9 +3,7 @@ package net.i2p.router.web; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; -import java.io.Writer; -import net.i2p.router.RouterContext; public class NetDbHelper extends HelperBase { private String _routerPrefix; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/OldConsoleHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/OldConsoleHelper.java index f7aa130647de24457f58ae1dd03e07afce8f795c..b88187681d38c31ec29596f2240e9188a7b390ab 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/OldConsoleHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/OldConsoleHelper.java @@ -3,9 +3,7 @@ package net.i2p.router.web; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; -import java.io.Writer; -import net.i2p.router.RouterContext; public class OldConsoleHelper extends HelperBase { public OldConsoleHelper() {} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/PeerHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/PeerHelper.java index 2504067ac3a484ccf35aa28c853810acc97f5139..0648f4c42a4e70452dc5bc557d3447b91a62f886 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/PeerHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/PeerHelper.java @@ -1,9 +1,7 @@ package net.i2p.router.web; import java.io.IOException; -import java.io.Writer; -import net.i2p.router.RouterContext; public class PeerHelper extends HelperBase { private int _sortFlags; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ProfilesHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ProfilesHelper.java index 702a63e50013d14fefd1f1a468f2253eaf9c965d..ce2242aa7156e7e014eecccd232437546ccdfb8d 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ProfilesHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ProfilesHelper.java @@ -4,7 +4,6 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; -import net.i2p.router.RouterContext; public class ProfilesHelper extends HelperBase { public ProfilesHelper() {} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/StatHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/StatHelper.java index ce6fefd5d677ab2ea860aa4d783f437d6092e5b2..2b7e81fb41e63a59568a7bee4535fced155351c4 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/StatHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/StatHelper.java @@ -1,6 +1,5 @@ package net.i2p.router.web; -import java.io.Writer; import java.util.Iterator; import java.util.Set; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/StatsGenerator.java b/apps/routerconsole/java/src/net/i2p/router/web/StatsGenerator.java index 3838245f5e4c7733b72acc82a595b793bd68e78f..983a6ba8bf4d0757dca47e88cd5845a65875ae86 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/StatsGenerator.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/StatsGenerator.java @@ -80,7 +80,7 @@ public class StatsGenerator { buf.append(stat); buf.append("\">"); buf.append(stat); - buf.append("</a></b><br />"); + buf.append("</a></b><br>"); if (_context.statManager().isFrequency(stat)) renderFrequency(stat, buf); else @@ -88,7 +88,7 @@ public class StatsGenerator { out.write(buf.toString()); buf.setLength(0); } - out.write("</ul><hr />"); + out.write("</ul><br>"); } out.flush(); } @@ -97,7 +97,7 @@ public class StatsGenerator { FrequencyStat freq = _context.statManager().getFrequency(name); buf.append("<i>"); buf.append(freq.getDescription()); - buf.append("</i><br />"); + buf.append("</i><br>"); long uptime = _context.router().getUptime(); long periods[] = freq.getPeriods(); Arrays.sort(periods); @@ -124,9 +124,9 @@ public class StatsGenerator { buf.append(" using the lifetime of "); buf.append(curFreq.getEventCount()); buf.append(" events)"); - buf.append("<br />"); + buf.append("<br>"); } - buf.append("<br />"); + buf.append("<br>"); } private void renderRate(String name, StringBuilder buf) { @@ -135,10 +135,10 @@ public class StatsGenerator { if (! "".equals(d)) { buf.append("<i>"); buf.append(d); - buf.append("</i><br />"); + buf.append("</i><br>"); } if (rate.getLifetimeEventCount() <= 0) { - buf.append("No lifetime events<br /> <br />"); + buf.append("No lifetime events<br> <br>"); return; } long now = _context.clock().now(); @@ -217,9 +217,9 @@ public class StatsGenerator { buf.append(num(rate.getLifetimeAverageValue())); buf.append(" over "); buf.append(rate.getLifetimeEventCount()); - buf.append(" events<br /></li>"); + buf.append(" events<br></li>"); buf.append("</ul>"); - buf.append("<br />"); + buf.append("<br>"); } private static void renderPeriod(StringBuilder buf, long period, String name) { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 6a1473d48a7adeef4c2d737534325860594446a8..938fb33d7b64db828f8aecc89b9cc2d090ce6326 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -1,15 +1,12 @@ package net.i2p.router.web; import java.text.Collator; -import java.text.DateFormat; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import java.util.Date; import java.util.Iterator; import java.util.List; -import java.util.Locale; import net.i2p.data.DataHelper; import net.i2p.data.Destination; @@ -18,7 +15,6 @@ import net.i2p.data.LeaseSet; import net.i2p.data.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.TunnelPoolSettings; import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade; @@ -367,32 +363,32 @@ public class SummaryHelper extends HelperBase { String name = getName(client); Hash h = client.calculateHash(); - buf.append("<tr><td align=\"right\"><b><img src=\"/themes/console/images/"); + buf.append("<tr><td align=\"right\"><img src=\"/themes/console/images/"); if (_context.clientManager().shouldPublishLeaseSet(h)) - buf.append("server.png\" alt=\"Server\" title=\"Server\" />"); + buf.append("server.png\" alt=\"Server\" title=\"Server\">"); else - buf.append("client.png\" alt=\"Client\" title=\"Client\" />"); - buf.append("</td><td align=\"left\"><a href=\"tunnels.jsp#").append(h.toBase64().substring(0,4)); + buf.append("client.png\" alt=\"Client\" title=\"Client\">"); + buf.append("</td><td align=\"left\"><b><a href=\"tunnels.jsp#").append(h.toBase64().substring(0,4)); buf.append("\" target=\"_top\" title=\"Show tunnels\">"); if (name.length() < 16) buf.append(name); else buf.append(name.substring(0,15)).append("…"); - buf.append("</a></td>\n"); + buf.append("</a></b></td>\n"); LeaseSet ls = _context.netDb().lookupLeaseSetLocally(h); if (ls != null) { long timeToExpire = ls.getEarliestLeaseDate() - _context.clock().now(); if (timeToExpire < 0) { // red or yellow light - buf.append("<td align=\right\"><img src=\"/themes/console/images/local_inprogress.png\" alt=\"Rebuilding…\" title=\"Leases expired ").append(DataHelper.formatDuration(0-timeToExpire)); - buf.append(" ago. Rebuilding..\"></td></tr>\n"); + buf.append("<td><img src=\"/themes/console/images/local_inprogress.png\" alt=\"Rebuilding…\" title=\"Leases expired ").append(DataHelper.formatDuration(0-timeToExpire)); + buf.append(" ago. Rebuilding…\"></td></tr>\n"); } else { // green light - buf.append("<td align=\right\"><img src=\"/themes/console/images/local_up.png\" alt=\"Ready\" title=\"Ready\"></td></tr>\n"); + buf.append("<td><img src=\"/themes/console/images/local_up.png\" alt=\"Ready\" title=\"Ready\"></td></tr>\n"); } } else { // yellow light - buf.append("<td align=\right\"><img src=\"/themes/console/images/local_inprogress.png\" alt=\"Building…\" title=\"Tunnel building in progress…\"></td></tr>\n"); + buf.append("<td><img src=\"/themes/console/images/local_inprogress.png\" alt=\"Building…\" title=\"Tunnel building in progress…\"></td></tr>\n"); } } buf.append("</table><hr>\n"); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryListener.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryListener.java index 6ef9df9db43dc9154a9e8ba10deea9ec5718c36e..a7d1995dc69cb1e8b2fd7b749473d2895f8d720c 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryListener.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryListener.java @@ -132,9 +132,11 @@ class SummaryListener implements RateSummaryListener { RrdDb getData() { return _db; } long now() { return _context.clock().now(); } + @Override public boolean equals(Object obj) { return ((obj instanceof SummaryListener) && ((SummaryListener)obj)._rate.equals(_rate)); } + @Override public int hashCode() { return _rate.hashCode(); } } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/TunnelHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/TunnelHelper.java index 3cd8a96e3d03d99694679394274195758a3bed12..b605cbf361bc1efd8da3485395cc69d39bbd8f4c 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/TunnelHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/TunnelHelper.java @@ -3,9 +3,7 @@ package net.i2p.router.web; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; -import java.io.Writer; -import net.i2p.router.RouterContext; public class TunnelHelper extends HelperBase { public TunnelHelper() {} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/UnsignedUpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/UnsignedUpdateHandler.java index a89a7a05c7e7f7e60b1e1ec2532e9c2eb75a0ce9..7fe42a3ba4ae2fdeb19176bfef60328a0d7fa520 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/UnsignedUpdateHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/UnsignedUpdateHandler.java @@ -2,7 +2,6 @@ package net.i2p.router.web; import java.io.File; -import net.i2p.I2PAppContext; import net.i2p.router.Router; import net.i2p.router.RouterContext; import net.i2p.util.EepGet; @@ -109,11 +108,11 @@ public class UnsignedUpdateHandler extends UpdateHandler { _context.router().saveConfig(); if ("install".equals(policy)) { _log.log(Log.CRIT, "Update was downloaded, restarting to install it"); - _status = "<b>Update downloaded</b><br />Restarting"; + _status = "<b>Update downloaded</b><br>Restarting"; restart(); } else { _log.log(Log.CRIT, "Update was downloaded, will be installed at next restart"); - _status = "<b>Update downloaded</b><br />"; + _status = "<b>Update downloaded</b><br>"; if (System.getProperty("wrapper.version") != null) _status += "Click Restart to install"; else diff --git a/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java index 293743bbbc6c71b0713dd619be8ad2d576021676..43cb6850fc2f8347d8e2800f29d4074604101459 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java @@ -201,11 +201,11 @@ public class UpdateHandler { _context.router().saveConfig(); if ("install".equals(policy)) { _log.log(Log.CRIT, "Update was VERIFIED, restarting to install it"); - _status = "<b>Update verified</b><br />Restarting"; + _status = "<b>Update verified</b><br>Restarting"; restart(); } else { _log.log(Log.CRIT, "Update was VERIFIED, will be installed at next restart"); - _status = "<b>Update downloaded</b><br />"; + _status = "<b>Update downloaded</b><br>"; if (System.getProperty("wrapper.version") != null) _status += "Click Restart to install"; else diff --git a/apps/routerconsole/jsp/config.jsp b/apps/routerconsole/jsp/config.jsp index b91a1ce245ce3d0dcd4280cc283b9718bdfd6ec2..c371624db8f83513865dc8880fb768e290ceab8b 100644 --- a/apps/routerconsole/jsp/config.jsp +++ b/apps/routerconsole/jsp/config.jsp @@ -13,7 +13,7 @@ <h1>I2P Network Configuration</h1> <div class="main" id="main"> <%@include file="confignav.jsp" %> - + <jsp:useBean class="net.i2p.router.web.ConfigNetHandler" id="formhandler" scope="request" /> <jsp:setProperty name="formhandler" property="*" /> <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> @@ -25,45 +25,42 @@ System.setProperty("net.i2p.router.web.ConfigNetHandler.nonce", new java.util.Random().nextLong()+""); %> <input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigNetHandler.nonce")%>" /> <input type="hidden" name="action" value="blah" /> - <h3>Bandwidth limiter</h3> - <p> + <h3>Bandwidth limiter</h3><p> <b>I2P will work best if you configure your rates to match the speed of your internet connection.</b> - </p> -<p> - <div class="wideload"> - <table> - <tr><td><input style="text-align: right; width: 5em;" name="inboundrate" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="inboundRate" />" /> KBps - In <td>(<jsp:getProperty name="nethelper" property="inboundRateBits" />)<br /> + </p><p> + <div class="wideload"><table><tr><td><input style="text-align: right; width: 5em;" name="inboundrate" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="inboundRate" />" /> KBps In + </td><td>(<jsp:getProperty name="nethelper" property="inboundRateBits" />)</td> <!-- let's keep this simple... - bursting up to + bursting up to <input name="inboundburstrate" type="text" size="5" value="<jsp:getProperty name="nethelper" property="inboundBurstRate" />" /> KBps for - <jsp:getProperty name="nethelper" property="inboundBurstFactorBox" /><br /> + <jsp:getProperty name="nethelper" property="inboundBurstFactorBox" /><br> --> - <tr><td><input style="text-align: right; width: 5em;" name="outboundrate" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="outboundRate" />" /> KBps - Out <td>(<jsp:getProperty name="nethelper" property="outboundRateBits" />)<br /> + </tr><tr> + <td><input style="text-align: right; width: 5em;" name="outboundrate" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="outboundRate" />" /> KBps Out + </td><td>(<jsp:getProperty name="nethelper" property="outboundRateBits" />)</td> <!-- let's keep this simple... - bursting up to + bursting up to <input name="outboundburstrate" type="text" size="2" value="<jsp:getProperty name="nethelper" property="outboundBurstRate" />" /> KBps for - <jsp:getProperty name="nethelper" property="outboundBurstFactorBox" /><br /> - <i>KBps = kilobytes per second = 1024 bytes per second = 8192 bits per second.<br /> - A negative rate sets the default.</i><br /> + <jsp:getProperty name="nethelper" property="outboundBurstFactorBox" /><br> + <i>KBps = kilobytes per second = 1024 bytes per second = 8192 bits per second.<br> + A negative rate sets the default.</i><br> --> - <tr><td><jsp:getProperty name="nethelper" property="sharePercentageBox" /> - Share <td>(<jsp:getProperty name="nethelper" property="shareRateBits" />)<br /> - </table></div> - </p><p> + </tr><tr> + <td><jsp:getProperty name="nethelper" property="sharePercentageBox" /> Share</td> + <td>(<jsp:getProperty name="nethelper" property="shareRateBits" />) +</td></tr></table></div></p><p> <% int share = nethelper.getShareBandwidth(); if (share < 12) { out.print("<b>NOTE</b>: You have configured I2P to share only " + share + "KBps. "); out.print("I2P requires at least 12KBps to enable sharing. "); out.print("Please enable sharing (participating in tunnels) by configuring more bandwidth. "); - out.print("It improves your anonymity by creating cover traffic, and helps the network.<br />"); + out.print("It improves your anonymity by creating cover traffic, and helps the network.<br>"); } else { out.print("You have configured I2P to share<b> " + share + "KBps</b>. "); - out.print("The higher the share bandwidth the more you improve your anonymity and help the network.<hr />"); + out.print("The higher the share bandwidth the more you improve your anonymity and help the network.<hr>"); } %> - </p><div class="formaction"> +</p><div class="formaction"> <input type="submit" name="save" value="Save changes" /> <input type="reset" value="Cancel" /></div> <!-- <b>Enable load testing: </b> @@ -71,28 +68,25 @@ <p>If enabled, your router will periodically anonymously probe some of your peers to see what sort of throughput they can handle. This improves your router's ability to pick faster peers, but can cost substantial bandwidth. Relevant data from the - load testing is fed into the profiles as well as the + load testing is fed into the profiles as well as the <a href="oldstats.jsp#test.rtt">test.rtt</a> and related stats.</p> - <hr /> + <br> --> - <h3>IP and Transport Configuration</h3> - <p> + <h3>IP and Transport Configuration</h3><p> <b>The default settings will work for most people. There is <a href="#chelp">help below</a>.</b> - </p><p> - <b>UPnP Configuration:</b><br /> + </p><p><b>UPnP Configuration:</b><br> <input type="checkbox" class="optbox" name="upnp" value="true" <jsp:getProperty name="nethelper" property="upnpChecked" /> /> Enable UPnP to open firewall ports - <a href="peers.jsp#upnp">UPnP status</a> - </p><p> - <b>IP Configuration:</b><br /> - Externally reachable hostname or IP address:<br /> + </p><p><b>IP Configuration:</b><br> + Externally reachable hostname or IP address:<br> <input type="radio" class="optbox" name="udpAutoIP" value="local,upnp,ssu" <%=nethelper.getUdpAutoIPChecked(3) %> /> - Use all auto-detect methods<br /> + Use all auto-detect methods<br> <input type="radio" class="optbox" name="udpAutoIP" value="local,ssu" <%=nethelper.getUdpAutoIPChecked(4) %> /> - Disable UPnP IP address detection<br /> + Disable UPnP IP address detection<br> <input type="radio" class="optbox" name="udpAutoIP" value="upnp,ssu" <%=nethelper.getUdpAutoIPChecked(5) %> /> - Ignore local interface IP address<br /> + Ignore local interface IP address<br> <input type="radio" class="optbox" name="udpAutoIP" value="ssu" <%=nethelper.getUdpAutoIPChecked(0) %> /> - Use SSU IP address detection only<br /> + Use SSU IP address detection only<br> <input type="radio" class="optbox" name="udpAutoIP" value="fixed" <%=nethelper.getUdpAutoIPChecked(1) %> /> Specify hostname or IP: <input name ="udpHost1" type="text" size="16" value="<jsp:getProperty name="nethelper" property="udphostname" />" /> @@ -109,52 +103,47 @@ out.print("</select>\n"); } %> - <br /> + <br> <input type="radio" class="optbox" name="udpAutoIP" value="hidden" <%=nethelper.getUdpAutoIPChecked(2) %> /> - Hidden mode - do not publish IP <i>(prevents participating traffic)</i><br /> - </p><p> - <b>UDP Configuration:</b><br /> + Hidden mode - do not publish IP <i>(prevents participating traffic)</i><br> + </p><p><b>UDP Configuration:</b><br> UDP port: - <input name ="udpPort" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="configuredUdpPort" />" /><br /> + <input name ="udpPort" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="configuredUdpPort" />" /><br> <!-- let's keep this simple... <input type="checkbox" class="optbox" name="requireIntroductions" value="true" <jsp:getProperty name="nethelper" property="requireIntroductionsChecked" /> /> Require SSU introductions <i>(Enable if you cannot open your firewall)</i> </p><p> - Current External UDP address: <i><jsp:getProperty name="nethelper" property="udpAddress" /></i><br /> + Current External UDP address: <i><jsp:getProperty name="nethelper" property="udpAddress" /></i><br> --> </p><p> - <b>TCP Configuration:</b><br /> - Externally reachable hostname or IP address:<br /> + <b>TCP Configuration:</b><br> + Externally reachable hostname or IP address:<br> <input type="radio" class="optbox" name="ntcpAutoIP" value="true" <%=nethelper.getTcpAutoIPChecked(2) %> /> Use auto-detected IP address <i>(currently <jsp:getProperty name="nethelper" property="udpIP" />)</i> - if we are not firewalled<br /> + if we are not firewalled<br> <input type="radio" class="optbox" name="ntcpAutoIP" value="always" <%=nethelper.getTcpAutoIPChecked(3) %> /> - Always use auto-detected IP address (Not firewalled)<br /> + Always use auto-detected IP address (Not firewalled)<br> <input type="radio" class="optbox" name="ntcpAutoIP" value="false" <%=nethelper.getTcpAutoIPChecked(1) %> /> Specify hostname or IP: - <input name ="ntcphost" type="text" size="16" value="<jsp:getProperty name="nethelper" property="ntcphostname" />" /><br /> + <input name ="ntcphost" type="text" size="16" value="<jsp:getProperty name="nethelper" property="ntcphostname" />" /><br> <input type="radio" class="optbox" name="ntcpAutoIP" value="false" <%=nethelper.getTcpAutoIPChecked(0) %> /> - Disable inbound (Firewalled)<br /> + Disable inbound (Firewalled)<br> <input type="radio" class="optbox" name="ntcpAutoIP" value="disabled" <%=nethelper.getTcpAutoIPChecked(4) %> /> - Completely disable <i>(select only if behind a firewall that throttles or blocks outbound TCP)</i><br /> + Completely disable <i>(select only if behind a firewall that throttles or blocks outbound TCP)</i><br> </p><p> - Externally reachable TCP port:<br /> + Externally reachable TCP port:<br> <input type="radio" class="optbox" name="ntcpAutoPort" value="2" <%=nethelper.getTcpAutoPortChecked(2) %> /> Use the same port configured for UDP - <i>(currently <jsp:getProperty name="nethelper" property="udpPort" />)</i><br /> + <i>(currently <jsp:getProperty name="nethelper" property="udpPort" />)</i><br> <input type="radio" class="optbox" name="ntcpAutoPort" value="1" <%=nethelper.getTcpAutoPortChecked(1) %> /> Specify Port: - <input name ="ntcpport" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="ntcpport" />" /><br /> - </p><p><b>Note: Changing these settings will restart your router.</b> - </p><hr><div class="formaction"> + <input name ="ntcpport" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="ntcpport" />" /><br> + </p><p><b>Note: Changing these settings will restart your router.</b></p> +<hr><div class="formaction"> <input type="submit" name="save" value="Save changes" /> <input type="reset" value="Cancel" /> -</div> -</div> -<h3><a name="chelp">Configuration Help:</a></h3> - <div align="justify"> - <p> +</div><h3><a name="chelp">Configuration Help:</a></h3><div align="justify"><p> While I2P will work fine behind most firewalls, your speeds and network integration will generally improve if the I2P port (generally 8887) is forwarded for both UDP and TCP. </p><p> @@ -166,30 +155,30 @@ </p> <!-- let's keep this simple... <input type="submit" name="recheckReachability" value="Check network reachability..." /> +</p> --> - </p><p> +<p> UPnP is used to communicate with Internet Gateway Devices (IGDs) to detect the external IP address and forward ports. UPnP support is beta, and may not work for any number of reasons: - <ul> +<ul> <li class="tidylist">No UPnP-compatible device present <li class="tidylist">UPnP disabled on the device <li class="tidylist">Software firewall interference with UPnP <li class="tidylist">Bugs in the device's UPnP implementation <li class="tidylist">Multiple firewall/routers in the internet connection path <li class="tidylist">UPnP device change, reset, or address change - </ul><br> +</ul><br> Reviewing the <a href="peers.jsp#upnp">UPnP status</a> may help. UPnP may be enabled or disabled above, but a change requires a router restart to take effect. - </p><p>Hostnames entered above will be published in the network database. +</p><p>Hostnames entered above will be published in the network database. They are <b>not private</b>. Also, <b>do not enter a private IP address</b> like 127.0.0.1 or 192.168.1.1. If you specify the wrong IP address or hostname, or do not properly configure your NAT or firewall, your network performance will degrade - substantially. When in doubt, leave the settings at the defaults.</p> - </p> -<h3><a name="help">Reachability Help:</a></h3> - <p> + substantially. When in doubt, leave the settings at the defaults. +</p> +<h3><a name="help">Reachability Help:</a></h3><p> While I2P will work fine behind most firewalls, your speeds and network integration will generally improve if the I2P port (generally 8887) to both UDP and TCP. If you think you have opened up your firewall and I2P still thinks you are firewalled, remember @@ -244,19 +233,17 @@ <li class="tidylist"><b>ERR - Client Manager I2CP Error - check logs</b> - This is usually due to a port 7654 conflict. Check the logs to verify. Do you have another I2P instance running? Stop the conflicting program and restart I2P. - </ul> - </p> - <hr /> + </ul></p><br> <!-- <b>Dynamic Router Keys: </b> - <input type="checkbox" class="optbox" name="dynamicKeys" value="true" <jsp:getProperty name="nethelper" property="dynamicKeysChecked" /> /><br /> + <input type="checkbox" class="optbox" name="dynamicKeys" value="true" <jsp:getProperty name="nethelper" property="dynamicKeysChecked" /> /><br> <p> This setting causes your router identity to be regenerated every time your IP address changes. If you have a dynamic IP this option can speed up your reintegration into the network (since people will have shitlisted your old router identity), and, for very weak adversaries, help frustrate trivial <a href="http://www.i2p.net/how_threatmodel#intersection">intersection - attacks</a> against the NetDB. Your different router identities would only be + attacks</a> against the NetDB. Your different router identities would only be 'hidden' among other I2P users at your ISP, and further analysis would link the router identities further.</p> <p>Note that when I2P detects an IP address change, it will automatically @@ -264,10 +251,6 @@ update their profiles - any long lasting client connections will be disconnected, though such would likely already be the case anyway, since the IP address changed. </p> - <hr /> + <br> --> - </form> -</div> -</div> -</body> -</html> +</div></form></div></div></body></html> diff --git a/apps/routerconsole/jsp/configadvanced.jsp b/apps/routerconsole/jsp/configadvanced.jsp index 6fe8723dc5d55a43ee5bc71c132dcd8da577335e..00e4a193a19030fe0254466f329f0f3e5c140be9 100644 --- a/apps/routerconsole/jsp/configadvanced.jsp +++ b/apps/routerconsole/jsp/configadvanced.jsp @@ -2,8 +2,7 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - config advanced</title> +<html><head><title>I2P Router Console - config advanced</title> <%@include file="css.jsp" %> </head><body> @@ -30,15 +29,9 @@ <input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigAdvancedHandler.nonce")%>" /> <input type="hidden" name="action" value="blah" /> <h3>Advanced I2P Configuration</h3> - <textarea rows="32" cols="60" name="config" wrap="off"><jsp:getProperty name="advancedhelper" property="settings" /></textarea><br /><hr> - <div class="formaction"> + <textarea rows="32" cols="60" name="config" wrap="off"><jsp:getProperty name="advancedhelper" property="settings" /></textarea><br><hr> + <div class="formaction"> <input type="submit" name="shouldsave" value="Apply" /> - <input type="reset" value="Cancel" /><br /> + <input type="reset" value="Cancel" /><br> <b>NOTE:</b> Some changes may require a restart to take effect. - </div> - </form> -</div> -</div> -</div> -</body> -</html> + </div></form></div></div></div></body></html> diff --git a/apps/routerconsole/jsp/configclients.jsp b/apps/routerconsole/jsp/configclients.jsp index 3cd7f4c7684f3189b45449a8a2af72dbb99b9a00..81efcd76b64d41dfc196d7fbe04971f5f727d40a 100644 --- a/apps/routerconsole/jsp/configclients.jsp +++ b/apps/routerconsole/jsp/configclients.jsp @@ -2,15 +2,13 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - config clients</title> +<html><head><title>I2P Router Console - config clients</title> <%@include file="css.jsp" %> <style type='text/css'> button span.hide{ display:none; } -</style> -</head><body> +</style></head><body> <%@include file="summary.jsp" %> @@ -19,33 +17,28 @@ button span.hide{ <h1>I2P Client Configuration</h1> <div class="main" id="main"> <%@include file="confignav.jsp" %> - + <jsp:useBean class="net.i2p.router.web.ConfigClientsHandler" id="formhandler" scope="request" /> <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:setProperty name="formhandler" property="action" value="<%=request.getParameter("action")%>" /> <jsp:setProperty name="formhandler" property="nonce" value="<%=request.getParameter("nonce")%>" /> <jsp:setProperty name="formhandler" property="settings" value="<%=request.getParameterMap()%>" /> <jsp:getProperty name="formhandler" property="allMessages" /> - <div class="configure"> - <form action="configclients.jsp" method="POST"> + <div class="configure"><form action="configclients.jsp" method="POST"> <% String prev = System.getProperty("net.i2p.router.web.ConfigClientsHandler.nonce"); if (prev != null) System.setProperty("net.i2p.router.web.ConfigClientsHandler.noncePrev", prev); System.setProperty("net.i2p.router.web.ConfigClientsHandler.nonce", new java.util.Random().nextLong()+""); %> <input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigClientsHandler.nonce")%>" /> - <h3>Client Configuration</h3> - <p> + <h3>Client Configuration</h3><p> The Java clients listed below are started by the router and run in the same JVM. - </p><p> <div class="wideload"> - <jsp:getProperty name="clientshelper" property="form1" /> - </p><p> - <i>To change other client options, edit the file + </p><div class="wideload"> + <p><jsp:getProperty name="clientshelper" property="form1" /> + </p><p><i>To change other client options, edit the file <%=net.i2p.router.startup.ClientAppConfig.configFile(net.i2p.I2PAppContext.getGlobalContext()).getAbsolutePath()%>. All changes require restart to take effect.</i> - </p> <hr /><div class="formaction"> + </p><hr><div class="formaction"> <input type="submit" name="action" value="Save Client Configuration" /> -</div></div> - <h3>WebApp Configuration</h3> - <p> +</div></div><h3>WebApp Configuration</h3><p> The Java web applications listed below are started by the webConsole client and run in the same JVM as the router. They are usually web applications accessible through the router console. They may be complete applications (e.g. i2psnark), @@ -55,18 +48,10 @@ All changes require restart to take effect.</i> A web app may also be disabled by removing the .war file from the webapps directory; however the .war file and web app will reappear when you update your router to a newer version, so disabling the web app here is the preferred method. - </p><p><div class="wideload"> + </p><div class="wideload"><p> <jsp:getProperty name="clientshelper" property="form2" /> - </p> - <p> + </p><p> <i>All changes require restart to take effect.</i> - </p> - <hr><div class="formaction"> + </p><hr><div class="formaction"> <input type="submit" name="action" value="Save WebApp Configuration" /> - </div> - </form> -</div> -</div> -</div> -</body> -</html> + </div></div></form></div></div></body></html> diff --git a/apps/routerconsole/jsp/configkeyring.jsp b/apps/routerconsole/jsp/configkeyring.jsp index 7e58f4a15630f1a0087e1cd00a9ca179284ed3c3..88957858de8804eef8e937895edd686555919eca 100644 --- a/apps/routerconsole/jsp/configkeyring.jsp +++ b/apps/routerconsole/jsp/configkeyring.jsp @@ -2,8 +2,7 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - config keyring</title> +<html><head><title>I2P Router Console - config keyring</title> <%@include file="css.jsp" %> </head><body> @@ -16,21 +15,16 @@ <jsp:setProperty name="formhandler" property="*" /> <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:getProperty name="formhandler" property="allMessages" /> - - - <jsp:useBean class="net.i2p.router.web.ConfigKeyringHelper" id="keyringhelper" scope="request" /> <jsp:setProperty name="keyringhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> -<div class="configure"> - <p> - <h3>Keyring</h3> +<div class="configure"><p><h3>Keyring</h3> The router keyring is used to decrypt encrypted leaseSets. The keyring may contain keys for local or remote encrypted destinations. - <div class="wideload"><p> + <div class="wideload"><p> <jsp:getProperty name="keyringhelper" property="summary" /> </p></div> - <hr /> + <br> <form action="configkeyring.jsp" method="POST"> <% String prev = System.getProperty("net.i2p.router.web.ConfigKeyringHandler.nonce"); @@ -41,23 +35,14 @@ Enter keys for encrypted remote destinations here. Keys for local destinations must be entered on the <a href="i2ptunnel/index.jsp">I2PTunnel page</a>. <p> - <div class="wideload"> - <table> - <tr> - <td class="mediumtags" align="right">Dest. name, hash, or full key:</td> - <td><textarea name="peer" cols="44" rows="1" style="height: 3em;" wrap="off"></textarea></td> - <tr> - <td class="mediumtags" align="right">Session Key:</td> - <td><input type="text" size="55" name="key" /></td> - <tr> - <td> - <td align="right"> - <input type="submit" name="action" value="Add key" /></td> - </table> - </form> - -</div> -</div> -</div> -</body> -</html> + <div class="wideload"> + <table><tr> + <td class="mediumtags" align="right">Dest. name, hash, or full key:</td> + <td><textarea name="peer" cols="44" rows="1" style="height: 3em;" wrap="off"></textarea></td> + </tr><tr> + <td class="mediumtags" align="right">Session Key:</td> + <td><input type="text" size="55" name="key" /></td> + </tr><tr> + <td></td> + <td align="right"><input type="submit" name="action" value="Add key" /></td> +</tr></table></div></form></div></div></body></html> diff --git a/apps/routerconsole/jsp/configlogging.jsp b/apps/routerconsole/jsp/configlogging.jsp index 432acdfb87cf662e535cf4d7c6ca9e9a3c2e0209..b4a08ee19c8f766e44935f60aba5c9d3f0a04175 100644 --- a/apps/routerconsole/jsp/configlogging.jsp +++ b/apps/routerconsole/jsp/configlogging.jsp @@ -18,7 +18,7 @@ <jsp:setProperty name="formhandler" property="*" /> <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:getProperty name="formhandler" property="allMessages" /> -<div class="configure"> +<div class="configure"> <form action="configlogging.jsp" method="POST"> <% String prev = System.getProperty("net.i2p.router.web.ConfigLoggingHandler.nonce"); if (prev != null) System.setProperty("net.i2p.router.web.ConfigLoggingHandler.noncePrev", prev); @@ -28,43 +28,26 @@ <h3>Configure I2P Logging Options</h3> <div class="wideload"> <table border="0" cellspacing="5"> - <tr> - <td class="mediumtags" align="right"><b>Logging filename:</b> - <td><input type="text" name="logfilename" size="40" value="<jsp:getProperty name="logginghelper" property="logFilePattern" />" /> - <br /> <i>(the symbol '@' will be replaced during log rotation)</i> - <tr> - <td class="mediumtags" align="right"><b>Log record format:</b> - <td><input type="text" name="logformat" size="20" value="<jsp:getProperty name="logginghelper" property="recordPattern" />" /> - <br /> <i>(use 'd' = date, 'c' = class, 't' = thread, 'p' = priority, - 'm' = message)</i> - <tr> - <td class="mediumtags" align="right"><b>Log date format:</b> - <td><input type="text" name="logdateformat" size="20" value="<jsp:getProperty name="logginghelper" property="datePattern" />" /> - <br /> <i>('MM' = month, 'dd' = day, 'HH' = hour, 'mm' = minute, 'ss' - = second, 'SSS' = millisecond)</i> - <tr> - <td class="mediumtags" align="right"><b>Max log file size:</b> - <td><input type="text" name="logfilesize" size="4" value="<jsp:getProperty name="logginghelper" property="maxFileSize" />" /> - <br /> - <tr> - <td class="mediumtags" align="right"><b>Default log level:</b> - <td><jsp:getProperty name="logginghelper" property="defaultLogLevelBox" /> <br /> <i>(DEBUG and INFO are not recommended defaults, - as they will drastically slow down your router)</i> - <tr> - <td class="mediumtags" align="right"><b>Log level overrides:</b> - <td><jsp:getProperty name="logginghelper" property="logLevelTable" /> - <tr> - <td colspan="2"><hr> - <tr> - <td> - <td> <div align="right"> - <input type="submit" name="shouldsave" value="Save changes" /> - <input type="reset" value="Cancel" /> - </div> - </table> - </form> -</div> -</div> -</div> -</body> -</html> + <tr><td class="mediumtags" align="right"><b>Logging filename:</b></td> + <td><input type="text" name="logfilename" size="40" value="<jsp:getProperty name="logginghelper" property="logFilePattern" />" /> + <br><i>(the symbol '@' will be replaced during log rotation)</i></td> + </tr><tr><td class="mediumtags" align="right"><b>Log record format:</b></td> + <td><input type="text" name="logformat" size="20" value="<jsp:getProperty name="logginghelper" property="recordPattern" />" /> + <br> <i>(use 'd' = date, 'c' = class, 't' = thread, 'p' = priority, + 'm' = message)</i></td> + </tr><tr><td class="mediumtags" align="right"><b>Log date format:</b></td> + <td><input type="text" name="logdateformat" size="20" value="<jsp:getProperty name="logginghelper" property="datePattern" />" /> + <br> <i>('MM' = month, 'dd' = day, 'HH' = hour, 'mm' = minute, 'ss' + = second, 'SSS' = millisecond)</i></td> + </tr><tr><td class="mediumtags" align="right"><b>Max log file size:</b></td> + <td><input type="text" name="logfilesize" size="4" value="<jsp:getProperty name="logginghelper" property="maxFileSize" />" /><br></td> + </tr><tr><td class="mediumtags" align="right"><b>Default log level:</b></td> + <td><jsp:getProperty name="logginghelper" property="defaultLogLevelBox" /><br><i>(DEBUG and INFO are not recommended defaults, + as they will drastically slow down your router)</i></td> + </tr><tr><td class="mediumtags" align="right"><b>Log level overrides:</b></td> + <td><jsp:getProperty name="logginghelper" property="logLevelTable" /></td> + </tr><tr><td colspan="2"><hr></td> + </tr><tr class="tablefooter"><td colspan="2"> <div class="formaction"> + <input type="submit" name="shouldsave" value="Save changes" /> + <input type="reset" value="Cancel" /> +</div></td></tr></table></div></form></div></div></body></html> diff --git a/apps/routerconsole/jsp/confignav.jsp b/apps/routerconsole/jsp/confignav.jsp index 37b6adbd0e0777adb4ae4526aca80079c80dcc2f..bba31052ec868fa567b9f44acc172a61d91f5931 100644 --- a/apps/routerconsole/jsp/confignav.jsp +++ b/apps/routerconsole/jsp/confignav.jsp @@ -1,6 +1,6 @@ <div class="confignav" id="confignav"> <center> -<% if (request.getRequestURI().indexOf("config.jsp") != -1) { +<% if (request.getRequestURI().indexOf("config.jsp") != -1) { %>Network | <% } else { %><a href="config.jsp">Network</a> | <% } String userAgent = request.getHeader("User-Agent"); if (userAgent == null || !userAgent.contains("MSIE")) { @@ -25,5 +25,4 @@ %>Stats | <% } else { %><a href="configstats.jsp">Stats</a> | <% } if (request.getRequestURI().indexOf("configadvanced.jsp") != -1) { %>Advanced<% } else { %><a href="configadvanced.jsp">Advanced</a><% } %> -</center> -</div> +</center></div> diff --git a/apps/routerconsole/jsp/configpeer.jsp b/apps/routerconsole/jsp/configpeer.jsp index 6f891a329b0902f257ad08788827163b873e80ca..007452229d137303c803bbd119712ec882a5aa1a 100644 --- a/apps/routerconsole/jsp/configpeer.jsp +++ b/apps/routerconsole/jsp/configpeer.jsp @@ -2,8 +2,7 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - config peers</title> +<html><head><title>I2P Router Console - config peers</title> <%@include file="css.jsp" %> </head><body> @@ -11,19 +10,19 @@ <h1>I2P Peer Configuration</h1> <div class="main" id="main"> <%@include file="confignav.jsp" %> - + <jsp:useBean class="net.i2p.router.web.ConfigPeerHandler" id="formhandler" scope="request" /> <jsp:setProperty name="formhandler" property="*" /> <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:getProperty name="formhandler" property="allMessages" /> - + <jsp:useBean class="net.i2p.router.web.ConfigPeerHelper" id="peerhelper" scope="request" /> <jsp:setProperty name="peerhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <% String peer = ""; - if (request.getParameter("peer") != null) + if (request.getParameter("peer") != null) peer = request.getParameter("peer"); %> <div class="configure"> @@ -40,9 +39,9 @@ <div class="mediumtags">Router Hash: <input type="text" size="55" name="peer" value="<%=peer%>" /></div> <h3>Manually Ban / Unban a Peer</h3> - Banning will prevent the participation of this peer in tunnels you create. - <hr /> - <div class="formaction"> + Banning will prevent the participation of this peer in tunnels you create. + <hr> + <div class="formaction"> <input type="submit" name="action" value="Ban peer until restart" /> <input type="submit" name="action" value="Unban peer" /> <% if (! "".equals(peer)) { %> @@ -51,17 +50,17 @@ </div> <h3>Adjust Profile Bonuses</h3> - Bonuses may be positive or negative, and affect the peer's inclusion in Fast - and High Capacity tiers. Fast peers are used for client tunnels, and High - Capacity peers are used for some exploratory tunnels. Current bonuses are - displayed on the <a href="profiles.jsp">profiles page</a>. + Bonuses may be positive or negative, and affect the peer's inclusion in Fast + and High Capacity tiers. Fast peers are used for client tunnels, and High + Capacity peers are used for some exploratory tunnels. Current bonuses are + displayed on the <a href="profiles.jsp">profiles page</a>. <p> <% long speed = 0; long capacity = 0; if (! "".equals(peer)) { // get existing bonus values? } - %> - <hr /> + %> + <hr> <div class="mediumtags">Speed: <input type="text" size="8" name="speed" value="<%=speed%>" /> Capacity: @@ -73,12 +72,8 @@ <jsp:useBean class="net.i2p.router.web.ProfilesHelper" id="profilesHelper" scope="request" /> <jsp:setProperty name="profilesHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:getProperty name="profilesHelper" property="shitlistSummary" /> - <hr /> + <hr> <div class="wideload"> <jsp:getProperty name="peerhelper" property="blocklistSummary" /> -</div> -</div> -</div> -</body> -</html> +</div></div></div></body></html> diff --git a/apps/routerconsole/jsp/configservice.jsp b/apps/routerconsole/jsp/configservice.jsp index 942aedf0d0fe872b50fb278a012d6c0da53b6279..45b5e435faa030e3d676598619c607a4930f3705 100644 --- a/apps/routerconsole/jsp/configservice.jsp +++ b/apps/routerconsole/jsp/configservice.jsp @@ -2,8 +2,7 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - config service</title> +<html><head><title>I2P Router Console - config service</title> <%@include file="css.jsp" %> </head><body> @@ -11,7 +10,7 @@ <h1>I2P Service Configuration</h1> <div class="main" id="main"> <%@include file="confignav.jsp" %> - + <jsp:useBean class="net.i2p.router.web.ConfigServiceHandler" id="formhandler" scope="request" /> <jsp:setProperty name="formhandler" property="*" /> <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> @@ -23,7 +22,7 @@ System.setProperty("net.i2p.router.web.ConfigServiceHandler.nonce", new java.util.Random().nextLong()+""); %> <input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigServiceHandler.nonce")%>" /> <h3>Shutdown the router</h3> - <p>Graceful shutdown lets the router satisfy the agreements it has already made + <p>Graceful shutdown lets the router satisfy the agreements it has already made before shutting down, but may take a few minutes. If you need to kill the router immediately, that option is available as well.</p> <hr><div class="formaction"> @@ -32,7 +31,7 @@ <input type="submit" name="action" value="Cancel graceful shutdown" /> </div> <% if (System.getProperty("wrapper.version") != null) { %> - <p>If you want the router to restart itself after shutting down, you can choose one of + <p>If you want the router to restart itself after shutting down, you can choose one of the following. This is useful in some situations - for example, if you changed some settings that client applications only read at startup, such as the routerconsole password or the interface it listens on. A graceful restart will take a few minutes (but your peers @@ -45,46 +44,41 @@ <% if ( (System.getProperty("os.name") != null) && (System.getProperty("os.name").startsWith("Win")) ) { %> <h3>Systray integration</h3> - <p>On the windows platform, there is a small application to sit in the system + <p>On the windows platform, there is a small application to sit in the system tray, allowing you to view the router's status (later on, I2P client applications will be able to integrate their own functionality into the system tray as well). If you are on windows, you can either enable or disable that icon here.</p> <hr><div class="formaction"> <input type="submit" name="action" value="Show systray icon" /> <input type="submit" name="action" value="Hide systray icon" /> -</div> - <h3>Run on startup</h3> - <p>You can control whether I2P is run on startup or not by selecting one of the +</div><h3>Run on startup</h3> + <p>You can control whether I2P is run on startup or not by selecting one of the following options - I2P will install (or remove) a service accordingly. You can - also run the <code>install_i2p_service_winnt.bat</code> (or + also run the <code>install_i2p_service_winnt.bat</code> (or <code>uninstall_i2p_service_winnt.bat</code>) from the command line, if you prefer.</p> <hr><div class="formaction"> <input type="submit" name="action" value="Run I2P on startup" /> <input type="submit" name="action" value="Don't run I2P on startup" /></div> - <p><b>Note:</b> If you are running I2P as service right now, removing it will shut + <p><b>Note:</b> If you are running I2P as service right now, removing it will shut down your router immediately. You may want to consider shutting down gracefully, as above, then running uninstall_i2p_service_winnt.bat.</p> <% } %> <% if (System.getProperty("wrapper.version") != null) { %> <h3>Debugging</h3> - <p>At times, it may be helpful to debug I2P by getting a thread dump. To do so, - please select the following option and review the thread dumped to + <p>At times, it may be helpful to debug I2P by getting a thread dump. To do so, + please select the following option and review the thread dumped to <a href="logs.jsp#servicelogs">wrapper.log</a>.</p> <hr><div class="formaction"> <input type="submit" name="action" value="Dump threads" /> <% } %></div> - + <h3>Launch browser on router startup?</h3> <p>I2P's main configuration interface is this web console, so for your convenience - I2P can launch a web browser pointing at + I2P can launch a web browser pointing at <a href="http://127.0.0.1:7657/index.jsp">http://127.0.0.1:7657/index.jsp</a> whenever the router starts up.</p> <hr><div class="formaction"> <input type="submit" name="action" value="View console on startup" /> <input type="submit" name="action" value="Do not view console on startup" /> -</form></div> -</div> -</div> -</body> -</html> +</div></form></div></div></body></html> diff --git a/apps/routerconsole/jsp/configstats.jsp b/apps/routerconsole/jsp/configstats.jsp index 9a2435ec4f313fdfa2a66dc48828fc635b591e83..122d035c3b9467244d83612ad6e2c89efcb64274 100644 --- a/apps/routerconsole/jsp/configstats.jsp +++ b/apps/routerconsole/jsp/configstats.jsp @@ -2,8 +2,7 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - config stats</title> +<html><head><title>I2P Router Console - config stats</title> <%@include file="css.jsp" %> <script type="text/javascript"> function init() @@ -73,39 +72,40 @@ function toggleAll(category) <input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigStatsHandler.nonce")%>" /> <h3>Configure I2P Stat Collection</h3> Enable full stats? - <input type="checkbox" class="optbox" name="isFull" value="true" <% + <input type="checkbox" class="optbox" name="isFull" value="true" <% if (statshelper.getIsFull()) { %>checked="true" <% } %>/> - (change requires restart to take effect)<br /> - Stat file: <input type="text" name="filename" value="<%=statshelper.getFilename()%>" /><br /> - Filter: (<a href="javascript: void(null);" onclick="toggleAll('*')">toggle all</a>)<hr /> + (change requires restart to take effect)<br> + Stat file: <input type="text" name="filename" value="<%=statshelper.getFilename()%>" /><br> + Filter: (<a href="javascript: void(null);" onclick="toggleAll('*')">toggle all</a>)<br> <div class="wideload"> <table> <% while (statshelper.hasMoreStats()) { while (statshelper.groupRequired()) { %> - <tr class="tablefooter"><td align="left" colspan="3"> + <tr class="tablefooter"> + <td align="left" colspan="3"> <b><%=statshelper.getCurrentGroupName()%></b> (<a href="javascript: void(null);" onclick="toggleAll('<%=statshelper.getCurrentGroupName()%>')">toggle all</a>) - </td></tr><tr class="tablefooter"><td align="center"><b>Log</b></td><td align="center"><b>Graph</b></td><td></td></tr><% + </td></tr> + <tr class="tablefooter"> + <td align="center"><b>Log</b></td> + <td align="center"><b>Graph</b></td> + <td></td></tr> + <% } // end iterating over required groups for the current stat %> <tr><td align="center"> <a name="<%=statshelper.getCurrentStatName()%>"></a> - <input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" class="optbox" name="statList" value="<%=statshelper.getCurrentStatName()%>" <% + <input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" class="optbox" name="statList" value="<%=statshelper.getCurrentStatName()%>" <% if (statshelper.getCurrentIsLogged()) { %>checked="true" <% } %>/></td> <td align="center"> <% if (statshelper.getCurrentCanBeGraphed()) { %> - <input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" class="optbox" name="graphList" value="<%=statshelper.getCurrentGraphName()%>" <% + <input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" class="optbox" name="graphList" value="<%=statshelper.getCurrentGraphName()%>" <% if (statshelper.getCurrentIsGraphed()) { %>checked="true" <% } %>/><% } %></td> - <td align="left"><b><%=statshelper.getCurrentStatName()%>:</b><br /> + <td align="left"><b><%=statshelper.getCurrentStatName()%>:</b><br> <%=statshelper.getCurrentStatDescription()%></td></tr><% } // end iterating over all stats %> <tr><td colspan="3"></td></tr> <tr><td align="center"><input type="checkbox" class="optbox" name="explicitFilter" /></td> - <td colspan="2">Advanced filter: + <td colspan="2">Advanced filter: <input type="text" name="explicitFilterValue" value="<%=statshelper.getExplicitFilter()%>" size="40" /></td></tr> - <tr class="tablefooter"><td colspan="3" align="right"><input type="submit" name="shouldsave" value="Save changes" /><input type="reset" value="Cancel" /></td></tr></form> - </table> -</div> -</div> -</div> -</body> -</html> + <tr class="tablefooter"><td colspan="3" align="right"><input type="submit" name="shouldsave" value="Save changes" /><input type="reset" value="Cancel" /></td></tr> + </table></div></form></div></div></body></html> diff --git a/apps/routerconsole/jsp/configtunnels.jsp b/apps/routerconsole/jsp/configtunnels.jsp index f6ccb44d7731326551acb94462e72a68f4d4f11c..f9185a01aa1a6c1d826f2c0b27c621ea465745fb 100644 --- a/apps/routerconsole/jsp/configtunnels.jsp +++ b/apps/routerconsole/jsp/configtunnels.jsp @@ -2,8 +2,7 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - config tunnels</title> +<html><head><title>I2P Router Console - config tunnels</title> <%@include file="css.jsp" %> </head><body> @@ -21,16 +20,14 @@ <jsp:setProperty name="formhandler" property="nonce" value="<%=request.getParameter("nonce")%>" /> <jsp:setProperty name="formhandler" property="settings" value="<%=request.getParameterMap()%>" /> <jsp:getProperty name="formhandler" property="allMessages" /> - <div class="configure"> - <p><i> + <div class="configure"><p><i> NOTE: The default settings work for most people. There is a fundamental tradeoff between anonymity and performance. Tunnels longer than 3 hops (for example 2 hops + 0-2 hops, 3 hops + 0-1 hops, 3 hops + 0-2 hops), or a high quantity + backup quantity, may severely reduce performance or reliability. High CPU and/or high outbound bandwidth usage may result. Change these settings with care, and adjust them if you have problems. - </i></p> - <div class="wideload"> + </i></p><div class="wideload"> <form action="configtunnels.jsp" method="POST"> <% String prev = System.getProperty("net.i2p.router.web.ConfigTunnelsHandler.nonce"); if (prev != null) System.setProperty("net.i2p.router.web.ConfigTunnelsHandler.noncePrev", prev); @@ -38,13 +35,8 @@ <input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigTunnelsHandler.nonce")%>" /> <input type="hidden" name="action" value="blah" /> <jsp:getProperty name="tunnelshelper" property="form" /> - <i>Note - Exploratory tunnel setting changes are stored in the router.config file.</i></br> + <i>Note - Exploratory tunnel setting changes are stored in the router.config file.</i><br> <i>Client tunnel changes are temporary and are not saved.</i><br> <i>To make permanent client tunnel changes see the </i><a href="i2ptunnel/index.jsp">i2ptunnel page</a>.<br> - <hr /><div class="formaction"><input type="submit" name="shouldsave" value="Save changes" /> <input type="reset" value="Cancel" /></div> - </form> -</div> -</div> -</div> -</body> -</html> + <hr><div class="formaction"><input type="submit" name="shouldsave" value="Save changes" /> <input type="reset" value="Cancel" /></div> + </form></div></div></div></body></html> diff --git a/apps/routerconsole/jsp/configui.jsp b/apps/routerconsole/jsp/configui.jsp index f918bd5b5940470a0a3b709dedf7d310a41d6202..89f7d7c2bf1d5c0101620009a8195855bc851d6e 100644 --- a/apps/routerconsole/jsp/configui.jsp +++ b/apps/routerconsole/jsp/configui.jsp @@ -2,8 +2,7 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - config UI</title> +<html><head><title>I2P Router Console - config UI</title> <%@include file="css.jsp" %> </head><body> @@ -16,13 +15,12 @@ <div class="main" id="main"> <%@include file="confignav.jsp" %> - + <jsp:useBean class="net.i2p.router.web.ConfigUIHandler" id="formhandler" scope="request" /> <jsp:setProperty name="formhandler" property="*" /> <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:getProperty name="formhandler" property="allMessages" /> -<div class="configure"> -<h3>Router Console Theme</h3> +<div class="configure"><h3>Router Console Theme</h3> <% // userAgent defined in confignav if (userAgent == null || !userAgent.contains("MSIE")) { @@ -34,14 +32,11 @@ <input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigUIHandler.nonce")%>" /> <input type="hidden" name="action" value="blah" /> <jsp:getProperty name="uihelper" property="settings" /> -<hr><div class="formaction"> +<hr><div class="formaction"> <input type="submit" name="shouldsave" value="Apply" /> <input type="reset" value="Cancel" /> -</form></div> +</div></form></div> <% } else { %> -Theme selection disabled for Internet Explorer, sorry.<hr>If you're not using IE, it's likely that +Theme selection disabled for Internet Explorer, sorry.<hr>If you're not using IE, it's likely that your browser is pretending to be IE; please configure your browser (or proxy) to use a different User Agent string if you'd like to access the console themes. <% } %> -</div> -</div> -</body> -</html> +</div></body></html> diff --git a/apps/routerconsole/jsp/configupdate.jsp b/apps/routerconsole/jsp/configupdate.jsp index 136876d372b0de4266c125ca06b5e21dbbff3a35..62677bbb041fdd3cd5d23229efbfe98a7690e8cd 100644 --- a/apps/routerconsole/jsp/configupdate.jsp +++ b/apps/routerconsole/jsp/configupdate.jsp @@ -2,8 +2,7 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - config update</title> +<html><head><title>I2P Router Console - config update</title> <%@include file="css.jsp" %> </head><body> @@ -11,16 +10,15 @@ <h1>I2P Update Configuration</h1> <div class="main" id="main"> <%@include file="confignav.jsp" %> - + <jsp:useBean class="net.i2p.router.web.ConfigUpdateHandler" id="formhandler" scope="request" /> <jsp:setProperty name="formhandler" property="*" /> <jsp:setProperty name="formhandler" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:getProperty name="formhandler" property="allMessages" /> - <jsp:useBean class="net.i2p.router.web.ConfigUpdateHelper" id="updatehelper" scope="request" /> <jsp:setProperty name="updatehelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <div class="messages"> -<i><jsp:getProperty name="updatehelper" property="newsStatus" /></i></div> +<i><jsp:getProperty name="updatehelper" property="newsStatus" /></i></div> <div class="configure"> <form action="configupdate.jsp" method="POST"> <% String prev = System.getProperty("net.i2p.router.web.ConfigUpdateHandler.nonce"); @@ -29,56 +27,33 @@ <input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigUpdateHandler.nonce")%>" /> <h3>Check for I2P and news updates</h3> <div class="wideload"><table border="0" cellspacing="5"> - <tr> - <td colspan="2"></tr> - <tr> - <td class= "mediumtags" align="right"><b>News:</b></td> - <td> <% if ("true".equals(System.getProperty("net.i2p.router.web.UpdateHandler.updateInProgress", "false"))) { %> <i>Update In Progress</i><br /> <% } else { %> <input type="submit" name="action" value="Check for update now" /> - <% } %></tr> - <tr> - <td colspan="2"><hr /></td> - </tr> - <tr> - <td class= "mediumtags" align="right"><b>News URL:</b></td> + <tr><td colspan="2"></tr> + <tr><td class= "mediumtags" align="right"><b>News & I2P Updates:</b></td> + <td> <% if ("true".equals(System.getProperty("net.i2p.router.web.UpdateHandler.updateInProgress", "false"))) { %> <i>Update In Progress</i><br> <% } else { %> <input type="submit" name="action" value="Check for updates" /> + <% } %></td></tr> + <tr><td colspan="2"><br></td></tr> + <tr><td class= "mediumtags" align="right"><b>News URL:</b></td> <td><input type="text" size="60" name="newsURL" value="<jsp:getProperty name="updatehelper" property="newsURL" />"></td> - </tr> - <tr> - <td class= "mediumtags" align="right"><b>Refresh frequency:</b> - <td><jsp:getProperty name="updatehelper" property="refreshFrequencySelectBox" /> - <tr> - <td class= "mediumtags" align="right"><b>Update policy:</b> - <td><jsp:getProperty name="updatehelper" property="updatePolicySelectBox" /> - <tr> - <td class= "mediumtags" align="right"><b>Update through the eepProxy?</b> - <td><jsp:getProperty name="updatehelper" property="updateThroughProxy" /> - <tr> - <td class= "mediumtags" align="right"><b>eepProxy host:</b> - <td><input type="text" size="10" name="proxyHost" value="<jsp:getProperty name="updatehelper" property="proxyHost" />" /> - <tr> - <td class= "mediumtags" align="right"><b>eepProxy port:</b> - <td><input type="text" size="4" name="proxyPort" value="<jsp:getProperty name="updatehelper" property="proxyPort" />" /> - <tr> - <td class= "mediumtags" align="right"><b>Update URLs:</b> - <td><textarea name="updateURL" wrap="off"><jsp:getProperty name="updatehelper" property="updateURL" /></textarea> - <tr> - <td class= "mediumtags" align="right"><b>Trusted keys:</b> - <td><textarea name="trustedKeys" wrap="off"><jsp:getProperty name="updatehelper" property="trustedKeys" /></textarea> - <tr> - <td class= "mediumtags" align="right"><b>Update with unsigned development builds?</b> - <td><jsp:getProperty name="updatehelper" property="updateUnsigned" /> - <tr> - <td class= "mediumtags" align="right"><b>Unsigned Build URL:</b></td> + </tr><tr><td class= "mediumtags" align="right"><b>Refresh frequency:</b> + <td><jsp:getProperty name="updatehelper" property="refreshFrequencySelectBox" /></td><tr> + <td class= "mediumtags" align="right"><b>Update policy:</b></td> + <td><jsp:getProperty name="updatehelper" property="updatePolicySelectBox" /></td> + <tr><td class= "mediumtags" align="right"><b>Update through the eepProxy?</b></td> + <td><jsp:getProperty name="updatehelper" property="updateThroughProxy" /></td> + </tr><tr><td class= "mediumtags" align="right"><b>eepProxy host:</b></td> + <td><input type="text" size="10" name="proxyHost" value="<jsp:getProperty name="updatehelper" property="proxyHost" />" /></td> + </tr><tr><td class= "mediumtags" align="right"><b>eepProxy port:</b></td> + <td><input type="text" size="4" name="proxyPort" value="<jsp:getProperty name="updatehelper" property="proxyPort" />" /></td> + </tr><tr><td class= "mediumtags" align="right"><b>Update URLs:</b></td> + <td><textarea name="updateURL" wrap="off"><jsp:getProperty name="updatehelper" property="updateURL" /></textarea></td> + </tr><tr><td class= "mediumtags" align="right"><b>Trusted keys:</b></td> + <td><textarea name="trustedKeys" wrap="off"><jsp:getProperty name="updatehelper" property="trustedKeys" /></textarea></td> + </tr><tr><td class= "mediumtags" align="right"><b>Update with unsigned development builds?</b></td> + <td><jsp:getProperty name="updatehelper" property="updateUnsigned" /></td> + </tr><tr><td class= "mediumtags" align="right"><b>Unsigned Build URL:</b></td> <td><input type="text" size="60" name="zipURL" value="<jsp:getProperty name="updatehelper" property="zipURL" />"></td> - <tr> - <td> - <td><div class="formaction"> - <input type="submit" name="action" value="Save" /> - <input type="reset" value="Cancel" /> - </div> - </table> - </div> - </form> -</div> -</div> -</body> -</html> + </tr><tr class="tablefooter"><td colspan="2"> + <div class="formaction"> + <input type="submit" name="action" value="Save" /> + <input type="reset" value="Cancel" /> + </div></td></tr></table></div></form></div></div></body></html> diff --git a/apps/routerconsole/jsp/css.jsp b/apps/routerconsole/jsp/css.jsp index 37b649780b4a1b394463f06ec7dbe85d345f0655..affe83099f427eb31f6ca94fc94ee17bfb6444aa 100644 --- a/apps/routerconsole/jsp/css.jsp +++ b/apps/routerconsole/jsp/css.jsp @@ -8,14 +8,14 @@ response.setHeader("Cache-Control","no-cache"); response.setDateHeader("Expires", 0); // the above will b0rk if the servlet engine has already flushed - // the response prior to including this file, so it should be + // the response prior to including this file, so it should be // near the top - + if (request.getParameter("i2p.contextId") != null) { - session.setAttribute("i2p.contextId", request.getParameter("i2p.contextId")); + session.setAttribute("i2p.contextId", request.getParameter("i2p.contextId")); } %> <jsp:useBean class="net.i2p.router.web.CSSHelper" id="cssHelper" scope="request" /> <jsp:setProperty name="cssHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> -<link href="<%=cssHelper.getTheme(request.getHeader("User-Agent"))%>console.css" rel="stylesheet" type="text/css" /> -<!--[if IE]><link href="/themes/console/classic/ieshim.css" rel="stylesheet" type="text/css" /><![endif]--> \ No newline at end of file +<link href="<%=cssHelper.getTheme(request.getHeader("User-Agent"))%>console.css" rel="stylesheet" type="text/css"> +<!--[if IE]><link href="/themes/console/classic/ieshim.css" rel="stylesheet" type="text/css" /><![endif]--> \ No newline at end of file diff --git a/apps/routerconsole/jsp/dumpprofile.jsp b/apps/routerconsole/jsp/dumpprofile.jsp index 34ff35f7e31e5a5e7c87fa949d6c351ac377ac42..f13a4bcd77e976a212fd273daa4b84d8202950ea 100644 --- a/apps/routerconsole/jsp/dumpprofile.jsp +++ b/apps/routerconsole/jsp/dumpprofile.jsp @@ -1,5 +1,5 @@ -<%@page contentType="text/plain" -%><jsp:useBean id="helper" class="net.i2p.router.web.StatHelper" -/><jsp:setProperty name="helper" property="peer" value="<%=request.getParameter("peer")%>" -/><jsp:setProperty name="helper" property="writer" value="<%=out%>" +<%@page contentType="text/plain" +%><jsp:useBean id="helper" class="net.i2p.router.web.StatHelper" +/><jsp:setProperty name="helper" property="peer" value="<%=request.getParameter("peer")%>" +/><jsp:setProperty name="helper" property="writer" value="<%=out%>" /><jsp:getProperty name="helper" property="profile" /> \ No newline at end of file diff --git a/apps/routerconsole/jsp/error.jsp b/apps/routerconsole/jsp/error.jsp index da2dfeac8834a60a699002be5669e7933fff30eb..92da24f4d3be78183526cab6589d9922fac3aead 100644 --- a/apps/routerconsole/jsp/error.jsp +++ b/apps/routerconsole/jsp/error.jsp @@ -12,12 +12,10 @@ } // If it can't find the iframe or viewtheme.jsp I wonder if the whole thing blows up... %> -<html><head> -<title>I2P Router Console</title> +<html><head><title>I2P Router Console</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <%@include file="css.jsp" %> -<link rel="shortcut icon" href="favicon.ico" /> -</head><body> +<link rel="shortcut icon" href="favicon.ico" /></head><body> <% if (System.getProperty("router.consoleNonce") == null) { System.setProperty("router.consoleNonce", new java.util.Random().nextLong() + ""); @@ -27,6 +25,4 @@ if (System.getProperty("router.consoleNonce") == null) { <h1><%=ERROR_CODE%> <%=ERROR_MESSAGE%></h1> <div class="warning" id="warning"> The Router Console page <%=ERROR_URI%> was not found. -</div> -</body> -</html> +</div></body></html> diff --git a/apps/routerconsole/jsp/graphs.jsp b/apps/routerconsole/jsp/graphs.jsp index 34ee723b76cc7df4719f7fc4403daabd8afb22d8..2a30675d945217146361b4a404081410849d3b0c 100644 --- a/apps/routerconsole/jsp/graphs.jsp +++ b/apps/routerconsole/jsp/graphs.jsp @@ -2,8 +2,7 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - graphs</title> +<html><head><title>I2P Router Console - graphs</title> <%@include file="css.jsp" %> </head><body> @@ -11,14 +10,11 @@ <h1>I2P Performance Graphs</h1> <div class="main" id="main"> <div class="graphspanel"> - <div class="widepanel"> + <div class="widepanel"> <jsp:useBean class="net.i2p.router.web.GraphHelper" id="graphHelper" scope="request" /> <jsp:setProperty name="graphHelper" property="*" /> <jsp:setProperty name="graphHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:setProperty name="graphHelper" property="writer" value="<%=out%>" /> <jsp:getProperty name="graphHelper" property="images" /> <jsp:getProperty name="graphHelper" property="form" /> -</div> -</div> -</body> -</html> \ No newline at end of file +</div></div></div></body></html> \ No newline at end of file diff --git a/apps/routerconsole/jsp/help.jsp b/apps/routerconsole/jsp/help.jsp index 97eda87ed6bf727b36ce3acab41d4a9c0f8d13f2..48752b19e3af97cedabab5ad4e0034b4f8cb35f6 100644 --- a/apps/routerconsole/jsp/help.jsp +++ b/apps/routerconsole/jsp/help.jsp @@ -2,34 +2,27 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - help</title> +<html><head><title>I2P Router Console - help</title> <%@include file="css.jsp" %> </head><body> - <%@include file="summary.jsp" %> <h1>I2P Router Help & Support</h1> <div class="main" id="main"><div align="justify"> -If you'd like to help improve or translate the documentation, or +If you'd like to help improve or translate the documentation, or help with other aspects of the project, please see the documentation for -<a href="http://www.i2p2.i2p/getinvolved.html">volunteers.</a> -<br><br>Further assistance is available here: -<br></div> +<a href="http://www.i2p2.i2p/getinvolved.html">volunteers.</a> +<br><br>Further assistance is available here:<br></div> <ul class="links"> <li class="tidylist"><a href="http://www.i2p2.i2p/faq.html">FAQ on www.i2p2.i2p</a> -<li class="tidylist"><a href="http://www.i2p2.i2p/faq_de.html">Deutsch FAQ</a>. -</ul> -<br> +<li class="tidylist"><a href="http://www.i2p2.i2p/faq_de.html">Deutsch FAQ</a>.</ul><br> You may also try the <a href="http://forum.i2p/">I2P forum</a> -or IRC.<br /> +or IRC.<br> <h2>Summary Bar Information</h2><div align="justify"> Many of the stats on the summary bar may be <a href="configstats.jsp">configured</a> to be <a href="graphs.jsp">graphed</a> for further analysis. -</div> -<h3>General</h3> -<ul> +</div><h3>General</h3><ul> <li class="tidylist"><b>Ident:</b> The first four characters (24 bits) of your 44-character (256-bit) Base64 router hash. The full hash is shown on your <a href="netdb.jsp?r=.">router info page</a>. @@ -43,10 +36,7 @@ your computer's time. <li class="tidylist"><b>Reachability:</b> The router's view of whether it can be contacted by other routers. Further information is on the <a href="config.jsp#help">configuration page</a>. -</ul> - -<h3>Peers</h3> -<ul> +</ul><h3>Peers</h3><ul> <li class="tidylist"><b>Active:</b> The first number is the number of peers you've sent or received a message from in the last few minutes. This may range from 8-10 to several hundred, depending on your total bandwidth, @@ -75,21 +65,17 @@ This number is not the total size of the network; it may vary widely depending on your total bandwidth, shared bandwidth, and locally-generated traffic. I2P does not require a router to know every other router. -</ul> - -<h3>Bandwidth in/out</h3><div align="justify"> +</ul><h3>Bandwidth in/out</h3><div align="justify"> Should be self-explanatory. All values are in bytes per second, not bits per second. Change your bandwidth limits on the <a href="config.jsp#help">configuration page</a>. -Bandwidth is <a href="graphs.jsp">graphed</a> by default. -</div> +Bandwidth is <a href="graphs.jsp">graphed</a> by default.</div> + <h3>Local destinations</h3><div align="justify"> The local applications connecting through your router. These may be clients started through <a href="i2ptunnel/index.jsp">I2PTunnel</a> or external programs connecting through SAM, BOB, or directly to I2CP. -</div> -<h3>Tunnels in/out</h3><div align="justify"> -The actual tunnels are shown on the <a href="tunnels.jsp">the tunnels page</a>.</div><br> -<ul> +</div><h3>Tunnels in/out</h3><div align="justify"> +The actual tunnels are shown on the <a href="tunnels.jsp">the tunnels page</a>.</div><br><ul> <li class="tidylist"><div align="justify"><b>Exploratory:</b> Tunnels built by your router and used for communication with the floodfill peers, building new tunnels, and testing existing tunnels.</div> @@ -102,12 +88,10 @@ shared bandwidth, and amount of locally-generated traffic. The recommended method for limiting participating tunnels is to change your share percentage on the <a href="config.jsp#help">configuration page</a>. You may also limit the total number by setting <tt>router.maxParticipatingTunnels=nnn</tt> on -the <a href="configadvanced.jsp">advanced configuration page</a>. <a href="configstats.jsp#tunnel.participatingTunnels">[Enable graphing]</a>. -</ul> +the <a href="configadvanced.jsp">advanced configuration page</a>. <a href="configstats.jsp#tunnel.participatingTunnels">[Enable graphing]</a>.</ul> <h3>Congestion</h3><div align="justify"> -Some basic indications of router overload:</div><br> -<ul> +Some basic indications of router overload:</div><br><ul> <li class="tidylist"><b>Job lag:</b> How long jobs are waiting before execution. The job queue is listed on the <a href="jobs.jsp">jobs page</a>. Unfortunately, there are several other job queues in the router that may be congested, @@ -143,42 +127,41 @@ participating tunnel through your router. Your router may accept all requests, accept or reject a percentage of requests, or reject all requests for a number of reasons, to control the bandwidth and CPU demands and maintain capacity for -local clients. -</ul> +local clients.</ul> <h2>Legal stuff</h2><div align="justify"> -The I2P router (router.jar) and SDK (i2p.jar) are almost entirely public domain, with -a few notable exceptions:</div><br /><ul> +The I2P router (router.jar) and SDK (i2p.jar) are almost entirely public domain, with +a few notable exceptions:</div><br><ul> <li class="tidylist">ElGamal and DSA code, under the BSD license, written by TheCrypto</li> <li class="tidylist">SHA256 and HMAC-SHA256, under the MIT license, written by the Legion of the Bouncycastle</li> <li class="tidylist">AES code, under the Cryptix (MIT) license, written by the Cryptix team</li> <li class="tidylist">SNTP code, under the BSD license, written by Adam Buckley</li> -<li class="tidylist">The rest is outright public domain, written by jrandom, mihi, hypercubus, oOo, +<li class="tidylist">The rest is outright public domain, written by jrandom, mihi, hypercubus, oOo, ugha, duck, shendaras, and others.</li> </ul> <p>On top of the I2P router are a series of client applications, each with their own set of licenses and dependencies. This webpage is being served as part of the I2P routerconsole client application, which is built off a trimmed down <a href="http://jetty.mortbay.com/jetty/index.html">Jetty</a> -instance (trimmed down, as in, we do not include the demo apps or other add-ons, and we simplify configuration), -allowing you to deploy standard JSP/Servlet web applications into your router. Jetty in turn makes use of +instance (trimmed down, as in, we do not include the demo apps or other add-ons, and we simplify configuration), +allowing you to deploy standard JSP/Servlet web applications into your router. Jetty in turn makes use of Apache's javax.servlet (javax.servlet.jar) implementation. -This product includes software developed by the Apache Software Foundation +This product includes software developed by the Apache Software Foundation (http://www.apache.org/). </p> <p>Another application you can see on this webpage is <a href="http://www.i2p2.i2p/i2ptunnel">I2PTunnel</a> (your <a href="i2ptunnel/" target="_blank">web interface</a>) - a GPL'ed application written by mihi that lets you tunnel normal TCP/IP traffic over I2P (such as the eepproxy and the irc proxy). There is also a <a href="http://susi.i2p/">susimail</a> web based mail client <a href="susimail/susimail">available</a> on -the console, which is a GPL'ed application written by susi23. The addressbook application, written by +the console, which is a GPL'ed application written by susi23. The addressbook application, written by <a href="http://ragnarok.i2p/">Ragnarok</a> helps maintain your hosts.txt files (see ./addressbook/ for more information).</p> <p>The router by default also includes human's public domain <a href="http://www.i2p2.i2p/sam">SAM</a> bridge, -which other client applications (such the <a href="http://duck.i2p/i2p-bt/">bittorrent port</a>) can use. -There is also an optimized library for doing large number calculations - jbigi - which in turn uses the -LGPL licensed <a href="http://swox.com/gmp/">GMP</a> library, tuned for various PC architectures. Launchers for windows users are built with <a href="http://launch4j.sourceforge.net/">Launch4J</a>, and the installer is built with <a href="http://www.izforge.com/izpack/">IzPack</a>. For -details on other applications available, as well as their licenses, please see the +which other client applications (such the <a href="http://duck.i2p/i2p-bt/">bittorrent port</a>) can use. +There is also an optimized library for doing large number calculations - jbigi - which in turn uses the +LGPL licensed <a href="http://swox.com/gmp/">GMP</a> library, tuned for various PC architectures. Launchers for windows users are built with <a href="http://launch4j.sourceforge.net/">Launch4J</a>, and the installer is built with <a href="http://www.izforge.com/izpack/">IzPack</a>. For +details on other applications available, as well as their licenses, please see the <a href="http://www.i2p2.i2p/licenses">license policy</a>. Source for the I2P code and most bundled client applications can be found on our <a href="http://www.i2p2.i2p/download">download page</a>. .</p> @@ -190,10 +173,7 @@ client applications can be found on our <a href="http://www.i2p2.i2p/download">d <jsp:setProperty name="contenthelper" property="maxLines" value="256" /> <jsp:setProperty name="contenthelper" property="startAtBeginning" value="true" /> <jsp:getProperty name="contenthelper" property="textContent" /> - - <p>A more complete list of changes can be found + + <p>A more complete list of changes can be found in the history.txt file in your i2p directory. - </p><hr /> -</div> -</body> -</html> + </p><br></div></body></html> diff --git a/apps/routerconsole/jsp/i2ptunnel/index.jsp b/apps/routerconsole/jsp/i2ptunnel/index.jsp index edba596ef25b4c3c8fcc92945a966ebcc8fe375a..8c7eefc2e681e1765be3c77fcdd4d275d71605f3 100644 --- a/apps/routerconsole/jsp/i2ptunnel/index.jsp +++ b/apps/routerconsole/jsp/i2ptunnel/index.jsp @@ -1,8 +1,7 @@ -<html><head><title>I2PTunnel Disabled</title> +<html><head><title>I2P Tunnel Manager Not Running</title> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="pragma" content="no-cache" /> </head> <body> -I2PTunnel is not running. Go to <a href="/configclients.jsp">the config clients page</a> -to start it. +The I2P Tunnel Manager is not currently running. Please visit the<a href="/configclients.jsp">Client Configuration</a> page to start it. </body></html> diff --git a/apps/routerconsole/jsp/index.jsp b/apps/routerconsole/jsp/index.jsp index 3056741e63e1bd09272bb087a5098d70d2ece1be..2bef637521bb9f1a6a9ac285cd0d4043929bb71d 100644 --- a/apps/routerconsole/jsp/index.jsp +++ b/apps/routerconsole/jsp/index.jsp @@ -14,9 +14,7 @@ if (System.getProperty("router.consoleNonce") == null) { } %> -<%@include file="summary.jsp" %> - -<h1>I2P Router Console</h1> +<%@include file="summary.jsp" %><h1>I2P Router Console</h1> <div class="news" id="news"> <jsp:useBean class="net.i2p.router.web.ContentHelper" id="newshelper" scope="request" /> <% java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); %> @@ -26,17 +24,12 @@ if (System.getProperty("router.consoleNonce") == null) { <jsp:useBean class="net.i2p.router.web.ConfigUpdateHelper" id="updatehelper" scope="request" /> <jsp:setProperty name="updatehelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> - <hr /><i><jsp:getProperty name="updatehelper" property="newsStatus" /></i><br /> -</div> - -<div class="main" id="main"> + <hr><i><jsp:getProperty name="updatehelper" property="newsStatus" /></i><br> +</div><div class="main" id="main"> <jsp:useBean class="net.i2p.router.web.ContentHelper" id="contenthelper" scope="request" /> <% fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getBaseDir(), "docs/readme.html"); %> <jsp:setProperty name="contenthelper" property="page" value="<%=fpath.getAbsolutePath()%>" /> <jsp:setProperty name="contenthelper" property="maxLines" value="300" /> <jsp:setProperty name="contenthelper" property="lang" value="<%=request.getParameter("lang")%>" /> <jsp:getProperty name="contenthelper" property="content" /> -</div> - -</body> -</html> +</div></body></html> diff --git a/apps/routerconsole/jsp/jobs.jsp b/apps/routerconsole/jsp/jobs.jsp index 6677dc916d8a042aed813f16d2b269bd65209b00..d75207c84d09ed130d4470083d7bc598cf1ca8ea 100644 --- a/apps/routerconsole/jsp/jobs.jsp +++ b/apps/routerconsole/jsp/jobs.jsp @@ -2,19 +2,13 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - job queue</title> +<html><head><title>I2P Router Console - job queue</title> <%@include file="css.jsp" %> </head><body> - -<%@include file="summary.jsp" %> - <h1>I2P Router Job Queue</h1> +<%@include file="summary.jsp" %><h1>I2P Router Job Queue</h1> <div class="main" id="main"> <jsp:useBean class="net.i2p.router.web.JobQueueHelper" id="jobQueueHelper" scope="request" /> <jsp:setProperty name="jobQueueHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:setProperty name="jobQueueHelper" property="writer" value="<%=out%>" /> <jsp:getProperty name="jobQueueHelper" property="jobQueueSummary" /> -</div> - -</body> -</html> +</div></body></html> diff --git a/apps/routerconsole/jsp/logs.jsp b/apps/routerconsole/jsp/logs.jsp index 0bfa685fa5952b0098c65c76491aba5bb561f7a9..3cca63d2d4f800569710a1230ed71bfe3922f36f 100644 --- a/apps/routerconsole/jsp/logs.jsp +++ b/apps/routerconsole/jsp/logs.jsp @@ -2,37 +2,27 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - logs</title> +<html><head><title>I2P Router Console - logs</title> <%@include file="css.jsp" %> </head><body> - <%@include file="summary.jsp" %> - <h1>I2P Router Logs</h1> +<h1>I2P Router Logs</h1> <div class="main" id="main"> - <div class="joblog"> - <h3>Version:</h3><a name="version"> </a> + <div class="joblog"><h3>Version:</h3><a name="version"> </a> Please include this information in bug reports. <p> -I2P <jsp:getProperty name="helper" property="version" /><br /> -<%=System.getProperty("java.vendor")%> <%=System.getProperty("java.version")%><br /> -<%=System.getProperty("os.name")%> <%=System.getProperty("os.arch")%> <%=System.getProperty("os.version")%><br /> -CPU <%=net.i2p.util.NativeBigInteger.cpuModel()%> (<%=net.i2p.util.NativeBigInteger.cpuType()%>)<br /> -jbigi <%=net.i2p.util.NativeBigInteger.loadStatus()%><br /> -Encoding <%=System.getProperty("file.encoding")%><br> - </p> - <hr /> +I2P <jsp:getProperty name="helper" property="version" /><br> +<%=System.getProperty("java.vendor")%> <%=System.getProperty("java.version")%><br> +<%=System.getProperty("os.name")%> <%=System.getProperty("os.arch")%> <%=System.getProperty("os.version")%><br> +CPU <%=net.i2p.util.NativeBigInteger.cpuModel()%> (<%=net.i2p.util.NativeBigInteger.cpuType()%>)<br> +jbigi <%=net.i2p.util.NativeBigInteger.loadStatus()%><br> +Encoding <%=System.getProperty("file.encoding")%><br></p><br> <jsp:useBean class="net.i2p.router.web.LogsHelper" id="logsHelper" scope="request" /> <jsp:setProperty name="logsHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <h3>Critical logs:</h3><a name="criticallogs"> </a> - <jsp:getProperty name="logsHelper" property="criticalLogs" /> - <hr /> + <jsp:getProperty name="logsHelper" property="criticalLogs" /><br> <h3>Router logs (<a href="configlogging.jsp">configure</a>):</h3> - <jsp:getProperty name="logsHelper" property="logs" /> - <hr /> + <jsp:getProperty name="logsHelper" property="logs" /><br> <h3>Service (Wrapper) logs:</h3><a name="servicelogs"> </a> <jsp:getProperty name="logsHelper" property="serviceLogs" /> -</div> -</div> -</body> -</html> +</div></div></body></html> diff --git a/apps/routerconsole/jsp/netdb.jsp b/apps/routerconsole/jsp/netdb.jsp index cac11bf054c5c09d49266977b51e8bd9c11f0840..83136b1137273a042e529b7c2c32661497abf8f3 100644 --- a/apps/routerconsole/jsp/netdb.jsp +++ b/apps/routerconsole/jsp/netdb.jsp @@ -6,7 +6,6 @@ <title>I2P Router Console - network database summary</title> <%@include file="css.jsp" %> </head><body> - <%@include file="summary.jsp" %> <h1>I2P Network Database Summary</h1> <div class="main" id="main"> @@ -18,7 +17,4 @@ <jsp:setProperty name="netdbHelper" property="router" value="<%=request.getParameter("r")%>" /> <jsp:setProperty name="netdbHelper" property="lease" value="<%=request.getParameter("l")%>" /> <jsp:getProperty name="netdbHelper" property="netDbSummary" /> -</div> -</div> -</body> -</html> +</div></div></body></html> diff --git a/apps/routerconsole/jsp/oldconsole.jsp b/apps/routerconsole/jsp/oldconsole.jsp index e9a557380737a34bb139a4361307398acee1cf83..803d4b63734437383273ab4aaaefe2707f140558 100644 --- a/apps/routerconsole/jsp/oldconsole.jsp +++ b/apps/routerconsole/jsp/oldconsole.jsp @@ -2,20 +2,14 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - internals</title> +<html><head><title>I2P Router Console - internals</title> <%@include file="css.jsp" %> </head><body> - <%@include file="summary.jsp" %> - <jsp:useBean class="net.i2p.router.web.OldConsoleHelper" id="conhelper" scope="request" /> <jsp:setProperty name="conhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:setProperty name="conhelper" property="writer" value="<%=out%>" /> <h1>I2P Router » Old Console</h1> <div class="main" id="main"> <jsp:getProperty name="conhelper" property="console" /> -</div> - -</body> -</html> +</div></body></html> diff --git a/apps/routerconsole/jsp/oldstats.jsp b/apps/routerconsole/jsp/oldstats.jsp index e17fa0ba8b1852e411fd53213c0ee403727b55b1..39f6c73d82309909c2e25623c1bddaf2eda0a832 100644 --- a/apps/routerconsole/jsp/oldstats.jsp +++ b/apps/routerconsole/jsp/oldstats.jsp @@ -2,20 +2,14 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - statistics</title> +<html><head><title>I2P Router Console - statistics</title> <%@include file="css.jsp" %> </head><body> - <%@include file="summary.jsp" %> - <jsp:useBean class="net.i2p.router.web.OldConsoleHelper" id="oldhelper" scope="request" /> <jsp:setProperty name="oldhelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:setProperty name="oldhelper" property="writer" value="<%=out%>" /> <h1>I2P Router Statistics</h1> <div class="main" id="main"> <jsp:getProperty name="oldhelper" property="stats" /> -</div> -</div> -</body> -</html> +</div></body></html> diff --git a/apps/routerconsole/jsp/peers.jsp b/apps/routerconsole/jsp/peers.jsp index 3d24ce65c737f26afda2e7e540ccbde3232000db..19b1d676729a2e2f7e0bda9a7e57ebde3dbc7459 100644 --- a/apps/routerconsole/jsp/peers.jsp +++ b/apps/routerconsole/jsp/peers.jsp @@ -2,13 +2,11 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - peer connections</title> +<html><head><title>I2P Router Console - peer connections</title> <%@include file="css.jsp" %> </head><body> - <%@include file="summary.jsp" %> - <h1>I2P Network Peers</h1> +<h1>I2P Network Peers</h1> <div class="main" id="main"> <jsp:useBean class="net.i2p.router.web.PeerHelper" id="peerHelper" scope="request" /> <jsp:setProperty name="peerHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> @@ -16,7 +14,4 @@ <jsp:setProperty name="peerHelper" property="urlBase" value="peers.jsp" /> <jsp:setProperty name="peerHelper" property="sort" value="<%=request.getParameter("sort") != null ? request.getParameter("sort") : ""%>" /> <jsp:getProperty name="peerHelper" property="peerSummary" /> -</div> - -</body> -</html> +</div></body></html> diff --git a/apps/routerconsole/jsp/profiles.jsp b/apps/routerconsole/jsp/profiles.jsp index 11529cf55118491ddd8bb022da96423f1e4fabe4..2ae4ff6b2689c0c7af1484c9fbf313e635649e3e 100644 --- a/apps/routerconsole/jsp/profiles.jsp +++ b/apps/routerconsole/jsp/profiles.jsp @@ -2,21 +2,15 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - peer profiles</title> +<html><head><title>I2P Router Console - peer profiles</title> <%@include file="css.jsp" %> -</head><body> - -<%@include file="summary.jsp" %> - <h1>I2P Network Peer Profiles</h1> +</head><body><%@include file="summary.jsp" %> +<h1>I2P Network Peer Profiles</h1> <div class="main" id="main"><div class="wideload"> <jsp:useBean class="net.i2p.router.web.ProfilesHelper" id="profilesHelper" scope="request" /> <jsp:setProperty name="profilesHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:getProperty name="profilesHelper" property="profileSummary" /> - <hr /> + <br> <a name="shitlist"> </a> <jsp:getProperty name="profilesHelper" property="shitlistSummary" /> -</div> -</div> -</body> -</html> +</div></div></body></html> diff --git a/apps/routerconsole/jsp/summary.jsp b/apps/routerconsole/jsp/summary.jsp index 786e48353405e1c550fb4eba7d01503a29582b0c..c7672d4f3fa39dde85d33a4fd64e94bcdd1c00b1 100644 --- a/apps/routerconsole/jsp/summary.jsp +++ b/apps/routerconsole/jsp/summary.jsp @@ -1,6 +1,6 @@ <% // put width here too to prevent bad layout at startup %> - -<div class="routersummaryouter" style="width: 200px;"> +<% // let's remove that for now since we're no longer using percentage width here %> +<div class="routersummaryouter"> <% // skip the iframe if refresh disabled String d = request.getParameter("refresh"); @@ -11,7 +11,7 @@ // pass the new delay parameter to the iframe newDelay = "?refresh=" + d; if (!"0".equals(d)) - out.print("<iframe src=\"summaryframe.jsp" + newDelay + "\" height=\"1500\" width=\"100%\" scrolling=\"auto\" frameborder=\"0\" allowtransparency=\"true\">\n"); + out.print("<iframe src=\"summaryframe.jsp" + newDelay + "\" height=\"1500\" width=\"200\" scrolling=\"auto\" frameborder=\"0\" title=\"sidepanel\">\n"); %> <div class="routersummary"> <%@include file="summarynoframe.jsp" %> @@ -22,10 +22,10 @@ } else { // since we don't have an iframe this will reload the base page, and // the new delay will be passed to the iframe above - out.print("<hr /><p><center><form action=\"" + request.getRequestURI() + "\" method=\"GET\">\n"); + out.print("<form action=\"" + request.getRequestURI() + "\" method=\"GET\">\n"); out.print("<b>Refresh (s):</b> <input size=\"3\" type=\"text\" name=\"refresh\" value=\"60\" />\n"); out.print("<button type=\"submit\">Enable</button>\n"); - out.print("</form></center></p></div>\n"); + out.print("</form></div>\n"); } %> </div> diff --git a/apps/routerconsole/jsp/summaryframe.jsp b/apps/routerconsole/jsp/summaryframe.jsp index 6be1645602217aeb37b3a447872d9aa1ccd785a6..05ad49ad7d89646fd48383d06c0cf7b6fd79170b 100644 --- a/apps/routerconsole/jsp/summaryframe.jsp +++ b/apps/routerconsole/jsp/summaryframe.jsp @@ -49,16 +49,12 @@ } } %> -</head> - -<body style="margin: 0;"> - -<div class="routersummary"> +</head><body style="margin: 0;"><div class="routersummary"> <%@include file="summarynoframe.jsp" %> <% // d and shutdownSoon defined above if (!shutdownSoon) { - out.print("<hr /><p><form action=\"summaryframe.jsp\" method=\"GET\">\n"); + out.print("<hr><form action=\"summaryframe.jsp\" method=\"GET\">\n"); if ("0".equals(d)) { out.print("<b>Refresh (s):<b> <input size=\"3\" type=\"text\" name=\"refresh\" value=\"60\" align=\"right\" />\n"); out.print("<button type=\"submit\">Enable</button>\n"); @@ -67,10 +63,7 @@ out.print("<input type=\"hidden\" name=\"refresh\" value=\"0\" />\n"); out.print("<button type=\"submit\">Disable " + d + "s Refresh</button>\n"); } - out.print("</form></p><hr />\n"); + out.print("</form><hr>\n"); } %> -</div> - -</body> -</html> +</div></body></html> diff --git a/apps/routerconsole/jsp/summarynoframe.jsp b/apps/routerconsole/jsp/summarynoframe.jsp index 507934049b00bb1b00982c453ca8f0de18860599..c772a8ffc6ae0e09ca5c998717b6598177ab84dc 100644 --- a/apps/routerconsole/jsp/summarynoframe.jsp +++ b/apps/routerconsole/jsp/summarynoframe.jsp @@ -12,7 +12,7 @@ <jsp:useBean class="net.i2p.router.web.UpdateHandler" id="update" scope="request" /> <jsp:setProperty name="update" property="*" /> <jsp:setProperty name="update" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> -<a href="index.jsp" target="_top"><img src="/themes/console/images/i2plogo.png" alt="I2P Router Console" title="I2P Router Console"/></a><hr /> +<a href="index.jsp" target="_top"><img src="/themes/console/images/i2plogo.png" alt="I2P Router Console" title="I2P Router Console"></a><hr> <% java.io.File lpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getBaseDir(), "docs/toolbar.html"); // you better have target="_top" for the links in there... if (lpath.exists()) { %> @@ -21,42 +21,33 @@ <jsp:setProperty name="linkhelper" property="maxLines" value="100" /> <jsp:getProperty name="linkhelper" property="content" /> <% } else { %> -<h3><a href="/configclients.jsp" target="_top" title="Configure startup of clients and webapps (services); manually start dormant services.">I2P Services</a></h3><hr> -<table> -<tr> -<td><a href="susidns/index.jsp" target="_blank" title="Manage your I2P hosts file here (I2P domain name resolution).">Addressbook</a> +<h3><a href="/configclients.jsp" target="_top" title="Configure startup of clients and webapps (services); manually start dormant services.">I2P Services</a></h3> +<hr><table> +<tr><td><a href="susidns/index.jsp" target="_blank" title="Manage your I2P hosts file here (I2P domain name resolution).">Addressbook</a> <a href="i2psnark/" target="_blank" title="Built-in anonymous BitTorrent Client">Torrents</a> -<a href="susimail/susimail" target="blank" title="Anonymous webmail client.">Webmail</a> -<a href="http://127.0.0.1:7658/" target="_blank" title="Anonymous resident webserver.">Webserver</a></td> -</tr></table><hr> -<h3><a href="config.jsp" target="_top" title="Configure I2P Router.">I2P Internals</a></h3><hr> -<table><tr> -<td> -<a href="tunnels.jsp" target="_top" title="View existing tunnels and tunnel build status.">Tunnels</a> -<a href="peers.jsp" target="_top" title="Show all current peer connections.">Peers</a> -<a href="profiles.jsp" target="_top" title="Show recent peer performance profiles.">Profiles</a> -<a href="netdb.jsp" target="_top" title="Show list of all known I2P routers.">NetDB</a> -<a href="logs.jsp" target="_top" title="Health Report.">Logs</a> +<a href="susimail/susimail" target="blank" title="Anonymous webmail client.">Webmail</a> +<a href="http://127.0.0.1:7658/" target="_blank" title="Anonymous resident webserver.">Webserver</a></td></tr></table> +<hr><h3><a href="config.jsp" target="_top" title="Configure I2P Router.">I2P Internals</a></h3><hr> +<table><tr><td> +<a href="tunnels.jsp" target="_top" title="View existing tunnels and tunnel build status.">Tunnels</a> +<a href="peers.jsp" target="_top" title="Show all current peer connections.">Peers</a> +<a href="profiles.jsp" target="_top" title="Show recent peer performance profiles.">Profiles</a> +<a href="netdb.jsp" target="_top" title="Show list of all known I2P routers.">NetDB</a> +<a href="logs.jsp" target="_top" title="Health Report.">Logs</a> <a href="jobs.jsp" target="_top" title="Show the router's workload, and how it's performing.">Jobs</a> -<a href="graphs.jsp" target="_top" title="Graph router performance.">Graphs</a> -<a href="oldstats.jsp" target="_top" title="Textual router performance statistics.">Stats</a> -</td></tr></table> +<a href="graphs.jsp" target="_top" title="Graph router performance.">Graphs</a> +<a href="oldstats.jsp" target="_top" title="Textual router performance statistics.">Stats</a></td></tr></table> <% } %> -<hr> -<h3><a href="help.jsp" target="_top" title="I2P Router Help.">General</a></h3><hr> -<h4> -<a title="Your unique I2P router identity is <jsp:getProperty name="helper" property="ident" />, never reveal it to anyone" href="netdb.jsp?r=." target="_top">Local Identity</a></h4> -<hr> -<table><tr> -<td align="left"> +<hr><h3><a href="help.jsp" target="_top" title="I2P Router Help.">General</a></h3><hr> +<h4><a title="Your unique I2P router identity is <jsp:getProperty name="helper" property="ident" />, never reveal it to anyone" href="netdb.jsp?r=." target="_top">Local Identity</a></h4><hr> +<table><tr><td align="left"> <b>Version:</b></td> <td align="right"><jsp:getProperty name="helper" property="version" /></td></tr> <tr title="How long we've been running for this session."> -<td align="left"> -<b>Uptime:</b></td> -<td align="right"><jsp:getProperty name="helper" property="uptime" /></td></tr></table> -<hr><h4><a href="config.jsp#help" target="_top" title="Help with configuring your firewall and router for optimal I2P performance."><jsp:getProperty name="helper" property="reachability" /></a></h4> -<hr> +<td align="left"><b>Uptime:</b></td> +<td align="right"><jsp:getProperty name="helper" property="uptime" /> +</td></tr></table> +<hr><h4><a href="config.jsp#help" target="_top" title="Help with configuring your firewall and router for optimal I2P performance."><jsp:getProperty name="helper" property="reachability" /></a></h4><hr> <% if (helper.updateAvailable() || helper.unsignedUpdateAvailable()) { // display all the time so we display the final failure message @@ -71,26 +62,27 @@ if (prev != null) System.setProperty("net.i2p.router.web.UpdateHandler.noncePrev", prev); System.setProperty("net.i2p.router.web.UpdateHandler.nonce", nonce+""); String uri = request.getRequestURI(); - out.print("<p><form action=\"" + uri + "\" method=\"GET\">\n"); + out.print("<form action=\"" + uri + "\" method=\"GET\">\n"); out.print("<input type=\"hidden\" name=\"updateNonce\" value=\"" + nonce + "\" />\n"); if (helper.updateAvailable()) out.print("<button type=\"submit\" name=\"updateAction\" value=\"signed\" >Download " + helper.getUpdateVersion() + " Update</button>\n"); if (helper.unsignedUpdateAvailable()) out.print("<button type=\"submit\" name=\"updateAction\" value=\"Unsigned\" >Download Unsigned<br>Update " + helper.getUnsignedUpdateVersion() + "</button>\n"); - out.print("</form></p>\n"); + out.print("</form>\n"); } } %> <p> <%=net.i2p.router.web.ConfigRestartBean.renderStatus(request.getRequestURI(), request.getParameter("action"), request.getParameter("consoleNonce"))%> -</p> -<hr /> -<h3><a href="peers.jsp" target="_top" title="Show all current peer connections.">Peers</a></h3><hr><table> +</p><hr><h3><a href="peers.jsp" target="_top" title="Show all current peer connections.">Peers</a></h3><hr> +<table> <tr><td align="left"><b>Active:</b></td><td align="right"><jsp:getProperty name="helper" property="activePeers" />/<jsp:getProperty name="helper" property="activeProfiles" /></td></tr> <tr><td align="left"><b>Fast:</b></td><td align="right"><jsp:getProperty name="helper" property="fastPeers" /></td></tr> <tr><td align="left"><b>High capacity:</b></td><td align="right"><jsp:getProperty name="helper" property="highCapacityPeers" /></td></tr> <tr><td align="left"><b>Integrated:</b></td><td align="right"><jsp:getProperty name="helper" property="wellIntegratedPeers" /></td></tr> -<tr><td align="left"><b>Known:</b></td><td align="right"><jsp:getProperty name="helper" property="allPeers" /></td></tr></table><hr><% +<tr><td align="left"><b>Known:</b></td><td align="right"><jsp:getProperty name="helper" property="allPeers" /></td></tr> +</table><hr> +<% if (helper.showFirewallWarning()) { %><h4><a href="config.jsp" target="_top" title="Help with firewall configuration.">Check NAT/firewall</a></h4><% } @@ -99,7 +91,7 @@ if (helper.allowReseed()) { if (reseedInProgress) { // While reseed occurring, show status message instead - out.print("<i>" + System.getProperty("net.i2p.router.web.ReseedHandler.statusMessage","") + "</i><br />"); + out.print("<i>" + System.getProperty("net.i2p.router.web.ReseedHandler.statusMessage","") + "</i><br>"); } else { // While no reseed occurring, show reseed link long nonce = new java.util.Random().nextLong(); @@ -107,38 +99,34 @@ if (prev != null) System.setProperty("net.i2p.router.web.ReseedHandler.noncePrev", prev); System.setProperty("net.i2p.router.web.ReseedHandler.nonce", nonce+""); String uri = request.getRequestURI(); - out.print("<p><form action=\"" + uri + "\" method=\"GET\">\n"); + out.print("<form action=\"" + uri + "\" method=\"GET\">\n"); out.print("<input type=\"hidden\" name=\"reseedNonce\" value=\"" + nonce + "\" />\n"); - out.print("<button type=\"submit\" >Reseed</button></form></p>\n"); + out.print("<button type=\"submit\" >Reseed</button></form>\n"); } } // If a new reseed ain't running, and the last reseed had errors, show error message if (!reseedInProgress) { String reseedErrorMessage = System.getProperty("net.i2p.router.web.ReseedHandler.errorMessage",""); if (reseedErrorMessage.length() > 0) { - out.print("<i>" + reseedErrorMessage + "</i><br />"); + out.print("<i>" + reseedErrorMessage + "</i><br>"); } } - %><hr /> -<h3><a href="config.jsp" title="Configure router bandwidth allocation." target="_top">Bandwidth in/out</a></h3><hr> + %> +<hr><h3><a href="config.jsp" title="Configure router bandwidth allocation." target="_top">Bandwidth in/out</a></h3><hr> <table> <tr><td align="left"><b>1s:</b></td><td align="right"><jsp:getProperty name="helper" property="inboundSecondKBps" />/<jsp:getProperty name="helper" property="outboundSecondKBps" />K/s</td></tr> <tr><td align="left"><b>5m:</b></td><td align="right"><jsp:getProperty name="helper" property="inboundFiveMinuteKBps" />/<jsp:getProperty name="helper" property="outboundFiveMinuteKBps" />K/s</td></tr> <tr><td align="left"><b>Total:</b></td><td align="right"><jsp:getProperty name="helper" property="inboundLifetimeKBps" />/<jsp:getProperty name="helper" property="outboundLifetimeKBps" />K/s</td></tr> <tr><td align="left"><b>Used:</b></td><td align="right"><jsp:getProperty name="helper" property="inboundTransferred" />/<jsp:getProperty name="helper" property="outboundTransferred" /></td></tr></table> -<hr> -<h3><a href="tunnels.jsp" target="_blank" title="View existing tunnels and tunnel build status.">Tunnels in/out</a></h3><hr> -<table><tr> -<td align="left"><b>Exploratory:</b></td><td align="right"><jsp:getProperty name="helper" property="inboundTunnels" />/<jsp:getProperty name="helper" property="outboundTunnels" /></td></tr> +<hr><h3><a href="tunnels.jsp" target="_top" title="View existing tunnels and tunnel build status.">Tunnels in/out</a></h3><hr> +<table> +<tr><td align="left"><b>Exploratory:</b></td><td align="right"><jsp:getProperty name="helper" property="inboundTunnels" />/<jsp:getProperty name="helper" property="outboundTunnels" /></td></tr> <tr><td align="left"><b>Client:</b></td><td align="right"><jsp:getProperty name="helper" property="inboundClientTunnels" />/<jsp:getProperty name="helper" property="outboundClientTunnels" /></td></tr> -<tr><td align="left"><b>Participating:</b></td><td align="right"><jsp:getProperty name="helper" property="participatingTunnels" /></td></tr></table> -<hr> -<h3><a href="/oldstats.jsp#JobQueue" target="_top" title="What's in the router's job queue?">Congestion</a></h3><hr> -<table><tr> -<td align="left"><b>Job lag:</b></td><td align="right"><jsp:getProperty name="helper" property="jobLag" /></td></tr> +<tr><td align="left"><b>Participating:</b></td><td align="right"><jsp:getProperty name="helper" property="participatingTunnels" /></td></tr> +</table><hr><h3><a href="/jobs.jsp" target="_top" title="What's in the router's job queue?">Congestion</a></h3><hr> +<table> +<tr><td align="left"><b>Job lag:</b></td><td align="right"><jsp:getProperty name="helper" property="jobLag" /></td></tr> <tr><td align="left"><b>Message delay:</b></td><td align="right"><jsp:getProperty name="helper" property="messageDelay" /></td></tr> <tr><td align="left"><b>Tunnel lag:</b></td><td align="right"><jsp:getProperty name="helper" property="tunnelLag" /></td></tr> -<tr><td align="left"><b>Backlog:</b></td><td align="right"><jsp:getProperty name="helper" property="inboundBacklog" /></td></tr><table align="center" title="Router tunnel build status."> -<hr><h4><jsp:getProperty name="helper" property="tunnelStatus" /></h4> -<hr> -<jsp:getProperty name="helper" property="destinations" /> +<tr><td align="left"><b>Backlog:</b></td><td align="right"><jsp:getProperty name="helper" property="inboundBacklog" /></td></tr> +</table><hr><h4><jsp:getProperty name="helper" property="tunnelStatus" /></h4><hr><jsp:getProperty name="helper" property="destinations" /> diff --git a/apps/routerconsole/jsp/tunnels.jsp b/apps/routerconsole/jsp/tunnels.jsp index 7f92aeaa4c51edad7c91e90096fff70215e31b85..e58ac07af2c9fe806e4eaf9679af2bb2c2c8fc13 100644 --- a/apps/routerconsole/jsp/tunnels.jsp +++ b/apps/routerconsole/jsp/tunnels.jsp @@ -2,19 +2,13 @@ <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>I2P Router Console - tunnel summary</title> +<html><head><title>I2P Router Console - tunnel summary</title> <%@include file="css.jsp" %> </head><body> - -<%@include file="summary.jsp" %> - <h1>I2P Tunnel Summary</h1> +<%@include file="summary.jsp" %><h1>I2P Tunnel Summary</h1> <div class="main" id="main"> <jsp:useBean class="net.i2p.router.web.TunnelHelper" id="tunnelHelper" scope="request" /> <jsp:setProperty name="tunnelHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" /> <jsp:setProperty name="tunnelHelper" property="writer" value="<%=out%>" /> <jsp:getProperty name="tunnelHelper" property="tunnelSummary" /> -</div> - -</body> -</html> +</div></body></html> diff --git a/apps/routerconsole/jsp/viewstat.jsp b/apps/routerconsole/jsp/viewstat.jsp index 331ad5ed2844d59c98ac746a67bc719cfa686b67..aee42b9585436ed04602b05c2486044a21526b2b 100644 --- a/apps/routerconsole/jsp/viewstat.jsp +++ b/apps/routerconsole/jsp/viewstat.jsp @@ -10,7 +10,7 @@ String templateFile = request.getParameter("template"); if (templateFile != null) { java.io.OutputStream cout = response.getOutputStream(); response.setContentType("image/png"); - rendered = net.i2p.router.web.StatSummarizer.instance().renderPng(cout, templateFile); + rendered = net.i2p.router.web.StatSummarizer.instance().renderPng(cout, templateFile); } net.i2p.stat.Rate rate = null; String stat = request.getParameter("stat"); @@ -19,11 +19,11 @@ boolean fakeBw = (stat != null && ("bw.combined".equals(stat))); net.i2p.stat.RateStat rs = net.i2p.I2PAppContext.getGlobalContext().statManager().getRate(stat); if ( !rendered && ((rs != null) || fakeBw) ) { long per = -1; - try { + try { if (fakeBw) per = 60*1000; else - per = Long.parseLong(period); + per = Long.parseLong(period); if (!fakeBw) rate = rs.getRate(per); if ( (rate != null) || (fakeBw) ) { @@ -63,7 +63,7 @@ if ( !rendered && ((rs != null) || fakeBw) ) { } } catch (NumberFormatException nfe) {} } -if (!rendered) { +if (!rendered) { response.sendError(404, "That stat is not available"); } %> \ No newline at end of file diff --git a/apps/streaming/java/src/net/i2p/client/streaming/SchedulerDead.java b/apps/streaming/java/src/net/i2p/client/streaming/SchedulerDead.java index 2bff627c7a99958bae5145a840a7878d52a01901..4fb78df20a4ee212322532f5ddee2768e5d47800 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/SchedulerDead.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/SchedulerDead.java @@ -8,7 +8,7 @@ import net.i2p.util.Log; * connection was reset.</p> * * <h2>Entry conditions:</h2><ul> - * <li>Both sides have closed and ACKed and the timeout has passed. <br /> + * <li>Both sides have closed and ACKed and the timeout has passed. <br> * <b>or</b></li> * <li>A RESET was received</li> * </ul> diff --git a/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java b/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java index 0b089775b3e6f92a4a047ed44d2dc1c924b409d5..02be5acd578f19d634d703c2273b6d4b464f104a 100644 --- a/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java +++ b/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java @@ -536,9 +536,9 @@ public class TransientSessionKeyManager extends SessionKeyManager { Set<OutboundSession> outbound = getOutboundSessions(); for (Iterator<OutboundSession> iter = outbound.iterator(); iter.hasNext();) { OutboundSession sess = iter.next(); - buf.append("<tr><td><b>Target key:</b> ").append(sess.getTarget().toString()).append("<br />"); - buf.append("<b>Established:</b> ").append(new Date(sess.getEstablishedDate())).append("<br />"); - buf.append("<b>Last Used:</b> ").append(new Date(sess.getLastUsedDate())).append("<br />"); + buf.append("<tr><td><b>Target key:</b> ").append(sess.getTarget().toString()).append("<br>"); + buf.append("<b>Established:</b> ").append(new Date(sess.getEstablishedDate())).append("<br>"); + buf.append("<b>Last Used:</b> ").append(new Date(sess.getLastUsedDate())).append("<br>"); buf.append("<b># Sets:</b> ").append(sess.getTagSets().size()).append("</td></tr>"); buf.append("<tr><td><b>Session key:</b> ").append(sess.getCurrentKey().toBase64()).append("</td></tr>"); buf.append("<tr><td><ul>"); diff --git a/history.txt b/history.txt index ceb9596b542eb8c6bdb22ddad65b56339347de20..6c3cf37e006f69fc419e39209bbe0553e397fd18 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,20 @@ +2009-08-19 sponge + * Java code to set Router Console password for dr|z3d + +2009-08-18 dr|z3d + * Fixes for sidepanel + * Overhauled classic theme for i2ptunnels + * First stage of code validation to fix broken and "illegal" code + * Multifarious other UI tweaks and fiddles. + +2009-08-15 sponge + * Merge in dr|z3d and my own html fixes for router console java and jsp + files so that Opera (and now IE?) doesn't puke anymore on the missing + and misplaced HTML tags. + * Optimized all jsp files so that they are shorter to save space, which + is then used to fix the broken HTML. We should break even space-wise. + * Bump to -13. + 2009-08-11 sponge * Code Janitor time! Many fixes and documenting fixes that should be done in the future. for the most part, this is a general code cleanup. diff --git a/installer/resources/themes/console/classic/console.css b/installer/resources/themes/console/classic/console.css index 62296c191fc2bee98dbcda2e4154cc3cf944db45..8b04beace4e0a0012296df391d3403deb4b7d8c9 100644 --- a/installer/resources/themes/console/classic/console.css +++ b/installer/resources/themes/console/classic/console.css @@ -1,4 +1,4 @@ -/* Optimised for less capable browers and system specifications */ +/* Optimised for less capable browsers and system specifications */ body { margin: 2px 0 0 2px; @@ -20,7 +20,8 @@ img { pre { overflow: auto; font-size: 8pt !important; - width: 100%; + width: 95%; + padding-top: 10px; } div.logo { @@ -110,7 +111,7 @@ div.toolbar { div.routersummaryouter { float: left; - width: 205px; + width: 200px; margin: 0; padding: 0; border: 0; @@ -119,7 +120,7 @@ div.routersummaryouter { div.routersummary { background: #ddf; - width: 190px; + width: 185px; color: inherit; margin: 0; padding: 7px 1px; @@ -171,7 +172,7 @@ div.routersummary h4 { div.routersummary table { border: 0; text-align: center !important; - margin: -5px 5px; + margin: -5px 5px -5px 2px; width: 180px !important; overflow: hidden; font-size: 8pt; @@ -225,7 +226,7 @@ div.warning h3 { } div.main { - margin: 0px 0px 0px 196px; + margin: 0px 0px 0px 195px; padding: 15px 15px 15px 15px; background: #eef; border: 5px solid #bbf; @@ -251,7 +252,7 @@ div.main textarea { } div.news { - margin: -5px 0px 0 196px; + margin: -5px 0px 0 195px; padding: -10px 15px 8px 15px; background: #ffffc0; border: 5px solid #bbf; @@ -271,7 +272,7 @@ div.news li { list-style: none; margin: -15px 15px -20px -20px; padding: 0px 0 15px 0; - border-bottom: 2px solid #cc7; + border-bottom: 5px solid #cc7; border-top: 0px solid #cc7; padding: 3px 5px 5px 5px; font-size: 12pt; @@ -358,7 +359,7 @@ h1 { text-align: center; border: 5px solid #bbf; padding: 13px 10px 12px 10px; - margin: 0 0px 0 196px; + margin: 0 0px 0 195px; line-height: 93%; text-transform: uppercase; letter-spacing: 0.3em; diff --git a/installer/resources/themes/console/classic/default.css b/installer/resources/themes/console/classic/default.css index 88aa40d7f7aa74f506acc75ef0a9a52826acce5e..efdfd191b97bb1bbc0f2c34b69845599afde6286 100644 --- a/installer/resources/themes/console/classic/default.css +++ b/installer/resources/themes/console/classic/default.css @@ -1,182 +1,204 @@ body { - margin : 0px; - padding : 0px; - text-align : center; - font-family : Arial, Helvetica, sans-serif; - background-color : #ffffff; - color : #000000; - font-size : 100%; - - /* we've avoided Tantek Hacks so far, - ** but we can't avoid using the non-w3c method of - ** box rendering. (and therefore one of mozilla's - ** proprietry -moz properties (which hopefully they'll - ** drop soon). - */ - -moz-box-sizing : border-box; - box-sizing : border-box; + margin: 0px; + padding: 0px; + text-align: center; + font: 10pt/140% "Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif; + background: #bbf; + color: #000; + -moz-box-sizing: border-box; + box-sizing: border-box; } div { - -moz-box-sizing : border-box; - box-sizing : border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } h4, label { - margin : 0px; - padding : 2px; - float : left; - width : 150px; - height : 24px; - font-weight : bold; - text-align : right; - font-size : 1.0em; - -moz-box-sizing: border-box; - box-sizing : border-box; + margin: 0px; + padding: 2px; + float: left; + width: 150px; + height: 24px; + font-weight: normal; + text-align: right; + font-size: 8.5pt; + -moz-box-sizing: border-box; + box-sizing: border-box; } h4 { - font-size : 1.2em; - text-align : center; - width : 750px; + font-size: 10.5pt; + text-align: center !important; + font-weight: bold; + border: 1px solid #77f; + border-top: 2px solid #77f; + margin: -6px 0 5px -10px !important; + padding: 5px 10px 25px 10px; + background: #fff; + text-shadow: 0px 0px 1px rgba(32, 32, 192, 0.3); + text-transform: uppercase; + white-space: nowrap; + width: 782px; + letter-spacing: 0.09em; +} + +label { + font-style: italic; + margin: 0 3px 0 -3px; } a { - text-decoration : none; + text-decoration: none; } form { - margin : 0px; + margin: 0px; } textarea, input, select, button, a { - font-family : Arial, Helvetica, sans-serif; - -moz-box-sizing : border-box; - box-sizing : border-box; - font-size : 1.0em; - float : left; + -moz-box-sizing: border-box; + box-sizing: border-box; + font: 8pt "Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif; + float: left; + margin: 2px 0 5px 0; } button { - float : none; + float: none; + height: 20px !important; } textarea { - border : 1px solid #ddddc0; + border: 1px solid #ddddc0; } br { - clear : left; + clear: left; } div.statusNotRunning { - float : left; - width : 82px; - height : 24px; - color : #dd0000; + float: left; + width: 82px; + height: 24px; + color: #d00; } + div.statusRunning { - float : left; - width : 82px; - height : 24px; - color : #00dd00; + float: left; + width: 82px; + height: 24px; + color: #0d0; } + div.statusStarting { - float : left; - width : 82px; - height : 24px; - color : #339933; + float: left; + width: 82px; + height: 24px; + color: #393; } hr { - display : none; + display: none; } .separator, .subdivider { - clear : both; - height : 1px; - margin : 3px 0px 3px 0px; - border-bottom : 1px solid #ddddc0; + clear: both; + height: 1px; + margin: 5px -8px 5px -8px; + border-bottom: 1px solid #aaf; } .subdivider { - border-bottom : 1px dashed #ddddc0; + border-bottom: 1px dotted #aaf; + margin: 0 0 10px 0; } .freetext { - width : 150px; - height : 22px; - border : 1px solid #aaaac0; + width: 150px; + height: 22px; + border: 1px solid #aaf; } .control { - margin : 0 4px 0 0; - padding : 0 0 4px 0; - overflow : hidden; - height : 20px; - width : 60px; - font-weight : normal; - background-color : #dddddd; - color : black; - border : 1px outset #ddddc0; - text-align : center; - white-space : nowrap; + margin: 2px; + padding: 2px; + overflow: hidden; + height: 20px; + width: 60px; + font-weight: bold; + background: #ddd; + color: #000; + border: 1px outset #ddddc0; + text-align: center; + vertical-align: middle; + white-space: nowrap; } .control:hover { - background-color : #ffffed; + background: #229; + color: #fff; } .control:active { - border : 2px inset; + border: 2px inset; } .panel { - width : 760px; - margin : 16px auto 16px auto; - overflow : hidden; - text-align : left; - font-size : 0.8em; - background-color : #ffffef; - border : 4px solid #ffffd0; + width: 790px; + margin: 16px auto 16px auto; + padding: 5px 10px; + overflow: hidden; + text-align: left; + font-size: 8pt; + background: #eef; + border: 4px solid #77f; + -moz-box-shadow: inset 0px 0px 0px 1px #99f; } .panel .footer { - float : right; - padding : 4px; + + padding: 4px; } .toolbox { - float : right; + width: 100%; } .rowItem { - width : 750px; - float : left; - margin : 0px; + width: 750px; + float: left; + margin: 0px; } .comment { - font-style : italic; + font-style: italic; + white-space: nowrap; } .text { - height : 24px; - width : 150px; - padding : 2px 0 0 2px; - float : left; - margin : 0; + height: 24px; + width: 150px; + padding: 2px 0 0 2px; + float: left; + margin: 0; + font-weight: bold; } .accessKey { - text-decoration : underline; + text-decoration: underline; } #globalOperationsPanel { - background-color : #ffefef; - border : 4px solid #ffd0d0; + background: #eef; + border: 4px solid #77f; + -moz-box-shadow: inset 0px 0px 0px 1px #900; + padding: 5px 5px 10px 5px; + text-align: right; } #globalOperationsPanel .control { - width : 100px; -} + width: 100px !important; + margin-top: 3px; + float: right; +} \ No newline at end of file diff --git a/installer/resources/themes/console/classic/i2ptunnel.css b/installer/resources/themes/console/classic/i2ptunnel.css index 814cab8923b4001ae8daf6d92a632b56368764cc..2128c7e737a96e9b75afb96ab328a0c1cadf483a 100644 --- a/installer/resources/themes/console/classic/i2ptunnel.css +++ b/installer/resources/themes/console/classic/i2ptunnel.css @@ -110,9 +110,11 @@ } #tunnelListPage textarea { - width : 750px; - height : 100px; + width : 100%; + height : 88px; padding : 0 0 0 4px; + color: green; + margin-bottom: 7px; } #tunnelListPage .footer .control { diff --git a/installer/resources/themes/console/classic/ieshim.css b/installer/resources/themes/console/classic/ieshim.css index 065127429377175fad2f8dcd9d4cbefee38099a9..2963dcf8a294d09005cf2372aa4607427805439d 100644 --- a/installer/resources/themes/console/classic/ieshim.css +++ b/installer/resources/themes/console/classic/ieshim.css @@ -122,7 +122,7 @@ div.routersummary hr { div.routersummary h3 { border: 0px solid #f00; text-align: center !important; - font-size: 10pt; + font-size: 9pt; letter-spacing: 0.05em; margin: -14px 0px -15px 1px; padding: 5px 0px 5px 0px; @@ -133,7 +133,7 @@ div.routersummary h3 { div.routersummary h4 { border: 0px solid #f00; border-bottom: 0 !important; - font-size: 9pt; + font-size: 8.5pt; letter-spacing: 0.05em; margin: -14px 0px -15px 1px !important; padding: 2px 3px 3px 3px; @@ -154,6 +154,7 @@ div.routersummary table { padding: 0px -10px; background-image: none !important; background-color: transparent !important; + text-align: center !important; } div.routersummary tr { @@ -172,10 +173,12 @@ div.routersummary p { padding: 0; } +/* div.routersummary img { margin: 5px -10px -5px -10px; overflow: hidden; } +*/ div.routersummary a:link, div.routersummary a:visited { text-shadow: 0px 0px 1px rgba(0, 0, 32, 0.3); diff --git a/installer/resources/themes/console/dark/console.css b/installer/resources/themes/console/dark/console.css index fe902cb1e99bc55d26c7201360f8beb413209a22..d36db5c62b9bde8b2fbafe04711440bd9c408480 100644 --- a/installer/resources/themes/console/dark/console.css +++ b/installer/resources/themes/console/dark/console.css @@ -1,7 +1,7 @@ /* Not yet complete. Subject to flux and change. dr|z3d - 07.25.09 */ body { - margin: 25px 10px 0 5px; + margin: 20px 5px 0 15px; padding: 0; text-align: center; background: #002; @@ -79,7 +79,7 @@ a:active{ div.routersummaryouter { float: left; width: 200px; - margin: 0 0 10px 20px; + margin: 0 0 10px 5px; padding: 0; border: 0; clear: left;/* fixes a bug in Opera */ @@ -125,7 +125,7 @@ div.routersummary hr { div.routersummary h3 { border: 0; font-size: 10pt; - letter-spacing: 0.05em; + letter-spacing: 0.04em; margin: -7px -9px -10px -9px; padding: 3px 0px 5px 0px; background: #007; @@ -140,8 +140,8 @@ div.routersummary h3 { div.routersummary h4 { border: 0; border-bottom: 0 !important; - font-size: 9pt; - letter-spacing: 0.05em; + font-size: 8.5pt; + letter-spacing: 0.03em; margin: -7px -9px -10px -9px !important; padding: 2px 3px 5px 3px; background: #005; @@ -154,7 +154,7 @@ div.routersummary h4 { div.routersummary table { border: 0; text-align: center !important; - margin: -5px -5px; + margin: -1px -4px -4px -4px; width: 185px !important; overflow: hidden; font-size: 8pt; @@ -178,7 +178,7 @@ div.routersummary p { } div.routersummary a:link, div.routersummary a:visited { - text-shadow: 0px 0px 1px rgba(0, 0, 32, 0.3); + text-shadow: 0px 0px 1px rgba(192, 192, 255, 0.5); } div.routersummary a:hover { @@ -224,7 +224,7 @@ div.warning { } div.main { - margin: 0px 0px 20px 215px; + margin: 0px 0px 20px 195px; padding: 0 15px 15px 25px; background: #002; text-align: left; @@ -240,7 +240,7 @@ div.main textarea { } div.news { - margin: 0px 15px 20px 240px; + margin: 0px 15px 20px 220px; padding: 20px 30px 20px 30px; border: 1px solid #99f; background: #004; @@ -266,7 +266,7 @@ div.news li { div.confignav { padding: 15px 10px !important; - margin: 0 0 25px 0; + margin: 0 0 15px 0; background: #004 url('images/darkbluebg.png'); -moz-border-radius: 4px; -khtml-border-radius: 4px; @@ -325,7 +325,7 @@ div.messages li { } div.graphspanel { - padding: 15px 15px 15px 15px; + padding: 15px; margin: 10px 0px; background: #005; -moz-border-radius: 4px; @@ -336,6 +336,12 @@ div.graphspanel { -moz-box-shadow: inset 0px 0px 1px 0px #eef; -khtml-box-shadow: inset 0px 0px 1px 0px #eef; box-shadow: inset 0px 0px 1px 0px #eef; + text-align: center; +} + +div.graphspanel form { + text-align: left; + padding: 15px; } div.graphspanel img { @@ -347,7 +353,7 @@ div.graphspanel img { -moz-box-shadow: inset 0px 0px 1px 0px #eef; -khtml-box-shadow: inset 0px 0px 1px 0px #eef; box-shadow: inset 0px 0px 1px 0px #eef; - opacity: 0.9; + opacity: 0.8; } div.graphspanel img:hover { @@ -361,6 +367,7 @@ div.graphspanel img:hover { box-shadow: inset 0px 0px 1px 1px #f60; opacity: 1; } + table { border-collapse: collapse; width: 100%; @@ -497,7 +504,7 @@ h1 { text-align: left; color: #fff; padding: 10px 15px; - margin: 0 15px 25px 240px; + margin: 0 15px 15px 220px; font-size: 16pt; font-weight: bold; font-style: normal; @@ -529,7 +536,7 @@ h2 { -moz-border-radius: 4px; -khtml-border-radius: 4px; vertical-align: middle; - margin: 25px 0 20px 0 !important; + margin: 15px 0 10px 0 !important; -moz-box-shadow: inset 0px 0px 1px 0px #eef; -khtml-box-shadow: inset 0px 0px 1px 0px #eef; box-shadow: inset 0px 0px 1px 0px #eef; @@ -757,8 +764,8 @@ form {} } .joblog { - margin: 25px 0 25px 0; - padding: 20px 30px 20px 30px !important; + margin: 15px 0 15px 0; + padding: 20px !important; border: 1px solid #99f; background-color: #004; background: url("images/darkbluebg.png"); diff --git a/installer/resources/themes/console/images/local_down.png b/installer/resources/themes/console/images/local_down.png index 14c7d4b9294e4109af51437ba8ac18d45710f673..4d056de5da5e89dc55609522bfc9224526665236 100644 Binary files a/installer/resources/themes/console/images/local_down.png and b/installer/resources/themes/console/images/local_down.png differ diff --git a/installer/resources/themes/console/images/local_inprogress.png b/installer/resources/themes/console/images/local_inprogress.png index d8fcfe44e89f608f35bcee1569d1e8acea324da8..245dc058d8274486f073b53ed73763e97d0e0af5 100644 Binary files a/installer/resources/themes/console/images/local_inprogress.png and b/installer/resources/themes/console/images/local_inprogress.png differ diff --git a/installer/resources/themes/console/images/local_up.png b/installer/resources/themes/console/images/local_up.png index 1b70292fe7d3942a6582b9d27d2f4448e0665e46..5b8a3451707baef478833ea6a3411a523bea0661 100644 Binary files a/installer/resources/themes/console/images/local_up.png and b/installer/resources/themes/console/images/local_up.png differ diff --git a/installer/resources/themes/console/light/console.css b/installer/resources/themes/console/light/console.css index be4f6a3d6aeda98f71bf44281541cdf2e406bd3c..6138ab4c8982631a4146717797215bf0e5cf3763 100644 --- a/installer/resources/themes/console/light/console.css +++ b/installer/resources/themes/console/light/console.css @@ -119,21 +119,21 @@ div.routersummary hr { } div.routersummary h3 { - border: 0px solid #f00; -/* border-bottom: 1px solid #99f !important;*/ + border: 0; font-size: 10pt; - letter-spacing: 0.05em; + letter-spacing: 0.04em; margin: -7px -9px -7px -9px; padding: 5px 0px 5px 0px; background: #c5d5fb; text-transform: uppercase; + background-image: -moz-linear-gradient(top, bottom, from(#ddf), to(#c5d5fb), color-stop(25%, #c5d5fb), color-stop(100%, #ddf)); } div.routersummary h4 { border: 0px solid #f00; border-bottom: 0 !important; - font-size: 9pt; - letter-spacing: 0.05em; + font-size: 8.5pt; + letter-spacing: 0.02em; margin: -7px -9px -7px -9px !important; padding: 2px 3px 3px 3px; background: #c1d1f7; @@ -145,7 +145,7 @@ div.routersummary h4 { div.routersummary table { border: 0; text-align: center !important; - margin: -5px -5px; + margin: -2px -4px; width: 185px !important; overflow: hidden; font-size: 8pt; @@ -169,11 +169,11 @@ div.routersummary p { } div.routersummary a:link, div.routersummary a:visited { - text-shadow: 0px 0px 1px rgba(0, 0, 32, 0.3); + text-shadow: 0px 0px 1px rgba(0, 0, 32, 0.5); } div.routersummary a:hover { - text-shadow: 0px 0px 1px rgba(255, 96, 0, 0.7); + text-shadow: 0px 0px 0.5px rgba(255, 255, 255, 0.7); color: #f60; } diff --git a/installer/resources/themes/console/snark.css b/installer/resources/themes/console/snark.css index a5551156fc1615a2540680423c5aa1dcea56edf3..13c233add72e0daeba1508dda90f2b9b3d8885cb 100644 --- a/installer/resources/themes/console/snark.css +++ b/installer/resources/themes/console/snark.css @@ -47,7 +47,7 @@ body { color: #f30; border-bottom: 3px solid #f30; border-top: 3px solid #f30; - text-shadow: 0px 0px 1px rgba(255, 163, 0, 0.9); + text-shadow: 0px 0px 1px rgba(255, 32, 0, 0.5); } .snarkMessages { @@ -95,7 +95,7 @@ th { border-top: 1px outset #001; border-bottom: 1px inset #001; background: #f60 url('/themes/console/images/tabletitleorange.png') repeat-x; - text-align: right; +/* text-align: right; */ whitespace: nowrap; } @@ -107,7 +107,7 @@ th { td { padding: 5px; - text-align: right; +/* text-align: right;*/ } .snarkTorrentEven { background-color: #fb1; @@ -139,8 +139,8 @@ td { color:#310; min-width: 800px !important; /* max-width: 800px !important; */ - margin: 20px; - padding: 10px 20px 5px 20px; + margin: 5px 0px; + padding: 10px 10px 0px 10px; -moz-border-radius: 4px; -khtml-border-radius: 4px; border-radius: 4px; @@ -224,7 +224,7 @@ img:hover{ div.section { - margin: 0 0 20px 0; + margin: 0 0 10px 0; padding: 10px; background: #ffe; border: 1px solid #001; @@ -241,7 +241,7 @@ div.section { } div.mainsection { - margin: 0 0 20px 0; + margin: 0 0 10px 0; padding: 10px; background: #ffe; border: 1px solid #001; @@ -258,7 +258,7 @@ div.mainsection { } div.newtorrentsection { - margin: 0 0 20px 0; + margin: 0 0 10px 0; padding: 10px; background: #ffe; border: 1px solid #001; @@ -275,7 +275,7 @@ div.newtorrentsection { } div.addtorrentsection { - margin: 0 0 20px 0; + margin: 0 0 10px 0; padding: 10px; background: #ffe; border: 1px solid #001; @@ -292,7 +292,7 @@ div.addtorrentsection { } div.configsection { - margin: 0 0 20px 0; + margin: 0; padding: 10px; background: #ffe; border: 1px solid #001; @@ -317,7 +317,7 @@ div.configsection a:hover{ } .snarknavbar { - margin: 5px 0 20px 0 !important; + margin: 0 0 10px 0 !important; padding: 10px; border: 1px solid #001; -moz-border-radius: 4px; @@ -326,4 +326,10 @@ div.configsection a:hover{ background: #eef; -moz-box-shadow: inset 0px 0px 1px 0px #002; background: #ddf url('../console/light/images/tabletile.png'); + text-transform: uppercase !important; + letter-spacing: 0.05em; + font-weight: bold; + font-size: 11pt; + color: #001; + text-shadow: 0px 0px 1px rgba(0, 0, 148, 0.9); } diff --git a/readme.html b/readme.html index 3992598933c97cc28132bfcb60bcd612545ea833..926f5b366f5aa9436c8f1f3e3a48f37606e66a01 100644 --- a/readme.html +++ b/readme.html @@ -1,83 +1,81 @@ -<div align="right"> - <div class="langbox" align="right"><a href="/index.jsp?lang=en"><img src="/flags.jsp?c=us" title="English" alt="English"></a> - <a href="/index.jsp?lang=zh"><img src="/flags.jsp?c=cn" title="Chinese" alt="Chinese"></a> - <a href="/index.jsp?lang=de"><img src="/flags.jsp?c=de" title="Deutsch" alt="Deutsch"></a> - <a href="/index.jsp?lang=fr"><img src="/flags.jsp?c=fr" title="Français" alt="Français"></a> - <a href="/index.jsp?lang=nl"><img src="/flags.jsp?c=nl" title="Nederlands" alt="Nederlands"></a> - <a href="/index.jsp?lang=sv"><img src="/flags.jsp?c=se" title="Svenska" alt="Svenska"></a></div> -</div> -<h2>Welcome to I2P!</h2> -<p>If you've just started I2P, the Active: numbers on the left should start to - grow over the next few minutes and you'll see a "shared clients" local destination - listed on the left (if not, <a href="#trouble">see below</a>). Once those show - up, you can: -<ul> - <li><b>browse "eepsites"</b> - on I2P there are anonymously hosted websites - - tell your browser to use the <b>HTTP proxy at 127.0.0.1 port 4444</b>, then - browse to an eepsite:<br /> - <ul class="links"> - <li><a href="http://inproxy.tino.i2p/status.php">inproxy.tino.i2p</a> - and <a href="http://perv.i2p/stats.cgi">perv.i2p</a>: sites tracking active - eepsites</li> - <li><a href="http://forum.i2p/">forum.i2p</a>: a secure - and anonymous connection to <a href="http://forum.i2p2.de/">forum.i2p2.de</a></li> - <li><a href="http://www.i2p2.i2p/">www.i2p2.i2p</a> and - mirror <a href="http://i2p-projekt.i2p">i2p-projekt.i2p</a>: secure and - anonymous connections to <a href="http://www.i2p2.de/">www.i2p2.de</a></li> - <li><a href="http://eepsites.i2p/">eepsites.i2p</a>: an - anonymously hosted search engine of eepsites</li> - <li><a href="http://ugha.i2p/">ugha.i2p</a>: ugha's eepsite, - a wiki that anyone can edit, and lots of links</li> - <li><a href="http://fproxy.tino.i2p">fproxy.tino.i2p</a>: - Freenet proxy</li> - <li><a href="http://echelon.i2p">echelon.i2p</a>: software - archive and information for I2P</li> - <p></p> - There are many more eepsites - just follow the links from the ones you see, - bookmark your favorites, and visit them often! - </ul></ul> - <br /> - <br /> - <ul> - <li class="tidylist"><b>browse the web</b> - there is currently an HTTP - "outproxy" in I2P hooked up to your own HTTP proxy on port 4444 - simply - set your browser's proxy to use it (as above) and go to any normal URL - - your requests will be bounced through the I2P network.</li> - <li class="tidylist"><b>transfer files</b> - there is an integrated <a href="/i2psnark">port</a> - of the <a href="http://www.klomp.org/snark/">Snark</a> <a href="http://www.bittorrent.com/">BitTorrent</a> - client.</li> - <li class="tidylist"><b>use anonymous email</b> - postman has created a - mail system compatible with normal mail clients (POP3 / SMTP) that allows - email within I2P as well as mail from and to the normal internet! get - your account at <a href="http://hq.postman.i2p/">hq.postman.i2p</a>. We - bundle <a href="/susimail/susimail">susimail</a>, a web based anonymity-oriented - pop3/smtp client configured to access postman's mail services.</li> - <li class="tidylist"><b>chat anonymously</b> - fire up your own IRC client - and connect to the server at <b>127.0.0.1 port 6668</b>. This points at - one of two anonymously hosted IRC servers, but neither you nor they know - where the other is.</li> - <li class="tidylist"><b>blog anonymously</b> - check out <a href="http://syndie.i2p2.de/">Syndie</a></li> - <li class="tidylist">and lots more</li> - </ul> -</ul> -<h2>Want your own eepsite?</h2> -<p>We've bundled some software to let you run your own eepsite - a <a href="http://jetty.mortbay.org/">Jetty</a> - instance listening on <a href="http://127.0.0.1:7658/">http://127.0.0.1:7658/</a>. - Simply place your files in the <code>eepsite/docroot/</code> directory (or place - any standard JSP/Servlet <code>.war</code> files under <code>eepsite/webapps</code>, - or standard CGI script under <code>eepsite/cgi-bin</code>) and they'll show - up. After starting up an <a href="/i2ptunnel/">eepsite tunnel</a> pointing at - it, your eepsite will be visible to others. Detailed instructions for starting - your eepsite are on <a href="http://127.0.0.1:7658/">your temporary eepsite - page</a>. </p> -<h2><a name="trouble">Troubleshooting</a></h2> -<p>Be patient - I2P may be slow to start the first time as it searches for peers. - If, after 30 minutes, your Active: connected/recent count has less than 10 connected - peers, you should open port 8887 on your firewall for better connectivity. If - you cannot see any eepsites at all (even <a href="http://www.i2p2.i2p/">www.i2p2.i2p</a>), - be sure your browser proxy is set to 127.0.0.1 port 4444. You may also want - to review the information on the <a href="http://www.i2p2.i2p/">I2P website</a>, - post up messages to the <a href="http://forum.i2p2.de/">I2P discussion forum</a>, - or swing by #i2p or #i2p-chat on IRC at <a href="irc://irc.freenode.net/#i2p">irc.freenode.net</a>, - irc.postman.i2p or irc.freshcoffee.i2p (they're linked together).</p> -<hr /> +<div align="right"> + <div class="langbox" align="right"><a href="/index.jsp?lang=en"><img src="/flags.jsp?c=us" title="English" alt="English"></a> + <a href="/index.jsp?lang=zh"><img src="/flags.jsp?c=cn" title="Chinese" alt="Chinese"></a> + <a href="/index.jsp?lang=de"><img src="/flags.jsp?c=de" title="Deutsch" alt="Deutsch"></a> + <a href="/index.jsp?lang=fr"><img src="/flags.jsp?c=fr" title="Français" alt="Français"></a> + <a href="/index.jsp?lang=nl"><img src="/flags.jsp?c=nl" title="Nederlands" alt="Nederlands"></a> + <a href="/index.jsp?lang=sv"><img src="/flags.jsp?c=se" title="Svenska" alt="Svenska"></a></div> +</div> +<h2>Welcome to I2P!</h2> +<p>If you've just started I2P, the Active: numbers on the left should start to + grow over the next few minutes and you'll see a "shared clients" local destination + listed on the left (if not, <a href="#trouble">see below</a>). Once those show +up, you can:</p> +<ul> + <li><b>browse "eepsites"</b> - on I2P there are anonymously hosted websites + - tell your browser to use the <b>HTTP proxy at 127.0.0.1 port 4444</b>, then + browse to an eepsite:<br /> + <ul class="links"> + <li><a href="http://inproxy.tino.i2p/status.php">inproxy.tino.i2p</a> + and <a href="http://perv.i2p/stats.cgi">perv.i2p</a>: sites tracking active + eepsites</li> + <li><a href="http://forum.i2p/">forum.i2p</a>: a secure + and anonymous connection to <a href="http://forum.i2p2.de/">forum.i2p2.de</a></li> + <li><a href="http://www.i2p2.i2p/">www.i2p2.i2p</a> and + mirror <a href="http://i2p-projekt.i2p">i2p-projekt.i2p</a>: secure and + anonymous connections to <a href="http://www.i2p2.de/">www.i2p2.de</a></li> + <li><a href="http://eepsites.i2p/">eepsites.i2p</a>: an + anonymously hosted search engine of eepsites</li> + <li><a href="http://ugha.i2p/">ugha.i2p</a>: ugha's eepsite, + a wiki that anyone can edit, and lots of links</li> + <li><a href="http://fproxy.tino.i2p">fproxy.tino.i2p</a>: + Freenet proxy</li> + <li><a href="http://echelon.i2p">echelon.i2p</a>: software + archive and information for I2P</li> + </ul></ul><ul> + There are many more eepsites - just follow the links from the ones you see, + bookmark your favorites, and visit them often! + </ul> + <ul> + <li class="tidylist"><b>browse the web</b> - there is currently an HTTP + "outproxy" in I2P hooked up to your own HTTP proxy on port 4444 - simply + set your browser's proxy to use it (as above) and go to any normal URL + - your requests will be bounced through the I2P network.</li> + <li class="tidylist"><b>transfer files</b> - there is an integrated <a href="/i2psnark">port</a> + of the <a href="http://www.klomp.org/snark/">Snark</a> <a href="http://www.bittorrent.com/">BitTorrent</a> + client.</li> + <li class="tidylist"><b>use anonymous email</b> - postman has created a + mail system compatible with normal mail clients (POP3 / SMTP) that allows + email within I2P as well as mail from and to the normal internet! get + your account at <a href="http://hq.postman.i2p/">hq.postman.i2p</a>. We + bundle <a href="/susimail/susimail">susimail</a>, a web based anonymity-oriented + pop3/smtp client configured to access postman's mail services.</li> + <li class="tidylist"><b>chat anonymously</b> - fire up your own IRC client + and connect to the server at <b>127.0.0.1 port 6668</b>. This points at + one of two anonymously hosted IRC servers, but neither you nor they know + where the other is.</li> + <li class="tidylist"><b>blog anonymously</b> - check out <a href="http://syndie.i2p2.de/">Syndie</a></li> + <li class="tidylist">and lots more</li> + </ul> +</ul> +<h2>Want your own eepsite?</h2> +<p>We've bundled some software to let you run your own eepsite - a <a href="http://jetty.mortbay.org/">Jetty</a> + instance listening on <a href="http://127.0.0.1:7658/">http://127.0.0.1:7658/</a>. + Simply place your files in the <code>eepsite/docroot/</code> directory (or place + any standard JSP/Servlet <code>.war</code> files under <code>eepsite/webapps</code>, + or standard CGI script under <code>eepsite/cgi-bin</code>) and they'll show + up. After starting up an <a href="/i2ptunnel/">eepsite tunnel</a> pointing at + it, your eepsite will be visible to others. Detailed instructions for starting + your eepsite are on <a href="http://127.0.0.1:7658/">your temporary eepsite + page</a>. </p> +<h2><a name="trouble">Troubleshooting</a></h2> +<p>Be patient - I2P may be slow to start the first time as it searches for peers. + If, after 30 minutes, your Active: connected/recent count has less than 10 connected + peers, you should open port 8887 on your firewall for better connectivity. If + you cannot see any eepsites at all (even <a href="http://www.i2p2.i2p/">www.i2p2.i2p</a>), + be sure your browser proxy is set to 127.0.0.1 port 4444. You may also want + to review the information on the <a href="http://www.i2p2.i2p/">I2P website</a>, + post up messages to the <a href="http://forum.i2p2.de/">I2P discussion forum</a>, + or swing by #i2p or #i2p-chat on IRC at <a href="irc://irc.freenode.net/#i2p">irc.freenode.net</a>, + irc.postman.i2p or irc.freshcoffee.i2p (they're linked together).</p> +<hr> diff --git a/router/java/src/net/i2p/router/Blocklist.java b/router/java/src/net/i2p/router/Blocklist.java index a4375c0ab5705ebf74c1723af6e745f472047833..eecaeccf1165104186f1622008cb0e84bcd2c158 100644 --- a/router/java/src/net/i2p/router/Blocklist.java +++ b/router/java/src/net/i2p/router/Blocklist.java @@ -778,7 +778,7 @@ public class Blocklist { if (to != from) { out.write(toStr(to)); out.write("</td></tr>\n"); } else - out.write(" </td></tr>\n"); + out.write(" </td></tr>\n"); } if (_blocklistSize > MAX_DISPLAY) out.write("<tr><th colspan=2>First " + MAX_DISPLAY + " displayed, see the " + diff --git a/router/java/src/net/i2p/router/JobQueue.java b/router/java/src/net/i2p/router/JobQueue.java index 65ec82b6710eb35ec2c6147700ea595bfd2c6df5..2aa79693f7c26c95dc60df328b692dadc662ded0 100644 --- a/router/java/src/net/i2p/router/JobQueue.java +++ b/router/java/src/net/i2p/router/JobQueue.java @@ -615,7 +615,7 @@ public class JobQueue { // for (int i = 0; i < states.length; i++) // buf.append(states[i]).append(" "); //buf.append(']'); - buf.append("</b><br />\n"); + buf.append("</b><br>\n"); long now = _context.clock().now(); diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java index ca01ca666ca55871fb48756e40137f085f129290..f49a3814631cf0dcfd629437e49599b720ca86de 100644 --- a/router/java/src/net/i2p/router/Router.java +++ b/router/java/src/net/i2p/router/Router.java @@ -597,23 +597,23 @@ public class Router { "<option value=\"/oldconsole.jsp#netdb\">Network Database</option>\n" + "<option value=\"/oldconsole.jsp#logs\">Log messages</option>\n" + "</select> <input type=\"submit\" value=\"GO\" /> </form>" + - "<hr />\n"); + "<hr>\n"); StringBuilder buf = new StringBuilder(32*1024); if ( (_routerInfo != null) && (_routerInfo.getIdentity() != null) ) - buf.append("<b>Router: </b> ").append(_routerInfo.getIdentity().getHash().toBase64()).append("<br />\n"); - buf.append("<b>As of: </b> ").append(new Date(_context.clock().now())).append(" (uptime: ").append(DataHelper.formatDuration(getUptime())).append(") <br />\n"); - buf.append("<b>Started on: </b> ").append(new Date(getWhenStarted())).append("<br />\n"); - buf.append("<b>Clock offset: </b> ").append(_context.clock().getOffset()).append("ms (OS time: ").append(new Date(_context.clock().now() - _context.clock().getOffset())).append(")<br />\n"); + buf.append("<b>Router: </b> ").append(_routerInfo.getIdentity().getHash().toBase64()).append("<br>\n"); + buf.append("<b>As of: </b> ").append(new Date(_context.clock().now())).append(" (uptime: ").append(DataHelper.formatDuration(getUptime())).append(") <br>\n"); + buf.append("<b>Started on: </b> ").append(new Date(getWhenStarted())).append("<br>\n"); + buf.append("<b>Clock offset: </b> ").append(_context.clock().getOffset()).append("ms (OS time: ").append(new Date(_context.clock().now() - _context.clock().getOffset())).append(")<br>\n"); long tot = Runtime.getRuntime().totalMemory()/1024; long free = Runtime.getRuntime().freeMemory()/1024; - buf.append("<b>Memory:</b> In use: ").append((tot-free)).append("KB Free: ").append(free).append("KB <br />\n"); - buf.append("<b>Version:</b> Router: ").append(RouterVersion.VERSION).append(" / SDK: ").append(CoreVersion.VERSION).append("<br />\n"); + buf.append("<b>Memory:</b> In use: ").append((tot-free)).append("KB Free: ").append(free).append("KB <br>\n"); + buf.append("<b>Version:</b> Router: ").append(RouterVersion.VERSION).append(" / SDK: ").append(CoreVersion.VERSION).append("<br>\n"); if (_higherVersionSeen) - buf.append("<b><font color=\"red\">HIGHER VERSION SEEN</font><b> - please <a href=\"http://www.i2p.net/\">check</a> to see if there is a new release out<br />\n"); + buf.append("<b><font color=\"red\">HIGHER VERSION SEEN</font><b> - please <a href=\"http://www.i2p.net/\">check</a> to see if there is a new release out<br>\n"); - buf.append("<hr /><a name=\"bandwidth\"> </a><h2>Bandwidth</h2>\n"); + buf.append("<hr><a name=\"bandwidth\"> </a><h2>Bandwidth</h2>\n"); long sent = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes(); long received = _context.bandwidthLimiter().getTotalAllocatedInboundBytes(); buf.append("<ul>"); @@ -723,41 +723,41 @@ public class Router { _context.bandwidthLimiter().renderStatusHTML(out); - out.write("<hr /><a name=\"clients\"> </a>\n"); + out.write("<hr><a name=\"clients\"> </a>\n"); _context.clientManager().renderStatusHTML(out); - out.write("\n<hr /><a name=\"transports\"> </a>\n"); + out.write("\n<hr><a name=\"transports\"> </a>\n"); _context.commSystem().renderStatusHTML(out); - out.write("\n<hr /><a name=\"profiles\"> </a>\n"); + out.write("\n<hr><a name=\"profiles\"> </a>\n"); _context.peerManager().renderStatusHTML(out); - out.write("\n<hr /><a name=\"tunnels\"> </a>\n"); + out.write("\n<hr><a name=\"tunnels\"> </a>\n"); _context.tunnelManager().renderStatusHTML(out); - out.write("\n<hr /><a name=\"jobs\"> </a>\n"); + out.write("\n<hr><a name=\"jobs\"> </a>\n"); _context.jobQueue().renderStatusHTML(out); - out.write("\n<hr /><a name=\"shitlist\"> </a>\n"); + out.write("\n<hr><a name=\"shitlist\"> </a>\n"); _context.shitlist().renderStatusHTML(out); - out.write("\n<hr /><a name=\"pending\"> </a>\n"); + out.write("\n<hr><a name=\"pending\"> </a>\n"); _context.messageRegistry().renderStatusHTML(out); - out.write("\n<hr /><a name=\"netdb\"> </a>\n"); + out.write("\n<hr><a name=\"netdb\"> </a>\n"); _context.netDb().renderLeaseSetHTML(out); _context.netDb().renderStatusHTML(out); buf.setLength(0); - buf.append("\n<hr /><a name=\"logs\"> </a>\n"); + buf.append("\n<hr><a name=\"logs\"> </a>\n"); List msgs = _context.logManager().getBuffer().getMostRecentMessages(); buf.append("\n<h2>Most recent console messages:</h2><table>\n"); for (Iterator iter = msgs.iterator(); iter.hasNext(); ) { diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 3e5e8985dd5771e110f3b6c0871a03c61fb5e850..6d9b6bc650a299fdd8a43d04880fbd2a1fb53624 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 12; + public final static long BUILD = 15; /** for example "-test" */ public final static String EXTRA = ""; public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA; diff --git a/router/java/src/net/i2p/router/Shitlist.java b/router/java/src/net/i2p/router/Shitlist.java index d5a5567331b2c19b8da68be7f4e03318ac177a6d..e8c52056a34ed8bb1f8fd1df9d51e8d888fbfa69 100644 --- a/router/java/src/net/i2p/router/Shitlist.java +++ b/router/java/src/net/i2p/router/Shitlist.java @@ -274,7 +274,7 @@ public class Shitlist { if ( (transports != null) && (transports.size() > 0) ) buf.append(" on the following transport: ").append(transports); if (entry.cause != null) { - buf.append("<br />\n"); + buf.append("<br>\n"); buf.append(entry.cause); } buf.append(" (<a href=\"configpeer.jsp?peer=").append(key.toBase64()).append("#unsh\">unban now</a>)"); diff --git a/router/java/src/net/i2p/router/client/ClientManager.java b/router/java/src/net/i2p/router/client/ClientManager.java index b042d524015cbaf3aeb792a6f3c82ac9d92583b0..5b4a4fb535ac0b1586d0308562adefa562dd084e 100644 --- a/router/java/src/net/i2p/router/client/ClientManager.java +++ b/router/java/src/net/i2p/router/client/ClientManager.java @@ -388,7 +388,7 @@ public class ClientManager { public void renderStatusHTML(Writer out) throws IOException { StringBuilder buf = new StringBuilder(8*1024); - buf.append("<u><b>Local destinations</b></u><br />"); + buf.append("<u><b>Local destinations</b></u><br>"); Map runners = null; synchronized (_runners) { @@ -397,39 +397,39 @@ public class ClientManager { for (Iterator iter = runners.keySet().iterator(); iter.hasNext(); ) { Destination dest = (Destination)iter.next(); ClientConnectionRunner runner = (ClientConnectionRunner)runners.get(dest); - buf.append("<b>*</b> ").append(dest.calculateHash().toBase64().substring(0,6)).append("<br />\n"); + buf.append("<b>*</b> ").append(dest.calculateHash().toBase64().substring(0,6)).append("<br>\n"); LeaseSet ls = runner.getLeaseSet(); if (ls == null) { - buf.append("<font color=\"red\"><i>No lease</i></font><br />\n"); + buf.append("<font color=\"red\"><i>No lease</i></font><br>\n"); } else { long leaseAge = ls.getEarliestLeaseDate() - _ctx.clock().now(); if (leaseAge <= 0) { buf.append("<font color=\"red\"><i>Lease expired "); - buf.append(DataHelper.formatDuration(0-leaseAge)).append(" ago</i></font><br />\n"); + buf.append(DataHelper.formatDuration(0-leaseAge)).append(" ago</i></font><br>\n"); } else { int count = ls.getLeaseCount(); if (count <= 0) { - buf.append("<font color=\"red\"><i>No tunnels</i></font><br />\n"); + buf.append("<font color=\"red\"><i>No tunnels</i></font><br>\n"); } else { TunnelId id = ls.getLease(0).getTunnelId(); TunnelInfo info = _ctx.tunnelManager().getTunnelInfo(id); if (info == null) { - buf.append("<font color=\"red\"><i>Failed tunnels</i></font><br />\n"); + buf.append("<font color=\"red\"><i>Failed tunnels</i></font><br>\n"); } else { buf.append(count).append(" x "); buf.append(info.getLength() - 1).append(" hop tunnel"); if (count != 1) buf.append('s'); - buf.append("<br />\n"); + buf.append("<br>\n"); buf.append("Expiring in ").append(DataHelper.formatDuration(leaseAge)); - buf.append("<br />\n"); + buf.append("<br>\n"); } } } } } - buf.append("\n<hr />\n"); + buf.append("\n<hr>\n"); out.write(buf.toString()); out.flush(); } diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java index 644dcbb39c4fa44649f6a64ec53928b9c3b29bee..ff53f7d15d43028e0aa4a8cf6924439525f19374 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java @@ -971,18 +971,18 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade { else buf.append(dest.toBase64().substring(0, 6)); } - buf.append(")</b><br />\n"); + buf.append(")</b><br>\n"); long exp = ls.getEarliestLeaseDate()-now; if (exp > 0) - buf.append("Expires in ").append(DataHelper.formatDuration(exp)).append("<br />\n"); + buf.append("Expires in ").append(DataHelper.formatDuration(exp)).append("<br>\n"); else - buf.append("Expired ").append(DataHelper.formatDuration(0-exp)).append(" ago<br />\n"); + buf.append("Expired ").append(DataHelper.formatDuration(0-exp)).append(" ago<br>\n"); for (int i = 0; i < ls.getLeaseCount(); i++) { buf.append("Lease ").append(i + 1).append(": Gateway "); buf.append(_context.commSystem().renderPeerHTML(ls.getLease(i).getGateway())); - buf.append(" Tunnel ").append(ls.getLease(i).getTunnelId().getTunnelId()).append("<br />\n"); + buf.append(" Tunnel ").append(ls.getLease(i).getTunnelId().getTunnelId()).append("<br>\n"); } - buf.append("<hr />\n"); + buf.append("<hr>\n"); out.write(buf.toString()); buf.setLength(0); } @@ -996,7 +996,7 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade { if (full) size *= 4; StringBuilder buf = new StringBuilder(size); - out.write("<h2>Network Database Contents</h2>\n"); + out.write("<h2>Network Database Contents (<a href=\"netdb.jsp?l=1\">View LeaseSets</a>)</h2>\n"); if (!_initialized) { buf.append("<i>Not initialized</i>\n"); out.write(buf.toString()); @@ -1004,7 +1004,6 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade { return; } - out.write("<a href=\"netdb.jsp?l=1\">View LeaseSets</a>"); Hash us = _context.routerHash(); out.write("<a name=\"routers\" ></a><h3>Routers (<a href=\"netdb.jsp"); if (full) @@ -1084,18 +1083,18 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade { String hash = info.getIdentity().getHash().toBase64(); buf.append("<a name=\"").append(hash.substring(0, 6)).append("\" ></a>"); if (isUs) { - buf.append("<a name=\"our-info\" ></a><b>Our info: ").append(hash).append("</b><br />\n"); + buf.append("<a name=\"our-info\" ></a><b>Our info: ").append(hash).append("</b><br>\n"); } else { - buf.append("<b>Peer info for:</b> ").append(hash).append("<br />\n"); + buf.append("<b>Peer info for:</b> ").append(hash).append("<br>\n"); } long age = _context.clock().now() - info.getPublished(); if (isUs && _context.router().isHidden()) - buf.append("Hidden, Updated: <i>").append(DataHelper.formatDuration(age)).append(" ago</i><br />\n"); + buf.append("Hidden, Updated: <i>").append(DataHelper.formatDuration(age)).append(" ago</i><br>\n"); else if (age > 0) - buf.append("Published: <i>").append(DataHelper.formatDuration(age)).append(" ago</i><br />\n"); + buf.append("Published: <i>").append(DataHelper.formatDuration(age)).append(" ago</i><br>\n"); else - buf.append("Published: <i>in ").append(DataHelper.formatDuration(0-age)).append("???</i><br />\n"); + buf.append("Published: <i>in ").append(DataHelper.formatDuration(0-age)).append("???</i><br>\n"); buf.append("Address(es): <i>"); String country = _context.commSystem().getCountry(info.getIdentity().getHash()); if(country != null) { @@ -1111,19 +1110,19 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade { buf.append('[').append(DataHelper.stripHTML(name)).append('=').append(DataHelper.stripHTML(val)).append("] "); } } - buf.append("</i><br />\n"); + buf.append("</i><br>\n"); if (full) { - buf.append("Stats: <br /><i><code>\n"); + buf.append("Stats: <br><i><code>\n"); for (Iterator iter = info.getOptions().keySet().iterator(); iter.hasNext(); ) { String key = (String)iter.next(); String val = info.getOption(key); - buf.append(DataHelper.stripHTML(key)).append(" = ").append(DataHelper.stripHTML(val)).append("<br />\n"); + buf.append(DataHelper.stripHTML(key)).append(" = ").append(DataHelper.stripHTML(val)).append("<br>\n"); } buf.append("</code></i>\n"); } else { buf.append("<a href=\"netdb.jsp?r=").append(hash.substring(0, 6)).append("\" >Full entry</a>\n"); } - buf.append("<hr />\n"); + buf.append("<hr>\n"); } } diff --git a/router/java/src/net/i2p/router/peermanager/ProfileOrganizerRenderer.java b/router/java/src/net/i2p/router/peermanager/ProfileOrganizerRenderer.java index 500ec5c8eed8d51f74e570c01434d5d1e073f382..1e3d71fc8774b878ccf52cc1d9aa82aafa7b689f 100644 --- a/router/java/src/net/i2p/router/peermanager/ProfileOrganizerRenderer.java +++ b/router/java/src/net/i2p/router/peermanager/ProfileOrganizerRenderer.java @@ -95,7 +95,7 @@ class ProfileOrganizerRenderer { } if (tier != prevTier) - buf.append("<tr><td colspan=\"7\"><hr /></td></tr>\n"); + buf.append("<tr><td colspan=\"7\"><hr></td></tr>\n"); prevTier = tier; buf.append("<tr><td align=\"center\" nowrap>"); @@ -149,7 +149,7 @@ class ProfileOrganizerRenderer { if (total / fails <= 10) // hide if < 10% buf.append(' ').append(fails).append('/').append(total).append(" Test Fails"); } - buf.append(" </td>"); + buf.append(" </td>"); buf.append("<td nowrap align=\"center\"><a target=\"_blank\" href=\"dumpprofile.jsp?peer=").append(peer.toBase64().substring(0,6)).append("\">profile</a>"); buf.append(" <a href=\"configpeer.jsp?peer=").append(peer.toBase64()).append("\">+-</a></td>\n"); buf.append("</tr>"); @@ -219,8 +219,8 @@ class ProfileOrganizerRenderer { buf.append("</table>"); buf.append("<h3>Thresholds:</h3>"); - buf.append("<b>Speed:</b> ").append(num(_organizer.getSpeedThreshold())).append(" (").append(fast).append(" fast peers)<br />"); - buf.append("<b>Capacity:</b> ").append(num(_organizer.getCapacityThreshold())).append(" (").append(reliable).append(" high capacity peers)<br />"); + buf.append("<b>Speed:</b> ").append(num(_organizer.getSpeedThreshold())).append(" (").append(fast).append(" fast peers)<br>"); + buf.append("<b>Capacity:</b> ").append(num(_organizer.getCapacityThreshold())).append(" (").append(reliable).append(" high capacity peers)<br>"); buf.append("<b>Integration:</b> ").append(num(_organizer.getIntegrationThreshold())).append(" (").append(integrated).append(" well integrated peers)"); buf.append("<h3>Definitions:</h3><ul>" + "<li><b>groups</b>: as determined by the profile organizer</li>" + diff --git a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java index ebbe205b401a2bd47a04035a7f0fca0644d43016..6a7eaca84b4d1e6ae7423a0e6172de229bfbc6f5 100644 --- a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java +++ b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java @@ -483,7 +483,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade { buf.append(h); if (found) buf.append("</a>"); - buf.append("</font></tt>"); + buf.append("</tt>"); return buf.toString(); } } diff --git a/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java b/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java index 75c73dd34bcadf12b9601c491ccb5d679fe9c15f..504fe326018763901e48648e1575c0fb61c36d40 100644 --- a/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java +++ b/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java @@ -645,7 +645,7 @@ public class FIFOBandwidthLimiter { buf.append("ms ago</li>\n"); } } - buf.append("</ol></li></ul></p><hr>\n"); + buf.append("</ol></li></ul><hr>\n"); out.write(buf.toString()); out.flush(); } diff --git a/router/java/src/net/i2p/router/transport/UPnP.java b/router/java/src/net/i2p/router/transport/UPnP.java index 523b5795e5bb0b5d30afd14289431840cfbbba71..079a2f6dc5c0c77eeed75a33bcb2273f2e90e98c 100644 --- a/router/java/src/net/i2p/router/transport/UPnP.java +++ b/router/java/src/net/i2p/router/transport/UPnP.java @@ -454,7 +454,7 @@ public class UPnP extends ControlPoint implements DeviceChangeListener, EventLis /** warning - slow */ public String renderStatusHTML() { final StringBuilder sb = new StringBuilder(); - sb.append("<a name=\"upnp\"></a><b>UPnP Status:</b><br />"); + sb.append("<a name=\"upnp\"></a><b>UPnP Status:</b><br>"); if(isDisabled) { sb.append("UPnP has been disabled; Do you have more than one UPnP Internet Gateway Device on your LAN ?"); diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java index 18fa3346fa7e21b3af42855dbed3a4d6f4dcb9c0..ade88566a236b48be141d67dd3d2d1b42dd8bc02 100644 --- a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java +++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java @@ -720,7 +720,7 @@ public class NTCPTransport extends TransportImpl { } if (peers.size() > 0) { -// buf.append("<tr> <td colspan=\"11\"><hr /></td></tr>\n"); +// buf.append("<tr> <td colspan=\"11\"><hr></td></tr>\n"); buf.append("<tr class=\"tablefooter\"> <td align=\"center\"><b>").append(peers.size()).append(" peers</b></td> <td> </td> <td> "); buf.append("</td> <td align=\"center\"><b>").append(formatRate(bpsRecv/1024)).append("/").append(formatRate(bpsSend/1024)).append("K/s</b>"); buf.append("</td> <td align=\"center\"><b>").append(DataHelper.formatDuration(totalUptime/peers.size())); diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java index c0fa13d3903f5b8d7b0fb7855605996726513f17..d431913d1fbd43e4bcc2c4831eefd96659486612 100644 --- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java +++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java @@ -1768,10 +1768,10 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority int numPeers = 0; StringBuilder buf = new StringBuilder(512); - buf.append("<p><b id=\"udpcon\"><h3>UDP connections: ").append(peers.size()); + buf.append("<h3 id=\"udpcon\">UDP connections: ").append(peers.size()); buf.append(". Limit: ").append(getMaxConnections()); buf.append(". Timeout: ").append(DataHelper.formatDuration(_expireTimeout)); - buf.append(".</b></h3>\n"); + buf.append(".</h3>\n"); buf.append("<div class=\"wideload\"><table>\n"); buf.append("<tr><th class=\"smallhead\" nowrap><a href=\"#def.peer\">Peer</a>"); if (sortFlags != FLAG_ALPHA) @@ -1843,18 +1843,18 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority boolean appended = false; if (_activeThrottle.isChoked(peer.getRemotePeer())) { - if (!appended) buf.append("<br />"); + if (!appended) buf.append("<br>"); buf.append(" <i>Choked</i>"); appended = true; } if (peer.getConsecutiveFailedSends() > 0) { - if (!appended) buf.append("<br />"); + if (!appended) buf.append("<br>"); buf.append(" <i>").append(peer.getConsecutiveFailedSends()).append(" fail(s)</i>"); appended = true; } if (_context.shitlist().isShitlisted(peer.getRemotePeer(), STYLE)) { - if (!appended) buf.append("<br />"); - buf.append(" <i>Shitlist</i>"); + if (!appended) buf.append("<br>"); + buf.append(" <i>Banned</i>"); appended = true; } //byte[] ip = getIP(peer.getRemotePeer()); @@ -1985,7 +1985,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority numPeers++; } -// buf.append("<tr><td colspan=\"16\"><hr /></td></tr>\n"); +// buf.append("<tr><td colspan=\"16\"><hr></td></tr>\n"); buf.append(" <tr class=\"tablefooter\"> <td colspan=\"3\" align=\"right\"><b>Total</b></td>"); buf.append(" <td align=\"center\" nowrap><b>"); buf.append(formatKBps(bpsIn)).append("/").append(formatKBps(bpsOut)); @@ -2000,7 +2000,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority buf.append("</b></td> <td> </td> <td align=\"center\"><b>"); buf.append(numPeers > 0 ? rtoTotal/numPeers : 0); buf.append("</b></td>\n <td> </td> <td align=\"center\"><b>"); - buf.append(sendTotal).append("</td></b> <td align=\"center\"><b>").append(recvTotal).append("</b></td>\n"); + buf.append(sendTotal).append("</b></td> <td align=\"center\"><b>").append(recvTotal).append("</b></td>\n"); buf.append(" <td align=\"center\"><b>").append(resentTotal); buf.append("</b></td> <td align=\"center\"><b>").append(dupRecvTotal).append("</b></td>\n"); buf.append(" </tr></table></div></p><p>\n"); @@ -2012,7 +2012,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority double nondupSent = ((double)bytesTransmitted - ((double)resentTotal)*averagePacketSize); double bwResent = (nondupSent <= 0 ? 0d : ((((double)resentTotal)*averagePacketSize) / nondupSent)); buf.append("<h3>Percentage of bytes retransmitted (lifetime): ").append(formatPct(bwResent)); - buf.append("</h3><i>(Includes retransmission required by packet loss)</i><br /></p>\n"); + buf.append("</h3><i>(Includes retransmission required by packet loss)</i><br></p>\n"); out.write(buf.toString()); buf.setLength(0); out.write(KEY); @@ -2032,24 +2032,24 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority } private static final String KEY = "<h3>Definitions:</h3><div class=\"configure\">" + - "<br><b id=\"def.peer\">Peer</b>: the remote peer.<br />\n" + - "<b id=\"def.dir\">Dir</b>: v means they offer to introduce us, ^ means we offer to introduce them.<br />\n" + - "<b id=\"def.idle\">Idle</b>: the idle time is how long since a packet has been received or sent.<br />\n" + - "<b id=\"def.rate\">In/out</b>: the rates show a smoothed inbound and outbound transfer rate (KBytes per second).<br />\n" + - "<b id=\"def.up\">Up</b>: the uptime is how long ago this session was established.<br />\n" + - "<b id=\"def.skew\">Skew</b>: the skew says how far off the other user's clock is, relative to your own.<br />\n" + - "<b id=\"def.cwnd\">Cwnd</b>: the congestion window is how many bytes in 'in flight' you can send w/out an acknowledgement, / <br />\n" + - " the number of currently active messages being sent, /<br />\n" + - " the maximum number of concurrent messages to send, /<br />\n"+ - " the number of consecutive sends which were blocked due to throws message window size.<br />\n" + - "<b id=\"def.ssthresh\">Sst</b>: the slow start threshold helps make sure the cwnd doesn't grow too fast.<br />\n" + - "<b id=\"def.rtt\">Rtt</b>: the round trip time is how long it takes to get an acknowledgement of a packet.<br />\n" + - "<b id=\"def.dev\">Dev</b>: the standard deviation of the round trip time, to help control the retransmit timeout.<br />\n" + - "<b id=\"def.rto\">Rto</b>: the retransmit timeout controls how frequently an unacknowledged packet will be retransmitted.<br />\n" + - "<b id=\"def.mtu\">Mtu</b>: current sending packet size / estimated receiving packet size.<br />\n" + - "<b id=\"def.send\">TX</b>: the number of packets sent to the peer.<br />\n" + - "<b id=\"def.recv\">RX</b>: the number of packets received from the peer.<br />\n" + - "<b id=\"def.resent\">ReTX</b>: the number of packets retransmitted to the peer.<br />\n" + + "<br><b id=\"def.peer\">Peer</b>: the remote peer.<br>\n" + + "<b id=\"def.dir\">Dir</b>: v means they offer to introduce us, ^ means we offer to introduce them.<br>\n" + + "<b id=\"def.idle\">Idle</b>: the idle time is how long since a packet has been received or sent.<br>\n" + + "<b id=\"def.rate\">In/out</b>: the rates show a smoothed inbound and outbound transfer rate (KBytes per second).<br>\n" + + "<b id=\"def.up\">Up</b>: the uptime is how long ago this session was established.<br>\n" + + "<b id=\"def.skew\">Skew</b>: the skew says how far off the other user's clock is, relative to your own.<br>\n" + + "<b id=\"def.cwnd\">Cwnd</b>: the congestion window is how many bytes in 'in flight' you can send w/out an acknowledgement, / <br>\n" + + " the number of currently active messages being sent, /<br>\n" + + " the maximum number of concurrent messages to send, /<br>\n"+ + " the number of consecutive sends which were blocked due to throws message window size.<br>\n" + + "<b id=\"def.ssthresh\">Sst</b>: the slow start threshold helps make sure the cwnd doesn't grow too fast.<br>\n" + + "<b id=\"def.rtt\">Rtt</b>: the round trip time is how long it takes to get an acknowledgement of a packet.<br>\n" + + "<b id=\"def.dev\">Dev</b>: the standard deviation of the round trip time, to help control the retransmit timeout.<br>\n" + + "<b id=\"def.rto\">Rto</b>: the retransmit timeout controls how frequently an unacknowledged packet will be retransmitted.<br>\n" + + "<b id=\"def.mtu\">Mtu</b>: current sending packet size / estimated receiving packet size.<br>\n" + + "<b id=\"def.send\">TX</b>: the number of packets sent to the peer.<br>\n" + + "<b id=\"def.recv\">RX</b>: the number of packets received from the peer.<br>\n" + + "<b id=\"def.resent\">ReTX</b>: the number of packets retransmitted to the peer.<br>\n" + "<b id=\"def.dupRecv\">DupRX</b>: the number of duplicate packets received from the peer." + "</div>\n"; diff --git a/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java b/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java index 530d3f1af6517a0221c477605e72c186063218ed..6bd7ba64612af766c3c18356fe785dad9ac5d2f8 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java +++ b/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java @@ -493,8 +493,8 @@ public class TunnelPoolManager implements TunnelManagerFacade { processed += cfg.getProcessedMessagesCount(); } out.write("</table>\n"); - out.write("<div class=\"statusnotes\"><center><b>Inactive participating tunnels: " + inactive + "</b></div>\n"); - out.write("<div class=\"statusnotes\"><b>Lifetime bandwidth usage: " + DataHelper.formatSize(processed*1024) + "B</b></center></div>\n"); + out.write("<div class=\"statusnotes\"><b>Inactive participating tunnels: " + inactive + "</b></div>\n"); + out.write("<div class=\"statusnotes\"><b>Lifetime bandwidth usage: " + DataHelper.formatSize(processed*1024) + "B</b></div>\n"); renderPeers(out); } @@ -542,9 +542,9 @@ public class TunnelPoolManager implements TunnelManagerFacade { continue; // don't display tunnels in their grace period live++; if (info.isInbound()) - out.write("<tr> <td class=\"cells\" align=\"center\"><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"/></td>"); + out.write("<tr> <td class=\"cells\" align=\"center\"><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"></td>"); else - out.write("<tr> <td class=\"cells\" align=\"center\"><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"/></td>"); + out.write("<tr> <td class=\"cells\" align=\"center\"><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"></td>"); out.write(" <td class=\"cells\" align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>\n"); out.write(" <td class=\"cells\" align=\"center\">" + info.getProcessedMessagesCount() + "KB</td>\n"); for (int j = 0; j < info.getLength(); j++) { @@ -558,7 +558,7 @@ public class TunnelPoolManager implements TunnelManagerFacade { } if (info.getLength() < maxLength && (info.getLength() == 1 || j == info.getLength() - 2)) { for (int k = info.getLength(); k < maxLength; k++) - out.write(" <td class=\"cells\" align=\"center\"> </td>"); + out.write(" <td class=\"cells\" align=\"center\"> </td>"); } } out.write("</tr>\n");