Draft
Conversation
Wasan1916
approved these changes
Dec 30, 2025
df707ec to
8c44139
Compare
…& use Gradle password credentials & native Ktor OpenAPI spec generator
# [1.7.0-dev.1](v1.6.1...v1.7.0-dev.1) (2026-02-19) ### Features * Add `downloaders` route ([#208](#208)) ([64f9431](64f9431))
# [1.7.0-dev.2](v1.7.0-dev.1...v1.7.0-dev.2) (2026-02-20) ### Features * Add history route ([f0c9d4b](f0c9d4b))
# [1.7.0-dev.3](v1.7.0-dev.2...v1.7.0-dev.3) (2026-02-20)
# [1.7.0-dev.4](v1.7.0-dev.3...v1.7.0-dev.4) (2026-03-02)
ec83197 to
fff6842
Compare
Wasan1916
approved these changes
Mar 7, 2026
8ee3377 to
5e0378b
Compare
Wasan1916
approved these changes
Mar 7, 2026
Wasan1916
approved these changes
Mar 7, 2026
PalmDevs
suggested changes
Mar 7, 2026
Comment on lines
+25
to
+91
| if (!_app) { | ||
| const { apiVersion } = getConfig(env); | ||
|
|
||
| _app = new OpenAPIHono<AppBindings>(); | ||
|
|
||
| _app.onError((err, c) => { | ||
| console.error(err); | ||
| return c.json( | ||
| { | ||
| error: err.message || "Unknown error", | ||
| stack: err.stack, | ||
| }, | ||
| 500, | ||
| ); | ||
| }); | ||
|
|
||
| // Default 5-minute cache for all routes (overridden per-route where needed) | ||
| _app.use("*", cacheControl(CacheDuration.short)); | ||
|
|
||
| const versionedApp = new OpenAPIHono<AppBindings>(); | ||
| versionedApp.route("/patches", patchesApp); | ||
| versionedApp.route("/manager", managerApp); | ||
| versionedApp.route("/announcements", announcementsApp); | ||
| versionedApp.route("/contributors", contributorsApp); | ||
| versionedApp.route("/team", teamApp); | ||
| versionedApp.route("/about", aboutApp); | ||
|
|
||
| _app.route(`/v${apiVersion}`, versionedApp); | ||
| _app.get("/", swaggerUI({ url: `/v${apiVersion}/openapi` })); | ||
|
|
||
| _app.doc(`/v${apiVersion}/openapi`, () => ({ | ||
| openapi: "3.1.0", | ||
| info: { | ||
| title: "ReVanced API", | ||
| version: packageJson.version, | ||
| description: "API server for ReVanced.", | ||
| contact: { | ||
| name: "ReVanced", | ||
| url: "https://revanced.app", | ||
| email: "contact@revanced.app", | ||
| }, | ||
| license: { | ||
| name: "AGPLv3", | ||
| url: "https://github.com/ReVanced/revanced-api/blob/main/LICENSE", | ||
| }, | ||
| }, | ||
| servers: [ | ||
| { url: "https://api.revanced.app", description: "Production" }, | ||
| { | ||
| url: "{customServer}", | ||
| description: "Custom server", | ||
| variables: { | ||
| customServer: { | ||
| default: "api.revanced.app", | ||
| description: "Custom server URL", | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| })); | ||
| _app.openAPIRegistry.registerComponent("securitySchemes", "Bearer", { | ||
| type: "http", | ||
| scheme: "bearer", | ||
| }); | ||
| } | ||
| return _app.fetch(request, env, ctx); | ||
| }, |
Member
There was a problem hiding this comment.
I'm confused about every part of this.
Why not just initialize app outside and do fetch: (request, env, ctx) => app.fetch(request, env, ctx)?
Since this is running on Cloudflare Workers, this is technically fine, but for any normal Hono app, this code is incredibly inefficient.
Member
There was a problem hiding this comment.
I agree it can be moved outside of fetch
Comment on lines
+49
to
+65
| let _publicKeyCache: string | undefined; | ||
|
|
||
| export async function getPublicKey(env: Env) { | ||
| if (!_publicKeyCache) { | ||
| const { patches } = getConfig(env); | ||
| const res = await env.ASSETS.fetch( | ||
| new URL(patches.publicKeyFile, "https://assets.local"), | ||
| ); | ||
| if (!res.ok) { | ||
| throw new Error( | ||
| `Failed to load public key from ${patches.publicKeyFile}: ${res.status}`, | ||
| ); | ||
| } | ||
| _publicKeyCache = await res.text(); | ||
| } | ||
| return { patches_public_key: _publicKeyCache }; | ||
| } |
Member
There was a problem hiding this comment.
Does this really need caching at the service level?
Member
There was a problem hiding this comment.
The API is designed platform independent, as such this layer of cache is needed, e.g. when you deploy without a cdn cache
PalmDevs
reviewed
Mar 7, 2026
3927adc to
0a0e002
Compare
Co-Authored-By: oSumAtrIX <johan.melkonyan1@web.de>
# [1.7.0-dev.4](v1.7.0-dev.3...v1.7.0-dev.4) (2026-03-07) ### Features * Convert ReVanced API from a Ktor server to serverless ([#211](#211)) ([2ba8849](2ba8849))
Co-authored-by: mostafaNazari702 <nazarimostafa2006@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request will Merge branch
devtomain.