Skip to content

Commit

Permalink
chore: Merge branch dev to main (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX authored Nov 6, 2024
2 parents 50b81fd + f740129 commit 440fbbc
Show file tree
Hide file tree
Showing 29 changed files with 768 additions and 739 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ AUTH_SHA256_DIGEST=
JWT_SECRET=
JWT_ISSUER=
JWT_VALIDITY_IN_MIN=

# Logging level for the application
LOG_LEVEL=INFO
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ persistence/
configuration.toml
docker-compose.yml
patches-public-key.asc
integrations-public-key.asc
node_modules/
static/
about.json
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
# [1.4.0-dev.6](https://github.com/ReVanced/revanced-api/compare/v1.4.0-dev.5...v1.4.0-dev.6) (2024-11-06)


### Features

* Allow versioning by arbitrary path string ([814d3c9](https://github.com/ReVanced/revanced-api/commit/814d3c946e31068e12e3886aa8beb3238ef126ae))
* Remove deprecated routes and old API ([eca40a6](https://github.com/ReVanced/revanced-api/commit/eca40a69799240f7803aa8851eb3ee961937e4d6))

# [1.4.0-dev.5](https://github.com/ReVanced/revanced-api/compare/v1.4.0-dev.4...v1.4.0-dev.5) (2024-11-05)

# [1.4.0-dev.4](https://github.com/ReVanced/revanced-api/compare/v1.4.0-dev.3...v1.4.0-dev.4) (2024-11-01)


### Features

* Remove "archived" query parameter ([8ad614e](https://github.com/ReVanced/revanced-api/commit/8ad614ef4fdaf45af87a3316ef4db7e7236fd64a))
* Use tag name directly instead of ID ([fc40427](https://github.com/ReVanced/revanced-api/commit/fc40427fbaafb523045eb6f5285d90949b206b8b))

# [1.4.0-dev.3](https://github.com/ReVanced/revanced-api/compare/v1.4.0-dev.2...v1.4.0-dev.3) (2024-11-01)


### Bug Fixes

* Use new patches file extension ([d42a3a3](https://github.com/ReVanced/revanced-api/commit/d42a3a393396a0f4e9085cda46e0af2c12b63cb1))

# [1.4.0-dev.2](https://github.com/ReVanced/revanced-api/compare/v1.4.0-dev.1...v1.4.0-dev.2) (2024-11-01)


### Bug Fixes

* Add missing logging level environment variable to .env.example ([3b62120](https://github.com/ReVanced/revanced-api/commit/3b6212065a5cfb95c303b6d0551747ba1eb317f6))


### Features

* Add URL and use friendly name for `APIContributable` ([a5498ab](https://github.com/ReVanced/revanced-api/commit/a5498aba2b99db89c28a65738cc58cc4c852c327))
* Make backend configurable ([f91f3a6](https://github.com/ReVanced/revanced-api/commit/f91f3a65c5e07b5b58ccbff1d4b0a5ba9b15fc50))
* Remove ReVanced Integrations ([f1c1092](https://github.com/ReVanced/revanced-api/commit/f1c10928ae3be1c6b1d675819755b3046fad70d8))

# [1.4.0-dev.1](https://github.com/ReVanced/revanced-api/compare/v1.3.0...v1.4.0-dev.1) (2024-11-01)


### Features

* Improve announcements API ([#192](https://github.com/ReVanced/revanced-api/issues/192)) ([56a00dd](https://github.com/ReVanced/revanced-api/commit/56a00ddb85f302d441f0b222a9902ea2c1c18897))

# [1.3.0](https://github.com/ReVanced/revanced-api/compare/v1.2.0...v1.3.0) (2024-10-07)


Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ API server for ReVanced.
## ❓ About

ReVanced API is a server that is used as the backend for ReVanced.
ReVanced API acts as the data source for [ReVanced Website](https://github.com/ReVanced/revanced-website) and powers [ReVanced Manager](https://github.com/ReVanced/revanced-manager)
ReVanced API acts as the data source for [ReVanced Website](https://github.com/ReVanced/revanced-website) and
powers [ReVanced Manager](https://github.com/ReVanced/revanced-manager)
with updates and ReVanced Patches.

## 💪 Features

Some of the features ReVanced API include:

- 📢 **Announcements**: Post and get announcements grouped by channels
- ℹ️ **About**: Get more information such as a description, ways to donate to,
and links of the hoster of ReVanced API
- 📢 **Announcements**: Post and get announcements
- ℹ️ **About**: Get more information such as a description, ways to donate to,
and links of the hoster of ReVanced API
- 🧩 **Patches**: Get the latest updates of ReVanced Patches, directly from ReVanced API
- 👥 **Contributors**: List all contributors involved in the project
- 🔄 **Backwards compatibility**: Proxy an old API for migration purposes and backwards compatibility

## 🚀 How to get started

Expand All @@ -90,7 +90,8 @@ ReVanced API can be deployed as a Docker container or used standalone.

To deploy ReVanced API as a Docker container, you can use Docker Compose or Docker CLI.
The Docker image is published on GitHub Container registry,
so before you can pull the image, you need to [authenticate to the Container registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry).
so before you can pull the image, you need
to [authenticate to the Container registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry).

### 🗄️ Docker Compose

Expand All @@ -114,8 +115,6 @@ so before you can pull the image, you need to [authenticate to the Container reg
-v $(pwd)/configuration.toml:/app/configuration.toml \
# Mount the patches public key
-v $(pwd)/patches-public-key.asc:/app/patches-public-key.asc \
# Mount the integrations public key
-v $(pwd)/integrations-public-key.asc:/app/integrations-public-key.asc \
# Mount the static folder
-v $(pwd)/static:/app/static \
# Mount the about.json file
Expand All @@ -141,7 +140,7 @@ A Java Runtime Environment (JRE) must be installed.
1. [Download](https://github.com/ReVanced/revanced-api/releases/latest) ReVanced API to a folder
2. In the same folder, create an `.env` file using [.env.example](.env.example) as a template
3. In the same folder, create a `configuration.toml` file
using [configuration.example.toml](configuration.example.toml) as a template
using [configuration.example.toml](configuration.example.toml) as a template
4. In the same folder, create an `about.json` file using [about.example.json](about.example.json) as a template
5. Run `java -jar revanced-api.jar start` to start the server

Expand All @@ -159,7 +158,8 @@ A Java Development Kit (JDK) and Git must be installed.

### 📙 Contributing

Thank you for considering contributing to ReVanced API. You can find the contribution guidelines [here](CONTRIBUTING.md).
Thank you for considering contributing to ReVanced API. You can find the contribution
guidelines [here](CONTRIBUTING.md).

### 🛠️ Building

Expand Down
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ kotlin {
}
}

tasks {
test {
useJUnitPlatform()
}
}

repositories {
mavenCentral()
google()
Expand Down Expand Up @@ -98,6 +104,8 @@ dependencies {
implementation(libs.caffeine)
implementation(libs.bouncy.castle.provider)
implementation(libs.bouncy.castle.pgp)

testImplementation(kotlin("test"))
}

// The maven-publish plugin is necessary to make signing work.
Expand Down
35 changes: 21 additions & 14 deletions configuration.example.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
organization = "revanced"
patches = { repository = "revanced-patches", asset-regex = "jar$", signature-asset-regex = "asc$", public-key-file = "patches-public-key.asc", public-key-id = 0 }
integrations = { repository = "revanced-integrations", asset-regex = "apk$", signature-asset-regex = "asc$", public-key-file = "integrations-public-key.asc", public-key-id = 0 }
manager = { repository = "revanced-manager", asset-regex = "apk$" }
contributors-repositories = [
"revanced-patcher",
"revanced-patches",
"revanced-integrations",
"revanced-website",
"revanced-cli",
"revanced-manager",
]
api-version = 1
api-version = "v1"
cors-allowed-hosts = [
"revanced.app",
"*.revanced.app"
]
endpoint = "https://api.revanced.app"
old-api-endpoint = "https://old-api.revanced.app"
static-files-path = "static/root"
versioned-static-files-path = "static/versioned"
backend-service-name = "GitHub"
about-json-file-path = "about.json"
organization = "revanced"

[patches]
repository = "revanced-patches"
asset-regex = "rvp$"
signature-asset-regex = "asc$"
public-key-file = "static/root/keys.asc"
public-key-id = 3897925568445097277

[manager]
repository = "revanced-manager"
asset-regex = "apk$"

[contributors-repositories]
revanced-patcher = "ReVanced Patcher"
revanced-patches = "ReVanced Patches"
revanced-website = "ReVanced Website"
revanced-cli = "ReVanced CLI"
revanced-manager = "ReVanced Manager"
1 change: 0 additions & 1 deletion docker-compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ services:
- /data/revanced-api/.env:/app/.env
- /data/revanced-api/configuration.toml:/app/configuration.toml
- /data/revanced-api/patches-public-key.asc:/app/patches-public-key.asc
- /data/revanced-api/integrations-public-key.asc:/app/integrations-public-key.asc
- /data/revanced-api/static:/app/static
- /data/revanced-api/about.json:/app/about.json
environment:
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 1.3.0
version = 1.4.0-dev.6
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
kompendium-core = "3.14.4"
kotlin = "2.0.0"
kotlin = "2.0.20"
logback = "1.5.6"
exposed = "0.52.0"
h2 = "2.2.224"
Expand All @@ -10,8 +10,8 @@ ktor = "2.3.7"
ktoml = "0.5.2"
picocli = "4.7.6"
datetime = "0.6.0"
revanced-patcher = "20.0.0"
revanced-library = "3.0.1-dev.1"
revanced-patcher = "21.0.0"
revanced-library = "3.0.2"
caffeine = "3.1.8"
bouncy-castle = "1.78.1"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,124 +1,112 @@
package app.revanced.api.configuration.schema
package app.revanced.api.configuration

import kotlinx.datetime.LocalDateTime
import kotlinx.serialization.Serializable

interface APIUser {
interface ApiUser {
val name: String
val avatarUrl: String
val url: String
}

@Serializable
class APIMember(
class ApiMember(
override val name: String,
override val avatarUrl: String,
override val url: String,
val bio: String?,
val gpgKey: APIGpgKey?,
) : APIUser
val gpgKey: ApiGpgKey?,
) : ApiUser

@Serializable
class APIGpgKey(
class ApiGpgKey(
val id: String,
val url: String,
)

@Serializable
class APIContributor(
class ApiContributor(
override val name: String,
override val avatarUrl: String,
override val url: String,
val contributions: Int,
) : APIUser
) : ApiUser

@Serializable
class APIContributable(
val name: String,
val url: String,
// Using a list instead of a set because set semantics are unnecessary here.
val contributors: List<APIContributor>,
val contributors: List<ApiContributor>,
)

@Serializable
class APIRelease<T>(
class ApiRelease(
val version: String,
val createdAt: LocalDateTime,
val description: String,
// Using a list instead of a set because set semantics are unnecessary here.
val assets: List<T>,
)

@Serializable
class APIManagerAsset(
val downloadUrl: String,
)

@Serializable
class APIPatchesAsset(
val downloadUrl: String,
val signatureDownloadUrl: String,
// TODO: Remove this eventually when integrations are merged into patches.
val name: APIAssetName,
val signatureDownloadUrl: String? = null,
)

@Serializable
enum class APIAssetName {
PATCHES,
INTEGRATION,
}

@Serializable
class APIReleaseVersion(
class ApiReleaseVersion(
val version: String,
)

@Serializable
class APIAnnouncement(
class ApiAnnouncement(
val author: String? = null,
val title: String,
val content: String? = null,
// Using a list instead of a set because set semantics are unnecessary here.
val attachmentUrls: List<String> = emptyList(),
val channel: String? = null,
val attachments: List<String> = emptyList(),
// Using a list instead of a set because set semantics are unnecessary here.
val tags: List<String> = emptyList(),
val archivedAt: LocalDateTime? = null,
val level: Int = 0,
)

@Serializable
class APIResponseAnnouncement(
class ApiResponseAnnouncement(
val id: Int,
val author: String? = null,
val title: String,
val content: String? = null,
// Using a list instead of a set because set semantics are unnecessary here.
val attachmentUrls: List<String> = emptyList(),
val channel: String? = null,
val attachments: List<String> = emptyList(),
// Using a list instead of a set because set semantics are unnecessary here.
val tags: List<String> = emptyList(),
val createdAt: LocalDateTime,
val archivedAt: LocalDateTime? = null,
val level: Int = 0,
)

@Serializable
class APIResponseAnnouncementId(
class ApiResponseAnnouncementId(
val id: Int,
)

@Serializable
class APIAnnouncementArchivedAt(
class ApiAnnouncementArchivedAt(
val archivedAt: LocalDateTime,
)

@Serializable
class APIRateLimit(
class ApiAnnouncementTag(
val name: String,
)

@Serializable
class ApiRateLimit(
val limit: Int,
val remaining: Int,
val reset: LocalDateTime,
)

@Serializable
class APIAssetPublicKeys(
class ApiAssetPublicKey(
val patchesPublicKey: String,
val integrationsPublicKey: String,
)

@Serializable
Expand Down Expand Up @@ -174,4 +162,4 @@ class APIAbout(
}

@Serializable
class APIToken(val token: String)
class ApiToken(val token: String)
Loading

0 comments on commit 440fbbc

Please sign in to comment.