Skip to content

Commit

Permalink
Migrate to a new service domain
Browse files Browse the repository at this point in the history
This resolves #83
  • Loading branch information
JustOff committed Jun 17, 2020
1 parent bd86c5a commit 43c7c7e
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ let httpObserver = {
} else if (/origin=caa&action=download$/.test(subject.URI.path)) {
subject.setResponseHeader("Content-Disposition", "attachment", false);
}
} else if (subject.URI.host == "ca-archive.biz.tm") {
} else if (subject.URI.host == "ca-archive.us.to") {
if (subject.responseStatus == "302" && /^\/storage\//.test(subject.URI.path)) {
let redirect;
if ((redirect = /^https?:\/\/(.+?)\//.exec(subject.getResponseHeader("Location"))) !== null) {
Expand Down
2 changes: 1 addition & 1 deletion content/addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ let Addon = {
} else if (Services.appinfo.name != "SeaMonkey" && Services.appinfo.name != "Iceape-UXP") {
appver = Services.appinfo.version;
}
data.downurl = "https://ca-archive.biz.tm/storage/" + Math.trunc(dbQuery.row.addon_id/1000) + "/" + dbQuery.row.addon_id + "/" + dbQuery.row.url.replace(/^\d+\/(.*)/,"$1") + "?origin=caa&action=";
data.downurl = "https://ca-archive.us.to/storage/" + Math.trunc(dbQuery.row.addon_id/1000) + "/" + dbQuery.row.addon_id + "/" + dbQuery.row.url.replace(/^\d+\/(.*)/,"$1") + "?origin=caa&action=";
if (appver && Services.vc.compare(dbQuery.row.min, appver) <= 0 && Services.vc.compare(appver, dbQuery.row.max) <= 0) {
data.compat = "add";
data.action = "Install Now";
Expand Down
2 changes: 1 addition & 1 deletion content/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ let List = {
if (appver && Services.vc.compare(dbQuery.row.min, appver) <= 0 && Services.vc.compare(appver, dbQuery.row.max) <= 0) {
item = item.replace("%COMPAT%", "add");
item = item.replace("%ACTION%", "Install Now");
item = item.replace("%DOWNURL%", "https://ca-archive.biz.tm/storage/" + Math.trunc(dbQuery.row.addon_id/1000) + "/" + dbQuery.row.addon_id + "/" + dbQuery.row.url.replace(/^\d+\/(.*)/,"$1") + "?origin=caa&action=install");
item = item.replace("%DOWNURL%", "https://ca-archive.us.to/storage/" + Math.trunc(dbQuery.row.addon_id/1000) + "/" + dbQuery.row.addon_id + "/" + dbQuery.row.url.replace(/^\d+\/(.*)/,"$1") + "?origin=caa&action=install");
} else {
item = item.replace("%COMPAT%", "download");
item = item.replace("%ACTION%", "List Versions");
Expand Down
2 changes: 1 addition & 1 deletion content/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ let Versions = {
} else if (Services.appinfo.name != "SeaMonkey" && Services.appinfo.name != "Iceape-UXP") {
appver = Services.appinfo.version;
}
let downurl = "https://ca-archive.biz.tm/storage/" + Math.trunc(dbQuery.row.addon_id/1000) + "/" + dbQuery.row.addon_id + "/" + dbQuery.row.url.replace(/^\d+\/(.*)/,"$1") + "?origin=caa&action=";
let downurl = "https://ca-archive.us.to/storage/" + Math.trunc(dbQuery.row.addon_id/1000) + "/" + dbQuery.row.addon_id + "/" + dbQuery.row.url.replace(/^\d+\/(.*)/,"$1") + "?origin=caa&action=";
if (appver && Services.vc.compare(dbQuery.row.min, appver) <= 0 && Services.vc.compare(appver, dbQuery.row.max) <= 0) {
item = item.replace("%COMPAT%", "add");
item = item.replace("%ACTION%", "Install Now");
Expand Down
77 changes: 38 additions & 39 deletions install.rdf
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
<?xml version='1.0' encoding='utf-8'?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:version>2.0.1</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
<em:multiprocessCompatible>false</em:multiprocessCompatible>
<em:name>Classic Add-ons Archive</em:name>
<em:description>Catalog of classic Firefox add-ons created before WebExtensions apocalypse</em:description>
<em:creator>Off JustOff &lt;[email protected]&gt;</em:creator>
<em:homepageURL>https://github.com/JustOff/ca-archive/</em:homepageURL>
<em:updateURL>https://ca-archive.biz.tm/update.xml</em:updateURL>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>45.0</em:minVersion>
<em:maxVersion>56.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<Description>
<em:id>{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}</em:id>
<em:minVersion>27.0.0</em:minVersion>
<em:maxVersion>28.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<Description>
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
<em:minVersion>2.40</em:minVersion>
<em:maxVersion>*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Iceape-UXP -->
<em:targetApplication>
<Description>
<em:id>{9184b6fe-4a5c-484d-8b4b-efbfccbfb514}</em:id>
<em:minVersion>52.0</em:minVersion>
<em:maxVersion>52.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:id>[email protected]</em:id>
<em:version>2.0.2</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
<em:multiprocessCompatible>false</em:multiprocessCompatible>
<em:name>Classic Add-ons Archive</em:name>
<em:description>Catalog of classic Firefox add-ons created before WebExtensions apocalypse</em:description>
<em:creator>Off JustOff &lt;[email protected]&gt;</em:creator>
<em:homepageURL>https://github.com/JustOff/ca-archive/</em:homepageURL>
<em:updateURL>https://ca-archive.us.to/update.xml</em:updateURL>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>45.0</em:minVersion>
<em:maxVersion>56.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<Description>
<em:id>{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}</em:id>
<em:minVersion>27.0.0</em:minVersion>
<em:maxVersion>28.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<Description>
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
<em:minVersion>2.40</em:minVersion>
<em:maxVersion>2.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<Description>
<em:id>{9184b6fe-4a5c-484d-8b4b-efbfccbfb514}</em:id>
<em:minVersion>52.0</em:minVersion>
<em:maxVersion>52.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>

0 comments on commit 43c7c7e

Please sign in to comment.