Skip to content

Commit

Permalink
Merge pull request #142 from correctexam/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
barais authored Jan 13, 2025
2 parents 4db424c + 5d813f2 commit fdf950e
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/docker/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ services:
command: bin/maildev --base-pathname /maildev -w 1080 -s 25
ports:
- 1080
- 25

minio:
image: quay.io/minio/minio
Expand All @@ -62,3 +61,9 @@ services:
- 9010:9000
- 9090:9090
command: server /data --console-address ":9090"
mail:
image: barais/smtprelay
restart: always
volumes:
- ./exampleconf/smtprelay.ini:/app/smtprelay.ini:ro
- ./tmp:/tmp:rw
130 changes: 130 additions & 0 deletions src/main/docker/exampleconf/smtprelay.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
; smtprelay configuration
;
; All config parameters can also be provided as environment
; variables in uppercase and the prefix "SMTPRELAY_".
; (eg. SMTPRELAY_LOGFILE, SMTPRELAY_LOG_FORMAT)

; Logfile (blank/default is stderr)
;logfile =

; Log format: default, plain (no timestamp), json
log_format = default

; Log level: panic, fatal, error, warn, info, debug, trace
log_level = info

; Hostname for this SMTP server
hostname = localhost.localdomain

; Welcome message for clients
;welcome_msg = <hostname> ESMTP ready.

; Listen on the following addresses for incoming
; unencrypted connections.
listen = 127.0.0.1:1025

; STARTTLS and TLS are also supported but need a
; SSL certificate and key.
;listen = tls://127.0.0.1:465 tls://[::1]:465
;listen = starttls://127.0.0.1:587 starttls://[::1]:587
;local_cert = smtpd.pem
;local_key = smtpd.key

; Enforce encrypted connection on STARTTLS ports before
; accepting mails from client.
;local_forcetls = false

; Only use remotes where FROM EMail address in received
; EMail matches remote_sender.
;strict_sender = false
; Socket timeout for read operations
; Duration string as sequence of decimal numbers,
; each with optional fraction and a unit suffix.
; Valid time units are "ns", "us", "ms", "s", "m", "h".
;read_timeout = 60s

; Socket timeout for write operations
; Duration string as sequence of decimal numbers,
; each with optional fraction and a unit suffix.
; Valid time units are "ns", "us", "ms", "s", "m", "h".
;write_timeout = 60s

; Socket timeout for DATA command
; Duration string as sequence of decimal numbers,
; each with optional fraction and a unit suffix.
; Valid time units are "ns", "us", "ms", "s", "m", "h".
;data_timeout = 5m

; Max concurrent connections, use -1 to disable
;max_connections = 100

; Max message size in bytes
;max_message_size = 10240000

; Max RCPT TO calls for each envelope
;max_recipients = 100

; Networks that are allowed to send mails to us
; Defaults to localhost. If set to "", then any address is allowed.
;allowed_nets = 127.0.0.0/8 ::1/128
allowed_nets =
; Regular expression for valid FROM EMail addresses
; If set to "", then any sender is permitted.
; Example: ^(.*)@localhost.localdomain$
;allowed_sender =

; Regular expression for valid TO EMail addresses
; If set to "", then any recipient is permitted.
; Example: ^(.*)@localhost.localdomain$
;allowed_recipients =

; File which contains username and password used for
; authentication before they can send mail.
; File format: username bcrypt-hash [email[,email[,...]]]
; username: The SMTP auth username
; bcrypt-hash: The bcrypt hash of the pasword (generate with "./hasher password")
; email: Comma-separated list of allowed "from" addresses:
; - If omitted, user can send from any address
; - If @domain.com is given, user can send from any address @domain.com
; - Otherwise, email address must match exactly (case-insensitive)
; E.g. "[email protected],@appsrv.example.com"
;allowed_users =

; Relay all mails to this SMTP servers.
; If not set, mails are discarded.
;
; Format:
; protocol://[user[:password]@][netloc][:port][/remote_sender][?param1=value1&...]
;
; protocol: smtp (unencrypted), smtps (TLS), starttls (STARTTLS)
; user: Username for authentication
; password: Password for authentication
; remote_sender: Email address to use as FROM
; params:
; skipVerify: "true" or empty to prevent ssl verification of remote server's certificate
; auth: "login" to use LOGIN authentication

; GMail
;remotes = starttls://user:[email protected]:587

; Mailgun.org
;remotes = starttls://user:[email protected]:587

; Mailjet.com
;remotes = starttls://user:[email protected]:587

; Ignore remote host certificates
;remotes = starttls://user:pass@server:587?skipVerify

; Login Authentication method on outgoing SMTP server
;remotes = smtp://user:pass@server:2525?auth=login

; Sender e-mail address on outgoing SMTP server
;remotes = smtp://user:pass@server:2525/[email protected]?auth=login

; Multiple remotes, space delimited
remotes = smtp://maildev:25?rate=300/1m
; remotes = smtp://127.0.0.1:2525?rate=1/1m

; Pipe messages to external command
;command = /usr/local/bin/script
5 changes: 5 additions & 0 deletions src/main/java/fr/istic/service/ExamSheetService.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ public Paged<ExamSheetDTO> findOrCreateExamSheetByName(Page page, Long scanId, I
this.persistOrUpdate(dto);
}
}
for (ExamSheet e: ExamSheet.findExamSheetByScanWithoutMinusOne(scanId).list()){
if (e.pagemax>=pageInScan){
e.delete();
}
}
nbrpage = ExamSheet.findExamSheetByScanWithoutMinusOne(scanId).count();
if (nbrpage == pageInScan/pageInTemplate){
return new Paged<>(ExamSheet.findExamSheetByScan(scanId).page(page))
Expand Down
1 change: 1 addition & 0 deletions src/main/java/fr/istic/web/rest/ExamSheetResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public Response getAllExamSheets(@BeanParam PageRequestVM pageRequest, @BeanPara
int nbreFeuilleParCopie = Integer
.valueOf("" + ((List) param.get("nbreFeuilleParCopie")).get(0));
int numberPagesInScan = Integer.valueOf("" + ((List) param.get("numberPagesInScan")).get(0));

if (nbreFeuilleParCopie > 0 && numberPagesInScan > 0
&& numberPagesInScan % nbreFeuilleParCopie == 0) {
try {
Expand Down

0 comments on commit fdf950e

Please sign in to comment.