Prudence
The Scalable REST/JVM
Web Development Platform

Creative Commons License

Administration

Prudence comes with the "Prudence Administration Application." As of Prudence 1.1, this is a simple application that lets you see the servers, virtual hosts and applications in the Prudence instance, and lets you start and stop them. Future versions of Prudence will build on this foundation, allowing for more runtime control, configuration and monitoring.

Installation

Prudence comes with this application installed as "prudence-admin," bound to the default virtual host at the root URL.

Customization

Changing the Root URL

Let's say we want prudence-admin at the "/admin/" URL on the default host, and the "/prudence/admin/" URL on myHost. We'll edit its "settings.*". Here's an example for the JavaScript flavor:
hosts = [[component.defaultHost, '/admin/'], [myHost, '/prudence/admin/']]

Requiring a Password

We'll create a "routing.js" file (for the JavaScript flavor):
// Implement defaults
document.execute('/defaults/application/routing/')
​
importClass(
	org.restlet.security.ChallengeAuthenticator,
	org.restlet.security.MapVerifier,
	org.restlet.data.ChallengeScheme);
​
// Create an authenticator
var verifier = new MapVerifier()
verifier.localSecrets.put('admin', new java.lang.String('opensesame').toCharArray())
var authenticator = new ChallengeAuthenticator(applicationInstance.context,
	ChallengeScheme.HTTP_BASIC, 'Prudence Administration')
authenticator.verifier = verifier
​
// Put authenticator before root
authenticator.next = applicationInstance.inboundRoot
applicationInstance.inboundRoot = authenticator