diff --git a/Backend/Account/ConsulRegisterer.cs b/Backend/Account/ConsulRegisterer.cs index fcb7016..08a2678 100644 --- a/Backend/Account/ConsulRegisterer.cs +++ b/Backend/Account/ConsulRegisterer.cs @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH var serviceCheck = new AgentServiceCheck() { - HTTP = $"http://{serviceIp}:{configuration.GetValue("servicePort")}/health", + HTTP = $"{configuration.GetValue("httpScheme")}://{serviceIp}:{configuration.GetValue("servicePort")}/health", Interval = TimeSpan.FromSeconds(30), }; diff --git a/Backend/Account/appsettings.Development.json b/Backend/Account/appsettings.Development.json index d051b9c..5ffaf9b 100644 --- a/Backend/Account/appsettings.Development.json +++ b/Backend/Account/appsettings.Development.json @@ -26,5 +26,6 @@ "HostAddress": "amqp://localhost:5672", "UserName": "guest", "Password": "guest" - } + }, + "httpScheme": "https" } diff --git a/Backend/Account/appsettings.json b/Backend/Account/appsettings.json index ff7c5be..a0bccdb 100644 --- a/Backend/Account/appsettings.json +++ b/Backend/Account/appsettings.json @@ -26,5 +26,6 @@ "HostAddress": "amqp://rabbitmq-service:5672", "UserName": "guest", "Password": "guest" - } + }, + "httpScheme": "http" } diff --git a/Backend/RecommendationAlgo/ConsulRegisterer.cs b/Backend/RecommendationAlgo/ConsulRegisterer.cs index f331412..881527c 100644 --- a/Backend/RecommendationAlgo/ConsulRegisterer.cs +++ b/Backend/RecommendationAlgo/ConsulRegisterer.cs @@ -21,7 +21,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH var serviceCheck = new AgentServiceCheck() { - HTTP = $"http://{serviceIp}:{configuration.GetValue("servicePort")}/health", + HTTP = $"{configuration.GetValue("httpScheme")}://{serviceIp}:{configuration.GetValue("servicePort")}/health", Interval = TimeSpan.FromSeconds(30), }; diff --git a/Backend/RecommendationAlgo/appsettings.Development.json b/Backend/RecommendationAlgo/appsettings.Development.json index 0ff2816..37ef32e 100644 --- a/Backend/RecommendationAlgo/appsettings.Development.json +++ b/Backend/RecommendationAlgo/appsettings.Development.json @@ -17,5 +17,6 @@ "HostAddress": "amqp://localhost:5672", "UserName": "guest", "Password": "guest" - } + }, + "httpScheme": "https" } diff --git a/Backend/RecommendationAlgo/appsettings.json b/Backend/RecommendationAlgo/appsettings.json index 01a86bd..ab1b795 100644 --- a/Backend/RecommendationAlgo/appsettings.json +++ b/Backend/RecommendationAlgo/appsettings.json @@ -17,5 +17,6 @@ "HostAddress": "amqp://rabbitmq-service:5672", "UserName": "guest", "Password": "guest" - } + }, + "httpScheme": "http" } diff --git a/Backend/Render/ConsulRegisterer.cs b/Backend/Render/ConsulRegisterer.cs index c3064b0..d250751 100644 --- a/Backend/Render/ConsulRegisterer.cs +++ b/Backend/Render/ConsulRegisterer.cs @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH var serviceCheck = new AgentServiceCheck() { - HTTP = $"http://{serviceIp}:{configuration.GetValue("servicePort")}/health", + HTTP = $"{configuration.GetValue("httpScheme")}://{serviceIp}:{configuration.GetValue("servicePort")}/health", Interval = TimeSpan.FromSeconds(30), }; diff --git a/Backend/Render/appsettings.Development.json b/Backend/Render/appsettings.Development.json index 2cb664a..44c55aa 100644 --- a/Backend/Render/appsettings.Development.json +++ b/Backend/Render/appsettings.Development.json @@ -14,5 +14,6 @@ "HostAddress": "amqp://localhost:5672", "UserName": "guest", "Password": "guest" - } + }, + "httpScheme": "https" } diff --git a/Backend/Render/appsettings.json b/Backend/Render/appsettings.json index 913f8c5..69e7ffc 100644 --- a/Backend/Render/appsettings.json +++ b/Backend/Render/appsettings.json @@ -14,5 +14,6 @@ "HostAddress": "amqp://rabbitmq-service:5672", "UserName": "guest", "Password": "guest" - } + }, + "httpScheme": "http" } diff --git a/Backend/Upload/ConsulRegisterer.cs b/Backend/Upload/ConsulRegisterer.cs index b4fc093..d35b231 100644 --- a/Backend/Upload/ConsulRegisterer.cs +++ b/Backend/Upload/ConsulRegisterer.cs @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH var serviceCheck = new AgentServiceCheck() { - HTTP = $"http://{serviceIp}:{configuration.GetValue("servicePort")}/health", + HTTP = $"{configuration.GetValue("httpScheme")}://{serviceIp}:{configuration.GetValue("servicePort")}/health", Interval = TimeSpan.FromSeconds(30), }; diff --git a/Backend/Upload/appsettings.Development.json b/Backend/Upload/appsettings.Development.json index 0e2d164..907989e 100644 --- a/Backend/Upload/appsettings.Development.json +++ b/Backend/Upload/appsettings.Development.json @@ -21,5 +21,6 @@ "consulUri": "http://localhost:8500", "POD_IP": "localhost", "servicePort": "5008", - "serviceName": "OpenVisStreamer.Upload" + "serviceName": "OpenVisStreamer.Upload", + "httpScheme": "https" } diff --git a/Backend/Upload/appsettings.json b/Backend/Upload/appsettings.json index a568158..4708fd1 100644 --- a/Backend/Upload/appsettings.json +++ b/Backend/Upload/appsettings.json @@ -24,5 +24,6 @@ "consulUri": "http://consul-service:8500", "POD_IP": "localhost", "servicePort": "8081", - "serviceName": "OpenVisStreamer.Upload" + "serviceName": "OpenVisStreamer.Upload", + "httpScheme": "http" } diff --git a/Backend/VideoLibrary/ConsulRegisterer.cs b/Backend/VideoLibrary/ConsulRegisterer.cs index fcb7016..08a2678 100644 --- a/Backend/VideoLibrary/ConsulRegisterer.cs +++ b/Backend/VideoLibrary/ConsulRegisterer.cs @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH var serviceCheck = new AgentServiceCheck() { - HTTP = $"http://{serviceIp}:{configuration.GetValue("servicePort")}/health", + HTTP = $"{configuration.GetValue("httpScheme")}://{serviceIp}:{configuration.GetValue("servicePort")}/health", Interval = TimeSpan.FromSeconds(30), }; diff --git a/Backend/VideoLibrary/appsettings.Development.json b/Backend/VideoLibrary/appsettings.Development.json index 8f7bdd4..27d3813 100644 --- a/Backend/VideoLibrary/appsettings.Development.json +++ b/Backend/VideoLibrary/appsettings.Development.json @@ -18,5 +18,6 @@ "HostAddress": "amqp://127.0.0.1:5672", "UserName": "guest", "Password": "guest" - } + }, + "httpScheme": "https" } diff --git a/Backend/VideoLibrary/appsettings.json b/Backend/VideoLibrary/appsettings.json index 862f1de..6509c6a 100644 --- a/Backend/VideoLibrary/appsettings.json +++ b/Backend/VideoLibrary/appsettings.json @@ -6,17 +6,17 @@ } }, "ConnectionStrings": { - "DefaultConnection": "server=videolib-db-service;uid=admin;pwd=1234;database=VideolibDB;" + "DefaultConnection": "server=videolib-db-service;uid=admin;pwd=1234;database=videolibdb;" }, "AllowedHosts": "*", "consulUri": "http://consul-service:8500", "POD_IP": "localhost", "servicePort": "8081", "serviceName": "OpenVisStreamer.VideoLibrary", - -"RabbitMQ":{ + "RabbitMQ": { "HostAddress": "amqp://rabbitmq-service:5672", "UserName": "guest", "Password": "guest" -} + }, + "httpScheme": "http" } diff --git a/Backend/VideoStreamer/ConsulRegisterer.cs b/Backend/VideoStreamer/ConsulRegisterer.cs index 0dfa71a..6e4b47d 100644 --- a/Backend/VideoStreamer/ConsulRegisterer.cs +++ b/Backend/VideoStreamer/ConsulRegisterer.cs @@ -20,7 +20,7 @@ public static void Register(IApplicationBuilder app, IWebHostEnvironment env, IH var serviceCheck = new AgentServiceCheck() { - HTTP = $"http://{serviceIp}:{configuration.GetValue("servicePort")}/health", + HTTP = $"{configuration.GetValue("httpScheme")}://{serviceIp}:{configuration.GetValue("servicePort")}/health", Interval = TimeSpan.FromSeconds(30), }; diff --git a/Backend/VideoStreamer/appsettings.Development.json b/Backend/VideoStreamer/appsettings.Development.json index fcc2335..805a75a 100644 --- a/Backend/VideoStreamer/appsettings.Development.json +++ b/Backend/VideoStreamer/appsettings.Development.json @@ -10,5 +10,6 @@ "POD_IP": "localhost", "servicePort": "5009", "serviceName": "OpenVisStreamer.Streamer", - "PVstorageBucketPath": "D:\\PRJ\\OpenVidStreamer\\DEVstorageBucket" + "PVstorageBucketPath": "D:\\PRJ\\OpenVidStreamer\\DEVstorageBucket", + "httpScheme": "https" } diff --git a/Backend/VideoStreamer/appsettings.json b/Backend/VideoStreamer/appsettings.json index eb59d34..f63dfdd 100644 --- a/Backend/VideoStreamer/appsettings.json +++ b/Backend/VideoStreamer/appsettings.json @@ -10,5 +10,6 @@ "POD_IP": "localhost", "servicePort": "8081", "serviceName": "OpenVisStreamer.Streamer", - "PVstorageBucketPath": "/app/data" + "PVstorageBucketPath": "/app/data", + "httpScheme": "http" } diff --git a/Frontend/openvidstreamer-fe/src/Pages/Upload/UploadPage.tsx b/Frontend/openvidstreamer-fe/src/Pages/Upload/UploadPage.tsx index c15746d..94c931c 100644 --- a/Frontend/openvidstreamer-fe/src/Pages/Upload/UploadPage.tsx +++ b/Frontend/openvidstreamer-fe/src/Pages/Upload/UploadPage.tsx @@ -2,7 +2,9 @@ import axios from 'axios'; import './VideoUploadForm.css'; import {VideoCategory, VideoCategoryNames, VideoUploadDTO} from "../../Model/VideoUploadDTO.ts"; -import {Label} from "flowbite-react"; // Assuming your CSS is in this file +import {Label} from "flowbite-react"; +import {ApiServerBaseUrl} from "../../../configProvider.ts"; +import {useStoreState} from "../../../persistenceProvider.ts"; // Assuming your CSS is in this file const UploadPage = () => { const [videoMetadata, setVideoMetadata] = useState({ @@ -15,6 +17,8 @@ const UploadPage = () => { const [thumbnailFile, setThumbnailFile] = useState(null); const [uploadPercentage, setUploadPercentage] = useState(0); + const authToken = useStoreState('authToken'); + const handleInputChange = (e) => { setVideoMetadata({ ...videoMetadata, @@ -40,9 +44,10 @@ const UploadPage = () => { formData.append('thumbnailFile', thumbnailFile); try { - await axios.post('https://localhost:5008/upload', formData, { + await axios.post(ApiServerBaseUrl()+ '/upload/upload', formData, { headers: { - 'Content-Type': 'multipart/form-data' + 'Content-Type': 'multipart/form-data', + "Authorization": "Bearer " + authToken }, onUploadProgress: progressEvent => { const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total); diff --git a/OpenVidStreamerKubernetesFiles/accountDB-deployment.yaml b/OpenVidStreamerKubernetesFiles/accountDB-deployment.yaml index 2caad99..db04741 100644 --- a/OpenVidStreamerKubernetesFiles/accountDB-deployment.yaml +++ b/OpenVidStreamerKubernetesFiles/accountDB-deployment.yaml @@ -26,3 +26,11 @@ spec: value: "12345" ports: - containerPort: 3306 + volumeMounts: + - name: account-db-storage + mountPath: /var/lib/mysql + volumes: + - name: account-db-storage + persistentVolumeClaim: + claimName: account-db-pvc + diff --git a/OpenVidStreamerKubernetesFiles/accountDB-persistent-volume-claim.yaml b/OpenVidStreamerKubernetesFiles/accountDB-persistent-volume-claim.yaml new file mode 100644 index 0000000..6ef7652 --- /dev/null +++ b/OpenVidStreamerKubernetesFiles/accountDB-persistent-volume-claim.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: account-db-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 20Gi diff --git a/OpenVidStreamerKubernetesFiles/apigateway-deployment.yaml b/OpenVidStreamerKubernetesFiles/apigateway-deployment.yaml index ed05406..09d1656 100644 --- a/OpenVidStreamerKubernetesFiles/apigateway-deployment.yaml +++ b/OpenVidStreamerKubernetesFiles/apigateway-deployment.yaml @@ -14,6 +14,6 @@ spec: spec: containers: - name: apigateway - image: :latest + image: openvidstreamer/apigateway:latest ports: - containerPort: 8081 diff --git a/OpenVidStreamerKubernetesFiles/apigateway-service.yaml b/OpenVidStreamerKubernetesFiles/apigateway-service.yaml index 18f0903..9979870 100644 --- a/OpenVidStreamerKubernetesFiles/apigateway-service.yaml +++ b/OpenVidStreamerKubernetesFiles/apigateway-service.yaml @@ -8,5 +8,5 @@ spec: app: apigateway ports: - protocol: TCP - port: 8081 - targetPort: 8081 + port: 8000 + targetPort: 8000 diff --git a/OpenVidStreamerKubernetesFiles/consul-deployment.yaml b/OpenVidStreamerKubernetesFiles/consul-deployment.yaml index 1acc32a..949a8d4 100644 --- a/OpenVidStreamerKubernetesFiles/consul-deployment.yaml +++ b/OpenVidStreamerKubernetesFiles/consul-deployment.yaml @@ -15,14 +15,7 @@ spec: app: consul spec: containers: - - name: consul - image: openvidstreamer/consul:latest - ports: - - containerPort: 8500 - volumeMounts: - - name: consul-config - mountPath: /consul/config - volumes: - - name: consul-config - configMap: - name: consul-configmap + - name: consul + image: consul:1.15.4 + ports: + - containerPort: 8500 diff --git a/OpenVidStreamerKubernetesFiles/consul-service.yaml b/OpenVidStreamerKubernetesFiles/consul-service.yaml index 88c62c6..c82f6a1 100644 --- a/OpenVidStreamerKubernetesFiles/consul-service.yaml +++ b/OpenVidStreamerKubernetesFiles/consul-service.yaml @@ -3,8 +3,10 @@ kind: Service metadata: name: consul-service spec: + type: NodePort ports: - port: 8500 targetPort: 8500 + nodePort: 32000 selector: app: consul diff --git a/OpenVidStreamerKubernetesFiles/nfs-deployment.yaml b/OpenVidStreamerKubernetesFiles/nfs-deployment.yaml deleted file mode 100644 index f3d531f..0000000 --- a/OpenVidStreamerKubernetesFiles/nfs-deployment.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nfs-server -spec: - replicas: 1 - selector: - matchLabels: - role: nfs-server - template: - metadata: - labels: - role: nfs-server - spec: - containers: - - name: nfs-server - image: itsthenetwork/nfs-server-alpine:latest - securityContext: - privileged: true - env: - - name: SHARED_DIRECTORY - value: /exports - ports: - - name: nfs - containerPort: 2049 - - name: mountd - containerPort: 20048 - - name: rpcbind - containerPort: 111 - volumeMounts: - - name: nfs-storage - mountPath: /exports - volumes: - - name: nfs-storage - emptyDir: {} diff --git a/OpenVidStreamerKubernetesFiles/nfs-persistent-volume-claim.yaml b/OpenVidStreamerKubernetesFiles/nfs-persistent-volume-claim.yaml new file mode 100644 index 0000000..a77eaea --- /dev/null +++ b/OpenVidStreamerKubernetesFiles/nfs-persistent-volume-claim.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nfs-pvc +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 20Gi + storageClassName: "" diff --git a/OpenVidStreamerKubernetesFiles/nfs-persistent-volume.yaml b/OpenVidStreamerKubernetesFiles/nfs-persistent-volume.yaml new file mode 100644 index 0000000..1086f70 --- /dev/null +++ b/OpenVidStreamerKubernetesFiles/nfs-persistent-volume.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nfs-pv +spec: + capacity: + storage: 20Gi + volumeMode: Filesystem + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: "" + nfs: + path: "/exports" + server: 10.0.0.3 diff --git a/OpenVidStreamerKubernetesFiles/nfs-service.yaml b/OpenVidStreamerKubernetesFiles/nfs-service.yaml deleted file mode 100644 index 5a7f130..0000000 --- a/OpenVidStreamerKubernetesFiles/nfs-service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: nfs-service -spec: - ports: - - name: nfs - port: 2049 - - name: mountd - port: 20048 - - name: rpcbind - port: 111 - selector: - role: nfs-server diff --git a/OpenVidStreamerKubernetesFiles/render-deployment.yaml b/OpenVidStreamerKubernetesFiles/render-deployment.yaml index 7eb60c2..1db6fd0 100644 --- a/OpenVidStreamerKubernetesFiles/render-deployment.yaml +++ b/OpenVidStreamerKubernetesFiles/render-deployment.yaml @@ -26,4 +26,12 @@ spec: fieldPath: status.podIP - name: servicePort value: "8081" + volumeMounts: + - mountPath: "/app/data" + name: nfs-storage + volumes: + - name: nfs-storage + persistentVolumeClaim: + claimName: nfs-pvc + diff --git a/OpenVidStreamerKubernetesFiles/statisticsDB-deployment.yaml b/OpenVidStreamerKubernetesFiles/statisticsDB-deployment.yaml index 96325b3..d36ac73 100644 --- a/OpenVidStreamerKubernetesFiles/statisticsDB-deployment.yaml +++ b/OpenVidStreamerKubernetesFiles/statisticsDB-deployment.yaml @@ -26,3 +26,11 @@ spec: value: "12345" ports: - containerPort: 3306 + volumeMounts: + - name: statistics-db-storage + mountPath: /var/lib/mysql + volumes: + - name: statistics-db-storage + persistentVolumeClaim: + claimName: statistics-db-pvc + diff --git a/OpenVidStreamerKubernetesFiles/statsticsDB-persistant-volume-claim.yaml b/OpenVidStreamerKubernetesFiles/statsticsDB-persistant-volume-claim.yaml new file mode 100644 index 0000000..75456c1 --- /dev/null +++ b/OpenVidStreamerKubernetesFiles/statsticsDB-persistant-volume-claim.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: statistics-db-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 15Gi diff --git a/OpenVidStreamerKubernetesFiles/upload-deployment.yaml b/OpenVidStreamerKubernetesFiles/upload-deployment.yaml index 2e739bb..1234c0c 100644 --- a/OpenVidStreamerKubernetesFiles/upload-deployment.yaml +++ b/OpenVidStreamerKubernetesFiles/upload-deployment.yaml @@ -26,4 +26,14 @@ spec: fieldPath: status.podIP - name: servicePort value: "8081" - + - name: NFS_SERVER + value: nfs-service + - name: NFS_PATH + value: "/exports" + volumeMounts: + - mountPath: "/app/data" + name: nfs-storage + volumes: + - name: nfs-storage + persistentVolumeClaim: + claimName: nfs-pvc diff --git a/OpenVidStreamerKubernetesFiles/videoLibDB-deployment.yaml b/OpenVidStreamerKubernetesFiles/videoLibDB-deployment.yaml index 59504d1..fd4c1d8 100644 --- a/OpenVidStreamerKubernetesFiles/videoLibDB-deployment.yaml +++ b/OpenVidStreamerKubernetesFiles/videoLibDB-deployment.yaml @@ -19,10 +19,18 @@ spec: - name: MYSQL_ROOT_PASSWORD value: "12345" - name: MYSQL_DATABASE - value: "videolibDB" + value: "VideolibDB" - name: MYSQL_USER value: "admin" - name: MYSQL_PASSWORD value: "1234" ports: - containerPort: 3306 + volumeMounts: + - name: videolib-db-storage + mountPath: /var/lib/mysql + volumes: + - name: videolib-db-storage + persistentVolumeClaim: + claimName: videolib-db-pvc + diff --git a/OpenVidStreamerKubernetesFiles/videoLibDB-persistant-volume-claim.yaml b/OpenVidStreamerKubernetesFiles/videoLibDB-persistant-volume-claim.yaml new file mode 100644 index 0000000..4b37319 --- /dev/null +++ b/OpenVidStreamerKubernetesFiles/videoLibDB-persistant-volume-claim.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: videolib-db-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi diff --git a/OpenVidStreamerKubernetesFiles/videoStreamer-deployment.yaml b/OpenVidStreamerKubernetesFiles/videoStreamer-deployment.yaml index 88fe65b..569d730 100644 --- a/OpenVidStreamerKubernetesFiles/videoStreamer-deployment.yaml +++ b/OpenVidStreamerKubernetesFiles/videoStreamer-deployment.yaml @@ -26,4 +26,12 @@ spec: fieldPath: status.podIP - name: servicePort value: "8081" + volumeMounts: + - mountPath: "/app/data" + name: nfs-storage + volumes: + - name: nfs-storage + persistentVolumeClaim: + claimName: nfs-pvc +