Skip to content

Commit

Permalink
Merge pull request #33 from TAK-Product-Center/upstream/4.8-RELEASE-63
Browse files Browse the repository at this point in the history
TAK Server 4.8-RELEASE-63
  • Loading branch information
takdeveloper authored Nov 17, 2023
2 parents cbbaa66 + 7d1742a commit f08ca71
Show file tree
Hide file tree
Showing 358 changed files with 11,292 additions and 6,958 deletions.
31 changes: 24 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TAK Server Development
*Requires Java 11*

* Linux / MacOS is recommended for development. If using Windows, replace "gradlew" with "gradlew.bat" in commands below.
* Linux or MacOS is recommended for development. If using Windows, replace "gradlew" with "gradlew.bat" in commands below. An x86-64 architecture CPU is required to build from source, including on MacOS. M1 or M2 Apple silicon is not supported.

Links:
* [Test Execution](src/takserver-takcl-core/docs/testing.md)
Expand Down Expand Up @@ -33,7 +33,7 @@ docker run -it -d --rm --name TakserverServer0DB \
--env POSTGRES_HOST_AUTH_METHOD=trust \
--env POSTGRES_USER=martiuser \
--env POSTGRES_DB=cot \
-p 5432 postgis/postgis:10-3.1
-p 5432 postgis/postgis:15-3.3
echo SQL SERVER IP: `docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' TakserverServer0DB`
```
Expand All @@ -48,7 +48,9 @@ Setup Local Database. If the postgis container was used, only the last two lines
```

Configure Local CoreConfig and Certs
```cd takserver-core/example```
```
cd takserver-core/example
```

This is the CoreConfig that takserver war will look for when running from the takserver-core/example directory. From this point, just follow the instructions at takserver/src/docs/TAK_Server_Configuration_Guide.pdf to set up the CoreConfig and Certs. Make sure that the CoreConfig now points to the directory where the certs were generated locally.

Expand Down Expand Up @@ -113,16 +115,24 @@ java -Xmx<value> -Dspring.profiles.active=messaging -jar ../build/libs/takserver
```

turn down log level of all logs:
```java -jar takserver.war $@ --logging.level.root=ERROR```
```
java -jar takserver.war $@ --logging.level.root=ERROR
```

turn down log level for subscriptions:
```java -jar takserver.war $@ --logging.level.com.bbn.marti.service.Subscription=ERROR```
```
java -jar takserver.war $@ --logging.level.com.bbn.marti.service.Subscription=ERROR
```

turn off logs just for subscriptions:
```java -jar takserver.war $@ --logging.level.com.bbn.marti.service.Subscription=OFF```
```
java -jar takserver.war $@ --logging.level.com.bbn.marti.service.Subscription=OFF
```

entirely disable most logging:
```java -jar takserver.war $@ --logging.level.root=OFF```
```
java -jar takserver.war $@ --logging.level.root=OFF
```

The default log level for most things is INFO. Possible levels are INFO, WARN, ERROR, OFF (in order of decreasing log frequency)

Expand All @@ -135,6 +145,13 @@ i.e.

```--logging.level.root=ERROR```

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

1. _takserver-messaging.log_ - Execution-level information about the messaging process, including client connection events, error messages and warnings.
2. _takserver-api.log_ - Execution-level information about the API process, including error messages and warnings.
3. _takserver-messaging-console.log_ - Java Virtual Machine (JVM) informational messages and errors, for the messaging process.
4. _takserver-api-console.log_ - Java Virtual Machine (JVM) informational messages and errors, for the API process.

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

Expand Down
35 changes: 35 additions & 0 deletions src/.licenses/config/allowed-licenses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"allowedLicenses": [
{"moduleLicense": "Apache License, Version 2.0"},
{"moduleLicense": "Apache License"},
{"moduleLicense": "Apache Software License, version 1.1"},
{"moduleLicense": "The MIT License"},
{"moduleLicense": "The 3-Clause BSD License"},
{"moduleLicense": "The 2-Clause BSD License"},

{"moduleLicense": "BSD"},
{"moduleLicense": "New BSD License"},
{"moduleLicense": "BSD New license"},
{"moduleLicense": "The New BSD License"},
{"moduleLicense": "The BSD License"},
{"moduleLicense": "Revised BSD"},
{"moduleLicense": "BSD-style"},

{"moduleLicense": "Public Domain"},
{"moduleLicense": "PUBLIC DOMAIN"},
{"moduleLicense": "Common Public License Version 1.0"},

{"moduleLicense": "CDDL + GPLv2 with classpath exception"},
{"moduleLicense": "LGPL, version 2.1"},
{"moduleLicense": "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0"},
{"moduleLicense": "GPL2 w/ CPE"},
{"moduleLicense": "CDDL 1.1"},
{"moduleLicense": "LGPL"},
{"moduleLicense": "Google Cloud Software License"},
{"moduleLicense": "GNU Lesser General Public License"},
{"moduleLicense": "CDDL+GPL License"},
{"moduleLicense": "ASL"},
{"moduleLicense": "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1"},
{"moduleLicense": null}
]
}
110 changes: 110 additions & 0 deletions src/.quality/config/pmd-ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?xml version="1.0"?>

<ruleset name="Custom Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>
My custom rules
</description>
<rule ref="category/java/bestpractices.xml">
<exclude name="UnusedPrivateMethod"/>
</rule>
<rule ref="category/java/design.xml">
<exclude name="LoosePackageCoupling"/>
<exclude name="ExcessiveImports"/>
<exclude name="TooManyFields"/>
<exclude name="TooManyMethods"/>
<exclude name="LawOfDemeter"/>
<exclude name="NcssCount"/>
<exclude name="CyclomaticComplexity"/>
<exclude name="NPathComplexity"/>
</rule>
<rule ref="category/java/errorprone.xml">
<exclude name="SimpleDateFormatNeedsLocale"/>
<exclude name="MissingSerialVersionUID"/>
<exclude name="BeanMembersShouldSerialize"/>
<exclude name="UseLocaleWithCaseConversions"/>
<exclude name="UseLocaleWithCaseConversions"/>

</rule>
<rule ref="category/java/performance.xml"/>
<rule ref="category/java/security.xml"/>

<!-- The next three rules replace the functionality of the naming/VariableNamingConventions rule. We want to
allow "logger" as a special case of static final. The other two rules are re-implementations of
functionality from the builtin rule in XPath since we disabled it, but we want them to be run. -->

<rule name="StaticFieldsUpperCaseExceptLogger"
language="java"
message="Variables that are final and static should be in all caps."
class="net.sourceforge.pmd.lang.rule.XPathRule">
<description>
Static final fields should have names in all upper case
</description>
<properties>
<property name="xpath">
<value>
<![CDATA[
//FieldDeclaration[@Static='true' and @Final='true']/VariableDeclarator/VariableDeclaratorId[upper-case(@Name) != @Name and @Name != 'logger']
]]>
</value>
</property>
</properties>
<example>
<![CDATA[
private static final String lower = "foo"; // don't do this!
]]>
</example>
</rule>

<rule name="VariableNamesStartWithLowerCaseLetter"
language="java"
message="Variables should start with a lowercase character"
class="net.sourceforge.pmd.lang.rule.XPathRule">
<description>
Normal variables should start with lower case letters
</description>
<properties>
<property name="xpath">
<value>
<![CDATA[
//VariableDeclaratorId[lower-case(substring(@Name,1,1))!=substring(@Name,1,1)]/../..[@Static='false' and @Final='false']
]]>
</value>
</property>
</properties>
<example>
<![CDATA[
public void foo() {
int XYZ; // Don't do this
}
]]>
</example>
</rule>

<rule name="VariableNamesShouldNotContainUnderscore"
language="java"
message="Variables that are not final should not contain underscores"
class="net.sourceforge.pmd.lang.rule.XPathRule">
<description>
Non-final variables should not have underscores in the name
</description>
<properties>
<property name="xpath">
<value>
<![CDATA[
//VariableDeclaratorId[contains(@Name,'_')]/../..[@Final='false']
]]>
</value>
</property>
</properties>
<example>
<![CDATA[
public void foo() {
int a_value; // Don't do this
}
]]>
</example>
</rule>
</ruleset>
64 changes: 56 additions & 8 deletions src/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//import se.bjurr.violations.gradle.plugin.ViolationsTask
//import com.github.jk1.license.render.InventoryHtmlReportRenderer
//import com.github.jk1.license.render.XmlReportRenderer

buildscript {

repositories {
Expand All @@ -9,12 +13,13 @@ buildscript {

dependencies {
classpath 'org.ajoberstar:grgit:1.7.2'
// classpath 'gradle.plugin.se.bjurr.violations:violations-gradle-plugin:1.52.2'
// classpath 'com.github.jk1:gradle-license-report:1.17'
}
}

apply plugin: 'eclipse'
apply plugin: 'idea'

apply from: 'gradle/license.gradle', to: project

ext {
Expand All @@ -35,7 +40,7 @@ ext {
takreleaserpm = takrel1 + takrel2

def (tvmaj, tvmin) = tv.tokenize('.')

verMajor = tvmaj
verMinor = tvmin
verPatch = takrel2
Expand All @@ -49,6 +54,8 @@ allprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
// apply plugin: 'pmd'


sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down Expand Up @@ -94,13 +101,54 @@ subprojects {
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:' + gradle_shadow_version
classpath 'gradle.plugin.org.openrepose:gradle-jaxb-plugin:2.5.0'
// classpath 'gradle.plugin.se.bjurr.violations:violations-gradle-plugin:1.52.2'
// classpath 'com.github.jk1:gradle-license-report:1.17'
}
}

clean {
delete 'bin/'
}
// apply plugin: 'se.bjurr.violations.violations-gradle-plugin' // Normalizes quality reports for Gitlab CI
// apply plugin: 'pmd'
// // Define a new task to merge quality reports and convert them into a format GitLab can consume
// tasks.create('violations', ViolationsTask) {
// maxReporterColumnWidth = 0 // 0 means "no limit"
// maxRuleColumnWidth = 60
// maxSeverityColumnWidth = 0
// maxLineColumnWidth = 0
// maxMessageColumnWidth = 50
// codeClimateFile = new File(project.buildDir.path + '/code-climate-file.json')
// // Will create a CodeClimate JSON report.
// violations = [
// ["PMD", buildDir.path, ".*/pmd/.*\\.xml\$", "pmd"]
// ]
// }
// pmd {
// ignoreFailures = true
// toolVersion = '6.47.0'
// ruleSetFiles = files("${rootDir}/.quality/config/pmd-ruleset.xml")
// // Note: The ruleSets array is explicitly set to empty to avoid using the default configuration.
// ruleSets = []
// }
//
// apply plugin: 'com.github.jk1.dependency-license-report'
// licenseReport {
// // Don't include artifacts of project's own group in the report
// excludeOwnGroup = true
//
// // Don't exclude bom dependencies.
// // If set to true, then all boms will be excluded from the report
// excludeBoms = false
//
// // Set custom report renderer, implementing ReportRenderer.
// // Yes, you can write your own to support any format necessary.
// renderers = [new XmlReportRenderer()]
// renderers = [new InventoryHtmlReportRenderer()]
//
// // This is for the allowed-licenses-file in checkLicense Task
// // Accepts File, URL or String path to local or remote file
// allowedLicensesFile = new File("${rootDir}/.licenses/config/allowed-licenses.json")
// }
//
// clean {
// delete 'bin/'
// }
}



25 changes: 0 additions & 25 deletions src/docs/INSTALL.txt

This file was deleted.

Binary file modified src/docs/TAK_Server_Configuration_Guide.odt
Binary file not shown.
Binary file modified src/docs/TAK_Server_Configuration_Guide.pdf
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit f08ca71

Please sign in to comment.