This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
ProxyFox v2.1 #20
Draft
Oliver-makes-code
wants to merge
149
commits into
master
Choose a base branch
from
dev/2.1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
ProxyFox v2.1 #20
Changes from all commits
Commits
Show all changes
149 commits
Select commit
Hold shift + click to select a range
3161a91
Set up handling for message interaction commands
Oliver-makes-code 9273c56
Merge branch 'master' into dev/2.1
Ampflower 37b6909
Initial API stuff
TibiNonEst b956713
Fix funni failure
TibiNonEst 66bd124
More API stuff
TibiNonEst 2c8d0e9
Messages et al.
TibiNonEst a973e26
Guild settings and API version
TibiNonEst dca836f
Misc API stuff
TibiNonEst 0be4f9e
Initial API authentication
TibiNonEst fffe373
Fix casing
TibiNonEst f2d2002
Merge branch 'master' into dev/2.1
Oliver-makes-code 5adaa39
Start move to proxyfox-command + start working on slash commands
Oliver-makes-code 36dbc57
Apply licenses
Oliver-makes-code ad0f08d
Move SystemCommands and SwitchCommands fully to the new system + star…
Oliver-makes-code 767ebe5
Misc fixes
Oliver-makes-code a7243f9
Finish slash command support
Oliver-makes-code 5b6aa64
Remove dev.proxyfox.bot.string package as it's unused now
Oliver-makes-code 80befbe
Fix build
Oliver-makes-code 4670604
Fix fix build build
Oliver-makes-code 0fa816c
Add initial group implementation to database, add TODO for future ref…
Oliver-makes-code 7f013a0
Apply licenses to new files
Oliver-makes-code 1b2f51e
aaaaaa
TibiNonEst 5b6e20f
totally fixed
TibiNonEst 1e93802
Add docker builds
TibiNonEst 7a8989c
Fix name, publish with hash
TibiNonEst c737366
Bump proxyfox-command
TibiNonEst 4a6cbcf
Merge branch 'dev/docker' into dev/2.1
TibiNonEst b8f2e6e
Pain
TibiNonEst a7b33dc
cursed
TibiNonEst eb5f784
Revert "cursed"
TibiNonEst 64ebfcb
Revert "Pain"
TibiNonEst fe584ec
Revert "totally fixed"
TibiNonEst ccea77b
Finish database refactor
TibiNonEst b6036a7
Update versions of things
Oliver-makes-code 2a1c444
Use Java 18
Oliver-makes-code c8714b3
Replace all references of JsonDatabase with InMemoryDatabase
Oliver-makes-code b706da3
Update Gradle to 7.6
Ampflower dbb9726
Provide immediate reason for inability to proxy if fixable by end user.
Ampflower 201642a
Add far better logging of exceptions.
Ampflower 4754fe5
Merge branch 'dev/2.0' into dev/2.1
Ampflower 181e27c
Initial pluralkit sync setup
Oliver-makes-code 4d0142b
Apply&update licenses
Oliver-makes-code 49f7cdc
Initial use of Quilt Loader on ProxyFox
Ampflower 759fb18
Most tests are fixed
TibiNonEst 331d44c
Fix case sensitivity in PluralKitImporter
Ampflower 25b2682
Fix birthday day/month flipping logic in PluralKitImporter
Ampflower f60f555
Use ConcurrentHashMap as the backing maps for InMemoryDatabase
Ampflower 5a5fba7
Fix logic errors & mem leaks in InMemoryDatabase
Ampflower 7d34dff
Harden ImporterTest to logic errors and its own assertions
Ampflower 4432d1a
Add PolyIgnorePrimitive
Ampflower 70cae0a
Fix Instant parsing
Ampflower b1e08f8
Merge remote-tracking branch 'origin/dev/2.1' into api-help-me
Ampflower 8cef09d
Fix broken merge from dev/2.1
Ampflower 12bed62
Default to port 8080 on ApiMain
Ampflower f606126
Add export test to Time Resolution
Ampflower ea16b6c
Merge remote-tracking branch 'origin/dev/2.1' into api-help-me
Ampflower 27954db
Restore microsecond resolution of switches
Ampflower 02abe43
Add explicit microsecond resolution test
Ampflower 987d547
Remove redundant epoch string
Ampflower 5472cce
Add nanosecond truncation test
Ampflower c4bad7e
Use Base64-encoded 24 bytes of secure random for generateToken
Ampflower 947f6e3
Add micros & nanos test to ExporterTest
Ampflower f6bdc62
Fix Mongo record serialization to match production
Ampflower fe36748
Drop GSON in favour of Kotlin Serialization
Ampflower 60d5b18
Force asynchronous registration of application commands
Ampflower 1c5d45b
Convert ConversionMain.kt to Kotlin Serialization
Ampflower 71dc8e1
Remove inapplicable tests for GSON.
Ampflower f5922c2
Undo DebugException being passed through to the error channel
Ampflower c2d5da4
Clarify comment.
Ampflower 7b9f902
Correct typo in gradle.yml
Ampflower e148879
Remove dependency on Kotlin stdlib in Patch
Ampflower 9ac901d
Setup shadowJar for Patch to bundle Quilt Loader & dependencies.
Ampflower d4563e6
Group poolRelease as build for ease of finding it in IntelliJ
Ampflower 0721c9a
Decouple tokens from systems
Oliver-makes-code 20bab0c
Move token stuff from SystemCommands to MiscCommands
Oliver-makes-code 0031549
Implement trust levels
Oliver-makes-code 3b95c4a
Reduce boilerplate across code
Oliver-makes-code 484f4d4
h
Oliver-makes-code 756f545
Misc code cleanups and deduplication
Oliver-makes-code 4056930
Clean up code and fix compiler warnings
Oliver-makes-code 6504d30
Start implementation of command menus
Oliver-makes-code 4218348
a
Oliver-makes-code a090b2f
Defer chat input command registry + apply licenses
Oliver-makes-code 7051da8
Implement message interaction command handlers
Oliver-makes-code 3f763a4
Implement a server toggle for system tag enforcement
Oliver-makes-code bffdda4
Work on groups
Oliver-makes-code 9c4e4ea
Apply licenses
Oliver-makes-code 33cd92e
More API changes, feat: actual tokens
TibiNonEst fa5f19f
Apply licenses
TibiNonEst a85bead
Exporter now handles missing members in a way to not break importer.
Ampflower b5810bc
Merge tag 'dev/2.0-old' into HEAD
Ampflower 79c9a45
Merge remote-tracking branch 'origin/master' into HEAD
Ampflower 0451b2a
Fix merge conflicts n stuff
Oliver-makes-code 94464c8
Migrate to MarKt
Oliver-makes-code 41ae203
Preliminaries for PK Sync
Oliver-makes-code f969636
License header for DontExpose
Oliver-makes-code b85ab99
Bump Quilt Gradle Licenser
Oliver-makes-code 4181464
Fix slash command registration taking eons
Oliver-makes-code 8c61753
Refactor command registration
Oliver-makes-code ef57ef9
Bump MarKt version
Oliver-makes-code 6b6a44c
add license header to CommandRegistrar.kt
Oliver-makes-code 7322784
Properly implement menus
Oliver-makes-code a4f1789
Add Kord.onlyIf
Oliver-makes-code b0beff2
Remove unnecessary parameter
Oliver-makes-code b21947c
Pass in CommandParser in CommandRegistrar$registerTextCommands
Oliver-makes-code 2aff215
Move TimedYesNoPrompt to DiscordContext
Oliver-makes-code c6e9046
Add visibility flag for interactionMenu
Oliver-makes-code 7bfe052
Use ProxyFox-Command for terminal input
Oliver-makes-code 710c564
fix build
Oliver-makes-code ef3655f
Merge branch 'master' into dev/2.1
Ampflower 4fe3d79
Merge remote-tracking branch 'origin/dev/2.1' into dev/2.1
Ampflower 2aee338
Add a CommonMessages enum to build common messages + add env-controll…
Oliver-makes-code fbaa830
Misc fixes
Oliver-makes-code 672f812
Support suppressed errors in error handler
Oliver-makes-code 5769517
Add the ability to defer responses
Oliver-makes-code 88ad2b4
Fix default visibility of timed y/n
Oliver-makes-code 0952085
More fixes with timed y/n
Oliver-makes-code c59a629
Update gitignore
Oliver-makes-code 9a2cb00
Misc command refactors
Oliver-makes-code 95fd406
Useragent + include more git properties
Oliver-makes-code ac2c662
Rearrange debug embed
Oliver-makes-code cd462c5
Move uptime to before shard id
Oliver-makes-code 7fac04b
Tell people to report exceptions
Oliver-makes-code fc42f61
Misc fixes related to application commands
Oliver-makes-code 8f3ad69
Fix import clashes by searching by member name before member id
Oliver-makes-code 507e810
Merge branch 'master' into dev/2.1
Oliver-makes-code c902672
Bump kord version, support voice messages, keep track of deleted mess…
Oliver-makes-code a4ec815
Clean up duplicated code in DiscordContext
Oliver-makes-code 17434af
Initial pluralkit sync implementation
Oliver-makes-code b613d4c
Better message deletion handling
Oliver-makes-code a860cd7
Update in-memory to match semantics change
Oliver-makes-code a50c73c
Refactor some API things
Oliver-makes-code cab2c3b
Remove unneeded indent
Oliver-makes-code 21ab55f
Avoid unnecessary api lookups where possible
Oliver-makes-code 910ea42
Bumb logback
Oliver-makes-code 489af71
Fix pk sync's diff check
Oliver-makes-code 3d38b3f
Check diff in pull sync
Oliver-makes-code a4d6c43
Token creation and deletion
Oliver-makes-code 8a40ce5
Transfer systems using transfer tokens
Oliver-makes-code 9ce6a59
Pager to use Menu from PF-C
Oliver-makes-code a83022f
Send file link as well on deleted system
Oliver-makes-code e2986fc
rip I used the wrong thing lol
Oliver-makes-code b324dac
Update dependencies
Ampflower 0b07b1b
Improve error handling for overflowing messages
Ampflower b13ab66
Don't require name argument on member command
Ampflower 56ebb7a
Merge remote-tracking branch 'origin/master' into dev/2.1
Ampflower 8dbd287
:3
Oliver-makes-code 22b67fe
[no ci] start migration to pf-c 2.0
Oliver-makes-code 1334a56
fix some api stuff + documentation too
Oliver-makes-code File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Docker Build and Publish | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: Persist Gradle cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
|
||
- name: Setup JDK 18 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 18 | ||
|
||
- name: Build | ||
run: ./gradlew build -x check -x test --no-daemon | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Artifacts | ||
path: | | ||
build/libs/ | ||
module/**/build/libs/ | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- run: docker build -t ghcr.io/the-proxyfox-group/proxyfox:latest -t ghcr.io/the-proxyfox-group/proxyfox:${GITHUB_SHA} . | ||
- run: docker push ghcr.io/the-proxyfox-group/proxyfox:latest | ||
- run: docker push ghcr.io/the-proxyfox-group/proxyfox:${GITHUB_SHA} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,25 +8,34 @@ on: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: gradle/wrapper-validation-action@v1 | ||
- uses: actions/cache@v3 | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: Persist Gradle cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
java-version: 18 | ||
|
||
- name: Build and publish with Gradle | ||
run: ./gradlew poolRelease --no-daemon | ||
|
||
- name: Upload build artifacts | ||
uses: AButler/[email protected] | ||
with: | ||
files: 'build/pool/*' | ||
repo-token: ${{secrets.GITHUB_TOKEN}} | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,7 @@ build/ | |
out/ | ||
mods/ | ||
proxyfox.db.properties | ||
systems.json | ||
.env | ||
.env | ||
.pf-command-lock | ||
.quilt/ | ||
config/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM openjdk:17-jdk-slim | ||
|
||
COPY modules/bot/build/libs/proxyfox-*.jar /usr/local/lib/ProxyFox.jar | ||
|
||
RUN mkdir /bot | ||
|
||
WORKDIR /bot | ||
|
||
ENTRYPOINT ["java", "-Xms2G", "-Xmx2G", "-jar", "/usr/local/lib/ProxyFox.jar"] | ||
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,18 +43,18 @@ allprojects { | |
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
sourceCompatibility = JavaVersion.VERSION_18 | ||
targetCompatibility = JavaVersion.VERSION_18 | ||
Comment on lines
+46
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should jump to Java 19 instead; 18 is already EoL, although, there's a possibility that 20 might be available by the time this branch is ready to be deployed into production. |
||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven("https://libraries.minecraft.net/") | ||
maven("https://oss.sonatype.org/content/repositories/snapshots") | ||
maven("https://maven.quiltmc.org/repository/release/") | ||
maven("https://maven.quiltmc.org/repository/snapshot/") | ||
maven("https://maven.fabricmc.net/") | ||
maven("https://jitpack.io") | ||
maven("https://maven.proxyfox.dev") | ||
} | ||
|
||
dependencies { | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version: "3" | ||
|
||
networks: | ||
proxyfox: | ||
external: false | ||
|
||
services: | ||
proxyfox: | ||
image: ghcr.io/the-proxyfox-group/proxyfox:latest | ||
container_name: proxyfox | ||
restart: always | ||
environment: | ||
- PROXYFOX_KEY=<token> | ||
- PROXYFOX_MONGO=mongodb://<username>:<password>@mongo | ||
networks: | ||
- proxyfox | ||
depends_on: | ||
- mongo | ||
|
||
mongo: | ||
image: mongo:latest | ||
container_name: proxyfox_mongo | ||
restart: always | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=<username> | ||
- MONGO_INITDB_ROOT_PASSWORD=<password> | ||
networks: | ||
- proxyfox | ||
volumes: | ||
- proxyfox-mongo:/data/db | ||
ports: | ||
- 27017:27017 | ||
|
||
volumes: | ||
proxyfox-mongo: |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
kotlin.code.style=official | ||
group=dev.proxyfox | ||
version=2.0.13 | ||
version=2.1.0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,68 @@ | ||
[versions] | ||
guava = "31.1-jre" | ||
logback = "1.2.11" | ||
kord = "0.8.0-M16" | ||
kotlin = "1.7.10" | ||
kotlinx_coroutines = "1.6.4" | ||
guava = "32.1.1-jre" | ||
logback = "1.4.8" | ||
kord = "0.10.0" | ||
kotlin = "1.9.0" | ||
kotlinx_coroutines = "1.7.2" | ||
|
||
# Database-specific | ||
# ProxyFox Libraries | ||
proxyfox_command = "2.0" | ||
pluralkt = "1.8" | ||
markt = "1.4" | ||
|
||
# Database | ||
postgres = "42.3.3" | ||
kjdbc = "0.5.2" | ||
gson = "2.9.0" | ||
kmongo = "4.6.0" | ||
kotlinx_datetime = "0.4.0" | ||
|
||
# API | ||
ktor = "2.1.3" | ||
|
||
# Testing | ||
testng = "7.6.1" | ||
mockk = "1.+" | ||
|
||
# Plugins | ||
shadow = "7.1.2" | ||
licenser = "1.1.2" | ||
licenser = "1.2.0" | ||
|
||
[libraries] | ||
guava = { module = "com.google.guava:guava", version.ref = "guava" } | ||
kord = { module = "dev.kord:kord-core", version.ref = "kord" } | ||
logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } | ||
|
||
proxyfox_command = { module = "dev.proxyfox:proxyfox-command", version.ref = "proxyfox_command" } | ||
pluralkt = { module = "dev.proxyfox:pluralkt", version.ref = "pluralkt" } | ||
markt = { module = "dev.proxyfox:MarKt", version.ref = "markt" } | ||
|
||
kotlin_stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } | ||
kotlinx_coroutines_core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx_coroutines" } | ||
|
||
gson = { module = "com.google.code.gson:gson", version.ref = "gson" } | ||
kjdbc = { module = "com.vladsch.kotlin-jdbc:kotlin-jdbc", version.ref = "kjdbc" } | ||
postgres = { module = "org.postgresql:postgresql", version.ref = "postgres" } | ||
kmongo_base = { module = "org.litote.kmongo:kmongo", version.ref = "kmongo" } | ||
kmongo_coroutine = { module = "org.litote.kmongo:kmongo-coroutine", version.ref = "kmongo" } | ||
kmongo_async = { module = "org.litote.kmongo:kmongo-async", version.ref = "kmongo" } | ||
kmongo_base = { module = "org.litote.kmongo:kmongo-serialization", version.ref = "kmongo" } | ||
kmongo_coroutine = { module = "org.litote.kmongo:kmongo-coroutine-serialization", version.ref = "kmongo" } | ||
kmongo_async = { module = "org.litote.kmongo:kmongo-async-serialization", version.ref = "kmongo" } | ||
kotlinx_datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx_datetime" } | ||
|
||
ktor_server = { module = "io.ktor:ktor-server-core", version.ref = "ktor" } | ||
ktor_server_netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor" } | ||
ktor_content_negotiation = { module = "io.ktor:ktor-server-content-negotiation", version.ref = "ktor" } | ||
ktor_serialization = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } | ||
|
||
testng = { module = "org.testng:testng", version.ref = "testng" } | ||
mockk = { module = "io.mockk:mockk", version.ref = "mockk" } | ||
kotlinx_coroutines_test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx_coroutines" } | ||
|
||
[bundles] | ||
base = ["guava", "logback", "kotlin_stdlib", "kotlinx_coroutines_core", "kord"] | ||
base = ["guava", "logback", "kotlin_stdlib", "kotlinx_coroutines_core", "kord", "proxyfox_command", "pluralkt", "markt"] | ||
database = ["kmongo_base", "kmongo_coroutine", "kmongo_async", "kotlinx_datetime"] | ||
api = ["ktor_server", "ktor_server_netty", "ktor_content_negotiation", "ktor_serialization"] | ||
test = ["testng", "kotlinx_coroutines_test", "mockk"] | ||
database = ["gson", "kmongo_base", "kmongo_coroutine", "kmongo_async"] | ||
|
||
[plugins] | ||
kotlin_jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } | ||
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" } | ||
licenser = { id = "org.quiltmc.gradle.licenser", version.ref = "licenser" } | ||
licenser = { id = "org.quiltmc.gradle.licenser", version.ref = "licenser" } | ||
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2022-2023, The ProxyFox Group | ||
* | ||
* This Source Code is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package dev.proxyfox.api | ||
|
||
import dev.proxyfox.api.routes.* | ||
import io.ktor.serialization.kotlinx.json.* | ||
import io.ktor.server.application.* | ||
import io.ktor.server.engine.* | ||
import io.ktor.server.netty.* | ||
import io.ktor.server.plugins.contentnegotiation.* | ||
import io.ktor.server.routing.* | ||
|
||
object ApiMain { | ||
fun main() = embeddedServer(Netty, port = System.getenv("PORT")?.toIntOrNull() ?: 8080) { | ||
configureRouting() | ||
configurePlugins() | ||
}.start() | ||
|
||
private fun Application.configurePlugins() { | ||
install(ContentNegotiation) { | ||
json() | ||
} | ||
} | ||
|
||
private fun Application.configureRouting() { | ||
routing { | ||
route("/v1") { | ||
systemRoutes() | ||
memberRoutes() | ||
switchRoutes() | ||
messageRoutes() | ||
tokenRoutes() | ||
coffeeRoutes() | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we should be specifying a hardcoded Xms & Xmx; it might be better to have an arguments input system for this, if Docker allows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The vps ProxyFox is hosted on also doesn't have 2G to spare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats fair, I can look into that