Skip to content

Commit f99ff9a

Browse files
Merge pull request #8 from OpenFuturePlatform/develop
Develop
2 parents 544e670 + 0af6281 commit f99ff9a

File tree

7 files changed

+66
-59
lines changed

7 files changed

+66
-59
lines changed

.github/workflows/build.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,23 @@ jobs:
7777
"docker rmi iceknight07/open-chat:latest || true"
7878
ssh -i ~/.ssh/private.key ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }} \
7979
"docker run --name open-chat-server --network=open-chat-network -p 443:8443 -d \
80-
-e POSTGRES_URL=open-chat-postgres:5432/open_chat \
81-
-e POSTGRES_USER=postgres \
82-
-e POSTGRES_PASSWORD=12345678 \
83-
-e KMS_URL=ws://kurento-media-server:8888/kurento \
8480
-e SPRING_PROFILES_ACTIVE=production \
81+
-e POSTGRES_URL=${{ secrets.POSTGRES_URL }} \
82+
-e POSTGRES_USER=${{ secrets.POSTGRES_USER }} \
83+
-e POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} \
84+
-e KMS_URL=${{ secrets.KMS_URL }} \
85+
-e AWS_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY }} \
86+
-e AWS_SECRET_KEY=${{ secrets.AWS_SECRET_KEY }} \
87+
-e AWS_REGION=${{ vars.REGION }} \
88+
-e ATTACHMENTS_BUCKET=${{ vars.ATTACHMENTS_BUCKET }} \
89+
-e RECORDINGS_BUCKET=${{ vars.RECORDINGS_BUCKET }} \
90+
-e TRANSCRIPTS_BUCKET=${{ vars.TRANSCRIPTS_BUCKET }} \
91+
-e COGNITO_USER_POOL_ID=${{ secrets.COGNITO_USER_POOL_ID }} \
92+
-e COGNITO_APP_CLIENT_ID=${{ secrets.COGNITO_APP_CLIENT_ID }} \
93+
-e COGNITO_APP_CLIENT_SECRET=${{ secrets.COGNITO_APP_CLIENT_SECRET }} \
94+
-e JWKS_URL=${{ secrets.JWKS_URL }} \
95+
-e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} \
96+
-e GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }} \
97+
-e FIREBASE_CONFIGURATION_JSON=${{ secrets.FIREBASE_CONFIGURATION_JSON }} \
98+
-e SSL_KEY_STORE_PASSWORD=${{ secrets.SSL_KEY_STORE_PASSWORD }} \
8599
iceknight07/open-chat:latest"

build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ dependencies {
4040
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1'
4141
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1'
4242

43-
44-
runtimeOnly("com.mysql:mysql-connector-j")
4543
runtimeOnly("org.postgresql:postgresql")
4644
implementation 'org.flywaydb:flyway-core:10.10.0'
4745
implementation "org.flywaydb:flyway-database-postgresql:10.10.0"

docker-compose/docker-compose.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,6 @@ services:
1313
volumes:
1414
- rabbitmq-data:/var/lib/rabbitmq
1515

16-
open-chat-mysql:
17-
image: mysql:8.0.22
18-
container_name: open-chat-mysql
19-
hostname: open-chat-mysql
20-
environment:
21-
- MYSQL_ROOT_PASSWORD=123456
22-
- MYSQL_DATABASE=open_chat
23-
ports:
24-
- '3310:3306'
25-
volumes:
26-
- local-mysql-data:/var/lib/mysql
27-
2816
open-chat-postgres:
2917
container_name: open-chat-postgres
3018
hostname: open-chat-postgres

src/main/kotlin/io/openfuture/openmessenger/service/firebase/FCMInitializer.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ import javax.annotation.PostConstruct
1515
@Service
1616
class FCMInitializer {
1717

18-
@Value("\${app.firebase-configuration-file}")
19-
private val firebaseConfigPath: String? = null
18+
@Value("\${app.firebase-configuration-json}")
19+
private val firebaseConfigJson: String? = null
2020

2121
var logger: Logger = LoggerFactory.getLogger(FCMInitializer::class.java)
2222

2323
@PostConstruct
2424
fun initialize() {
2525
try {
2626
val options = FirebaseOptions.builder()
27-
.setCredentials(GoogleCredentials.fromStream(ClassPathResource(firebaseConfigPath!!).getInputStream()))
27+
.setCredentials(GoogleCredentials.fromStream(firebaseConfigJson!!.byteInputStream()))
2828
.build()
2929
if (FirebaseApp.getApps().isEmpty()) {
3030
FirebaseApp.initializeApp(options)

src/main/resources/application-production.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,41 @@ spring:
55
username: ${POSTGRES_USER}
66
password: ${POSTGRES_PASSWORD}
77

8+
aws:
9+
access-key: ${AWS_ACCESS_KEY}
10+
secret-key: ${AWS_SECRET_KEY}
11+
region: ${AWS_REGION}
12+
attachments-bucket: ${ATTACHMENTS_BUCKET}
13+
recordings-bucket: ${RECORDINGS_BUCKET}
14+
transcripts-bucket: ${TRANSCRIPTS_BUCKET}
15+
cognito:
16+
user-pool-id: ${COGNITO_USER_POOL_ID}
17+
app-client-id: ${COGNITO_APP_CLIENT_ID}
18+
app-client-secret: ${COGNITO_APP_CLIENT_SECRET}
19+
20+
jwks:
21+
url: ${JWKS_URL}
22+
23+
openai:
24+
model: gpt-3.5-turbo-0301
25+
api:
26+
url: https://api.openai.com/v1/chat/completions
27+
key: ${OPENAI_API_KEY}
28+
29+
gemini:
30+
api:
31+
key: ${GEMINI_API_KEY}
32+
url: https://generativelanguage.googleapis.com/v1beta/models
33+
app:
34+
firebase-configuration-json: ${FIREBASE_CONFIGURATION_JSON}
35+
836
kms:
937
url: ${KMS_URL}
1038

1139
server:
1240
ssl:
1341
key-store: classpath:keystore.p12
14-
key-store-password: 12345678
42+
key-store-password: ${SSL_KEY_STORE_PASSWORD}
1543
key-store-type: PKCS12
1644
key-alias: tomcat
1745
port: 8443

src/main/resources/application.yml

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,35 @@ spring:
88
password: 123456
99
jpa:
1010
database-platform: org.hibernate.dialect.PostgreSQLDialect
11-
cloud:
12-
gcp:
13-
credentials:
14-
location: file:/Users/beksultan/Documents/open-messanger/alien-scope-428812-i2-0794e36fcbee.json
1511
servlet:
1612
multipart:
1713
max-file-size: 50MB
1814
max-request-size: 50MB
1915
aws:
20-
access-key: ${AWS_ACCESS_KEY}
21-
secret-key: ${AWS_SECRET_KEY}
22-
region: us-east-2
23-
attachments-bucket: ${AWS_ATTACHMENTS_BUCKET}
24-
recordings-bucket: ${AWS_RECORDINGS_BUCKET}
25-
transcripts-bucket: ${AWS_TRANSCRIPTS_BUCKET}
16+
access-key:
17+
secret-key:
18+
region:
19+
attachments-bucket:
20+
recordings-bucket:
21+
transcripts-bucket:
2622
cognito:
27-
user-pool-id: ${AWS_COGNITO_USER_POOL_ID}
28-
app-client-id: ${AWS_COGNITO_APP_CLIENT_ID}
29-
app-client-secret: ${AWS_COGNITO_APP_CLIENT_SECRET}
23+
user-pool-id:
24+
app-client-id:
25+
app-client-secret:
3026

3127
jwks:
32-
url: ${AWS_COGNITO_JWKS_URL}
28+
url:
3329

3430
openai:
35-
model: ${OPENAI_MODEL}
31+
model: gpt-3.5-turbo-0301
3632
api:
37-
url: ${OPENAI_API_URL}
38-
key: ${OPENAI_API_KEY}
33+
url: https://api.openai.com/v1/chat/completions
34+
key:
3935

4036
gemini:
4137
api:
42-
key: ${GEMINI_API_KEY}
43-
url: ${GEMINI_API_URL}
44-
45-
46-
system:
47-
GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS}
38+
key:
39+
url: https://generativelanguage.googleapis.com/v1beta/models
4840

4941
kms:
5042
url: ws://127.0.0.1:8888/kurento
@@ -64,4 +56,4 @@ state:
6456

6557
# FIREBASE
6658
app:
67-
firebase-configuration-file: ${FIREBASE_CONFIG_FILE}
59+
firebase-configuration-json:

src/main/resources/open-chat-5f7ba-firebase-adminsdk-1523p-0a596434ea.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)