Compare commits

...

20 Commits

Author SHA1 Message Date
Dmitry Dunaev
4a3274b169 [WIFI-10236] Chg: helm image to the working one
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-07-22 14:55:29 +03:00
TIP Automation User
88f7ab6bfa Chg: update image tag in helm values to v2.4.2 2022-07-21 15:08:55 +00:00
Dmitry Dunaev
153d4ee11e [WIFI-1998] Add: gracefull ingress deprecation
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-07-21 17:45:36 +03:00
TIP Automation User
21cb6ae297 Chg: update image tag in helm values to v2.4.1 2022-07-21 13:50:30 +00:00
Dmitry Dunaev
a22acace01 [WIFI-9174] Fix: switch from deprecated bitnami charts to mirrored ones
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2022-07-21 16:44:38 +03:00
TIP Automation User
8db90d4c36 Chg: update image tag in helm values to v2.4.0 2021-12-17 02:36:56 +00:00
Johann Hoffmann
c6a9b72872 [WIFI-6170] Add OpenWifi Docker Compose deployment with PostgreSQL (#20)
* Add wait-for-postgres.sh wrapper script

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Copy wait-for-postgres.sh into Docker image

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2021-12-16 17:27:36 +01:00
TIP Automation User
e0507ceb82 Chg: update image tag in helm values to v2.4.0-RC5 2021-12-11 08:12:32 +00:00
stephb9959
afc8b942cb Fixing https://telecominfraproject.atlassian.net/browse/WIFI-6149 2021-12-10 10:31:42 -08:00
TIP Automation User
5737ab7c00 Chg: update image tag in helm values to v2.4.0-RC4 2021-12-08 07:42:44 +00:00
Dmitry Dunaev
1b59208fa2 Add: .git dir to build image to expose git hash for version
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
2021-12-08 10:27:29 +03:00
stephb9959
f5ee31bd8b Merge remote-tracking branch 'origin/release/v2.4.0' into release/v2.4.0 2021-12-06 09:10:57 -08:00
stephb9959
9f9faafb1c Adding git hash as part of the version number. - no Jira. 2021-12-06 09:10:48 -08:00
TIP Automation User
dc9d155b78 Chg: update image tag in helm values to v2.4.0-RC3 2021-12-06 15:58:04 +00:00
stephb9959
b8a7a7aff9 Fixing https://telecominfraproject.atlassian.net/browse/WIFI-6048 2021-12-05 12:00:47 -08:00
stephb9959
3195679fee Fixing https://telecominfraproject.atlassian.net/browse/WIFI-6048 2021-12-05 10:06:03 -08:00
stephb9959
d1a9556b27 Fixing https://telecominfraproject.atlassian.net/browse/WIFI-6048 2021-12-04 22:43:32 -08:00
Dmitry Dunaev
c45850b749 Chg: helm image in values to new release candidate 2021-11-22 14:59:10 +03:00
stephb9959
ab859d1f77 Solving https://telecominfraproject.atlassian.net/browse/WIFI-5780 2021-11-19 10:59:20 -08:00
Leonid Mirsky
da5720cf8d Update Helm values to v2.4.0-RC1
Signed-off-by: Leonid Mirsky <leonid@opsfleet.com>
2021-11-16 23:13:00 +02:00
14 changed files with 140 additions and 57 deletions

View File

@@ -25,8 +25,18 @@ else()
file(WRITE build ${BUILD_NUM})
endif()
set(BUILD_SHARED_LIBS 1)
add_definitions(-DAPP_VERSION="${CMAKE_PROJECT_VERSION}" -DBUILD_NUMBER="${BUILD_NUM}" -DAWS_CUSTOM_MEMORY_MANAGEMENT)
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --tags
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_RESULT
OUTPUT_VARIABLE GIT_HASH)
if(NOT GIT_RESULT EQUAL "0")
message(FATAL_ERROR "git describe --always --tags failed with ${GIT_RESULT}")
endif()
string(REGEX REPLACE "\n$" "" GIT_HASH "${GIT_HASH}")
endif()
add_definitions(-DAWS_CUSTOM_MEMORY_MANAGEMENT)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
@@ -48,8 +58,11 @@ endif()
include_directories(/usr/local/include /usr/local/opt/openssl/include src include/kafka /usr/local/opt/mysql-client/include)
configure_file(src/ow_version.h.in ${PROJECT_SOURCE_DIR}/src/ow_version.h @ONLY)
add_executable( owfms
build
src/ow_version.h.in
src/framework/CountryCodes.h
src/framework/KafkaTopics.h
src/framework/MicroService.h

View File

@@ -56,6 +56,7 @@ RUN make install
ADD CMakeLists.txt build /owfms/
ADD cmake /owfms/cmake
ADD src /owfms/src
ADD .git /owfms/.git
WORKDIR /owfms
RUN mkdir cmake-build
@@ -75,7 +76,7 @@ RUN addgroup -S "$OWFMS_USER" && \
RUN mkdir /openwifi
RUN mkdir -p "$OWFMS_ROOT" "$OWFMS_CONFIG" && \
chown "$OWFMS_USER": "$OWFMS_ROOT" "$OWFMS_CONFIG"
RUN apk add --update --no-cache librdkafka curl-dev mariadb-connector-c libpq unixodbc su-exec gettext ca-certificates bash jq curl
RUN apk add --update --no-cache librdkafka curl-dev mariadb-connector-c libpq unixodbc su-exec gettext ca-certificates bash jq curl postgresql-client
COPY --from=builder /owfms/cmake-build/owfms /openwifi/owfms
COPY --from=builder /cppkafka/cmake-build/src/lib/* /lib/
@@ -85,6 +86,7 @@ COPY --from=builder /aws-sdk-cpp/cmake-build/aws-cpp-sdk-s3/libaws-cpp-sdk-s3.so
COPY owfms.properties.tmpl /
COPY docker-entrypoint.sh /
COPY wait-for-postgres.sh /
RUN wget https://raw.githubusercontent.com/Telecominfraproject/wlan-cloud-ucentral-deploy/main/docker-compose/certs/restapi-ca.pem \
-O /usr/local/share/ca-certificates/restapi-ca-selfsigned.pem

2
build
View File

@@ -1 +1 @@
24
32

2
helm/.gitignore vendored
View File

@@ -1 +1,3 @@
*.swp
Chart.lock
charts

View File

@@ -5,14 +5,14 @@ name: owfms
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 "owfms.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "owfms.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 "owfms.ingress.apiVersion" $root }}
kind: Ingress
metadata:
name: {{ include "owfms.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 "owfms.fullname" $root }}-{{ .serviceName }}
port:
{{- if kindIs "string" .servicePort }}
name: {{ .servicePort }}
{{- else }}
number: {{ .servicePort }}
{{- end }}
{{- else }}
serviceName: {{ include "owfms.fullname" $root }}-{{ .serviceName }}
servicePort: {{ .servicePort }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -8,7 +8,7 @@ fullnameOverride: ""
images:
owfms:
repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owfms
tag: main
tag: v2.4.0
pullPolicy: Always
# regcred:
# registry: tip-tip-wlan-cloud-ucentral.jfrog.io
@@ -51,6 +51,7 @@ ingresses:
- restapi.chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
serviceName: owfms
servicePort: restapi

View File

@@ -69,6 +69,8 @@ using namespace std::chrono_literals;
#include "RESTObjects/RESTAPI_SecurityObjects.h"
#include "nlohmann/json.hpp"
#include "ow_version.h"
namespace OpenWifi {
enum UNAUTHORIZED_REASON {
@@ -1900,7 +1902,7 @@ namespace OpenWifi {
QB_.SerialNumber = GetParameter(RESTAPI::Protocol::SERIALNUMBER, "");
QB_.StartDate = GetParameter(RESTAPI::Protocol::STARTDATE, 0);
QB_.EndDate = GetParameter(RESTAPI::Protocol::ENDDATE, 0);
QB_.Offset = GetParameter(RESTAPI::Protocol::OFFSET, 1);
QB_.Offset = GetParameter(RESTAPI::Protocol::OFFSET, 0);
QB_.Limit = GetParameter(RESTAPI::Protocol::LIMIT, 100);
QB_.Filter = GetParameter(RESTAPI::Protocol::FILTER, "");
QB_.Select = GetParameter(RESTAPI::Protocol::SELECT, "");
@@ -1912,7 +1914,7 @@ namespace OpenWifi {
QB_.AdditionalInfo = GetBoolParameter(RESTAPI::Protocol::WITHEXTENDEDINFO,false);
if(QB_.Offset<1)
QB_.Offset=1;
QB_.Offset=0;
return true;
}
@@ -2393,10 +2395,10 @@ namespace OpenWifi {
Poco::Logger & L, RESTAPI_GenericServer & S);
class RESTAPI_server : public SubSystemServer {
class RESTAPI_ExtServer : public SubSystemServer {
public:
static RESTAPI_server *instance() {
static RESTAPI_server *instance_ = new RESTAPI_server;
static RESTAPI_ExtServer *instance() {
static RESTAPI_ExtServer *instance_ = new RESTAPI_ExtServer;
return instance_;
}
int Start() override;
@@ -2410,7 +2412,7 @@ namespace OpenWifi {
inline void reinitialize(Poco::Util::Application &self) override;
inline Poco::Net::HTTPRequestHandler *CallServer(const char *Path) {
inline Poco::Net::HTTPRequestHandler *CallServer(const char *Path, uint64_t Id) {
RESTAPIHandler::BindingMap Bindings;
return RESTAPI_external_server(Path, Bindings, Logger_, Server_);
}
@@ -2420,19 +2422,19 @@ namespace OpenWifi {
Poco::ThreadPool Pool_;
RESTAPI_GenericServer Server_;
RESTAPI_server() noexcept:
RESTAPI_ExtServer() noexcept:
SubSystemServer("RESTAPIServer", "RESTAPIServer", "openwifi.restapi")
{
}
};
inline RESTAPI_server * RESTAPI_server() { return RESTAPI_server::instance(); };
inline RESTAPI_ExtServer * RESTAPI_ExtServer() { return RESTAPI_ExtServer::instance(); };
class RequestHandlerFactory : public Poco::Net::HTTPRequestHandlerFactory {
class ExtRequestHandlerFactory : public Poco::Net::HTTPRequestHandlerFactory {
public:
RequestHandlerFactory(RESTAPI_GenericServer & Server) :
Logger_(RESTAPI_server::instance()->Logger()),
Server_(Server)
explicit ExtRequestHandlerFactory(RESTAPI_GenericServer & Server) :
Logger_(RESTAPI_ExtServer::instance()->Logger()),
Server_(Server)
{
}
@@ -2440,15 +2442,16 @@ namespace OpenWifi {
inline Poco::Net::HTTPRequestHandler *createRequestHandler(const Poco::Net::HTTPServerRequest &Request) override {
Poco::URI uri(Request.getURI());
auto *Path = uri.getPath().c_str();
return RESTAPI_server()->CallServer(Path);
return RESTAPI_ExtServer()->CallServer(Path, TransactionId_++);
}
private:
Poco::Logger &Logger_;
RESTAPI_GenericServer &Server_;
static inline std::atomic_uint64_t TransactionId_ = 1;
Poco::Logger &Logger_;
RESTAPI_GenericServer &Server_;
};
inline int RESTAPI_server::Start() {
inline int RESTAPI_ExtServer::Start() {
Logger_.information("Starting.");
Server_.InitLogging();
@@ -2467,7 +2470,7 @@ namespace OpenWifi {
Params->setMaxQueued(200);
Params->setKeepAlive(true);
auto NewServer = std::make_unique<Poco::Net::HTTPServer>(new RequestHandlerFactory(Server_), Pool_, Sock, Params);
auto NewServer = std::make_unique<Poco::Net::HTTPServer>(new ExtRequestHandlerFactory(Server_), Pool_, Sock, Params);
NewServer->start();
RESTServers_.push_back(std::move(NewServer));
}
@@ -2475,11 +2478,11 @@ namespace OpenWifi {
return 0;
}
class RESTAPI_InternalServer : public SubSystemServer {
class RESTAPI_IntServer : public SubSystemServer {
public:
static RESTAPI_InternalServer *instance() {
static RESTAPI_InternalServer *instance_ = new RESTAPI_InternalServer;
static RESTAPI_IntServer *instance() {
static RESTAPI_IntServer *instance_ = new RESTAPI_IntServer;
return instance_;
}
@@ -2488,12 +2491,13 @@ namespace OpenWifi {
Logger_.information("Stopping ");
for( const auto & svr : RESTServers_ )
svr->stop();
Pool_.stopAll();
Pool_.joinAll();
RESTServers_.clear();
}
inline void reinitialize(Poco::Util::Application &self) override;
inline Poco::Net::HTTPRequestHandler *CallServer(const char *Path) {
inline Poco::Net::HTTPRequestHandler *CallServer(const char *Path, uint64_t Id) {
RESTAPIHandler::BindingMap Bindings;
return RESTAPI_internal_server(Path, Bindings, Logger_, Server_);
}
@@ -2502,30 +2506,31 @@ namespace OpenWifi {
Poco::ThreadPool Pool_;
RESTAPI_GenericServer Server_;
RESTAPI_InternalServer() noexcept: SubSystemServer("RESTAPIInternalServer", "REST-ISRV", "openwifi.internal.restapi")
RESTAPI_IntServer() noexcept: SubSystemServer("RESTAPIInternalServer", "REST-ISRV", "openwifi.internal.restapi")
{
}
};
inline RESTAPI_InternalServer * RESTAPI_InternalServer() { return RESTAPI_InternalServer::instance(); };
inline RESTAPI_IntServer * RESTAPI_IntServer() { return RESTAPI_IntServer::instance(); };
class InternalRequestHandlerFactory : public Poco::Net::HTTPRequestHandlerFactory {
class IntRequestHandlerFactory : public Poco::Net::HTTPRequestHandlerFactory {
public:
InternalRequestHandlerFactory(RESTAPI_GenericServer & Server) :
Logger_(RESTAPI_InternalServer()->Logger()),
explicit IntRequestHandlerFactory(RESTAPI_GenericServer & Server) :
Logger_(RESTAPI_IntServer()->Logger()),
Server_(Server){}
inline Poco::Net::HTTPRequestHandler *createRequestHandler(const Poco::Net::HTTPServerRequest &Request) override {
Poco::URI uri(Request.getURI());
auto *Path = uri.getPath().c_str();
return RESTAPI_InternalServer()->CallServer(Path);
return RESTAPI_IntServer()->CallServer(Path, TransactionId_++);
}
private:
static inline std::atomic_uint64_t TransactionId_ = 1;
Poco::Logger & Logger_;
RESTAPI_GenericServer & Server_;
};
inline int RESTAPI_InternalServer::Start() {
inline int RESTAPI_IntServer::Start() {
Logger_.information("Starting.");
Server_.InitLogging();
@@ -2543,7 +2548,7 @@ namespace OpenWifi {
Params->setMaxQueued(200);
Params->setKeepAlive(true);
auto NewServer = std::make_unique<Poco::Net::HTTPServer>(new InternalRequestHandlerFactory(Server_), Pool_, Sock, Params);
auto NewServer = std::make_unique<Poco::Net::HTTPServer>(new IntRequestHandlerFactory(Server_), Pool_, Sock, Params);
NewServer->start();
RESTServers_.push_back(std::move(NewServer));
}
@@ -2673,7 +2678,7 @@ namespace OpenWifi {
std::string MyPrivateEndPoint_;
std::string MyPublicEndPoint_;
std::string UIURI_;
std::string Version_{std::string(APP_VERSION) + "("+ BUILD_NUMBER + ")"};
std::string Version_{ OW_VERSION::VERSION + "("+ OW_VERSION::BUILD + ")" + " - " + OW_VERSION::HASH };
BusEventManager BusEventManager_;
std::mutex InfraMutex_;
std::default_random_engine RandomEngine_;
@@ -2824,8 +2829,8 @@ namespace OpenWifi {
// add the default services
SubSystems_.push_back(KafkaManager());
SubSystems_.push_back(ALBHealthCheckServer());
SubSystems_.push_back(RESTAPI_server());
SubSystems_.push_back(RESTAPI_InternalServer());
SubSystems_.push_back(RESTAPI_ExtServer());
SubSystems_.push_back(RESTAPI_IntServer());
Poco::Net::initializeSSL();
Poco::Net::HTTPStreamFactory::registerFactory();
@@ -3395,14 +3400,14 @@ namespace OpenWifi {
Consumer.unsubscribe();
}
inline void RESTAPI_server::reinitialize(Poco::Util::Application &self) {
inline void RESTAPI_ExtServer::reinitialize(Poco::Util::Application &self) {
MicroService::instance().LoadConfigurationFile();
Logger_.information("Reinitializing.");
Stop();
Start();
}
void RESTAPI_InternalServer::reinitialize(Poco::Util::Application &self) {
void RESTAPI_IntServer::reinitialize(Poco::Util::Application &self) {
MicroService::instance().LoadConfigurationFile();
Logger_.information("Reinitializing.");
Stop();
@@ -3726,7 +3731,7 @@ namespace OpenWifi {
if (AuthClient()->IsAuthorized( SessionToken_, UserInfo_, Expired)) {
#endif
if(Server_.LogIt(Request->getMethod(),true)) {
Logger_.debug(Poco::format("X-REQ-ALLOWED(%s): User='%s@%s' Method='%s' Path='%s",
Logger_.debug(Poco::format("X-REQ-ALLOWED(%s): User='%s@%s' Method='%s' Path='%s'",
UserInfo_.userinfo.email,
Utils::FormatIPv6(Request->clientAddress().toString()),
Request->clientAddress().toString(),
@@ -3736,7 +3741,7 @@ namespace OpenWifi {
return true;
} else {
if(Server_.LogBadTokens(true)) {
Logger_.debug(Poco::format("X-REQ-DENIED(%s): Method='%s' Path='%s",
Logger_.debug(Poco::format("X-REQ-DENIED(%s): Method='%s' Path='%s'",
Utils::FormatIPv6(Request->clientAddress().toString()),
Request->getMethod(), Request->getURI()));
}

View File

@@ -2,8 +2,7 @@
// Created by stephane bourque on 2021-10-06.
//
#ifndef OPENWIFI_STORAGE_H
#define OPENWIFI_STORAGE_H
#pragma once
#include "Poco/Data/Session.h"
#include "Poco/Data/SessionPool.h"
@@ -54,13 +53,13 @@ namespace OpenWifi {
[[nodiscard]] inline std::string ComputeRange(uint64_t From, uint64_t HowMany) {
if(dbType_==sqlite) {
return " LIMIT " + std::to_string(From-1) + ", " + std::to_string(HowMany) + " ";
return " LIMIT " + std::to_string(From) + ", " + std::to_string(HowMany) + " ";
} else if(dbType_==pgsql) {
return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From-1) + " ";
return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From) + " ";
} else if(dbType_==mysql) {
return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From-1) + " ";
return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From) + " ";
}
return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From-1) + " ";
return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From) + " ";
}
inline std::string ConvertParams(const std::string & S) const {
@@ -165,5 +164,3 @@ namespace OpenWifi {
#endif
}
#endif //OPENWIFI_STORAGE_H

13
src/ow_version.h.in Normal file
View File

@@ -0,0 +1,13 @@
//
// Created by stephane bourque on 2021-12-06.
//
#pragma once
#include <string>
namespace OW_VERSION {
inline static const std::string VERSION{"@CMAKE_PROJECT_VERSION@"};
inline static const std::string BUILD{"@BUILD_NUM@"};
inline static const std::string HASH{"@GIT_HASH@"};
}

View File

@@ -65,7 +65,7 @@ namespace OpenWifi {
if(LatestFirmwareCache()->AddToCache(F.deviceType,F.revision,F.id,F.imageDate)) {
F.latest = true ;
Poco::Data::Statement Update(Sess);
std::string st{"UPDATE " + DBNAME_FIRMWARES + " SET latest=0 WHERE deviceType=? AND Latest=1"};
std::string st{"UPDATE " + DBNAME_FIRMWARES + " SET latest=false WHERE deviceType=? AND Latest=true"};
Update << ConvertParams(st),
Poco::Data::Keywords::use(F.deviceType);
Update.execute();

View File

@@ -25,7 +25,7 @@ namespace OpenWifi {
"location varchar, "
"uploader varchar, "
"digest varchar, "
"latest int, "
"latest boolean, "
"notes text, "
"created bigint"
};
@@ -88,7 +88,7 @@ namespace OpenWifi {
std::string,
std::string,
std::string,
uint64_t,
bool,
std::string,
uint64_t> FirmwaresRecord;
typedef std::vector<FirmwaresRecord> FirmwaresRecordList;

26
wait-for-postgres.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/sh
# wait-for-postgres.sh
set -e
host="$1"
shift
export PGUSER=$(grep 'storage.type.postgresql.username' $OWFMS_CONFIG/owfms.properties | awk -F '= ' '{print $2}')
export PGPASSWORD=$(grep 'storage.type.postgresql.password' $OWFMS_CONFIG/owfms.properties | awk -F '= ' '{print $2}')
until psql -h "$host" -c '\q'; do
>&2 echo "Postgres is unavailable - sleeping"
sleep 1
done
>&2 echo "Postgres is up - executing command"
if [ "$1" = '/openwifi/owfms' -a "$(id -u)" = '0' ]; then
if [ "$RUN_CHOWN" = 'true' ]; then
chown -R "$OWFMS_USER": "$OWFMS_ROOT" "$OWFMS_CONFIG"
fi
exec su-exec "$OWFMS_USER" "$@"
fi
exec "$@"