Skip to content

Commit

Permalink
Merge branch 'master' into Flask_Werkzeug_Update
Browse files Browse the repository at this point in the history
  • Loading branch information
naman108 authored Apr 14, 2024
2 parents faed9a1 + 9747949 commit c762d76
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 34 deletions.
22 changes: 0 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,6 @@ ENV PATH /home/freetak/.local/bin:$PATH
RUN pip install --upgrade pip ; pip install setuptools wheel poetry ; pip install --force-reinstall "ruamel.yaml<0.18"
RUN pip install --no-build-isolation --editable .

# Provide a way to edit the configuration from outside the container
# May need to be updated if the base image changes
RUN cp FreeTAKServer/core/configuration/MainConfig.py FreeTAKServer/core/configuration/MainConfig.bak
RUN mv FreeTAKServer/core/configuration/MainConfig.py /opt/fts/MainConfig.py
RUN ln -s /opt/fts/MainConfig.py FreeTAKServer/core/configuration/MainConfig.py

# Open ports
# note: docker compose documentation suggests that communication between
# core and ui doesn't need a port explicitly exposed
# DataPackagePort
EXPOSE 8080
# CoTPort
EXPOSE 8087
# SSLCoTPort
EXPOSE 8089
# SSLDataPackagePort
EXPOSE 8443
# FederationPort
EXPOSE 9000
# APIPort - Don't expose by default
#EXPOSE 19023

VOLUME /opt/fts

CMD [ "/home/freetak/docker-run.sh" ]
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@

@page.route('/GenerateQR', methods=['GET'])
def generate_qr():
datapackage_id = request.args.get('datapackage_id')
dp = RestAPICommunicationController().make_request("GetEnterpriseSyncMetaData", "", {"id": datapackage_id}).get_value("objectmetadata")
datapackage_hash = request.args.get('datapackage_hash')
resp = RestAPICommunicationController().make_request("GetEnterpriseSyncMetaData", "", {"objecthash": datapackage_hash})
dp = resp.get_value("objectmetadata")
qr = qrcode.QRCode(
version=1,
box_size=10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,9 @@ def stop(self):
def start(self, APIPipea, CommandPipea, IP, Port, starttime, factory):
print('running api')

#ObjectFactory.configure(factory)
#tracing_provider = ObjectFactory.get_instance("TracingProvider")
#super().start(factory, tracing_provider)
super().start()
self.initialize_connections(APPLICATION_PROTOCOL)
ObjectFactory.configure(factory)
Expand Down
72 changes: 72 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
services:
freetakserver:
image: freetakserver:latest
pull_policy: build
restart: unless-stopped
build:
context: .
dockerfile: Dockerfile
volumes:
- free-tak-core-db:/opt/fts/
ports:
# DataPackagePort
- 8080:8080
# CoTPort
- 8087:8087
# SSLCoTPort
- 8089:8089
# SSLDataPackagePort
- 8443:8443
# FederationPort
#- 9000:9000
# APIPort - Don't expose by default
#- 19023:19023

environment:
# The ChangeMe section
FTS_FED_PASSWORD: "defaultpass"
FTS_CLIENT_CERT_PASSWORD: "password"
FTS_SECRET_KEY: "vnkdjnfjknfl1232#"
FTS_NODE_ID: "fl5m8j5txlgdtfv8wi96zf8tt0howddo"
FTS_CONNECTION_MESSAGE: "Welcome to FreeTAKServer. The Parrot is not dead. It’s just resting"

# Networking
FTS_COT_PORT: 8087
FTS_SSLCOT_PORT: 8089
FTS_API_PORT: 19023
FTS_FED_PORT: 9000

FTS_DP_ADDRESS: 127.0.0.1
FTS_USER_ADDRESS: 127.0.0.1
FTS_API_ADDRESS: 0.0.0.0

FTS_ROUTING_PROXY_SUBSCRIBE_PORT: 19030
FTS_ROUTING_PROXY_SUBSCRIBE_IP: 127.0.0.1

FTS_ROUTING_PROXY_PUBLISHER_PORT: 19032
FTS_ROUTING_PROXY_PUBLISHER_IP: 127.0.0.1

FTS_ROUTING_PROXY_SERVER_PORT: 19031
FTS_ROUTING_PROXY_SERVER_IP: 127.0.0.1

FTS_INTEGRATION_MANAGER_PULLER_PORT: 19033 # port to receive worker responses by the integration manager
FTS_INTEGRATION_MANAGER_PULLER_ADDRESS: 127.0.0.1 # address to receive worker responses by the integration manager

FTS_INTEGRATION_MANAGER_PUBLISHER_PORT: 19034 # port from which to publish messages by the integration manager
FTS_INTEGRATION_MANAGER_PUBLISHER_ADDRESS: 127.0.0.1 # address from which to publish messages by the integration manager

# Misc Settings
FTS_OPTIMIZE_API: True
FTS_DATA_RECEPTION_BUFFER: 1024
FTS_MAX_RECEPTION_TIME: 4
FTS_NUM_ROUTING_WORKERS: 3
FTS_COT_TO_DB: True
# number of milliseconds to wait between each iteration of main loop
# decreasing will increase CPU usage and server performance
# increasing will decrease CPU usage and server performance
FTS_MAINLOOP_DELAY: 100
FTS_EMERGENCY_RADIUS: 0 # radius of emergency within-which users will receive it
FTS_LOG_LEVEL: "info"

volumes:
free-tak-core-db:
10 changes: 0 additions & 10 deletions docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
#!/bin/bash

# Sharing for MainConfig.py
if [[ ! -f "/opt/fts/MainConfig.py" ]]
then
cp FreeTAKServer/core/configuration/MainConfig.bak /opt/fts/MainConfig.py
fi
if [[ ! -f "FreeTAKServer/core/configuration/MainConfig.py" ]]
then
ln -s /opt/fts/MainConfig.py FreeTAKServer/core/configuration/MainConfig.py
fi

# Sharing for FTSConfig.yaml
if [[ ! -f "/opt/fts/FTSConfig.yaml" ]]
then
Expand Down

0 comments on commit c762d76

Please sign in to comment.