From 5f5e7e9c1ecc2fab8c6ac2cc16f040ab75bc59b5 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 7 Mar 2021 09:07:16 +0000 Subject: [PATCH] Add archive home page Signed-off-by: Graham --- .../org/openrs2/archive/web/WebServer.kt | 3 + .../org/openrs2/archive/templates/index.html | 107 ++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 archive/src/main/resources/org/openrs2/archive/templates/index.html diff --git a/archive/src/main/kotlin/org/openrs2/archive/web/WebServer.kt b/archive/src/main/kotlin/org/openrs2/archive/web/WebServer.kt index a9953d12..894baf7f 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/web/WebServer.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/web/WebServer.kt @@ -6,11 +6,13 @@ import io.ktor.application.install import io.ktor.features.ContentNegotiation import io.ktor.http.ContentType import io.ktor.jackson.JacksonConverter +import io.ktor.response.respond import io.ktor.routing.get import io.ktor.routing.routing import io.ktor.server.engine.embeddedServer import io.ktor.server.netty.Netty import io.ktor.thymeleaf.Thymeleaf +import io.ktor.thymeleaf.ThymeleafContent import io.ktor.webjars.Webjars import org.openrs2.json.Json import org.thymeleaf.extras.java8time.dialect.Java8TimeDialect @@ -42,6 +44,7 @@ public class WebServer @Inject constructor( install(Webjars) routing { + get("/") { call.respond(ThymeleafContent("index.html", emptyMap())) } get("/caches") { cachesController.index(call) } get("/caches/{id}") { cachesController.show(call) } get("/caches/{id}.zip") { cachesController.export(call) } diff --git a/archive/src/main/resources/org/openrs2/archive/templates/index.html b/archive/src/main/resources/org/openrs2/archive/templates/index.html new file mode 100644 index 00000000..1cb17f55 --- /dev/null +++ b/archive/src/main/resources/org/openrs2/archive/templates/index.html @@ -0,0 +1,107 @@ + + + + OpenRS2 Archive + + + + +
+
+

Welcome to the OpenRS2 Archive

+

+ The OpenRS2 Archive is a collection of caches and XTEA keys + for all versions of RuneScape that use JS5 to manage assets + (mainline RuneScape builds 402 and greater, and all builds + of Old School RuneScape). +

+

+ The archive uses content-addressable storage, converting + caches to the client's native + .dat2/.idx format on-demand. This + provides several benefits: the disk space required to store + all available caches is reduced, and groups or XTEA keys + missing from one copy of the cache can be sourced + automatically from other copies - provided the checksums and + version numbers match. +

+

+ The archive is highly automated: OSRS cache updates are + downloaded automatically (with RuneScape 3 support + planned), and XTEA keys are pulled from various sources and + verified automatically. However, third-party contributions + must be imported manually to verify the data's provenance + (see the "Contributing" section below). +

+

+ Support for archiving clients/gamepacks, loaders and native + libraries is also planned for a future update. +

+
+
+
+

Sources

+

+ A significant amount of data in the archive was, or is, + obtained from the following projects, which we'd like + to thank: +

+ +
+
+

Contributing

+

+ Please contact Graham#5361 in + OpenRS2's Discord server + if you have data (old clients/gamepacks, loaders, native + libraries, caches and XTEA keys - ideally original or + only lightly modified copies) to contribute. +

+

+ Contributing data is important even if the cache or + keyset already exists in the archive. Older copies of + the cache are often incomplete, and your copy may have + data missing from the archive. +

+

+ By pooling all the community's data together in a + single location, the whole community will benefit from + access to more complete caches and keysets. +

+
+
+

Mirroring

+

+ An rsync server is available at + rsync://archive.openrs2.org/pub. Daily + Postgres dumps are available in the db + subdirectory in the custom dump format. +

+

+ A public-facing Postgres instance, for complex queries + and replication, may be made available in the future. +

+

+ The + software + used to import and export data is open-source. Combined + with the database dumps, this ensures the longevity of + the archive if the main instance ever disappears. +

+
+
+
+ +