Settings
You can customize the Piggydb's behavior by modifying the settings. The following is how to change the settings for each package.
- Standalone Package
- modifying application.properties
- All-in-One Package
- modifying run.bat or run.sh
- War Package
- modify application.properties in <extracted-war>/WEB-INF/config.
Those settings also can be set via the Java System Properties.
Database Location
If you use a Standalone Package or All-in-One Package, the database files will be created in ~/piggydb/ (Windows: C:\Documents and Settings\<User>\piggydb), and the database name is "piggydb" by default.
The location of the database files or the database name can be changed via the Piggydb settings "piggydb.database.prefix" and "piggydb.database.name", respectively.
- piggydb.database.prefix: A path of the database directory (default: file:~/piggydb)
- A path should be URL which starts with "file:".
- Windows example: file:C:/path/to/database
- Linux or Mac OS X example: file:/path/to/database
- A path should be URL which starts with "file:".
- piggydb.database.name: A database name
If you use a War Package, the database files will be created in ~/piggydb/ and the database name will be determined by the context path, which is basically a war name. If you deploy a war file named "myknowledge.war", then the database name will be "myknowledge". If the context path is null, then the database name will be "piggydb". This auto war-database mapping allows you to deploy multiple piggydb.wars with separate databases on the same JEE server more easily (NOTE: This feature is available only with servlet 2.5 (tomcat 6.x) or later, otherwise the database name will be "piggydb").
Anonymous Access
Piggydb allows only authenticated (logged in) users to view, edit content by default. But the anonymous access feature has been available since version 4.4. You can enable anonymous access to let users view content without a login (anonymous users can only view content, but not register, edit or delete knowledge fragments).
To enable anonymous access, change the Piggydb settings "piggydb.enableAnonymous" value to "true".
If you use a War Package, you can download an anonymous-enabled package from here: http://sourceforge.net/projects/piggydb/files/ (file name: piggydb-<version>-anonymous.war).
Security
- piggydb.enableClientAddressAuth
- If this value is true, Piggydb invalidates the current session if the client IP address is not the same as the logged-in address.
- piggydb.enableUserAgentAuth
- If this value is true, Piggydb invalidates the current session if the client user-agent is not the same as the logged-in agent.
Others
- piggydb.entity.changeableOnlyForCreator
- If this value is true, a fragment can be modified only by its creator/author