Button Button

From yuri at sims.berkeley.edu Mon Jun 23 07:21:16 2008 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Mon Jun 23 07:30:03 2008 Subject: [Sputnik-list] Sputnik Earth Beta Message-ID: fa4efbc00806230221t3d014077j5cb9685401032ad9@mail.gmail.com

A more complete release of Sputnik "Earth" is here:

On UNIX:

cd into some directory (e.g., "cd ~/sputnik"), then run

wget http://sputnik.freewisdom.org/files/sputnik_install_2008_06_22.sh
sh sputnik_install_2008_06_22.sh
./bin/xavante_start

On Windows (not tested):

  1. install Kepler 1.1

  2. make a directory where you want to store the data (e.g., "wiki-data")

  3. create a file called sputnik.ws in Kepler's "htdocs" directory that looks like this:

    require('sputnik') return sputnik.newwsapirunfn{ VERSIUMPARAMS = { 'c:/sputnik/wiki-data/' }, BASE_URL = '/sputnik.ws', }

(Replace "c:/sputnik/wiki-data/" with the path to your directory wiki-data directory).

This beta should be better than the previous (March 2008) release of Sputnik (last in "Dish of the Day" series), so I updated "Installation" page with those instructions and consider this "beta" to be the recommended version now. I am calling it "beta" for now, since there are a few more changes I want to make to "earth" before I close it.

  • yuri

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

From yuri at sims.berkeley.edu Mon Jun 23 07:44:44 2008 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Mon Jun 23 07:53:30 2008 Subject: [Sputnik-list] Re: Sputnik Earth Beta In-Reply-To: fa4efbc00806230221t3d014077j5cb9685401032ad9@mail.gmail.com References: fa4efbc00806230221t3d014077j5cb9685401032ad9@mail.gmail.com Message-ID: fa4efbc00806230244y2accc0bej5b01bc43bea37407@mail.gmail.com

I forgot to mention that a new version of versium-git is also out, which means that you can now use Git to store Sputnik's history.

To do this, first install Sputnik the normal way. If you already created some nodes using the default storage module, delete everything in the wiki-data directory, then initialize it as a git repository:

cd wiki-data
rm -rf wiki-data
git init

Then install 'versium-git':

./bin/luarocks install

--from=http://sputnik.freewisdom.org/rocks/earth/ versium-git

Then add this to the parameters:

VERSIUMSTORAGEMODULE = 'versium.git',

In other words, you sputnik.ws should look like this:

require('sputnik')
return sputnik.new_wsapi_run_fn{
   VERSIUM_PARAMS = { '/yuri/sputnik/wiki-data/' },
   BASE_URL       = '/sputnik.ws',
   VERSIUM_STORAGE_MODULE = 'versium.git',
}

Then run Sputnik the normal way.

Running sputnik over git gives you a few benefits:

  1. Your data directory is now very clean. Each node is a file (e.g., "Home_Page.lua"), sub-nodes are files in directories. (This also means you can just trivially dofile any of your data files if you want to use the data in them bypassing Sputnik entirely.)
  2. You can access your wiki history without the browser by just using "git log" (e.g. "git log Home_Page.lua")
  3. You can edit files by hand, then commit changes through git, and those changes will then show up in Sputnik's history.
  4. You can pull files from the server that runs Sputnik onto your laptop, edit them locally in your favorite editor, commit, push, and the changes will appear (with history!) in the Sputnik running on the server. (Or, you can sync data between two Sputniks - e.g., one running on the server and one running locally.)
  5. If you are doing 4 and meanwhile someone edits the data on the server, you can actually merge them.

In other words, all the reasons why you already love git are now also reasons to love Sputnik.

Sputnik over MySQL, SQLite and Subversion should hopefully be coming shortly. (The first two of those are ready, just need to be tested a bit more.)

  • yuri

On Mon, Jun 23, 2008 at 2:21 AM, Yuri Takhteyev yuri@sims.berkeley.edu wrote:

A more complete release of Sputnik "Earth" is here:

On UNIX:

cd into some directory (e.g., "cd ~/sputnik"), then run

wget http://sputnik.freewisdom.org/files/sputnikinstall20080622.sh sh sputnikinstall20080622.sh ./bin/xavante_start

On Windows (not tested):

  1. install Kepler 1.1
  2. make a directory where you want to store the data (e.g., "wiki-data")
  3. create a file called sputnik.ws in Kepler's "htdocs" directory that looks like this:

require('sputnik') return sputnik.newwsapirun_fn{

  VERSIUM_PARAMS = { 'c:/sputnik/wiki-data/' },
  BASE_URL       = '/sputnik.ws',

}

(Replace "c:/sputnik/wiki-data/" with the path to your directory wiki-data directory).

This beta should be better than the previous (March 2008) release of Sputnik (last in "Dish of the Day" series), so I updated "Installation" page with those instructions and consider this "beta" to be the recommended version now. I am calling it "beta" for now, since there are a few more changes I want to make to "earth" before I close it.

  • yuri

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

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

From gareuselesinge at libero.it Mon Jun 23 07:58:56 2008 From: gareuselesinge at libero.it (Enrico Tassi) Date: Mon Jun 23 08:08:15 2008 Subject: [Sputnik-list] Sputnik Earth Beta In-Reply-To: fa4efbc00806230221t3d014077j5cb9685401032ad9@mail.gmail.com References: fa4efbc00806230221t3d014077j5cb9685401032ad9@mail.gmail.com Message-ID: 20080623095856.GA32274@birba

On Mon, Jun 23, 2008 at 02:21:16AM -0700, Yuri Takhteyev wrote:

A more complete release of Sputnik "Earth" is here:

On UNIX:

cd into some directory (e.g., "cd ~/sputnik"), then run

wget http://sputnik.freewisdom.org/files/sputnik_install_2008_06_22.sh
sh sputnik_install_2008_06_22.sh
./bin/xavante_start

It seems the sputnik tarball has a lot of ~ files, not a big deal anyway... -- Enrico Tassi

From yuri at sims.berkeley.edu Mon Jun 23 08:13:54 2008 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Mon Jun 23 08:22:41 2008 Subject: [Sputnik-list] Sputnik Earth Beta In-Reply-To: 20080623095856.GA32274@birba References: fa4efbc00806230221t3d014077j5cb9685401032ad9@mail.gmail.com

<20080623095856.GA32274@birba>

Message-ID: fa4efbc00806230313n2f1091c5p9eff7b57e8e2c9a0@mail.gmail.com

Whoops. That's me forgetting to run "git clean" making the archive. I'll try to start using git-archive.

BTW, I created a new branch called "earth" which you can now track instead of "master". Though, I expect them to stay synchronized for some time.

  • yuri

On Mon, Jun 23, 2008 at 2:58 AM, Enrico Tassi gareuselesinge@libero.it wrote:

On Mon, Jun 23, 2008 at 02:21:16AM -0700, Yuri Takhteyev wrote:

A more complete release of Sputnik "Earth" is here:

On UNIX:

cd into some directory (e.g., "cd ~/sputnik"), then run

wget http://sputnik.freewisdom.org/files/sputnik_install_2008_06_22.sh
sh sputnik_install_2008_06_22.sh
./bin/xavante_start

It seems the sputnik tarball has a lot of ~ files, not a big deal anyway... -- Enrico Tassi


Sputnik-list mailing list Sputnik-list@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/sputnik-list

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

From yuri at sims.berkeley.edu Mon Jun 23 15:51:22 2008 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Mon Jun 23 16:00:33 2008 Subject: [Sputnik-list] Re: Sputnik Earth Beta In-Reply-To: 485F964C.4070203@lemote.com References: E1KAijr-0004tY-VX@mail.luaforge.net 485F964C.4070203@lemote.com Message-ID: fa4efbc00806231051n306bb4fdo388a0af911a6c070@mail.gmail.com

After registered and login sputnik, I edit a page and refresh, find that sputnik makes me logout automatically, why?

Can you describe the exact steps? I can't reproduce this.

How to upload a png file, pdf file when edit in sputnik? Could you give us a detailed tutors on it?

Binary files are represented by special nodes, which behave differently because they have their "prototype" field set to "@BinaryFile". If you want to "edit" an existing binary node, e.g., "logo", just go to it's "edit" page, and it will have a button to upload a new image. E.g.:

http://localhost:8080/sputnik.ws?p=logo.png - returns an image http://localhost:8080/sputnik.ws?p=logo - returns a page that describes the node, has an "Edit" link http://localhost:8080/sputnik.ws?p=_logo.edit - a form to edit attributes, including uploading a new image

If you want to create a new node from scratch, then (as I just realized) it's somewhat more complicated than it should be, because we originally locked this feature down aggressively for security, and then forgot to provide an easier mechanism. I'll look into this and post an update. Meanwhile, you can create such nodes manually if you want. If you are using Sputnik with git, then just create a file "My_Image.lua" in your wiki-data directory, put the following into it:

prototype      = "@Binary_File"
file_type      = "image/jpeg"

Save the file. Commit it with git if you want to save this revision in history. Then access the node via the web interface to upload a new file. Of course, you can also put the image data into the node via the editor as well: just look at what My_Image.lua looks like after you upload a file into it, keeping in mind that the value of "content" is base64-encoded image data.

How to do to convert the old page storage format to the new git storage format? Please supply a tool or method? I can't bear write them one by one manually by myself!

Depends on how old. Pages created by "Cottington" releases (before 2008) will need to be converted. There is a script to convert those files to the new default format (files in directories): http://sputnik.freewisdom.org/en/MigratingfromCottington. I haven't tested it recently, so it might be a bit stale, but I will try to get back to it the next few days.

I will also provide a script for converting data into the new git format. For now, you can try something like this:

require"luarocks.require"
require"versium.filedir"
require"versium.git"
old = versium.filedir.new{"/tmp/old-sputnik/wiki-data/"}
new = versium.git.new{"/tmp/new-sputnik/wiki-data/"}
for i, id in ipairs(old:get_node_ids()) do
   print(id)
   for j, edit in ipairs(old:get_node_history(id)) do
      data = old:get_node(id, edit.version)
      new:save_version(id, data, edit.author, edit.comment)
   end
end

Note that what we do here is create a versium.filedir versium instance for the old repository (assuming the default Dish of the Day / Earth format), a versium.git for the new repository, then just copy the content edit-by-edit from one repository into another. Note that this will preserve revisions and comments, but will lose the timestamps. I am not sure how to backdate commits git.

  • yuri

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