Author: scottbw
Date: Fri Aug 31 08:15:24 2012
New Revision: 1379351
URL: http://svn.apache.org/viewvc?rev=1379351&view=rev
Log:
Use separate settings for system forwarding system proxy from server-side proxy
settings returned to widgets; see WOOKIE-364. Thanks to Matthias Niederhausen
for the patch.
Modified:
incubator/wookie/trunk/src/org/apache/wookie/proxy/ConnectionsPrefsManager.java
incubator/wookie/trunk/src/widgetserver.properties
Modified:
incubator/wookie/trunk/src/org/apache/wookie/proxy/ConnectionsPrefsManager.java
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/proxy/ConnectionsPrefsManager.java?rev=1379351&r1=1379350&r2=1379351&view=diff
==============================================================================
---
incubator/wookie/trunk/src/org/apache/wookie/proxy/ConnectionsPrefsManager.java
(original)
+++
incubator/wookie/trunk/src/org/apache/wookie/proxy/ConnectionsPrefsManager.java
Fri Aug 31 08:15:24 2012
@@ -24,9 +24,6 @@ import org.apache.log4j.Logger;
/**
* Read in & process the proxy settings from the properties file
- * @author Paul Sharples
- * @version $Id: ConnectionsPrefsManager.java,v 1.2 2009-07-28 16:05:23
scottwilson Exp $
- *
*/
public class ConnectionsPrefsManager {
@@ -38,11 +35,11 @@ public class ConnectionsPrefsManager {
private static String fHostname = null;
private static void init(Configuration properties){
- fHostname = properties.getString("widget.proxy.hostname");
+ fHostname = properties.getString("system.proxy.hostname");
if(fHostname != null) {
fIsProxySet = (fHostname.length() > 0 ? true : false);
}
- fUseNTLMAuthentication =
properties.getBoolean("widget.proxy.usentlmauthentication");
+ fUseNTLMAuthentication =
properties.getBoolean("system.proxy.usentlmauthentication",false);
fParsedFile = true;
}
@@ -53,15 +50,11 @@ public class ConnectionsPrefsManager {
public static void setProxySettings(HttpClient client, Configuration
properties) {
if(!fParsedFile) init(properties); // just do this once - will
have to reboot for changes to take effect
if(isProxyServerSet()){
- int port;
- try{
- port = properties.getInt("widget.proxy.port");
- }
- catch(Exception ex){
- port=8080; // default for now if not specified
- }
- String username =
properties.getString("widget.proxy.username");
- String password =
properties.getString("widget.proxy.password");
+ int port = properties.getInt("system.proxy.port",8080);
//$NON-NLS-1$
+ String username =
properties.getString("system.proxy.username"); //$NON-NLS-1$
+ String password =
properties.getString("system.proxy.password"); //$NON-NLS-1$
+
+ fLogger.info("setting proxy conf:"+fHostname+":"+port);
HostConfiguration hConf= client.getHostConfiguration();
hConf.setProxy(fHostname, port);
Modified: incubator/wookie/trunk/src/widgetserver.properties
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/widgetserver.properties?rev=1379351&r1=1379350&r2=1379351&view=diff
==============================================================================
--- incubator/wookie/trunk/src/widgetserver.properties (original)
+++ incubator/wookie/trunk/src/widgetserver.properties Fri Aug 31 08:15:24 2012
@@ -4,6 +4,7 @@ widget.email.contact=wookie-dev@incubato
widget.web.page=http://incubator.apache.org/wookie
# Keep this true while developing, but set to false for a build
widget.debug=true
+
#######################################################################
# By default Wookie will use the same scheme/host/port it is being
# served from when generating URLs for widgets. By changing these
@@ -12,50 +13,80 @@ widget.debug=true
#widget.server.scheme=
#widget.server.hostname=
#widget.server.port=
+
#######################################################################
## Sending emails
widget.email.server=localhost
widget.email.port=25
#widget.email.username=
#widget.email.password=
+
#######################################################################
+# Widget deployment settings - you normally won't need to change
+# these
+#
widget.useruploadfolder=/upload
widget.widgetfolder=/wservices
-#######################################################################
# Set hot_deploy to true, and .wgt files dropped into widget.deployfolder
# will automatically be added to the server
widget.deployfolder=/deploy
widget.hot_deploy=true
+
#######################################################################
# Location of Shindig services
+#
widget.shindig.url=/
widget.metadata.url=/gadgets/metadata
+
#######################################################################
+# Server-side proxy (SSP)
+#
+# These settings are used for configuring the built-in proxy used to
+# handle Ajax requests by widgets, bypassing same-origin restrictions.
+#
+# Set to true to use access policies to filter requests; this is
+# *highly recommended*. Settings this to false allows any widget to
+# access any origin.
widget.proxy.usewhitelist=true
+# Set this to true to verify that requests to the SSP originate with
+# this server; this should be set to false where the server uses
+# a virtual host configuration
widget.proxy.checkdomain=false
-## local proxy settings - note if no hostname is specified then no proxy will
be used ##
+# Set these to override the default proxy location provided to widgets
widget.proxy.scheme=
widget.proxy.hostname=
widget.proxy.port=
-## default is to use the Wookie whitelist proxy
widget.proxy.path=/proxy
-## comment out the line above, and uncomment this to use the Shindig open
proxy instead
-# widget.proxy.path=/gadgets/proxy
-widget.proxy.username=
-widget.proxy.password=
-widget.proxy.usentlmauthentication=false
-## language settings
-## NB "en-gb-yorks" is for testing localization
+
+
+#######################################################################
+#
+# System proxy settings
+#
+# When a system forwarding proxy is in place for your network, use
+# the settings below to configure the internal proxy host and port. This
+# information is used in the internal HttpClient configuration and is not
+# exposed externally.
+#
+#system.proxy.hostname=
+#system.proxy.port=
+#system.proxy.username=
+#system.proxy.password=
+#system.proxy.usentlmauthentication=false
+
+#######################################################################
+# language settings
+#
+# NB "en-gb-yorks" is for testing localization
widget.locales=en, nl, fr, en-gb-yorks
widget.default.locale=en
+
#######################################################################
# Persistence manager configuration
widget.persistence.manager.classname=@PERSISTENCE_MANAGER_CLASSNAME@
-#######################################################################
# JPA persistence manager configuration, (JNDI: java:comp/env/jdbc/wookie)
widget.persistence.manager.cachesize=1000
widget.persistence.manager.dbtype=@DATABASE_TYPE@
-#######################################################################
# JCR persistence manager configuration, (JNDI: java:comp/env/jcr/wookie)
widget.persistence.manager.user=@REPOSITORY_USER@
widget.persistence.manager.password=@REPOSITORY_PASSWORD@
@@ -64,10 +95,17 @@ widget.persistence.manager.workspace=@RE
# Queue preferences
widget.preferences.useinstancequeues=true
widget.shareddata.useinstancequeues=true
-# Validator service preferences
+
+#######################################################################
+# Validator service
+#
# Allow **anyone** to upload .wgt packages to wookie for validation
# Note: .wgt resources are removed after validation and are not imported
permanently.
widget.enable.validator=false
+
+#######################################################################
+# Broadcast updates
+#
# Broadcast imported widget events to specified url
# The widget identifier is POSTed to the url defined in
widget.import.broadcast.url
widget.import.broadcast=false
@@ -105,6 +143,7 @@ widget.instance.lockeddomain.enabled=fal
#######################################################################
# digital signature settings
+#
# Set this property to have Wookie check widget digital signatures when
# deploying a widget
widget.deployment.verifysignature=true