Skip to content

Commit 4361692

Browse files
authored
Merge branch 'TAK-Product-Center:main' into main
2 parents ad42f2e + 1f345ec commit 4361692

File tree

682 files changed

+18543
-18235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

682 files changed

+18543
-18235
lines changed

README.md

+22-10
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ This is the CoreConfig that takserver war will look for when running from the ta
5656

5757
See appendix B in src/docs/TAK_Server_Configuration_Guide.pdf for cert generation instructions.
5858

59-
### Build and run TAK server locally for development
59+
### Build TAK server to run locally for development
6060

6161
Note that due to Java 17, there are a lot of '--add-opens' arguments in the JDK_JAVA_OPTIONS
6262
```
@@ -67,20 +67,30 @@ export IGNITE_HOME="$PWD/ignite"
6767
export JDK_JAVA_OPTIONS="-Dloader.path=WEB-INF/lib-provided,WEB-INF/lib,WEB-INF/classes,file:lib/ -Djava.net.preferIPv4Stack=true -Djava.security.egd=file:/dev/./urandom -DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_QUIET=true -Dio.netty.tmpdir=$PWD -Djava.io.tmpdir=$PWD -Dio.netty.native.workdir=$PWD -Djdk.tls.client.protocols=TLSv1.2 --add-opens=java.base/sun.security.pkcs=ALL-UNNAMED --add-opens=java.base/sun.security.pkcs10=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED --add-opens=java.base/sun.security.x509=ALL-UNNAMED --add-opens=java.base/sun.security.tools.keytool=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED --add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.math=ALL-UNNAMED --add-opens=java.sql/java.sql=ALL-UNNAMED --add-opens=java.base/javax.net.ssl=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=jdk.unsupported/sun.misc=ALL-UNNAMED --add-opens=java.base/java.lang.ref=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.security.ssl=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/sun.security.rsa=ALL-UNNAMED --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.security.x500=ALL-UNNAMED --add-opens=java.base/sun.security.pkcs12=ALL-UNNAMED --add-opens=java.base/sun.security.provider=ALL-UNNAMED --add-opens=java.base/javax.security.auth.x500=ALL-UNNAMED"
6868
6969
```
70+
### Running TAK server locally for development
7071

71-
TAK server consists of two processes: Messaging and API. The messaging process can run independently, but the API process needs to connect to the ignite server that runs as a part of the messaging process. For both processes, -Xmx should always be specified.
72+
TAK server consists of three processes: Configuration, Messaging and API.
7273

73-
Run Messaging (note - this command and the following one to run api include the **duplicatelogs** profile. This turns off the filter that blocks duplicated log messages that cause log spam in operational deployments of TAK Server.
74+
The configuration process needs to be running first in order for the Messaging, API or any other services to retrieve the centralized configuration. This is separate from the TAKIgniteConfiguration that is loaded **per service** using defaults or the overridden values in TAKIgniteConfig.xml.
75+
76+
The messaging process can run independently, but the API process may need to connect to the ignite server that runs as a part of the messaging process if it is not configured to run its own Ignite server. For both processes, -Xmx should always be specified.
77+
78+
Note - These commands include the **duplicatelogs** profile. This turns off the filter that blocks duplicated log messages that cause log spam in operational deployments of TAK Server.
79+
80+
#### Run Configuration Microservice
81+
```
82+
java -server -XX:+AlwaysPreTouch -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:+DisableExplicitGC -Xmx<value> -Dspring.profiles.active=config,duplicatelogs -jar ../build/libs/takserver-core-xyz.war
83+
```
84+
#### Run Messaging Microservice
7485
```
7586
java -server -XX:+AlwaysPreTouch -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:+DisableExplicitGC -Xmx<value> -Dspring.profiles.active=messaging,duplicatelogs -jar ../build/libs/takserver-core-xyz.war
7687
```
77-
78-
Run API
88+
#### Run API Microservice
7989
```
8090
java -server -XX:+AlwaysPreTouch -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:+DisableExplicitGC -Xmx<value> -Dspring.profiles.active=api,duplicatelogs -Dkeystore.pkcs12.legacy -jar ../build/libs/takserver-core-xyz.war
8191
```
8292

83-
Run Plugin Manager (useful when working on plugin capability)
93+
#### Run Plugin Manager Microservice (optional - useful when working on plugin capability)
8494
```
8595
java -server -XX:+AlwaysPreTouch -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:+DisableExplicitGC -Xmx<value> -jar ../../takserver-plugin-manager/build/libs/takserver-plugin-manager-xyz.jar
8696
```
@@ -150,10 +160,12 @@ i.e.
150160

151161
The TAK Server log files can be found in the _logs_ subdirectory:
152162

153-
1. _takserver-messaging.log_ - Execution-level information about the messaging process, including client connection events, error messages and warnings.
154-
2. _takserver-api.log_ - Execution-level information about the API process, including error messages and warnings.
155-
3. _takserver-messaging-console.log_ - Java Virtual Machine (JVM) informational messages and errors, for the messaging process.
156-
4. _takserver-api-console.log_ - Java Virtual Machine (JVM) informational messages and errors, for the API process.
163+
1. _takserver-config.log_ - Execution-level information about the configuration process including setup, error messages and warnings.
164+
2. _takserver-messaging.log_ - Execution-level information about the messaging process, including client connection events, error messages and warnings.
165+
3. _takserver-api.log_ - Execution-level information about the API process, including error messages and warnings.
166+
4. _takserver-config-console.log_ - Java Virtual Machine (JVM) informational messages and errors, for the config process.
167+
5. _takserver-messaging-console.log_ - Java Virtual Machine (JVM) informational messages and errors, for the messaging process.
168+
6. _takserver-api-console.log_ - Java Virtual Machine (JVM) informational messages and errors, for the API process.
157169

158170
## Swagger
159171
https://localhost:8443/swagger-ui.html

src/docs/README_fedhub.md

+84-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
12
# TAK Server Federation Hub
23

3-
*Requires Java 11.*
4+
*Requires Java 17.*
45

56
## Description
67

@@ -37,18 +38,97 @@ To build the .rpm for the Federation Hub, run:
3738
2. broker
3839
3. UI (optional)
3940

40-
## Install and Run
41+
## Install and Run RHEL7
42+
Update yum
43+
44+
```
45+
sudo yum update -y
46+
```
47+
48+
Install Java 17
49+
```
50+
sudo yum install wget -y
51+
sudo wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm
52+
sudo yum install -y ./jdk-17_linux-x64_bin.rpm
53+
```
54+
55+
To install from the .rpm, run:
56+
57+
```
58+
sudo rpm -ivh takserver-fed-hub-*.noarch.rpm --nodeps
59+
```
60+
61+
## Install and Run RHEL8
62+
Update yum
63+
64+
```
65+
sudo dnf update -y
66+
```
67+
68+
Install Java 17
69+
```
70+
sudo dnf install java-17-openjdk-devel -y
71+
```
4172

4273
To install from the .rpm, run:
4374

4475
```
45-
sudo yum install federation-hub-*.noarch.rpm
76+
sudo yum install takserver-fed-hub-*.noarch.rpm -y
77+
```
78+
79+
Add and Apply SELinux
80+
```
81+
sudo dnf install checkpolicy
82+
cd /opt/tak/federation-hub && sudo ./apply-selinux.sh && sudo semodule -l | grep takserver
4683
```
4784

85+
## Install Mongo
86+
Make sure /opt/tak/federation-hub/configs/federation-hub-broker.yml has your database credentials defined. Defaults will be generated otherwise
87+
```
88+
dbUsername: martiuser
89+
dbPassword: pass4marti
90+
```
91+
92+
Mongo Setup
93+
```
94+
sudo yum install -y mongodb-org
95+
sudo systemctl daemon-reload
96+
sudo systemctl enable mongod
97+
sudo systemctl restart mongod
98+
sudo /opt/tak/federation-hub/scripts/db/configure.sh
99+
```
100+
101+
## Update from RPM
102+
Before updating the Federation Hub, you should back up the policy file and list of authorized users:
103+
104+
```
105+
mv /opt/tak/federation-hub/ui_generated_policy.json /tmp
106+
mv /opt/tak/federation-hub/authorized_users.yml /tmp
107+
```
108+
109+
RHEL7
110+
```
111+
sudo rpm -Uvh takserver-fed-hub-*.noarch.rpm --nodeps
112+
```
113+
114+
RHEL8
115+
```
116+
sudo yum upgrade takserver-fed-hub-*.noarch.rpm
117+
```
118+
119+
The policy and authorized can then be replaced:
120+
```
121+
mv /tmp/ui_generated_policy.json /opt/tak/federation-hub/
122+
mv /tmp/authorized_users.yml /opt/tak/federation-hub/
123+
```
124+
125+
## Configuration
126+
**The Federation Hub authenticates clients using TLS with X.509 client certificates. Scripts for generating a private security enclave, including a Certificate Authority (CA), and certs for use by the Federation Hub are in the TAK server documentation. See the TAK server configuration guide (docs/TAK_Server_Configuration_Guide.pdf) for additional information.**
127+
48128
The Federation Hub can then be started as a system service (and enabled to run on boot):
49129

50130
```
51-
sudo systemctl start federation-hub
131+
sudo systemctl restart federation-hub
52132
sudo systemctl enable federation-hub
53133
```
54134

@@ -64,8 +144,6 @@ The Federation Hub consists of three processes: a policy manager, an administrat
64144

65145
## Client Authentication and Authorization
66146

67-
The Federation Hub authenticates clients using TLS with X.509 client certificates. Scripts for generating a private security enclave, including a Certificate Authority (CA), and certs for use by the Federation Hub are in the TAK server documentation. See the TAK server configuration guide (docs/TAK_Server_Configuration_Guide.pdf) for additional information.
68-
69147
To authorize clients to act as administrators and enable access to the admin UI, use `federation-hub-manager.jar`:
70148

71149
```
1.05 KB
Binary file not shown.
6.8 KB
Binary file not shown.

src/federation-common/build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ dependencies {
88
implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j_version
99
implementation group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4j_version
1010

11+
implementation(project(':takserver-common'))
1112
api project(':takserver-fig-core')
1213

1314
// Apache Ignite (cache and distributed service grid).
1415
// implementation group: 'org.apache.ignite', name: 'ignite-spring', version: ignite_spring_version
1516
// implementation group: 'org.apache.ignite', name: 'ignite-spring-cache-ext', version: ignite_spring_cache_version
1617
implementation group: 'org.springframework', name: 'spring-beans', version: spring_version
1718
implementation group: 'org.springframework', name: 'spring-context', version: spring_version
18-
19+
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-mongodb', version: spring_boot_version
1920

2021
implementation group: 'org.apache.ignite', name: 'ignite-kubernetes', version: ignite_version
2122
implementation group: 'org.apache.ignite', name: 'ignite-slf4j', version: ignite_version
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM mongo:6.0
2+
3+
COPY tak/federation-hub/scripts/db /opt/tak/federation-hub/scripts/db
4+
5+
RUN mkdir -p /var/lib/mongodb
6+
7+
ENTRYPOINT ["/bin/sh","-c","/opt/tak/federation-hub/scripts/db/configureInDocker.sh && tail -f /dev/null"]

src/federation-common/src/main/java/tak/server/federation/FederateGroup.java

-36
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,6 @@ public FederateGroup(FederateIdentity federateIdentity) {
2323
this.filterExpression = "";
2424
}
2525

26-
public FederateGroup(FederateIdentity federateIdentity, boolean interconnected) {
27-
super(federateIdentity);
28-
this.interconnected = interconnected;
29-
this.federatesInGroup = new HashSet<>();
30-
this.filterExpression = "";
31-
}
32-
33-
/* If there is a group filter expression, the group is interconnected. */
34-
public FederateGroup(FederateIdentity federateIdentity, String filterExpression) {
35-
super(federateIdentity);
36-
this.interconnected = true;
37-
this.filterExpression = filterExpression;
38-
this.federatesInGroup = new HashSet<>();
39-
}
40-
41-
public FederateGroup(String name, FederateIdentity federateIdentity) {
42-
super(name, federateIdentity);
43-
this.interconnected = true;
44-
this.federatesInGroup = new HashSet<>();
45-
this.filterExpression = "";
46-
}
47-
48-
public FederateGroup(String name, FederateIdentity federateIdentity, boolean interconnected) {
49-
super(name, federateIdentity);
50-
this.interconnected = interconnected;
51-
this.federatesInGroup = new HashSet<>();
52-
this.filterExpression = "";
53-
}
54-
55-
/* If there is a group filter expression, the group is interconnected. */
56-
public FederateGroup(String name, FederateIdentity federateIdentity, String filterExpression) {
57-
super(name, federateIdentity);
58-
this.interconnected = true;
59-
this.filterExpression = filterExpression;
60-
this.federatesInGroup = new HashSet<>();
61-
}
6226

6327
public boolean isInterconnected() {
6428
return interconnected;

src/federation-common/src/main/java/tak/server/federation/FederationException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public FederationException(String additionalInformation, Throwable failureCausin
2424
@Override
2525
public String toString() {
2626
Throwable cause = this.getCause();
27-
if(cause == null) {
27+
if (cause == null) {
2828
return this.getMessage();
2929
} else if (this.additionalInformation == null) {
3030
return cause.toString();

src/federation-common/src/main/java/tak/server/federation/FederationFilter.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public String getMethodName() {
3131
}
3232

3333
public void addMessageAttribute(String key, Object value) {
34-
if(isValueValidType(value)) {
34+
if (isValueValidType(value)) {
3535
messageAttributes.put(key, value);
3636
}
3737
}
@@ -41,7 +41,7 @@ public Map<String, Object> getMessageAttributes() {
4141
}
4242

4343
public void addSourceAttribute(String key, Object value) {
44-
if(isValueValidType(value)) {
44+
if (isValueValidType(value)) {
4545
sourceAttributes.put(key, value);
4646
}
4747
}
@@ -51,7 +51,7 @@ public Map<String, Object> getSourceAttributes() {
5151
}
5252

5353
public void addDestinationAttribute(String key, Object value) {
54-
if(isValueValidType(value)) {
54+
if (isValueValidType(value)) {
5555
destinationAttributes.put(key, value);
5656

5757
}

0 commit comments

Comments
 (0)