[Sputnik-list] sputnik earth on kepler 1.1

Yuri Takhteyev yuri at sims.berkeley.edu
Thu Jun 12 08:00:37 GMT+2 2008


Now that kepler 1.1 is out, I made a set of Sputnik rocks to go with
it.  This is based on the recent "Earth" code, with all the changes
that Jim and I did in spring.  This is a first stab at a release and
might have some minor quirks, but this should actually work better
than the last release ("Dish of the Day").

To install, you would need to first install Kepler 1.1 into some
directory.  I'll assume it's ~/sputnik/:

    mkdir ~/sputnik
    cd ~/sputnik
    export SPUTNIK=`pwd`
    wget http://luaforge.net/frs/download.php/3468/kepler-install-1.1-1
    bash kepler-install-1.1-1 --prefix=$SPUTNIK --without-readline

Then install Sputnik:

    ./bin/luarocks --from=http://sputnik.freewisdom.org/rocks/earth
install sputnik

Make a directory for storing the data:

    mkdir wiki-data
    chmod -R a+rw wiki-data

Create a sputnik.ws file in $SPUTNIK/kepler/htdocs/sputnik.ws:

    require"sputnik"

    return sputnik.new_wsapi_run_fn{
       VERSIUM_PARAMS = { '/home/yuri/sputnik/wiki-data/' },
       BASE_URL       = '/sputnik.ws',
    }

MAKE SURE TO REPLACE /home/yuri/wiki-data/ WITH THE RIGHT PATH.

Start Xavante:

    ./bin/xavante_start

Then access Sputnik at http://localhost:8080/sputnik.ws


We removed the old requirement of registration, so by default
anonymous users can edit any non-config pages.  Note that there is
some spam protection through honeypots and hashed fields.

If you want, however, you can introduce more control.

1.  You can add ReCaptcha:

    ./bin/luarocks --from=http://sputnik.freewisdom.org/rocks/earth
install recaptcha

Then go to recaptcha.net and get yourself a pair of API keys.  I'll
refer to them as PUBLIC and PRIVATE.  Then change the last function
call in sputnik.ws to:

    return sputnik.new_wsapi_run_fn{
       VERSIUM_PARAMS = { '/home/yuri/sputnik/wiki-data/' },
       BASE_URL       = '/sputnik.ws',
       CAPTCHA_MODULE = 'recaptcha',
       CAPTCHA_PARAMS = { PUBLIC, PRIVATE},
    }

REPLACING "PUBLIC" and "PRIVATE" with your recaptcha API keys.

This will do two things: anonymous users will be required to enter
captcha to edit and new users will be required to enter captcha to
register.

2. You can require email verification for new accounts:

    return sputnik.new_wsapi_run_fn{
       VERSIUM_PARAMS = { '/tmp/sputnik2/wiki-data/' },
       BASE_URL       = '/sputnik.ws',
       CAPTCHA_MODULE = 'recaptcha',
       CAPTCHA_PARAMS = { '6LdbBAIAAAAAAJnEResrcRMM8TMyilXbvpOoW0E0',
'6LdbBAIAAAAAAMbAygU7qCR3sfMkdcirOPbxT0OW'},
       REQUIRE_EMAIL_ACTIVATION = true,
       SMTP_SERVER    = "localhost",
       --SMTP_SERVER_PORT = "25",
       --SMTP_USERNAME  = "yuri",
       --SMTP_PASSWORD  = "pa$$w0rd",
    }

Note that for this to work you would need to have an SMTP server.

3. You can block anonymous users from editing any nodes.

Create an account called "Admin", log in with it, then edit @Root and
uncomment the two commented lines in "permissions".

Note that in general there is now a concept of "admin" users, who can
do different things and usually see a different edit form.  By
default, only "Admin" is an admin.  However, once you are logged in as
"Admin", you can make any user an admin by editing "_passwords" and
adding "is_admin='true'" to their record.

 - yuri

-- 
http://sputnik.freewisdom.org/



More information about the Sputnik-list mailing list