Changeset d6c3ffd


Ignore:
Timestamp:
Sep 17, 2005 7:31:48 AM (15 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
20c42a17
Parents:
177e0ae6
git-author:
jrandom <jrandom> (09/17/05 07:31:48)
git-committer:
zzz <zzz@…> (09/17/05 07:31:48)
Message:

2005-09-17 jrandom

  • Added the natively compiled jbigi and patched java service wrapper for OS X. Thanks Bill Dorsey for letting me use your machine!
  • Don't build i2p.exe or i2pinstall.exe when run on OS X machines, as we don't bundle the binutils necessary (and there'd be a naming conflict if we did).
  • Added 'single user' functionality to syndie - if the single user checkbox on the admin page is checked, all users are allowed to control the instance and sync up with remote syndie nodes.
  • Temporarily disable the x-i2p-gzip in i2ptunnel until it is more closely debugged.
Files:
3 added
15 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java

    r177e0ae6 rd6c3ffd  
    372372                   
    373373                    String ok = getTunnel().getContext().getProperty("i2ptunnel.gzip");
    374                     boolean gzip = true;
     374                    boolean gzip = false;
    375375                    if (ok != null)
    376376                        gzip = Boolean.valueOf(ok).booleanValue();
  • apps/syndie/java/src/net/i2p/syndie/BlogManager.java

    r177e0ae6 rd6c3ffd  
    241241        return (cfg.exists());
    242242    }
     243   
     244    /**
     245     * If true, this syndie instance is meant for just one local user, so we don't need
     246     * to password protect registration, remote.jsp, or admin.jsp
     247     *
     248     */
     249    public boolean isSingleUser() {
     250        String isSingle = _context.getProperty("syndie.singleUser");
     251        return ( (isSingle != null) && (Boolean.valueOf(isSingle).booleanValue()) );
     252    }
    243253
    244254    public String getDefaultProxyHost() { return _context.getProperty("syndie.defaultProxyHost", ""); }
     
    246256   
    247257    public boolean authorizeAdmin(String pass) {
     258        if (isSingleUser()) return true;
    248259        String admin = getAdminPasswordHash();
    249260        if ( (admin == null) || (admin.trim().length() <= 0) )
     
    253264    }
    254265    public boolean authorizeRemote(String pass) {
     266        if (isSingleUser()) return true;
    255267        String rem = getRemotePasswordHash();
    256268        if ( (rem == null) || (rem.trim().length() <= 0) )
     
    259271        return (hash.equals(rem));
    260272    }
     273    public boolean authorizeRemote(User user) {
     274        if (isSingleUser()) return true;
     275        return (!user.getAuthenticated() || !user.getAllowAccessRemote());
     276    }
    261277   
    262278    public void configure(String registrationPassword, String remotePassword, String adminPass, String defaultSelector,
    263                           String defaultProxyHost, int defaultProxyPort, Properties opts) {
     279                          String defaultProxyHost, int defaultProxyPort, boolean isSingleUser, Properties opts) {
    264280        File cfg = getConfigFile();
    265281        Writer out = null;
     
    278294            if (defaultProxyPort > 0)
    279295                out.write("syndie.defaultProxyPort="+defaultProxyPort + "\n");
     296            out.write("syndie.singleUser=" + isSingleUser + "\n");
    280297            if (opts != null) {
    281298                for (Iterator iter = opts.keySet().iterator(); iter.hasNext(); ) {
     
    328345        System.err.println("Register [" + login + "] pass [" + password + "] name [" + blogName + "] descr [" + blogDescription + "] contact [" + contactURL + "] regPass [" + registrationPassword + "]");
    329346        String hashedRegistrationPassword = getRegistrationPasswordHash();
    330         if (hashedRegistrationPassword != null) {
     347        if ( (hashedRegistrationPassword != null) && (!isSingleUser()) ) {
    331348            try {
    332349                if (!hashedRegistrationPassword.equals(Base64.encode(_context.sha().calculateHash(registrationPassword.getBytes("UTF-8")).getData())))
  • apps/syndie/java/src/net/i2p/syndie/sml/HTMLRenderer.java

    r177e0ae6 rd6c3ffd  
    352352            for (int i = 0; i < locations.size(); i++) {
    353353                SafeURL surl = (SafeURL)locations.get(i);
    354                 if (_user.getAuthenticated() && _user.getAllowAccessRemote())
     354                if (_user.getAuthenticated() && BlogManager.instance().authorizeRemote(_user) )
    355355                    _bodyBuffer.append("<a ").append(getClass("blogArchiveView")).append(" href=\"").append(getArchiveURL(blog, surl)).append("\">").append(sanitizeString(surl.toString())).append("</a> ");
    356356                else
  • apps/syndie/java/src/net/i2p/syndie/web/PostBean.java

    r177e0ae6 rd6c3ffd  
    9898        if (_log.shouldLog(Log.DEBUG))
    9999            _log.debug("Posted the entry " + uri.toString() + " (archive = " + _archive + ")");
    100         if ( (uri != null) && (_user.getAllowAccessRemote()) ) {
     100        if ( (uri != null) && BlogManager.instance().authorizeRemote(_user) ) {
    101101            PetName pn = _user.getPetNameDB().get(_archive);
    102102            if (_log.shouldLog(Log.DEBUG))
  • apps/syndie/jsp/admin.jsp

    r177e0ae6 rd6c3ffd  
    2626    String proxyPort = request.getParameter("proxyport");
    2727    String selector = request.getParameter("selector");
     28    boolean isSingleUser = BlogManager.instance().isSingleUser();
     29    String singleSet = request.getParameter("singleuser");
     30    if (singleSet != null)
     31      isSingleUser = true;
     32    else
     33      isSingleUser = false;
     34   
    2835    if (configured) {
    29       if ( (adminPass != null) && (BlogManager.instance().authorizeAdmin(adminPass)) ) {
     36      if (BlogManager.instance().authorizeAdmin(adminPass)) {
    3037        int port = -1;
    3138        try { port = Integer.parseInt(proxyPort); } catch (NumberFormatException nfe) { port = 4444; }
    32         BlogManager.instance().configure(regPass, remotePass, adminPass, selector, proxyHost, port, null);
     39        BlogManager.instance().configure(regPass, remotePass, adminPass, selector, proxyHost, port, isSingleUser, null);
    3340        %><span class="b_adminMsgOk">Configuration updated</span><%
    3441      } else {
     
    3845      int port = -1;
    3946      try { port = Integer.parseInt(proxyPort); } catch (NumberFormatException nfe) { port = 4444; }
    40       BlogManager.instance().configure(regPass, remotePass, adminPass, selector, proxyHost, port, null);
     47      BlogManager.instance().configure(regPass, remotePass, adminPass, selector, proxyHost, port, isSingleUser, null);
    4148      %><span class="b_adminMsgOk">Configuration saved</span><%
    4249    }
    4350  } else {
    4451%><form action="admin.jsp" method="POST">
     52<em class="b_adminField">Single user?</em> <input type="checkbox" class="b_adminField" name="singleuser" <%=BlogManager.instance().isSingleUser() ? " checked=\"true\" " : ""%> /><br />
     53<span class="b_adminDescr">If this is checked, the registration, admin, and remote passwords are unnecessary - anyone
     54can register and administer Syndie, as well as use any remote functionality.  This should not be checked if untrusted
     55parties can access this web interface.</span><br />
    4556<em class="b_adminField">Registration password:</em> <input class="b_adminField" type="text" name="regpass" size="10" /><br />
    4657<span class="b_adminDescr">Users must specify this password on the registration form to proceed.  If this is
  • apps/syndie/jsp/post.jsp

    r177e0ae6 rd6c3ffd  
    9898        post.renderPreview(out);
    9999        %><hr /><span class="b_postConfirm"><form action="post.jsp" method="POST">
    100 Please confirm that the above is ok<% if (user.getAllowAccessRemote()) { %>, and select what additional archives you
     100Please confirm that the above is ok<% if (BlogManager.instance().authorizeRemote(user)) { %>, and select what additional archives you
    101101want the post transmitted to.  Otherwise, just hit your browser's back arrow and
    102102make changes.
  • apps/syndie/jsp/remote.jsp

    r177e0ae6 rd6c3ffd  
    1717    <td valign="top" align="left" rowspan="2" class="b_rightnav"><jsp:include page="_rightnav.jsp" /></td></tr>
    1818<tr class="b_content"><td valign="top" align="left" colspan="3" class="b_content"><%
    19 if (!user.getAuthenticated() || !user.getAllowAccessRemote()) {
     19if (!BlogManager.instance().authorizeRemote(user)) {
    2020%><span class="b_remoteMsgErr">Sorry, you are not allowed to access remote archives from here.  Perhaps you should install Syndie yourself?</span><%
    2121} else { %><form action="remote.jsp" method="POST"><span class="b_remoteChooser"><span class="b_remoteChooserField">Import from:</span>
  • build.xml

    r177e0ae6 rd6c3ffd  
    4747    </target>
    4848    <target name="buildexe">
     49        <condition property="osx">
     50            <os family="mac" />
     51        </condition>
     52        <ant target="doBuildEXE" />
     53    </target>
     54    <target name="doBuildEXE" unless="osx">
    4955        <jar destfile="./build/launchi2p.jar">
    5056            <manifest>
     
    116122    <target name="clean" depends="pkgclean" >
    117123        <delete dir="./build" />
    118         <delete file="i2pinstall.exe" />       
    119         <delete file="i2p.exe" />       
     124        <delete file="i2pinstall.exe" failonerror="false" quiet="true" />       
     125        <delete file="i2p.exe" failonerror="false" quiet="true" />     
    120126    </target>
    121127    <target name="distclean" depends="clean">
     
    200206        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
    201207        <copy file="build/systray.jar" todir="pkg-temp/lib" />
    202         <copy file="i2p.exe" todir="pkg-temp/" />
     208        <copy file="i2p.exe" todir="pkg-temp/" failonerror="false" />
    203209        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
    204210        <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
     
    290296        <copy file="build/router.jar" todir="pkg-temp/lib/" />
    291297        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
    292         <copy file="i2p.exe" todir="pkg-temp/" />
     298        <copy file="i2p.exe" todir="pkg-temp/" failonerror="false" />
    293299        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
    294300       
     
    342348    </target>
    343349    <target name="installerexe">
     350        <condition property="osx">
     351            <os family="mac" />
     352        </condition>
     353        <ant target="doInstallerEXE" />
     354    </target>
     355    <target name="doInstallerEXE">
    344356        <!-- now the installer exe -->
    345357        <taskdef name="launch4j"
  • history.txt

    r177e0ae6 rd6c3ffd  
    1 $Id: history.txt,v 1.252 2005/09/16 13:28:27 jrandom Exp $
     1$Id: history.txt,v 1.253 2005/09/16 16:24:43 jrandom Exp $
     2
     32005-09-17  jrandom
     4    * Added the natively compiled jbigi and patched java service wrapper for
     5      OS X.  Thanks Bill Dorsey for letting me use your machine!
     6    * Don't build i2p.exe or i2pinstall.exe when run on OS X machines, as we
     7      don't bundle the binutils necessary (and there'd be a naming conflict
     8      if we did).
     9    * Added 'single user' functionality to syndie - if the single user
     10      checkbox on the admin page is checked, all users are allowed to control
     11      the instance and sync up with remote syndie nodes.
     12    * Temporarily disable the x-i2p-gzip in i2ptunnel until it is more closely
     13      debugged.
    214
    3152005-09-16  jrandom
  • installer/lib/jbigi/README.txt

    r177e0ae6 rd6c3ffd  
    33The GMP code in jbigi is from GMP-4.1.3 (http://www.swox.com/gmp/), and
    44was optimized for a variety of CPU architectures.
     5
     6On Sep 16, 2005, libjbigi-osx-none.jnilib was added to jbigi.jar after
     7being compiled by jrandom on osx/ppc with GMP-4.1.4.
  • installer/resources/postinstall.sh

    r177e0ae6 rd6c3ffd  
    2020# chmod 744 ./install_i2p_service_unix
    2121chmod 744 ./osid
    22 chmod 744 ./startRouter.sh
     22chmod 744 ./runplain.sh
    2323# chmod 744 ./uninstall_i2p_service_unix
    2424
Note: See TracChangeset for help on using the changeset viewer.