In order to mitigate against the brute force attacks against Gitlab accounts, we are moving to all edu-ID Logins. We would like to remind you to link your account with your edu-id. Login will be possible only by edu-ID after November 30, 2021. Here you can find the instructions for linking your account.

If you don't have a SWITCH edu-ID, you can create one with this guide here

kind regards

This Server has been upgraded to GitLab release 14.2.6

Unverified Commit 9bd362f4 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

make media folder root path customisable

parent 6532ade9
Pipeline #18427 passed with stages
in 7 minutes and 25 seconds
......@@ -61,6 +61,8 @@ spec:
value: fedora-output-json-records
- name: TOPIC_PROCESS
value: postprocessing-reporting
- name: MEDIA_FOLDER_ROOT_PATH
value: "/data"
restartPolicy: Always
volumes:
......
......@@ -4,6 +4,7 @@ app:
externalBaseUrl: ${EXTERNAL_BASE_URL:?system}
fedoraUser: ${FEDORA_USER:?system}
fedoraPassword: ${FEDORA_PASSWORD:?system}
mediaFolderRootPath: ${MEDIA_FOLDER_ROOT_PATH:?system}
kafka:
consumer:
bootstrap.servers: ${KAFKA_BOOTSTRAP_SERVERS:?system}
......
......@@ -35,7 +35,8 @@ object App extends scala.App with Logging with RecordUtils {
"internalBaseUrl",
"externalBaseUrl",
"fedoraUser",
"fedoraPassword"
"fedoraPassword",
"mediaFolderRootPath"
).asJava,
"app.yml",
true,
......
......@@ -21,11 +21,11 @@ package ch.memobase
import ch.memobase.models.MimeType
object FileUtils {
trait FileUtils {
import models.Conversions._
val rootPath = "/data"
val rootPath: String
val videoFilePath: (String, MimeType) => String =
(id, mimeType) => s"$rootPath/$id.${getFileTypeExtension(mimeType).get}"
......
......@@ -41,9 +41,9 @@ case class ProcessIgnore(id: String, msg: String) extends ProcessOutcome
class RecordProcessor(fileHandler: DisseminationCopyHandler,
fedoraClientWrapper: FedoraClientWrapper,
appSettings: Properties) {
appSettings: Properties) extends FileUtils {
import FileUtils._
val rootPath: String = appSettings.getProperty("mediaFolderRootPath")
def process(record: ConsumerRecord[String, String]): List[ProcessOutcome] = {
BinaryResourceMetadata.build(record.value(), appSettings.getProperty("externalBaseUrl")) flatMap {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment