Browse Source

More flexible auto-update locations

split-DB
catbref 5 years ago
parent
commit
4ced9cc3e2
  1. 2
      src/main/java/org/qora/controller/AutoUpdate.java
  2. 2
      src/main/java/org/qora/settings/Settings.java

2
src/main/java/org/qora/controller/AutoUpdate.java

@ -149,7 +149,7 @@ public class AutoUpdate extends Thread {
private static boolean attemptUpdate(byte[] commitHash, byte[] downloadHash, String repoBaseUri) { private static boolean attemptUpdate(byte[] commitHash, byte[] downloadHash, String repoBaseUri) {
LOGGER.info(String.format("Fetching update from %s", repoBaseUri)); LOGGER.info(String.format("Fetching update from %s", repoBaseUri));
InputStream in = ApiRequest.fetchStream(repoBaseUri + "/raw/" + HashCode.fromBytes(commitHash).toString() + "/" + JAR_FILENAME); InputStream in = ApiRequest.fetchStream(String.format(repoBaseUri, HashCode.fromBytes(commitHash).toString()));
if (in == null) { if (in == null) {
LOGGER.warn(String.format("Failed to fetch update from %s", repoBaseUri)); LOGGER.warn(String.format("Failed to fetch update from %s", repoBaseUri));
return false; // failed - try another repo return false; // failed - try another repo

2
src/main/java/org/qora/settings/Settings.java

@ -83,7 +83,7 @@ public class Settings {
// Auto-update sources // Auto-update sources
private String[] autoUpdateRepos = new String[] { private String[] autoUpdateRepos = new String[] {
"https://github.com/catbref/qora-core" "https://github.com/catbref/qora-core/raw/%s/qora-core.jar"
}; };
// Constructors // Constructors

Loading…
Cancel
Save