Skip to content

Commit c14e02a

Browse files
committed
Fix ssl backend and cors and more small fixes
1 parent 0e5f064 commit c14e02a

File tree

10 files changed

+38
-11
lines changed

10 files changed

+38
-11
lines changed

backend/config/crypto/ca.cnf

+15
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,18 @@ authorityKeyIdentifier = keyid:always,issuer
1919
basicConstraints = critical, CA:true
2020
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
2121

22+
[req_ext]
23+
subjectAltName = @alt_names
24+
25+
[alt_names]
26+
DNS.1 = localhost
27+
DNS.2 = authik-0.dating.se.ifmo.ru
28+
DNS.3 = authik-1.dating.se.ifmo.ru
29+
DNS.4 = authik-2.dating.se.ifmo.ru
30+
DNS.5 = matchmaker-0.dating.se.ifmo.ru
31+
DNS.6 = matchmaker-1.dating.se.ifmo.ru
32+
DNS.7 = matchmaker-2.dating.se.ifmo.ru
33+
DNS.8 = people-0.dating.se.ifmo.ru
34+
DNS.9 = people-1.dating.se.ifmo.ru
35+
DNS.10 = people-2.dating.se.ifmo.ru
36+
DNS.11 = server.dc1.consul

backend/consul/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ RUN chmod -R 755 /consul/config && \
1212
chmod 644 /consul/config/itmo-dating-backend.crt && \
1313
chmod 644 /consul/config/itmo-dating-backend-ca.crt && \
1414
chmod 644 /consul/config/consul.hcl
15+
16+
CMD ["sh", "./consul/run.sh"]

backend/consul/config/consul.hcl

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ acl {
1414
enable_token_persistence = true
1515
}
1616

17+
limits {
18+
http_max_conns_per_client = 400
19+
}
20+
1721
data_dir = "/opt/consul/data"
1822

1923
ui = true

backend/consul/run.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/sh
22

3-
consul agent -config-file=/consul/config/consul.hcl -bootstrap-expect=1 \
4-
| grep -v "This request used the token query parameter which is deprecated and will be removed"
3+
consul agent -config-file=/consul/config/consul.hcl -bootstrap-expect=1 | grep -v "This request used the token query parameter which is deprecated and will be removed"

backend/gateway/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies {
77

88
implementation(libs.org.springframework.boot.spring.boot)
99
implementation(libs.org.springframework.cloud.spring.cloud.starter.gateway)
10-
10+
implementation(libs.org.springframework.spring.web)
1111
implementation(libs.org.springdoc.springdoc.openapi.starter.webflux.ui)
1212

1313
testImplementation(libs.org.springframework.boot.spring.boot.starter.test)

backend/gateway/src/main/kotlin/ru/ifmo/se/dating/gateway/SSLContextConfig.kt backend/gateway/src/main/kotlin/ru/ifmo/se/dating/gateway/ClientSSLContextConfig.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ import javax.net.ssl.KeyManagerFactory
1212
import javax.net.ssl.TrustManagerFactory
1313

1414
@Configuration
15-
class SSLContextConfig(
16-
@Value("\${server.ssl.key-store-type}")
15+
class ClientSSLContextConfig(
16+
@Value("\${client.ssl.key-store-type}")
1717
private val keyStoreType: String,
1818

19-
@Value("\${server.ssl.key-store}")
19+
@Value("\${client.ssl.key-store}")
2020
private val keyStore: Resource,
2121

22-
@Value("\${server.ssl.key-store-password}")
22+
@Value("\${client.ssl.key-store-password}")
2323
private val keyStorePassword: String,
2424

25-
@Value("\${server.ssl.protocol}")
25+
@Value("\${client.ssl.protocol}")
2626
private val sslProtocol: String,
2727
) {
2828
@Bean

backend/foundation/src/main/kotlin/ru/ifmo/se/dating/spring/api/CorsFilter.kt backend/gateway/src/main/kotlin/ru/ifmo/se/dating/gateway/CorsFilter.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.ifmo.se.dating.spring.api
1+
package ru.ifmo.se.dating.gateway
22

33
import org.springframework.http.HttpMethod
44
import org.springframework.http.HttpStatus

backend/gateway/src/main/resources/application.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,16 @@ server:
9595
ssl:
9696
enabled: true
9797
key-store-type: PKCS12
98-
key-store: classpath:keystore/itmo-dating-backend.p12
98+
key-store: classpath:keystore/keystore.p12
9999
key-store-password: ${KEY_STORE_PASSWORD}
100100
protocol: TLSv1.3
101101
enabled-protocols: TLSv1.3
102+
client:
103+
ssl:
104+
key-store-type: PKCS12
105+
key-store: classpath:keystore/itmo-dating-backend.p12
106+
key-store-password: ${KEY_STORE_PASSWORD}
107+
protocol: TLSv1.3
102108
springdoc:
103109
swagger-ui:
104110
path: /swagger-ui.html

backend/starter-service-discovery/src/main/resources/application-service-discovery.yml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ spring:
1616
instance-id: instance-${HOSTNAME}
1717
heartbeat:
1818
enabled: true
19+
ttl: 30
20+
catalog-services-watch-delay: 5000
1921
management:
2022
health:
2123
consul:

compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ services:
8585
image: ghcr.io/secs-dev/itmo-dating-consul:latest
8686
build:
8787
context: ./backend/consul
88-
command: sh ./consul/run.sh
8988
hostname: server.dc1.consul
9089
ports:
9190
- "127.0.0.1:8500:8500/tcp"

0 commit comments

Comments
 (0)