Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- |application secureApp removeHandlers secureTools handlersToKeep filesHandlerName toolHandlerNames keepDevTools |
- secureApp := true.
- removeHandlers := true.
- secureTools := true.
- keepDevTools := false.
- Author fullName: 'PhilippeBack'.
- " =========== Patches start ======== "
- #(
- 'Somefileout.st'
- ) do: [ :patch |
- Transcript show: ' Patching with: ', patch; cr.
- (FileLocator imageDirectory / 'patches' / patch) readStreamDo: [ :s | s fileIn ].
- Transcript show: ' Patched.', patch; cr.
- ].
- " =========== Patches end ======== "
- filesHandlerName := 'files'.
- toolHandlerNames := { 'tools'. 'status'. 'browse' } asOrderedCollection.
- handlersToKeep := toolHandlerNames copy add: filesHandlerName; yourself.
- "Set Jira Account"
- JiraSettings
- jiraUrl: '<something>.atlassian.net';
- jiraUsername: '<someuser>';
- jiraPassword: '<somepassord>'.
- "Remove all handlers not for keeps"
- (WADispatcher default handlers keys difference: handlersToKeep)
- do:[ :name | WAAdmin unregister:name ].
- "Dev tools or not"
- keepDevTools ifFalse: [
- WAAdmin applicationDefaults
- removeParent: WADevelopmentConfiguration instance ].
- "
- Register application handler
- and start the server on port 8082,
- including serving static files
- "
- HOWebApplication declareApplicationAndStartServer.
- "Secure app handler if needed"
- secureApp ifTrue: [
- application := WADispatcher default handlerAt: 'smartweb'.
- application configuration addParent: WAAuthConfiguration instance.
- application
- preferenceAt: #login put: '<someweblogin>';
- preferenceAt: #passwordHash put: (GRPlatform current secureHashFor: '<somewebpassword>').
- application
- addFilter: WAAuthenticationFilter new ].
- "Secure other apps if needed - no need to secure files"
- secureTools ifTrue: [
- toolHandlerNames do: [ :toolHandlerName |
- application := WADispatcher default handlerAt: toolHandlerName.
- application configuration addParent: WAAuthConfiguration instance.
- application
- preferenceAt: #login put: 'admin';
- preferenceAt: #passwordHash put: (GRPlatform current secureHashFor: '<someadminpassword>').
- application
- addFilter: WAAuthenticationFilter new
- ]
- ].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement