Skip to content

Commit 7a6d7b7

Browse files
Merge release/2.1.0 branch into master (#77)
<!-- Thanks for the contribution, this is awesome. --> # PR Details Merge the release/2.1.0 branch into the master branch as part of the release process. This merge should be tagged and then deployed on the new production website. Note: #76 Should be merged first ## Description <!--- Describe your changes in detail --> ## Related GitHub Issue <!--- This project only accepts pull requests related to open GitHub issues or Jira Keys --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please DO NOT name partially fixed issues, instead open an issue specific to this fix --> <!--- Please link to the issue here: --> ## Related Jira Key [Map-88](https://usdot-carma.atlassian.net/browse/MAP-88) ## Motivation and Context <!--- Why is this change required? What problem does it solve? --> ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Defect fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that cause existing functionality to change) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] I have added any new packages to the sonar-scanner.properties file - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have read the [**CONTRIBUTING**](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md) document. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed.
2 parents cedbd48 + 2875a2e commit 7a6d7b7

File tree

101 files changed

+8548
-435
lines changed

Some content is hidden

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

101 files changed

+8548
-435
lines changed

.github/workflows/ci.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,22 @@ jobs:
1818
options: --user root
1919
steps:
2020
- name: Checkout ${{ github.event.repository.name }}
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222
- name: Install # This action is to install and build subfolders in project
2323
run: |
2424
cd $GITHUB_WORKSPACE
2525
export LD_LIBRARY_PATH=/__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-lib-asn1c/third_party_lib
2626
cd /__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-parent && mvn -e -X clean install -Dmaven.test.failure.ignore=true
2727
cd /__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-lib-asn1c && mvn -e -X clean install -Dmaven.test.failure.ignore=true
2828
cd /__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-mapencoder && mvn -e -X clean install -Dmaven.test.failure.ignore=true
29+
cd /__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-rgaencoder && mvn -e -X clean install -Dmaven.test.failure.ignore=true
2930
cd /__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-message-builder && mvn -e -X clean install -Dmaven.test.failure.ignore=true
3031
cd /__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-ISDcreator-webapp && mvn -e -X clean install -Dmaven.test.failure.ignore=true
3132
cd /__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-TIMcreator-webapp && mvn -e -X clean install -Dmaven.test.failure.ignore=true
3233
cd /__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-map-services-proxy && mvn -e -X clean install -Dmaven.test.failure.ignore=true
3334
jar cvf /__w/connectedvcs-tools/connectedvcs-tools/root.war -C /__w/connectedvcs-tools/connectedvcs-tools/root .
3435
- name: Archive generated Class files
35-
uses: actions/upload-artifact@v3 # Archive the generated class files after the build action used for deployment
36+
uses: actions/upload-artifact@v4 # Archive the generated class files after the build action used for deployment
3637
with:
3738
name: Class files
3839
path: |
@@ -94,12 +95,14 @@ jobs:
9495
sonar.projectBaseDir=$GITHUB_WORKSPACE
9596
sonar.projectKey=usdot-fhwa-stol_connectedvcs-tools
9697
sonar.projectName=connectedvcs-tools
98+
sonar.exclusions=**/target/**
9799
sonar.coverage.jacoco.xmlReportPaths=$GITHUB_WORKSPACE/connectedvcs-tools/connectedvcs-tools/fedgov-cv-TIMcreator-webapp/target/site/jacoco/jacoco.xml,\
98100
$GITHUB_WORKSPACE/connectedvcs-tools/connectedvcs-tools/fedgov-cv-ISDcreator-webapp/target/site/jacoco/jacoco.xml,\
99101
$GITHUB_WORKSPACE/connectedvcs-tools/connectedvcs-tools/fedgov-cv-lib-asn1c/target/site/jacoco/jacoco.xml,\
100102
$GITHUB_WORKSPACE/connectedvcs-tools/connectedvcs-tools/fedgov-cv-mapencoder/target/site/jacoco/jacoco.xml,\
101103
$GITHUB_WORKSPACE/connectedvcs-tools/connectedvcs-tools/fedgov-cv-message-builder/target/site/jacoco/jacoco.xml,\
102104
$GITHUB_WORKSPACE/connectedvcs-tools/connectedvcs-tools/fedgov-cv-map-services-proxy/target/site/jacoco/jacoco.xml
105+
103106
sonar.java.binaries=/__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-TIMcreator-webapp/target,\
104107
/__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-ISDcreator-webapp/target,\
105108
/__w/connectedvcs-tools/connectedvcs-tools/fedgov-cv-lib-asn1c/target,\

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ target/
2626
.classpath
2727
.vscode/
2828
root.war
29+
private-resources.war

Dockerfile

+48-27
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
11
FROM gradle:7.4.2-jdk8 AS gradle-build
2-
ARG TOKEN
3-
RUN git clone https://[email protected]/usdot-fhwa-stol/CARMASensitive.git
2+
ARG USE_SSL
43
RUN ls -la && pwd
54
FROM maven:3.8.5-jdk-8-slim AS mvn-build
6-
ADD . /root
5+
COPY . /root
6+
7+
# Install gettext to use envsubst
8+
RUN apt-get update && \
9+
apt-get install -y gettext-base && \
10+
apt-get clean
11+
12+
# Update the web.xml based on SSL selection
13+
RUN if [ "$USE_SSL" = "true" ]; then \
14+
export SECURITY_CONSTRAINT="<security-constraint><web-resource-collection><web-resource-name>Everything</web-resource-name><url-pattern>/*</url-pattern></web-resource-collection><user-data-constraint><transport-guarantee>CONFIDENTIAL</transport-guarantee></user-data-constraint></security-constraint>"; \
15+
else \
16+
export SECURITY_CONSTRAINT=""; \
17+
fi && \
18+
envsubst '$SECURITY_CONSTRAINT' < /root/root/WEB-INF/web.xml > /tmp/web.xml.tmp && \
19+
mv /tmp/web.xml.tmp /root/root/WEB-INF/web.xml && \
20+
envsubst '$SECURITY_CONSTRAINT' < /root/fedgov-cv-TIMcreator-webapp/src/main/webapp/WEB-INF/web.xml > /tmp/web.xml.tmp && \
21+
mv /tmp/web.xml.tmp /root/fedgov-cv-TIMcreator-webapp/src/main/webapp/WEB-INF/web.xml && \
22+
envsubst '$SECURITY_CONSTRAINT' < /root/fedgov-cv-ISDcreator-webapp/src/main/webapp/WEB-INF/web.xml > /tmp/web.xml.tmp && \
23+
mv /tmp/web.xml.tmp /root/fedgov-cv-ISDcreator-webapp/src/main/webapp/WEB-INF/web.xml
724

825
# Run the Maven build
9-
RUN cd /root/fedgov-cv-parent \
10-
&& mvn install -DskipTests
11-
RUN cd /root/fedgov-cv-lib-asn1c \
12-
&& mvn install -DskipTests
13-
RUN cd /root/fedgov-cv-mapencoder \
14-
&& mvn install -DskipTests
15-
RUN cd /root/fedgov-cv-message-builder \
16-
&& mvn install -DskipTests
17-
RUN cd /root/fedgov-cv-ISDcreator-webapp \
18-
&& mvn install -DskipTests
19-
RUN cd /root/fedgov-cv-TIMcreator-webapp \
20-
&& mvn install -DskipTests
21-
RUN cd /root/fedgov-cv-map-services-proxy \
22-
&& mvn clean install -DskipTests
23-
RUN jar cvf /root/private-resources.war -C /root/private-resources .
24-
RUN jar cvf /root/root.war -C /root/root .
26+
COPY ./build.sh /root
27+
WORKDIR /root
28+
RUN ./build.sh
29+
2530

2631
FROM jetty:9.4.46-jre8-slim
32+
ARG USE_SSL
2733
# Install the generated WAR files
2834
COPY --from=mvn-build /root/fedgov-cv-ISDcreator-webapp/target/isd.war /var/lib/jetty/webapps
2935
COPY --from=mvn-build /root/fedgov-cv-TIMcreator-webapp/target/tim.war /var/lib/jetty/webapps
@@ -36,16 +42,31 @@ RUN mkdir -p /var/lib/jetty/webapps/third_party_lib
3642
COPY --from=mvn-build /root/fedgov-cv-lib-asn1c/third_party_lib/libasn1c.so /var/lib/jetty/webapps/third_party_lib
3743
COPY --from=mvn-build /root/fedgov-cv-lib-asn1c/third_party_lib/libasn1c_x64.so /var/lib/jetty/webapps/third_party_lib
3844
COPY --from=mvn-build /root/fedgov-cv-lib-asn1c/third_party_lib/libasn1c_x86.so /var/lib/jetty/webapps/third_party_lib
45+
COPY --from=mvn-build /root/fedgov-cv-lib-asn1c/third_party_lib/libasn1c_rga.so /var/lib/jetty/webapps/third_party_lib
3946

40-
#Create env file
47+
# Create library path env
4148
USER root
42-
ENV LD_LIBRARY_PATH /var/lib/jetty/webapps/third_party_lib
49+
ENV LD_LIBRARY_PATH=/var/lib/jetty/webapps/third_party_lib
4350
RUN ldconfig
4451

45-
RUN cd /var/lib/jetty \
46-
&& echo 'log4j2.version=2.23.1' >> start.d/logging-log4j2.ini
47-
RUN java -jar $JETTY_HOME/start.jar --create-files
52+
WORKDIR /var/lib/jetty
53+
RUN echo 'log4j2.version=2.23.1' >> start.d/logging-log4j2.ini && \
54+
java -jar "$JETTY_HOME"/start.jar --create-files
55+
56+
# Prepare files for SSL
57+
COPY keystore* /tmp/
58+
COPY ssl.ini /tmp/
4859

49-
RUN java -jar $JETTY_HOME/start.jar --add-to-start=https
50-
COPY --from=gradle-build /home/gradle/CARMASensitive/maptool/keystore* /var/lib/jetty/etc/
51-
COPY --from=gradle-build /home/gradle/CARMASensitive/maptool/ssl.ini /var/lib/jetty/start.d/
60+
# Conditionally add SSL or non-SSL based on the USE_SSL environment variable
61+
RUN if [ "$USE_SSL" = "true" ]; then \
62+
if [ -f /tmp/ssl.ini ]; then \
63+
java -jar "$JETTY_HOME"/start.jar --add-to-start=https; \
64+
cp /tmp/keystore* /var/lib/jetty/etc/; \
65+
cp /tmp/ssl.ini /var/lib/jetty/start.d/; \
66+
else \
67+
echo "SSL is enabled, but keystore or ssl.ini files are missing."; \
68+
exit 1; \
69+
fi; \
70+
else \
71+
java -jar "$JETTY_HOME"/start.jar --add-to-start=http; \
72+
fi

README.md

+7-13
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,23 @@ This repository is a monorepo combining the repository histories of each of the
44
ConnectedVCS Tool packages. Each subfolder corresponds to one of the original
55
repositories used for ConnectedVCS Tools development.
66

7-
## Setup Path
8-
1. After cloning the repo, set up LD_LIBRARY_PATH by running `LD_LIBRARY_PATH="[path_to_connectedvcs-tools]/fedgov-cv-lib-asn1c/third_party_lib"`.
9-
2. Then, run `export LD_LIBRARY_PATH`.
7+
## Docker Instructions
8+
Build and setup instructions for the docker image can be found in the [Docker Instructions](docs/Docker_Instructions.md).
109

11-
## Build Instructions
12-
1. Install JDK and Maven.
13-
2. Run `sudo ./build.sh`.
14-
15-
## Deployment
16-
1. Locate `root.war`,`isd.war` and `tim.war` in `connectedvcs-tools/`, `connectedvcs-tools/fedgov-cv-ISDcreator-webapp/target` and `connectedvcs-tools/fedgov-cv-TIMcreator-webapp/target` respectively.
17-
2. Deploy as servlets in conjunction with Apache Tomcat.
10+
## Local Instructions
11+
Build and setup instructions for running ConnectedVCS Tools locally can be found in the [Local Instructions](docs/Local_Instructions.md).
1812

1913
## Contribution
20-
Welcome to the ConnectedVCS Tools contributing guide. Please read this guide to learn about our development process, how to propose pull requests and improvements, and how to build and test your changes to this project. [ConnectedVCS Tools Contributing Guide](Contributing.md)
14+
Welcome to the ConnectedVCS Tools contributing guide. Please read this guide to learn about our development process, how to propose pull requests and improvements, and how to build and test your changes to this project. [ConnectedVCS Tools Contributing Guide](Contributing.md).
2115

2216
## Code of Conduct
2317
Please read our [ConnectedVCS Tools Code of Conduct](Code_of_Conduct.md) which outlines our expectations for participants within the Connected Vehicle (CV) community, as well as steps to reporting unacceptable behavior. We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored. Anyone who violates this code of conduct may be banned from the community.
2418

2519
## Attribution
26-
The development team would like to acknowledge the people who have made direct contributions to the design and code in this repository. [ConnectedVCS Tools Attribution](ATTRIBUTION.md)
20+
The development team would like to acknowledge the people who have made direct contributions to the design and code in this repository. [ConnectedVCS Tools Attribution](ATTRIBUTION.md).
2721

2822
## License
29-
By contributing to the Federal Highway Administration (FHWA) ConnectedVCS Tools, you agree that your contributions will be licensed under its Apache License 2.0 license. [ConnectedVCS Tools License](LICENSE)
23+
By contributing to the Federal Highway Administration (FHWA) ConnectedVCS Tools, you agree that your contributions will be licensed under its Apache License 2.0 license. [ConnectedVCS Tools License](LICENSE).
3024

3125
## Contact
3226
For more information, contact [email protected].

build.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ mvn install -DskipTests=true
88
cd ../fedgov-cv-mapencoder/
99
mvn install -DskipTests=true
1010

11+
cd ../fedgov-cv-rgaencoder/
12+
mvn install -DskipTests=true
13+
1114
cd ../fedgov-cv-message-builder/
1215
mvn install -DskipTests=true
1316

@@ -20,4 +23,6 @@ mvn install -DskipTests=true
2023
cd ../fedgov-cv-map-services-proxy/
2124
mvn install -DskipTests=true
2225

23-
jar cvf ../root.war -C ../root .
26+
jar cvf ../private-resources.war -C ../private-resources .
27+
jar cvf ../root.war -C ../root .
28+

docs/BingMaps_API_Key_Guidance.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Bing Maps API Key Guidance
2+
----------------------------
3+
4+
**NOTE: Bing Maps is now deprectated. We will be migrating to a different map provider.**
5+
6+
The current version of the MAP Creation Tool uses Bing Maps for its base map. An API key must be generated by each individual user if a personal deployment of the tool is desired. By default, we recommend securing your API keys according to the official instructions on [Enhanced Security for Bing Maps API Keys](https://blogs.bing.com/maps/2018-05/Announcing-Enhanced-Security-for-Bing-Maps-API-Keys). Enabling security will ensure no bad actors will be able to abuse the use of your personal API keys.
7+
8+
In case the tool will not be publically available, the security feature does not need to be enabled. However, it is still recommended to periodically check the usage of your keys.
9+
10+
### **Getting a Bing Maps API Key**
11+
12+
An account with Bing Maps can be created using the [Bing Maps Portal](https://www.bingmapsportal.com/). After an account is created, you may follow the official instructions on [Creating a Bing Maps Key](https://learn.microsoft.com/en-us/bingmaps/getting-started/bing-maps-dev-center-help/getting-a-bing-maps-key).
13+
14+
### **Using your API Key**
15+
16+
Once a key is obtained, please insert your key and any arbitrary username in the [ISDcreator-webapp-keys](/private-resources/js/ISDcreator-webapp-keys.js) file and build your updated ConnectedVCS Tools using either the [Local](/docs/Local_Instructions.md) or [Docker](/docs/Docker_Instructions.md) build instructions.

docs/Docker_Instructions.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Running Dockerized ConnectedVCS Tools
2+
If you are running ConnectedVCS Tools using a docker image, you can use the following instructions:
3+
4+
**NOTE:** Bing Maps is now deprecated and new users are no longer allowed to create API keys. We will be migrating to a different map provider and updating this documentation soon.
5+
6+
## Prerequisites
7+
ConnectedVCS Tools has been developed using Ubuntu 20.04 and Ubuntu 22.04. Further testing with other operating systems is needed before guidance is created. For the moment, please use Ubuntu 20.04 or later [Ubuntu LTS Release](https://releases.ubuntu.com/).
8+
9+
### Install Docker CE
10+
Instructions for installing Docker may change, so please use the current instructions at the Docker website:
11+
https://docs.docker.com/desktop/install/linux-install/.
12+
13+
## Run the ConnectedVCS Tools Image
14+
15+
### Build a Custom Image
16+
17+
1. Clone the ConnectedVCS Tools respository:
18+
```
19+
git clone https://github.com/usdot-fhwa-stol/connectedvcs-tools.git
20+
```
21+
2. Note: Placeholder for map API key generation.
22+
23+
3. Enter a map API key and username in [ISDcreator-webapp-keys](/private-resources/js/ISDcreator-webapp-keys.js)
24+
and API key in [application.properties](/fedgov-cv-map-services-proxy/src/main/resources/application.properties#L2).
25+
26+
4. Create a new Google Maps API Key using the [Google Maps Platform](https://developers.google.com/maps/documentation/javascript/get-api-key#create-api-keys).
27+
- Please read the [Google Maps API Key Guidance](/docs/GoogleMaps_API_Key_Guidance.md).
28+
5. Enter your key to the end of the Geocomplete src link (indicated by "google.map.api.key") at the [application.properties](/fedgov-cv-map-services-proxy/src/main/resources/application.properties#L1)
29+
30+
6. Using SSL vs not using SSL:
31+
32+
- If using SSL certificates, you may look up instructions to generate a keystore and SSL certficiates with your certificate authority (CA) of choice. In this case, the ssl.ini and keystore files will need to be updated or replaced to copy your applicable keystore information to the image. **NOTE**: The current ssl.ini and keystore files are examples only. Please update or replace before running the following command.
33+
```
34+
sudo docker build -t usdotfhwastol/connectedvcs-tools:<tag> --build-arg USE_SSL=true .
35+
```
36+
37+
- If running the tool without certificates, no changes are needed. Run the following command.
38+
```
39+
sudo docker build -t usdotfhwastol/connectedvcs-tools:<tag> --build-arg USE_SSL=false .
40+
```
41+
42+
### Run Image with SSL certificate
43+
```
44+
sudo docker run -d -p 443:443 usdotfhwastol/connectedvcs-tools:<tag>
45+
```
46+
47+
### Run Image without SSL certificate
48+
```
49+
sudo docker run -d -p 8080:8080 usdotfhwastol/connectedvcs-tools:<tag>
50+
```
51+
52+
## Access the ConnectedVCS Tools Interface
53+
54+
1. In your browser, navigate to:
55+
- with SSL: https://127.0.0.1:443/
56+
- without SSL: http://127.0.0.1:8080/

docs/GoogleMaps_API_Key_Guidance.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Google Maps API Key Guidance
2+
----------------------------
3+
4+
The current version of the MAP Creation Tool uses Google Maps for the Places Autocomplete plugin. This plugin allows a user to input an address in the searchbar at the top of the MAP Creation Tool page and autonavigate to the address. To enable the plugin, an API key must be generated by each individual user if a personal deployment of the tool is desired. By default, we recommend securing your API keys according to the official instructions on [Google Maps Platform security guidance](https://developers.google.com/maps/api-security-best-practices#restricting-api-keys). Enabling security will ensure no bad actors will be able to abuse the use of your personal API keys.
5+
6+
In case the tool will not be publically available, the security feature does not need to be enabled. However, it is still recommended to periodically check the usage of your keys.
7+
8+
### **Getting a Google Maps API Key**
9+
10+
An account with Google Maps and an API Key can be created using the [Google Maps Platform](https://developers.google.com/maps/documentation/javascript/get-api-key#create-api-keys).
11+
12+
### **Using your API Key**
13+
14+
Once a key is obtained, please insert your key to the end of the Geocomplete src link (indicated by "YOUR_API_KEY") at the [index.html](/fedgov-cv-ISDcreator-webapp/src/main/webapp/index.html) file and build your updated ConnectedVCS Tools using either the [Local](/docs/Local_Instructions.md) or [Docker](/docs/Docker_Instructions.md) build instructions.

0 commit comments

Comments
 (0)