'From Pharo1.1.1 of 12 September 2010 [Latest update: #11414] on 23 November 2010 at 11:20:21 am'! Object subclass: #ZZInstallUtility instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'ZZ'! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! ZZInstallUtility class instanceVariableNames: ''! !ZZInstallUtility class methodsFor: 'build-core' stamp: 'YanniChiu 11/23/2010 11:15'! addAuthenticationFilter: application application configuration addParent: WAAuthConfiguration instance. application preferenceAt: #login put: 'admin'; preferenceAt: #passwordHash put: (GRPlatform current secureHashFor: 'pier'); yourself. ^ application addFilter: WAAuthenticationFilter new ! ! !ZZInstallUtility class methodsFor: 'build-core' stamp: 'YanniChiu 11/23/2010 11:15'! adminEntryPoints ^ #( '/config' '/status' '/tools/classbrowser' '/tools/screenshot' '/tools/versionuploader' '/tools/vnc' )! ! !ZZInstallUtility class methodsFor: 'build-core' stamp: 'YanniChiu 11/23/2010 11:15'! prepareImage "self prepareImage" Author fullName: 'deployed'. self prepareVncServer. self prepareSeaside. ! ! !ZZInstallUtility class methodsFor: 'build-core' stamp: 'YanniChiu 11/23/2010 11:15'! prepareSeaside "Turn off the Seaside toolbar" WAAdmin applicationDefaults removeParent: WADevelopmentConfiguration instance. WADispatcher default withDescendantsDo: [:each | each isApplication ifTrue: [ | pathString | pathString := each hierarchyPathString. "Set access control on all Seaside admin tools" (self adminEntryPoints includes: pathString) ifTrue: [ self addAuthenticationFilter: each ] ifFalse: [ "Trim all but the public entry points" (self publicEntryPoints includes: pathString) ifFalse: [ WAAdmin unregister: pathString ] ] ] ]. "Unregister empty dispatchers" WADispatcher default withDescendantsDo: [:each | (each isDispatcher and: [ each handlers isEmpty ]) ifTrue: [ WAAdmin unregister: each hierarchyPathString ] ] ! ! !ZZInstallUtility class methodsFor: 'build-core' stamp: 'YanniChiu 11/23/2010 11:15'! prepareVncServer "Set up RFB/VNC Server for production deployment" (RFBServer current) initializePreferences; configureForMemoryConservation; allowEmptyPasswords: false; setFullPassword: 'pier'; setViewPassword: 'pier'; "start: 1;" "Use WAVNCController to start/stop" yourself. ! ! !ZZInstallUtility class methodsFor: 'build-core' stamp: 'YanniChiu 11/23/2010 11:15'! publicEntryPoints ^ #('/browse' '/files' '/pier')! ! !ZZInstallUtility class methodsFor: 'build-customize' stamp: 'YanniChiu 11/23/2010 11:15'! changePasswordsTo: password "Change various passwords to differ from the build script values. Example: self changePasswordsTo: 'abcde' " self adminEntryPoints do: [ :each | | application | application := WADispatcher default handlerAt: each. "application configuration addParent: WAAuthConfiguration instance." application preferenceAt: #login put: 'admin'; preferenceAt: #passwordHash put: (GRPlatform current secureHashFor: password); yourself "application addFilter: WAAuthenticationFilter new." ]. (PRKernel instanceNamed: 'pier') adminUser password: password. "((PRKernel instanceNamed: 'pier') userNamed: 'demo' ifNone: [ ]) password: password." (RFBServer current) setFullPassword: password; setViewPassword: password; yourself! ! !ZZInstallUtility class methodsFor: 'build-customize' stamp: 'YanniChiu 11/23/2010 11:19'! changeServerHostname: serverHostname port: port "Set the serverHostname of all deployed entry points. Example use: self changeServerHostname: 'www.foobar.com' port: 80 self changeServerHostname: 'localhost' port: 8080 " self adminEntryPoints , self publicEntryPoints do: [ :each | | application | application := WADispatcher default handlerAt: each. application preferenceAt: #serverProtocol put: 'http'; preferenceAt: #serverPort put: port; preferenceAt: #serverHostname put: serverHostname; "preferenceAt: #serverPath put: '/';" yourself ]! !