Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added locationByDeepCoverageZone to the `crs/stats/ip/{ip}` endpoint in the Traffic Router API

### Fixed
- Fixed #5274 - CDN in a Box's Traffic Vault image failed to build due to Basho's repo responding with 402 Payment Required. The repo has been removed from the image.
- [#5274](https://github.com/apache/trafficcontrol/issues/5274) - CDN in a Box's Traffic Vault image failed to build due
to Basho's repo responding with 402 Payment Required. The repo has been removed from the image.
- [#5069](https://github.com/apache/trafficcontrol/issues/5069) - For LetsEncryptDnsChallengerWatcher in Traffic Router,
the cr-config location is configurable instead of only looking at `/opt/traffic_router/db/cr-config.json`

## [5.0.0] - 2020-10-20
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,18 @@
import org.apache.log4j.Logger;

import java.io.*;
import java.nio.file.Path;
import java.time.Instant;
import java.util.HashMap;
import java.util.List;

public class LetsEncryptDnsChallengeWatcher extends AbstractResourceWatcher {
private static final Logger LOGGER = Logger.getLogger(LetsEncryptDnsChallengeWatcher.class);
public static final String DEFAULT_LE_DNS_CHALLENGE_URL = "https://${toHostname}/api/2.0/letsencrypt/dnsrecords/";
private static final String configFile = "/opt/traffic_router/db/cr-config.json";

private String configFile;
private ConfigHandler configHandler;

public void setConfigHandler(final ConfigHandler configHandler) {
this.configHandler = configHandler;
}
private Path databasesDirectory;

public LetsEncryptDnsChallengeWatcher() {
setDatabaseUrl(DEFAULT_LE_DNS_CHALLENGE_URL);
Expand Down Expand Up @@ -134,7 +132,7 @@ public String getWatcherConfigPrefix() {

private String readConfigFile() {
try {
final InputStream is = new FileInputStream(configFile);
final InputStream is = new FileInputStream(databasesDirectory.resolve(configFile).toString());
final BufferedReader buf = new BufferedReader(new InputStreamReader(is));
String line = buf.readLine();
final StringBuilder sb = new StringBuilder();
Expand All @@ -144,7 +142,7 @@ private String readConfigFile() {
}
return sb.toString();
} catch (Exception e) {
LOGGER.error("Could not read cr-config file.");
LOGGER.error("Could not read cr-config file " + configFile + ".");
return null;
}
}
Expand Down Expand Up @@ -178,4 +176,18 @@ private ArrayNode updateStaticEntries(final LetsEncryptDnsChallenge challenge, f
return newStaticDnsEntriesNode;
}

public void setConfigHandler(final ConfigHandler configHandler) {
this.configHandler = configHandler;
}
public ConfigHandler getConfigHandler() {
return this.configHandler;
}

public void setDatabasesDirectory(final Path databasesDirectory) {
this.databasesDirectory = databasesDirectory;
}

public void setConfigFile(final String configFile) {
this.configFile = configFile;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@
<property name="steeringRegistry" ref="steeringRegistry" />
</bean>

<bean id="letsEncryptDnsChallengeWatcher" class="com.comcast.cdn.traffic_control.traffic_router.core.ds.LetsEncryptDnsChallengeWatcher">
<property name="executorService" ref="ScheduledExecutorService" />
<property name="databasesDirectory" ref="databasesDir" />
<property name="databaseName" value="$[cache.letsencrypt.database:letsencrypt.json]" />
<property name="trafficOpsUtils" ref="trafficOpsUtils" />
<property name="trafficRouterManager" ref="trafficRouterManager" />
<bean id="letsEncryptDnsChallengeWatcher" class="com.comcast.cdn.traffic_control.traffic_router.core.ds.LetsEncryptDnsChallengeWatcher">
<property name="executorService" ref="ScheduledExecutorService" />
<property name="databasesDirectory" ref="databasesDir" />
<property name="databaseName" value="$[cache.letsencrypt.database:letsencrypt.json]" />
<property name="trafficOpsUtils" ref="trafficOpsUtils" />
<property name="trafficRouterManager" ref="trafficRouterManager" />
<property name="pollingInterval" value="60000" />
<property name="configHandler" ref="ConfigHandler" />
<property name="configFile" value="$[cache.config.json:cr-config.json]" />
<property name="configHandler" ref="ConfigHandler" />
</bean>

<bean id="certificatesQueue" class="java.util.concurrent.ArrayBlockingQueue" >
Expand Down