diff --git a/build.gradle b/build.gradle
index 9eecd8416e6..5da453cfceb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,12 +3,9 @@ plugins {
id "com.github.ben-manes.versions" version "0.51.0"
id "io.franzbecker.gradle-lombok" version "5.0.0" apply false
id "com.diffplug.spotless" version "6.25.0" apply false
- id "com.avast.gradle.docker-compose" version "0.17.7"
}
apply plugin: "eclipse"
-apply plugin: "docker-compose"
-
ext {
schemasDir = file("config/triplea/schemas")
@@ -199,39 +196,4 @@ subprojects {
removeUnusedImports()
}
}
-
- // "testWithDatabase" runs only the tests that need a database
- tasks.register("testWithDatabase", Test) {
- description = "Runs integration tests."
- group = "verification"
-
- dependsOn(":composeUp")
- dependsOn(":spitfire-server:database:flywayMigrateLobbyDb")
- dependsOn(":spitfire-server:database:flywayMigrateErrorReportDb")
-
- useJUnitPlatform() {
- includeTags "RequiresDatabase"
- }
- }
-
- // - "testAll" runs all tests
- task testAll {
- dependsOn testWithDatabase
- dependsOn test
- }
-
- // - "check" should run ALL validations, tests, spotlessChecks, everything..
- check.dependsOn testAll
-
- // composeUp is the same as running => docker compose -f .docker/full-stack.yml --ansi never -p triplea up
- // composeBuild is the same as running => docker compose -f .docker/full-stack.yml --ansi never -p triplea build
- dockerCompose {
- projectName = "triplea"
- useComposeFiles = ["docker-compose.yml" ]
- }
-
- // compose builds need WAR files for packaging, so we must run the corresponding package (shadowJar) tasks
- composeBuild.dependsOn ":servers:game-support:server:shadowJar"
- composeBuild.dependsOn ":servers:maps:server:shadowJar"
- composeBuild.dependsOn ":spitfire-server:dropwizard-server:shadowJar"
}
diff --git a/docker-compose.yml b/docker-compose.yml
deleted file mode 100644
index 291eae4e016..00000000000
--- a/docker-compose.yml
+++ /dev/null
@@ -1,69 +0,0 @@
-# This docker-compose file depends on './gradlew shadowJar'
-#
-# Launches all of the background servers used by TripleA.
-# The main entrypoint to those services is NGINX which
-# is listening on localhost:80
-#
-version: '3'
-services:
- database:
- image: postgres:10
- environment:
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: postgres
- POSTGRES_DB: postgres
- volumes:
- - ./.docker-compose/database/01-init.sql:/docker-entrypoint-initdb.d/01-init.sql
- ports:
- - "5432:5432"
- healthcheck:
- test: echo 'select 1' | psql -h localhost -U postgres | grep -q '1 row'
- interval: 3s
- retries: 10
- timeout: 3s
-
- lobby:
- build:
- context: spitfire-server/dropwizard-server/
- dockerfile: Dockerfile
- environment:
- - DATABASE_USER=lobby_user
- - DATABASE_PASSWORD=lobby
- - DB_URL=database:5432/lobby_db
- ports:
- - "8080"
- depends_on:
- - database
-
- game-support-server:
- build:
- context: servers/game-support/server/
- dockerfile: Dockerfile
- environment:
- - DB_URL=database:5432/lobby_db
- ports:
- - "8080"
- depends_on:
- - database
-
- maps-server:
- build:
- context: servers/maps/server/
- dockerfile: Dockerfile
- environment:
- - DB_URL=database:5432/lobby_db
- ports:
- - "8080"
- depends_on:
- - database
-
- nginx:
- image: nginx:stable-alpine-perl
- volumes:
- - ./.docker-compose/nginx/default.conf:/etc/nginx/conf.d/default.conf
- ports:
- - "80:80"
- links:
- - game-support-server
- - maps-server
- - lobby
diff --git a/format b/format
index 79f9eeda9a6..66955177d32 100755
--- a/format
+++ b/format
@@ -1,5 +1,7 @@
#!/bin/bash
+set -eu
+
./gradlew spotlessApply
find . -name "*.md" -type f | while read -r file; do
diff --git a/game-app/game-core/build.gradle b/game-app/game-core/build.gradle
index 4c336e83693..4b77f2f9ced 100644
--- a/game-app/game-core/build.gradle
+++ b/game-app/game-core/build.gradle
@@ -18,12 +18,12 @@ dependencies {
implementation project(":game-app:map-data")
implementation project(":game-app:game-relay-server")
implementation project(":http-clients:lobby-client")
+ implementation project(":http-clients:maps-server")
implementation project(":lib:http-client-lib")
implementation project(":lib:java-extras")
implementation project(":lib:swing-lib")
implementation project(":lib:websocket-client")
implementation project(":lib:xml-reader")
- implementation project(":servers:maps:client")
testImplementation "org.awaitility:awaitility:$awaitilityVersion"
testImplementation "org.sonatype.goodies:goodies-prefs:$sonatypeGoodiesPrefsVersion"
testImplementation project(":lib:swing-lib-test-support")
diff --git a/game-app/game-headed/build.gradle b/game-app/game-headed/build.gradle
index 64dccdc08a7..0482d6d6b5f 100644
--- a/game-app/game-headed/build.gradle
+++ b/game-app/game-headed/build.gradle
@@ -21,12 +21,12 @@ dependencies {
implementation project(":game-app:game-core")
implementation project(":game-app:map-data")
implementation project(":http-clients:lobby-client")
+ implementation project(":http-clients:maps-server")
implementation project(":lib:feign-common")
implementation project(":lib:http-client-lib")
implementation project(":lib:java-extras")
implementation project(":lib:swing-lib")
implementation project(":lib:websocket-client")
- implementation project(":servers:maps:client")
testImplementation "org.sonatype.goodies:goodies-prefs:$sonatypeGoodiesPrefsVersion"
testImplementation project(":lib:test-common")
}
diff --git a/servers/game-support/client/build.gradle b/http-clients/game-support-server/build.gradle
similarity index 100%
rename from servers/game-support/client/build.gradle
rename to http-clients/game-support-server/build.gradle
diff --git a/servers/game-support/client/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java b/http-clients/game-support-server/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java
similarity index 100%
rename from servers/game-support/client/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java
rename to http-clients/game-support-server/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java
diff --git a/servers/game-support/client/src/main/java/org/triplea/http/client/error/report/CanUploadRequest.java b/http-clients/game-support-server/src/main/java/org/triplea/http/client/error/report/CanUploadRequest.java
similarity index 100%
rename from servers/game-support/client/src/main/java/org/triplea/http/client/error/report/CanUploadRequest.java
rename to http-clients/game-support-server/src/main/java/org/triplea/http/client/error/report/CanUploadRequest.java
diff --git a/servers/game-support/client/src/main/java/org/triplea/http/client/error/report/ErrorReportClient.java b/http-clients/game-support-server/src/main/java/org/triplea/http/client/error/report/ErrorReportClient.java
similarity index 100%
rename from servers/game-support/client/src/main/java/org/triplea/http/client/error/report/ErrorReportClient.java
rename to http-clients/game-support-server/src/main/java/org/triplea/http/client/error/report/ErrorReportClient.java
diff --git a/servers/game-support/client/src/main/java/org/triplea/http/client/error/report/ErrorReportRequest.java b/http-clients/game-support-server/src/main/java/org/triplea/http/client/error/report/ErrorReportRequest.java
similarity index 100%
rename from servers/game-support/client/src/main/java/org/triplea/http/client/error/report/ErrorReportRequest.java
rename to http-clients/game-support-server/src/main/java/org/triplea/http/client/error/report/ErrorReportRequest.java
diff --git a/servers/game-support/client/src/main/java/org/triplea/http/client/error/report/ErrorReportResponse.java b/http-clients/game-support-server/src/main/java/org/triplea/http/client/error/report/ErrorReportResponse.java
similarity index 100%
rename from servers/game-support/client/src/main/java/org/triplea/http/client/error/report/ErrorReportResponse.java
rename to http-clients/game-support-server/src/main/java/org/triplea/http/client/error/report/ErrorReportResponse.java
diff --git a/http-clients/github-client/build.gradle b/http-clients/github-client/build.gradle
deleted file mode 100644
index 15f8179e91e..00000000000
--- a/http-clients/github-client/build.gradle
+++ /dev/null
@@ -1,9 +0,0 @@
-dependencies {
- implementation "io.github.openfeign:feign-core:$feignCoreVersion"
- implementation "io.github.openfeign:feign-gson:$feignGsonVersion"
- implementation project(":lib:feign-common")
- implementation project(":lib:java-extras")
- testImplementation "ru.lanwen.wiremock:wiremock-junit5:$wireMockJunit5Version"
- testImplementation "com.github.tomakehurst:wiremock:$wireMockVersion"
- testImplementation project(":lib:test-common")
-}
diff --git a/http-clients/github-client/src/main/java/org/triplea/http/client/github/BranchInfoResponse.java b/http-clients/github-client/src/main/java/org/triplea/http/client/github/BranchInfoResponse.java
deleted file mode 100644
index f4457180fa5..00000000000
--- a/http-clients/github-client/src/main/java/org/triplea/http/client/github/BranchInfoResponse.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.triplea.http.client.github;
-
-import com.google.gson.annotations.SerializedName;
-import java.time.Instant;
-import lombok.AllArgsConstructor;
-import lombok.ToString;
-
-/**
- * Represents the data returned by github API for their 'branches' endpoint. This class Presents a
- * simplified interface for what is otherwise a JSON response.
- */
-@ToString
-@AllArgsConstructor
-public class BranchInfoResponse {
- @SerializedName("commit")
- private final LastCommit lastCommit;
-
- /** Returns the date of the last commit. */
- public Instant getLastCommitDate() {
- return Instant.parse(lastCommit.commit.commitDetails.date);
- }
-
- @ToString
- @AllArgsConstructor
- private static class LastCommit {
-
- private final Commit commit;
-
- @ToString
- @AllArgsConstructor
- private static class Commit {
- @SerializedName("author")
- private final CommitDetails commitDetails;
-
- @ToString
- @AllArgsConstructor
- private static class CommitDetails {
- private final String date;
- }
- }
- }
-}
diff --git a/http-clients/github-client/src/main/java/org/triplea/http/client/github/CreateIssueRequest.java b/http-clients/github-client/src/main/java/org/triplea/http/client/github/CreateIssueRequest.java
deleted file mode 100644
index b5358cd7c1e..00000000000
--- a/http-clients/github-client/src/main/java/org/triplea/http/client/github/CreateIssueRequest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.triplea.http.client.github;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.ToString;
-import org.triplea.http.client.HttpClientConstants;
-import org.triplea.java.StringUtils;
-
-/** Represents request data to create a github issue. */
-@ToString
-@EqualsAndHashCode
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class CreateIssueRequest {
- private String title;
- private String body;
- private String[] labels;
-
- public String getTitle() {
- return title == null ? null : StringUtils.truncate(title, HttpClientConstants.TITLE_MAX_LENGTH);
- }
-
- public String getBody() {
- return body == null
- ? null
- : StringUtils.truncate(body, HttpClientConstants.REPORT_BODY_MAX_LENGTH);
- }
-}
diff --git a/http-clients/github-client/src/main/java/org/triplea/http/client/github/CreateIssueResponse.java b/http-clients/github-client/src/main/java/org/triplea/http/client/github/CreateIssueResponse.java
deleted file mode 100644
index 509b5fc62a2..00000000000
--- a/http-clients/github-client/src/main/java/org/triplea/http/client/github/CreateIssueResponse.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.triplea.http.client.github;
-
-import com.google.gson.annotations.SerializedName;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.ToString;
-
-/** Response JSON object from github after we create a new issue. */
-@ToString
-@AllArgsConstructor
-@Getter
-public class CreateIssueResponse {
- @SerializedName("html_url")
- private final String htmlUrl;
-}
diff --git a/http-clients/github-client/src/main/java/org/triplea/http/client/github/GithubApiClient.java b/http-clients/github-client/src/main/java/org/triplea/http/client/github/GithubApiClient.java
deleted file mode 100644
index 4d61fc428a7..00000000000
--- a/http-clients/github-client/src/main/java/org/triplea/http/client/github/GithubApiClient.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package org.triplea.http.client.github;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import feign.FeignException;
-import java.net.URI;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Optional;
-import javax.annotation.Nonnull;
-import lombok.Builder;
-import lombok.Getter;
-import org.slf4j.LoggerFactory;
-import org.triplea.http.client.HttpClient;
-
-/** Can be used to interact with github's webservice API. */
-public class GithubApiClient {
- /** If this client is set to 'test' mode, we will return a stubbed response. */
- @VisibleForTesting
- static final String STUBBED_RETURN_VALUE =
- "API-token==test--returned-a-stubbed-github-issue-link";
-
- private final GithubApiFeignClient githubApiFeignClient;
-
- /**
- * Flag useful for testing, when set to true no API calls will be made and a hardcoded stubbed
- * value of {@code STUBBED_RETURN_VALUE} will always be returned.
- */
- private final boolean stubbingModeEnabled;
-
- @Getter private final String org;
- private final String repo;
-
- /**
- * @param uri The URI for githubs webservice API.
- * @param authToken Auth token that will be sent to Github for webservice calls. Can be empty, but
- * if specified must be valid (no auth token still works, but rate limits will be more
- * restrictive).
- * @param org Name of the github org to be queried.
- * @param repo Name of the github repository, may be left null if using only 'org' level APIs (EG:
- * list repositories)
- * @param stubbingModeEnabled When set to true, stub values will be returned and the github web
- * API will not actually be contacted.
- */
- @Builder
- public GithubApiClient(
- @Nonnull URI uri,
- @Nonnull String authToken,
- @Nonnull String org,
- String repo,
- final boolean stubbingModeEnabled) {
- githubApiFeignClient =
- HttpClient.newClient(
- GithubApiFeignClient.class,
- uri,
- Strings.isNullOrEmpty(authToken)
- ? Map.of()
- : Map.of("Authorization", "token " + authToken));
- this.stubbingModeEnabled = stubbingModeEnabled;
- this.org = org;
- this.repo = repo;
- }
-
- /**
- * Invokes github web-API to create a github issue with the provided parameter data.
- *
- * @param createIssueRequest Upload data for creating the body and title of the github issue.
- * @return Response from server containing link to the newly created issue.
- * @throws feign.FeignException thrown on error or if non-2xx response is received
- */
- public CreateIssueResponse newIssue(final CreateIssueRequest createIssueRequest) {
- Preconditions.checkNotNull(repo);
- if (stubbingModeEnabled) {
- return new CreateIssueResponse(
- STUBBED_RETURN_VALUE + String.valueOf(Math.random()).substring(0, 5));
- }
-
- return githubApiFeignClient.newIssue(org, repo, createIssueRequest);
- }
-
- /**
- * Returns a listing of the repositories within a github organization. This call handles paging,
- * it returns a complete list and may perform multiple calls to Github.
- *
- *
Example equivalent cUrl call:
- *
- *
curl https://api.github.com/orgs/triplea-maps/repos
- */
- public Collection listRepositories() {
- final Collection allRepos = new HashSet<>();
- int pageNumber = 1;
- Collection repos = listRepositories(pageNumber);
- while (!repos.isEmpty()) {
- pageNumber++;
- allRepos.addAll(repos);
- repos = listRepositories(pageNumber);
- }
- return allRepos;
- }
-
- private Collection listRepositories(int pageNumber) {
- final Map queryParams = new HashMap<>();
- queryParams.put("per_page", "100");
- queryParams.put("page", String.valueOf(pageNumber));
-
- return githubApiFeignClient.listRepos(queryParams, org);
- }
-
- /**
- * Fetches details of a specific branch on a specific repo. Useful for retrieving info about the
- * last commit to the repo. Note, the repo listing contains a 'last_push' date, but this method
- * should be used instead as the last_push date on a repo can be for any branch (even PRs).
- *
- *
Example equivalent cUrl:
- * https://api.github.com/repos/triplea-maps/star_wars_galactic_war/branches/master
- *
- * @param branch Which branch to be queried.
- * @return Payload response object representing the response from Github's web API.
- */
- public BranchInfoResponse fetchBranchInfo(String branch) {
- return fetchBranchInfo(repo, branch);
- }
-
- public BranchInfoResponse fetchBranchInfo(String repo, String branch) {
- Preconditions.checkNotNull(repo);
- return githubApiFeignClient.getBranchInfo(org, repo, branch);
- }
-
- public Optional fetchLatestVersion() {
- Preconditions.checkNotNull(repo);
- try {
- return Optional.of(githubApiFeignClient.getLatestRelease(org, repo).getTagName());
- } catch (final FeignException e) {
- LoggerFactory.getLogger(GithubApiClient.class)
- .warn("No data received from server for latest engine version", e);
- return Optional.empty();
- }
- }
-}
diff --git a/http-clients/github-client/src/main/java/org/triplea/http/client/github/GithubApiFeignClient.java b/http-clients/github-client/src/main/java/org/triplea/http/client/github/GithubApiFeignClient.java
deleted file mode 100644
index cc4e9571ddb..00000000000
--- a/http-clients/github-client/src/main/java/org/triplea/http/client/github/GithubApiFeignClient.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.triplea.http.client.github;
-
-import com.google.common.annotations.VisibleForTesting;
-import feign.FeignException;
-import feign.Param;
-import feign.QueryMap;
-import feign.RequestLine;
-import java.util.List;
-import java.util.Map;
-
-@SuppressWarnings("InterfaceNeverImplemented")
-interface GithubApiFeignClient {
-
- @VisibleForTesting String CREATE_ISSUE_PATH = "/repos/{org}/{repo}/issues";
- @VisibleForTesting String LIST_REPOS_PATH = "/orgs/{org}/repos";
- @VisibleForTesting String BRANCHES_PATH = "/repos/{org}/{repo}/branches/{branch}";
- @VisibleForTesting String LATEST_RELEASE_PATH = "/repos/{org}/{repo}/releases/latest";
-
- /**
- * Creates a new issue on github.com.
- *
- * @throws FeignException Thrown on non-2xx responses.
- */
- @RequestLine("POST " + CREATE_ISSUE_PATH)
- CreateIssueResponse newIssue(
- @Param("org") String org, @Param("repo") String repo, CreateIssueRequest createIssueRequest);
-
- @RequestLine("GET " + LIST_REPOS_PATH)
- List listRepos(
- @QueryMap Map queryParams, @Param("org") String org);
-
- @RequestLine("GET " + BRANCHES_PATH)
- BranchInfoResponse getBranchInfo(
- @Param("org") String org, @Param("repo") String repo, @Param("branch") String branch);
-
- @RequestLine("GET " + LATEST_RELEASE_PATH)
- LatestReleaseResponse getLatestRelease(@Param("org") String org, @Param("repo") String repo);
-}
diff --git a/http-clients/github-client/src/main/java/org/triplea/http/client/github/LatestReleaseResponse.java b/http-clients/github-client/src/main/java/org/triplea/http/client/github/LatestReleaseResponse.java
deleted file mode 100644
index 2c7fed2c018..00000000000
--- a/http-clients/github-client/src/main/java/org/triplea/http/client/github/LatestReleaseResponse.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.triplea.http.client.github;
-
-import com.google.gson.annotations.SerializedName;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-@Getter
-@AllArgsConstructor
-public class LatestReleaseResponse {
- @SerializedName("tag_name")
- String tagName;
-}
diff --git a/http-clients/github-client/src/main/java/org/triplea/http/client/github/MapRepoListing.java b/http-clients/github-client/src/main/java/org/triplea/http/client/github/MapRepoListing.java
deleted file mode 100644
index e0322bdef1e..00000000000
--- a/http-clients/github-client/src/main/java/org/triplea/http/client/github/MapRepoListing.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.triplea.http.client.github;
-
-import com.google.gson.annotations.SerializedName;
-import java.net.URI;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.ToString;
-
-/** Response object from Github listing the details of an organization's repositories. */
-@ToString
-@AllArgsConstructor
-@EqualsAndHashCode
-@Builder
-public class MapRepoListing {
- @SerializedName("html_url")
- String htmlUrl;
-
- @Getter String name;
-
- public URI getUri() {
- return URI.create(htmlUrl);
- }
-}
diff --git a/http-clients/github-client/src/test/java/org/triplea/http/client/github/GithubApiClientTest.java b/http-clients/github-client/src/test/java/org/triplea/http/client/github/GithubApiClientTest.java
deleted file mode 100644
index a3612cc0e72..00000000000
--- a/http-clients/github-client/src/test/java/org/triplea/http/client/github/GithubApiClientTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package org.triplea.http.client.github;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsCollectionContaining.hasItem;
-
-import com.github.tomakehurst.wiremock.WireMockServer;
-import java.net.URI;
-import java.time.Instant;
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
-import java.util.Collection;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.triplea.test.common.TestDataFileReader;
-import ru.lanwen.wiremock.ext.WiremockResolver;
-import ru.lanwen.wiremock.ext.WiremockUriResolver;
-
-@ExtendWith({WiremockResolver.class, WiremockUriResolver.class})
-class GithubApiClientTest {
-
- @Test
- void repoListing(@WiremockResolver.Wiremock final WireMockServer server) {
- stubRepoListingResponse(
- 1,
- server,
- TestDataFileReader.readContents("sample_responses/repo_listing_response_page1.json"));
- stubRepoListingResponse(
- 2,
- server,
- TestDataFileReader.readContents("sample_responses/repo_listing_response_page2.json"));
- stubRepoListingResponse(3, server, "[]");
-
- final Collection repos =
- GithubApiClient.builder()
- .org("example-org")
- .repo("map-repo")
- .uri(URI.create(server.baseUrl()))
- .build()
- .listRepositories();
-
- assertThat(repos, hasSize(3));
- assertThat(
- repos,
- hasItem(
- MapRepoListing.builder()
- .htmlUrl("https://github.com/triplea-maps/tutorial")
- .name("tutorial")
- .build()));
- assertThat(
- repos,
- hasItem(
- MapRepoListing.builder()
- .htmlUrl("https://github.com/triplea-maps/aa_enhanced_revised")
- .name("aa_enhanced_revised")
- .build()));
- assertThat(
- repos,
- hasItem(
- MapRepoListing.builder()
- .htmlUrl("https://github.com/triplea-maps/roman_invasion")
- .name("roman_invasion")
- .build()));
- }
-
- private void stubRepoListingResponse(
- final int expectedPageNumber, final WireMockServer server, final String response) {
- server.stubFor(
- get("/orgs/example-org/repos?per_page=100&page=" + expectedPageNumber)
- .willReturn(aResponse().withStatus(200).withBody(response)));
- }
-
- @Test
- @DisplayName("Invoke branches API and verify we can retrieve last commit date")
- void branchListingResponseFetchLastCommitDate(
- @WiremockResolver.Wiremock final WireMockServer server) {
- final String exampleResponse =
- TestDataFileReader.readContents("sample_responses/branch_listing_response.json");
- server.stubFor(
- get("/repos/example-org/map-repo/branches/master")
- .withHeader("Authorization", equalTo("token test-token"))
- .willReturn(aResponse().withStatus(200).withBody(exampleResponse)));
-
- final BranchInfoResponse branchInfoResponse =
- GithubApiClient.builder()
- .authToken("test-token")
- .org("example-org")
- .repo("map-repo")
- .uri(URI.create(server.baseUrl()))
- .build()
- .fetchBranchInfo("master");
-
- final Instant expectedLastCommitDate =
- LocalDateTime.of(2021, 2, 4, 19, 30, 32).atOffset(ZoneOffset.UTC).toInstant();
- assertThat(branchInfoResponse.getLastCommitDate(), is(expectedLastCommitDate));
- }
-
- @Test
- void getLatestRelease(@WiremockResolver.Wiremock final WireMockServer server) {
- final String exampleResponse =
- TestDataFileReader.readContents("sample_responses/latest_release_response.json");
- server.stubFor(
- get("/repos/example-org/map-repo/releases/latest")
- .withHeader("Authorization", equalTo("token test-token"))
- .willReturn(aResponse().withStatus(200).withBody(exampleResponse)));
-
- final String latestVersion =
- GithubApiClient.builder()
- .authToken("test-token")
- .org("example-org")
- .repo("map-repo")
- .uri(URI.create(server.baseUrl()))
- .build()
- .fetchLatestVersion()
- .orElseThrow();
-
- assertThat(latestVersion, is("2.5.22294"));
- }
-}
diff --git a/http-clients/github-client/src/test/resources/logback-test.xml b/http-clients/github-client/src/test/resources/logback-test.xml
deleted file mode 100644
index 2222e345e83..00000000000
--- a/http-clients/github-client/src/test/resources/logback-test.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- %d [%thread] %logger{36} %-5level: %msg%n
-
-
-
-
-
-
-
diff --git a/http-clients/github-client/src/test/resources/sample_responses/branch_listing_response.json b/http-clients/github-client/src/test/resources/sample_responses/branch_listing_response.json
deleted file mode 100644
index 946057635cb..00000000000
--- a/http-clients/github-client/src/test/resources/sample_responses/branch_listing_response.json
+++ /dev/null
@@ -1,97 +0,0 @@
-{
- "name": "master",
- "commit": {
- "sha": "acbae06cf21433af89be31e72acfee1995bf43f3",
- "node_id": "MDY6Q29tbWl0NTA5MTExMzU6YWNiYWUwNmNmMjE0MzNhZjg5YmUzMWU3MmFjZmVlMTk5NWJmNDNmMw==",
- "commit": {
- "author": {
- "name": "authorName",
- "email": "email@gmail.com",
- "date": "2021-02-04T19:30:32Z"
- },
- "committer": {
- "name": "authorName",
- "email": "email@gmail.com",
- "date": "2021-02-04T19:30:32Z"
- },
- "message": "Add description.html file",
- "tree": {
- "sha": "29eba65784a2ea4da212945ecbc3f147647118ea",
- "url": "https://api.github.com/repos/triplea-maps/star_wars_galactic_war/git/trees/29eba65784a2ea4da212945ecbc3f147647118ea"
- },
- "url": "https://api.github.com/repos/triplea-maps/star_wars_galactic_war/git/commits/acbae06cf21433af89be31e72acfee1995bf43f3",
- "comment_count": 0,
- "verification": {
- "verified": false,
- "reason": "unsigned",
- "signature": null,
- "payload": null
- }
- },
- "url": "https://api.github.com/repos/triplea-maps/star_wars_galactic_war/commits/acbae06cf21433af89be31e72acfee1995bf43f3",
- "html_url": "https://github.com/triplea-maps/star_wars_galactic_war/commit/acbae06cf21433af89be31e72acfee1995bf43f3",
- "comments_url": "https://api.github.com/repos/triplea-maps/star_wars_galactic_war/commits/acbae06cf21433af89be31e72acfee1995bf43f3/comments",
- "author": {
- "login": "authorName",
- "id": 12397753,
- "node_id": "MDQ6VXNlcjEyMzk3NzUz",
- "avatar_url": "https://avatars.githubusercontent.com/u/1239?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/authorName",
- "html_url": "https://github.com/authorName",
- "followers_url": "https://api.github.com/users/authorName/followers",
- "following_url": "https://api.github.com/users/authorName/following{/other_user}",
- "gists_url": "https://api.github.com/users/authorName/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/authorName/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/authorName/subscriptions",
- "organizations_url": "https://api.github.com/users/authorName/orgs",
- "repos_url": "https://api.github.com/users/authorName/repos",
- "events_url": "https://api.github.com/users/authorName/events{/privacy}",
- "received_events_url": "https://api.github.com/users/authorName/received_events",
- "type": "User",
- "site_admin": false
- },
- "committer": {
- "login": "authorName",
- "id": 12390000,
- "node_id": "MDQ6VXNlcjEyMzk3NzUz",
- "avatar_url": "https://avatars.githubusercontent.com/u/12397753?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/authorName",
- "html_url": "https://github.com/authorName",
- "followers_url": "https://api.github.com/users/authorName/followers",
- "following_url": "https://api.github.com/users/authorName/following{/other_user}",
- "gists_url": "https://api.github.com/users/authorName/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/authorName/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/authorName/subscriptions",
- "organizations_url": "https://api.github.com/users/authorName/orgs",
- "repos_url": "https://api.github.com/users/authorName/repos",
- "events_url": "https://api.github.com/users/authorName/events{/privacy}",
- "received_events_url": "https://api.github.com/users/authorName/received_events",
- "type": "User",
- "site_admin": false
- },
- "parents": [
- {
- "sha": "151fb26082cd58e5a0c997beee41011461480b9b",
- "url": "https://api.github.com/repos/triplea-maps/star_wars_galactic_war/commits/151fb26082cd58e5a0c997beee41011461480b9b",
- "html_url": "https://github.com/triplea-maps/star_wars_galactic_war/commit/151fb26082cd58e5a0c997beee41011461480b9b"
- }
- ]
- },
- "_links": {
- "self": "https://api.github.com/repos/triplea-maps/star_wars_galactic_war/branches/master",
- "html": "https://github.com/triplea-maps/star_wars_galactic_war/tree/master"
- },
- "protected": false,
- "protection": {
- "enabled": false,
- "required_status_checks": {
- "enforcement_level": "off",
- "contexts": [
-
- ]
- }
- },
- "protection_url": "https://api.github.com/repos/triplea-maps/star_wars_galactic_war/branches/master/protection"
-}
diff --git a/http-clients/github-client/src/test/resources/sample_responses/latest_release_response.json b/http-clients/github-client/src/test/resources/sample_responses/latest_release_response.json
deleted file mode 100644
index 7f6781ac27e..00000000000
--- a/http-clients/github-client/src/test/resources/sample_responses/latest_release_response.json
+++ /dev/null
@@ -1,346 +0,0 @@
-{
- "url": "https://api.github.com/repos/triplea-game/triplea/releases/33335898",
- "assets_url": "https://api.github.com/repos/triplea-game/triplea/releases/33335898/assets",
- "upload_url": "https://uploads.github.com/repos/triplea-game/triplea/releases/33335898/assets{?name,label}",
- "html_url": "https://github.com/triplea-game/triplea/releases/tag/2.5.22294",
- "id": 33335898,
- "author": {
- "login": "tripleabuilderbot",
- "id": 14932076,
- "node_id": "MDQ6VXNlcjE0OTMyMDc2",
- "avatar_url": "https://avatars.githubusercontent.com/u/14932076?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/tripleabuilderbot",
- "html_url": "https://github.com/tripleabuilderbot",
- "followers_url": "https://api.github.com/users/tripleabuilderbot/followers",
- "following_url": "https://api.github.com/users/tripleabuilderbot/following{/other_user}",
- "gists_url": "https://api.github.com/users/tripleabuilderbot/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/tripleabuilderbot/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/tripleabuilderbot/subscriptions",
- "organizations_url": "https://api.github.com/users/tripleabuilderbot/orgs",
- "repos_url": "https://api.github.com/users/tripleabuilderbot/repos",
- "events_url": "https://api.github.com/users/tripleabuilderbot/events{/privacy}",
- "received_events_url": "https://api.github.com/users/tripleabuilderbot/received_events",
- "type": "User",
- "site_admin": false
- },
- "node_id": "MDc6UmVsZWFzZTMzMzM1ODk4",
- "tag_name": "2.5.22294",
- "target_commitish": "f516043a9d4ae146de4a6305165ce3a686a92a32",
- "name": "",
- "draft": false,
- "prerelease": false,
- "created_at": "2020-11-02T05:11:01Z",
- "published_at": "2020-11-02T05:12:47Z",
- "assets": [
- {
- "url": "https://api.github.com/repos/triplea-game/triplea/releases/assets/27820580",
- "id": 27820580,
- "node_id": "MDEyOlJlbGVhc2VBc3NldDI3ODIwNTgw",
- "name": "migrations.zip",
- "label": "",
- "uploader": {
- "login": "tripleabuilderbot",
- "id": 14932076,
- "node_id": "MDQ6VXNlcjE0OTMyMDc2",
- "avatar_url": "https://avatars.githubusercontent.com/u/14932076?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/tripleabuilderbot",
- "html_url": "https://github.com/tripleabuilderbot",
- "followers_url": "https://api.github.com/users/tripleabuilderbot/followers",
- "following_url": "https://api.github.com/users/tripleabuilderbot/following{/other_user}",
- "gists_url": "https://api.github.com/users/tripleabuilderbot/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/tripleabuilderbot/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/tripleabuilderbot/subscriptions",
- "organizations_url": "https://api.github.com/users/tripleabuilderbot/orgs",
- "repos_url": "https://api.github.com/users/tripleabuilderbot/repos",
- "events_url": "https://api.github.com/users/tripleabuilderbot/events{/privacy}",
- "received_events_url": "https://api.github.com/users/tripleabuilderbot/received_events",
- "type": "User",
- "site_admin": false
- },
- "content_type": "application/zip",
- "state": "uploaded",
- "size": 7420,
- "download_count": 66,
- "created_at": "2020-11-02T05:12:44Z",
- "updated_at": "2020-11-02T05:12:45Z",
- "browser_download_url": "https://github.com/triplea-game/triplea/releases/download/2.5.22294/migrations.zip"
- },
- {
- "url": "https://api.github.com/repos/triplea-game/triplea/releases/assets/27820570",
- "id": 27820570,
- "node_id": "MDEyOlJlbGVhc2VBc3NldDI3ODIwNTcw",
- "name": "triplea-game-headed-2.5.22294.zip",
- "label": "",
- "uploader": {
- "login": "tripleabuilderbot",
- "id": 14932076,
- "node_id": "MDQ6VXNlcjE0OTMyMDc2",
- "avatar_url": "https://avatars.githubusercontent.com/u/14932076?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/tripleabuilderbot",
- "html_url": "https://github.com/tripleabuilderbot",
- "followers_url": "https://api.github.com/users/tripleabuilderbot/followers",
- "following_url": "https://api.github.com/users/tripleabuilderbot/following{/other_user}",
- "gists_url": "https://api.github.com/users/tripleabuilderbot/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/tripleabuilderbot/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/tripleabuilderbot/subscriptions",
- "organizations_url": "https://api.github.com/users/tripleabuilderbot/orgs",
- "repos_url": "https://api.github.com/users/tripleabuilderbot/repos",
- "events_url": "https://api.github.com/users/tripleabuilderbot/events{/privacy}",
- "received_events_url": "https://api.github.com/users/tripleabuilderbot/received_events",
- "type": "User",
- "site_admin": false
- },
- "content_type": "application/zip",
- "state": "uploaded",
- "size": 26094498,
- "download_count": 223,
- "created_at": "2020-11-02T05:12:25Z",
- "updated_at": "2020-11-02T05:12:26Z",
- "browser_download_url": "https://github.com/triplea-game/triplea/releases/download/2.5.22294/triplea-game-headed-2.5.22294.zip"
- },
- {
- "url": "https://api.github.com/repos/triplea-game/triplea/releases/assets/27820575",
- "id": 27820575,
- "node_id": "MDEyOlJlbGVhc2VBc3NldDI3ODIwNTc1",
- "name": "triplea-game-headless-2.5.22294.zip",
- "label": "",
- "uploader": {
- "login": "tripleabuilderbot",
- "id": 14932076,
- "node_id": "MDQ6VXNlcjE0OTMyMDc2",
- "avatar_url": "https://avatars.githubusercontent.com/u/14932076?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/tripleabuilderbot",
- "html_url": "https://github.com/tripleabuilderbot",
- "followers_url": "https://api.github.com/users/tripleabuilderbot/followers",
- "following_url": "https://api.github.com/users/tripleabuilderbot/following{/other_user}",
- "gists_url": "https://api.github.com/users/tripleabuilderbot/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/tripleabuilderbot/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/tripleabuilderbot/subscriptions",
- "organizations_url": "https://api.github.com/users/tripleabuilderbot/orgs",
- "repos_url": "https://api.github.com/users/tripleabuilderbot/repos",
- "events_url": "https://api.github.com/users/tripleabuilderbot/events{/privacy}",
- "received_events_url": "https://api.github.com/users/tripleabuilderbot/received_events",
- "type": "User",
- "site_admin": false
- },
- "content_type": "application/zip",
- "state": "uploaded",
- "size": 18797934,
- "download_count": 105,
- "created_at": "2020-11-02T05:12:38Z",
- "updated_at": "2020-11-02T05:12:41Z",
- "browser_download_url": "https://github.com/triplea-game/triplea/releases/download/2.5.22294/triplea-game-headless-2.5.22294.zip"
- },
- {
- "url": "https://api.github.com/repos/triplea-game/triplea/releases/assets/27820573",
- "id": 27820573,
- "node_id": "MDEyOlJlbGVhc2VBc3NldDI3ODIwNTcz",
- "name": "triplea-lobby-server-2.5.22294.zip",
- "label": "",
- "uploader": {
- "login": "tripleabuilderbot",
- "id": 14932076,
- "node_id": "MDQ6VXNlcjE0OTMyMDc2",
- "avatar_url": "https://avatars.githubusercontent.com/u/14932076?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/tripleabuilderbot",
- "html_url": "https://github.com/tripleabuilderbot",
- "followers_url": "https://api.github.com/users/tripleabuilderbot/followers",
- "following_url": "https://api.github.com/users/tripleabuilderbot/following{/other_user}",
- "gists_url": "https://api.github.com/users/tripleabuilderbot/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/tripleabuilderbot/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/tripleabuilderbot/subscriptions",
- "organizations_url": "https://api.github.com/users/tripleabuilderbot/orgs",
- "repos_url": "https://api.github.com/users/tripleabuilderbot/repos",
- "events_url": "https://api.github.com/users/tripleabuilderbot/events{/privacy}",
- "received_events_url": "https://api.github.com/users/tripleabuilderbot/received_events",
- "type": "User",
- "site_admin": false
- },
- "content_type": "application/zip",
- "state": "uploaded",
- "size": 23701788,
- "download_count": 55,
- "created_at": "2020-11-02T05:12:35Z",
- "updated_at": "2020-11-02T05:12:38Z",
- "browser_download_url": "https://github.com/triplea-game/triplea/releases/download/2.5.22294/triplea-lobby-server-2.5.22294.zip"
- },
- {
- "url": "https://api.github.com/repos/triplea-game/triplea/releases/assets/27820582",
- "id": 27820582,
- "node_id": "MDEyOlJlbGVhc2VBc3NldDI3ODIwNTgy",
- "name": "triplea-maps-server-2.5.22294.zip",
- "label": "",
- "uploader": {
- "login": "tripleabuilderbot",
- "id": 14932076,
- "node_id": "MDQ6VXNlcjE0OTMyMDc2",
- "avatar_url": "https://avatars.githubusercontent.com/u/14932076?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/tripleabuilderbot",
- "html_url": "https://github.com/tripleabuilderbot",
- "followers_url": "https://api.github.com/users/tripleabuilderbot/followers",
- "following_url": "https://api.github.com/users/tripleabuilderbot/following{/other_user}",
- "gists_url": "https://api.github.com/users/tripleabuilderbot/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/tripleabuilderbot/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/tripleabuilderbot/subscriptions",
- "organizations_url": "https://api.github.com/users/tripleabuilderbot/orgs",
- "repos_url": "https://api.github.com/users/tripleabuilderbot/repos",
- "events_url": "https://api.github.com/users/tripleabuilderbot/events{/privacy}",
- "received_events_url": "https://api.github.com/users/tripleabuilderbot/received_events",
- "type": "User",
- "site_admin": false
- },
- "content_type": "application/zip",
- "state": "uploaded",
- "size": 21665863,
- "download_count": 47,
- "created_at": "2020-11-02T05:12:46Z",
- "updated_at": "2020-11-02T05:12:46Z",
- "browser_download_url": "https://github.com/triplea-game/triplea/releases/download/2.5.22294/triplea-maps-server-2.5.22294.zip"
- },
- {
- "url": "https://api.github.com/repos/triplea-game/triplea/releases/assets/27820572",
- "id": 27820572,
- "node_id": "MDEyOlJlbGVhc2VBc3NldDI3ODIwNTcy",
- "name": "TripleA_2.5.22294_macos.dmg",
- "label": "",
- "uploader": {
- "login": "tripleabuilderbot",
- "id": 14932076,
- "node_id": "MDQ6VXNlcjE0OTMyMDc2",
- "avatar_url": "https://avatars.githubusercontent.com/u/14932076?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/tripleabuilderbot",
- "html_url": "https://github.com/tripleabuilderbot",
- "followers_url": "https://api.github.com/users/tripleabuilderbot/followers",
- "following_url": "https://api.github.com/users/tripleabuilderbot/following{/other_user}",
- "gists_url": "https://api.github.com/users/tripleabuilderbot/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/tripleabuilderbot/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/tripleabuilderbot/subscriptions",
- "organizations_url": "https://api.github.com/users/tripleabuilderbot/orgs",
- "repos_url": "https://api.github.com/users/tripleabuilderbot/repos",
- "events_url": "https://api.github.com/users/tripleabuilderbot/events{/privacy}",
- "received_events_url": "https://api.github.com/users/tripleabuilderbot/received_events",
- "type": "User",
- "site_admin": false
- },
- "content_type": "application/x-apple-diskimage",
- "state": "uploaded",
- "size": 58909491,
- "download_count": 6229,
- "created_at": "2020-11-02T05:12:33Z",
- "updated_at": "2020-11-02T05:12:34Z",
- "browser_download_url": "https://github.com/triplea-game/triplea/releases/download/2.5.22294/TripleA_2.5.22294_macos.dmg"
- },
- {
- "url": "https://api.github.com/repos/triplea-game/triplea/releases/assets/27820571",
- "id": 27820571,
- "node_id": "MDEyOlJlbGVhc2VBc3NldDI3ODIwNTcx",
- "name": "TripleA_2.5.22294_unix.sh",
- "label": "",
- "uploader": {
- "login": "tripleabuilderbot",
- "id": 14932076,
- "node_id": "MDQ6VXNlcjE0OTMyMDc2",
- "avatar_url": "https://avatars.githubusercontent.com/u/14932076?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/tripleabuilderbot",
- "html_url": "https://github.com/tripleabuilderbot",
- "followers_url": "https://api.github.com/users/tripleabuilderbot/followers",
- "following_url": "https://api.github.com/users/tripleabuilderbot/following{/other_user}",
- "gists_url": "https://api.github.com/users/tripleabuilderbot/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/tripleabuilderbot/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/tripleabuilderbot/subscriptions",
- "organizations_url": "https://api.github.com/users/tripleabuilderbot/orgs",
- "repos_url": "https://api.github.com/users/tripleabuilderbot/repos",
- "events_url": "https://api.github.com/users/tripleabuilderbot/events{/privacy}",
- "received_events_url": "https://api.github.com/users/tripleabuilderbot/received_events",
- "type": "User",
- "site_admin": false
- },
- "content_type": "application/x-sh",
- "state": "uploaded",
- "size": 64495298,
- "download_count": 3696,
- "created_at": "2020-11-02T05:12:28Z",
- "updated_at": "2020-11-02T05:12:32Z",
- "browser_download_url": "https://github.com/triplea-game/triplea/releases/download/2.5.22294/TripleA_2.5.22294_unix.sh"
- },
- {
- "url": "https://api.github.com/repos/triplea-game/triplea/releases/assets/27820567",
- "id": 27820567,
- "node_id": "MDEyOlJlbGVhc2VBc3NldDI3ODIwNTY3",
- "name": "TripleA_2.5.22294_windows-32bit.exe",
- "label": "",
- "uploader": {
- "login": "tripleabuilderbot",
- "id": 14932076,
- "node_id": "MDQ6VXNlcjE0OTMyMDc2",
- "avatar_url": "https://avatars.githubusercontent.com/u/14932076?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/tripleabuilderbot",
- "html_url": "https://github.com/tripleabuilderbot",
- "followers_url": "https://api.github.com/users/tripleabuilderbot/followers",
- "following_url": "https://api.github.com/users/tripleabuilderbot/following{/other_user}",
- "gists_url": "https://api.github.com/users/tripleabuilderbot/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/tripleabuilderbot/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/tripleabuilderbot/subscriptions",
- "organizations_url": "https://api.github.com/users/tripleabuilderbot/orgs",
- "repos_url": "https://api.github.com/users/tripleabuilderbot/repos",
- "events_url": "https://api.github.com/users/tripleabuilderbot/events{/privacy}",
- "received_events_url": "https://api.github.com/users/tripleabuilderbot/received_events",
- "type": "User",
- "site_admin": false
- },
- "content_type": "application/x-ms-dos-executable",
- "state": "uploaded",
- "size": 64250880,
- "download_count": 2227,
- "created_at": "2020-11-02T05:12:22Z",
- "updated_at": "2020-11-02T05:12:24Z",
- "browser_download_url": "https://github.com/triplea-game/triplea/releases/download/2.5.22294/TripleA_2.5.22294_windows-32bit.exe"
- },
- {
- "url": "https://api.github.com/repos/triplea-game/triplea/releases/assets/27820579",
- "id": 27820579,
- "node_id": "MDEyOlJlbGVhc2VBc3NldDI3ODIwNTc5",
- "name": "TripleA_2.5.22294_windows-64bit.exe",
- "label": "",
- "uploader": {
- "login": "tripleabuilderbot",
- "id": 14932076,
- "node_id": "MDQ6VXNlcjE0OTMyMDc2",
- "avatar_url": "https://avatars.githubusercontent.com/u/14932076?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/tripleabuilderbot",
- "html_url": "https://github.com/tripleabuilderbot",
- "followers_url": "https://api.github.com/users/tripleabuilderbot/followers",
- "following_url": "https://api.github.com/users/tripleabuilderbot/following{/other_user}",
- "gists_url": "https://api.github.com/users/tripleabuilderbot/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/tripleabuilderbot/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/tripleabuilderbot/subscriptions",
- "organizations_url": "https://api.github.com/users/tripleabuilderbot/orgs",
- "repos_url": "https://api.github.com/users/tripleabuilderbot/repos",
- "events_url": "https://api.github.com/users/tripleabuilderbot/events{/privacy}",
- "received_events_url": "https://api.github.com/users/tripleabuilderbot/received_events",
- "type": "User",
- "site_admin": false
- },
- "content_type": "application/x-ms-dos-executable",
- "state": "uploaded",
- "size": 63516160,
- "download_count": 30564,
- "created_at": "2020-11-02T05:12:42Z",
- "updated_at": "2020-11-02T05:12:44Z",
- "browser_download_url": "https://github.com/triplea-game/triplea/releases/download/2.5.22294/TripleA_2.5.22294_windows-64bit.exe"
- }
- ],
- "tarball_url": "https://api.github.com/repos/triplea-game/triplea/tarball/2.5.22294",
- "zipball_url": "https://api.github.com/repos/triplea-game/triplea/zipball/2.5.22294",
- "body": ""
-}
diff --git a/http-clients/github-client/src/test/resources/sample_responses/repo_listing_response_page1.json b/http-clients/github-client/src/test/resources/sample_responses/repo_listing_response_page1.json
deleted file mode 100644
index c7e33d355c3..00000000000
--- a/http-clients/github-client/src/test/resources/sample_responses/repo_listing_response_page1.json
+++ /dev/null
@@ -1,200 +0,0 @@
-[
- {
- "id": 43531223,
- "node_id": "MDEwOlJlcG9zaXRvcnk0MzUzMTIyMw==",
- "name": "tutorial",
- "full_name": "triplea-maps/tutorial",
- "private": false,
- "owner": {
- "login": "triplea-maps",
- "id": 14303309,
- "node_id": "MDEyOk9yZ2FuaXphdGlvbjE0MzAzMzA5",
- "avatar_url": "https://avatars.githubusercontent.com/u/14303309?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/triplea-maps",
- "html_url": "https://github.com/triplea-maps",
- "followers_url": "https://api.github.com/users/triplea-maps/followers",
- "following_url": "https://api.github.com/users/triplea-maps/following{/other_user}",
- "gists_url": "https://api.github.com/users/triplea-maps/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/triplea-maps/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/triplea-maps/subscriptions",
- "organizations_url": "https://api.github.com/users/triplea-maps/orgs",
- "repos_url": "https://api.github.com/users/triplea-maps/repos",
- "events_url": "https://api.github.com/users/triplea-maps/events{/privacy}",
- "received_events_url": "https://api.github.com/users/triplea-maps/received_events",
- "type": "Organization",
- "site_admin": false
- },
- "html_url": "https://github.com/triplea-maps/tutorial",
- "description": null,
- "fork": false,
- "url": "https://api.github.com/repos/triplea-maps/tutorial",
- "forks_url": "https://api.github.com/repos/triplea-maps/tutorial/forks",
- "keys_url": "https://api.github.com/repos/triplea-maps/tutorial/keys{/key_id}",
- "collaborators_url": "https://api.github.com/repos/triplea-maps/tutorial/collaborators{/collaborator}",
- "teams_url": "https://api.github.com/repos/triplea-maps/tutorial/teams",
- "hooks_url": "https://api.github.com/repos/triplea-maps/tutorial/hooks",
- "issue_events_url": "https://api.github.com/repos/triplea-maps/tutorial/issues/events{/number}",
- "events_url": "https://api.github.com/repos/triplea-maps/tutorial/events",
- "assignees_url": "https://api.github.com/repos/triplea-maps/tutorial/assignees{/user}",
- "branches_url": "https://api.github.com/repos/triplea-maps/tutorial/branches{/branch}",
- "tags_url": "https://api.github.com/repos/triplea-maps/tutorial/tags",
- "blobs_url": "https://api.github.com/repos/triplea-maps/tutorial/git/blobs{/sha}",
- "git_tags_url": "https://api.github.com/repos/triplea-maps/tutorial/git/tags{/sha}",
- "git_refs_url": "https://api.github.com/repos/triplea-maps/tutorial/git/refs{/sha}",
- "trees_url": "https://api.github.com/repos/triplea-maps/tutorial/git/trees{/sha}",
- "statuses_url": "https://api.github.com/repos/triplea-maps/tutorial/statuses/{sha}",
- "languages_url": "https://api.github.com/repos/triplea-maps/tutorial/languages",
- "stargazers_url": "https://api.github.com/repos/triplea-maps/tutorial/stargazers",
- "contributors_url": "https://api.github.com/repos/triplea-maps/tutorial/contributors",
- "subscribers_url": "https://api.github.com/repos/triplea-maps/tutorial/subscribers",
- "subscription_url": "https://api.github.com/repos/triplea-maps/tutorial/subscription",
- "commits_url": "https://api.github.com/repos/triplea-maps/tutorial/commits{/sha}",
- "git_commits_url": "https://api.github.com/repos/triplea-maps/tutorial/git/commits{/sha}",
- "comments_url": "https://api.github.com/repos/triplea-maps/tutorial/comments{/number}",
- "issue_comment_url": "https://api.github.com/repos/triplea-maps/tutorial/issues/comments{/number}",
- "contents_url": "https://api.github.com/repos/triplea-maps/tutorial/contents/{+path}",
- "compare_url": "https://api.github.com/repos/triplea-maps/tutorial/compare/{base}...{head}",
- "merges_url": "https://api.github.com/repos/triplea-maps/tutorial/merges",
- "archive_url": "https://api.github.com/repos/triplea-maps/tutorial/{archive_format}{/ref}",
- "downloads_url": "https://api.github.com/repos/triplea-maps/tutorial/downloads",
- "issues_url": "https://api.github.com/repos/triplea-maps/tutorial/issues{/number}",
- "pulls_url": "https://api.github.com/repos/triplea-maps/tutorial/pulls{/number}",
- "milestones_url": "https://api.github.com/repos/triplea-maps/tutorial/milestones{/number}",
- "notifications_url": "https://api.github.com/repos/triplea-maps/tutorial/notifications{?since,all,participating}",
- "labels_url": "https://api.github.com/repos/triplea-maps/tutorial/labels{/name}",
- "releases_url": "https://api.github.com/repos/triplea-maps/tutorial/releases{/id}",
- "deployments_url": "https://api.github.com/repos/triplea-maps/tutorial/deployments",
- "created_at": "2015-10-02T01:54:08Z",
- "updated_at": "2021-02-04T19:31:35Z",
- "pushed_at": "2021-02-04T19:31:31Z",
- "git_url": "git://github.com/triplea-maps/tutorial.git",
- "ssh_url": "git@github.com:triplea-maps/tutorial.git",
- "clone_url": "https://github.com/triplea-maps/tutorial.git",
- "svn_url": "https://github.com/triplea-maps/tutorial",
- "homepage": null,
- "size": 45829,
- "stargazers_count": 0,
- "watchers_count": 0,
- "language": "HTML",
- "has_issues": true,
- "has_projects": true,
- "has_downloads": true,
- "has_wiki": true,
- "has_pages": false,
- "forks_count": 1,
- "mirror_url": null,
- "archived": false,
- "disabled": false,
- "open_issues_count": 0,
- "license": null,
- "forks": 1,
- "open_issues": 0,
- "watchers": 0,
- "default_branch": "master",
- "permissions": {
- "admin": false,
- "push": false,
- "pull": true
- }
- },
- {
- "id": 50909601,
- "node_id": "MDEwOlJlcG9zaXRvcnk1MDkwOTYwMQ==",
- "name": "aa_enhanced_revised",
- "full_name": "triplea-maps/aa_enhanced_revised",
- "private": false,
- "owner": {
- "login": "triplea-maps",
- "id": 14303309,
- "node_id": "MDEyOk9yZ2FuaXphdGlvbjE0MzAzMzA5",
- "avatar_url": "https://avatars.githubusercontent.com/u/14303309?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/triplea-maps",
- "html_url": "https://github.com/triplea-maps",
- "followers_url": "https://api.github.com/users/triplea-maps/followers",
- "following_url": "https://api.github.com/users/triplea-maps/following{/other_user}",
- "gists_url": "https://api.github.com/users/triplea-maps/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/triplea-maps/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/triplea-maps/subscriptions",
- "organizations_url": "https://api.github.com/users/triplea-maps/orgs",
- "repos_url": "https://api.github.com/users/triplea-maps/repos",
- "events_url": "https://api.github.com/users/triplea-maps/events{/privacy}",
- "received_events_url": "https://api.github.com/users/triplea-maps/received_events",
- "type": "Organization",
- "site_admin": false
- },
- "html_url": "https://github.com/triplea-maps/aa_enhanced_revised",
- "description": null,
- "fork": false,
- "url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised",
- "forks_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/forks",
- "keys_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/keys{/key_id}",
- "collaborators_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/collaborators{/collaborator}",
- "teams_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/teams",
- "hooks_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/hooks",
- "issue_events_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/issues/events{/number}",
- "events_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/events",
- "assignees_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/assignees{/user}",
- "branches_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/branches{/branch}",
- "tags_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/tags",
- "blobs_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/git/blobs{/sha}",
- "git_tags_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/git/tags{/sha}",
- "git_refs_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/git/refs{/sha}",
- "trees_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/git/trees{/sha}",
- "statuses_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/statuses/{sha}",
- "languages_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/languages",
- "stargazers_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/stargazers",
- "contributors_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/contributors",
- "subscribers_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/subscribers",
- "subscription_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/subscription",
- "commits_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/commits{/sha}",
- "git_commits_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/git/commits{/sha}",
- "comments_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/comments{/number}",
- "issue_comment_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/issues/comments{/number}",
- "contents_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/contents/{+path}",
- "compare_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/compare/{base}...{head}",
- "merges_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/merges",
- "archive_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/{archive_format}{/ref}",
- "downloads_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/downloads",
- "issues_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/issues{/number}",
- "pulls_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/pulls{/number}",
- "milestones_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/milestones{/number}",
- "notifications_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/notifications{?since,all,participating}",
- "labels_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/labels{/name}",
- "releases_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/releases{/id}",
- "deployments_url": "https://api.github.com/repos/triplea-maps/aa_enhanced_revised/deployments",
- "created_at": "2016-02-02T09:33:26Z",
- "updated_at": "2016-02-02T09:33:26Z",
- "pushed_at": "2017-12-14T04:37:33Z",
- "git_url": "git://github.com/triplea-maps/aa_enhanced_revised.git",
- "ssh_url": "git@github.com:triplea-maps/aa_enhanced_revised.git",
- "clone_url": "https://github.com/triplea-maps/aa_enhanced_revised.git",
- "svn_url": "https://github.com/triplea-maps/aa_enhanced_revised",
- "homepage": null,
- "size": 380,
- "stargazers_count": 0,
- "watchers_count": 0,
- "language": null,
- "has_issues": true,
- "has_projects": true,
- "has_downloads": true,
- "has_wiki": true,
- "has_pages": false,
- "forks_count": 0,
- "mirror_url": null,
- "archived": false,
- "disabled": false,
- "open_issues_count": 0,
- "license": null,
- "forks": 0,
- "open_issues": 0,
- "watchers": 0,
- "default_branch": "master",
- "permissions": {
- "admin": false,
- "push": false,
- "pull": true
- }
- }
-]
diff --git a/http-clients/github-client/src/test/resources/sample_responses/repo_listing_response_page2.json b/http-clients/github-client/src/test/resources/sample_responses/repo_listing_response_page2.json
deleted file mode 100644
index 01ca1b9cc5f..00000000000
--- a/http-clients/github-client/src/test/resources/sample_responses/repo_listing_response_page2.json
+++ /dev/null
@@ -1,101 +0,0 @@
-[
- {
- "id": 50909644,
- "node_id": "MDEwOlJlcG9zaXRvcnk1MDkwOTY0NA==",
- "name": "roman_invasion",
- "full_name": "triplea-maps/roman_invasion",
- "private": false,
- "owner": {
- "login": "triplea-maps",
- "id": 14303309,
- "node_id": "MDEyOk9yZ2FuaXphdGlvbjE0MzAzMzA5",
- "avatar_url": "https://avatars.githubusercontent.com/u/14303309?v=4",
- "gravatar_id": "",
- "url": "https://api.github.com/users/triplea-maps",
- "html_url": "https://github.com/triplea-maps",
- "followers_url": "https://api.github.com/users/triplea-maps/followers",
- "following_url": "https://api.github.com/users/triplea-maps/following{/other_user}",
- "gists_url": "https://api.github.com/users/triplea-maps/gists{/gist_id}",
- "starred_url": "https://api.github.com/users/triplea-maps/starred{/owner}{/repo}",
- "subscriptions_url": "https://api.github.com/users/triplea-maps/subscriptions",
- "organizations_url": "https://api.github.com/users/triplea-maps/orgs",
- "repos_url": "https://api.github.com/users/triplea-maps/repos",
- "events_url": "https://api.github.com/users/triplea-maps/events{/privacy}",
- "received_events_url": "https://api.github.com/users/triplea-maps/received_events",
- "type": "Organization",
- "site_admin": false
- },
- "html_url": "https://github.com/triplea-maps/roman_invasion",
- "description": null,
- "fork": false,
- "url": "https://api.github.com/repos/triplea-maps/roman_invasion",
- "forks_url": "https://api.github.com/repos/triplea-maps/roman_invasion/forks",
- "keys_url": "https://api.github.com/repos/triplea-maps/roman_invasion/keys{/key_id}",
- "collaborators_url": "https://api.github.com/repos/triplea-maps/roman_invasion/collaborators{/collaborator}",
- "teams_url": "https://api.github.com/repos/triplea-maps/roman_invasion/teams",
- "hooks_url": "https://api.github.com/repos/triplea-maps/roman_invasion/hooks",
- "issue_events_url": "https://api.github.com/repos/triplea-maps/roman_invasion/issues/events{/number}",
- "events_url": "https://api.github.com/repos/triplea-maps/roman_invasion/events",
- "assignees_url": "https://api.github.com/repos/triplea-maps/roman_invasion/assignees{/user}",
- "branches_url": "https://api.github.com/repos/triplea-maps/roman_invasion/branches{/branch}",
- "tags_url": "https://api.github.com/repos/triplea-maps/roman_invasion/tags",
- "blobs_url": "https://api.github.com/repos/triplea-maps/roman_invasion/git/blobs{/sha}",
- "git_tags_url": "https://api.github.com/repos/triplea-maps/roman_invasion/git/tags{/sha}",
- "git_refs_url": "https://api.github.com/repos/triplea-maps/roman_invasion/git/refs{/sha}",
- "trees_url": "https://api.github.com/repos/triplea-maps/roman_invasion/git/trees{/sha}",
- "statuses_url": "https://api.github.com/repos/triplea-maps/roman_invasion/statuses/{sha}",
- "languages_url": "https://api.github.com/repos/triplea-maps/roman_invasion/languages",
- "stargazers_url": "https://api.github.com/repos/triplea-maps/roman_invasion/stargazers",
- "contributors_url": "https://api.github.com/repos/triplea-maps/roman_invasion/contributors",
- "subscribers_url": "https://api.github.com/repos/triplea-maps/roman_invasion/subscribers",
- "subscription_url": "https://api.github.com/repos/triplea-maps/roman_invasion/subscription",
- "commits_url": "https://api.github.com/repos/triplea-maps/roman_invasion/commits{/sha}",
- "git_commits_url": "https://api.github.com/repos/triplea-maps/roman_invasion/git/commits{/sha}",
- "comments_url": "https://api.github.com/repos/triplea-maps/roman_invasion/comments{/number}",
- "issue_comment_url": "https://api.github.com/repos/triplea-maps/roman_invasion/issues/comments{/number}",
- "contents_url": "https://api.github.com/repos/triplea-maps/roman_invasion/contents/{+path}",
- "compare_url": "https://api.github.com/repos/triplea-maps/roman_invasion/compare/{base}...{head}",
- "merges_url": "https://api.github.com/repos/triplea-maps/roman_invasion/merges",
- "archive_url": "https://api.github.com/repos/triplea-maps/roman_invasion/{archive_format}{/ref}",
- "downloads_url": "https://api.github.com/repos/triplea-maps/roman_invasion/downloads",
- "issues_url": "https://api.github.com/repos/triplea-maps/roman_invasion/issues{/number}",
- "pulls_url": "https://api.github.com/repos/triplea-maps/roman_invasion/pulls{/number}",
- "milestones_url": "https://api.github.com/repos/triplea-maps/roman_invasion/milestones{/number}",
- "notifications_url": "https://api.github.com/repos/triplea-maps/roman_invasion/notifications{?since,all,participating}",
- "labels_url": "https://api.github.com/repos/triplea-maps/roman_invasion/labels{/name}",
- "releases_url": "https://api.github.com/repos/triplea-maps/roman_invasion/releases{/id}",
- "deployments_url": "https://api.github.com/repos/triplea-maps/roman_invasion/deployments",
- "created_at": "2016-02-02T09:33:59Z",
- "updated_at": "2016-02-02T09:33:59Z",
- "pushed_at": "2017-12-14T04:28:01Z",
- "git_url": "git://github.com/triplea-maps/roman_invasion.git",
- "ssh_url": "git@github.com:triplea-maps/roman_invasion.git",
- "clone_url": "https://github.com/triplea-maps/roman_invasion.git",
- "svn_url": "https://github.com/triplea-maps/roman_invasion",
- "homepage": null,
- "size": 512,
- "stargazers_count": 0,
- "watchers_count": 0,
- "language": null,
- "has_issues": true,
- "has_projects": true,
- "has_downloads": true,
- "has_wiki": true,
- "has_pages": false,
- "forks_count": 0,
- "mirror_url": null,
- "archived": false,
- "disabled": false,
- "open_issues_count": 0,
- "license": null,
- "forks": 0,
- "open_issues": 0,
- "watchers": 0,
- "default_branch": "master",
- "permissions": {
- "admin": false,
- "push": false,
- "pull": true
- }
- }
-]
diff --git a/servers/maps/client/build.gradle b/http-clients/maps-server/build.gradle
similarity index 100%
rename from servers/maps/client/build.gradle
rename to http-clients/maps-server/build.gradle
diff --git a/servers/maps/client/src/main/java/org/triplea/http/client/maps/admin/MapTagAdminClient.java b/http-clients/maps-server/src/main/java/org/triplea/http/client/maps/admin/MapTagAdminClient.java
similarity index 100%
rename from servers/maps/client/src/main/java/org/triplea/http/client/maps/admin/MapTagAdminClient.java
rename to http-clients/maps-server/src/main/java/org/triplea/http/client/maps/admin/MapTagAdminClient.java
diff --git a/servers/maps/client/src/main/java/org/triplea/http/client/maps/admin/MapTagMetaData.java b/http-clients/maps-server/src/main/java/org/triplea/http/client/maps/admin/MapTagMetaData.java
similarity index 100%
rename from servers/maps/client/src/main/java/org/triplea/http/client/maps/admin/MapTagMetaData.java
rename to http-clients/maps-server/src/main/java/org/triplea/http/client/maps/admin/MapTagMetaData.java
diff --git a/servers/maps/client/src/main/java/org/triplea/http/client/maps/admin/UpdateMapTagRequest.java b/http-clients/maps-server/src/main/java/org/triplea/http/client/maps/admin/UpdateMapTagRequest.java
similarity index 100%
rename from servers/maps/client/src/main/java/org/triplea/http/client/maps/admin/UpdateMapTagRequest.java
rename to http-clients/maps-server/src/main/java/org/triplea/http/client/maps/admin/UpdateMapTagRequest.java
diff --git a/servers/maps/client/src/main/java/org/triplea/http/client/maps/listing/MapDownloadItem.java b/http-clients/maps-server/src/main/java/org/triplea/http/client/maps/listing/MapDownloadItem.java
similarity index 100%
rename from servers/maps/client/src/main/java/org/triplea/http/client/maps/listing/MapDownloadItem.java
rename to http-clients/maps-server/src/main/java/org/triplea/http/client/maps/listing/MapDownloadItem.java
diff --git a/servers/maps/client/src/main/java/org/triplea/http/client/maps/listing/MapTag.java b/http-clients/maps-server/src/main/java/org/triplea/http/client/maps/listing/MapTag.java
similarity index 100%
rename from servers/maps/client/src/main/java/org/triplea/http/client/maps/listing/MapTag.java
rename to http-clients/maps-server/src/main/java/org/triplea/http/client/maps/listing/MapTag.java
diff --git a/servers/maps/client/src/main/java/org/triplea/http/client/maps/listing/MapsClient.java b/http-clients/maps-server/src/main/java/org/triplea/http/client/maps/listing/MapsClient.java
similarity index 100%
rename from servers/maps/client/src/main/java/org/triplea/http/client/maps/listing/MapsClient.java
rename to http-clients/maps-server/src/main/java/org/triplea/http/client/maps/listing/MapsClient.java
diff --git a/infrastructure/.gitignore b/infrastructure/.gitignore
deleted file mode 100644
index d9655d9be40..00000000000
--- a/infrastructure/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-vagrant/.vagrant
-.ansible
-*-console.log
-ansible/*.retry
-**/*.jar
-**/*.zip
-ansible/roles/database/flyway/files/
-
-vault_password
-secret
-.include/mitogen-0.2.9
diff --git a/infrastructure/.include/build_latest_artifacts b/infrastructure/.include/build_latest_artifacts
deleted file mode 100755
index 4a6580edce0..00000000000
--- a/infrastructure/.include/build_latest_artifacts
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-
-# This script builds deployment artifacts from source and moves
-# those artifacts to ansible 'file' locations where they are then
-# available to ansible.
-
-scriptDir="$(dirname "$0")"
-rootDir="$scriptDir/../.."
-
-MIGRATIONS_ZIP="$rootDir/spitfire-server/database/build/artifacts/migrations.zip"
-LOBBY_SERVER_ZIP="$rootDir/spitfire-server/dropwizard-server/build/artifacts/triplea-dropwizard-server.zip"
-BOT_ZIP="$rootDir/game-app/game-headless/build/artifacts/triplea-game-headless.zip"
-
-
-function main() {
- buildArtifacts
- copyBuildArtifacts
-}
-
-function buildArtifacts() {
- (
- cd "$rootDir" || exit 1
-
- ./gradlew \
- :spitfire-server:dropwizard-server:release \
- :game-app:game-headless:release \
- :spitfire-server:database:release
- set +x
- )
-}
-
-function copyBuildArtifacts() {
- copyBuildArtifact "$MIGRATIONS_ZIP" "$scriptDir/../ansible/roles/lobby_server/files/"
- copyBuildArtifact "$LOBBY_SERVER_ZIP" "$scriptDir/../ansible/roles/lobby_server/files/"
- copyBuildArtifact "$BOT_ZIP" "$scriptDir/../ansible/roles/bot/files/"
-}
-
-function copyBuildArtifact() {
- local -r artifactSource="$1"
- local -r artifactDestinationPath="$2"
-
- if [ ! -f "$artifactSource" ]; then
- echo "Error: File does not exist: $artifactSource"
- exit 1
- fi
-
- mkdir -p "$artifactDestinationPath"
- cp -v "$artifactSource" "$artifactDestinationPath"
-}
-
-main
-
diff --git a/infrastructure/README.md b/infrastructure/README.md
deleted file mode 100644
index 834e40e9ec6..00000000000
--- a/infrastructure/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Infrastructure Project
-
-See: [/docs/infrastructure/README.md](/docs/infrastructure/README.md)
-
diff --git a/infrastructure/ansible.cfg b/infrastructure/ansible.cfg
deleted file mode 100644
index bf0d3f87e57..00000000000
--- a/infrastructure/ansible.cfg
+++ /dev/null
@@ -1,25 +0,0 @@
-# For example with defaults:
-# https://raw.githubusercontent.com/ansible/ansible/devel/examples/ansible.cfg
-
-[defaults]
-host_key_checking = False
-forks = 10
-serial = 100%
-gathering = explicit
-remote_user = root
-stdout_callback = yaml
-# Use the stdout_callback when running ad-hoc commands.
-bin_ansible_callbacks = True
-# timeout updates the value of ansible_ssh_timeout, default is 10
-timeout = 30
-
-[ssh_connection]
-pipelining = True
-control_path = /tmp/ansible-ssh-%%h-%%p-%%r
-ControlMaster = auto
-ssh_args = -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
-retries = 10
-
-[privilege_escalation]
-become = true
-
diff --git a/infrastructure/ansible/group_vars/all.yml b/infrastructure/ansible/group_vars/all.yml
deleted file mode 100644
index 05a3dfbdfb1..00000000000
--- a/infrastructure/ansible/group_vars/all.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-# These variables are used across multiple roles.
-# Other than these variables, roles should be fully self-contained.
-
-ansible_connection: ssh
-admin_user: "admin"
-admin_home: "/home/{{ admin_user }}"
-ansible_python_interpreter: /usr/bin/python3
diff --git a/infrastructure/ansible/group_vars/prod.yml b/infrastructure/ansible/group_vars/prod.yml
deleted file mode 100644
index 9053fb802c4..00000000000
--- a/infrastructure/ansible/group_vars/prod.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-bot_numbers: ["01", "02", "03", "04" ]
-lobby_restart_on_new_deployment: false
-lobby_uri: "https://prod.triplea-game.org"
-
-lobby_cert_folder: /etc/letsencrypt/live/{{ inventory_hostname }}
-lobby_public_cert_file: "{{ lobby_cert_folder }}/fullchain.pem"
-lobby_private_key_file: "{{ lobby_cert_folder }}/privkey.pem"
-
-nginx_generate_dhparam: true
-nginx_generate_self_signed_cert: false
-
-lobby_db_password: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 64336166636636343330663935383339363337313233333664333134346237306364386430633437
- 3236386138623863353330316436333964366335396439310a313132613436663263363832663834
- 39623766333661383435353431353763653431333563333663343563396433343135653134646333
- 3132393065333230360a363765346461636364373534373433373730666637636564363364343438
- 37353238616531613237363562386263666331316537613538373062363639633565316434373463
- 34613939313561363439326231663830613162353066326239373664383262306432636534306135
- 32643830353366353762303935363033613262616661313834636237663632636332326130623864
- 36613339633764366632326330376633363161373637313039373232643436356232626165666566
- 3238
-
-github_api_token: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 65323936623766656635643265383735633030653862386133316139303734636535643838383432
- 6530313938633736376438313764316536326632386634650a633363333737353538643031353861
- 38663362313632336135623530646663306132383436343038303630313465316236646535303938
- 6164623232346230660a393037366339633362346535363265306235326536366663616637383332
- 34366634336163366264333430666665333931323139383966373232333562333032333665373964
- 6236643330633934373632306366303231303762353537613438
diff --git a/infrastructure/ansible/group_vars/vagrant_local.yml b/infrastructure/ansible/group_vars/vagrant_local.yml
deleted file mode 100644
index 58a733455e9..00000000000
--- a/infrastructure/ansible/group_vars/vagrant_local.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-bot_numbers: ["01", "02" ]
-lobby_restart_on_new_deployment: false
-lobby_uri: "http://localhost:8080"
-nginx_generate_dhparam: false
-nginx_generate_self_signed_cert: true
-
-lobby_cert_folder: /etc/nginx/certs
-lobby_public_cert_file: "{{ lobby_cert_folder }}/cert.crt"
-lobby_private_key_file: "{{ lobby_cert_folder }}/cert.key"
-
-lobby_db_password: "lobby"
-github_api_token: "test"
-
diff --git a/infrastructure/ansible/inventory/production b/infrastructure/ansible/inventory/production
deleted file mode 100644
index b7ec777ac50..00000000000
--- a/infrastructure/ansible/inventory/production
+++ /dev/null
@@ -1,17 +0,0 @@
-[forums]
-forums.triplea-game.org
-
-[lobbyServer]
-prod.triplea-game.org reverse_proxy_server_name=prod.triplea-game.org
-
-[botHosts]
-prod2-bot02.triplea-game.org bot_number=2 bot_location_city_name=Atlanta
-prod2-bot04.triplea-game.org bot_number=4 bot_location_city_name=Atlanta
-prod2-bot06.triplea-game.org bot_number=6 bot_location_city_name=California
-prod2-bot07.triplea-game.org bot_number=7 bot_location_city_name=Jersey
-prod2-bot09.triplea-game.org bot_number=9 bot_location_city_name=Frankfurt
-
-[prod:children]
-lobbyServer
-botHosts
-
diff --git a/infrastructure/ansible/inventory/vagrant b/infrastructure/ansible/inventory/vagrant
deleted file mode 100644
index 0d8a19a6763..00000000000
--- a/infrastructure/ansible/inventory/vagrant
+++ /dev/null
@@ -1,12 +0,0 @@
-[vagrant_local]
-vagrant ansible_become=true ansible_ssh_user=vagrant ansible_user=vagrant ansible_host=127.0.0.1 ansible_port=2010 ansible_ssh_private_key_file=vagrant/.vagrant/machines/vagrantHost/virtualbox/private_key
-
-[lobbyServer:children]
-vagrant_local
-
-[mapsServer:children]
-vagrant_local
-
-[botHosts:children]
-vagrant_local
-
diff --git a/infrastructure/ansible/roles/bot/README.md b/infrastructure/ansible/roles/bot/README.md
deleted file mode 100644
index ad8abe48e0b..00000000000
--- a/infrastructure/ansible/roles/bot/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Deploys automated host java server and connects up to the lobby.
diff --git a/infrastructure/ansible/roles/bot/defaults/main.yml b/infrastructure/ansible/roles/bot/defaults/main.yml
deleted file mode 100644
index d328c31dbb0..00000000000
--- a/infrastructure/ansible/roles/bot/defaults/main.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-bot_user: "bot"
-bot_folder: "/opt/bot"
-bot_version: "2.5"
-
-bot_zip_file_url: "https://github.com/triplea-game/triplea/releases/download/2.5.22294/triplea-game-headless-2.5.22294.zip"
-
-# The location where we will install the bot binaries
-bot_install_home: "{{ bot_folder }}/{{ bot_version }}"
-
-# The location of the jar executable that we will run to launch the bot server.
-bot_jar: "{{ bot_install_home }}/bin/triplea-game-headless-2.5.22294.jar"
-
-# A folder where the bot server will find maps.
-bot_maps_folder: "{{ bot_folder }}/maps"
-
-# The URI of the lobby that the bot would connect to.
-bot_lobby_uri: "{{ lobby_uri }}"
-
-bot_max_memory: "196m"
-
-# Each bot number matches a bot instance that will be deployed and started.
-bot_numbers: ["01", "02", "03", "04" ]
-
-# The location of the server, should be a city name
-bot_location_city_name: ""
-
-# The number of the bot server, should be globally unique
-bot_number: 0
-
-# When set to true, all maps on the bot server will be updated (overwritten).
-update_maps: false
-
diff --git a/infrastructure/ansible/roles/bot/tasks/main.yml b/infrastructure/ansible/roles/bot/tasks/main.yml
deleted file mode 100644
index 5f26f4b7dbf..00000000000
--- a/infrastructure/ansible/roles/bot/tasks/main.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-- name: assert vars are set
- assert:
- that:
- - bot_number > 0
- - bot_location_city_name != ""
-
-- name: allow ports
- ufw:
- rule: allow
- port: "40{{ item }}"
- proto: tcp
- with_items: "{{ bot_numbers }}"
-
-- name: create service user to run the app
- user:
- name: "{{ bot_user }}"
- create_home: no
- system: yes
-
-- name: deploy scripts to admin home
- template:
- src: "{{ item }}.j2"
- dest: "{{ admin_home }}/{{ item }}"
- owner: "{{ admin_user }}"
- group: "{{ admin_user }}"
- mode: "0755"
- with_items:
- - start-all
- - stop-all
- - download-all-maps
-
-- name: create folders
- file:
- state: directory
- path: "{{ item }}"
- mode: "0755"
- owner: "{{ bot_user }}"
- group: "{{ bot_user }}"
- with_items:
- - "{{ bot_folder }}"
- - "{{ bot_install_home }}"
- - "{{ bot_maps_folder }}"
-
-- name: Download Bot Zip File
- register: bot_zip_file_download
- get_url:
- url: "{{ bot_zip_file_url }}"
- dest: "{{ bot_install_home }}"
- mode: "0644"
- checksum: "md5:e83a688423c2441a5f3a89f2db0b8993"
- owner: "{{ bot_user }}"
- group: "{{ bot_user }}"
-
-- name: extract zip file
- when: bot_zip_file_download.changed
- unarchive:
- remote_src: yes
- src: "{{ bot_install_home }}/triplea-game-headless-2.5.22294.zip"
- dest: "{{ bot_install_home }}/"
- owner: "{{ bot_user }}"
- group: "{{ bot_user }}"
-
-- name: create triplea-root touch file
- file:
- state: touch
- path: "{{ bot_install_home }}/.triplea-root"
- mode: "0644"
- owner: "{{ bot_user }}"
- group: "{{ bot_user }}"
-
-- name: ensure logging folder /var/log/triplea exists
- file:
- path: /var/log/triplea
- state: directory
- mode: "0755"
- owner: syslog
- group: adm
-
-- name: deploy rsyslog config files to send log output from syslog to files
- register: bot_rsyslog_conf
- template:
- src: bot-rsyslog.conf
- dest: /etc/rsyslog.d/bot{{ item }}.conf
- mode: "0644"
- owner: root
- group: root
- with_items: "{{ bot_numbers }}"
-
-- name: restart rsyslog to pick up any config changes
- when: bot_rsyslog_conf.changed
- service:
- name: rsyslog
- state: restarted
-
-- name: install systemd service script
- register: bot_service
- template:
- src: bot.service.j2
- dest: /lib/systemd/system/bot@.service
- mode: "644"
-
-- name: reload systemd configurations
- when: bot_service.changed
- systemd:
- daemon_reload: yes
-
-- name: enable and ensure bots are started
- service:
- name: "bot@{{ item }}"
- state: started
- enabled: yes
- with_items: "{{ bot_numbers }}"
diff --git a/infrastructure/ansible/roles/bot/templates/bot-rsyslog.conf b/infrastructure/ansible/roles/bot/templates/bot-rsyslog.conf
deleted file mode 100644
index 452900d31ad..00000000000
--- a/infrastructure/ansible/roles/bot/templates/bot-rsyslog.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-if $programname == 'bot{{ item }}' then /var/log/triplea/bot{{ item }}.log
-& stop
-
diff --git a/infrastructure/ansible/roles/bot/templates/bot.service.j2 b/infrastructure/ansible/roles/bot/templates/bot.service.j2
deleted file mode 100644
index 64c2647b43f..00000000000
--- a/infrastructure/ansible/roles/bot/templates/bot.service.j2
+++ /dev/null
@@ -1,26 +0,0 @@
-[Unit]
-Description=TripleA Bot %i
-Documentation=
-
-[Service]
-WorkingDirectory={{ bot_install_home }}
-User={{ bot_user }}
-Group={{ bot_user }}
-ExecStart=java -server \
- -Xmx{{ bot_max_memory }} \
- -Xss1250K \
- -Djava.awt.headless=true \
- -jar {{ bot_jar }} \
- -Ptriplea.port="40%i" \
- -Ptriplea.name="Bot{{ bot_number }}%i_{{ bot_location_city_name }}" \
- -Ptriplea.lobby.uri="{{ bot_lobby_uri }}" \
- -Ptriplea.map.folder="{{ bot_maps_folder }}"
-Restart=always
-
-StandardOutput=syslog
-StandardError=syslog
-SyslogIdentifier=bot%i
-
-
-[Install]
-WantedBy=multi-user.target
diff --git a/infrastructure/ansible/roles/bot/templates/download-all-maps.j2 b/infrastructure/ansible/roles/bot/templates/download-all-maps.j2
deleted file mode 100644
index 72bf42f8631..00000000000
--- a/infrastructure/ansible/roles/bot/templates/download-all-maps.j2
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-# This script will download all maps to a bot server
-
-sudo -u "{{ bot_user }}" mkdir -p "{{ bot_maps_folder }}"
-cd "{{ bot_maps_folder }}"
-for j in 1 2; do
- while read mapRepo; do
- downloadFile="$(echo $mapRepo | sed 's|.*/||')-master.zip"
- sudo -u "{{ bot_user }}" wget -O "$downloadFile" "https://github.com/$mapRepo/archive/master.zip"
- done < <(curl --silent "https://api.github.com/orgs/triplea-maps/repos?page=$j&per_page=1000" \
- | grep full_name | sed 's/.*: "//' | sed 's/",$//')
-done
diff --git a/infrastructure/ansible/roles/bot/templates/start-all.j2 b/infrastructure/ansible/roles/bot/templates/start-all.j2
deleted file mode 100644
index 3da4402d827..00000000000
--- a/infrastructure/ansible/roles/bot/templates/start-all.j2
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-sudo systemctl daemon-reload
-
-{% for item in bot_numbers %}
-sudo systemctl start bot@{{ item }}
-{% endfor %}
diff --git a/infrastructure/ansible/roles/bot/templates/stop-all.j2 b/infrastructure/ansible/roles/bot/templates/stop-all.j2
deleted file mode 100644
index f1008f81f14..00000000000
--- a/infrastructure/ansible/roles/bot/templates/stop-all.j2
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-{% for item in bot_numbers %}
-sudo systemctl stop bot@{{ item }}
-{% endfor %}
diff --git a/infrastructure/ansible/roles/database/flyway/install/README.md b/infrastructure/ansible/roles/database/flyway/install/README.md
deleted file mode 100644
index f07eee80ec6..00000000000
--- a/infrastructure/ansible/roles/database/flyway/install/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-## Flyway Quick Overview
-Flyway is a database migration utility. We define a set of 'changeset' files that contain SQL commands,
-the changeset files are executed by flyway in order. Flyway keeps tracking tables to know which
-changesets have been executed and it does not re-execute changesets. Flyway also computes a md5 hash
-of changeset files and will halt if existing changesets have been modified (deleting the md5 value
-will tell flyway to recompute the md5 of a file and execute any new changesets. In general avoid
-modifying existing changeset files).
-
-## Flyway Role
- - Downloads flyway executable
- - Downloads changeset files
- - Executes changesets
diff --git a/infrastructure/ansible/roles/database/flyway/install/defaults/main.yml b/infrastructure/ansible/roles/database/flyway/install/defaults/main.yml
deleted file mode 100644
index 1ba090db422..00000000000
--- a/infrastructure/ansible/roles/database/flyway/install/defaults/main.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-flyway_version: "7.5.4"
-
-# Location where we can download flyway
-flyway_download_location: "https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/{{ flyway_version }}/flyway-commandline-{{ flyway_version }}-linux-x64.tar.gz"
-
-flyway_extracted_location: "/opt/flyway"
-
diff --git a/infrastructure/ansible/roles/database/flyway/install/tasks/main.yml b/infrastructure/ansible/roles/database/flyway/install/tasks/main.yml
deleted file mode 100644
index 90af9557c26..00000000000
--- a/infrastructure/ansible/roles/database/flyway/install/tasks/main.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-- name: create service user to run flyway
- user:
- name: flyway
- create_home: no
- system: yes
-
-- name: Create folder /opt/flyway/[version]/
- file:
- state: directory
- path: "{{ flyway_extracted_location }}"
- mode: "0755"
- owner: flyway
- group: flyway
-
-- name: Download flyway CLI
- get_url:
- url: "{{ flyway_download_location }}"
- dest: "/opt/flyway/flyway-cli.tar.gz"
- mode: "0644"
- checksum: "md5:f5f2683e41cf2581693aad28f69fb4af"
- owner: flyway
- group: flyway
-
-- name: extract flyway CLI
- unarchive:
- copy: no
- src: "/opt/flyway/flyway-cli.tar.gz"
- dest: "{{ flyway_extracted_location }}"
- owner: flyway
- group: flyway
- creates: "{{ flyway_extracted_location }}/flyway-{{ flyway_version }}"
diff --git a/infrastructure/ansible/roles/database/flyway/run_migrations/README.md b/infrastructure/ansible/roles/database/flyway/run_migrations/README.md
deleted file mode 100644
index 5aa8206a668..00000000000
--- a/infrastructure/ansible/roles/database/flyway/run_migrations/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-This role is meant to be used as part of an include block. EG:
-
-```yaml
--- roles/[role]/tasks/main.yml
-
-- name: Install [application] database
- include_role:
- name: database/flyway_run_migration
- vars:
- migrations_file: "[name_of_zip_file_found_on_ansible control host]"
- flyway_db_name: ""
- flyway_migration_dir: "[name of directory created when expanding the zip file]"
- flyway_user: ""
- flyway_password: ""
-```
diff --git a/infrastructure/ansible/roles/database/flyway/run_migrations/defaults/main.yml b/infrastructure/ansible/roles/database/flyway/run_migrations/defaults/main.yml
deleted file mode 100644
index 3fee926e0a5..00000000000
--- a/infrastructure/ansible/roles/database/flyway/run_migrations/defaults/main.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-migrations_file: ""
-flyway_db_name: ""
-flyway_migration_dir: ""
-flyway_user: ""
-flyway_password: ""
-flyway_db_url: "jdbc:postgresql://localhost:5432/{{ flyway_db_name }}"
-flyway_migrations_location: "/opt/flyway/database_migrations"
diff --git a/infrastructure/ansible/roles/database/flyway/run_migrations/tasks/main.yml b/infrastructure/ansible/roles/database/flyway/run_migrations/tasks/main.yml
deleted file mode 100644
index 9333cd84c47..00000000000
--- a/infrastructure/ansible/roles/database/flyway/run_migrations/tasks/main.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-- name: assert vars are set
- assert:
- that:
- - migrations_file != ""
- - flyway_db_name != ""
- - flyway_migration_dir != ""
- - flyway_user != ""
- - flyway_password != ""
-
-- name: create migration folders
- file:
- state: directory
- mode: "0755"
- owner: flyway
- group: flyway
- path : "{{ flyway_migrations_location }}"
-
-- name: extract migrations
- unarchive:
- src: "migrations.zip"
- dest: "{{ flyway_migrations_location }}"
- mode: "0644"
- owner: flyway
- group: flyway
-
-- name: deploy file flyway.conf
- template:
- src: flyway.conf.j2
- dest: "{{ flyway_migrations_location }}/flyway.conf"
- mode: "0644"
- owner: flyway
- group: flyway
-
-- name: run flyway
- command: |
- /opt/flyway/flyway-7.5.4/flyway
- -X
- -locations=filesystem:{{ flyway_migrations_location }}/{{ flyway_migration_dir }}
- -configFiles={{ flyway_migrations_location }}/flyway.conf
- migrate
- register: flyway
- changed_when: '"is up to date. No migration necessary" not in flyway.stdout'
- failed_when: >
- (flyway.rc != 0) or
- ("Successfully validated 0 migrations" in flyway.stdout) or
- ("WARNING: No migrations found. Are your locations set up correctly?" in flyway.stdout)
diff --git a/infrastructure/ansible/roles/database/flyway/run_migrations/templates/flyway.conf.j2 b/infrastructure/ansible/roles/database/flyway/run_migrations/templates/flyway.conf.j2
deleted file mode 100644
index 3e128530444..00000000000
--- a/infrastructure/ansible/roles/database/flyway/run_migrations/templates/flyway.conf.j2
+++ /dev/null
@@ -1,4 +0,0 @@
-flyway.driver = org.postgresql.Driver
-flyway.url={{ flyway_db_url }}
-flyway.user={{ flyway_user }}
-flyway.password={{ flyway_password }}
diff --git a/infrastructure/ansible/roles/database/postgres/create_database/README.md b/infrastructure/ansible/roles/database/postgres/create_database/README.md
deleted file mode 100644
index 91957d4d6c6..00000000000
--- a/infrastructure/ansible/roles/database/postgres/create_database/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# postgres_create_database
-
-This role creates a database & a corresponding user with password.
-The database will start out completely blank, applications and
-data migration tools can use the username+password to populate
-a schema or execute queries.
-
-This role is meant to be used as part of an include block. EG:
-```yaml
--- roles/[role]/tasks/main.yml
-
-- name: Install [application] database
- include_role:
- name: database/postgres_create_database
- vars:
- database_name: "db_name"
- database_user: "db_user_name"
- database_password: "vault_encrypted_password"
-```
diff --git a/infrastructure/ansible/roles/database/postgres/create_database/defaults/main.yml b/infrastructure/ansible/roles/database/postgres/create_database/defaults/main.yml
deleted file mode 100644
index e00d1eb6e57..00000000000
--- a/infrastructure/ansible/roles/database/postgres/create_database/defaults/main.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The name of the database that will be created.
-# To connect to the database:
-# sudo -u postgres psql
-# /c {{ database_name }}
-database_name: ""
-
-# The name of the database user that will be created, this user
-# will own the database, '{{ database_name }}'
-# Typically an application will use this name as the username when
-# connecting to database.
-database_user: ""
-
-# The password for the database user that will be created.
-# An application should use this value as part of the 'usenrame, password'
-# combination when connecting to '{{ database_name }}'
-database_password: ""
diff --git a/infrastructure/ansible/roles/database/postgres/create_database/tasks/main.yml b/infrastructure/ansible/roles/database/postgres/create_database/tasks/main.yml
deleted file mode 100644
index 23639d78bec..00000000000
--- a/infrastructure/ansible/roles/database/postgres/create_database/tasks/main.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-- name: check required variables
- assert:
- that:
- - database_name != ""
- - database_user != ""
- - database_password != ""
-
-- name: Create postgres user account for the new database
- become_user: postgres
- postgresql_user:
- name: "{{ database_user }}"
- password: "{{ database_password }}"
- encrypted: yes
- state: "present"
- role_attr_flags: NOSUPERUSER,NOCREATEDB
-
-- name: Create new database
- become_user: postgres
- postgresql_db:
- name: "{{ database_name }}"
- owner: "{{ database_user }}"
-
-- name: Grant application user access to database
- become_user: postgres
- postgresql_privs:
- database: "{{ database_name }}"
- state: present
- privs: ALL
- type: database
- roles: "{{ database_user }}"
- grant_option: no
diff --git a/infrastructure/ansible/roles/database/postgres/install/README.md b/infrastructure/ansible/roles/database/postgres/install/README.md
deleted file mode 100644
index eacca977cbc..00000000000
--- a/infrastructure/ansible/roles/database/postgres/install/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-Installs a Postgres DB and creates application schemas.
-
-After this role is run, there will be an empty database ready
-for 'flyway' to execute database migrations which will create
-tables (and procedures and indices, etc..) and insert seed data.
-
-Access to database for admins and deployments is done by first
-SSH'ing into the server and then using `sudo -u` to switch to
-the OS user 'postgres'. As the 'postgres' user, no password is
-required when accessing database.
-
-EG:
-```
-ssh lobby-database-server
-sudo -u postgres psql
-```
diff --git a/infrastructure/ansible/roles/database/postgres/install/files/pg_hba.conf b/infrastructure/ansible/roles/database/postgres/install/files/pg_hba.conf
deleted file mode 100644
index d6afaf5a361..00000000000
--- a/infrastructure/ansible/roles/database/postgres/install/files/pg_hba.conf
+++ /dev/null
@@ -1,20 +0,0 @@
-# See the .pg_hba_conf.orig file for more documentation on this configuration file
-
-# We configure postgres authentication such that you almost always need a password.
-# The one exception is if you are logged into the OS as user 'postgres', then
-# you can run local 'psql' commands without a password.
-
-# TYPE DATABASE USER ADDRESS METHOD
-# OS user 'postgres' can log into the database without password
-local all postgres peer
-# All other users need to use a password even when connecting from local
-local all all md5
-# IPv4 local connections:
-host all all 127.0.0.1/32 md5
-# IPv6 local connections:
-host all all ::1/128 md5
-# Allow replication connections from localhost, by a user with the
-# replication privilege.
-local replication all peer
-host replication all 127.0.0.1/32 md5
-host replication all ::1/128 md5
diff --git a/infrastructure/ansible/roles/database/postgres/install/files/pg_hba.conf.orig b/infrastructure/ansible/roles/database/postgres/install/files/pg_hba.conf.orig
deleted file mode 100644
index f07bb73a2bc..00000000000
--- a/infrastructure/ansible/roles/database/postgres/install/files/pg_hba.conf.orig
+++ /dev/null
@@ -1,99 +0,0 @@
-# PostgreSQL Client Authentication Configuration File
-# ===================================================
-#
-# Refer to the "Client Authentication" section in the PostgreSQL
-# documentation for a complete description of this file. A short
-# synopsis follows.
-#
-# This file controls: which hosts are allowed to connect, how clients
-# are authenticated, which PostgreSQL user names they can use, which
-# databases they can access. Records take one of these forms:
-#
-# local DATABASE USER METHOD [OPTIONS]
-# host DATABASE USER ADDRESS METHOD [OPTIONS]
-# hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
-# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
-#
-# (The uppercase items must be replaced by actual values.)
-#
-# The first field is the connection type: "local" is a Unix-domain
-# socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
-# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
-# plain TCP/IP socket.
-#
-# DATABASE can be "all", "sameuser", "samerole", "replication", a
-# database name, or a comma-separated list thereof. The "all"
-# keyword does not match "replication". Access to replication
-# must be enabled in a separate record (see example below).
-#
-# USER can be "all", a user name, a group name prefixed with "+", or a
-# comma-separated list thereof. In both the DATABASE and USER fields
-# you can also write a file name prefixed with "@" to include names
-# from a separate file.
-#
-# ADDRESS specifies the set of hosts the record matches. It can be a
-# host name, or it is made up of an IP address and a CIDR mask that is
-# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
-# specifies the number of significant bits in the mask. A host name
-# that starts with a dot (.) matches a suffix of the actual host name.
-# Alternatively, you can write an IP address and netmask in separate
-# columns to specify the set of hosts. Instead of a CIDR-address, you
-# can write "samehost" to match any of the server's own IP addresses,
-# or "samenet" to match any address in any subnet that the server is
-# directly connected to.
-#
-# METHOD can be "trust", "reject", "md5", "password", "scram-sha-256",
-# "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".
-# Note that "password" sends passwords in clear text; "md5" or
-# "scram-sha-256" are preferred since they send encrypted passwords.
-#
-# OPTIONS are a set of options for the authentication in the format
-# NAME=VALUE. The available options depend on the different
-# authentication methods -- refer to the "Client Authentication"
-# section in the documentation for a list of which options are
-# available for which authentication methods.
-#
-# Database and user names containing spaces, commas, quotes and other
-# special characters must be quoted. Quoting one of the keywords
-# "all", "sameuser", "samerole" or "replication" makes the name lose
-# its special character, and just match a database or username with
-# that name.
-#
-# This file is read on server startup and when the server receives a
-# SIGHUP signal. If you edit the file on a running system, you have to
-# SIGHUP the server for the changes to take effect, run "pg_ctl reload",
-# or execute "SELECT pg_reload_conf()".
-#
-# Put your actual configuration here
-# ----------------------------------
-#
-# If you want to allow non-local connections, you need to add more
-# "host" records. In that case you will also need to make PostgreSQL
-# listen on a non-local interface via the listen_addresses
-# configuration parameter, or via the -i or -h command line switches.
-
-
-
-
-# DO NOT DISABLE!
-# If you change this first entry you will need to make sure that the
-# database superuser can access the database using some other method.
-# Noninteractive access to all databases is required during automatic
-# maintenance (custom daily cronjobs, replication, and similar tasks).
-#
-# Database administrative login by Unix domain socket
-local all postgres peer
-
-# TYPE DATABASE USER ADDRESS METHOD
-
-# "local" is for Unix domain socket connections only
-local all all peer
-# IPv4 local connections:
-host all all 127.0.0.1/32 md5
-# IPv6 local connections:
-host all all ::1/128 md5
-# Allow replication connections from localhost, by a user with the
-# replication privilege.
-local replication all peer
-host replication all 127.0.0.1/32 md5
-host replication all ::1/128 md5
diff --git a/infrastructure/ansible/roles/database/postgres/install/tasks/main.yml b/infrastructure/ansible/roles/database/postgres/install/tasks/main.yml
deleted file mode 100644
index 8ded4336fd6..00000000000
--- a/infrastructure/ansible/roles/database/postgres/install/tasks/main.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-- name: Ensure latest bash and ssl
- apt:
- state: latest
- name:
- - bash
- - openssl
- - libssl-dev
- - libssl-doc
-
-- name: Install PostgreSQL
- apt:
- state: present
- name:
- - postgresql
- - postgresql-contrib
- - libpq-dev
- - python3-psycopg2
-
-- name: Ensure the PostgreSQL service is running
- service:
- name: postgresql
- state: started
- enabled: yes
-
-- name: deploy file /etc/postgresql/12/main/pg_hba.conf
- register: pg_hba
- copy:
- src: pg_hba.conf
- dest: /etc/postgresql/12/main/pg_hba.conf
- owner: postgres
- group: postgres
- mode: "0640"
-
-- name: Reload PostgreSQL if pg_hba.conf changed
- when: pg_hba.changed
- service:
- name: postgresql
- state: reloaded
-
diff --git a/infrastructure/ansible/roles/java/README.md b/infrastructure/ansible/roles/java/README.md
deleted file mode 100644
index d4449842e60..00000000000
--- a/infrastructure/ansible/roles/java/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Installs Java JDK
diff --git a/infrastructure/ansible/roles/java/defaults/main.yml b/infrastructure/ansible/roles/java/defaults/main.yml
deleted file mode 100644
index ee516685f46..00000000000
--- a/infrastructure/ansible/roles/java/defaults/main.yml
+++ /dev/null
@@ -1 +0,0 @@
-java_version: "openjdk-11-jdk-headless"
diff --git a/infrastructure/ansible/roles/java/tasks/main.yml b/infrastructure/ansible/roles/java/tasks/main.yml
deleted file mode 100644
index c50c1e58980..00000000000
--- a/infrastructure/ansible/roles/java/tasks/main.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-- name: install java
- apt:
- state: present
- name: "{{ java_version }}"
diff --git a/infrastructure/ansible/roles/lobby_server/README.md b/infrastructure/ansible/roles/lobby_server/README.md
deleted file mode 100644
index f765525ac1f..00000000000
--- a/infrastructure/ansible/roles/lobby_server/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# Lobby_Server role
-
-- runs DB schema migrations
-- deploys nginx config file for reverse proxy
-- deploys and configures lobby application, installed
- as 'lobby_server_', eg:
- `sudo systemctl status lobby_server_2.6`
-
-## SSL Setup
-
-We use 'certbot' to create 'LetsEncrypt' signed certificates.
-It is not easy to automate. We also have another challenge
-that getting a cert requires a DNS entry, which is not
-available on a local installation to vagrant.
-
-When deploying to vagrant, we will generate self signed certificates.
-
-After running the deployment, run certbot manually with the
-following commands:
-
-```bash
-apt install \
- software-properties-common \
- certbot \
- python3-certbot-nginx
-
-certbot \
- --nginx \
- -d \
- --rsa-key-size 4096
-```
-
-Once certbot is run, run a deployment in 'check' and 'diff'
-mode to validate which changes would be made on the next
-deployment. Check in any updates such that this 'diff'
-is empty.
diff --git a/infrastructure/ansible/roles/lobby_server/defaults/main.yml b/infrastructure/ansible/roles/lobby_server/defaults/main.yml
deleted file mode 100644
index c479b0a0b5e..00000000000
--- a/infrastructure/ansible/roles/lobby_server/defaults/main.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-lobby_user: lobby
-# Full version includes the build number, eg: 2.6+153432
-lobby_full_version: "{{ build_version }}"
-
-# product version is just the major.minor, eg: 2.6
-lobby_product_version: "{{ product_version }}"
-lobby_name: "lobby_{{ lobby_product_version }}"
-lobby_home_folder: "/opt/lobby/{{ lobby_product_version }}"
-
-lobby_ports:
- "default": "8080"
- "2.5": "8080"
- "2.6": "9026"
-
-lobby_http_port: "{{ lobby_ports[lobby_product_version] }}"
-
-lobby_db_host: "localhost"
-lobby_db_port: "5432"
-lobby_db_name: lobby_db
-lobby_db_user: lobby_user
-github_api_token: "test"
-lobby_artifact: triplea-dropwizard-server.zip
-lobby_jar_file: triplea-dropwizard-server.jar
-lobby_restart_on_new_deployment: true
-
-# How often to run map indexing. We need to be able to index all maps
-# before the next run starts to avoid overlapping runs. The smaller this
-# value the more responsive indexing will be to map updates.
-# 120 -> 2 hours in between runs -> (if indexing 360 / hour) -> 720 maps to be indexed per run
-map_indexing_period_minutes: 120
-
-# Indexing delay is how much of a backoff there is between indexing
-# each map. We need to keep this number to be under 1000 tasks per
-# hour to avoid rate limiting
-# 10 => 6 per minute => 360 per hour.
-map_indexing_task_delay_seconds: 10
-
-reverse_proxy_server_name: "localhost"
-
-lobby_public_cert_folder: /etc/nginx/certs
-lobby_public_cert_file: "{{ lobby_public_cert_folder }}/cert.crt"
-lobby_private_key_file: "{{ lobby_public_cert_folder }}//cert.key"
-
-lobby_dhparam_file: "/etc/nginx/dhparam.pem"
-
-# Whether we should generate self signed SSL certs, suitable
-# for a dev environment where we are not using letsencrypt to
-# obtain certs.
-nginx_generate_self_signed_cert: false
diff --git a/infrastructure/ansible/roles/lobby_server/tasks/main.yml b/infrastructure/ansible/roles/lobby_server/tasks/main.yml
deleted file mode 100644
index f53fc24b799..00000000000
--- a/infrastructure/ansible/roles/lobby_server/tasks/main.yml
+++ /dev/null
@@ -1,103 +0,0 @@
-## Database
-
-- name: Database - create lobby database
- include_role:
- name: database/postgres/create_database
- vars:
- database_name: "{{ lobby_db_name }}"
- database_user: "{{ lobby_db_user }}"
- database_password: "{{ lobby_db_password }}"
-
-- name: Database - Run Flyway to execute DB migrations (install schema, database tables, data migrations)
- include_role:
- name: database/flyway/run_migrations
- vars:
- migrations_file: "migrations.zip"
- flyway_db_name: "{{ lobby_db_name }}"
- flyway_migration_dir: "lobby_db"
- flyway_user: "{{ lobby_db_user }}"
- flyway_password: "{{ lobby_db_password }}"
-
-## Nginx
-
-- name: Nginx config - generate dhparams
- include_role:
- name: nginx/generate_dhparams
-
-- name: Nginx config - deploy /etc/nginx/sites-enabled/lobby.conf
- template:
- src: "etc_nginx_sites_enabled_lobby.conf"
- dest: /etc/nginx/sites-enabled/lobby.conf
- owner: root
- group: root
- mode: "0644"
-
-- name: Nginx config - deploy 2.5 lobby nginx config
- template:
- src: 2-5_lobby.conf
- dest: /etc/nginx/sites-enabled/lobby-2-5.conf
- owner: root
- group: root
- mode: "0644"
-
-- name: Nginx config - generate self signed cert
- when: nginx_generate_self_signed_cert
- include_role:
- name: nginx/generate_self_signed_cert
- vars:
- ssl_cert_folder: "{{ lobby_public_cert_folder }}"
- ssl_cert_key: "{{ lobby_private_key_file }}"
- ssl_cert: "{{ lobby_public_cert_file }}"
-
-## Application
-
-- name: create lobby service user group
- group:
- name: "{{ lobby_user }}"
-
-- name: create service user
- user:
- name: "{{ lobby_user }}"
- group: "{{ lobby_user }}"
- create_home: no
- system: yes
-
-- name: ensure deployment folder exists
- file:
- state: directory
- path: "{{ lobby_home_folder }}"
- mode: "0755"
- owner: "{{ lobby_user }}"
- group: "{{ lobby_user }}"
-
-- name: extract lobby_server zip file
- register: deploy_artifact
- unarchive:
- src: "{{ lobby_artifact }}"
- dest: "{{ lobby_home_folder }}/"
- owner: "{{ lobby_user }}"
- group: "{{ lobby_user }}"
-
-- name: install systemd service file
- register: service_script
- template:
- src: lobby_server.service.j2
- dest: /lib/systemd/system/{{ lobby_name }}.service
- mode: "644"
-
-# Ideally we would restart the lobby if we update it to run the new version.
-# We do not want to disconnect users, so we do not restart the lobby.
-- name: ensure lobby is started
- systemd:
- name: "{{ lobby_name }}"
- state: started
- enabled: yes
- daemon_reload: true
-
-- name: drop a version file in lobby home
- template:
- src: version.txt
- dest: "{{ lobby_home_folder }}/version.txt"
- mode: "0644"
- owner: "{{ lobby_user }}"
- group: "{{ lobby_user }}"
diff --git a/infrastructure/ansible/roles/lobby_server/templates/2-5_lobby.conf b/infrastructure/ansible/roles/lobby_server/templates/2-5_lobby.conf
deleted file mode 100644
index 1c31bbda66d..00000000000
--- a/infrastructure/ansible/roles/lobby_server/templates/2-5_lobby.conf
+++ /dev/null
@@ -1,56 +0,0 @@
-# warning: be sure that we can run certbot role and then re-run the nginx
-# role without this file changing. If this file is changed (white-space included)
-# then nginx will be restarting, disconnecting all active connections.
-
-server {
- listen 443 ssl http2;
- listen [::]:443 ssl http2;
- server_name prod2-lobby.triplea-game.org;
- ssl_certificate /etc/letsencrypt/live/prod2-lobby.triplea-game.org/fullchain.pem; # managed by Certbot;
- ssl_certificate_key /etc/letsencrypt/live/prod2-lobby.triplea-game.org/privkey.pem; # managed by Certbot;
-
- ssl_protocols TLSv1.2 TLSv1.3;
- ssl_ciphers EECDH+AESGCM:EDH+AESGCM;
- ssl_prefer_server_ciphers on;
- access_log /var/log/nginx/java_server.access.log;
-
- ssl_dhparam /etc/nginx/dhparam.pem;
- ssl_ecdh_curve secp384r1;
- ssl_session_timeout 10m;
- ssl_session_cache shared:SSL:10m;
- ssl_session_tickets off;
- ssl_stapling on;
- ssl_stapling_verify on;
- add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
- add_header X-Frame-Options DENY;
- add_header X-Content-Type-Options nosniff;
- add_header X-XSS-Protection "1; mode=block";
-
- location / {
-
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
-
- # Fix the “It appears that your reverse proxy set up is broken" error.
- proxy_pass http://localhost:8080;
- proxy_read_timeout 90;
-
- proxy_redirect https://localhost:443 https://localhost:8080;
- }
-
- location /game-connection/ws {
- proxy_pass http://localhost:8080;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- }
-
- location /player-connection/ws {
- proxy_pass http://localhost:8080;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- }
-}
diff --git a/infrastructure/ansible/roles/lobby_server/templates/etc_nginx_sites_enabled_lobby.conf b/infrastructure/ansible/roles/lobby_server/templates/etc_nginx_sites_enabled_lobby.conf
deleted file mode 100644
index 4defda6a16c..00000000000
--- a/infrastructure/ansible/roles/lobby_server/templates/etc_nginx_sites_enabled_lobby.conf
+++ /dev/null
@@ -1,65 +0,0 @@
-map $http_Triplea_Version $lobby_port {
-{% for version,port in lobby_ports.items()|sort(attribute='1') %}
- {{ version }} "{{ port }}";
-{% endfor %}
-}
-
-server {
- listen 443 ssl http2;
- listen [::]:443 ssl http2;
- server_name {{ reverse_proxy_server_name }};
- ssl_certificate /etc/letsencrypt/live/prod.triplea-game.org-0001/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/prod.triplea-game.org-0001/privkey.pem; # managed by Certbot
-
- ssl_protocols TLSv1.2 TLSv1.3;
- ssl_ciphers EECDH+AESGCM:EDH+AESGCM;
- ssl_prefer_server_ciphers on;
- access_log /var/log/nginx/lobby_server.access.log;
-
- ssl_dhparam {{ lobby_dhparam_file }};
- ssl_ecdh_curve secp384r1;
- ssl_session_timeout 10m;
- ssl_session_cache shared:SSL:10m;
- ssl_session_tickets off;
- ssl_stapling on;
- ssl_stapling_verify on;
- add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
- add_header X-Frame-Options DENY;
- add_header X-Content-Type-Options nosniff;
- add_header X-XSS-Protection "1; mode=block";
-
- location / {
- proxy_pass http://127.0.0.1:$lobby_port;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_read_timeout 90;
- }
-
- location /game-connection/ws {
- proxy_pass http://127.0.0.1:$lobby_port;
- proxy_http_version 1.1;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
-
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- }
-
- location /player-connection/ws {
- proxy_pass http://127.0.0.1:$lobby_port;
- proxy_http_version 1.1;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
-
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- }
-
-}
-
diff --git a/infrastructure/ansible/roles/lobby_server/templates/lobby_server.service.j2 b/infrastructure/ansible/roles/lobby_server/templates/lobby_server.service.j2
deleted file mode 100644
index 2d7a05d9551..00000000000
--- a/infrastructure/ansible/roles/lobby_server/templates/lobby_server.service.j2
+++ /dev/null
@@ -1,27 +0,0 @@
-[Unit]
-Description={{ lobby_name }}
-Documentation=
-
-[Service]
-Environment=ERROR_REPORT_TO_GITHUB_ENABLED=true
-Environment=MAP_INDEXING_ENABLED=true
-Environment=GAME_HOST_CONNECTIVITY_CHECK_ENABLED=true
-Environment=USE_FORWARDED_HEADERS=true
-Environment=DATABASE_USER={{ lobby_db_user }}
-Environment=DATABASE_PASSWORD={{ lobby_db_password }}
-Environment=DB_URL={{ lobby_db_host }}:{{ lobby_db_port }}/{{ lobby_db_name }}
-Environment=GITHUB_API_TOKEN={{ github_api_token }}
-Environment=MAP_INDEXING_PERIOD_MINUTES={{ map_indexing_period_minutes }}
-Environment=MAP_INDEXING_DELAY_SECONDS={{ map_indexing_task_delay_seconds }}
-Environment=HTTP_PORT={{ lobby_http_port }}
-
-WorkingDirectory={{ lobby_home_folder }}
-User={{ lobby_user }}
-Group={{ lobby_user }}
-ExecStart=java -jar bin/{{ lobby_jar_file }}
-
-StandardOutput=append:/var/log/{{ lobby_name }}.log
-StandardError=append:/var/log/{{ lobby_name }}.log
-
-[Install]
-WantedBy=multi-user.target
diff --git a/infrastructure/ansible/roles/lobby_server/templates/version.txt b/infrastructure/ansible/roles/lobby_server/templates/version.txt
deleted file mode 100644
index 174f89903ce..00000000000
--- a/infrastructure/ansible/roles/lobby_server/templates/version.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-# Current version of lobby is:
-{{ lobby_full_version }}
diff --git a/infrastructure/ansible/roles/nginx/README.md b/infrastructure/ansible/roles/nginx/README.md
deleted file mode 100644
index 4f0d4829560..00000000000
--- a/infrastructure/ansible/roles/nginx/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-## Troubleshooting
-
-If nginx fails to reload or to start up:
-
-```bash
-cd infrastructure/vagrant
-vagrant ssh
-sudo /usr/sbin/nginx
-```
-
-The above will usually print out a more detailed error message
-that should tell you where the problem is.
-
-After you fix the configuration problem, reload nginx:
-```
-cd infrastructure/vagrant
-vagrant ssh
-sudo systemctl reload nginx
-```
diff --git a/infrastructure/ansible/roles/nginx/generate_dhparams/defaults/main.yml b/infrastructure/ansible/roles/nginx/generate_dhparams/defaults/main.yml
deleted file mode 100644
index 8d83d68abe1..00000000000
--- a/infrastructure/ansible/roles/nginx/generate_dhparams/defaults/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-dhparams_pem_file: /etc/nginx/dhparam.pem
-nginx_generate_dhparam: true
diff --git a/infrastructure/ansible/roles/nginx/generate_dhparams/files/vagrant-only.dhparam.pem b/infrastructure/ansible/roles/nginx/generate_dhparams/files/vagrant-only.dhparam.pem
deleted file mode 100644
index 091fe273e6b..00000000000
--- a/infrastructure/ansible/roles/nginx/generate_dhparams/files/vagrant-only.dhparam.pem
+++ /dev/null
@@ -1,13 +0,0 @@
------BEGIN DH PARAMETERS-----
-MIICCAKCAgEAvlOOqIkd4a8L9Oai3dlA84wXSXKOlzxN3RPQZc2sY0xrRCrnX34l
-8QsD7zQ3BjdERTDBSu4WXhRguYkbqxaJB6gjCuZa3E4a1REWJdqYSKEAJQPnhnNZ
-49ZOSlRvr14064K4bz0j+Ihx0mAPh3pSlwsdzbS4tSvkNPs4ejq1RZSJZIDstJmS
-Yo6ik53ObAso8zGILgKAqDmjbQXGAX5BT0uYhqcrl3Ny006NLOJ/e6oMFLTuKttx
-CidkVhqGgQyuHxzHPOWWRlDhbMLKkRN344G8BkNbWu5LnZY9CQw6WVnIo1Nf1roa
-rclLLHg2nbRUiH6KUW3R4ushwu35FdtRw8BpQnu2wVGvKjymn0eOvh3Qxgx2Oiym
-yyLDS5TZsVHWLsvzu/21+5tIrNVsL8prB3V8r9ypdz3Q4Q6JoeknY0pq6YELhg07
-CEUaMy0FbnQQ2TALzqfztSqZCxPYG9r9yfQxk1wvI2JJVlts77r2MB3TFEEjWc+5
-/NOLQNL8DbwBfY4OfIs/i6tzqD181JWvTdwvRTRJc8ZIgVouOpEwzzf4xTqm7Oka
-GhtcjINJp307XfvHJSIbO1abHaIdsPZYVNfFHGYh/lBwS1WchLg7SzihBglQHnHy
-fxSEnTl9r0FtPNZ1mT5IkbQlRAmWafKWXYzG09L27CpXU3cPAcno0VsCAQI=
------END DH PARAMETERS-----
diff --git a/infrastructure/ansible/roles/nginx/generate_dhparams/tasks/main.yml b/infrastructure/ansible/roles/nginx/generate_dhparams/tasks/main.yml
deleted file mode 100644
index 727d693d094..00000000000
--- a/infrastructure/ansible/roles/nginx/generate_dhparams/tasks/main.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-- name: copy dhparam.pem
- when: not nginx_generate_dhparam
- copy:
- src: vagrant-only.dhparam.pem
- dest: "{{ dhparams_pem_file }}"
- owner: root
- mode: "0664"
-
-- name: generate dhparam.pem
- when: nginx_generate_dhparam
- shell:
- cmd: openssl dhparam -out {{ dhparams_pem_file }} 4096
- creates: "{{ dhparams_pem_file }}"
-
-- name: set permissions of dhparam.pem
- file:
- dest: "{{ dhparams_pem_file }}"
- mode: "0664"
diff --git a/infrastructure/ansible/roles/nginx/generate_self_signed_cert/defaults/main.yml b/infrastructure/ansible/roles/nginx/generate_self_signed_cert/defaults/main.yml
deleted file mode 100644
index c1026193b45..00000000000
--- a/infrastructure/ansible/roles/nginx/generate_self_signed_cert/defaults/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-ssl_cert_folder: ""
-ssl_cert_key: ""
-ssl_cert: ""
diff --git a/infrastructure/ansible/roles/nginx/generate_self_signed_cert/tasks/main.yml b/infrastructure/ansible/roles/nginx/generate_self_signed_cert/tasks/main.yml
deleted file mode 100644
index f3d02d19c79..00000000000
--- a/infrastructure/ansible/roles/nginx/generate_self_signed_cert/tasks/main.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-- name: assert required vars are set
- assert:
- that:
- - ssl_cert_folder != ""
- - ssl_cert_key != ""
- - ssl_cert != ""
-
-- name: create folder for SSL certs
- file:
- path: "{{ ssl_cert_folder }}"
- state: directory
- owner: root
- group: root
- mode: "0770"
-
-- name: create SSL keys if needed
- command: |
- openssl req -x509 -nodes -days 365 \
- -newkey rsa:4096 -keyout {{ ssl_cert_key }} -out {{ ssl_cert }} \
- -batch -subj '/CN=localhost' -sha256 -addext "subjectAltName = IP:127.0.0.1, IP:::1"
-
-- name: ensure permissions on SSL cert files
- file:
- path: "{{ item }}"
- state: file
- owner: root
- group: root
- mode: "0770"
- with_items:
- - "{{ ssl_cert_key }}"
- - "{{ ssl_cert }}"
diff --git a/infrastructure/ansible/roles/nginx/install/README.md b/infrastructure/ansible/roles/nginx/install/README.md
deleted file mode 100644
index 2f3362eef78..00000000000
--- a/infrastructure/ansible/roles/nginx/install/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-Installs nginx with configuration for port forwarding and https certificate.
-We'll have nginx listen on secure port, forward received requests to application
-server on non-secure port, and then respond back to the client via secure (https)
-connection.
diff --git a/infrastructure/ansible/roles/nginx/install/tasks/main.yml b/infrastructure/ansible/roles/nginx/install/tasks/main.yml
deleted file mode 100644
index cbc2ebf1ec5..00000000000
--- a/infrastructure/ansible/roles/nginx/install/tasks/main.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-- name: apt install nginx
- apt:
- name: nginx
- state: present
-
-- name: deploy nginx sites_enabled configuation
- template:
- src: etc_nginx_sites_enabled_default.j2
- dest: /etc/nginx/sites-enabled/default
- mode: "0644"
- owner: root
- group: root
-
-- name: allow ports
- tags: firewall
- ufw:
- rule: allow
- port: "{{ item }}"
- proto: tcp
- with_items:
- - "443"
- - "80"
-
-- name: ensure nginx is started
- systemd:
- name: nginx
- state: started
- enabled: true
diff --git a/infrastructure/ansible/roles/nginx/install/templates/etc_nginx_sites_enabled_default.j2 b/infrastructure/ansible/roles/nginx/install/templates/etc_nginx_sites_enabled_default.j2
deleted file mode 100644
index 2b6f5db7b70..00000000000
--- a/infrastructure/ansible/roles/nginx/install/templates/etc_nginx_sites_enabled_default.j2
+++ /dev/null
@@ -1,7 +0,0 @@
-server {
- listen 80;
- listen [::]:80;
-# return 301 https://$host$request_uri;
-
- root /usr/share/nginx/html;
-}
diff --git a/infrastructure/ansible/roles/nginx_forums_conf/files/nginx.conf b/infrastructure/ansible/roles/nginx_forums_conf/files/nginx.conf
deleted file mode 100644
index 73196730198..00000000000
--- a/infrastructure/ansible/roles/nginx_forums_conf/files/nginx.conf
+++ /dev/null
@@ -1,69 +0,0 @@
-user www-data;
-worker_processes auto;
-pid /run/nginx.pid;
-
-events {
- worker_connections 768;
- # multi_accept on;
-}
-
-http {
-
- log_format compression '$remote_addr - $remote_user [$time_local] '
- '"$request" $status $body_bytes_sent '
- '"$http_referer" "$http_user_agent" "$gzip_ratio"';
-
- ##
- # Basic Settings
- ##
-
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- keepalive_timeout 65;
- types_hash_max_size 2048;
- # server_tokens off;
-
- # server_names_hash_bucket_size 64;
- # server_name_in_redirect off;
-
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
-
- ##
- # SSL Settings
- ##
-
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
- ssl_prefer_server_ciphers on;
-
- ##
- # Logging Settings
- ##
-
- access_log /var/log/nginx/access.log;
- error_log /var/log/nginx/error.log;
-
- ##
- # Gzip Settings
- ##
-
- gzip on;
- gzip_disable "msie6";
-
- # gzip_vary on;
- # gzip_proxied any;
- # gzip_comp_level 6;
- # gzip_buffers 16 8k;
- # gzip_http_version 1.1;
- # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
-
- ##
- # Virtual Host Configs
- ##
-
- include /etc/nginx/conf.d/*.conf;
- include /etc/nginx/sites-enabled/*;
-}
-
-
diff --git a/infrastructure/ansible/roles/nginx_forums_conf/files/sites-enabled-default b/infrastructure/ansible/roles/nginx_forums_conf/files/sites-enabled-default
deleted file mode 100644
index b277d3ebe36..00000000000
--- a/infrastructure/ansible/roles/nginx_forums_conf/files/sites-enabled-default
+++ /dev/null
@@ -1,60 +0,0 @@
-# Session caching for improved performance
-
-ssl_session_cache shared:ssl_session_cache:10m;
-
-server {
- listen 80;
- listen [::]:80;
- server_name forums.triplea-game.org;
- return 301 https://forums.triplea-game.org$request_uri;
-}
-server {
- listen 443 ssl http2;
- listen [::]:443 ssl http2;
- server_name forums.triplea-game.org;
- ssl_certificate /etc/letsencrypt/live/forums.triplea-game.org/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/forums.triplea-game.org/privkey.pem;
-
- # Turn on OCSP stapling as recommended at
- # https://community.letsencrypt.org/t/integration-guide/13123
- # requires nginx version >= 1.3.7
- ssl_stapling on;
- ssl_stapling_verify on;
- # add_header Strict-Transport-Security "max-age=31536000";
- ssl_protocols TLSv1.2;
- ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
- ssl_prefer_server_ciphers on;
- ssl_dhparam /etc/dhparam/dhparams.pem;
-
- location /.well-known {
- alias /var/www/nodebb/.well-known;
- }
-
- # Display a more friendly error page for being displayed when updating.
-
- error_page 502 /502.html;
-
- location /502.html {
- alias /var/www/nodebb/502.html;
- }
-
- location / {
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $http_host;
- proxy_set_header X-NginX-Proxy true;
- proxy_set_header X-Forwarded-Proto $scheme;
-
- proxy_pass http://127.0.0.1:4567;
- proxy_redirect off;
-
- # Socket.IO Support
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
-
- # NodeBB has an independent max upload size setting
- client_max_body_size 4096K;
- }
-}
-
diff --git a/infrastructure/ansible/roles/nginx_forums_conf/tasks/main.yml b/infrastructure/ansible/roles/nginx_forums_conf/tasks/main.yml
deleted file mode 100644
index 0dedc181b47..00000000000
--- a/infrastructure/ansible/roles/nginx_forums_conf/tasks/main.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-- name: ensure nginx folders exist
- file:
- path: "{{ item }}"
- state: directory
- owner: root
- group: root
- mode: 0755
- loop:
- - /etc/nginx
- - /etc/nginx/sites-enabled
-
-- name: deploy nginx.conf
- register: deploy_conf
- copy:
- src: "{{ item.src }}"
- dest: "{{ item.dest }}"
- mode: 0644
- owner: root
- group: root
- loop:
- - src: nginx.conf
- dest: /etc/nginx/nginx.conf
- - src: sites-enabled-default
- dest: /etc/nginx/sites-enabled/default
-
-- name: reload nginx conf if changed
- when: deploy_conf.changed
- service:
- name: nginx
- state: reloaded
-
diff --git a/infrastructure/ansible/roles/postfix/defaults/main.yml b/infrastructure/ansible/roles/postfix/defaults/main.yml
deleted file mode 100644
index 076de0318bd..00000000000
--- a/infrastructure/ansible/roles/postfix/defaults/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-postfix_smtpd_tls_cert_file: "/etc/letsencrypt/live/{{ inventory_hostname }}/fullchain.pem"
-postfix_smtpd_tls_key_file: "/etc/letsencrypt/live/{{ inventory_hostname }}/privkey.pem"
-postfix_hostname: "triplea-game.org"
diff --git a/infrastructure/ansible/roles/postfix/tasks/main.yml b/infrastructure/ansible/roles/postfix/tasks/main.yml
deleted file mode 100644
index 0d1c49ea465..00000000000
--- a/infrastructure/ansible/roles/postfix/tasks/main.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-- name: Install postfix
- apt:
- state: present
- name: postfix
-
-- name: Deploy postfix config
- template:
- src: main.cf.j2
- dest: /etc/postfix/main.cf
- owner: root
- group: root
- mode: "0644"
- register: postfix_config
-
-- name: Restart postfix if config changes
- when: postfix_config.changed
- systemd:
- name: postfix
- state: restarted
-
-- name: Ensure postfix is started
- systemd:
- name: postfix
- state: started
diff --git a/infrastructure/ansible/roles/postfix/templates/main.cf.j2 b/infrastructure/ansible/roles/postfix/templates/main.cf.j2
deleted file mode 100644
index 4aea2df1b83..00000000000
--- a/infrastructure/ansible/roles/postfix/templates/main.cf.j2
+++ /dev/null
@@ -1,53 +0,0 @@
-# See /usr/share/postfix/main.cf.dist for a commented, more complete version
-
-
-# Debian specific: Specifying a file name will cause the first
-# line of that file to be used as the name. The Debian default
-# is /etc/mailname.
-#myorigin = /etc/mailname
-
-smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
-biff = no
-
-# appending .domain is the MUA's job.
-append_dot_mydomain = no
-
-# Uncomment the next line to generate "delayed mail" warnings
-#delay_warning_time = 4h
-
-readme_directory = no
-
-# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
-# fresh installs.
-compatibility_level = 2
-
-# TLS parameters
-smtpd_tls_cert_file={{ postfix_smtpd_tls_cert_file }}
-smtpd_tls_key_file={{ postfix_smtpd_tls_key_file }}
-smtp_tls_security_level=encrypt
-smtp_tls_mandatory_ciphers=high
-smtpd_use_tls=yes
-smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
-smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
-smtpd_tls_ciphers = high
-smtp_tls_ciphers = high
-smtpd_tls_protocols = !SSLv2, !SSLv3
-smtp_tls_protocols = !SSLv2, !SSLv3
-
-# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
-# information on enabling SSL in the smtp client.
-
-smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
-myhostname = {{ postfix_hostname }}
-alias_maps = hash:/etc/aliases
-alias_database = hash:/etc/aliases
-myorigin = /etc/mailname
-mydestination = {{ postfix_hostname }}, localhost
-relayhost =
-mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
-mailbox_command = procmail -a "$EXTENSION"
-mailbox_size_limit = 0
-recipient_delimiter = +
-inet_interfaces = loopback-only
-inet_protocols = all
-
diff --git a/infrastructure/ansible/roles/system/admin_user/README.md b/infrastructure/ansible/roles/system/admin_user/README.md
deleted file mode 100644
index 54fab6d4850..00000000000
--- a/infrastructure/ansible/roles/system/admin_user/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-Creates the 'admin' user on each host and deploys SSH keys. Admin user is a maintenance user
-for the TripleA team to be able to ssh into the server. Admin user has sudo access.
diff --git a/infrastructure/ansible/roles/system/admin_user/files/authorized_keys b/infrastructure/ansible/roles/system/admin_user/files/authorized_keys
deleted file mode 100644
index 40e20a0aa87..00000000000
--- a/infrastructure/ansible/roles/system/admin_user/files/authorized_keys
+++ /dev/null
@@ -1,5 +0,0 @@
-ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKgXoGb+M2ux4Xfu5U4rJ491IYswFC947fGDUC0jZFSV prastle-ed25519-key-20180416
-ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIENZoW92mNwtkry/yDGSQB51Ap7Jo2wsVON1l5Sk7nJt dan@desk
-ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAgWvlebib7R87yoNIxTWqZFARfnJfnXiCNMVkP3n5Tb ssoloff@triplea-dev.localdomain
-ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF7ypuqJPv0HKxMnbA18Q81o8vtX4vfQDfhE/TylZpPX RoiEX@Desktop
-AAAAB3NzaC1yc2EAAAABJQAAAQEAiV/GnDxSnwoxud9yGJQH6HvzSguIPd00rfM0zNXV89cO7WWvsJoyhqXOAlULm1pco98GZu2YBAa7KhqC6gCVuW6nN3uCDasoG8+jNGUW+LKy7Nv5KeZjmlr51KYPw5yo0TBhfuf5ttkLT+IH/4frX+1stmLflPSui4LCVRoBsN4VEbFiijUUl5oYYHJ8ipNPzrQQz3e9dKnA6SNnMsN6vfgESpurTw57gritCttD52rpp4aJOUCyBXKEVTJxiwxgi1LupPNRVj/r/lpzbKRGRwGll7qcYK12tX2oJ0JjzfHmXobVjpzaasjatgbOUuCElwrAWyAA05P1uGvT31wA7w== frigoref
diff --git a/infrastructure/ansible/roles/system/admin_user/tasks/main.yml b/infrastructure/ansible/roles/system/admin_user/tasks/main.yml
deleted file mode 100644
index d08b6b1f931..00000000000
--- a/infrastructure/ansible/roles/system/admin_user/tasks/main.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-- name: create admin group
- group:
- name: admin
- state: present
-
-- name: create the admin user (triplea) for maintainers to SSH to the system
- user:
- name: "{{ admin_user }}"
- shell: /bin/bash
- create_home: yes
- append: yes
- groups: admin,adm
-
-- name: Allow the admin user to have passwordless sudo
- lineinfile:
- dest: /etc/sudoers
- state: present
- regexp: "^%{{ admin_user }}"
- line: "%{{ admin_user }} ALL=(ALL) NOPASSWD: ALL"
- validate: 'visudo -cf %s'
-
-- name: create ssh directory
- file:
- path: "{{ admin_home }}/.ssh/"
- state: directory
- mode: "700"
- owner: "{{ admin_user }}"
- group: "{{ admin_user }}"
-
-- name: copy authorized keys file
- copy:
- src: authorized_keys
- dest: "{{ admin_home }}/.ssh/authorized_keys"
- mode: "600"
- owner: "{{ admin_user }}"
- group: "{{ admin_user }}"
diff --git a/infrastructure/ansible/roles/system/apt_common_tools/README.md b/infrastructure/ansible/roles/system/apt_common_tools/README.md
deleted file mode 100644
index f13008cb3fa..00000000000
--- a/infrastructure/ansible/roles/system/apt_common_tools/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-Installs system tools installed via 'apt' that should be present on all system
-
diff --git a/infrastructure/ansible/roles/system/apt_common_tools/tasks/main.yml b/infrastructure/ansible/roles/system/apt_common_tools/tasks/main.yml
deleted file mode 100644
index bb69b27de41..00000000000
--- a/infrastructure/ansible/roles/system/apt_common_tools/tasks/main.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-- name: Update and upgrade apt packages
- apt:
- upgrade: yes
- update_cache: yes
- cache_valid_time: 86400 # One day, only updates if caches are older than this.
-
-- name: apt install standard utilities and packages
- apt:
- state: present
- autoremove: true
- name:
- # acl installed to help with: "Failed to set permissions on the temporary files
- # Ansible needs to create when becoming an unprivileged user"
- # https://stackoverflow.com/questions/46352173/ansible-failed-to-set-permissions-on-the-temporary
- - acl
- - fail2ban
- - htop
- - iftop
- - unattended-upgrades
- - unzip
diff --git a/infrastructure/ansible/roles/system/firewall/README.md b/infrastructure/ansible/roles/system/firewall/README.md
deleted file mode 100644
index 3a78acb16a1..00000000000
--- a/infrastructure/ansible/roles/system/firewall/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-Enables and configures UFW (fire wall). Ports to be opened for firewall are defined in group_vars by
-server group.
diff --git a/infrastructure/ansible/roles/system/firewall/tasks/main.yml b/infrastructure/ansible/roles/system/firewall/tasks/main.yml
deleted file mode 100644
index 3e3cac4cb7a..00000000000
--- a/infrastructure/ansible/roles/system/firewall/tasks/main.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-- name: UFW allow SSH
- ufw:
- rule: allow
- name: OpenSSH
-
-- name: UFW deny incoming by default
- ufw:
- default: deny
- direction: incoming
-
-- name: UFW allow outgoing by default
- ufw:
- default: allow
- direction: outgoing
-
-- name: turn on ssh rate limiting
- ufw:
- rule: limit
- port: ssh
- proto: tcp
-
-- name: Turn on firewall
- ufw:
- state: enabled
diff --git a/infrastructure/ansible/roles/system/hostname/tasks/main.yml b/infrastructure/ansible/roles/system/hostname/tasks/main.yml
deleted file mode 100644
index e39a46e3e85..00000000000
--- a/infrastructure/ansible/roles/system/hostname/tasks/main.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-- name: set hostname of system
- hostname:
- name: "{{ inventory_hostname }}"
- register: hostname_result
-
-- name: deploy /etc/hosts file with hostname in it
- template:
- src: etc_hosts.j2
- dest: /etc/hosts
- mode: 0755
- owner: root
- group: root
-
-- name: reboot machine for hostname to take effect
- when: hostname_result.changed
- reboot:
-
-
diff --git a/infrastructure/ansible/roles/system/hostname/templates/etc_hosts.j2 b/infrastructure/ansible/roles/system/hostname/templates/etc_hosts.j2
deleted file mode 100644
index 1984784bbd2..00000000000
--- a/infrastructure/ansible/roles/system/hostname/templates/etc_hosts.j2
+++ /dev/null
@@ -1,8 +0,0 @@
-127.0.0.1 {{ inventory_hostname }} localhost
-
-# The following lines are desirable for IPv6 capable hosts
-::1 {{ inventory_hostname }} localhost ip6-localhost ip6-loopback
-ff02::1 ip6-allnodes
-ff02::2 ip6-allrouters
-
-
diff --git a/infrastructure/ansible/roles/system/journald/files/journald.conf b/infrastructure/ansible/roles/system/journald/files/journald.conf
deleted file mode 100644
index 5e2848f1a69..00000000000
--- a/infrastructure/ansible/roles/system/journald/files/journald.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-[Journal]
-#Storage=auto
-#Compress=yes
-#Seal=yes
-#SplitMode=uid
-#SyncIntervalSec=5m
-#RateLimitIntervalSec=30s
-#RateLimitBurst=10000
-#SystemMaxUse=
-SystemMaxUse=500M
-#SystemKeepFree=
-#SystemMaxFileSize=
-#SystemMaxFiles=100
-#RuntimeMaxUse=
-#RuntimeKeepFree=
-#RuntimeMaxFileSize=
-#RuntimeMaxFiles=100
-#MaxRetentionSec=
-#MaxFileSec=1month
-#ForwardToSyslog=yes
-#ForwardToKMsg=no
-#ForwardToConsole=no
-#ForwardToWall=yes
-#TTYPath=/dev/console
-#MaxLevelStore=debug
-#MaxLevelSyslog=debug
-#MaxLevelKMsg=notice
-#MaxLevelConsole=info
-#MaxLevelWall=emerg
-#LineMax=48K
-#ReadKMsg=yes
-
diff --git a/infrastructure/ansible/roles/system/journald/tasks/main.yml b/infrastructure/ansible/roles/system/journald/tasks/main.yml
deleted file mode 100644
index 554c6d0ce0a..00000000000
--- a/infrastructure/ansible/roles/system/journald/tasks/main.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-- name: deploy journald config
- register: journal_conf
- copy:
- src: journald.conf
- dest: /etc/systemd/journald.conf
- mode: 644
- owner: root
- group: root
-
-- name: restart journald if config was changed
- when: journal_conf.changed
- service:
- state: restarted
- name: systemd-journald
-
diff --git a/infrastructure/ansible/site.yml b/infrastructure/ansible/site.yml
deleted file mode 100644
index e930d30072d..00000000000
--- a/infrastructure/ansible/site.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-- hosts: all
- tags: common
- roles:
- - system/apt_common_tools
- - system/hostname
- - system/firewall
- - system/journald
- - system/admin_user
-
-- hosts: forums
- tags: forums
- roles:
- - nginx_forums_conf
-
-- hosts: lobbyServer
- tags: [lobby, lobby_server]
- roles:
- - {name: java, tags: java}
- - {name: postfix, tags: postfix}
- - {name: database/postgres/install, tags: postgres}
- - {name: database/flyway/install, tags: flyway}
- - {name: nginx/install, tags: nginx}
- - {name: lobby_server, tags: lobby_app}
-
-- hosts: botHosts
- tags: [bot, bots]
- roles:
- - java
- - bot
-
diff --git a/infrastructure/create_secret b/infrastructure/create_secret
deleted file mode 100755
index 6853ea0633b..00000000000
--- a/infrastructure/create_secret
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-
-function usage() {
- echo "Usage: ./$0 [variable-name]"
- echo " eg: ./$0 lobby_db_password"
- echo ""
- echo "This script will encode a secret value that can be embedded in ansible"
- echo "and decrypted when ansible runs given the vault password"
- echo ""
- echo "This script expects the secret value to be encrypted to be written"
- echo "to a file called 'secret'"
- echo "This script expects a second file to contain the ansible vault password"
- echo "named 'vault_password'"
- exit 1
-}
-
-variable_name=$1
-
-set -eu
-
-if [ ! -f "secret" ]; then
- echo "Error, file 'secret' should exist containing the secret value to be encrypted"
- exit 1
-fi
-
-if [ ! -f "vault_password" ]; then
- echo "Error, file 'vault_password' should exist containing the ansible vault password"
- exit 1
-fi
-
-if [ -z "$variable_name" ];then
- usage
-fi
-
-if [ ! -z "${2-}" ]; then
- echo "Error, unexpected number of parameters"
- usage
-fi
-
-ansible-vault encrypt_string --vault-password-file vault_password "$(cat secret)" --name "$variable_name"
-
diff --git a/infrastructure/run_ansible b/infrastructure/run_ansible
deleted file mode 100755
index 4c1354fb299..00000000000
--- a/infrastructure/run_ansible
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/bash
-
-set -eu
-
-scriptDir="$(dirname "$0")"
-rootDir="$scriptDir/.."
-readonly ENVIRONMENT_VAGRANT=vagrant
-readonly ENVIRONMENT_PRODUCTION=production
-
-# This script orchestrates deployments via ansible. Fresh artifacts are always built and then deployed.
-
-function usage() {
- echo "usage: $0 [options]"
- echo ""
- echo "Examples:"
- echo "$0 --environment $ENVIRONMENT_VAGRANT"
- echo "$0 --environment $ENVIRONMENT_VAGRANT --diff --dry-run --verbose"
- echo ""
- echo "[options]"
- echo " --environment, --env [$ENVIRONMENT_VAGRANT|$ENVIRONMENT_PRODUCTION]"
- echo " The target environment for the deployment."
- echo " $ENVIRONMENT_VAGRANT is an environment that can be launched locally via a VM"
- echo " --tags, -t [ansible tags]"
- echo " Defaults to the empty set"
- echo " Any tags that should be passed to ansible"
- echo " --diff, -d"
- echo " Ansible reports line-diffs of what has changed"
- echo " --dry-run"
- echo " Sets ansible to 'check' mode, no actual changes are made. Useful with '--diff'"
- echo " This option can cause false positive failures if one action depends on a previous"
- echo " --verbose, -v"
- echo " Shows ansible verbose output, gives more detail about what has changed."
- echo " --limit, -l"
- echo " Limits which servers we deploy to, only these servers will be updated."
- echo " Specify server hostnames, and/or hostgroup names"
- exit 1
-}
-
-
-if [[ $# -eq 0 ]]; then
- usage
-fi
-
-
-DIFF_ARG=""
-DRY_RUN_ARG=""
-ENVIRONMENT=""
-TAGS_ARG=""
-VERBOSE_ARG=""
-LIMIT_ARG=""
-
-while [[ $# -gt 0 ]]; do
- key="$1"
-
- case $key in
- -env|--env|--environment)
- ENVIRONMENT="$2"
- if [[ "$ENVIRONMENT" != "$ENVIRONMENT_PRODUCTION" \
- && "$ENVIRONMENT" != "$ENVIRONMENT_VAGRANT" ]]; then
- echo "Error, invalid value for --environment: $ENVIRONMENT"
- usage
- fi
- shift # past argument
- shift # past value
- ;;
- --tags|-t)
- TAGS_ARG="--tags $2"
- shift # past argument
- shift # past value
- ;;
- --diff|-d|--d)
- DIFF_ARG="--diff"
- shift
- ;;
- --dry-run)
- DRY_RUN_ARG="--check"
- shift
- ;;
- --verbose|-v)
- VERBOSE_ARG="-v"
- shift
- ;;
- --limit|-l)
- LIMIT_ARG="--limit $2"
- shift
- shift
- ;;
- *)
- echo "Error, unknown option: $1"
- exit 1
- ;;
- esac
-done
-
-if [ -z "$ENVIRONMENT" ]; then
- echo "Missing arg: --environment"
- usage
-fi
-
-# If we are deploying to non-vagrant environment then we will need
-# an ansible vault passphrase value to decrypt secrets.
-VAULT_PASSWORD_FILE_ARG=""
-if [ "$ENVIRONMENT" == "$ENVIRONMENT_PRODUCTION" ]; then
- VAULT_PASSWORD_FILE="$rootDir/infrastructure/vault_password"
- if [ ! -f "$VAULT_PASSWORD_FILE" ]; then
- echo "Deployments to production environment requires vault password file: $VAULT_PASSWORD_FILE"
- exit 1
- fi
-
- VAULT_PASSWORD_FILE_ARG="--vault-password-file $VAULT_PASSWORD_FILE"
- readonly VAULT_PASSWORD_FILE_ARG
-fi
-
-"$scriptDir/.include/build_latest_artifacts"
-BUILD_VERSION=$("$rootDir/.build/get-build-version")
-PRODUCT_VERSION=$("$rootDir/.build/get-product-version")
-
-# Run deployment
-set -x
-ANSIBLE_CONFIG="$scriptDir/ansible.cfg" ansible-playbook \
- --extra-vars "build_version=$BUILD_VERSION" \
- --extra-vars "product_version=$PRODUCT_VERSION" \
- --inventory "$scriptDir/ansible/inventory/$ENVIRONMENT" $DRY_RUN_ARG $LIMIT_ARG \
- $VAULT_PASSWORD_FILE_ARG $TAGS_ARG $DIFF_ARG $VERBOSE_ARG "$scriptDir/ansible/site.yml"
-set +x
diff --git a/infrastructure/update_bots.sh b/infrastructure/update_bots.sh
deleted file mode 100755
index 9ac5ee5fa9f..00000000000
--- a/infrastructure/update_bots.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-# This script will download all maps to all bots.
-# Requires no args to run, intended to be run from Github Actions (via the web interface of Github)
-
-set -eu
-
-scriptDir="$(dirname "$0")"
-rootDir="$scriptDir/.."
-
-VAULT_PASSWORD_FILE="$rootDir/infrastructure/vault_password"
-if [ ! -f "$VAULT_PASSWORD_FILE" ]; then
- echo "Deployments to production environment requires vault password file: $VAULT_PASSWORD_FILE"
- exit 1
-fi
-
-set -x
-ANSIBLE_CONFIG="$scriptDir/ansible.cfg" ansible-playbook \
- --inventory "$scriptDir/ansible/inventory/production" --limit botHosts \
- --vault-password-file "$VAULT_PASSWORD_FILE" \
- --tags update_maps \
- "$scriptDir/ansible/site.yml"
-set +x
diff --git a/infrastructure/vagrant/README.md b/infrastructure/vagrant/README.md
deleted file mode 100644
index 6c69a695fad..00000000000
--- a/infrastructure/vagrant/README.md
+++ /dev/null
@@ -1,93 +0,0 @@
-## Local Development with Vagrant
-
-Vagrant allows you to launch virtual machines via CLI. This can be used
-to simulate deployments to a production server.
-
-Vagrant typically interacts with VM software like VirtualBox which is
-the software that is actually launching the virtual machine.
-
-## Quick Start
-
-### Installation
-
-```bash
-sudo apt install -y virtualbox ansible
-```
-
-Install Vagrant from [vagrant download site](https://www.vagrantup.com/downloads.html)
-
-
-### Start VM & Run Deployment
-
-```bash
-cd .../triplea/infrastructure/vagrant
-vagrant up
-cd ..
-./run_ansible --env vagrant
-```
-
-Once the above is completed, vagrant will have launched a VM and ansible
-will have deployed a full lobby server to the machine, available at:
-`https://localhost:8000`
-
-To access the VM:
-
-```bash
-cd .../triplea/infrastructure/vagrant
-vagrant ssh
-```
-
-*Note*, you may need to do some chowning to be able to run virtualbox as non-root:
-
-```bash
-sudo chown $USER:$USER -R ~/.vagrant.d/
-sudo chown $USER:$USER -R ~/triplea/infrastructure/.vagrant/
-```
-
-### More Useful Commands
-
-
-```bash
-cd ~/triplea/infrastructure/vagrant
-
-## check status of vagrant VMs:
-localhost$ vagrant status
-
-## vagrant ssh will connect you to the running virtualbox instance
-localhost$ vagrant ssh
-
-## check apps are running
-vagrant$ ps -ef | grep java
-
-## check lobby logs
-vagrant$ journalctl -f -u triplea-lobby
-
-## log in to database and verify DB and tables exist
-vagrant$ sudo -u postgres psql
-```
-
-```bash
-# Halt the Virtual Server
-cd ~/triplea/infrastructure/vagrant
-vagrant halt
-
-# Clean / Destroy Virtual Servers
-cd ~/triplea/infrastructure/vagrant
-vagrant destroy -f
-```
-
-## Troubleshooting
-
-### VM Won't Start
-
-- Open VirtualBox, the VM should be listed there and you can open a console to
- the VM from VirtualBox which will show you the latest console output from
- the VM. This console output may give an indication of what is happening
-- Sometimes bringing the VM down and recreating it is the way to go:
-
-```bash
-cd triplea/infrastructure/vagrant/
-vagrant halt
-vagrant destroy
-vagrant up
-```
diff --git a/infrastructure/vagrant/Vagrantfile b/infrastructure/vagrant/Vagrantfile
deleted file mode 100644
index d0fb2f3d2e6..00000000000
--- a/infrastructure/vagrant/Vagrantfile
+++ /dev/null
@@ -1,15 +0,0 @@
-Vagrant.configure("2") do |config|
- config.vm.box = "bento/ubuntu-20.04"
-
- config.vm.provider "virtualbox" do |vb|
- vb.cpus = "2"
- end
-
- config.vm.define "vagrantHost" do |vagrantHost|
- vagrantHost.vm.network "forwarded_port", guest: 22, host: 2010, host_ip: "127.0.0.1", id: "ssh"
- vagrantHost.vm.network "forwarded_port", guest: 4001, host: 4100, host_ip: "127.0.0.1"
- vagrantHost.vm.network "forwarded_port", guest: 443, host: 8000, host_ip: "127.0.0.1"
- vagrantHost.vm.network "forwarded_port", guest: 8080, host: 8008, host_ip: "127.0.0.1"
- end
-end
-
diff --git a/node-bb/Dockerfile b/node-bb/Dockerfile
deleted file mode 100644
index b761d9991c2..00000000000
--- a/node-bb/Dockerfile
+++ /dev/null
@@ -1,20 +0,0 @@
-FROM nodebb/docker:v1.13.3
-
-WORKDIR /usr/src/app
-
-ARG NODE_ENV
-ENV NODE_ENV $NODE_ENV
-
-COPY install/package.json /usr/src/app/package.json
-
-RUN npm install --only=prod && \
- npm cache clean --force
-
-ENV NODE_ENV=production \
- daemon=false \
- silent=false
-
-EXPOSE 4567
-
-CMD node ./nodebb build ; node ./nodebb start
-
diff --git a/node-bb/README.md b/node-bb/README.md
deleted file mode 100644
index 9d70f4506de..00000000000
--- a/node-bb/README.md
+++ /dev/null
@@ -1,179 +0,0 @@
-# TripleA Forums
-
-The software that powers the TripleA Forums is [NodeBB](https://github.com/NodeBB/NodeBB).
-This document is instructions on how to build and run the Docker container of the forums using an
-[official Docker container of NodeBB](https://hub.docker.com/r/nodebb/docker) as the base image.
-
-## Building
-
-1. Build the Docker image using the command ```docker build -t triplea-forums:latest .```
-
-2. Make a directory on your machine for where the config file and upload folder will live. ```mkdir -p /opt/triple-forums```
-
-3. Make a directory for uploaded files. Inside the upload directory, create folders category, emoji, files, profile,
-sounds, and system.
-
-```shell script
-mkdir -p /opt/triple-forums/uploads/category
-mkdir -p /opt/triple-forums/uploads/emoji
-mkdir -p /opt/triple-forums/uploads/files
-mkdir -p /opt/triple-forums/uploads/profile
-mkdir -p /opt/triple-forums/uploads/sounds
-mkdir -p /opt/triple-forums/uploads/system
-```
-
-### Running
-
-#### First time run
-
-You will need a running Mongo database locally or in a Docker container. See [MongoDB](#mongodb) for how to do this.
-
-1. Run the triplea-forums:latest image using the command
-```docker run -d --rm --name triplea-forums -v /opt/triple-forums/uploads:/usr/src/app/public/uploads -p 8080:4567 triplea-forums:latest```
-
-2. Navigate to [http://0.0.0.0:8080/](http://0.0.0.0:8080/). This is the install and configuration screen for NodeBB.
-
-3. Fill out the details on the page.
-
-4. Once the configuration is complete, you will need to save the config.json file off the container to the folder you
-created earlier. Run ```docker container cp triplea-forums:/usr/src/app/config.json /opt/triplea-forums```
-
-#### Second and later runs
-
-1. If you did not save the config.json from before, you can make a copy of the example/config.json
-and update it per the instructions in [Configuration](#configuration) section.
-```cp example/config.json /opt/triplea-forums/config.json```
-
-2. With the config.json run the triplea-forums:latest image using the command
-```docker run -d --rm --name triplea-forums -v /opt/triple-forums/config.json:/usr/src/app/config.json -v /opt/triple-forums/uploads:/usr/src/app/public/uploads -p 8080:4567 triplea-forums:latest```
-
-### Stopping
-
-To stop the running container, run the following: ```docker stop triplea-forums```
-
-### MongoDB
-
-Mongo is the database that backs triplea-forums. You can install and run a local copy by following the
-instructions [here](https://docs.mongodb.com/manual/installation/) or you can run a Docker image with Mongo already
-installed.
-
-Before running the Docker image it is important to know which version of Mongo you want to run. As of this writing the
-latest version is 4.4. In most cases running that will be fine however if you need a different version, you can find
-the list of Docker image versions on [https://hub.docker.com/_/mongo](https://hub.docker.com/_/mongo).
-
-#### Mac OSX and Windows
-
-This command will start the Docker container:
-```shell script
-docker run --rm --name mongodb -p 27017:27017 -d mongo:4.4
-```
-
-To stop the container, run ```docker stop mongodb```
-
-The data saved will persist between shutdowns because it is being saved in the VirtualBox instance running on your os.
-For more information on that, see the section Where to Store Data at
-[https://hub.docker.com/_/mongo](https://hub.docker.com/_/mongo).
-
-#### Linux and Unix
-
-While Linux and Unix can use the same command as Mac OSX to start the container, the data stored is not in VirtualBox.
-Instead, it is stored directly on the host at `/var/lib/docker/volumes/{volume hash}/_data`. It's far easier for backup
-purposes if you mount a volume directory for storing the data. The below command uses a volume mount.
-
-This command will start the Docker container:
-
-```shell script
-docker run --rm --name mongodb -p 27017:27017 -v /opt/triple-forums/datadir:/data/db -d mongo:4.4
-```
-
-To stop the container, run ```docker stop mongodb```
-
-The data saved is stored in the volume path you specify with the `-v` flag. In this case `/opt/triple-forums/datadir`.
-
-### NodeBB
-
-The table below lists the version of NodeBB that TripleA Forums is currently running. This document
-is written to that version.
-
-| TripleA Forums | NodeBB Version | Package Json |
-|----------------|----------------|-------------------------------------------------------------------------------------------|
-| Current | 1.13.3 | [package.json source](https://github.com/NodeBB/NodeBB/blob/v1.13.3/install/package.json) |
-| Future | 1.14.3 | [package.json source](https://github.com/NodeBB/NodeBB/blob/v1.14.3/install/package.json) |
-
-#### Upgrading To A Newer NodeBB Version
-
-Upgrading to a newer version uses the following process:
-
-1. Change the version of the FROM image in the Dockerfile to the newer version of NodeBB.
-2. Update the install/package.json to use packages from the newer versions package.json source.
-3. Replace the nodebb-plugins in the install/package.json with the current list of plugins used for TripleA Forums.
-4. Run Docker build to create the new image.
-
-#### Plugins
-
-NodeBB customizations are plugins which are installed either through the admin interface or by adding them
-to package.json directly. For the TripleA Forums, they are installed through the package.json.
-
-#### Installing/Upgrading A Plugin
-
-Installing or grading a plugin use the following process:
-
-1. Update the install/package.json to use the newer plugin.
-2. Run Docker build to create the new image.
-
-##### List of currently installed plugins
-
-NOTE: *Refer to install/package.json for the most up to date list.*
-
-```json
-{
-"nodebb-plugin-2factor": "^2.7.2",
-"nodebb-plugin-cards": "0.2.2",
-"nodebb-plugin-composer-default": "6.3.25",
-"nodebb-plugin-custom-pages": "^1.1.3",
-"nodebb-plugin-dbsearch": "4.0.7",
-"nodebb-plugin-desktop-notifications": "^0.3.3",
-"nodebb-plugin-emoji": "^3.3.0",
-"nodebb-plugin-emoji-android": "2.0.0",
-"nodebb-plugin-emoji-one": "^2.0.0",
-"nodebb-plugin-featured-threads": "0.2.1",
-"nodebb-plugin-github-embed": "^0.7.5",
-"nodebb-plugin-gravatar": "^2.2.4",
-"nodebb-plugin-markdown": "8.11.2",
-"nodebb-plugin-mentions": "2.7.4",
-"nodebb-plugin-newsletter": "^0.8.1",
-"nodebb-plugin-ns-embed": "^4.0.0",
-"nodebb-plugin-ns-login": "^3.0.0",
-"nodebb-plugin-poll": "^0.3.3",
-"nodebb-plugin-shoutbox": "^0.3.4",
-"nodebb-plugin-soundpack-default": "1.0.0",
-"nodebb-plugin-spam-be-gone": "0.6.7",
-"nodebb-plugin-sso-facebook": "^3.5.1",
-"nodebb-plugin-sso-github2": "2.0.2",
-"nodebb-plugin-sso-google": "^2.4.1",
-"nodebb-plugin-sso-twitter": "^2.5.8"
-}
-```
-
-#### Configuration
-
-The NodeBB configuration is a JSON file, ```config.json```, which is kept at the root of the NodeBB install.
-An example of that file can be found at ```example/config.json```. Information on all the configuration
-options for NodeBB can be found [here](https://docs.nodebb.org/configuring/config/).
-
-Copy the example/config.json file to a location of your choice. Edit the file to update the parameters for the database.
-
-**Key points of the configuration to remember**:
-
-1. The *url* parameter is referencing the address NodeBB is binding to inside the Docker container. This is different
-from the address of the host machine.
-
-2. The *port* parameter is referencing the port NodeBB is listening on inside the Docker container. This does not
-have to be the same port on the host machine. Docker maps the host machine port to the container port.
-
-3. Database (Mongo) parameters *host* and *port* are referring to the address and port of the machine
-Mongo is running on.
-
-4. The *upload_path* parameter should not be used. If you set this parameter, you will need to update where inside the
-container your volume needs to mount. Depending on where you change that location too, you might have to edit the
-Dockerfile to create the directory.
diff --git a/node-bb/example/config.json b/node-bb/example/config.json
deleted file mode 100644
index f18498f5d4b..00000000000
--- a/node-bb/example/config.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "url": "http://0.0.0.0:8080",
- "secret": "6c5e0d10-ea73-4835-bf2b-51979001fbd8",
- "database": "mongo",
- "port": "8080",
- "mongo": {
- "host": "192.168.1.231",
- "port": "27017",
- "username": "",
- "password": "",
- "database": "nodebb",
- "uri": ""
- }
-}
\ No newline at end of file
diff --git a/node-bb/install/package.json b/node-bb/install/package.json
deleted file mode 100644
index 40cc80a9330..00000000000
--- a/node-bb/install/package.json
+++ /dev/null
@@ -1,214 +0,0 @@
-{
- "name": "nodebb",
- "license": "GPL-3.0",
- "description": "NodeBB Forum",
- "version": "1.13.3",
- "homepage": "http://www.nodebb.org",
- "repository": {
- "type": "git",
- "url": "https://github.com/NodeBB/NodeBB/"
- },
- "main": "app.js",
- "scripts": {
- "start": "node loader.js",
- "lint": "eslint --cache ./nodebb .",
- "pretest": "npm run lint",
- "test": "nyc --reporter=html --reporter=text-summary mocha",
- "coveralls": "nyc report --reporter=text-lcov | coveralls && rm -r coverage"
- },
- "dependencies": {
- "@nodebb/mubsub": "^1.6.0",
- "ace-builds": "^1.4.9",
- "archiver": "^4.0.0",
- "async": "^3.2.0",
- "autoprefixer": "^9.7.6",
- "bcryptjs": "2.4.3",
- "benchpressjs": "^2.0.2",
- "body-parser": "^1.19.0",
- "bootstrap": "^3.4.1",
- "bootswatch": "git://github.com/thomaspark/bootswatch.git#c41a8f066feb8950c6f9c6bcf5a3c37d1085404e",
- "chart.js": "^2.9.3",
- "cli-graph": "^3.2.2",
- "clipboard": "^2.0.6",
- "colors": "^1.4.0",
- "commander": "^5.0.0",
- "compression": "^1.7.4",
- "connect-ensure-login": "^0.1.1",
- "connect-flash": "^0.1.1",
- "connect-mongo": "3.2.0",
- "connect-multiparty": "^2.2.0",
- "connect-pg-simple": "^6.1.0",
- "connect-redis": "4.0.4",
- "continuation-local-storage": "^3.2.1",
- "cookie-parser": "^1.4.5",
- "cron": "^1.8.2",
- "cropperjs": "^1.5.6",
- "csurf": "^1.11.0",
- "daemon": "^1.1.0",
- "diff": "^4.0.2",
- "express": "^4.17.1",
- "express-session": "^1.17.0",
- "express-useragent": "^1.0.13",
- "graceful-fs": "^4.2.3",
- "helmet": "^3.22.0",
- "html-to-text": "^5.1.1",
- "ipaddr.js": "^1.9.1",
- "jimp": "0.2.28",
- "jquery": "3.5.1",
- "jsesc": "3.0.1",
- "json-2-csv": "^3.6.2",
- "jsonwebtoken": "^8.5.1",
- "less": "^3.11.1",
- "lodash": "^4.17.15",
- "logrotate-stream": "^0.2.6",
- "lru-cache": "5.1.1",
- "material-design-lite": "^1.3.0",
- "mime": "^2.4.4",
- "minimist": "^1.2.0",
- "mkdirp": "^1.0.4",
- "mongodb": "3.5.7",
- "morgan": "^1.10.0",
- "mousetrap": "^1.6.5",
- "mubsub": "^1.4.0",
- "mubsub-nbb": "^1.5.0",
- "nconf": "^0.10.0",
- "nodebb-plugin-2factor": "^2.7.2",
- "nodebb-plugin-cards": "0.2.2",
- "nodebb-plugin-composer-default": "6.3.25",
- "nodebb-plugin-custom-pages": "^1.1.3",
- "nodebb-plugin-dbsearch": "4.0.7",
- "nodebb-plugin-desktop-notifications": "^0.3.3",
- "nodebb-plugin-emoji": "^3.3.0",
- "nodebb-plugin-emoji-android": "2.0.0",
- "nodebb-plugin-emoji-one": "^2.0.0",
- "nodebb-plugin-featured-threads": "0.2.1",
- "nodebb-plugin-github-embed": "^0.7.5",
- "nodebb-plugin-gravatar": "^2.2.4",
- "nodebb-plugin-markdown": "8.11.2",
- "nodebb-plugin-mentions": "2.7.4",
- "nodebb-plugin-newsletter": "^0.8.1",
- "nodebb-plugin-ns-embed": "^4.0.0",
- "nodebb-plugin-ns-login": "^3.0.0",
- "nodebb-plugin-poll": "^0.3.3",
- "nodebb-plugin-shoutbox": "^0.3.4",
- "nodebb-plugin-soundpack-default": "1.0.0",
- "nodebb-plugin-spam-be-gone": "0.6.7",
- "nodebb-plugin-sso-facebook": "^3.5.1",
- "nodebb-plugin-sso-github2": "2.0.2",
- "nodebb-plugin-sso-google": "^2.4.1",
- "nodebb-plugin-sso-twitter": "^2.5.8",
- "nodebb-plugin-trophies-updated": "0.0.4",
- "nodebb-plugin-user-invitations": "^0.6.0",
- "nodebb-plugin-write-api": "^5.7.4",
- "nodebb-rewards-essentials": "0.1.3",
- "nodebb-theme-lavender": "5.0.11",
- "nodebb-theme-persona": "10.1.39",
- "nodebb-theme-slick": "1.2.29",
- "nodebb-theme-vanilla": "11.1.16",
- "nodebb-widget-essentials": "4.1.0",
- "nodebb-widget-ns-stats": "^3.0.0",
- "nodebb-widget-user-subset": "1.0.1",
- "nodemailer": "^6.4.6",
- "passport": "^0.4.1",
- "passport-local": "1.0.0",
- "pg": "^8.0.2",
- "pg-cursor": "^2.1.9",
- "postcss": "8.4.31",
- "postcss-clean": "1.1.0",
- "promise-polyfill": "^8.1.3",
- "prompt": "^1.0.0",
- "redis": "3.1.1",
- "request": "2.88.2",
- "request-promise-native": "^1.0.8",
- "rimraf": "3.0.2",
- "rss": "^1.2.2",
- "sanitize-html": "^1.23.0",
- "semver": "^7.2.1",
- "serve-favicon": "^2.5.0",
- "sharp": "0.32.6",
- "sitemap": "^6.1.0",
- "socket.io": "2.4.0",
- "socket.io-adapter-cluster": "^1.0.1",
- "socket.io-adapter-mongo": "^2.0.5",
- "socket.io-adapter-postgres": "^1.2.1",
- "socket.io-client": "2.3.0",
- "socket.io-redis": "5.2.0",
- "socketio-wildcard": "2.0.0",
- "spdx-license-list": "^6.1.0",
- "spider-detector": "2.0.0",
- "textcomplete": "^0.17.1",
- "textcomplete.contenteditable": "^0.1.1",
- "toobusy-js": "^0.5.1",
- "uglify-es": "^3.3.9",
- "uglify-js": "^3.3.4",
- "util.promisify": "1.0.0",
- "validator": "13.7.0",
- "winston": "3.2.1",
- "xml": "^1.0.1",
- "xregexp": "^4.3.0",
- "zxcvbn": "^4.4.2"
- },
- "devDependencies": {
- "@apidevtools/swagger-parser": "9.0.1",
- "@commitlint/cli": "8.3.5",
- "@commitlint/config-angular": "8.3.4",
- "coveralls": "3.1.0",
- "eslint": "6.8.0",
- "eslint-config-airbnb-base": "14.1.0",
- "eslint-plugin-import": "2.20.2",
- "grunt": "1.5.3",
- "grunt-contrib-watch": "1.1.0",
- "husky": "4.2.5",
- "jsdom": "16.5.0",
- "lint-staged": "10.2.0",
- "mocha": "7.1.2",
- "mocha-lcov-reporter": "1.3.0",
- "nyc": "15.0.1",
- "smtp-server": "3.6.0"
- },
- "bugs": {
- "url": "https://github.com/NodeBB/NodeBB/issues"
- },
- "engines": {
- "node": ">=8"
- },
- "maintainers": [
- {
- "name": "Andrew Rodrigues",
- "email": "andrew@nodebb.org",
- "url": "https://github.com/psychobunny"
- },
- {
- "name": "Julian Lam",
- "email": "julian@nodebb.org",
- "url": "https://github.com/julianlam"
- },
- {
- "name": "Barış Soner Uşaklı",
- "email": "baris@nodebb.org",
- "url": "https://github.com/barisusakli"
- }
- ],
- "husky": {
- "hooks": {
- "pre-commit": "lint-staged",
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
- }
- },
- "lint-staged": {
- "*.js": [
- "eslint --fix",
- "git add"
- ]
- }
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/servers/README-WIP.md b/servers/README-WIP.md
deleted file mode 100644
index 855c4c35339..00000000000
--- a/servers/README-WIP.md
+++ /dev/null
@@ -1,12 +0,0 @@
-/servers folder is a WIP
-
-The folder will contain a subdirectory for each server that we will be deploying.
-
-Currently we have things bundled as largely just one server.
-
-This folder is not yet used, it is a start of an effort to break this up and re-organize
-the code a bit to be yet more modular.
-
-Further, with very specific sub-folders and more executables, we will have more opportunity
-to do continuous deployments on any update without having to worry for example about
-disconnecting everyone from chat.
diff --git a/servers/game-support/README.md b/servers/game-support/README.md
deleted file mode 100644
index 19571569d7c..00000000000
--- a/servers/game-support/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-## Error Reporting Server - Overview
-
-The error reporting service allows game clients to submit crash reports that are then entered
-into Github Issues. For the most part the service is an intermediary between the TripleA UI
-and the web-api for Github Issues.
-
-The service provides throttling, it keeps tracks of error reports that have been submitted
-and will allow only so many for a given window of time from a given user.
diff --git a/servers/game-support/server/Dockerfile b/servers/game-support/server/Dockerfile
deleted file mode 100644
index 1ba692a2b8e..00000000000
--- a/servers/game-support/server/Dockerfile
+++ /dev/null
@@ -1,6 +0,0 @@
-FROM openjdk:11-jre-slim-buster
-
-EXPOSE 8080
-ADD configuration.yml /
-ADD build/libs/game-support-server.jar /
-CMD java -jar game-support-server.jar server /configuration.yml
diff --git a/servers/game-support/server/build.gradle b/servers/game-support/server/build.gradle
deleted file mode 100644
index 5d7a7c19686..00000000000
--- a/servers/game-support/server/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-plugins {
- id "application"
- id "com.github.johnrengelman.shadow" version "7.1.2"
-}
-
-archivesBaseName = "game-support-server"
-mainClassName = "org.triplea.server.GameSupportServerApplication"
-ext {
- releasesDir = file("$buildDir/releases")
-}
-
-jar {
- manifest {
- attributes "Main-Class": mainClassName
- }
-}
-
-task portableInstaller(type: Zip, group: "release", dependsOn: shadowJar) {
- from file("configuration.yml")
-
- from(shadowJar.outputs) {
- into "bin"
- }
-}
-
-task release(group: "release", dependsOn: portableInstaller) {
- doLast {
- publishArtifacts(portableInstaller.outputs.files)
- }
-}
-
-shadowJar {
- archiveClassifier.set ""
- // mergeServiceFiles is needed by dropwizard
- // Without this configuration parsing breaks and is unable to find connector type "http" for
- // the following YAML snippet: server: {applicationConnectors: [{type: http, port: 8080}]
- mergeServiceFiles()
-}
-
-configurations {
- testImplementation {
- // database-rider brings in slf4j-simple as a transitive dependency
- // DropWizard has logback baked in and cannot have multiple slf4j bindings.
- exclude group: "org.slf4j", module: "slf4j-simple"
- }
-}
-
-
-dependencies {
- implementation "io.dropwizard:dropwizard-core:$dropwizardVersion"
- implementation "io.dropwizard:dropwizard-jdbi3:$dropwizardVersion"
- implementation project(":http-clients:github-client")
- implementation project(":lib:http-client-lib")
- implementation project(":servers:game-support:client")
- implementation project(":servers:server-lib")
-
- runtimeOnly "org.postgresql:postgresql:$postgresqlVersion"
-
- testImplementation "com.github.database-rider:rider-junit5:$databaseRiderVersion"
- testImplementation "io.dropwizard:dropwizard-testing:$dropwizardVersion"
- testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
- testImplementation project(":lib:test-common")
- testImplementation project(":servers:server-test-support")
- testImplementation project(":spitfire-server:database-test-support")
-}
diff --git a/servers/game-support/server/configuration.yml b/servers/game-support/server/configuration.yml
deleted file mode 100644
index b5f4e8a22f9..00000000000
--- a/servers/game-support/server/configuration.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-githubApiToken: ${GITHUB_API_TOKEN:-}
-githubWebServiceUrl: https://api.github.com
-githubGameOrg: triplea-game
-githubGameRepo: triplea
-
-# When disabled, API calls to github to create error reports will not
-# be made and instead a hardcoded value returned.
-errorReportToGithubEnabled: ${ERROR_REPORT_TO_GITHUB_ENABLED:-false}
-
-
-database:
- driverClass: org.postgresql.Driver
- user: ${DATABASE_USER:-error_report_user}
- password: ${DATABASE_PASSWORD:-error_report}
- url: jdbc:postgresql://${DB_URL:-localhost:5432/error_report}
- properties:
- charSet: UTF-8
-
- # the maximum amount of time to wait on an empty pool before throwing an exception
- maxWaitForConnection: 1s
-
- # the SQL query to run when validating a connection's liveness
- validationQuery: select 1
-
- # the minimum number of connections to keep open
- minSize: 8
-
- # the maximum number of connections to keep open
- maxSize: 32
-
- # whether or not idle connections should be validated
- checkConnectionWhileIdle: false
-
- # the amount of time to sleep between runs of the idle connection validation, abandoned cleaner and idle pool resizing
- evictionInterval: 10s
-
- # the minimum amount of time an connection must sit idle in the pool before it is eligible for eviction
- minIdleTime: 1 minute
-
-
-logging:
- # The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL.
- level: INFO
- loggers:
- # Set this to DEBUG to troubleshoot HTTP 400 "Unable to process JSON" errors.
- io.dropwizard.jersey.jackson.JsonProcessingExceptionMapper: INFO
-
-server:
- applicationConnectors:
- - type: http
- port: ${HTTP_PORT:-8080}
- # useForwardedHeaders is important for when behind a reverse proxy (NGINX)
- # Without this 'getRemoteAddr' will return the IP of the reverse proxy server.
- # By default when building locally useForwardedPorts should be 'false', but
- # for all other environments that do have a NGINX server, the value should be
- # set to true.
- useForwardedHeaders: ${USE_FORWARDED_HEADERS:-false}
- adminConnectors: []
diff --git a/servers/game-support/server/src/main/java/org/triplea/server/GameSupportServerApplication.java b/servers/game-support/server/src/main/java/org/triplea/server/GameSupportServerApplication.java
deleted file mode 100644
index bbb38deff43..00000000000
--- a/servers/game-support/server/src/main/java/org/triplea/server/GameSupportServerApplication.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.triplea.server;
-
-import io.dropwizard.Application;
-import io.dropwizard.jdbi3.JdbiFactory;
-import io.dropwizard.setup.Bootstrap;
-import io.dropwizard.setup.Environment;
-import java.net.URI;
-import org.jdbi.v3.core.Jdbi;
-import org.triplea.dropwizard.common.ServerConfiguration;
-import org.triplea.http.client.github.GithubApiClient;
-import org.triplea.server.error.reporting.ErrorReportController;
-
-public class GameSupportServerApplication extends Application {
- private static final String[] DEFAULT_ARGS = new String[] {"server", "configuration.yml"};
-
- private ServerConfiguration serverConfiguration;
-
- /**
- * Main entry-point method, launches the drop-wizard http server. If no args are passed then will
- * use default values suitable for local development.
- */
- public static void main(String[] args) throws Exception {
- final GameSupportServerApplication application = new GameSupportServerApplication();
- // if no args are provided then we will use default values.
- application.run(args.length == 0 ? DEFAULT_ARGS : args);
- }
-
- @Override
- public void initialize(Bootstrap bootstrap) {
- serverConfiguration =
- ServerConfiguration.build(bootstrap)
- .enableBetterJdbiExceptions()
- .enableEnvironmentVariablesInConfig();
- }
-
- @Override
- public void run(GameSupportServerConfiguration configuration, Environment environment) {
- serverConfiguration.enableEnvironmentVariablesInConfig();
-
- final Jdbi jdbi =
- new JdbiFactory()
- .build(environment, configuration.getDatabase(), "postgresql-connection-pool");
-
- var githubApiClient =
- GithubApiClient.builder()
- .authToken(configuration.getGithubApiToken())
- .uri(URI.create(configuration.getGithubWebServiceUrl()))
- .repo(configuration.getGithubGameRepo())
- .stubbingModeEnabled(!configuration.getErrorReportToGithubEnabled())
- .org(configuration.getGithubGameOrg())
- .build();
-
- environment.jersey().register(ErrorReportController.build(githubApiClient, jdbi));
- }
-}
diff --git a/servers/game-support/server/src/main/java/org/triplea/server/GameSupportServerConfiguration.java b/servers/game-support/server/src/main/java/org/triplea/server/GameSupportServerConfiguration.java
deleted file mode 100644
index 3c4b5dcbbd8..00000000000
--- a/servers/game-support/server/src/main/java/org/triplea/server/GameSupportServerConfiguration.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.triplea.server;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.dropwizard.Configuration;
-import io.dropwizard.db.DataSourceFactory;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import lombok.Data;
-import lombok.Getter;
-
-@Data
-public class GameSupportServerConfiguration extends Configuration {
-
- String githubApiToken;
- String githubWebServiceUrl;
-
- String githubGameOrg; // : triplea-game
- String githubGameRepo; // triplea
- String githubMapsOrgName; // : triplea-maps
-
- Boolean errorReportToGithubEnabled;
-
- @Valid @NotNull @JsonProperty @Getter DataSourceFactory database = new DataSourceFactory();
-}
diff --git a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/ErrorReportController.java b/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/ErrorReportController.java
deleted file mode 100644
index 4524d96a554..00000000000
--- a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/ErrorReportController.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.triplea.server.error.reporting;
-
-import java.util.function.Function;
-import javax.annotation.Nonnull;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import lombok.Builder;
-import org.jdbi.v3.core.Jdbi;
-import org.triplea.dropwizard.common.IpAddressExtractor;
-import org.triplea.http.client.error.report.CanUploadErrorReportResponse;
-import org.triplea.http.client.error.report.CanUploadRequest;
-import org.triplea.http.client.error.report.ErrorReportClient;
-import org.triplea.http.client.error.report.ErrorReportRequest;
-import org.triplea.http.client.error.report.ErrorReportResponse;
-import org.triplea.http.client.github.GithubApiClient;
-import org.triplea.http.client.lib.ClientIdentifiers;
-import org.triplea.server.error.reporting.upload.CanUploadErrorReportStrategy;
-import org.triplea.server.error.reporting.upload.CreateIssueParams;
-import org.triplea.server.error.reporting.upload.ErrorReportModule;
-
-/** Http controller that binds the error upload endpoint with the error report upload handler. */
-@Path("/")
-@Consumes(MediaType.APPLICATION_JSON)
-@Produces(MediaType.APPLICATION_JSON)
-@Builder
-public class ErrorReportController {
- @Nonnull private final ErrorReportModule errorReportIngestion;
- @Nonnull private final Function canReportModule;
-
- /** Factory method. */
- public static ErrorReportController build(GithubApiClient githubApiClient, Jdbi jdbi) {
- return ErrorReportController.builder()
- .errorReportIngestion(ErrorReportModule.build(githubApiClient, jdbi))
- .canReportModule(CanUploadErrorReportStrategy.build(jdbi))
- .build();
- }
-
- @POST
- @Path(ErrorReportClient.CAN_UPLOAD_ERROR_REPORT_PATH)
- public CanUploadErrorReportResponse canUploadErrorReport(CanUploadRequest canUploadRequest) {
- if (canUploadRequest == null
- || canUploadRequest.getErrorTitle() == null
- || canUploadRequest.getGameVersion() == null) {
- throw new IllegalArgumentException("Missing request attributes title or game version");
- }
-
- return canReportModule.apply(canUploadRequest);
- }
-
- /**
- * Endpoint where users can submit an error report, the server will use an API token of a generic
- * user to in turn create a GitHub issue using the data from the error report.
- */
- @POST
- @Path(ErrorReportClient.ERROR_REPORT_PATH)
- public ErrorReportResponse uploadErrorReport(
- @Context HttpServletRequest request, ErrorReportRequest errorReport) {
-
- if (errorReport == null
- || errorReport.getBody() == null
- || errorReport.getTitle() == null
- || errorReport.getGameVersion() == null) {
- throw new IllegalArgumentException("Missing attribute, body, title, or game version");
- }
-
- return errorReportIngestion.createErrorReport(
- CreateIssueParams.builder()
- .ip(IpAddressExtractor.extractIpAddress(request))
- .systemId(request.getHeader(ClientIdentifiers.VERSION_HEADER))
- .errorReportRequest(errorReport)
- .build());
- }
-}
diff --git a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/CanUploadErrorReportStrategy.java b/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/CanUploadErrorReportStrategy.java
deleted file mode 100644
index 0042db1a835..00000000000
--- a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/CanUploadErrorReportStrategy.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.triplea.server.error.reporting.upload;
-
-import java.util.function.Function;
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import org.jdbi.v3.core.Jdbi;
-import org.triplea.http.client.error.report.CanUploadErrorReportResponse;
-import org.triplea.http.client.error.report.CanUploadRequest;
-
-/**
- * Answers the question if a user can upload an error report. If the given title and version already
- * exist, then a user cannot upload a (duplicate) error report.
- */
-@AllArgsConstructor(access = AccessLevel.PROTECTED)
-public class CanUploadErrorReportStrategy
- implements Function {
-
- private final ErrorReportingDao errorReportingDao;
-
- public static CanUploadErrorReportStrategy build(final Jdbi jdbi) {
- return new CanUploadErrorReportStrategy(jdbi.onDemand(ErrorReportingDao.class));
- }
-
- @Override
- public CanUploadErrorReportResponse apply(final CanUploadRequest canUploadRequest) {
- return errorReportingDao
- .getErrorReportLink(canUploadRequest.getErrorTitle(), canUploadRequest.getGameVersion())
- .map(CanUploadErrorReportStrategy::buildResponseFromExisting)
- .orElseGet(
- () ->
- // no error report exists, user can upload
- CanUploadErrorReportResponse.builder().canUpload(true).build());
- }
-
- private static CanUploadErrorReportResponse buildResponseFromExisting(
- final String existingBugLink) {
- return CanUploadErrorReportResponse.builder()
- .canUpload(false)
- .existingBugReportUrl(existingBugLink)
- .responseDetails(
- "A bug report already exists for this problem.
"
- + "Please visit the bug report URL and add any details that could help.
"
- + "We are always interested to know how a problem happened "
- + "and we may have questions you might be able to help answer. ")
- .build();
- }
-}
diff --git a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/CreateIssueParams.java b/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/CreateIssueParams.java
deleted file mode 100644
index 2a6f565e1c9..00000000000
--- a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/CreateIssueParams.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.triplea.server.error.reporting.upload;
-
-import javax.annotation.Nonnull;
-import lombok.Builder;
-import lombok.Value;
-import org.triplea.http.client.error.report.ErrorReportRequest;
-
-@Value
-@Builder(toBuilder = true)
-public class CreateIssueParams {
- @Nonnull private final String ip;
- @Nonnull private final String systemId;
- @Nonnull private final ErrorReportRequest errorReportRequest;
-}
diff --git a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/ErrorReportModule.java b/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/ErrorReportModule.java
deleted file mode 100644
index 0cfed78e52d..00000000000
--- a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/ErrorReportModule.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.triplea.server.error.reporting.upload;
-
-import java.time.Instant;
-import java.time.temporal.ChronoUnit;
-import javax.annotation.Nonnull;
-import lombok.Builder;
-import org.jdbi.v3.core.Jdbi;
-import org.triplea.http.client.error.report.ErrorReportResponse;
-import org.triplea.http.client.github.CreateIssueRequest;
-import org.triplea.http.client.github.GithubApiClient;
-
-/** Performs the steps for uploading an error report from the point of view of the server. */
-@Builder
-public class ErrorReportModule {
- @Nonnull private final GithubApiClient githubApiClient;
- @Nonnull private final ErrorReportingDao errorReportingDao;
-
- public static ErrorReportModule build(GithubApiClient githubApiClient, Jdbi jdbi) {
- return ErrorReportModule.builder()
- .githubApiClient(githubApiClient)
- .errorReportingDao(jdbi.onDemand(ErrorReportingDao.class))
- .build();
- }
-
- /**
- * Creates an error report (a github issue), records in database the created issue, and purges
- * very old error reports from database.
- */
- public ErrorReportResponse createErrorReport(CreateIssueParams createIssueParams) {
- var errorReportRequest = createIssueParams.getErrorReportRequest();
-
- var githubCreateIssueResponse =
- githubApiClient.newIssue(
- CreateIssueRequest.builder()
- .title(errorReportRequest.getTitle())
- .body(errorReportRequest.getBody())
- .labels(new String[] {"Error Report", errorReportRequest.getSimpleGameVersion()})
- .build());
-
- errorReportingDao.insertHistoryRecord(
- InsertHistoryRecordParams.builder()
- .ip(createIssueParams.getIp())
- .systemId(createIssueParams.getSystemId())
- .gameVersion(createIssueParams.getErrorReportRequest().getGameVersion())
- .title(createIssueParams.getErrorReportRequest().getTitle())
- .githubIssueLink(githubCreateIssueResponse.getHtmlUrl())
- .build());
- errorReportingDao.purgeOld(Instant.now().minus(365, ChronoUnit.DAYS));
-
- return new ErrorReportResponse(githubCreateIssueResponse.getHtmlUrl());
- }
-}
diff --git a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/ErrorReportingDao.java b/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/ErrorReportingDao.java
deleted file mode 100644
index 44d88104231..00000000000
--- a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/ErrorReportingDao.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.triplea.server.error.reporting.upload;
-
-import java.time.Instant;
-import java.util.Optional;
-import org.jdbi.v3.sqlobject.customizer.Bind;
-import org.jdbi.v3.sqlobject.customizer.BindBean;
-import org.jdbi.v3.sqlobject.statement.SqlQuery;
-import org.jdbi.v3.sqlobject.statement.SqlUpdate;
-
-/** DAO class for error reporting functionality. */
-public interface ErrorReportingDao {
-
- /** Inserts a new record indicating a user has submitted an error report at a given date. */
- @SqlUpdate(
- "insert into error_report_history"
- + "(user_ip, system_id, report_title, game_version, created_issue_link) "
- + "values"
- + "(:ip, :systemId, :title, :gameVersion, :githubIssueLink)")
- void insertHistoryRecord(@BindBean InsertHistoryRecordParams insertHistoryRecordParams);
-
- /**
- * Method to clean up old records from the error report history table. This is to avoid the table
- * from growing very large.
- *
- * @param purgeSinceDate Any records older than this date will be removed.
- */
- @SqlUpdate("delete from error_report_history where date_created < :purgeSinceDate")
- void purgeOld(@Bind("purgeSinceDate") Instant purgeSinceDate);
-
- @SqlQuery(
- "select created_issue_link"
- + " from error_report_history"
- + " where report_title = :reportTitle "
- + " and game_version = :gameVersion")
- Optional getErrorReportLink(
- @Bind("reportTitle") String reportTitle, @Bind("gameVersion") String gameVersion);
-}
diff --git a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/InsertHistoryRecordParams.java b/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/InsertHistoryRecordParams.java
deleted file mode 100644
index 982951b4939..00000000000
--- a/servers/game-support/server/src/main/java/org/triplea/server/error/reporting/upload/InsertHistoryRecordParams.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.triplea.server.error.reporting.upload;
-
-import lombok.Builder;
-import lombok.Value;
-
-/** Parameter object for inserting a record of an error report uploaded by a user. */
-@Value
-@Builder
-public class InsertHistoryRecordParams {
- /** The IP address of the user reporting the error. */
- String ip;
-
- /** SystemId of the user uploading the error report. */
- String systemId;
-
- /** The engine version of the user at the time they uploaded the error report. */
- String gameVersion;
-
- /** The title of the error report, will be used for de-duping. */
- String title;
-
- /**
- * Link to the github issue created by the error report. This is the issue that the user should
- * have just uploaded.
- */
- String githubIssueLink;
-}
diff --git a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/CanUploadErrorReportStrategyTest.java b/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/CanUploadErrorReportStrategyTest.java
deleted file mode 100644
index 53a9bc0f2e3..00000000000
--- a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/CanUploadErrorReportStrategyTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.triplea.modules.error.reporting;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.hamcrest.core.IsNull.nullValue;
-import static org.mockito.Mockito.when;
-
-import java.util.Optional;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-import org.triplea.http.client.error.report.CanUploadErrorReportResponse;
-import org.triplea.http.client.error.report.CanUploadRequest;
-import org.triplea.server.error.reporting.upload.CanUploadErrorReportStrategy;
-import org.triplea.server.error.reporting.upload.ErrorReportingDao;
-
-@ExtendWith(MockitoExtension.class)
-class CanUploadErrorReportStrategyTest {
-
- @Mock private ErrorReportingDao errorReportingDao;
-
- @InjectMocks private CanUploadErrorReportStrategy canUploadErrorReportStrategy;
-
- @Test
- @DisplayName("If we do not find an existing error report then the user can upload")
- void errorReportDoesNotExist() {
- when(errorReportingDao.getErrorReportLink("reportTitle", "version"))
- .thenReturn(Optional.empty());
-
- final CanUploadErrorReportResponse response =
- canUploadErrorReportStrategy.apply(
- CanUploadRequest.builder().errorTitle("reportTitle").gameVersion("version").build());
-
- assertThat(response.getCanUpload(), is(true));
- assertThat(response.getExistingBugReportUrl(), is(nullValue()));
- assertThat(response.getResponseDetails(), is(nullValue()));
- }
-
- @Test
- @DisplayName("If find an existing error report then the user can *not* upload")
- void errorReportDoesExist() {
- when(errorReportingDao.getErrorReportLink("reportTitle", "version"))
- .thenReturn(Optional.of("link"));
-
- final CanUploadErrorReportResponse response =
- canUploadErrorReportStrategy.apply(
- CanUploadRequest.builder().errorTitle("reportTitle").gameVersion("version").build());
-
- assertThat(response.getCanUpload(), is(false));
- assertThat(response.getExistingBugReportUrl(), is("link"));
- assertThat(response.getResponseDetails(), is(notNullValue()));
- }
-}
diff --git a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/ErrorReportControllerIntegrationTest.java b/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/ErrorReportControllerIntegrationTest.java
deleted file mode 100644
index 00a7a5dd6dd..00000000000
--- a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/ErrorReportControllerIntegrationTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.triplea.modules.error.reporting;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNull.notNullValue;
-
-import java.net.URI;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.triplea.http.client.error.report.CanUploadRequest;
-import org.triplea.http.client.error.report.ErrorReportClient;
-import org.triplea.http.client.error.report.ErrorReportRequest;
-import org.triplea.http.client.error.report.ErrorReportResponse;
-import org.triplea.http.client.lib.ClientIdentifiers;
-import org.triplea.test.common.RequiresDatabase;
-
-@ExtendWith(ErrorReportServerTestExtension.class)
-@RequiresDatabase
-class ErrorReportControllerIntegrationTest {
- private final ErrorReportClient client;
-
- ErrorReportControllerIntegrationTest(final URI localhost) {
- client =
- ErrorReportClient.newClient(
- localhost,
- ClientIdentifiers.builder().applicationVersion("0.0").systemId("system").build());
- }
-
- @Test
- void uploadErrorReport() {
- final ErrorReportResponse response =
- client.uploadErrorReport(
- ErrorReportRequest.builder()
- .body("body")
- .title("error-report-title-" + String.valueOf(Math.random()).substring(0, 10))
- .gameVersion("version")
- .build());
-
- assertThat(response.getGithubIssueLink(), is(notNullValue()));
- }
-
- @Test
- void canUploadErrorReport() {
- client.canUploadErrorReport(
- CanUploadRequest.builder().gameVersion("2.0").errorTitle("title").build());
- }
-}
diff --git a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/ErrorReportModuleTest.java b/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/ErrorReportModuleTest.java
deleted file mode 100644
index 0265d1e1400..00000000000
--- a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/ErrorReportModuleTest.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.triplea.modules.error.reporting;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import java.util.stream.Stream;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.Arguments;
-import org.junit.jupiter.params.provider.MethodSource;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-import org.triplea.http.client.error.report.ErrorReportRequest;
-import org.triplea.http.client.error.report.ErrorReportResponse;
-import org.triplea.http.client.github.CreateIssueRequest;
-import org.triplea.http.client.github.CreateIssueResponse;
-import org.triplea.http.client.github.GithubApiClient;
-import org.triplea.server.error.reporting.upload.CreateIssueParams;
-import org.triplea.server.error.reporting.upload.ErrorReportModule;
-import org.triplea.server.error.reporting.upload.ErrorReportingDao;
-import org.triplea.server.error.reporting.upload.InsertHistoryRecordParams;
-
-@ExtendWith(MockitoExtension.class)
-class ErrorReportModuleTest {
-
- private static final ErrorReportRequest ERROR_REPORT_REQUEST =
- ErrorReportRequest.builder().body("body").title("title").gameVersion("version").build();
-
- private static final String GITHUB_ISSUE_URL = "example-url-value";
-
- private static final CreateIssueParams createIssueParams =
- CreateIssueParams.builder()
- .ip("127.0.1.10")
- .systemId("system-id")
- .errorReportRequest(ERROR_REPORT_REQUEST)
- .build();
-
- @Mock private GithubApiClient githubApiClient;
- @Mock private ErrorReportingDao errorReportingDao;
-
- private ErrorReportModule errorReportModule;
-
- @BeforeEach
- void setup() {
- errorReportModule =
- ErrorReportModule.builder()
- .githubApiClient(githubApiClient)
- .errorReportingDao(errorReportingDao)
- .build();
-
- when(githubApiClient.newIssue(any())).thenReturn(new CreateIssueResponse(GITHUB_ISSUE_URL));
- }
-
- @Test
- void newIssueLinkIsReturnedToClient() {
- final ErrorReportResponse response = errorReportModule.createErrorReport(createIssueParams);
-
- assertThat(response.getGithubIssueLink(), is(GITHUB_ISSUE_URL));
- }
-
- /**
- * Given an input to create an error report, we validate the parameters we send to github to
- * create an issue.
- */
- @Test
- void validateDataSentToGithub() {
- errorReportModule.createErrorReport(createIssueParams);
-
- verify(githubApiClient)
- .newIssue(
- CreateIssueRequest.builder()
- .body("body")
- .title("title")
- .labels(new String[] {"Error Report", "version"})
- .build());
- }
-
- /**
- * Given a variety of 'inputVersion' representing game versions, we validate the data we send to
- * github (notably checking the labels that we send).
- */
- @ParameterizedTest
- @MethodSource
- void validateLabelsDataSentToGithub(String inputVersion, String[] expectedLabels) {
- errorReportModule.createErrorReport(
- createIssueParams.toBuilder()
- .errorReportRequest(
- createIssueParams.getErrorReportRequest().toBuilder()
- .gameVersion(inputVersion)
- .build())
- .build());
-
- verify(githubApiClient)
- .newIssue(
- CreateIssueRequest.builder()
- .body("body")
- .title("title")
- .labels(expectedLabels)
- .build());
- }
-
- @SuppressWarnings("unused")
- static Stream validateLabelsDataSentToGithub() {
- return Stream.of(
- Arguments.of("version", new String[] {"Error Report", "version"}),
- Arguments.of("1.1", new String[] {"Error Report", "1.1"}),
- Arguments.of("2.1.1", new String[] {"Error Report", "2.1"}),
- Arguments.of("3.2.1.1", new String[] {"Error Report", "3.2"}),
- Arguments.of("4.0.1", new String[] {"Error Report", "4.0"}),
- Arguments.of("5.1+123", new String[] {"Error Report", "5.1"}),
- Arguments.of("6.0+abc", new String[] {"Error Report", "6.0"}));
- }
-
- @Test
- void errorReportIsLoggedToDatabase() {
- errorReportModule.createErrorReport(createIssueParams);
-
- verify(errorReportingDao)
- .insertHistoryRecord(
- InsertHistoryRecordParams.builder()
- .title(ERROR_REPORT_REQUEST.getTitle())
- .gameVersion(ERROR_REPORT_REQUEST.getGameVersion())
- .githubIssueLink(GITHUB_ISSUE_URL)
- .systemId(createIssueParams.getSystemId())
- .ip(createIssueParams.getIp())
- .build());
- }
-
- @Test
- void oldErrorReportsArePurged() {
- errorReportModule.createErrorReport(createIssueParams);
-
- verify(errorReportingDao).purgeOld(any());
- }
-}
diff --git a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/ErrorReportServerTestExtension.java b/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/ErrorReportServerTestExtension.java
deleted file mode 100644
index 6e57de332f1..00000000000
--- a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/ErrorReportServerTestExtension.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.triplea.modules.error.reporting;
-
-import io.dropwizard.testing.DropwizardTestSupport;
-import org.triplea.server.GameSupportServerApplication;
-import org.triplea.server.GameSupportServerConfiguration;
-import org.triplea.test.common.RequiresDatabase;
-import org.triplea.test.support.DropwizardServerExtension;
-
-/**
- * Use with {@code @ExtendWith(SpitfireServerTestExtension.class)} Tests extended with this
- * extension will launch a drop wizard server when the test starts up. If a server is already
- * running at the start of a test, it will be re-used.
- */
-@RequiresDatabase
-public class ErrorReportServerTestExtension
- extends DropwizardServerExtension {
-
- private static final DropwizardTestSupport testSupport =
- new DropwizardTestSupport<>(GameSupportServerApplication.class, "configuration.yml");
-
- @Override
- public DropwizardTestSupport getSupport() {
- return testSupport;
- }
-}
diff --git a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/db/ErrorReportingDaoTest.java b/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/db/ErrorReportingDaoTest.java
deleted file mode 100644
index b0c16183128..00000000000
--- a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/db/ErrorReportingDaoTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.triplea.modules.error.reporting.db;
-
-import static com.github.npathai.hamcrestopt.OptionalMatchers.isPresentAndIs;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import com.github.database.rider.core.api.dataset.DataSet;
-import com.github.database.rider.core.api.dataset.ExpectedDataSet;
-import com.github.database.rider.junit5.DBUnitExtension;
-import com.github.npathai.hamcrestopt.OptionalMatchers;
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
-import java.util.List;
-import lombok.RequiredArgsConstructor;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.Arguments;
-import org.junit.jupiter.params.provider.MethodSource;
-import org.triplea.server.error.reporting.upload.ErrorReportingDao;
-import org.triplea.server.error.reporting.upload.InsertHistoryRecordParams;
-import org.triplea.test.common.RequiresDatabase;
-
-@RequiredArgsConstructor
-@ExtendWith(ErrorReportingModuleDatabaseTestSupport.class)
-@ExtendWith(DBUnitExtension.class)
-@RequiresDatabase
-final class ErrorReportingDaoTest {
- private final ErrorReportingDao errorReportingDao;
-
- /** Simple check that if we insert a record we'll get a new record in the expected dataset. */
- @DataSet(value = "error_reporting/empty_error_report_history.yml", useSequenceFiltering = false)
- @ExpectedDataSet(value = "error_reporting/error_report_history_post_insert.yml")
- @Test
- void insertRow() {
- errorReportingDao.insertHistoryRecord(
- InsertHistoryRecordParams.builder()
- .ip("the_userIp")
- .systemId("the_systemId")
- .title("the_reportTitle")
- .gameVersion("the_gameVersion")
- .githubIssueLink("the_createdIssueLink")
- .build());
- }
-
- @DataSet(value = "error_reporting/error_report_history.yml", useSequenceFiltering = false)
- @ExpectedDataSet(value = "error_reporting/error_report_history_post_purge.yml")
- @Test
- void purgeOld() {
- errorReportingDao.purgeOld(LocalDateTime.of(2016, 1, 3, 23, 0, 0).toInstant(ZoneOffset.UTC));
- }
-
- @DataSet(
- value = "error_reporting/error_report_history_post_purge.yml",
- useSequenceFiltering = false)
- @Test
- void getErrorReportLinkFoundCase() {
- assertThat(
- errorReportingDao.getErrorReportLink("the_reportTitle2", "the_gameVersion2"),
- isPresentAndIs("the_createdIssueLink2"));
- }
-
- @DataSet(
- value = "error_reporting/error_report_history_post_purge.yml",
- useSequenceFiltering = false)
- @ParameterizedTest
- @MethodSource
- void getErrorReportLinkNotFoundCases(final String title, final String version) {
- assertThat(
- errorReportingDao.getErrorReportLink(title, version), //
- OptionalMatchers.isEmpty());
- }
-
- @SuppressWarnings("unused")
- private static List getErrorReportLinkNotFoundCases() {
- return List.of(
- Arguments.of("title-not-found", "version-not-found"),
- Arguments.of("title-not-found", "the_gameVersion2"),
- Arguments.of("the_reportTitle2", "version-not-found"));
- }
-}
diff --git a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/db/ErrorReportingModuleDatabaseTestSupport.java b/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/db/ErrorReportingModuleDatabaseTestSupport.java
deleted file mode 100644
index 97a6d620a8c..00000000000
--- a/servers/game-support/server/src/test/java/org/triplea/modules/error/reporting/db/ErrorReportingModuleDatabaseTestSupport.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.triplea.modules.error.reporting.db;
-
-import java.util.Collection;
-import java.util.List;
-import org.jdbi.v3.core.mapper.RowMapperFactory;
-import org.triplea.spitfire.database.DatabaseTestSupport;
-
-public class ErrorReportingModuleDatabaseTestSupport extends DatabaseTestSupport {
- @Override
- protected Collection rowMappers() {
- return List.of();
- }
-}
diff --git a/servers/game-support/server/src/test/resources/datasets/error_reporting/empty_error_report_history.yml b/servers/game-support/server/src/test/resources/datasets/error_reporting/empty_error_report_history.yml
deleted file mode 100644
index 479acd482bb..00000000000
--- a/servers/game-support/server/src/test/resources/datasets/error_reporting/empty_error_report_history.yml
+++ /dev/null
@@ -1 +0,0 @@
-error_report_history:
diff --git a/servers/game-support/server/src/test/resources/datasets/error_reporting/error_report_history.yml b/servers/game-support/server/src/test/resources/datasets/error_reporting/error_report_history.yml
deleted file mode 100644
index 94419eb678f..00000000000
--- a/servers/game-support/server/src/test/resources/datasets/error_reporting/error_report_history.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-error_report_history:
- - id: 900000
- user_ip: first
- date_created: 2016-01-01 23:59:20.0
- system_id: the_systemId
- report_title: the_reportTitle0
- game_version: the_gameVersion0
- created_issue_link: the_createdIssueLink0
- - id: 900001
- user_ip: first
- date_created: 2016-01-02 23:59:20.0
- system_id: the_systemId
- report_title: the_reportTitle1
- game_version: the_gameVersion1
- created_issue_link: the_createdIssueLink1
- - id: 900002
- user_ip: first
- date_created: 2016-01-03 23:59:20.0
- system_id: the_systemId
- report_title: the_reportTitle2
- game_version: the_gameVersion2
- created_issue_link: the_createdIssueLink2
- - id: 900003
- user_ip: second
- date_created: 2016-01-03 23:59:20.0
- system_id: the_systemId
- report_title: the_reportTitle3
- game_version: the_gameVersion3
- created_issue_link: the_createdIssueLink3
diff --git a/servers/game-support/server/src/test/resources/datasets/error_reporting/error_report_history_post_insert.yml b/servers/game-support/server/src/test/resources/datasets/error_reporting/error_report_history_post_insert.yml
deleted file mode 100644
index 31509cc0a3b..00000000000
--- a/servers/game-support/server/src/test/resources/datasets/error_reporting/error_report_history_post_insert.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-error_report_history:
- - id: "regex:\\d+" #any number
- user_ip: the_userIp
- system_id: the_systemId
- report_title: the_reportTitle
- game_version: the_gameVersion
- created_issue_link: the_createdIssueLink
diff --git a/servers/game-support/server/src/test/resources/datasets/error_reporting/error_report_history_post_purge.yml b/servers/game-support/server/src/test/resources/datasets/error_reporting/error_report_history_post_purge.yml
deleted file mode 100644
index 6675a125594..00000000000
--- a/servers/game-support/server/src/test/resources/datasets/error_reporting/error_report_history_post_purge.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-error_report_history:
- - id: 900002
- user_ip: first
- date_created: 2016-01-03 23:59:20.0
- system_id: the_systemId
- report_title: the_reportTitle2
- game_version: the_gameVersion2
- created_issue_link: the_createdIssueLink2
- - id: 900003
- user_ip: second
- date_created: 2016-01-03 23:59:20.0
- system_id: the_systemId
- report_title: the_reportTitle3
- game_version: the_gameVersion3
- created_issue_link: the_createdIssueLink3
diff --git a/servers/game-support/server/src/test/resources/db-cleanup.sql b/servers/game-support/server/src/test/resources/db-cleanup.sql
deleted file mode 100644
index d51ff4f3158..00000000000
--- a/servers/game-support/server/src/test/resources/db-cleanup.sql
+++ /dev/null
@@ -1,3 +0,0 @@
--- Deletes table data in proper order
-
-delete from error_report_history;
diff --git a/servers/game-support/server/src/test/resources/dbunit.yml b/servers/game-support/server/src/test/resources/dbunit.yml
deleted file mode 100644
index 1f4bedcd880..00000000000
--- a/servers/game-support/server/src/test/resources/dbunit.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-connectionConfig:
- driver: "org.postgresql.Driver"
- url: "jdbc:postgresql://localhost:5432/lobby_db"
- user: "lobby_user"
- password: "lobby"
diff --git a/servers/game-support/server/src/test/resources/logback-test.xml b/servers/game-support/server/src/test/resources/logback-test.xml
deleted file mode 100644
index 2222e345e83..00000000000
--- a/servers/game-support/server/src/test/resources/logback-test.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- %d [%thread] %logger{36} %-5level: %msg%n
-
-
-
-
-
-
-
diff --git a/servers/lobby/README.md b/servers/lobby/README.md
deleted file mode 100644
index 5ff6e2fd01e..00000000000
--- a/servers/lobby/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-## Lobby-Chat Server - Overview
-
-This service keeps a list of chatters and sends chat messages between them.
-When logging into the lobby, a person is logging into this service.
-
-
-## Lobby-Games Server - Overview
-
-This service is responsible for keeping a list of ongoing lobby games and their status.
diff --git a/servers/lobby/client/build.gradle b/servers/lobby/client/build.gradle
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/servers/lobby/server/build.gradle b/servers/lobby/server/build.gradle
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/servers/maps/README.md b/servers/maps/README.md
deleted file mode 100644
index a87a2a67e20..00000000000
--- a/servers/maps/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# Maps Server - Overview
-
-The maps-index server indexes all of the maps and provides an API
-for game-clients to get a listing of maps and to interact with
-the maps list.
-
-## Historical Context
-
-The maps index was historically first created as an XML file, and
-each map was an entry in the XML file. The game-client would download
-this file from a static location and then parse it to know the list
-of maps.
-
-Eventually this was evolved to be a YML file. The maps-index server
-is a further step on this evolution to where maps are dynamically
-read from the triplea-maps github organization and then the list
-fo maps is maintained in a database.
diff --git a/servers/maps/server/Dockerfile b/servers/maps/server/Dockerfile
deleted file mode 100644
index d6412e74f26..00000000000
--- a/servers/maps/server/Dockerfile
+++ /dev/null
@@ -1,6 +0,0 @@
-FROM openjdk:11-jre-slim-buster
-
-EXPOSE 8080
-ADD configuration.yml /
-ADD build/libs/maps-server.jar /
-CMD java -jar maps-server.jar server /configuration.yml
diff --git a/servers/maps/server/build.gradle b/servers/maps/server/build.gradle
deleted file mode 100644
index dbc3203dd01..00000000000
--- a/servers/maps/server/build.gradle
+++ /dev/null
@@ -1,62 +0,0 @@
-plugins {
- id "application"
- id "com.github.johnrengelman.shadow" version "7.1.2"
-}
-
-archivesBaseName = "maps-server"
-mainClassName = "org.triplea.maps.MapsServerApplication"
-
-ext {
- releasesDir = file("$buildDir/releases")
-}
-
-jar {
- manifest {
- attributes "Main-Class": mainClassName
- }
-}
-
-task portableInstaller(type: Zip, group: "release", dependsOn: shadowJar) {
- from file("configuration.yml")
-
- from(shadowJar.outputs) {
- into "bin"
- }
-}
-
-task release(group: "release", dependsOn: portableInstaller) {
- doLast {
- publishArtifacts(portableInstaller.outputs.files)
- }
-}
-
-shadowJar {
- archiveClassifier.set ""
- // mergeServiceFiles is needed by dropwizard
- // Without this configuration parsing breaks and is unable to find connector type "http" for
- // the following YAML snippet: server: {applicationConnectors: [{type: http, port: 8080}]
- mergeServiceFiles()
-}
-
-
-dependencies {
- implementation "io.dropwizard:dropwizard-core:$dropwizardVersion"
- implementation "io.dropwizard:dropwizard-jdbi3:$dropwizardVersion"
- implementation "org.jdbi:jdbi3-core:$jdbiVersion"
- implementation "org.jdbi:jdbi3-sqlobject:$jdbiVersion"
-
- implementation project(":http-clients:github-client")
- implementation project(":lib:feign-common")
- implementation project(":lib:java-extras")
- implementation project(":servers:maps:client")
- implementation project(":servers:server-lib")
- implementation project(":spitfire-server:database")
-
- runtimeOnly "org.postgresql:postgresql:$postgresqlVersion"
-
- testImplementation "com.github.database-rider:rider-junit5:$databaseRiderVersion"
- testImplementation "io.dropwizard:dropwizard-testing:$dropwizardVersion"
- testImplementation "uk.co.datumedge:hamcrest-json:$hamcrestJsonVersion"
- testImplementation project(":lib:test-common")
- testImplementation project(":spitfire-server:database-test-support")
-}
diff --git a/servers/maps/server/configuration.yml b/servers/maps/server/configuration.yml
deleted file mode 100644
index 92b59c744b3..00000000000
--- a/servers/maps/server/configuration.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-githubApiToken: ${GITHUB_API_TOKEN:-}
-githubWebServiceUrl: https://api.github.com
-githubMapsOrgName: triplea-maps
-
-
-# Whether to print out SQL statements as executed, useful for debugging.
-logSqlStatements: false
-
-database:
- driverClass: org.postgresql.Driver
- user: ${DATABASE_USER:-lobby_user}
- password: ${DATABASE_PASSWORD:-lobby}
- url: jdbc:postgresql://${DB_URL:-localhost:5432/lobby_db}
- properties:
- charSet: UTF-8
- # the maximum amount of time to wait on an empty pool before throwing an exception
- maxWaitForConnection: 1s
-
- # the SQL query to run when validating a connection's liveness
- validationQuery: select 1
-
- # the minimum number of connections to keep open
- minSize: 8
-
- # the maximum number of connections to keep open
- maxSize: 32
-
- # whether or not idle connections should be validated
- checkConnectionWhileIdle: false
-
- # the amount of time to sleep between runs of the idle connection validation, abandoned cleaner and idle pool resizing
- evictionInterval: 10s
-
- # the minimum amount of time an connection must sit idle in the pool before it is eligible for eviction
- minIdleTime: 1 minute
-
-
-logging:
- # The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL.
- level: INFO
- loggers:
- # Set this to DEBUG to troubleshoot HTTP 400 "Unable to process JSON" errors.
- io.dropwizard.jersey.jackson.JsonProcessingExceptionMapper: INFO
-
-server:
- applicationConnectors:
- - type: http
- port: ${HTTP_PORT:-8080}
- # useForwardedHeaders is important for when behind a reverse proxy (NGINX)
- # Without this 'getRemoteAddr' will return the IP of the reverse proxy server.
- # By default when building locally useForwardedPorts should be 'false', but
- # for all other environments that do have a NGINX server, the value should be
- # set to true.
- useForwardedHeaders: ${USE_FORWARDED_HEADERS:-false}
- adminConnectors: []
diff --git a/servers/maps/server/src/main/java/configuration.yml b/servers/maps/server/src/main/java/configuration.yml
deleted file mode 100644
index 9cd8553b1dc..00000000000
--- a/servers/maps/server/src/main/java/configuration.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-githubApiToken: ${GITHUB_API_TOKEN:-}
-githubWebServiceUrl: https://api.github.com
-githubMapsOrgName: triplea-maps
-
-
-# If map indexing is enabled, it will begin shortly after server startup.
-# If disabled no map indexing will occur.
-mapIndexingEnabled: ${MAP_INDEXING_ENABLED:-false}
-
-# How often between map indexing runs. On each map indexing run we will
-# index all maps. If the previous map indexing run is still going
-# we will then have multiple indexing jobs running at the same time.
-# To avoid overlapping indexing jobs, this value needs to be greater than:
-# (number of maps) * (processing time) * (indexingTaskDelaySeconds / 60)
-mapIndexingPeriodMinutes: ${MAP_INDEXING_PERIOD_MINUTES:-300}
-
-# Time period in seconds between indexing each individual map. This must
-# be configured to avoid github API rate limiting.
-# Eg:
-# 1 -> one indexing task per second -> 3600 requests per hour.
-# 5 -> one indexing task every 5 seconds -> 720 requests per hour.
-# 60 -> one indexing task per minute -> 60 requests per hour.
-# 120 -> one indexing task every other minute -> 30 requests per hour.
-# Unauthenticated Github API requests are limited to 60 request per hour.
-# Authenticated Github API requests are limited to 1000 requests per hour.
-indexingTaskDelaySeconds: ${MAP_INDEXING_DELAY_SECONDS:-120}
-
-# Whether to print out SQL statements as executed, useful for debugging.
-logSqlStatements: false
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/MapTagAdminController.java b/servers/maps/server/src/main/java/org/triplea/maps/MapTagAdminController.java
deleted file mode 100644
index b1497936e91..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/MapTagAdminController.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.triplea.maps;
-
-import java.util.List;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import lombok.AllArgsConstructor;
-import org.jdbi.v3.core.Jdbi;
-import org.triplea.http.client.GenericServerResponse;
-import org.triplea.http.client.maps.admin.MapTagAdminClient;
-import org.triplea.http.client.maps.admin.MapTagMetaData;
-import org.triplea.http.client.maps.admin.UpdateMapTagRequest;
-import org.triplea.maps.tags.MapTagAdminModule;
-import org.triplea.maps.tags.UpdateMapTagResult;
-import org.triplea.spitfire.server.HttpController;
-
-@AllArgsConstructor
-public class MapTagAdminController extends HttpController {
- private final MapTagAdminModule mapTagAdminModule;
-
- public static MapTagAdminController build(final Jdbi jdbi) {
- return new MapTagAdminController(MapTagAdminModule.build(jdbi));
- }
-
- /**
- * Returns data about map tags, which ones exist and their allowed values. This is useful to
- * moderators to select new tag values per map.
- */
- @GET
- @Path(MapTagAdminClient.GET_MAP_TAGS_META_DATA_PATH)
- // @RolesAllowed(UserRole.MODERATOR)
- public List fetchAvailableMapTags() {
- return mapTagAdminModule.fetchMapTags();
- }
-
- /**
- * Upserts a tag value for a map. If the tag already exists its value is overwritten, otherwise a
- * new map-tag-value combination is created.
- */
- @POST
- @Path(MapTagAdminClient.UPDATE_MAP_TAG_PATH)
- // @RolesAllowed(UserRole.MODERATOR)
- public GenericServerResponse updateMapTag(final UpdateMapTagRequest updateMapTagRequest) {
- final UpdateMapTagResult result = mapTagAdminModule.updateMapTag(updateMapTagRequest);
-
- return GenericServerResponse.builder()
- .success(result.isSuccess())
- .message(result.getMessage())
- .build();
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/MapsController.java b/servers/maps/server/src/main/java/org/triplea/maps/MapsController.java
deleted file mode 100644
index dea3eb959b4..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/MapsController.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.triplea.maps;
-
-import java.util.List;
-import java.util.function.Supplier;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import org.jdbi.v3.core.Jdbi;
-import org.triplea.http.client.maps.listing.MapDownloadItem;
-import org.triplea.http.client.maps.listing.MapsClient;
-import org.triplea.maps.listing.MapsListingModule;
-
-@Path("/")
-@Consumes(MediaType.APPLICATION_JSON)
-@Produces(MediaType.APPLICATION_JSON)
-@AllArgsConstructor(access = AccessLevel.PRIVATE)
-public class MapsController {
- private final Supplier> downloadListingSupplier;
-
- public static MapsController build(final Jdbi jdbi) {
- return new MapsController(MapsListingModule.build(jdbi));
- }
-
- /**
- * Returns the full set of maps available for download. This is useful for populating a 'download
- * maps listing', the intended audience is any game user searching for available to download maps.
- */
- @GET
- @Path(MapsClient.MAPS_LISTING_PATH)
- public List fetchAvailableMaps() {
- return downloadListingSupplier.get();
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/MapsModuleConfig.java b/servers/maps/server/src/main/java/org/triplea/maps/MapsModuleConfig.java
deleted file mode 100644
index de193aaa704..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/MapsModuleConfig.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.triplea.maps;
-
-import org.triplea.http.client.github.GithubApiClient;
-
-public interface MapsModuleConfig {
- GithubApiClient createMapsRepoGithubApiClient();
-
- int getMapIndexingPeriodMinutes();
-
- int getIndexingTaskDelaySeconds();
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/MapsModuleRowMappers.java b/servers/maps/server/src/main/java/org/triplea/maps/MapsModuleRowMappers.java
deleted file mode 100644
index bc14b2840ea..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/MapsModuleRowMappers.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.triplea.maps;
-
-import java.util.List;
-import lombok.experimental.UtilityClass;
-import org.jdbi.v3.core.mapper.RowMapperFactory;
-import org.jdbi.v3.core.mapper.reflect.ConstructorMapper;
-import org.triplea.maps.listing.MapListingRecord;
-import org.triplea.maps.listing.MapTagRecord;
-import org.triplea.maps.tags.MapTagMetaDataRecord;
-
-/** Utility to get connections to the Postgres lobby database. */
-@UtilityClass
-public final class MapsModuleRowMappers {
- /**
- * Returns all row mappers. These are classes that map result set values to corresponding return
- * objects.
- */
- public static List rowMappers() {
- return List.of(
- ConstructorMapper.factory(MapListingRecord.class),
- ConstructorMapper.factory(MapTagRecord.class),
- ConstructorMapper.factory(MapTagMetaDataRecord.class));
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/MapsServerApplication.java b/servers/maps/server/src/main/java/org/triplea/maps/MapsServerApplication.java
deleted file mode 100644
index a8da9abeca3..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/MapsServerApplication.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package org.triplea.maps;
-
-import io.dropwizard.Application;
-import io.dropwizard.jdbi3.JdbiFactory;
-import io.dropwizard.setup.Bootstrap;
-import io.dropwizard.setup.Environment;
-import java.util.List;
-import lombok.extern.slf4j.Slf4j;
-import org.jdbi.v3.core.Jdbi;
-import org.triplea.dropwizard.common.IllegalArgumentMapper;
-import org.triplea.dropwizard.common.JdbiLogging;
-import org.triplea.dropwizard.common.ServerConfiguration;
-import org.triplea.maps.indexing.MapsIndexingObjectFactory;
-
-/**
- * Main entry-point for launching drop wizard HTTP server. This class is responsible for configuring
- * any Jersey plugins, registering resources (controllers) and injecting those resources with
- * configuration properties from 'AppConfig'.
- */
-@Slf4j
-public class MapsServerApplication extends Application {
-
- private static final String[] DEFAULT_ARGS = new String[] {"server", "configuration.yml"};
-
- private ServerConfiguration serverConfiguration;
-
- /**
- * Main entry-point method, launches the drop-wizard http server. If no args are passed then will
- * use default values suitable for local development.
- */
- public static void main(final String[] args) throws Exception {
- final MapsServerApplication application = new MapsServerApplication();
- // if no args are provided then we will use default values.
- application.run(args.length == 0 ? DEFAULT_ARGS : args);
- }
-
- @Override
- public void initialize(final Bootstrap bootstrap) {
- serverConfiguration =
- ServerConfiguration.build(bootstrap)
- .enableEnvironmentVariablesInConfig()
- .enableBetterJdbiExceptions();
- }
-
- @Override
- public void run(final MapsServerConfig configuration, final Environment environment) {
- final Jdbi jdbi =
- new JdbiFactory()
- .build(environment, configuration.getDatabase(), "postgresql-connection-pool");
-
- MapsModuleRowMappers.rowMappers().forEach(jdbi::registerRowMapper);
-
- if (configuration.isLogSqlStatements()) {
- JdbiLogging.registerSqlLogger(jdbi);
- }
-
- if (configuration.isMapIndexingEnabled()) {
- environment
- .lifecycle()
- .manage(MapsIndexingObjectFactory.buildMapsIndexingSchedule(configuration, jdbi));
- log.info(
- "Map indexing is enabled to run every:"
- + " {} minutes with one map indexing request every {} seconds",
- configuration.getMapIndexingPeriodMinutes(),
- configuration.getIndexingTaskDelaySeconds());
- } else {
- log.info("Map indexing is disabled");
- }
-
- serverConfiguration.registerExceptionMappers(environment, List.of(new IllegalArgumentMapper()));
-
- List.of(MapsController.build(jdbi), MapTagAdminController.build(jdbi))
- .forEach(controller -> environment.jersey().register(controller));
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/MapsServerConfig.java b/servers/maps/server/src/main/java/org/triplea/maps/MapsServerConfig.java
deleted file mode 100644
index d2b3aac2a45..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/MapsServerConfig.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.triplea.maps;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.dropwizard.Configuration;
-import io.dropwizard.db.DataSourceFactory;
-import java.net.URI;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import lombok.Getter;
-import lombok.Setter;
-import org.triplea.http.client.github.GithubApiClient;
-
-/**
- * This configuration class represents the configuration values in the server YML configuration. An
- * instance of this class is created by DropWizard on launch and then is passed to the application
- * class. Values can be injected into the application by using environment variables in the server
- * YML configuration file.
- */
-public class MapsServerConfig extends Configuration {
-
- @Valid @NotNull @JsonProperty @Getter
- private final DataSourceFactory database = new DataSourceFactory();
-
- @Getter(onMethod_ = {@JsonProperty})
- @Setter(onMethod_ = {@JsonProperty})
- private String githubWebServiceUrl;
-
- /** Webservice token, should be an API token for the TripleA builder bot account. */
- @Getter(onMethod_ = {@JsonProperty})
- @Setter(onMethod_ = {@JsonProperty})
- private String githubApiToken;
-
- @Getter(onMethod_ = {@JsonProperty})
- @Setter(onMethod_ = {@JsonProperty})
- private String githubMapsOrgName;
-
- @Getter(onMethod_ = {@JsonProperty})
- @Setter(onMethod_ = {@JsonProperty})
- private boolean mapIndexingEnabled;
-
- @Getter(onMethod_ = {@JsonProperty})
- @Setter(onMethod_ = {@JsonProperty})
- private int mapIndexingPeriodMinutes;
-
- @Getter(onMethod_ = {@JsonProperty})
- @Setter(onMethod_ = {@JsonProperty})
- private int indexingTaskDelaySeconds;
-
- @Getter(onMethod_ = {@JsonProperty})
- @Setter(onMethod_ = {@JsonProperty})
- private boolean logSqlStatements;
-
- public GithubApiClient createGithubApiClient() {
- return GithubApiClient.builder()
- .stubbingModeEnabled(false)
- .authToken(githubApiToken)
- .uri(URI.create(githubWebServiceUrl))
- .org(githubMapsOrgName)
- .build();
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexDao.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexDao.java
deleted file mode 100644
index 64a3914e0c5..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexDao.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.triplea.maps.indexing;
-
-import java.time.Instant;
-import java.util.List;
-import java.util.Optional;
-import org.jdbi.v3.sqlobject.customizer.Bind;
-import org.jdbi.v3.sqlobject.customizer.BindBean;
-import org.jdbi.v3.sqlobject.customizer.BindList;
-import org.jdbi.v3.sqlobject.statement.SqlQuery;
-import org.jdbi.v3.sqlobject.statement.SqlUpdate;
-
-public interface MapIndexDao {
-
- /** Upserts a map indexing result into the map_index table. */
- @SqlUpdate(
- "insert into map_index("
- + " map_name, repo_url, description, "
- + " download_url, preview_image_url, download_size_bytes, last_commit_date)\n"
- + "values("
- + " :mapName, :mapRepoUri, :description, "
- + " :downloadUri, :previewImageUri, :mapDownloadSizeInBytes, :lastCommitDate)\n"
- + "on conflict(repo_url)\n"
- + "do update set\n"
- + " map_name = :mapName,"
- + " description = :description,"
- + " download_url = :downloadUri,"
- + " preview_image_url = :previewImageUri,"
- + " download_size_bytes = :mapDownloadSizeInBytes,"
- + " last_commit_date = :lastCommitDate")
- void upsert(@BindBean MapIndexingResult mapIndexingResult);
-
- /** Deletes maps that are not in the parameter list from the map_index table. */
- @SqlUpdate("delete from map_index where repo_url not in()")
- int removeMapsNotIn(@BindList("mapUriList") List mapUriList);
-
- @SqlQuery("select last_commit_date from map_index where repo_url = :repoUrl")
- Optional getLastCommitDate(@Bind("repoUrl") String repoUrl);
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexingResult.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexingResult.java
deleted file mode 100644
index 1bd40638838..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexingResult.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.triplea.maps.indexing;
-
-import java.time.Instant;
-import javax.annotation.Nonnull;
-import lombok.Builder;
-import lombok.Value;
-
-/**
- * Data object representing a map index entry. URI is the location of the map repo, name and version
- * are read from the 'map.yml' file located in the map repo.
- */
-@Builder
-@Value
-public class MapIndexingResult {
- /** Name of the map as found in the 'map.yml' file located in the map repo. */
- @Nonnull String mapName;
-
- /** URI to the repo, typically something like: "https://github.com/triplea-maps/test-map/" */
- @Nonnull String mapRepoUri;
-
- /**
- * URI to download the map:
- * "https://github.com/triplea-maps/test-map/archive/refs/heads/master.zip"
- */
- @Nonnull String downloadUri;
-
- /**
- * URI to download preview image, eg:
- * https://raw.githubusercontent.com/triplea-maps/napoleonic_empires/master/preview.png
- */
- @Nonnull String previewImageUri;
-
- /** The size of the map download in bytes. */
- @Nonnull Long mapDownloadSizeInBytes;
-
- /** Date of the most recent commit to master. */
- @Nonnull Instant lastCommitDate;
-
- /**
- * Description data parsed from description.html. If description file is missing or too long, then
- * this field will continue an error message with details on how to fix the missing description.
- */
- @Nonnull String description;
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexingTask.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexingTask.java
deleted file mode 100644
index a9ca20619f5..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexingTask.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.triplea.maps.indexing;
-
-import java.time.Instant;
-import java.util.Optional;
-import java.util.function.BiPredicate;
-import java.util.function.Function;
-import javax.annotation.Nonnull;
-import lombok.Builder;
-import org.triplea.http.client.github.MapRepoListing;
-import org.triplea.maps.indexing.tasks.DownloadUriCalculator;
-import org.triplea.maps.indexing.tasks.PreviewUriCalculator;
-
-/**
- * Given a map repo name and URI, reads pertinent indexing information. Indexing will be skipped if
- * database is up to date and the repo has not been updated since.
- *
- *
- *
mapName: read from map.yml found in the repository
- *
lastCommitDate: github API is queried for the repo's master branch last commit date.
- *
description: read from description.html file
- *
- */
-@Builder
-class MapIndexingTask implements Function> {
- @Nonnull private final Function> lastCommitDateFetcher;
- @Nonnull private final BiPredicate skipMapIndexingCheck;
- @Nonnull private final Function> mapNameReader;
- @Nonnull private final Function mapDescriptionReader;
- @Nonnull private final Function> downloadSizeFetcher;
-
- @Override
- public Optional apply(final MapRepoListing mapRepoListing) {
- final Instant lastCommitDateOnRepo = lastCommitDateFetcher.apply(mapRepoListing).orElse(null);
- if (lastCommitDateOnRepo == null) {
- return Optional.empty();
- }
-
- if (skipMapIndexingCheck.test(mapRepoListing, lastCommitDateOnRepo)) {
- return Optional.empty();
- }
-
- final String mapName = mapNameReader.apply(mapRepoListing).orElse(null);
- if (mapName == null) {
- return Optional.empty();
- }
-
- final String description = mapDescriptionReader.apply(mapRepoListing);
-
- final String downloadUri = new DownloadUriCalculator().apply(mapRepoListing);
-
- final String previewImageUri = new PreviewUriCalculator().apply(mapRepoListing);
-
- final Long downloadSize = downloadSizeFetcher.apply(mapRepoListing).orElse(null);
- if (downloadSize == null) {
- return Optional.empty();
- }
-
- return Optional.of(
- MapIndexingResult.builder()
- .mapName(mapName)
- .mapRepoUri(mapRepoListing.getUri().toString())
- .lastCommitDate(lastCommitDateOnRepo)
- .description(description)
- .downloadUri(downloadUri)
- .previewImageUri(previewImageUri)
- .mapDownloadSizeInBytes(downloadSize)
- .build());
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexingTaskRunner.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexingTaskRunner.java
deleted file mode 100644
index 61be9494b5a..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapIndexingTaskRunner.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package org.triplea.maps.indexing;
-
-import java.net.URI;
-import java.util.ArrayDeque;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Deque;
-import java.util.Optional;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
-import lombok.Builder;
-import lombok.extern.slf4j.Slf4j;
-import org.triplea.http.client.github.GithubApiClient;
-import org.triplea.http.client.github.MapRepoListing;
-import org.triplea.java.timer.Timers;
-
-/**
- * Task that runs a map indexing pass on all maps. The indexing will update database to reflect the
- * latest checked in across all map repositories.
- *
- *
- *
Queries Github for list of map repos
- *
Checks each map repo for a 'map.yml' and reads the map name and version
- *
Deletes from database maps that have been removed
- *
Upserts latest map info into database
- *
- */
-@Builder
-@Slf4j
-class MapIndexingTaskRunner implements Runnable {
-
- @Nonnull private final MapIndexDao mapIndexDao;
- @Nonnull private final GithubApiClient githubApiClient;
- @Nonnull private final Function> mapIndexer;
- @Nonnull private final Integer indexingTaskDelaySeconds;
-
- private int totalNumberMaps;
- private long startTimeEpochMillis;
- private int mapsDeleted;
- private int mapsIndexed;
-
- @Override
- public void run() {
- log.info("Map indexing started, github org: {}", githubApiClient.getOrg());
-
- startTimeEpochMillis = System.currentTimeMillis();
-
- // get list of maps
- final Collection mapUris =
- githubApiClient.listRepositories().stream()
- .sorted(Comparator.comparing(MapRepoListing::getName))
- .collect(Collectors.toList());
-
- totalNumberMaps = mapUris.size();
-
- // remove deleted maps
- mapsDeleted =
- mapIndexDao.removeMapsNotIn(
- mapUris.stream()
- .map(MapRepoListing::getUri)
- .map(URI::toString)
- .collect(Collectors.toList()));
-
- // start indexing - convert maps to index to a stack and then process that
- // stack at a fixed rate to avoid rate limits.
- final Deque reposToIndex = new ArrayDeque<>(mapUris);
- indexNextMapRepo(reposToIndex);
- }
-
- /**
- * Recursive method to process a stack of map repo listings. On each iteration we wait a fixed
- * delay, we then pop an element, process it, and then repeat until the stack is empty.
- */
- private void indexNextMapRepo(final Deque reposToIndex) {
- performIndexing(reposToIndex.pop());
- if (reposToIndex.isEmpty()) {
- notifyCompletion();
- } else {
- Timers.executeAfterDelay(
- indexingTaskDelaySeconds, TimeUnit.SECONDS, () -> indexNextMapRepo(reposToIndex));
- }
- }
-
- /**
- * Performs the actual indexing of a single map repo listing. Indexing is two parts, first we
- * reach out to the repo to gather indexing information, second we upsert that info into database.
- */
- private void performIndexing(final MapRepoListing mapRepoListing) {
- log.info("Indexing map: " + mapRepoListing.getName());
- mapIndexer
- .apply(mapRepoListing)
- .ifPresent(
- mapIndexResult -> {
- mapIndexDao.upsert(mapIndexResult);
- mapsIndexed++;
- });
- }
-
- private void notifyCompletion() {
- log.info(
- "Map indexing finished in {} ms, repos found: {}, repos with map.yml: {}, maps deleted: {}",
- (System.currentTimeMillis() - startTimeEpochMillis),
- totalNumberMaps,
- mapsIndexed,
- mapsDeleted);
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapsIndexingObjectFactory.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapsIndexingObjectFactory.java
deleted file mode 100644
index e35914ebd25..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/MapsIndexingObjectFactory.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.triplea.maps.indexing;
-
-import io.dropwizard.lifecycle.Managed;
-import java.time.Duration;
-import java.time.Instant;
-import java.util.function.BiPredicate;
-import lombok.experimental.UtilityClass;
-import org.jdbi.v3.core.Jdbi;
-import org.triplea.http.client.github.GithubApiClient;
-import org.triplea.http.client.github.MapRepoListing;
-import org.triplea.maps.MapsServerConfig;
-import org.triplea.maps.indexing.tasks.CommitDateFetcher;
-import org.triplea.maps.indexing.tasks.DownloadSizeFetcher;
-import org.triplea.maps.indexing.tasks.MapDescriptionReader;
-import org.triplea.maps.indexing.tasks.MapNameReader;
-import org.triplea.maps.indexing.tasks.SkipMapIndexingCheck;
-import org.triplea.server.lib.scheduled.tasks.ScheduledTask;
-
-@UtilityClass
-public class MapsIndexingObjectFactory {
- /**
- * Factory method to create indexing task on a schedule. This does not start indexing, the
- * 'start()' method must be called for map indexing to begin.
- */
- public static Managed buildMapsIndexingSchedule(
- final MapsServerConfig configuration, final Jdbi jdbi) {
-
- var githubApiClient = configuration.createGithubApiClient();
-
- return ScheduledTask.builder()
- .taskName("Map-Indexing")
- .delay(Duration.ofSeconds(10))
- .period(Duration.ofMinutes(configuration.getMapIndexingPeriodMinutes()))
- .task(
- MapIndexingTaskRunner.builder()
- .githubApiClient(githubApiClient)
- .mapIndexer(
- mapIndexingTask(
- githubApiClient,
- new SkipMapIndexingCheck(jdbi.onDemand(MapIndexDao.class))))
- .mapIndexDao(jdbi.onDemand(MapIndexDao.class))
- .indexingTaskDelaySeconds(configuration.getIndexingTaskDelaySeconds())
- .build())
- .build();
- }
-
- MapIndexingTask mapIndexingTask(
- final GithubApiClient githubApiClient,
- final BiPredicate skipMapIndexingCheck) {
- return MapIndexingTask.builder()
- .lastCommitDateFetcher(CommitDateFetcher.builder().githubApiClient(githubApiClient).build())
- .skipMapIndexingCheck(skipMapIndexingCheck)
- .mapNameReader(MapNameReader.builder().build())
- .mapDescriptionReader(new MapDescriptionReader())
- .downloadSizeFetcher(new DownloadSizeFetcher())
- .build();
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/README.md b/servers/maps/server/src/main/java/org/triplea/maps/indexing/README.md
deleted file mode 100644
index c98ffb14327..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-Map indexing refers to the process where the map server fetches
-metadata from all maps available to download. As part of this
-fetch we are gathering enough information to list the map as
-available to download.
-
-To index we gather data from two key locations:
-
-- **Github API**: This tells us which repositories exist,
-each repository represents a map
-
-- **map.yml file**: Each repository is expected to contain
-a map.yml file that in turn tells us the name and the
-version of the map.
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/CommitDateFetcher.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/CommitDateFetcher.java
deleted file mode 100644
index 7bc090e24a2..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/CommitDateFetcher.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.triplea.maps.indexing.tasks;
-
-import java.time.Instant;
-import java.util.Optional;
-import java.util.function.Function;
-import javax.annotation.Nonnull;
-import lombok.Builder;
-import lombok.extern.slf4j.Slf4j;
-import org.triplea.http.client.github.GithubApiClient;
-import org.triplea.http.client.github.MapRepoListing;
-
-/**
- * Given a map repo listing, does an API call to github to return the last commit date for that
- * repo. Returns an empty if there are any errors fetching last commit date.
- */
-@Builder
-@Slf4j
-public class CommitDateFetcher implements Function> {
-
- @Nonnull private final GithubApiClient githubApiClient;
-
- @Override
- public Optional apply(final MapRepoListing mapRepoListing) {
- try {
- return Optional.of(
- githubApiClient.fetchBranchInfo(mapRepoListing.getName(), "master").getLastCommitDate());
- } catch (final Exception e) {
- log.error(
- "Could not index map: {}, unable to fetch last commit date. Either the last commit"
- + "date was missing from the webservice call payload from github, or most likely"
- + "the webservice call to github failed.",
- mapRepoListing.getUri(),
- e);
- return Optional.empty();
- }
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/DownloadSizeFetcher.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/DownloadSizeFetcher.java
deleted file mode 100644
index 61e1ff17d36..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/DownloadSizeFetcher.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.triplea.maps.indexing.tasks;
-
-import com.google.common.annotations.VisibleForTesting;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.StandardCopyOption;
-import java.util.Optional;
-import java.util.function.Function;
-import lombok.AccessLevel;
-import lombok.Setter;
-import lombok.extern.slf4j.Slf4j;
-import org.triplea.http.client.github.MapRepoListing;
-import org.triplea.io.ContentDownloader;
-import org.triplea.io.FileUtils;
-import org.triplea.java.function.ThrowingFunction;
-
-/**
- * Given a map repo, determines the map download size.
- *
- *
Implementation note: download size is determined by downloading the entire file at the given
- * URI to a temp file and then returning the size of that temp file. The temp file is then deleted.
- */
-@Slf4j
-public class DownloadSizeFetcher implements Function> {
-
- @Setter(value = AccessLevel.PACKAGE, onMethod_ = @VisibleForTesting)
- private ThrowingFunction downloadFunction =
- (uri -> new ContentDownloader(uri).getStream());
-
- @Override
- public Optional apply(final MapRepoListing mapRepoListing) {
- final URI uri = URI.create(new DownloadUriCalculator().apply(mapRepoListing));
-
- log.info("Checking file size, downloading: " + uri);
- final Path tempFile = FileUtils.createTempFile().orElse(null);
- if (tempFile == null) {
- return Optional.empty();
- }
-
- // download the file at the given URI, the copy method will return the file sizes in bytes.
- try {
- final long fileSize =
- Files.copy(downloadFunction.apply(uri), tempFile, StandardCopyOption.REPLACE_EXISTING);
- FileUtils.delete(tempFile);
- return Optional.of(fileSize);
- } catch (final IOException e) {
- log.error("Error downloading: {}, {}", uri, e.getMessage(), e);
- FileUtils.delete(tempFile);
- return Optional.empty();
- }
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/DownloadUriCalculator.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/DownloadUriCalculator.java
deleted file mode 100644
index 9414b4c983d..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/DownloadUriCalculator.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.triplea.maps.indexing.tasks;
-
-import java.util.function.Function;
-import org.triplea.http.client.github.MapRepoListing;
-
-/** Given a map repo URI, determines the download URI for that map. */
-public class DownloadUriCalculator implements Function {
-
- @Override
- public String apply(final MapRepoListing mapRepoListing) {
- return mapRepoListing.getUri().toString() + "/archive/refs/heads/master.zip";
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/MapDescriptionReader.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/MapDescriptionReader.java
deleted file mode 100644
index a1bc7be3c4b..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/MapDescriptionReader.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.triplea.maps.indexing.tasks;
-
-import java.net.URI;
-import java.util.Optional;
-import java.util.function.Function;
-import org.triplea.http.client.github.MapRepoListing;
-import org.triplea.io.ContentDownloader;
-
-/**
- * A function where if given a map repo listing will find the 'description.html' file in that repo
- * and returns its contents. If the contents are too long or the file is missing then will return a
- * 'description-missing' error message with details on how to fix it.
- */
-public class MapDescriptionReader implements Function {
- private static final int DESCRIPTION_COLUMN_DATABASE_MAX_LENGTH = 3000;
-
- @Override
- public String apply(final MapRepoListing mapRepoListing) {
- final String description = downloadDescription(mapRepoListing).orElse(null);
- if (description == null) {
- return String.format(
- "No description available for: %s. "
- + "Contact the map author and request they add a 'description.html' file",
- mapRepoListing.getUri());
- } else if (description.length() > DESCRIPTION_COLUMN_DATABASE_MAX_LENGTH) {
- return String.format(
- "The description for this map is too long at %s characters. Max length is %s. "
- + "Contact the map author for: %s"
- + ", and request they reduce the length of the file 'description.html'",
- description.length(), DESCRIPTION_COLUMN_DATABASE_MAX_LENGTH, mapRepoListing.getUri());
- } else {
- return description;
- }
- }
-
- private Optional downloadDescription(final MapRepoListing mapRepoListing) {
- final String descriptionUri =
- mapRepoListing.getUri().toString() + "/blob/master/description.html?raw=true";
- return ContentDownloader.downloadAsString(URI.create(descriptionUri));
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/MapNameReader.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/MapNameReader.java
deleted file mode 100644
index 417b38fa7d7..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/MapNameReader.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.triplea.maps.indexing.tasks;
-
-import com.google.common.annotations.VisibleForTesting;
-import java.net.URI;
-import java.util.Map;
-import java.util.Optional;
-import java.util.function.Function;
-import lombok.AccessLevel;
-import lombok.Builder;
-import lombok.Setter;
-import lombok.extern.slf4j.Slf4j;
-import org.triplea.http.client.github.MapRepoListing;
-import org.triplea.io.ContentDownloader;
-import org.triplea.yaml.YamlReader;
-
-@Slf4j
-@Builder
-public class MapNameReader implements Function> {
- /* Function to download content as a string and log an info message if not found. */
- @Setter(value = AccessLevel.PACKAGE, onMethod_ = @VisibleForTesting)
- @Builder.Default
- private Function downloadFunction =
- uri -> ContentDownloader.downloadAsString(uri).orElse(null);
-
- /**
- * Determines the expected location of a map.yml file, downloads it, reads and returns the
- * 'map_name' attribute. Returns null if the file could not be found or otherwise could not be
- * read.
- */
- @Override
- public Optional apply(final MapRepoListing mapRepoListing) {
- final URI mapYmlUri =
- URI.create(mapRepoListing.getUri().toString() + "/blob/master/map.yml?raw=true");
-
- final String mapYamlContents = downloadFunction.apply(mapYmlUri);
- if (mapYamlContents == null) {
- log.warn("Could not index, missing map.yml. Expected URI: {}", mapYmlUri);
- return Optional.empty();
- }
-
- // parse and return the 'map_name' attribute from the YML file we just downloaded
- try {
- final Map mapYamlData = YamlReader.readMap(mapYamlContents);
- return Optional.of((String) mapYamlData.get("map_name"));
- } catch (final ClassCastException
- | YamlReader.InvalidYamlFormatException
- | NullPointerException e) {
- log.error("Invalid map.yml data found at URI: {}, error: {}", mapYmlUri, e.getMessage());
- return Optional.empty();
- }
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/PreviewUriCalculator.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/PreviewUriCalculator.java
deleted file mode 100644
index 90102103f5b..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/PreviewUriCalculator.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.triplea.maps.indexing.tasks;
-
-import java.util.function.Function;
-import org.triplea.http.client.github.MapRepoListing;
-
-public class PreviewUriCalculator implements Function {
- @Override
- public String apply(final MapRepoListing mapRepoListing) {
- return mapRepoListing.getUri().toString() + "/blob/master/preview.png?raw=true";
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/SkipMapIndexingCheck.java b/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/SkipMapIndexingCheck.java
deleted file mode 100644
index 67e5913bfce..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/indexing/tasks/SkipMapIndexingCheck.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.triplea.maps.indexing.tasks;
-
-import com.google.common.annotations.VisibleForTesting;
-import java.time.Instant;
-import java.util.Optional;
-import java.util.function.BiPredicate;
-import java.util.function.Function;
-import javax.annotation.Nonnull;
-import lombok.AllArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.triplea.http.client.github.MapRepoListing;
-import org.triplea.maps.indexing.MapIndexDao;
-
-/**
- * Given a repo and the last commit date of that repo, this predicate checks if we should skip
- * indexing of that repo. We should skip indexing if the last commit date of the repo is more recent
- * then what we have stored in database.
- */
-@Slf4j
-@AllArgsConstructor(onConstructor_ = @VisibleForTesting)
-public class SkipMapIndexingCheck implements BiPredicate {
- @Nonnull private final Function> databaseLastCommitDateLookup;
-
- public SkipMapIndexingCheck(final MapIndexDao mapIndexDao) {
- databaseLastCommitDateLookup =
- mapRepoListing -> mapIndexDao.getLastCommitDate(mapRepoListing.getUri().toString());
- }
-
- @Override
- public boolean test(final MapRepoListing mapRepoListing, final Instant lastCommitDateOnRepo) {
- final Instant lastCommitDateInDatabase =
- databaseLastCommitDateLookup.apply(mapRepoListing).orElse(null);
-
- if (lastCommitDateInDatabase != null
- && !lastCommitDateInDatabase.isBefore(lastCommitDateOnRepo)) {
- log.info(
- "Skipping, map indexing is up to date for: {}, "
- + "last commit date on repo: {}, "
- + "last commit date in database: {}",
- mapRepoListing.getUri(),
- lastCommitDateInDatabase,
- lastCommitDateInDatabase);
- return true;
- } else {
- return false;
- }
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/listing/MapListingDao.java b/servers/maps/server/src/main/java/org/triplea/maps/listing/MapListingDao.java
deleted file mode 100644
index f1b83a57560..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/listing/MapListingDao.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.triplea.maps.listing;
-
-import java.util.List;
-import org.jdbi.v3.sqlobject.statement.SqlQuery;
-
-public interface MapListingDao {
- /** Returns all maps registered listed in database. */
- @SqlQuery(
- "select"
- + " m.map_name,"
- + " m.download_url,"
- + " m.download_size_bytes,"
- + " m.preview_image_url,"
- + " m.description,"
- + " m.last_commit_date"
- + " from map_index m"
- + " order by m.map_name")
- List fetchMapListings();
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/listing/MapListingRecord.java b/servers/maps/server/src/main/java/org/triplea/maps/listing/MapListingRecord.java
deleted file mode 100644
index 8b3e0bc0e99..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/listing/MapListingRecord.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.triplea.maps.listing;
-
-import java.time.Instant;
-import java.util.List;
-import lombok.Builder;
-import lombok.Getter;
-import org.jdbi.v3.core.mapper.reflect.ColumnName;
-import org.triplea.http.client.maps.listing.MapDownloadItem;
-import org.triplea.http.client.maps.listing.MapTag;
-
-@Getter
-public class MapListingRecord {
- private final String name;
- private final String downloadUrl;
- private final String previewImageUrl;
- private final String description;
- private final Instant lastCommitDate;
- private final Long downloadSizeBytes;
-
- @Builder
- public MapListingRecord(
- @ColumnName("map_name") final String name,
- @ColumnName("download_url") final String downloadUrl,
- @ColumnName("preview_image_url") final String previewImageUrl,
- @ColumnName("description") final String description,
- @ColumnName("last_commit_date") final Instant lastCommitDate,
- @ColumnName("download_size_bytes") final Long downloadSizeBytes) {
- this.name = name;
- this.downloadUrl = downloadUrl;
- this.previewImageUrl = previewImageUrl;
- this.description = description;
- this.lastCommitDate = lastCommitDate;
- this.downloadSizeBytes = downloadSizeBytes;
- }
-
- public MapDownloadItem toMapDownloadItem(final List mapTags) {
- return MapDownloadItem.builder()
- .downloadUrl(downloadUrl)
- .downloadSizeInBytes(downloadSizeBytes)
- .previewImageUrl(previewImageUrl)
- .mapName(name)
- .lastCommitDateEpochMilli(lastCommitDate.toEpochMilli())
- .description(description)
- .mapTags(mapTags)
- .build();
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/listing/MapTagRecord.java b/servers/maps/server/src/main/java/org/triplea/maps/listing/MapTagRecord.java
deleted file mode 100644
index c5ebba099f0..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/listing/MapTagRecord.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.triplea.maps.listing;
-
-import lombok.Builder;
-import lombok.Getter;
-import org.jdbi.v3.core.mapper.reflect.ColumnName;
-import org.triplea.http.client.maps.listing.MapTag;
-
-@Getter
-public class MapTagRecord {
- private final String mapName;
- private final String tagName;
- private final String value;
- private final int displayOrder;
-
- @Builder
- public MapTagRecord(
- @ColumnName("map_name") final String mapName,
- @ColumnName("tag_name") final String tagName,
- @ColumnName("tag_value") final String value,
- @ColumnName("display_order") final int displayOrder) {
- this.mapName = mapName;
- this.tagName = tagName;
- this.value = value;
- this.displayOrder = displayOrder;
- }
-
- public MapTag toMapTag() {
- return MapTag.builder().name(tagName).value(value).displayOrder(displayOrder).build();
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/listing/MapsListingModule.java b/servers/maps/server/src/main/java/org/triplea/maps/listing/MapsListingModule.java
deleted file mode 100644
index 8c6e45560bc..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/listing/MapsListingModule.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.triplea.maps.listing;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
-import lombok.AllArgsConstructor;
-import org.jdbi.v3.core.Jdbi;
-import org.triplea.http.client.maps.listing.MapDownloadItem;
-import org.triplea.http.client.maps.listing.MapTag;
-import org.triplea.maps.tags.MapTagsDao;
-
-@AllArgsConstructor
-public class MapsListingModule implements Supplier> {
-
- private final MapListingDao mapListingDao;
- private final MapTagsDao mapTagsDao;
-
- public static MapsListingModule build(final Jdbi jdbi) {
- return new MapsListingModule(
- jdbi.onDemand(MapListingDao.class), //
- new MapTagsDao(jdbi));
- }
-
- /** Returns data for the full set of maps available to download. */
- @Override
- public List get() {
- final Collection mapListingRecords = mapListingDao.fetchMapListings();
- final Collection mapTags = mapTagsDao.fetchAllMapTags();
-
- // iterate over each map listing and combine it with the corresponding map tags
- return mapListingRecords.stream()
- .map(mapListingRecord -> toMapDownloadItem(mapListingRecord, mapTags))
- .collect(Collectors.toList());
- }
-
- private MapDownloadItem toMapDownloadItem(
- final MapListingRecord mapListingRecord, final Collection mapTags) {
-
- final List mapTagsForThisMap =
- mapTags.stream()
- .filter(m -> m.getMapName().equals(mapListingRecord.getName()))
- .map(MapTagRecord::toMapTag)
- .collect(Collectors.toList());
-
- return mapListingRecord.toMapDownloadItem(mapTagsForThisMap);
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagAdminModule.java b/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagAdminModule.java
deleted file mode 100644
index 47c54532836..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagAdminModule.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package org.triplea.maps.tags;
-
-import com.google.common.base.Strings;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import org.jdbi.v3.core.Jdbi;
-import org.triplea.http.client.maps.admin.MapTagMetaData;
-import org.triplea.http.client.maps.admin.UpdateMapTagRequest;
-
-@AllArgsConstructor
-public class MapTagAdminModule {
-
- private final MapTagsDao mapTagsDao;
-
- public static MapTagAdminModule build(final Jdbi jdbi) {
- return new MapTagAdminModule(new MapTagsDao(jdbi));
- }
-
- /**
- * Updates (upserts or deletes) the tag value on a given map.
- *
- *
Delete Case: If the new tag value is an empty string or null, then the tag value is deleted
- * from the map.
- *
- *
Insert Case: If the tag value is non-empty and the tag does not exist for the map, the tag
- * is created.
- *
- *
Update Case: If the tag exists for a given map, it is updated to a new value.
- */
- public UpdateMapTagResult updateMapTag(final UpdateMapTagRequest updateMapTagRequest) {
- // if new tag value is empty or null, then delete the map tag
- if (Strings.nullToEmpty(updateMapTagRequest.getNewTagValue()).isBlank()) {
- mapTagsDao.deleteMapTag(updateMapTagRequest.getMapName(), updateMapTagRequest.getTagName());
- return UpdateMapTagResult.builder()
- .success(true)
- .message(
- String.format(
- "Deleted: %s : %s",
- updateMapTagRequest.getMapName(), updateMapTagRequest.getTagName()))
- .build();
- } else {
- return mapTagsDao.upsertMapTag(
- updateMapTagRequest.getMapName(),
- updateMapTagRequest.getTagName(),
- updateMapTagRequest.getNewTagValue());
- }
- }
-
- /**
- * Queries DB to get the full set of tags and their allowed values. Results are returned by
- * display order. An empty string is automatically added to the set of allowed values for each
- * tag.
- */
- public List fetchMapTags() {
-
- // aggregate tuples of:
- // ,
- //
- // into:
- //
-
- // create a map where we will aggregate by tag name
- final Map builders = new HashMap<>();
-
- for (final MapTagMetaDataRecord mapTagMetaDataRecord : mapTagsDao.fetchAllTagsMetaData()) {
- if (builders.containsKey(mapTagMetaDataRecord.getName())) {
- builders
- .get(mapTagMetaDataRecord.getName())
- .addAllowedValue(mapTagMetaDataRecord.getAllowedValue());
- } else {
- builders.put(
- mapTagMetaDataRecord.getName(), new MapTagMetaDataBuilder(mapTagMetaDataRecord));
- }
- }
-
- return builders.values().stream()
- .sorted(Comparator.comparing(MapTagMetaDataBuilder::getDisplayOrder))
- .map(MapTagMetaDataBuilder::toMapTagMetaData)
- .collect(Collectors.toList());
- }
-
- private static class MapTagMetaDataBuilder {
- private final String name;
- @Getter private final int displayOrder;
- private final Set allowedValues;
-
- MapTagMetaDataBuilder(final MapTagMetaDataRecord mapTagMetaDataRecord) {
- this.name = mapTagMetaDataRecord.getName();
- this.displayOrder = mapTagMetaDataRecord.getDisplayOrder();
- allowedValues = new HashSet<>();
- allowedValues.add("");
- allowedValues.add(mapTagMetaDataRecord.getAllowedValue());
- }
-
- void addAllowedValue(final String allowedValue) {
- allowedValues.add(allowedValue);
- }
-
- MapTagMetaData toMapTagMetaData() {
- return MapTagMetaData.builder()
- .tagName(name)
- .displayOrder(displayOrder)
- .allowedValues(allowedValues.stream().sorted().collect(Collectors.toList()))
- .build();
- }
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagAllowedValueRecord.java b/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagAllowedValueRecord.java
deleted file mode 100644
index aebda6943a0..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagAllowedValueRecord.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.triplea.maps.tags;
-
-public class MapTagAllowedValueRecord {
- String tagName;
- String allowedValue;
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagMetaDataRecord.java b/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagMetaDataRecord.java
deleted file mode 100644
index 8531ed1d848..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagMetaDataRecord.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.triplea.maps.tags;
-
-import lombok.Builder;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.ToString;
-import org.jdbi.v3.core.mapper.reflect.ColumnName;
-
-@Getter
-@ToString
-@EqualsAndHashCode
-public class MapTagMetaDataRecord {
- private final String name;
- private final int displayOrder;
- private final String allowedValue;
-
- @Builder
- public MapTagMetaDataRecord(
- @ColumnName("name") final String name,
- @ColumnName("display_order") final int displayOrder,
- @ColumnName("allowed_value") final String allowedValue) {
- this.name = name;
- this.displayOrder = displayOrder;
- this.allowedValue = allowedValue;
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagsDao.java b/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagsDao.java
deleted file mode 100644
index 6d3774ba056..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/tags/MapTagsDao.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package org.triplea.maps.tags;
-
-import java.util.List;
-import lombok.AllArgsConstructor;
-import org.jdbi.v3.core.Jdbi;
-import org.triplea.maps.listing.MapTagRecord;
-
-@AllArgsConstructor
-public class MapTagsDao {
- private final Jdbi jdbi;
-
- /** Fetches the set of map tag values attached to a given map. */
- public List fetchAllMapTags() {
- final String query =
- "select"
- + " mi.map_name map_name,"
- + " mt.name tag_name,"
- + " mt.display_order,"
- + " mtav.value tag_value"
- + " from map_tag_value mtv"
- + " join map_tag mt on mt.id = mtv.map_tag_id"
- + " join map_tag_allowed_value mtav on mtav.id = mtv.map_tag_allowed_value_id"
- + " join map_index mi on mi.id = mtv.map_index_id"
- + " order by mi.map_name, mt.display_order";
- return jdbi.withHandle(
- handle ->
- handle
- .createQuery(query) //
- .mapTo(MapTagRecord.class)
- .list());
- }
-
- /** Returns the full set of tag names and all allowed values. */
- public List fetchAllTagsMetaData() {
- final String queryString =
- "select mt.name, mt.display_order, mtav.value allowed_value "
- + "from map_tag mt "
- + "join map_tag_allowed_value mtav on mtav.map_tag_id = mt.id "
- + "order by mt.display_order, mtav.value";
-
- return jdbi.withHandle(
- handle ->
- handle
- .createQuery(queryString) //
- .mapTo(MapTagMetaDataRecord.class)
- .list());
- }
-
- /**
- * Deletes a tag value on a given map.
- *
- * @param mapName The map whose tag will be deleted.
- * @param tagName The name of the tag to delete.
- */
- UpdateMapTagResult deleteMapTag(final String mapName, final String tagName) {
- final String query =
- "delete from map_tag_value "
- + "where "
- + " map_index_id = (select id from map_index where map_name = ?) "
- + " and map_tag_id = (select id from map_tag where name = ?)";
-
- jdbi.withHandle(handle -> handle.execute(query, mapName, tagName));
-
- return UpdateMapTagResult.builder()
- .success(true)
- .message(String.format("Deleted: %s : %s", mapName, tagName))
- .build();
- }
-
- /**
- * Upserts a given tag for a given map. Returns a failure result if the tag value is invalid or if
- * the map name cannot be found. Updates to the same value return a 'success'.
- *
- * @param mapName The name of the map to be tagged (map_index.map_name)
- * @param tagName The name of the tag to upsert
- * @param tagValue The value of the tag
- */
- UpdateMapTagResult upsertMapTag(
- final String mapName, final String tagName, final String tagValue) {
-
- final Integer tagAllowedValueId = lookupTagValueId(tagName, tagValue);
- if (tagAllowedValueId == null) {
- return UpdateMapTagResult.builder()
- .success(false)
- .message(String.format("%s is not a valid tag value for tag %s", tagValue, tagName))
- .build();
- }
-
- final Integer mapId = lookupMapId(mapName);
- if (mapId == null) {
- return UpdateMapTagResult.builder()
- .success(false)
- .message(String.format("Unable to find map with name %s", mapName))
- .build();
- }
-
- // run the upsert
- final String upsert =
- String.format(
- "insert into map_tag_value("
- + " map_tag_id, "
- + " map_index_id, "
- + " map_tag_allowed_value_id)"
- + " values("
- + " (select id from map_tag where name = :tagName),"
- + " %s,"
- + " %s"
- + " )"
- + " on conflict(map_tag_id, map_index_id)\n"
- + " do update set map_tag_allowed_value_id = %s",
- mapId, tagAllowedValueId, tagAllowedValueId);
-
- jdbi.withHandle(
- handle ->
- handle
- .createUpdate(upsert)
- .bind("tagName", tagName)
- .bind("mapName", mapName)
- .execute());
-
- return UpdateMapTagResult.builder()
- .success(true)
- .message(String.format("%s tagged with %s = %s", mapName, tagName, tagValue))
- .build();
- }
-
- private Integer lookupTagValueId(final String tagName, final String tagValue) {
- return jdbi.withHandle(
- handle ->
- handle
- .createQuery(
- "select mtav.id "
- + "from map_tag_allowed_value mtav "
- + "join map_tag mt on mt.id = mtav.map_tag_id "
- + "where mt.name = :tagName and mtav.value = :tagValue")
- .bind("tagName", tagName)
- .bind("tagValue", tagValue)
- .mapTo(Integer.class)
- .findOne()
- .orElse(null));
- }
-
- private Integer lookupMapId(final String mapName) {
- return jdbi.withHandle(
- handle ->
- handle
- .createQuery("select id from map_index where map_name = :mapName")
- .bind("mapName", mapName)
- .mapTo(Integer.class)
- .findOne()
- .orElse(null));
- }
-}
diff --git a/servers/maps/server/src/main/java/org/triplea/maps/tags/UpdateMapTagResult.java b/servers/maps/server/src/main/java/org/triplea/maps/tags/UpdateMapTagResult.java
deleted file mode 100644
index b4be70a110c..00000000000
--- a/servers/maps/server/src/main/java/org/triplea/maps/tags/UpdateMapTagResult.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.triplea.maps.tags;
-
-import lombok.Builder;
-import lombok.Value;
-
-@Builder
-@Value
-public class UpdateMapTagResult {
- boolean success;
- String message;
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/MapsModuleDatabaseTestSupport.java b/servers/maps/server/src/test/java/org/triplea/maps/MapsModuleDatabaseTestSupport.java
deleted file mode 100644
index 01ebc013e4c..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/MapsModuleDatabaseTestSupport.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.triplea.maps;
-
-import java.util.Collection;
-import org.jdbi.v3.core.mapper.RowMapperFactory;
-import org.triplea.spitfire.database.DatabaseTestSupport;
-
-public class MapsModuleDatabaseTestSupport extends DatabaseTestSupport {
- @Override
- protected Collection rowMappers() {
- return MapsModuleRowMappers.rowMappers();
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexDaoTest.java b/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexDaoTest.java
deleted file mode 100644
index 7f99e554661..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexDaoTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.triplea.maps.indexing;
-
-import static com.github.npathai.hamcrestopt.OptionalMatchers.isPresentAndIs;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import com.github.database.rider.core.api.dataset.DataSet;
-import com.github.database.rider.core.api.dataset.ExpectedDataSet;
-import com.github.database.rider.junit5.DBUnitExtension;
-import com.github.npathai.hamcrestopt.OptionalMatchers;
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
-import java.util.List;
-import lombok.AllArgsConstructor;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.triplea.maps.MapsModuleDatabaseTestSupport;
-import org.triplea.test.common.RequiresDatabase;
-
-@AllArgsConstructor
-@DataSet(value = "map_index.yml", useSequenceFiltering = false)
-@ExtendWith(MapsModuleDatabaseTestSupport.class)
-@ExtendWith(DBUnitExtension.class)
-@RequiresDatabase
-class MapIndexDaoTest {
-
- private final MapIndexDao mapIndexDao;
-
- @Test
- @ExpectedDataSet(value = "expected/map_index_upsert_updated.yml", orderBy = "id")
- void upsertUpdatesRecords() {
- mapIndexDao.upsert(
- MapIndexingResult.builder()
- .mapName("map-name-updated")
- .mapRepoUri("http-map-repo-url-2")
- .lastCommitDate(LocalDateTime.of(2000, 1, 12, 23, 59).toInstant(ZoneOffset.UTC))
- .mapDownloadSizeInBytes(6789L)
- .downloadUri("http-map-repo-3-download-updated-url")
- .previewImageUri("http-preview-image-url-3")
- .description("description-updated")
- .build());
- }
-
- /** The data we are inserting matches what is present in map_index.yml */
- @Test
- @ExpectedDataSet("map_index.yml")
- void upsertSameData() {
- mapIndexDao.upsert(
- MapIndexingResult.builder()
- .mapName("map-name-2")
- .mapRepoUri("http-map-repo-url-2")
- .lastCommitDate(LocalDateTime.of(2016, 1, 1, 23, 59, 20).toInstant(ZoneOffset.UTC))
- .mapDownloadSizeInBytes(1000L)
- .downloadUri("http-map-repo-url-2/archives/master.zip")
- .previewImageUri("http-preview-image-url-2")
- .description("description-repo-2")
- .build());
- }
-
- @Test
- @ExpectedDataSet("expected/map_index_post_remove.yml")
- void removeMaps() {
- mapIndexDao.removeMapsNotIn(List.of("http-map-repo-url"));
- }
-
- @Test
- void getLastCommitDate() {
- assertThat(
- mapIndexDao.getLastCommitDate("http-map-repo-url"),
- isPresentAndIs(LocalDateTime.of(2000, 12, 1, 23, 59, 20).toInstant(ZoneOffset.UTC)));
- assertThat(
- mapIndexDao.getLastCommitDate("http-map-repo-url-2"),
- isPresentAndIs(LocalDateTime.of(2016, 1, 1, 23, 59, 20).toInstant(ZoneOffset.UTC)));
-
- assertThat(
- "Map repo URL does not exist",
- mapIndexDao.getLastCommitDate("http://map-repo-url-DNE"),
- OptionalMatchers.isEmpty());
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexingIntegrationTest.java b/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexingIntegrationTest.java
deleted file mode 100644
index 09887fcb988..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexingIntegrationTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.triplea.maps.indexing;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.hamcrest.core.StringContains.containsString;
-
-import org.junit.jupiter.api.Test;
-import org.triplea.http.client.github.MapRepoListing;
-import org.triplea.maps.MapsServerConfig;
-import org.triplea.test.common.RequiresDatabase;
-
-/**
- * Test that does a live indexing (goes over network to github) of 'triplea-maps/test-map'. We'll
- * build an indexer and then run indexing on the test map. The test map will be in a known state and
- * we'll then verify the returned indexing results are as expected.
- */
-@RequiresDatabase
-public class MapIndexingIntegrationTest {
-
- @Test
- void runIndexingOnTestMap() {
- MapsServerConfig mapsServerConfig = new MapsServerConfig();
- mapsServerConfig.setGithubMapsOrgName("triplea-maps");
- mapsServerConfig.setGithubWebServiceUrl("https://api.github.com");
-
- final MapIndexingTask mapIndexingTaskRunner =
- MapsIndexingObjectFactory.mapIndexingTask(
- mapsServerConfig.createGithubApiClient(), (repo, repoLastCommitDate) -> false);
-
- final MapIndexingResult result =
- mapIndexingTaskRunner
- .apply(
- MapRepoListing.builder()
- .name("test-map")
- .htmlUrl("https://github.com/triplea-maps/test-map")
- .build())
- .orElseThrow(
- () -> new AssertionError("Expected a result to be returned, check logs for cause"));
-
- assertThat(result.getMapRepoUri(), is("https://github.com/triplea-maps/test-map"));
- assertThat("Map name is read from map.yml", result.getMapName(), is("Test Map"));
- assertThat(
- "Last commit date is parsed from an API call",
- result.getLastCommitDate(),
- is(notNullValue()));
- assertThat(
- "Description is downloaded from description.html",
- result.getDescription(),
- containsString(" by test"));
-
- assertThat(
- result.getDownloadUri(),
- is("https://github.com/triplea-maps/test-map/archive/refs/heads/master.zip"));
-
- assertThat(result.getMapDownloadSizeInBytes() > 0, is(true));
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexingTaskRunnerTest.java b/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexingTaskRunnerTest.java
deleted file mode 100644
index a99040e7655..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexingTaskRunnerTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.triplea.maps.indexing;
-
-import static org.mockito.Mockito.timeout;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
-import java.util.List;
-import java.util.Optional;
-import java.util.function.Function;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-import org.triplea.http.client.github.GithubApiClient;
-import org.triplea.http.client.github.MapRepoListing;
-
-@ExtendWith(MockitoExtension.class)
-class MapIndexingTaskRunnerTest {
-
- static final MapIndexingResult MAP_INDEX_RESULT =
- MapIndexingResult.builder()
- .lastCommitDate(LocalDateTime.of(2000, 1, 12, 23, 59).toInstant(ZoneOffset.UTC))
- .mapName("map-name")
- .mapRepoUri("http://repo")
- .downloadUri("http://repo-download")
- .previewImageUri("http://preview")
- .mapDownloadSizeInBytes(555L)
- .description("description")
- .build();
-
- @Mock MapIndexDao mapIndexDao;
- @Mock GithubApiClient githubApiClient;
- @Mock Function> mapIndexer;
- MapIndexingTaskRunner mapIndexingTaskRunner;
-
- @BeforeEach
- void setup() {
- mapIndexingTaskRunner =
- MapIndexingTaskRunner.builder()
- .mapIndexDao(mapIndexDao)
- .githubApiClient(githubApiClient)
- .mapIndexer(mapIndexer)
- .indexingTaskDelaySeconds(0)
- .build();
- }
-
- @Test
- @DisplayName(
- "Verify we fetch repos, run indexer, and then process results on non-empty indexed repos")
- void runMapIndexing() {
- final MapRepoListing repoListing1 =
- MapRepoListing.builder().name("uri-1").htmlUrl("https://uri-1").build();
- final MapRepoListing repoListing2 =
- MapRepoListing.builder().name("uri-2").htmlUrl("https://uri-2").build();
-
- when(githubApiClient.listRepositories()).thenReturn(List.of(repoListing1, repoListing2));
- when(mapIndexer.apply(repoListing1)).thenReturn(Optional.of(MAP_INDEX_RESULT));
-
- mapIndexingTaskRunner.run();
-
- verify(mapIndexDao).removeMapsNotIn(List.of("https://uri-1", "https://uri-2"));
- verify(mapIndexDao, timeout(2000)).upsert(MAP_INDEX_RESULT);
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexingTaskTest.java b/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexingTaskTest.java
deleted file mode 100644
index 3691d79e0ca..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/indexing/MapIndexingTaskTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package org.triplea.maps.indexing;
-
-import static com.github.npathai.hamcrestopt.OptionalMatchers.isEmpty;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-
-import java.time.Instant;
-import java.util.Optional;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.triplea.http.client.github.MapRepoListing;
-
-class MapIndexingTaskTest {
-
- private static final Instant instant = Instant.now();
-
- private static final MapRepoListing mapRepoListing =
- MapRepoListing.builder().htmlUrl("http://url").name("repo name").build();
-
- @Test
- @DisplayName("On successful indexing, data is aggregated correctly")
- void verifyMapIndexingHappyCase() {
- final var mapIndexingTask =
- MapIndexingTask.builder()
- .lastCommitDateFetcher(repoListing -> Optional.of(instant))
- .skipMapIndexingCheck((mapRepoListing, instant1) -> false)
- .mapNameReader(mapRepoListing -> Optional.of("map name"))
- .mapDescriptionReader(mapRepoListing -> "description")
- .downloadSizeFetcher(mapRepoListing -> Optional.of(10L))
- .build();
-
- final var mapIndexingResult =
- mapIndexingTask
- .apply(mapRepoListing)
- .orElseThrow(() -> new IllegalStateException("Unexpected empty result, check logs.."));
-
- assertThat(mapIndexingResult.getMapName(), is("map name"));
- assertThat(mapIndexingResult.getLastCommitDate(), is(instant));
- assertThat(mapIndexingResult.getDescription(), is("description"));
- assertThat(mapIndexingResult.getMapRepoUri(), is(mapRepoListing.getUri().toString()));
- assertThat(
- mapIndexingResult.getDownloadUri(),
- is(mapRepoListing.getUri().toString() + "/archive/refs/heads/master.zip"));
- assertThat(mapIndexingResult.getMapDownloadSizeInBytes(), is(10L));
- }
-
- @Test
- @DisplayName("No result if there is a failure getting last commit date from repo")
- void verifyNoResultIfLastCommitDateCannotBeObtained() {
- final var mapIndexingTask =
- MapIndexingTask.builder()
- .lastCommitDateFetcher(repoListing -> Optional.empty())
- .skipMapIndexingCheck((mapRepoListing, instant1) -> false)
- .mapNameReader(mapRepoListing -> Optional.of("map name"))
- .mapDescriptionReader(mapRepoListing -> "description")
- .downloadSizeFetcher(mapRepoListing -> Optional.of(10L))
- .build();
-
- final var mapIndexingResult = mapIndexingTask.apply(mapRepoListing);
-
- assertThat(
- "No value indicates we skipped indexing, because last commit date fetcher"
- + "return an empty we expect indexing to have been skipped.",
- mapIndexingResult,
- isEmpty());
- }
-
- @Test
- @DisplayName("No result if there skip check returns true")
- void verifyNoResultIfIndexingIsSkipped() {
- final var mapIndexingTask =
- MapIndexingTask.builder()
- .lastCommitDateFetcher(repoListing -> Optional.of(instant))
- .skipMapIndexingCheck((mapRepoListing, instant1) -> true)
- .mapNameReader(mapRepoListing -> Optional.of("map name"))
- .mapDescriptionReader(mapRepoListing -> "description")
- .downloadSizeFetcher(mapRepoListing -> Optional.of(10L))
- .build();
-
- final var mapIndexingResult = mapIndexingTask.apply(mapRepoListing);
-
- assertThat(
- "No value indicates we skipped indexing, because skip check returned true"
- + " we expect indexing to have been skipped.",
- mapIndexingResult,
- isEmpty());
- }
-
- @Test
- @DisplayName("No result if we fail to download")
- void verifyNoResultIfDownloadFails() {
- final var mapIndexingTask =
- MapIndexingTask.builder()
- .lastCommitDateFetcher(repoListing -> Optional.of(instant))
- .skipMapIndexingCheck((mapRepoListing, instant1) -> false)
- .mapNameReader(mapRepoListing -> Optional.of("map name"))
- .mapDescriptionReader(mapRepoListing -> "description")
- .downloadSizeFetcher(mapRepoListing -> Optional.empty())
- .build();
-
- final var mapIndexingResult = mapIndexingTask.apply(mapRepoListing);
-
- assertThat(
- "Download size fetcher returned empty, failure to download, indexing skipped",
- mapIndexingResult,
- isEmpty());
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/DownloadSizeFetcherTest.java b/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/DownloadSizeFetcherTest.java
deleted file mode 100644
index 08c14bd1129..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/DownloadSizeFetcherTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.triplea.maps.indexing.tasks;
-
-import static com.github.npathai.hamcrestopt.OptionalMatchers.isEmpty;
-import static com.github.npathai.hamcrestopt.OptionalMatchers.isPresentAndIs;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.Optional;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.triplea.http.client.github.MapRepoListing;
-import org.triplea.test.common.StringToInputStream;
-
-class DownloadSizeFetcherTest {
-
- private static final MapRepoListing mapRepoListing =
- MapRepoListing.builder().name("repo name").htmlUrl("htttps://fake-uri").build();
-
- /**
- * In this test we stub the downloaded content to be a fixed size string. We then verify the
- * reported download size matches teh byte length of the string.
- */
- @Test
- @DisplayName("Happy case, return content size downloaded")
- void returnContentSizeDownloaded() {
- final DownloadSizeFetcher downloadSizeFetcher = new DownloadSizeFetcher();
- final String contentsString = "this is a test";
- downloadSizeFetcher.setDownloadFunction(
- uri -> StringToInputStream.asInputStream(contentsString));
-
- final Optional result = downloadSizeFetcher.apply(mapRepoListing);
-
- assertThat(
- "The 'contentString' was 'fake' downloaded, reported download size should match the "
- + "byte length of that string.",
- result,
- isPresentAndIs((long) contentsString.getBytes(StandardCharsets.UTF_8).length));
- }
-
- @Test
- @DisplayName("Error case, error during download returns empty optional")
- void returnEmptyOnErrorDownloading() {
- final DownloadSizeFetcher downloadSizeFetcher = new DownloadSizeFetcher();
- downloadSizeFetcher.setDownloadFunction(
- uri -> {
- throw new IOException("test");
- });
-
- final Optional result = downloadSizeFetcher.apply(mapRepoListing);
-
- assertThat(result, isEmpty());
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/DownloadUriCalculatorTest.java b/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/DownloadUriCalculatorTest.java
deleted file mode 100644
index fde42c07cfd..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/DownloadUriCalculatorTest.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.triplea.maps.indexing.tasks;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-
-import org.junit.jupiter.api.Test;
-import org.triplea.http.client.github.MapRepoListing;
-
-class DownloadUriCalculatorTest {
-
- @Test
- void verifyDownloadUriCalculation() {
- final var mapRepoListing =
- MapRepoListing.builder()
- .htmlUrl("https://github.com/triplea-maps/test-map")
- .name("repo name")
- .build();
-
- final String result = new DownloadUriCalculator().apply(mapRepoListing);
-
- assertThat(
- result, is("https://github.com/triplea-maps/test-map/archive/refs/heads/master.zip"));
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/MapNameReaderTest.java b/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/MapNameReaderTest.java
deleted file mode 100644
index 25da9f304d3..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/MapNameReaderTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.triplea.maps.indexing.tasks;
-
-import static com.github.npathai.hamcrestopt.OptionalMatchers.isEmpty;
-import static com.github.npathai.hamcrestopt.OptionalMatchers.isPresentAndIs;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import java.util.Optional;
-import org.junit.jupiter.api.Test;
-import org.triplea.http.client.github.MapRepoListing;
-
-class MapNameReaderTest {
-
- @Test
- void readMapName() {
- final var mapNameReader =
- MapNameReader.builder().downloadFunction(uri -> "map_name: The Map Name").build();
-
- final Optional result =
- mapNameReader.apply(
- MapRepoListing.builder().name("repo name").htmlUrl("http://repo").build());
-
- assertThat(result, isPresentAndIs("The Map Name"));
- }
-
- @Test
- void readMapNameErrorCaseWithNoMapNameRead() {
- final var mapNameReader = MapNameReader.builder().downloadFunction(uri -> null).build();
-
- final Optional result =
- mapNameReader.apply(
- MapRepoListing.builder().name("repo name").htmlUrl("http://repo").build());
-
- assertThat(result, isEmpty());
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/PreviewUriCalculatorTest.java b/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/PreviewUriCalculatorTest.java
deleted file mode 100644
index 2209e5ea55d..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/indexing/tasks/PreviewUriCalculatorTest.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.triplea.maps.indexing.tasks;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-
-import org.junit.jupiter.api.Test;
-import org.triplea.http.client.github.MapRepoListing;
-
-class PreviewUriCalculatorTest {
- @Test
- void verifyDownloadUriCalculation() {
- final var mapRepoListing =
- MapRepoListing.builder()
- .htmlUrl("https://github.com/triplea-maps/test-map")
- .name("repo name")
- .build();
-
- final String result = new PreviewUriCalculator().apply(mapRepoListing);
-
- assertThat(
- result, is("https://github.com/triplea-maps/test-map/blob/master/preview.png?raw=true"));
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/listing/MapListingDaoTest.java b/servers/maps/server/src/test/java/org/triplea/maps/listing/MapListingDaoTest.java
deleted file mode 100644
index b9db241a791..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/listing/MapListingDaoTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.triplea.maps.listing;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
-import static org.hamcrest.core.Is.is;
-
-import com.github.database.rider.core.api.dataset.DataSet;
-import com.github.database.rider.junit5.DBUnitExtension;
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.triplea.maps.MapsModuleDatabaseTestSupport;
-import org.triplea.test.common.RequiresDatabase;
-
-@DataSet(value = "map_index.yml,map_tag_value.yml", useSequenceFiltering = false)
-@ExtendWith(MapsModuleDatabaseTestSupport.class)
-@ExtendWith(DBUnitExtension.class)
-@RequiresDatabase
-class MapListingDaoTest {
-
- private final MapListingDao mapListingDao;
-
- MapListingDaoTest(final MapListingDao mapListingDao) {
- this.mapListingDao = mapListingDao;
- }
-
- @Test
- void verifySelect() {
- final var results = mapListingDao.fetchMapListings();
- assertThat(results, hasSize(2));
- final var mapDownloadListing = results.get(0);
- assertThat(mapDownloadListing.getName(), is("map-name"));
- assertThat(mapDownloadListing.getDownloadUrl(), is("http-map-repo-url/archives/master.zip"));
- assertThat(mapDownloadListing.getDownloadSizeBytes(), is(4000L));
- assertThat(mapDownloadListing.getPreviewImageUrl(), is("http-preview-image-url"));
- assertThat(mapDownloadListing.getDescription(), is("description-repo-1"));
- assertThat(
- mapDownloadListing.getLastCommitDate().toEpochMilli(),
- is(LocalDateTime.of(2000, 12, 1, 23, 59, 20).toInstant(ZoneOffset.UTC).toEpochMilli()));
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/listing/MapsListingModuleTest.java b/servers/maps/server/src/test/java/org/triplea/maps/listing/MapsListingModuleTest.java
deleted file mode 100644
index 2f13f2de50b..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/listing/MapsListingModuleTest.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.triplea.maps.listing;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
-import static org.hamcrest.core.Is.is;
-import static org.mockito.Mockito.when;
-
-import java.time.Instant;
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
-import java.util.List;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-import org.triplea.http.client.maps.listing.MapDownloadItem;
-import org.triplea.maps.tags.MapTagsDao;
-
-@ExtendWith(MockitoExtension.class)
-class MapsListingModuleTest {
- private static final Instant commitDate1 =
- LocalDateTime.of(1990, 12, 31, 23, 59, 0).toInstant(ZoneOffset.UTC);
-
- private static final Instant commitDate2 =
- LocalDateTime.of(1999, 1, 30, 12, 59, 0).toInstant(ZoneOffset.UTC);
-
- private static final Instant commitDate3 =
- LocalDateTime.of(1999, 5, 30, 12, 59, 0).toInstant(ZoneOffset.UTC);
-
- @Mock private MapListingDao mapListingDao;
- @Mock private MapTagsDao mapTagsDao;
-
- @InjectMocks private MapsListingModule mapsListingModule;
-
- @Test
- @DisplayName("Should call map listing DAOs, merge and return data")
- void verifyDataFetch() {
- when(mapListingDao.fetchMapListings())
- .thenReturn(
- List.of(
- MapListingRecord.builder()
- .downloadUrl("http://map-url-1")
- .previewImageUrl("http-preview-url-1")
- .name("map-name-1")
- .lastCommitDate(commitDate1)
- .description("description-1")
- .downloadSizeBytes(10L)
- .build(),
- MapListingRecord.builder()
- .downloadUrl("http://map-url-2")
- .previewImageUrl("http-preview-url-2")
- .name("map-name-2")
- .lastCommitDate(commitDate2)
- .description("description-2")
- .downloadSizeBytes(20L)
- .build(),
- MapListingRecord.builder()
- .downloadUrl("http://map-url-3")
- .previewImageUrl("http-preview-url-3")
- .name("map-name-3")
- .lastCommitDate(commitDate3)
- .description("description-3")
- .downloadSizeBytes(30L)
- .build()));
-
- when(mapTagsDao.fetchAllMapTags())
- .thenReturn(
- List.of(
- // 2 tags on map-name-1
- MapTagRecord.builder()
- .mapName("map-name-1")
- .displayOrder(1)
- .tagName("tag-name-1")
- .value("tag-name-1-value")
- .build(),
- MapTagRecord.builder()
- .mapName("map-name-1")
- .displayOrder(2)
- .tagName("tag-name-2")
- .value("tag-name-2-value")
- .build(),
- // 1 tags on map-name-2
- MapTagRecord.builder()
- .mapName("map-name-2")
- .displayOrder(1)
- .tagName("tag-name-1")
- .value("map-2-tag-name-1-value")
- .build()
- // 0 tags on map-name-3
- ));
-
- final List results = mapsListingModule.get();
- assertThat(results, hasSize(3));
- // expected sort by map name, so first map should be id "1"
- assertThat(results.get(0).getMapName(), is("map-name-1"));
- assertThat(results.get(0).getLastCommitDateEpochMilli(), is(commitDate1.toEpochMilli()));
- assertThat(results.get(0).getDownloadUrl(), is("http://map-url-1"));
- assertThat(results.get(0).getPreviewImageUrl(), is("http-preview-url-1"));
- assertThat(results.get(0).getDownloadSizeInBytes(), is(10L));
- assertThat(results.get(0).getTagValue("tag-name-1"), is("tag-name-1-value"));
- assertThat(results.get(0).getTagValue("tag-name-2"), is("tag-name-2-value"));
-
- assertThat(results.get(1).getMapName(), is("map-name-2"));
- assertThat(results.get(1).getLastCommitDateEpochMilli(), is(commitDate2.toEpochMilli()));
- assertThat(results.get(1).getDownloadUrl(), is("http://map-url-2"));
- assertThat(results.get(1).getPreviewImageUrl(), is("http-preview-url-2"));
- assertThat(results.get(1).getDownloadSizeInBytes(), is(20L));
-
- assertThat(results.get(2).getMapName(), is("map-name-3"));
- assertThat(results.get(2).getLastCommitDateEpochMilli(), is(commitDate3.toEpochMilli()));
- assertThat(results.get(2).getDownloadUrl(), is("http://map-url-3"));
- assertThat(results.get(2).getPreviewImageUrl(), is("http-preview-url-3"));
- assertThat(results.get(2).getDownloadSizeInBytes(), is(30L));
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/tags/MapTagAdminModuleTest.java b/servers/maps/server/src/test/java/org/triplea/maps/tags/MapTagAdminModuleTest.java
deleted file mode 100644
index e45315c047e..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/tags/MapTagAdminModuleTest.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package org.triplea.maps.tags;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.IsCollectionContaining.hasItem;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import java.util.List;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.MethodSource;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-import org.triplea.http.client.maps.admin.MapTagMetaData;
-import org.triplea.http.client.maps.admin.UpdateMapTagRequest;
-
-@ExtendWith(MockitoExtension.class)
-class MapTagAdminModuleTest {
-
- @Mock MapTagsDao mapTagsDao;
-
- @InjectMocks MapTagAdminModule mapTagAdminModule;
-
- @DisplayName(
- "If we update a map tag to an empty or null value, "
- + "then we should delete the map tag value database row.")
- @ParameterizedTest
- @MethodSource
- void updateMapTagDeletionCases(final UpdateMapTagRequest updateMapTagRequest) {
- mapTagAdminModule.updateMapTag(updateMapTagRequest);
-
- verify(mapTagsDao)
- .deleteMapTag(updateMapTagRequest.getMapName(), updateMapTagRequest.getTagName());
- }
-
- @SuppressWarnings("unused")
- static List updateMapTagDeletionCases() {
- return List.of(
- UpdateMapTagRequest.builder()
- .mapName("map-name")
- .tagName("tag-name")
- .newTagValue("")
- .build(),
- UpdateMapTagRequest.builder()
- .mapName("map-name")
- .tagName("tag-name")
- .newTagValue(null)
- .build());
- }
-
- @DisplayName("Updating a map tag value to a non-empty value will upsert into database.")
- @Test
- void updateMapTag() {
- final var updateMapTagRequest =
- UpdateMapTagRequest.builder()
- .mapName("map-name")
- .tagName("tag-name")
- .newTagValue("any-value")
- .build();
-
- mapTagAdminModule.updateMapTag(updateMapTagRequest);
-
- verify(mapTagsDao)
- .upsertMapTag(
- updateMapTagRequest.getMapName(),
- updateMapTagRequest.getTagName(),
- updateMapTagRequest.getNewTagValue());
- }
-
- @Test
- void fetchMapTags() {
- when(mapTagsDao.fetchAllTagsMetaData())
- .thenReturn(
- List.of(
- MapTagMetaDataRecord.builder()
- .displayOrder(1)
- .name("Category")
- .allowedValue("AWESOME")
- .build(),
- MapTagMetaDataRecord.builder()
- .displayOrder(1)
- .name("Category")
- .allowedValue("GOOD")
- .build(),
- MapTagMetaDataRecord.builder()
- .displayOrder(2)
- .name("Rating")
- .allowedValue("1")
- .build()));
-
- final var results = mapTagAdminModule.fetchMapTags();
-
- assertThat(
- results,
- hasItem(
- MapTagMetaData.builder()
- .tagName("Category")
- .displayOrder(1)
- // note that empty string has been added
- .allowedValues(List.of("", "AWESOME", "GOOD"))
- .build()));
- assertThat(
- results,
- hasItem(
- MapTagMetaData.builder()
- .tagName("Rating")
- .displayOrder(2)
- // note that empty string has been added
- .allowedValues(List.of("", "1"))
- .build()));
- }
-}
diff --git a/servers/maps/server/src/test/java/org/triplea/maps/tags/MapTagsDaoTest.java b/servers/maps/server/src/test/java/org/triplea/maps/tags/MapTagsDaoTest.java
deleted file mode 100644
index 8b7f529a66c..00000000000
--- a/servers/maps/server/src/test/java/org/triplea/maps/tags/MapTagsDaoTest.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package org.triplea.maps.tags;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsCollectionContaining.hasItem;
-
-import com.github.database.rider.core.api.dataset.DataSet;
-import com.github.database.rider.core.api.dataset.ExpectedDataSet;
-import com.github.database.rider.junit5.DBUnitExtension;
-import lombok.AllArgsConstructor;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.triplea.maps.MapsModuleDatabaseTestSupport;
-import org.triplea.test.common.RequiresDatabase;
-
-@DataSet(value = "map_index.yml,map_tag_value.yml", useSequenceFiltering = false)
-@ExtendWith(MapsModuleDatabaseTestSupport.class)
-@ExtendWith(DBUnitExtension.class)
-@AllArgsConstructor
-@RequiresDatabase
-class MapTagsDaoTest {
-
- private final MapTagsDao mapTagsDao;
-
- @Test
- void verifyFetchTagsForGivenMap() {
- final var mapTags = mapTagsDao.fetchAllMapTags();
- assertThat(mapTags, hasSize(3));
- assertThat(mapTags.get(0).getMapName(), is("map-name"));
- assertThat(mapTags.get(0).getTagName(), is("Category"));
- assertThat(mapTags.get(0).getDisplayOrder(), is(1));
- assertThat(mapTags.get(0).getValue(), is("BEST"));
-
- assertThat(mapTags.get(1).getMapName(), is("map-name"));
- assertThat(mapTags.get(1).getTagName(), is("Rating"));
- assertThat(mapTags.get(1).getDisplayOrder(), is(2));
- assertThat(mapTags.get(1).getValue(), is("1"));
-
- assertThat(mapTags.get(2).getMapName(), is("map-name-2"));
- assertThat(mapTags.get(2).getTagName(), is("Rating"));
- assertThat(mapTags.get(2).getDisplayOrder(), is(2));
- assertThat(mapTags.get(2).getValue(), is("1"));
- }
-
- @DisplayName("Run a query to get all tags, then check that we have each expected result rows.")
- @Test
- void fetchAllTagsMetaData() {
- final var tags = mapTagsDao.fetchAllTagsMetaData();
-
- assertThat(
- tags,
- hasItem(
- MapTagMetaDataRecord.builder()
- .displayOrder(1)
- .name("Category")
- .allowedValue("AWESOME")
- .build()));
- assertThat(
- tags,
- hasItem(
- MapTagMetaDataRecord.builder()
- .displayOrder(1)
- .name("Category")
- .allowedValue("GOOD")
- .build()));
- assertThat(
- tags,
- hasItem(
- MapTagMetaDataRecord.builder()
- .displayOrder(1)
- .name("Category")
- .allowedValue("BEST")
- .build()));
-
- assertThat(
- tags,
- hasItem(
- MapTagMetaDataRecord.builder()
- .displayOrder(2)
- .name("Rating")
- .allowedValue("1")
- .build()));
- assertThat(
- tags,
- hasItem(
- MapTagMetaDataRecord.builder()
- .displayOrder(2)
- .name("Rating")
- .allowedValue("2")
- .build()));
- }
-
- @Test
- @ExpectedDataSet("expected/map_tag_value_after_tag_deleted.yml")
- void deleteMapTag() {
- mapTagsDao.deleteMapTag("map-name", "Category");
- }
-
- @DisplayName("Update an existing tag value to a new value")
- @Test
- @ExpectedDataSet("expected/map_tag_value_after_update_to_new_value.yml")
- void upsertMapTagNewValue() {
- final var result = mapTagsDao.upsertMapTag("map-name", "Category", "AWESOME");
- assertThat(result.isSuccess(), is(true));
- }
-
- @DisplayName("Insert a new tag value")
- @Test
- @ExpectedDataSet(value = "expected/map_tag_value_after_insert_new_value.yml")
- void upsertMapTagAddingNewTag() {
- // map-name-2 does not have a 'Category' tag
- final var result = mapTagsDao.upsertMapTag("map-name-2", "Category", "GOOD");
- assertThat(result.isSuccess(), is(true));
- }
-
- @DisplayName("Update a tag to an illegal value is a no-op error")
- @Test
- /* No changes expected to database */
- @ExpectedDataSet("map_tag_value.yml")
- void upsertMapTagToNonAllowed() {
- final var result = mapTagsDao.upsertMapTag("map-name", "Category", "BAD-VALUE");
- assertThat(result.isSuccess(), is(false));
- }
-
- @DisplayName("Update a tag to the wrong allowed value, the allowed value for a different tag")
- @Test
- /* No changes expected to database */
- @ExpectedDataSet("map_tag_value.yml")
- void upsertMapTagToWrongAllowedValue() {
- final var result = mapTagsDao.upsertMapTag("map-name", "Category", "1");
- assertThat(result.isSuccess(), is(false));
- }
-
- @DisplayName("Update a non-existing tag is a no-op error")
- @Test
- /* No changes expected to database */
- @ExpectedDataSet("map_tag_value.yml")
- void upsertMapTagToNonExistentTag() {
- final var result = mapTagsDao.upsertMapTag("map-name", "Bad-Tag-Name", "ANY-VALUE");
- assertThat(result.isSuccess(), is(false));
- }
-
- @DisplayName("Updating the tag of a non-existing map is a no-op error")
- @Test
- /* No changes expected to database */
- @ExpectedDataSet("map_tag_value.yml")
- void upsertMapTagWhereMapDoesNotExist() {
- final var result = mapTagsDao.upsertMapTag("bad-map-name", "Category", "GOOD");
- assertThat(result.isSuccess(), is(false));
- }
-}
diff --git a/servers/maps/server/src/test/resources/datasets/expected/map_index_post_remove.yml b/servers/maps/server/src/test/resources/datasets/expected/map_index_post_remove.yml
deleted file mode 100644
index b0a37ea4422..00000000000
--- a/servers/maps/server/src/test/resources/datasets/expected/map_index_post_remove.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-map_index:
- - id: 10
- map_name: map-name
- repo_url: "http-map-repo-url"
- last_commit_date: 2000-12-01 23:59:20.0
diff --git a/servers/maps/server/src/test/resources/datasets/expected/map_index_upsert_updated.yml b/servers/maps/server/src/test/resources/datasets/expected/map_index_upsert_updated.yml
deleted file mode 100644
index 2719eb69414..00000000000
--- a/servers/maps/server/src/test/resources/datasets/expected/map_index_upsert_updated.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-map_index:
- - id: 10
- map_name: map-name
- repo_url: 'http-map-repo-url'
- description: description-repo-1
- download_url: 'http-map-repo-url/archives/master.zip'
- preview_image_url: 'http-preview-image-url'
- download_size_bytes: 4000
- last_commit_date: 2000-12-01 23:59:20.0
- - id: 20
- map_name: map-name-updated
- repo_url: "http-map-repo-url-2"
- description: description-updated
- download_url: 'http-map-repo-3-download-updated-url'
- preview_image_url: 'http-preview-image-url-3'
- download_size_bytes: 6789
- last_commit_date: 2000-01-12 23:59:00.0
diff --git a/servers/maps/server/src/test/resources/datasets/expected/map_tag_value_after_insert_new_value.yml b/servers/maps/server/src/test/resources/datasets/expected/map_tag_value_after_insert_new_value.yml
deleted file mode 100644
index 1fb6cb89cb0..00000000000
--- a/servers/maps/server/src/test/resources/datasets/expected/map_tag_value_after_insert_new_value.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-map_tag_value:
- # new row added
- - id: "regex:\\d+" #any number
- map_tag_id: 500
- map_index_id: 20
- map_tag_allowed_value_id: 5001
- - id: 3000
- map_tag_id: 500
- map_index_id: 10
- map_tag_allowed_value_id: 5000
- - id: 3001
- map_tag_id: 800
- map_index_id: 10
- map_tag_allowed_value_id: 6000
- - id: 3002
- map_tag_id: 800
- map_index_id: 20
- map_tag_allowed_value_id: 6000
diff --git a/servers/maps/server/src/test/resources/datasets/expected/map_tag_value_after_tag_deleted.yml b/servers/maps/server/src/test/resources/datasets/expected/map_tag_value_after_tag_deleted.yml
deleted file mode 100644
index 926b7385a7b..00000000000
--- a/servers/maps/server/src/test/resources/datasets/expected/map_tag_value_after_tag_deleted.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-map_tag_value:
- - id: 3001
- map_tag_id: 800
- map_index_id: 10
- map_tag_allowed_value_id: 6000
- - id: 3002
- map_tag_id: 800
- map_index_id: 20
- map_tag_allowed_value_id: 6000
diff --git a/servers/maps/server/src/test/resources/datasets/expected/map_tag_value_after_update_to_new_value.yml b/servers/maps/server/src/test/resources/datasets/expected/map_tag_value_after_update_to_new_value.yml
deleted file mode 100644
index 416d9128e30..00000000000
--- a/servers/maps/server/src/test/resources/datasets/expected/map_tag_value_after_update_to_new_value.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-map_tag_value:
- - id: 3000
- map_tag_id: 500
- map_index_id: 10
- # tag_value is updated from 'BEST' to 'AWESOME'
- map_tag_allowed_value_id: 5002
- - id: 3001
- map_tag_id: 800
- map_index_id: 10
- map_tag_allowed_value_id: 6000
- - id: 3002
- map_tag_id: 800
- map_index_id: 20
- map_tag_allowed_value_id: 6000
diff --git a/servers/maps/server/src/test/resources/datasets/map_index.yml b/servers/maps/server/src/test/resources/datasets/map_index.yml
deleted file mode 100644
index cf32b3217b9..00000000000
--- a/servers/maps/server/src/test/resources/datasets/map_index.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-map_index:
- - id: 10
- map_name: map-name
- # Do not use "http:" in test data, DB rider logs a noisy warning about this.
- # repo_url must otherwise begin with 'http' per column constraint
- repo_url: 'http-map-repo-url'
- description: description-repo-1
- download_url: 'http-map-repo-url/archives/master.zip'
- preview_image_url: 'http-preview-image-url'
- download_size_bytes: 4000
- last_commit_date: 2000-12-01 23:59:20.0
- - id: 20
- map_name: map-name-2
- repo_url: 'http-map-repo-url-2'
- description: description-repo-2
- download_url: 'http-map-repo-url-2/archives/master.zip'
- preview_image_url: 'http-preview-image-url-2'
- download_size_bytes: 1000
- last_commit_date: 2016-01-01 23:59:20.0
diff --git a/servers/maps/server/src/test/resources/datasets/map_tag_value.yml b/servers/maps/server/src/test/resources/datasets/map_tag_value.yml
deleted file mode 100644
index a6d7b967857..00000000000
--- a/servers/maps/server/src/test/resources/datasets/map_tag_value.yml
+++ /dev/null
@@ -1,38 +0,0 @@
-map_tag:
- - id: 500
- name: Category
- display_order: 1
- - id: 800
- name: Rating
- display_order: 2
-
-map_tag_allowed_value:
- - id: 5000
- map_tag_id: 500
- value: BEST
- - id: 5001
- map_tag_id: 500
- value: GOOD
- - id: 5002
- map_tag_id: 500
- value: AWESOME
- - id: 6000
- map_tag_id: 800
- value: 1
- - id: 6001
- map_tag_id: 800
- value: 2
-
-map_tag_value:
- - id: 3000
- map_tag_id: 500
- map_index_id: 10
- map_tag_allowed_value_id: 5000
- - id: 3001
- map_tag_id: 800
- map_index_id: 10
- map_tag_allowed_value_id: 6000
- - id: 3002
- map_tag_id: 800
- map_index_id: 20
- map_tag_allowed_value_id: 6000
diff --git a/servers/maps/server/src/test/resources/db-cleanup.sql b/servers/maps/server/src/test/resources/db-cleanup.sql
deleted file mode 100644
index 52c84368379..00000000000
--- a/servers/maps/server/src/test/resources/db-cleanup.sql
+++ /dev/null
@@ -1,5 +0,0 @@
--- Deletes table data in proper order
-
-delete from map_tag_value;
-delete from map_tag_allowed_value;
-delete from map_index;
diff --git a/servers/maps/server/src/test/resources/dbunit.yml b/servers/maps/server/src/test/resources/dbunit.yml
deleted file mode 100644
index 1f4bedcd880..00000000000
--- a/servers/maps/server/src/test/resources/dbunit.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-connectionConfig:
- driver: "org.postgresql.Driver"
- url: "jdbc:postgresql://localhost:5432/lobby_db"
- user: "lobby_user"
- password: "lobby"
diff --git a/servers/maps/server/src/test/resources/logback-test.xml b/servers/maps/server/src/test/resources/logback-test.xml
deleted file mode 100644
index 4b4865541d2..00000000000
--- a/servers/maps/server/src/test/resources/logback-test.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- %d [%thread] %logger{36} %-5level: %msg%n
-
-
-
-
-
-
-
-
-
-
diff --git a/servers/server-lib/build.gradle b/servers/server-lib/build.gradle
deleted file mode 100644
index fe633824e35..00000000000
--- a/servers/server-lib/build.gradle
+++ /dev/null
@@ -1,9 +0,0 @@
-dependencies {
- implementation "com.liveperson:dropwizard-websockets:$dropwizardWebsocketsVersion"
- implementation "io.dropwizard:dropwizard-auth:$dropwizardVersion"
- implementation "io.dropwizard:dropwizard-core:$dropwizardVersion"
- implementation "io.dropwizard:dropwizard-jdbi3:$dropwizardVersion"
- implementation project(":lib:java-extras")
-
- testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
-}
diff --git a/servers/server-lib/src/main/java/org/triplea/dropwizard/common/AuthenticationConfiguration.java b/servers/server-lib/src/main/java/org/triplea/dropwizard/common/AuthenticationConfiguration.java
deleted file mode 100644
index aeb1060a5a4..00000000000
--- a/servers/server-lib/src/main/java/org/triplea/dropwizard/common/AuthenticationConfiguration.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.triplea.dropwizard.common;
-
-import com.codahale.metrics.MetricRegistry;
-import com.github.benmanes.caffeine.cache.Caffeine;
-import io.dropwizard.auth.AuthDynamicFeature;
-import io.dropwizard.auth.AuthValueFactoryProvider;
-import io.dropwizard.auth.Authenticator;
-import io.dropwizard.auth.Authorizer;
-import io.dropwizard.auth.CachingAuthenticator;
-import io.dropwizard.auth.oauth.OAuthCredentialAuthFilter;
-import io.dropwizard.setup.Environment;
-import java.security.Principal;
-import java.time.Duration;
-import lombok.experimental.UtilityClass;
-import org.glassfish.jersey.server.filter.RolesAllowedDynamicFeature;
-
-@UtilityClass
-public class AuthenticationConfiguration {
-
- /**
- * Enables configuration via OAuth token. Endpoints annotated with @RolesAllowed will be activated
- * and will require a user to have been a given role during per-request authentication.
- */
- public static void enableAuthentication(
- final Environment environment,
- final MetricRegistry metrics,
- final Authenticator authenticator,
- final Authorizer authorizer,
- final Class principalClass) {
- environment
- .jersey()
- .register(
- new AuthDynamicFeature(
- new OAuthCredentialAuthFilter.Builder()
- .setAuthenticator(
- new CachingAuthenticator<>(
- metrics,
- authenticator,
- Caffeine.newBuilder()
- .expireAfterAccess(Duration.ofMinutes(10))
- .maximumSize(10000)))
- .setAuthorizer(authorizer)
- .setPrefix("Bearer")
- .buildAuthFilter()));
- environment.jersey().register(new AuthValueFactoryProvider.Binder<>(principalClass));
- environment.jersey().register(new RolesAllowedDynamicFeature());
- }
-}
diff --git a/servers/server-lib/src/main/java/org/triplea/dropwizard/common/IllegalArgumentMapper.java b/servers/server-lib/src/main/java/org/triplea/dropwizard/common/IllegalArgumentMapper.java
deleted file mode 100644
index 5766657e3b1..00000000000
--- a/servers/server-lib/src/main/java/org/triplea/dropwizard/common/IllegalArgumentMapper.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.triplea.dropwizard.common;
-
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.ExceptionMapper;
-
-/**
- * This class is used to convert IllegalArgumentExceptions thrown by http endpoint controllers to
- * return HTTP status 400 codes. Without this, those errors would be 500s.
- */
-public class IllegalArgumentMapper implements ExceptionMapper {
- @Override
- public Response toResponse(final IllegalArgumentException exception) {
- return Response.status(Response.Status.BAD_REQUEST)
- .entity("Http 400 - Bad Request: " + exception.getMessage())
- .build();
- }
-}
diff --git a/servers/server-lib/src/main/java/org/triplea/dropwizard/common/IpAddressExtractor.java b/servers/server-lib/src/main/java/org/triplea/dropwizard/common/IpAddressExtractor.java
deleted file mode 100644
index 62174f5c813..00000000000
--- a/servers/server-lib/src/main/java/org/triplea/dropwizard/common/IpAddressExtractor.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.triplea.dropwizard.common;
-
-import javax.servlet.http.HttpServletRequest;
-import lombok.experimental.UtilityClass;
-
-@UtilityClass
-public class IpAddressExtractor {
-
- /**
- * Extracts the IP address of the remote address making an HttpServletRequest.
- *
- *
httpServletRequest.getRemoteAddr() can return a value surrounded by square brackets. This
- * method will return that remote addr with square brackets stripped.
- *
- * @return valid IP address of the remote machine making
- */
- public String extractIpAddress(HttpServletRequest httpServletRequest) {
- return httpServletRequest
- .getRemoteAddr() //
- .replaceAll("\\[", "")
- .replaceAll("\\]", "");
- }
-}
diff --git a/servers/server-lib/src/main/java/org/triplea/dropwizard/common/JdbiLogging.java b/servers/server-lib/src/main/java/org/triplea/dropwizard/common/JdbiLogging.java
deleted file mode 100644
index 22f9e42fcf4..00000000000
--- a/servers/server-lib/src/main/java/org/triplea/dropwizard/common/JdbiLogging.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.triplea.dropwizard.common;
-
-import java.sql.SQLException;
-import lombok.experimental.UtilityClass;
-import lombok.extern.slf4j.Slf4j;
-import org.jdbi.v3.core.Jdbi;
-import org.jdbi.v3.core.statement.SqlLogger;
-import org.jdbi.v3.core.statement.StatementContext;
-
-@UtilityClass
-@Slf4j
-public class JdbiLogging {
- /** Adds a logger to JDBI that will log SQL statements before they are executed. */
- public static void registerSqlLogger(final Jdbi jdbi) {
- jdbi.setSqlLogger(
- new SqlLogger() {
- @Override
- public void logBeforeExecution(final StatementContext context) {
- log.info("Executing SQL: " + context.getRawSql());
- }
-
- @Override
- public void logAfterExecution(final StatementContext context) {}
-
- @Override
- public void logException(final StatementContext context, final SQLException ex) {
- log.error("Exception executing SQL: " + context.getRawSql(), ex);
- }
- });
- }
-}
diff --git a/servers/server-lib/src/main/java/org/triplea/dropwizard/common/ServerConfiguration.java b/servers/server-lib/src/main/java/org/triplea/dropwizard/common/ServerConfiguration.java
deleted file mode 100644
index 5d3848b2453..00000000000
--- a/servers/server-lib/src/main/java/org/triplea/dropwizard/common/ServerConfiguration.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package org.triplea.dropwizard.common;
-
-import io.dropwizard.Configuration;
-import io.dropwizard.configuration.EnvironmentVariableSubstitutor;
-import io.dropwizard.configuration.SubstitutingSourceProvider;
-import io.dropwizard.jdbi3.bundles.JdbiExceptionsBundle;
-import io.dropwizard.setup.Bootstrap;
-import io.dropwizard.setup.Environment;
-import io.dropwizard.websockets.WebsocketBundle;
-import java.util.Arrays;
-import java.util.List;
-import javax.websocket.server.ServerEndpointConfig;
-import javax.ws.rs.container.ContainerRequestFilter;
-import lombok.AllArgsConstructor;
-
-/**
- * Facilitates configuration for a dropwizard server Application class.
- *
- * @param Configuration class type of the server.
- */
-public class ServerConfiguration {
-
- private final Bootstrap bootstrap;
-
- @AllArgsConstructor
- public static class WebsocketConfig {
- private final Class> websocketClass;
- private final String path;
- }
-
- private ServerConfiguration(
- final Bootstrap bootstrap, final WebsocketConfig... websocketConfigs) {
- this.bootstrap = bootstrap;
-
- final ServerEndpointConfig[] websockets = addWebsockets(websocketConfigs);
- bootstrap.addBundle(new WebsocketBundle(websockets));
- }
-
- private ServerEndpointConfig[] addWebsockets(final WebsocketConfig... websocketConfigs) {
- return Arrays.stream(websocketConfigs)
- .map(
- websocketConfig ->
- ServerEndpointConfig.Builder.create(
- websocketConfig.websocketClass, websocketConfig.path)
- .build())
- .toArray(ServerEndpointConfig[]::new);
- }
-
- public static ServerConfiguration build(
- final Bootstrap bootstrap, final WebsocketConfig... websocketConfigs) {
- return new ServerConfiguration<>(bootstrap, websocketConfigs);
- }
-
- /**
- * This bootstrap will replace ${...} values in YML configuration with environment variable
- * values. Without it, all values in the YML configuration are treated as literals.
- */
- public ServerConfiguration enableEnvironmentVariablesInConfig() {
- bootstrap.setConfigurationSourceProvider(
- new SubstitutingSourceProvider(
- bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
- return this;
- }
-
- /**
- * From: https://www.dropwizard.io/0.7.1/docs/manual/jdbi.html By adding the JdbiExceptionsBundle
- * to your application, Dropwizard will automatically unwrap ant thrown SQLException or
- * DBIException instances. This is critical for debugging, since otherwise only the common wrapper
- * exception’s stack trace is logged.
- */
- public ServerConfiguration enableBetterJdbiExceptions() {
- bootstrap.addBundle(new JdbiExceptionsBundle());
- return this;
- }
-
- public ServerConfiguration registerRequestFilter(
- final Environment environment, final ContainerRequestFilter containerRequestFilter) {
- environment.jersey().register(containerRequestFilter);
- return this;
- }
-
- /**
- * Registers an exception mapping, meaning an uncaught exception matching an exception mapper will
- * then "go through" the exception mapper. This can be used for example to register an exception
- * mapper for something like IllegalArgumentException to return a status 400 response
- * rather than a status 500 response. Exception mappers can be also be used for common logging or
- * for returning a specific response entity.
- */
- public ServerConfiguration registerExceptionMappers(
- final Environment environment, final List