Changeset fbf6282


Ignore:
Timestamp:
Jan 4, 2008 2:37:24 AM (13 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f838b18
Parents:
5195a5c
git-author:
zzz <zzz> (01/04/08 02:37:24)
git-committer:
zzz <zzz@…> (01/04/08 02:37:24)
Message:

2008-01-03 zzz

  • addressbook: Do basic validation of hostnames and destkeys
  • susidns: Add support for the private addressbook, update the text and links somewhat
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • apps/addressbook/config.txt

    r5195a5c rfbf6282  
    1818#                            and your subscribed address books. (../userhosts.txt)
    1919#
     20# private_addressbook        The path to the private address book used by the router. 
     21#                            This is used only by the router and SusiDNS.
     22#                            It is not published by addressbook. (../privatehosts.txt)
     23#
    2024# published_addressbook      The path to the copy of your address book made
    2125#                            available on i2p. (../eepsite/docroot/hosts.txt)
     
    3640master_addressbook=myhosts.txt
    3741router_addressbook=../userhosts.txt
     42private_addressbook=../privatehosts.txt
    3843published_addressbook=../eepsite/docroot/hosts.txt
    3944log=log.txt
  • apps/addressbook/java/src/addressbook/AddressBook.java

    r5195a5c rfbf6282  
    154154
    155155    /**
     156     * Do basic validation of the hostname and dest
     157     * hostname was already converted to lower case by ConfigParser.parse()
     158     */
     159    private static boolean valid(String host, String dest) {
     160        return
     161                host.endsWith(".i2p") &&
     162                host.length() > 4 &&
     163                host.length() <= 67 &&          // 63 + ".i2p"
     164                (! host.startsWith(".")) &&
     165                (! host.startsWith("-")) &&
     166                (! host.endsWith("-.i2p")) &&
     167                host.indexOf("..") < 0 &&
     168                host.replaceAll("[a-z0-9.-]", "").length() == 0 &&
     169
     170                dest.length() == 516 &&
     171                dest.endsWith("AAAA") &&
     172                dest.replaceAll("[a-zA-Z0-9~-]", "").length() == 0
     173                ;       
     174    }
     175
     176    /**
    156177     * Merge this AddressBook with AddressBook other, writing messages about new
    157178     * addresses or conflicts to log. Addresses in AddressBook other that are
     
    171192            String otherValue = (String) other.addresses.get(otherKey);
    172193
    173             if (otherKey.endsWith(".i2p") && otherValue.length() == 516) {
     194            if (valid(otherKey, otherValue)) {
    174195                if (this.addresses.containsKey(otherKey) && !overwrite) {
    175196                    if (!this.addresses.get(otherKey).equals(otherValue)
  • apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java

    r5195a5c rfbf6282  
    2020 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2121 * 
    22  * $Revision: 1.1 $
     22 * $Revision: 1.2 $
    2323 */
    2424
     
    7777        }
    7878        private long configLastLoaded = 0;
     79        private static final String PRIVATE_BOOK = "private_addressbook";
     80        private static final String DEFAULT_PRIVATE_BOOK = "../privatehosts.txt";
    7981        private void loadConfig()
    8082        {
     
    8789                        properties.clear();
    8890                        properties.load( new FileInputStream( ConfigBean.configFileName ) );
     91                        // added in 0.5, for compatibility with 0.4 config.txt
     92                        if( properties.getProperty(PRIVATE_BOOK) == null)
     93                                properties.setProperty(PRIVATE_BOOK, DEFAULT_PRIVATE_BOOK);
    8994                        configLastLoaded = currentTime;
    9095                }
     
    113118        {
    114119                if( book == null || ( book.compareToIgnoreCase( "master" ) != 0 &&
    115                                 book.compareToIgnoreCase( "router" ) != 0 ) &&
    116                                 book.compareToIgnoreCase( "published" ) != 0 )
     120                                book.compareToIgnoreCase( "router" ) != 0 &&
     121                                book.compareToIgnoreCase( "private" ) != 0 &&
     122                                book.compareToIgnoreCase( "published" ) != 0  ))
    117123                        book = "master";
    118124               
     
    164170                        }
    165171                        // Format a message about filtered addressbook size, and the number of displayed entries
    166                         message = "Filtered list contains " + list.size() + " entries";
     172                        if( filter != null && filter.length() > 0 )
     173                                message = "Filtered l";
     174                        else
     175                                message = "L";
     176                        message += "ist contains " + list.size() + " entries";
    167177                        if (list.size() > 300) message += ", displaying the first 300."; else message += ".";
    168178
     
    252262                return getBook().compareToIgnoreCase( "published" ) == 0;
    253263        }
     264        public boolean isPrivate()
     265        {
     266                return getBook().compareToIgnoreCase( "private" ) == 0;
     267        }
    254268        public void setFilter(String filter) {
    255269                if( filter != null && ( filter.length() == 0 || filter.compareToIgnoreCase( "none" ) == 0 ) ) {
  • apps/susidns/src/java/src/i2p/susi/dns/VersionBean.java

    r5195a5c rfbf6282  
    2020 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2121 * 
    22  * $Revision: 1.4 $
     22 * $Revision: 1.1 $
    2323 */
    2424
     
    2727public class VersionBean {
    2828       
    29         private static String version = "0.4";
     29        private static String version = "0.5";
    3030        private static String url = "http://susi.i2p/?i2paddresshelper=T2DU1KAz3meB0B53U8Y06-I7vHR7XmC0qXAJfLW6b-1L1FVKoySRZz4xazHAwyv2xtRpvKrv6ukLm1tThEW0zQWtZPtX8G6KkzMibD8t7IS~4yw-9VkBtUydyYfsX08AK3v~-egSW8HCXTdyIJVtrETJb337VDUHW-7D4L1JLbwSH4if2ooks6yFTrljK5aVMi-16dZOVvmoyJc3jBqSdK6kraO4gW5-vHTmbLwL498p9nug1KOg1DqgN2GeU5X1QlVrlpFb~IIfdP~O8NT7u-LAjW3jSJsMbLDHMSYTIhC7xmJIiBoi-qk8p6TLynAmvJ7HRvbx4N1EB-uJHyD16wsZkkHyEOfmXbj0ZqLyKEGb3thPwCz-M9v~c2Qt3WbwjXJAtHpjlHkdJ4Fg91cX2oak~JoapnPf6Syw8hko5syf6VVoCYLnrrYyM8oGl8mLclHkj~VCidQNqMSM74IhrHfK6HmRikqtZBexb5M6wfMTTqBvaHURdD21GOpFKYBUAAAA";
    3131       
  • apps/susidns/src/jsp/addressbook.jsp

    r5195a5c rfbf6282  
    2121 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2222 * 
    23  * $Revision: 1.2 $
     23 * $Revision: 1.3 $
    2424 */
    2525%>
     
    4949<a href="addressbook.jsp?book=master">master</a> |
    5050<a href="addressbook.jsp?book=router">router</a> |
    51 <a href="addressbook.jsp?book=published">published</a> *
     51<a href="addressbook.jsp?book=published">published</a> |
     52<a href="addressbook.jsp?book=private">private</a> *
    5253<a href="subscriptions.jsp">subscriptions</a> *
    53 <a href="config.jsp">configuration</a>
     54<a href="config.jsp">configuration</a> *
     55<a href="index.jsp">overview</a>
    5456</p>
    5557</div>
     
    9395<a href="addressbook.jsp?filter=none">all</a></p>
    9496<c:if test="${book.hasFilter}">
    95 <p>Current filter: ${book.filter}</p>
     97<p>Current filter: ${book.filter}
     98(<a href="addressbook.jsp?filter=none">clear filter</a>)</p>
    9699</c:if>
    97100</div>
     
    118121<tr class="head">
    119122
    120 <c:if test="${book.master || book.router || book.published}">
     123<c:if test="${book.master || book.router || book.published || book.private}">
    121124<th>&nbsp;</th>
    122125</c:if>
     
    128131<c:forEach items="${book.entries}" var="addr" begin="0" end="299">
    129132<tr class="list${book.trClass}">
    130 <c:if test="${book.master || book.router || book.published}">
     133<c:if test="${book.master || book.router || book.published || book.private}">
    131134<td class="checkbox"><input type="checkbox" name="checked" value="${addr.name}" alt="Mark for deletion"></td>
    132135</c:if>
     
    140143</div>
    141144
    142 <c:if test="${book.master || book.router || book.published}">
     145<c:if test="${book.master || book.router || book.published || book.private}">
    143146<div id="buttons">
    144147<p class="buttons"><input type="image" name="action" value="delete" src="images/delete.png" alt="Delete checked" />
  • apps/susidns/src/jsp/config.jsp

    r5195a5c rfbf6282  
    2121 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2222 * 
    23  * $Revision: 1.14 $
     23 * $Revision: 1.1 $
    2424 */
    2525%>
     
    4444<a href="addressbook.jsp?book=master">master</a> |
    4545<a href="addressbook.jsp?book=router">router</a> |
    46 <a href="addressbook.jsp?book=published">published</a> *
     46<a href="addressbook.jsp?book=published">published</a> |
     47<a href="addressbook.jsp?book=private">private</a> *
    4748<a href="subscriptions.jsp">subscriptions</a> *
    48 <a href="config.jsp">configuration</a>
     49configuration *
     50<a href="index.jsp">overview</a>
    4951</p>
    5052</div>
     
    6668<h3>Hints</h3>
    6769<ol>
    68 <li>All file or directory paths here are relative to the addressbooks working directory, which normally
     70<li>All file or directory paths here are relative to the addressbook's working directory, which normally
    6971is located at $I2P/addressbook/.</li>
    70 <li>If you want to manually add lines to an addressbook, add them to the master addressbook. The router
     72<li>If you want to manually add lines to an addressbook, add them to the private or master addressbooks. The router
    7173addressbook and the published addressbook are overwritten by the addressbook application.</li>
    72 <li><b>Important:</b>When you publish your addressbook, <b>ALL</b> destinations appear there, even those
    73 from your master addressbook. Unfortunately the master addressbook points to your userhosts.txt, which was
    74 used for private destinations before. So if you want to keep the destinations in your userhosts.txt secret,
    75 please change the master addressbook to a different file before turning on addressbook publishing.</li>
     74<li><b>Important:</b>When you publish your addressbook, <b>ALL</b> destinations from the master and router addressbooks appear there.
     75Use the private addressbook for private destinations, these are not published.
     76</li>
    7677</ol>
    7778<h3>Options</h3>
     
    8081<li><b>update_delay</b> - update interval in hours (no need to change)</li>
    8182<li><b>published_addressbook</b> - your public hosts.txt file (choose a path within your webserver document root)</li>
    82 <li><b>router_addressbook</b> - your hosts.txt (no need to change)</li>
    83 <li><b>master_addressbook</b> - your personal addressbook, it gets never overwritten by the addressbook</li>
     83<li><b>router_addressbook</b> - your hosts.txt (don't change)</li>
     84<li><b>master_addressbook</b> - your personal addressbook, it never gets overwritten by the addressbook (don't change)</li>
     85<li><b>private_addressbook</b> - your private addressbook, it is never published (defaults to ../privatehosts.txt, don't change)</li>
    8486<li><b>proxy_port</b> - http port for your eepProxy (no need to change)</li>
    8587<li><b>proxy_host</b> - hostname for your eepProxy (no need to change)</li>
  • apps/susidns/src/jsp/index.jsp

    r5195a5c rfbf6282  
    2121 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2222 * 
    23  * $Revision: 1.1 $
     23 * $Revision: 1.2 $
    2424 */
    2525%>
     
    4343<a href="addressbook.jsp?book=master">master</a> |
    4444<a href="addressbook.jsp?book=router">router</a> |
    45 <a href="addressbook.jsp?book=published">published</a> *
     45<a href="addressbook.jsp?book=published">published</a> |
     46<a href="addressbook.jsp?book=private">private</a> *
    4647<a href="subscriptions.jsp">subscriptions</a> *
    47 <a href="config.jsp">configuration</a>
     48<a href="config.jsp">configuration</a> *
     49overview
    4850</p>
    4951</div>
     
    6567<h3>How does the addressbook work?</h3>
    6668<p>The addressbook application regularly (normally once per hour) polls your subscriptions and merges their content
    67 into your so called router addressbook (normally your plain hosts.txt). Then it merges your so called master addressbook (normally
    68 your userhosts.txt) into the router addressbook as well. If configured the router addressbook is now written to the so published addressbook,
    69 which is a publicly available copy of your hosts.txt somewhere in your eepsites document root. (Yes, this means that, with activated publication,
    70 your once private keys from userhosts.txt now are publicly available for everybody.)
     69into your so-called router addressbook (normally your plain hosts.txt). Then it merges your so-called master addressbook (normally
     70your userhosts.txt) into the router addressbook as well. If configured, the router addressbook is now written to the published addressbook,
     71which is a publicly available copy of your hosts.txt somewhere in your eepsite's document root.
     72</p><p>
     73The router also uses a private addressbook (privatehosts.txt, not shown in the picture), which is not merged or published.
     74Hosts in the private addressbook can be accessed by you but their addresses are never distributed to others.
     75The private addressbook can also be used for aliases of hosts in your other addressbooks.
    7176</p>
    7277<p><img src="images/how.png" border="0" alt="addressbook working scheme"/></p>
  • apps/susidns/src/jsp/subscriptions.jsp

    r5195a5c rfbf6282  
    2121 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2222 * 
    23  * $Revision: 1.1 $
     23 * $Revision: 1.2 $
    2424 */
    2525%>
     
    4343<a href="addressbook.jsp?book=master">master</a> |
    4444<a href="addressbook.jsp?book=router">router</a> |
    45 <a href="addressbook.jsp?book=published">published</a> *
    46 <a href="subscriptions.jsp">subscriptions</a> *
    47 <a href="config.jsp">configuration</a>
     45<a href="addressbook.jsp?book=published">published</a> |
     46<a href="addressbook.jsp?book=private">private</a> *
     47subscriptions *
     48<a href="config.jsp">configuration</a> *
     49<a href="index.jsp">overview</a>
    4850</p>
    4951</div>
  • history.txt

    r5195a5c rfbf6282  
    1 $Id: history.txt,v 1.609 2007-12-29 22:45:12 zzz Exp $
     1$Id: history.txt,v 1.610 2008-01-02 17:08:50 zzz Exp $
     2
     32008-01-03 zzz
     4    * addressbook: Do basic validation of hostnames and destkeys
     5    * susidns: Add support for the private addressbook,
     6      update the text and links somewhat
    27
    382008-01-02 zzz
  • router/java/src/net/i2p/router/RouterVersion.java

    r5195a5c rfbf6282  
    1616 */
    1717public class RouterVersion {
    18     public final static String ID = "$Revision: 1.544 $ $Date: 2007-12-29 22:45:09 $";
     18    public final static String ID = "$Revision: 1.545 $ $Date: 2008-01-02 17:08:48 $";
    1919    public final static String VERSION = "0.6.1.30";
    20     public final static long BUILD = 16;
     20    public final static long BUILD = 17;
    2121    public static void main(String args[]) {
    2222        System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
Note: See TracChangeset for help on using the changeset viewer.