Skip to content

Commit 23bde45

Browse files
committed
4.2.0 release
#188 biosecurity and blog email templates
1 parent 917424f commit 23bde45

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2151
-897
lines changed

README.md

+20-4
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,38 @@ Scheduling is handled by Quartz plugin in the app. It works like RSS - it checks
88

99
[![Build Status](https://api.travis-ci.com/AtlasOfLivingAustralia/alerts.svg?branch=develop)](https://app.travis-ci.com/github/AtlasOfLivingAustralia/alerts)
1010

11-
# Dev environment set up
11+
# Dev environment set up
1212

13+
## Recommend:
14+
Go folder ```./docker```, run ```docker-compose up```
15+
16+
Docker-compose runs MySql 8.1 on 3306, smtp4dev on 3000, 2525
17+
18+
19+
## Alternative, you can install your own environment
20+
21+
What the docker-compose does:
1322
1. Install MySql
1423
1. Log in as root
1524
1. ```create user 'alerts_user'@'localhost' identified as 'alerts_user';```
1625
1. ```grant all privileges on *.* to 'alerts_user'@'localhost';```
1726
1. ```create database alerts```
1827
1. Create /data/alerts/config/alerts-config.properties
19-
1. Use the template in ala-install to get the necessary values
28+
1. Use the template in ala-install to get the necessary values
2029

2130

22-
## To check email sending on local dev environment
31+
### To check email sending on local dev environment
2332
Run [smtp4dev](https://github.com/rnwood/smtp4dev) via Docker:
2433

2534
`docker run -p 3000:80 -p 2525:25 -d --name smtpdev rnwood/smtp4dev`
2635

27-
Emails will be sent on SMTP port 2525 (configure sending emails via `postie.enableEmail=true`, `grails.mail.port=2525` and `grails.mail.server=localhost`. Note: emails will not be delivered externally so you don't have to worry about spamming users.
36+
Emails will be sent on SMTP port 2525 (configure sending emails via `mail.enabled=true`, `grails.mail.port=2525` and `grails.mail.server=localhost`. Note: emails will not be delivered externally so you don't have to worry about spamming users.
2837

2938
You can view all sent emails via the smtp4dev UI on http://localhost:3000/, inlcuding HTML emails which are nicely displayed.
39+
40+
41+
### 4.2.0 Release
42+
43+
Change logs
44+
DB schema update:
45+
``` ALTER TABLE alerts.query_result MODIFY logs TEXT NULL; ```

build.gradle

+8-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* rights and limitations under the License.
1212
*/
1313
buildscript {
14-
version "4.0.0"
14+
version "4.2.0"
1515
group "au.org.ala"
1616
}
1717

@@ -25,9 +25,7 @@ plugins {
2525
id "com.bertramlabs.asset-pipeline"
2626
id "application"
2727
id "eclipse"
28-
2928
id "com.gorylenko.gradle-git-properties" version "2.4.1"
30-
3129
id "maven-publish"
3230
}
3331

@@ -105,6 +103,8 @@ dependencies {
105103
implementation "org.grails.plugins:hibernate5"
106104
implementation("org.hibernate:hibernate-core:5.6.15.Final")
107105
implementation "org.hibernate:hibernate-jcache"
106+
implementation 'org.codehaus.groovy.modules.http-builder:http-builder:latest.release'
107+
108108
compileOnly("io.micronaut:micronaut-inject-groovy")
109109

110110
implementation "org.grails.plugins:gsp"
@@ -132,7 +132,10 @@ dependencies {
132132
implementation "org.apache.httpcomponents:httpcore:4.4.16"
133133

134134
implementation 'dk.glasius:external-config:3.1.1'
135-
implementation 'org.grails.plugins:mail:3.0.0'
135+
136+
//Using AWS SES as email provider
137+
implementation 'org.grails.plugins:mail:4.0.0'
138+
implementation 'au.org.ala:ala-mail:1.0.0-SNAPSHOT'
136139

137140
implementation 'org.grails.plugins:schwartz-monitor:2.0.1.ALA-SNAPSHOT'
138141
implementation 'org.grails.plugins:quartz:2.0.13'
@@ -156,7 +159,7 @@ dependencies {
156159
runtimeOnly 'xalan:xalan:2.7.3'
157160
implementation 'com.jayway.jsonpath:json-path:2.7.0'
158161
implementation 'com.jayway.jsonpath:json-path-assert:2.7.0'
159-
implementation 'au.org.ala.plugins:openapi:1.1.0'
162+
implementation 'au.org.ala.plugins:openapi:1.3.0'
160163
}
161164
//
162165
//bootRun {

docker/.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
COMPOSE_PROJECT_NAME=alerts

docker/docker-compose.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
services:
3+
mysql:
4+
container_name: mysql-alerts
5+
image: "mysql:8.1.0"
6+
environment:
7+
MYSQL_DATABASE: 'alerts'
8+
MYSQL_USER: 'alerts_user'
9+
MYSQL_PASSWORD: 'password'
10+
MYSQL_ROOT_PASSWORD: 'password'
11+
command: --default-authentication-plugin=mysql_native_password
12+
ports:
13+
- "3309:3306"
14+
expose:
15+
- '3309'
16+
smtpdev:
17+
image: rnwood/smtp4dev
18+
ports:
19+
- "3000:80"
20+
- "2525:25"
21+
container_name: smtpdev-alerts
22+
23+
version: "2"
76.9 KB
Loading
77.9 KB
Loading
Loading
Loading
Loading
Loading
115 KB
Loading
155 KB
Loading
Loading
Loading

grails-app/assets/javascripts/bootstrap-3-typeahead-4.0.1.min.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

grails-app/assets/stylesheets/alerts.css

+31-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,34 @@ a.btn-ala {
6161

6262
.biosecurityTableColumn {
6363
width: 20%;
64-
}
64+
}
65+
66+
.bioscecrurity-padding {
67+
padding: 20px 0px 20px 0px;
68+
}
69+
70+
.more-button {
71+
background-color: #C44D34;
72+
cursor: pointer;
73+
border: 0;
74+
border-radius: 10px;
75+
color: white;
76+
padding: 11px 19px;
77+
text-align: center;
78+
display: inline-block;
79+
font-size: 16px;
80+
}
81+
82+
.badge-info {
83+
background-color: #17a2b8; /* Adjust the color as needed */
84+
color: #fff;
85+
}
86+
87+
.custom-list {
88+
counter-reset: list-counter;
89+
}
90+
91+
.indented-text {
92+
text-indent: -2ch;
93+
padding-left: 3ch;
94+
}

grails-app/conf/application.yml

+65-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
---
2+
# mail.enabled: true will send email via a mail server depending on the mail.ses.enabled
3+
4+
# Set mail.ses.enabled true will use AWS SES, it requires the AWS credentials to be set in the environment variables
5+
# Set false will use the default grails mail plugin, we need to config the mail server and port in grails.mail
6+
# In dev, email will be posted to Postie docker container, which can be accessed via http://localhost:3000
7+
8+
mail:
9+
enabled: true
10+
ses:
11+
enabled: false
12+
details:
13+
sender: "alerts@ala.org.au"
14+
alertAddressTitle: "Atlas alerts"
15+
infoSender: "alerts@ala.org.au"
16+
infoAddressTitle: "Atlas of Living Australia"
17+
defaultResourceName: "Atlas of Living Australia"
18+
# forceAllAlertsGetSent results in emails getting sent regardless if data has changed - only use in DEV env
19+
forceAllAlertsGetSent: false
20+
221
grails:
22+
#default mail service
23+
mail:
24+
port: 2525
25+
server: localhost
326
profile: web
427
cache:
528
clearAtStartup: true
@@ -115,15 +138,6 @@ security:
115138
adminRole: ROLE_ADMIN
116139
uriFilterPattern: ["/","/alaAdmin/*","/testAuth/*","/query/*","/admin/*","/admin/user/*","/admin/user/debug/*","/admin/debug/all","/notification/myAlerts","/notification/changeFrequency","/notification/addMyAlert","/notification/addMyAlert/*","/notification/deleteMyAlert/*","/notification/deleteMyAlert/*","/notification/deleteMyAlertWR/*","/webservice/*","/webservice/createTaxonAlert","/webservice/taxonAlerts","/webservice/createRegionAlert","/webservice/regionAlerts","/webservice/deleteTaxonAlert/*","/webservice/create*","/webservice/createSpeciesGroupRegionAlert","/ws/*","/ws/createTaxonAlert","/ws/taxonAlerts","/ws/createRegionAlert","/ws/regionAlerts","/ws/deleteTaxonAlert/*","/ws/createTaxonRegionAlert","/ws/createSpeciesGroupRegionAlert","/admin/runChecksNow"]
117140

118-
postie:
119-
emailSender: "atlas-alerts@ala.org.au"
120-
emailAlertAddressTitle: "Atlas alerts"
121-
emailInfoAddressTitle: "Atlas of Living Australia"
122-
emailInfoSender: "atlas-alerts@ala.org.au"
123-
defaultResourceName: "Atlas of Living Australia"
124-
enableEmail: false
125-
# forceAllAlertsGetSent results in emails getting sent regardless if data has changed - only use in DEV env
126-
forceAllAlertsGetSent: false
127141
ala:
128142
baseURL: "https://www.ala.org.au"
129143
userDetailsURL: "https://auth.ala.org.au/userdetails/userDetails/getUserListFull"
@@ -156,6 +170,11 @@ useBlogsAlerts: true
156170
useCitizenScienceAlerts: true
157171
biosecurity:
158172
cronExpression: '0 30 9 ? * WED'
173+
query:
174+
template:
175+
authoritativeList: /occurrences/search?q=species_list_uid:___LISTIDPARAM___&fq=decade:2020&fq=country:Australia&fq=first_loaded_date:[___DATEPARAM___%20TO%20*]&fq=occurrence_date:[___LASTYEARPARAM___%20TO%20*]&sort=first_loaded_date&dir=desc&disableAllQualityFilters=true
176+
nonAuthoritativeList: /occurrences/search?q=species_list:___LISTIDPARAM___&fq=decade:2020&fq=country:Australia&fq=first_loaded_date:[___DATEPARAM___%20TO%20*]&fq=occurrence_date:[___LASTYEARPARAM___%20TO%20*]&sort=first_loaded_date&dir=desc&disableAllQualityFilters=true
177+
maxRecords: 500
159178
moreinfo:
160179
link: https://www.ala.org.au/blogs-news/ala-helps-to-stop-pests-in-their-tracks/
161180
dir: /data/alerts/emails
@@ -172,7 +191,7 @@ biosecurity:
172191
lgaField: cl10923
173192
shape: cl11033:"Namadgi" OR cl11033:"Tidbinbilla" OR cl11033:"Bimberi"
174193
#shape: spatialObject:9223660
175-
eventDateAge: 29
194+
eventDateAge: 150
176195
firstLoadedDateAge: 8
177196

178197
environments:
@@ -182,16 +201,41 @@ environments:
182201
mail:
183202
host: "localhost"
184203
port: 1025
185-
username: postie.emailSender
204+
#username: postie.emailSender
186205
security:
187206
cas:
188207
appServerName: "http://localhost:8080"
208+
userdetails:
209+
web:
210+
url: https://aws-auth-test-2023.test.ala.org.au/userdetails/
211+
api:
212+
url: https://api.test.ala.org.au/userdetails/cognito/
213+
mail:
214+
details:
215+
sender: "alerts-test@ala.org.au"
216+
alertAddressTitle: "Atlas alerts [Dev]"
217+
infoAddressTitle: "Atlas of Living Australia [Dev]"
218+
infoSender: "alerts-test@ala.org.au"
189219
test:
190220
grails:
191221
serverURL: "http://dev.ala.org.au:8080"
222+
mail:
223+
host: "localhost"
224+
port: 25
192225
security:
193226
cas:
194227
appServerName: "https://auth.ala.org.au"
228+
userdetails:
229+
web:
230+
url: https://aws-auth-test-2023.test.ala.org.au/userdetails/
231+
api:
232+
url: https://api.test.ala.org.au/userdetails/cognito/
233+
mail:
234+
details:
235+
sender: "alerts-test@ala.org.au"
236+
alertAddressTitle: "Atlas alerts [Test]"
237+
infoAddressTitle: "Atlas of Living Australia [Test]"
238+
infoSender: "alerts-test@ala.org.au"
195239
production:
196240
grails:
197241
serverURL: "https://auth.ala.org.au/alerts"
@@ -201,6 +245,11 @@ environments:
201245
security:
202246
cas:
203247
appServerName: "https://auth.ala.org.au"
248+
userdetails:
249+
web:
250+
url: https://auth.ala.org.au/userdetails/
251+
api:
252+
url: https://api.ala.org.au/userdetails/cognito/
204253

205254
---
206255
hibernate:
@@ -229,7 +278,7 @@ dataSource:
229278
validationQueryTimeout: 10 # seconds (default: -1 i.e. disabled)
230279
validationInterval: 30000 # milliseconds, default is 30000 (30 seconds)
231280
removeAbandoned: true # # default: false
232-
removeAbandonedTimeout: 300 # seconds (default: 60)
281+
removeAbandonedTimeout: 3600 # seconds (default: 60), must be > quartz job duration
233282
logAbandoned: true # adds some overhead to every borrow from the pool, disable if it becomes a performance issue
234283
logValidationErrors: true # default: false, logs validation errors at SEVERE
235284
# NOTE: removeAbandoned: true OR testWhileIdle: true enables the Pool Cleaner. There is a bug with the
@@ -259,9 +308,11 @@ environments:
259308
username: sa
260309
password:
261310
url: jdbc:h2:mem:testDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
311+
userDetails:
312+
url: https://aws-auth-test-2023.test.ala.org.au/userdetails/
262313
production:
263314
dataSource:
264-
dbCreate: none
315+
dbCreate: update
265316

266317
myannotation:
267318
enabled: false
@@ -270,8 +321,7 @@ webservice:
270321
jwt: true
271322
jwt-scopes: "openid users/read"
272323

273-
userDetails:
274-
url: https://aws-auth-dev.ala.org.au/userdetails/
324+
275325

276326
security:
277327
cas:

0 commit comments

Comments
 (0)