Compare commits

...

9 Commits

Author SHA1 Message Date
TIP Automation User
4b190a571f Chg: update image tag in helm values to v2.5.2 2022-07-26 10:29:43 +00:00
Dmitry Dunaev
c6b84434ea [WIFI-1998] Add: gracefull ingress deprecation
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-07-21 17:40:21 +03:00
Dmitry Dunaev
acad0cd99f Merge pull request #96 from Telecominfraproject/fix/wifi-9174--dep-charts-2.5
[WIFI-9174] Fix: switch from deprecated bitnami charts to mirrored ones
2022-06-03 15:52:43 +03:00
Dmitry Dunaev
7f675733df [WIFI-9174] Fix: switch from deprecated bitnami charts to mirrored ones
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-06-03 15:51:56 +03:00
Johann Hoffmann
4f1d05467f Update image tag in helm values to v2.5.1
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-04-29 19:06:38 +02:00
Johann Hoffmann
27bffaa734 Update image tag in helm values to v2.5.1-RC1
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-04-29 18:10:44 +02:00
stephb9959
b005b57137 Fixing https://telecominfraproject.atlassian.net/browse/WIFI-7812 2022-04-28 14:28:19 -07:00
TIP Automation User
2bae52e67e Chg: update image tag in helm values to v2.5.0 2022-03-30 13:48:16 +00:00
TIP Automation User
7766fe08cd Chg: update image tag in helm values to v2.5.0-RC1 2022-02-11 16:02:37 +00:00
7 changed files with 66 additions and 21 deletions

View File

@@ -1,12 +1,12 @@
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 10.9.2
- name: mysql
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 8.8.3
- name: mariadb
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 9.4.2
digest: sha256:1fdae7cbea906e41dccd8618ff9e2c68d0c684724ae27c79a12bb6089968df5c
generated: "2021-08-17T12:18:40.341427893+03:00"
digest: sha256:e9df5a5d8a0a193bfda33ea06060203aace01f0f7df9eda662a84185322c7ab5
generated: "2022-06-03T15:38:31.063022252+03:00"

View File

@@ -5,14 +5,14 @@ name: owgw
version: 0.1.0
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 10.9.2
condition: postgresql.enabled
- name: mysql
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 8.8.3
condition: mysql.enabled
- name: mariadb
repository: https://charts.bitnami.com/bitnami
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 9.4.2
condition: mariadb.enabled

View File

@@ -30,3 +30,13 @@ Create chart name and version as used by the chart label.
{{- define "owgw.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "owgw.ingress.apiVersion" -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" -}}
{{- print "networking.k8s.io/v1" -}}
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}

View File

@@ -2,7 +2,7 @@
{{- range $ingress, $ingressValue := .Values.ingresses }}
{{- if $ingressValue.enabled }}
---
apiVersion: extensions/v1beta1
apiVersion: {{ include "owgw.ingress.apiVersion" $root }}
kind: Ingress
metadata:
name: {{ include "owgw.fullname" $root }}-{{ $ingress }}
@@ -36,9 +36,23 @@ spec:
paths:
{{- range $ingressValue.paths }}
- path: {{ .path }}
{{- if $root.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
pathType: {{ .pathType | default "ImplementationSpecific" }}
{{- end }}
backend:
{{- if $root.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
service:
name: {{ include "owgw.fullname" $root }}-{{ .serviceName }}
port:
{{- if kindIs "string" .servicePort }}
name: {{ .servicePort }}
{{- else }}
number: {{ .servicePort }}
{{- end }}
{{- else }}
serviceName: {{ include "owgw.fullname" $root }}-{{ .serviceName }}
servicePort: {{ .servicePort }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -9,7 +9,7 @@ fullnameOverride: ""
images:
owgw:
repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owgw
tag: master
tag: v2.5.2
pullPolicy: Always
# regcred:
# registry: tip-tip-wlan-cloud-ucentral.jfrog.io
@@ -62,6 +62,7 @@ ingresses:
- restapi.chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
serviceName: owgw
servicePort: restapi
fileuploader:
@@ -73,6 +74,7 @@ ingresses:
- fileuploader.chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
serviceName: owgw
servicePort: fileuploader

View File

@@ -258,20 +258,34 @@ namespace OpenWifi {
}
bool WSConnection::ExtractBase64CompressedData(const std::string &CompressedData,
std::string &UnCompressedData) {
std::string &UnCompressedData, uint64_t compress_sz) {
std::istringstream ifs(CompressedData);
Poco::Base64Decoder b64in(ifs);
std::ostringstream ofs;
Poco::StreamCopier::copyStream(b64in, ofs);
unsigned long MaxSize = ofs.str().size() * 10;
std::vector<uint8_t> UncompressedBuffer(MaxSize);
unsigned long FinalSize = MaxSize;
if (uncompress((uint8_t *)&UncompressedBuffer[0], &FinalSize, (uint8_t *)ofs.str().c_str(),
ofs.str().size()) == Z_OK) {
UncompressedBuffer[FinalSize] = 0;
UnCompressedData = (char *)&UncompressedBuffer[0];
return true;
int factor = 20;
unsigned long MaxSize = compress_sz ? (unsigned long) (compress_sz + 5000) : (unsigned long) (ofs.str().size() * factor);
while(true) {
std::vector<uint8_t> UncompressedBuffer(MaxSize);
unsigned long FinalSize = MaxSize;
auto status = uncompress((uint8_t *)&UncompressedBuffer[0], &FinalSize,
(uint8_t *)ofs.str().c_str(), ofs.str().size());
if(status==Z_OK) {
UncompressedBuffer[FinalSize] = 0;
UnCompressedData = (char *)&UncompressedBuffer[0];
return true;
}
if(status==Z_BUF_ERROR) {
if(factor<300) {
factor+=10;
MaxSize = ofs.str().size() * factor;
continue;
} else {
return false;
}
}
return false;
}
return false;
}
@@ -300,9 +314,13 @@ namespace OpenWifi {
auto ParamsObj = Doc->get(uCentralProtocol::PARAMS).extract<Poco::JSON::Object::Ptr>();
if (ParamsObj->has(uCentralProtocol::COMPRESS_64)) {
std::string UncompressedData;
uint64_t compress_sz = 0 ;
if(ParamsObj->has("compress_sz")) {
compress_sz = ParamsObj->get("compress_sz");
}
try {
if (ExtractBase64CompressedData(
ParamsObj->get(uCentralProtocol::COMPRESS_64).toString(), UncompressedData)) {
ParamsObj->get(uCentralProtocol::COMPRESS_64).toString(), UncompressedData, compress_sz)) {
poco_trace(Logger(),Poco::format("EVENT(%s): Found compressed payload expanded to '%s'.",
CId_, UncompressedData));
Poco::JSON::Parser Parser;

View File

@@ -31,7 +31,8 @@ namespace OpenWifi {
void OnSocketShutdown(const Poco::AutoPtr<Poco::Net::ShutdownNotification>& pNf);
void OnSocketError(const Poco::AutoPtr<Poco::Net::ErrorNotification>& pNf);
bool LookForUpgrade(uint64_t UUID);
static bool ExtractBase64CompressedData(const std::string & CompressedData, std::string & UnCompressedData);
static bool ExtractBase64CompressedData(const std::string &CompressedData,
std::string &UnCompressedData, uint64_t compress_sz);
void LogException(const Poco::Exception &E);
inline Poco::Logger & Logger() { return Logger_; }
bool SetWebSocketTelemetryReporting(uint64_t interval, uint64_t TelemetryWebSocketTimer);