Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 72548b798a | |||
| 342ceee28d | |||
| ecf82b0e2e | |||
| c100b52720 |
@@ -9,8 +9,10 @@ data:
|
||||
forward-headers-strategy: framework
|
||||
|
||||
app:
|
||||
api-key: ${API_KEY}
|
||||
jellyfin:
|
||||
url: {{ $.Values.app.jellyfin.url | quote }}
|
||||
api-key: ${JELLYFIN_API_KEY}
|
||||
s3:
|
||||
url: {{ $.Values.app.s3.url | quote }}
|
||||
access-key: ${S3_ACCESS_KEY}
|
||||
|
||||
@@ -69,16 +69,26 @@ spec:
|
||||
key: dbPassword
|
||||
- name: DB_URL
|
||||
value: "jdbc:postgresql://{{ $.Values.db.host }}:{{ $.Values.db.port }}/{{ $.Values.db.name }}"
|
||||
- name: API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ $.Release.Name }}-{{ $.Chart.Name }}-secret
|
||||
key: apiKey
|
||||
- name: JELLYFIN_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ $.Release.Name }}-{{ $.Chart.Name }}-secret
|
||||
key: jellyfinApiKey
|
||||
- name: S3_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ $.Release.Name }}-{{ $.Chart.Name }}-secret
|
||||
key: app.s3.accessKey
|
||||
key: accessKey
|
||||
- name: S3_SECRET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ $.Release.Name }}-{{ $.Chart.Name }}-secret
|
||||
key: app.s3.secretKey
|
||||
key: secretKey
|
||||
volumeMounts:
|
||||
- mountPath: '/opt/app/config'
|
||||
name: application-properties-volume
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: "{{ $.Release.Name }}-{{ $.Chart.Name }}"
|
||||
annotations: {}
|
||||
spec:
|
||||
rules:
|
||||
- host: {{.Values.ingress.host }}
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: "{{ $.Release.Name }}-{{ $.Chart.Name }}"
|
||||
port:
|
||||
number: {{ .Values.port }}
|
||||
path: /
|
||||
pathType: Prefix
|
||||
@@ -8,3 +8,5 @@ data:
|
||||
dbPassword: {{ (required "DB password не установлен" $.Values.db.password) | b64enc | quote }}
|
||||
accessKey: {{ (required "Accesskey не установлен" $.Values.app.s3.accessKey) | b64enc | quote }}
|
||||
secretKey: {{ (required "Secretkey не установлен" $.Values.app.s3.secretKey) | b64enc | quote }}
|
||||
apiKey: {{ (required "ApiKey не установлен" $.Values.app.apiKey) | b64enc | quote }}
|
||||
jellyfinApiKey: {{ (required "Jellyfin ApiKey не установлен" $.Values.app.jellyfin.apiKey) | b64enc | quote }}
|
||||
|
||||
@@ -23,8 +23,10 @@ db:
|
||||
maxConnections: 10
|
||||
|
||||
app:
|
||||
apiKey: null
|
||||
jellyfin:
|
||||
url: null
|
||||
apiKey: null
|
||||
s3:
|
||||
url: null
|
||||
accessKey: null
|
||||
@@ -35,3 +37,5 @@ app:
|
||||
|
||||
securityContext:
|
||||
privileged: false
|
||||
ingress:
|
||||
host: null
|
||||
|
||||
@@ -7,7 +7,6 @@ import kotlinx.serialization.Serializable
|
||||
data class CreateMirrorRequest(
|
||||
@field:NotBlank(message = "itemId must not be blank")
|
||||
val itemId: String,
|
||||
@field:NotBlank(message = "sourceUrl must not be blank")
|
||||
val sourceUrl: String,
|
||||
val sourceUrl: String = "",
|
||||
val sourceType: String = "jellyfin",
|
||||
)
|
||||
|
||||
@@ -83,6 +83,21 @@ class MirrorControllerTest : AbstractIntegrationTest() {
|
||||
assertEquals(1, count)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `POST mirror without sourceUrl creates a job`() {
|
||||
mockMvc.perform(
|
||||
post("/api/mirror")
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.content("""{"itemId":"no-url-id"}"""),
|
||||
).andExpect(status().isCreated)
|
||||
|
||||
val response = json.decodeFromString<ByItemResponse>(
|
||||
bodyOf(mockMvc.perform(get("/api/mirror/by-item/no-url-id")).andExpect(status().isOk).andReturn()),
|
||||
)
|
||||
assertEquals("no-url-id", response.itemId)
|
||||
assertEquals("new", response.status)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `POST mirror returns 400 on blank itemId`() {
|
||||
postCreate("", "https://source.example/stream")
|
||||
|
||||
Reference in New Issue
Block a user