From a423d1c07124ef3b7f87de482bf276747ab4627d Mon Sep 17 00:00:00 2001 From: Santeri Korri Date: Thu, 2 Jan 2025 10:49:02 +0200 Subject: [PATCH 1/3] =?UTF-8?q?OY-5025=20P=C3=A4ivitetty=20PDFBox=20versio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 ++-- project.clj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c4bc871..1413884 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ https://github.com/Opetushallitus/liiteri scm:git:git://github.com/Opetushallitus/liiteri.git scm:git:ssh://git@github.com/Opetushallitus/liiteri.git - 51d8a289e943aed6885d6fa089de955026a21755 + 9423602c71c600b1da773dc00e5b48ec3e7c23a4 src @@ -140,7 +140,7 @@ org.apache.pdfbox pdfbox - 3.0.2 + 3.0.3 diff --git a/project.clj b/project.clj index 85ed2d5..75d41be 100644 --- a/project.clj +++ b/project.clj @@ -17,7 +17,7 @@ [io.netty/netty-codec-http "4.1.60.Final"] ; fixes CVE-2021-21295 [com.typesafe.akka/akka-actor_2.12 "2.5.16"] [io.undertow/undertow-core "2.3.5.Final"] - [org.apache.pdfbox/pdfbox "3.0.2"]] + [org.apache.pdfbox/pdfbox "3.0.3"]] :dependencies [[org.clojure/clojure "1.11.2"] [com.amazonaws/aws-java-sdk-s3 "1.12.740"] From 4d593723332aec4614b9eb7ef003b200734ccca0 Mon Sep 17 00:00:00 2001 From: Santeri Korri Date: Thu, 2 Jan 2025 11:16:15 +0200 Subject: [PATCH 2/3] OY-5025 Refaktoroitu virusskannauksen tulosten prosessoinnin ajastus --- src/liiteri/virus_scan.clj | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/liiteri/virus_scan.clj b/src/liiteri/virus_scan.clj index 7615343..22349b3 100644 --- a/src/liiteri/virus_scan.clj +++ b/src/liiteri/virus_scan.clj @@ -1,17 +1,14 @@ (ns liiteri.virus-scan - (:require [chime :as c] - [clojure.core.async :as a] - [clojure.java.jdbc :as jdbc] + (:require [clojure.java.jdbc :as jdbc] [clojure.string :as string] - [clj-time.core :as t] - [clj-time.periodic :as p] [com.stuartsierra.component :as component] [liiteri.db.file-metadata-store :as metadata-store] [liiteri.files.file-store :as file-store] [liiteri.sqs-client :refer [get-sqs-client]] [taoensso.timbre :as log] [cheshire.core :as json]) - (:import [com.amazonaws.services.sqs.model ReceiveMessageRequest])) + (:import [com.amazonaws.services.sqs.model ReceiveMessageRequest] + [java.util.concurrent Executors TimeUnit ScheduledFuture])) (defn- log-virus-scan-result [file-key filename content-type status elapsed-time] (let [status-str (string/upper-case (name status))] @@ -28,6 +25,7 @@ (let [messages (-> (.receiveMessage sqs-client (-> (ReceiveMessageRequest. result-queue-url) (.withWaitTimeSeconds (int 1)))) ; wait time of 1 second is to enable long polling which means we get answers from all sqs servers (.getMessages))] + (log/info (str "Received " (.size messages) " virus scan results")) (doseq [message messages] (try (let [message (json/parse-string (.getBody message) true) @@ -77,25 +75,23 @@ result-queue-url (-> (.getQueueUrl sqs-poll-results-client result-queue-name) (.getQueueUrl)) poll-interval (get-in config [:bucketav :poll-interval-seconds]) - times (c/chime-ch (p/periodic-seq (t/now) (t/seconds poll-interval)) - {:ch (a/chan (a/sliding-buffer 1))}) - s3-bucket (get-in config [:file-store :s3 :bucket])] - (log/info "Starting virus scan results polling") - (a/go-loop [] - (when-let [_ (a/ Date: Fri, 3 Jan 2025 09:51:59 +0200 Subject: [PATCH 3/3] =?UTF-8?q?OY-5025=20P=C3=A4ivitetty=20timbre-versio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 8 ++++---- project.clj | 6 +++--- src/liiteri/audit_log.clj | 2 +- src/liiteri/core.clj | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 1413884..d349356 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ https://github.com/Opetushallitus/liiteri scm:git:git://github.com/Opetushallitus/liiteri.git scm:git:ssh://git@github.com/Opetushallitus/liiteri.git - 9423602c71c600b1da773dc00e5b48ec3e7c23a4 + 5eb3e1bbea5d3eaba7766294031bb577dff7cc37 src @@ -233,7 +233,7 @@ com.taoensso timbre - 4.10.0 + 6.6.1 timbre-ns-pattern-level @@ -243,7 +243,7 @@ com.fzakaria slf4j-timbre - 0.3.14 + 0.4.1 org.slf4j @@ -363,7 +363,7 @@ oph clj-timbre-access-logging - 1.0.0-SNAPSHOT + 1.1.0-SNAPSHOT oph diff --git a/project.clj b/project.clj index 75d41be..0fe6150 100644 --- a/project.clj +++ b/project.clj @@ -36,9 +36,9 @@ [prismatic/schema "1.1.12"] [metosin/schema-tools "0.12.0"] [javax.servlet/servlet-api "2.5"] - [com.taoensso/timbre "4.10.0"] + [com.taoensso/timbre "6.6.1"] [timbre-ns-pattern-level "0.1.2"] - [com.fzakaria/slf4j-timbre "0.3.14"] + [com.fzakaria/slf4j-timbre "0.4.1"] [org.slf4j/slf4j-api "1.7.26"] [org.slf4j/log4j-over-slf4j "1.7.26"] [org.slf4j/jcl-over-slf4j "1.7.26"] @@ -64,7 +64,7 @@ [oph/clj-ring-db-cas-session "0.3.0-SNAPSHOT"] [oph/clj-access-logging "1.0.0-SNAPSHOT"] [oph/clj-stdout-access-logging "1.0.0-SNAPSHOT"] - [oph/clj-timbre-access-logging "1.0.0-SNAPSHOT"] + [oph/clj-timbre-access-logging "1.1.0-SNAPSHOT"] [oph/clj-string-normalizer "0.1.0-SNAPSHOT"]] :repositories [["snapshots" {:url "https://artifactory.opintopolku.fi/artifactory/oph-sade-snapshot-local"}]] diff --git a/src/liiteri/audit_log.clj b/src/liiteri/audit_log.clj index 7c101eb..5722a81 100644 --- a/src/liiteri/audit_log.clj +++ b/src/liiteri/audit_log.clj @@ -2,7 +2,7 @@ (:require [clojure.string :as string] [com.stuartsierra.component :as component] [taoensso.timbre :as timbre] - [taoensso.timbre.appenders.3rd-party.rolling :refer [rolling-appender]]) + [taoensso.timbre.appenders.community.rolling :refer [rolling-appender]]) (:import [fi.vm.sade.auditlog Audit ApplicationType Changes$Builder Logger Operation Target$Builder User] [org.ietf.jgss Oid] (java.net InetAddress))) diff --git a/src/liiteri/core.clj b/src/liiteri/core.clj index dd93447..7a27276 100644 --- a/src/liiteri/core.clj +++ b/src/liiteri/core.clj @@ -14,7 +14,7 @@ [liiteri.mime-fixer :as mime-fixer] [liiteri.preview.preview-generator :as preview-generator] [taoensso.timbre :as log] - [taoensso.timbre.appenders.3rd-party.rolling :refer [rolling-appender]] + [taoensso.timbre.appenders.community.rolling :refer [rolling-appender]] [timbre-ns-pattern-level :as pattern-level] [liiteri.local :as local]) (:import [java.util TimeZone])