Tokyo Promenade is a kind of content management system. That is, Tokyo Promenade is a system in order to manage Web contents easily by providing total functions of browsing, authoring, editing Web contents on the Web interface itself. Tokyo Promenade has the following features.
Tokyo Promenade is available on platforms which have API conforming to C99 and POSIX. Tokyo Promenade is a free software licensed under the GNU General Public License.
Install the latest version of Tokyo Cabinet beforehand and get the package of Tokyo Promenade.
When an archive file of Tokyo Promenade is extracted, change the current working directory to the generated directory and perform installation.
Run the configuration script. To enable the Lua extension, add the `--enable-lua' option. To enable the FastCGI script, add the `--enable-fcgi' option.
./configure
Build programs.
make
Perform self-diagnostic test.
make check
Install programs. This operation must be carried out by the root user.
make install
When a series of work finishes, the following files will be installed.
/usr/local/bin/prommgr /usr/local/libexec/promenade.cgi /usr/local/libexec/promscrcount.lua /usr/local/libexec/promupdiff.sh /usr/local/libexec/promupping.sh /usr/local/share/tokyopromenade/... /usr/local/man/man1/... /usr/local/man/man3/...
Install an arbitrary web server which supports the CGI mechanism. Then, create a directory where CGI scripts can be executed. We call it the base directory, which contains some files of Tokyo Promenade.
mkdir -p /path/to/the/base/directory cd /path/to/the/base/directory
Copy the CGI script and some configuration files into the base directory.
cp /usr/local/libexec/promenade.cgi . cp /usr/local/share/tokyopromenade/promenade.* . cp /usr/local/share/tokyopromenade/passwd.txt .
Create the database file where articles are stored.
prommgr create promenade.tct
Import the help articles into the database.
prommgr import promenade.tct /usr/local/share/tokyopromenade/misc/help-*.tpw
Create a directory where uploaded files are stored.
mkdir upload
The CGI script should have permissions to read/write the database file, the upload directory and the password file. To achieve the purpose, one of the following is suggested.
sudo chown -R www:nobody /path/to/the/base/directory
chmod -R 777 /path/to/the/base/directory
When all steps above are finished, access the CGI script with a Web browser.
The account for the administrator is prepared by default. The name is "admin
" and the default password is "nimda
". After the deployment of the site, what to do first is to login as the administrator and change the password.
To login, select the "Login
" link in the navigation bar on the top of the page. The login form is shown and then input the user name and the password. After the login operation, some links are added to the navigation bar. Select the "Users
" link and the user management form is shown and then input the new password twice in the "change password" column for the administrator and press the "change" button.
To update the site contents, authorization by the login operation is needed. And, the administrator only has privilege of the user management and freezing articles. Adding the "*
" tag to the tag attribute of each article means freezing the article. Such frozen articles is not editable by users except for administrator.
By default, an anchor string "About" in the navigation bar links to an article whose name is "tp-about". Because the article is not defined, you should select the link and write it at the start. Note that the "?
" tag means to hide the article from the timeline page.
The command `prommgr
' is a command line utility. The usage is the following.
prommgr create [-fts] dbpath [scale]
prommgr import [-suf str] dbpath file ...
prommgr export [-dir str] dbpath [id]
prommgr update dbpath id [file]
prommgr remove dbpath id
prommgr convert [-fw|-ft] [-buri str] [-duri str] [-page] [file]
prommgr passwd [-salt str] [-info str] name pass
prommgr version
To add users by batch processing, the `passwd
' subcommand is useful. Take the following for example.
prommgr passwd -salt tokyopromenade -info "John Doe" "john" "iloveyou"
To backup the database and the upload directory, simply use the `tar
' command.
tar zcvf mybackup-20090810.tar.gz promenade.tct* upload
To customize the behavior of the CGI script, edit the template file `promenade.tmpl
'. The following configuration variables are defined there.
database
: the path of the database filepassword
: the path of the password fileupload
: the path of the update directoryscrext
: the path of the Lua extension file.recvmax
: the maximum length of the received datamimerule
: the dicision rule of the MIME typetitle
: the title of the sitesubtitle
: the subtitle of the sitelang
: the language of the siteauthor
: the author of the sitesearchnum
: the number of articles in each search pagelistnum
: the number of articles in each timeline pagefeedlistnum
: the number of articles in each feedfilenum
: the number of files in each file management pagesidebarnum
: the number of items in the side barcommentmode
: the type of comment authorizationupdatecmd
: the path of the update commandsessionlife
: the lifetime of each session in secondshomepage
: the URL of the home page of the sitefrontpage
: the name of the article for the front pageaboutpage
: the name of the article for the site introduction pageThe other sections of the template file describes the output data in HTML and Atom. The file `promenade.css
' is the CSS file to decorate HTML. You can modify them arbitrary to customize the user interface.
If the `password
' is omitted or empty, authentication is disabled and all visitors can update all contents without the login operation.
The `mimerule
' can be "auto", "xhtml", or "html". "auto" means that the MIME type is detected with adapted to the ability to user agents. "xhtml" means the MIME type is always XHTML. "html" means the MIME type is always HTML.
The `commentmode
' can be "all", "riddle", "login", or "none". "all" means that all visitors can write comments. "riddle" means that users who cleared a riddle can write comments. "login" means that login users only can write comments. "none" means no user can write comments. If the `frontpage
' does not specified, the top page shows the timeline of recent articles.
The `scrext
' specifies the path of a Lua script file. It works only when Tokyo Promenade was built with enabling the Lua extension. There is naming convention of functions to be called. The function "_begin" is called before the database is opened, and receives no parameter, and returns a message string to be shown by the template variable "beginmsg". The function "_end" is called before the database is opened, and receives no parameter, and returns a message string to be shown by the template variable "endmsg". The function "_procart" is called for each article to be printed, and receives the Wiki string of the article, and returns the converted Wiki string. The function "_procpage" is called to convert the HTML string of the whole page to be printed, and receives the HTML string of the whole page, and returns the converted HTML string. The configuration variables of the template file are given as a table of the global variable "_conf". The parameters of the CGI script are given as a table of the global variable "_params". The login user information is given as a table of the global variable "_user". The built-in functions "_strstr" and "_regex" are provided for pattern matching and replacement. The both takes three parameters; the first is the source string, the second is the matching pattern, and the third is the replacement string. The third is optional and matching is just checked if it is omitted. The following Lua script files are installed under "/usr/local/libexec" by default.
promscrsample.lua
: sample implementationpromscrcount.lua
: simple access counterThe `updatecmd
' specifies the path of a command file, which is called after every article is updated. The script receives seven parameters. The first is one of the following operation modes: "new", "update", "comment", and "remove". The second is the ID number of the updated article. The third is the name of the cache file of the new content. The fourth is the name of the cache file of the old content. The fifth is the timestamp in microseconds. The sixth parameter is the name of the user of the update operation. The seventh parameter is the absolute URL of the SGI script. The configuration variables of the template file are given as environment variables whose names are led with the prefix "TP_" and transformed into upper cases. The following shell script files are installed under "/usr/local/libexec" by default.
promupdiff.sh
: record difference data to trace the site history bypromupping.sh
: notify site update to public feed subscription servicesAccording to this tutorial, the password file is placed under the document root of the web server and it is revealed to the internet. However, it is safer to hide the password file into another directory which is not published, though each password is ciphered.
Tokyo Promenade is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
Tokyo Promenade is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see `http://www.gnu.org/licenses/
'.
Tokyo Promenade was written by FAL Labs. You can contact the author by e-mail to `info@fallabs.com
'.