-
Notifications
You must be signed in to change notification settings - Fork 0
First controller version #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
fd36fd7
add: readme.md
dayyeeet aa3bd64
fix: grpc kotlin stub
FllipEis f134a72
Merge remote-tracking branch 'origin/develop' into develop
FllipEis 2e0acd6
feat: add controller backend logic for servers and groups
dayyeeet ffa2ca1
feat: jooq with schema to java generation
dayyeeet 6e10dd6
refactor: remove redundant code
dayyeeet 72bdf60
feat: add sql structure and actually implement jooq generated files i…
dayyeeet d0002cd
refactor: change package of jooq codegen, readd composite key
dayyeeet 7ac3c60
feat: database implementation, reformat code
dayyeeet 0cc147e
fix: jooq messages, main class detection, truthful database-config.yml
dayyeeet 98aee66
feat: GroupApi CRUD operations, YamlRepository
dayyeeet 433d81c
feat: add attributes to Group.kt and Server.kt
dayyeeet 0489a84
refactor: types for repositories
dayyeeet 952805c
refactor: cleanup ServerHost.kt definition
dayyeeet 2f1f2ad
refactor: cleanup code
dayyeeet 49c04cd
feat: add property management logic
dayyeeet 11a3c60
feat: add Reconciler
dayyeeet 8f98d19
refactor: update readme.md
dayyeeet 1e60b9c
implement: github packages workflow
dayyeeet 83939a8
fix: run jooqCodegen when building
dayyeeet 3d50c65
fix: build order
dayyeeet 0507ab9
fix: typo in workflow file
dayyeeet 5923662
feat: numerical id inclusion for server starts
dayyeeet 3969fcd
refactor: update controller version
dayyeeet 5f3e83a
refactor: update group types
dayyeeet f787790
refactor: update group types
dayyeeet f877534
fix: YamlRepository issues, gRPC connection issues
dayyeeet 7eb1dbb
fix: db issues
dayyeeet 309cea7
fix: add support to mutate properties on Server objects
dayyeeet 8d1054f
impl: add ServerHost on the fly registration and server reattaching
dayyeeet 29214d9
refactor: make ServerHost config serializable
dayyeeet 48ea1f5
impl: ServerHost reattaching
dayyeeet 234cd89
update: readme.md
dayyeeet 005217b
refactor: make port generation a controller task
dayyeeet 1c1a1da
refactor: remove gh-packages
dayyeeet 353f8e6
impl: controller args, numerical id fix
dayyeeet b919aa7
fix: npe in group config
FllipEis 59eb262
refactor: add prepared state to server
dayyeeet ec42e7c
refactor: improve reconiler and numerical ids
FllipEis b86b714
Merge remote-tracking branch 'origin/develop' into develop
FllipEis 4826f7a
fix: server starting
FllipEis 2949401
fix: duplicate database entries
FllipEis 4983097
feat: reconciler is now stopping unused servers
FllipEis e489225
impl: Server update support
dayyeeet 94688f1
fix: ManagedChannel garbage collection error
dayyeeet 1f463be
fix: numerical ids
FllipEis ac0b48b
add: max-startup-seconds to default conf
dayyeeet 7d64ecb
add: server types and server type queries
dayyeeet 281c52d
fix: broken grpc calls
dayyeeet 2250c07
refactor: improve group repository
FllipEis 1d51c41
fix: only allow .yml files in yaml directory repository
FllipEis d39b6ce
refactor: improve start arguments
FllipEis 73e96e9
Merge remote-tracking branch 'origin/develop' into develop
FllipEis 27f1e95
fix: server type import
FllipEis 720de91
fix: database path
FllipEis 7a7c3f6
refactor: clean up
FllipEis c14bd2b
fix: yaml file saving format
FllipEis 7693c86
refactor: optimize imports
FllipEis 6f93495
refactor: clean up gradle files
FllipEis e0ae584
feat: codestyles
FllipEis 7daba05
refactor: reformat code
FllipEis 8810f0d
fix: gradle libs version naming
FllipEis 7f289e6
refactor: cleanup annoying log
dayyeeet 57d9384
Merge remote-tracking branch 'origin/develop' into develop
dayyeeet fed43b9
refactor: cleanup annoying log
dayyeeet 1dd6163
fix: array exceptions
dayyeeet dd4eaa4
refactor: add cleanup for numerical ids
FllipEis 6e86d3c
Merge remote-tracking branch 'origin/develop' into develop
FllipEis 2c4f528
fix: only log numerical id cleanup if there are unused ids
FllipEis 3c04db3
fix: garbage collection error
dayyeeet 388d1fe
refactor: move proto files to buf
FllipEis ddf7524
Merge remote-tracking branch 'origin/develop' into develop
FllipEis 9917ad4
refactor: update version to 1.0.20
FllipEis 2b8070e
refactor: move jooq codegen to runtime
FllipEis 4521cd6
feat: grpc config in start arguments and env
FllipEis cd3c3eb
refactor: some logger improvements
FllipEis 45f881f
impl: velocity secret file, group api crud, cleanup definitions
dayyeeet d334c25
refactor: improve forwarding secret
FllipEis c616727
refactor: remove unused resources
dayyeeet 55d345f
refactor: remove arraylist inheritance from repositories
dayyeeet 8029d33
impl: new api methods in buf bump
dayyeeet 5fe6d25
feat: authentication & improve forwarding secret
FllipEis b95a124
fix: authentication
FllipEis 0408da4
feat: authentication in controller api
FllipEis 13ef965
impl: all grpc methods in controller api
dayyeeet 137eb0d
refactor: reconciler
frederickbaier e8c2dac
Merge branch 'develop' of https://github.com/theSimpleCloud/simpleclo…
frederickbaier 03d12e1
fix: merge conflicts
frederickbaier b7f4280
fix: ServerService#getAllServers has not completed the responseObserver
FllipEis cbbdbab
refactor: improve controller api
FllipEis 57787eb
refactor: resolve requested changes
dayyeeet 4c5b24b
refactor: add javadoc to group and server api getters
dayyeeet 8015a52
refactor: remove author comment
dayyeeet dda8744
feat: maven central publish
FllipEis 1fde0a5
refactor: improve ServerHostRepository#find
FllipEis 9a8dcca
refactor: change return type of LoadableRepository#load to list of el…
FllipEis 39f669a
fix: make error handling way better
dayyeeet 52ee5b2
refactor: update javadocs and readme
dayyeeet 4de9772
update: proto specs
FllipEis b1f28cf
Merge remote-tracking branch 'origin/develop' into develop
FllipEis 13c74b8
feat: adjust reconciler to start new servers based on player ratio
frederickbaier 2f7a6b2
feat: make new server player ratio optional
frederickbaier 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,4 +39,6 @@ bin/ | |
| .vscode/ | ||
|
|
||
| ### Mac OS ### | ||
| .DS_Store | ||
| .DS_Store | ||
|
|
||
| run/ | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
38 changes: 32 additions & 6 deletions
38
controller-api/src/main/kotlin/app/simplecloud/controller/api/ControllerApi.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,41 @@ | ||
| package app.simplecloud.controller.api | ||
|
|
||
| import app.simplecloud.controller.shared.group.Group | ||
| import java.util.concurrent.CompletableFuture | ||
| import app.simplecloud.controller.api.impl.ControllerApiImpl | ||
|
|
||
| interface ControllerApi { | ||
|
|
||
| /** | ||
| * NOTE: This may be moved to a separate api file. | ||
| * @param name the name of the group. | ||
| * @returns a [CompletableFuture] with the [Group]. | ||
| * @return the Controller [GroupApi] | ||
| */ | ||
| fun getGroupByName(name: String): CompletableFuture<Group> | ||
| fun getGroups(): GroupApi | ||
|
|
||
| /** | ||
| * @return the Controller [ServerApi] | ||
| */ | ||
| fun getServers(): ServerApi | ||
FllipEis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| companion object { | ||
|
|
||
| /** | ||
| * Creates a new [ControllerApi] instance | ||
| * @return the created [ControllerApi] | ||
| */ | ||
| @JvmStatic | ||
| fun create(): ControllerApi { | ||
| val authSecret = System.getenv("CONTROLLER_SECRET") | ||
| return create(authSecret) | ||
| } | ||
|
|
||
| /** | ||
| * Creates a new [ControllerApi] instance | ||
| * @param authSecret the authentication key used by the Controller | ||
| * @return the created [ControllerApi] | ||
| */ | ||
| @JvmStatic | ||
| fun create(authSecret: String): ControllerApi { | ||
| return ControllerApiImpl(authSecret) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
17 changes: 0 additions & 17 deletions
17
controller-api/src/main/kotlin/app/simplecloud/controller/api/ControllerApiSingleton.kt
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
controller-api/src/main/kotlin/app/simplecloud/controller/api/GroupApi.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package app.simplecloud.controller.api | ||
|
|
||
| import app.simplecloud.controller.shared.group.Group | ||
| import build.buf.gen.simplecloud.controller.v1.ServerType | ||
| import java.util.concurrent.CompletableFuture | ||
|
|
||
| interface GroupApi { | ||
|
|
||
| /** | ||
| * @param name the name of the group. | ||
| * @return a [CompletableFuture] with the [Group]. | ||
| */ | ||
| fun getGroupByName(name: String): CompletableFuture<Group> | ||
|
|
||
| /** | ||
| * @param name the name of the group. | ||
| * @return the deleted [Group]. | ||
| */ | ||
| fun deleteGroup(name: String): CompletableFuture<Group> | ||
|
|
||
| /** | ||
| * @param group the [Group] to create. | ||
| * @return the created [Group]. | ||
| */ | ||
| fun createGroup(group: Group): CompletableFuture<Group> | ||
|
|
||
| /** | ||
| * @param group the [Group] to update. | ||
| * @return the updated [Group]. | ||
| */ | ||
| fun updateGroup(group: Group): CompletableFuture<Group> | ||
| /** | ||
| * @return a [CompletableFuture] with a list of all groups. | ||
| */ | ||
| fun getAllGroups(): CompletableFuture<List<Group>> | ||
|
|
||
| /** | ||
| * @param type the [ServerType] of the group | ||
| * @return a [CompletableFuture] with a list of all groups matching this type. | ||
| */ | ||
| fun getGroupsByType(type: ServerType): CompletableFuture<List<Group>> | ||
|
|
||
| } |
74 changes: 74 additions & 0 deletions
74
controller-api/src/main/kotlin/app/simplecloud/controller/api/ServerApi.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| package app.simplecloud.controller.api | ||
|
|
||
| import app.simplecloud.controller.shared.group.Group | ||
| import build.buf.gen.simplecloud.controller.v1.ServerType | ||
| import app.simplecloud.controller.shared.server.Server | ||
| import build.buf.gen.simplecloud.controller.v1.ServerState | ||
| import java.util.concurrent.CompletableFuture | ||
|
|
||
| interface ServerApi { | ||
|
|
||
| /** | ||
| * @return a [CompletableFuture] with a [List] of all [Server]s | ||
| */ | ||
| fun getAllServers(): CompletableFuture<List<Server>> | ||
|
|
||
| /** | ||
| * @param id the id of the server. | ||
| * @return a [CompletableFuture] with the [Server]. | ||
| */ | ||
| fun getServerById(id: String): CompletableFuture<Server> | ||
|
|
||
| /** | ||
| * @param groupName the name of the server group. | ||
| * @return a [CompletableFuture] with a [List] of [Server]s of that group. | ||
| */ | ||
| fun getServersByGroup(groupName: String): CompletableFuture<List<Server>> | ||
|
|
||
| /** | ||
| * @param group The server group. | ||
| * @return a [CompletableFuture] with a [List] of [Server]s of that group. | ||
| */ | ||
| fun getServersByGroup(group: Group): CompletableFuture<List<Server>> | ||
|
|
||
| /** | ||
| * @param type The servers type | ||
| * @return a [CompletableFuture] with a [List] of all [Server]s with this type | ||
| */ | ||
| fun getServersByType(type: ServerType): CompletableFuture<List<Server>> | ||
|
|
||
| /** | ||
| * @param groupName the group name of the group the new server should be of. | ||
| * @return a [CompletableFuture] with a [Server] or null. | ||
| */ | ||
| fun startServer(groupName: String): CompletableFuture<Server?> | ||
|
|
||
| /** | ||
| * @param groupName the group name of the servers group. | ||
| * @param numericalId the numerical id of the server. | ||
| * @return a [CompletableFuture] with the stopped [Server]. | ||
| */ | ||
| fun stopServer(groupName: String, numericalId: Long): CompletableFuture<Server> | ||
|
|
||
| /** | ||
| * @param id the id of the server. | ||
| * @return a [CompletableFuture] with the stopped [Server]. | ||
| */ | ||
| fun stopServer(id: String): CompletableFuture<Server> | ||
|
|
||
| /** | ||
| * @param id the id of the server. | ||
| * @param state the new state of the server. | ||
| * @return a [CompletableFuture] with the updated [Server]. | ||
| */ | ||
| fun updateServerState(id: String, state: ServerState): CompletableFuture<Server> | ||
|
|
||
| /** | ||
| * @param id the id of the server. | ||
| * @param key the server property key | ||
| * @param value the new property value | ||
| * @return a [CompletableFuture] with the updated [Server]. | ||
| */ | ||
| fun updateServerProperty(id: String, key: String, value: Any): CompletableFuture<Server> | ||
|
|
||
| } |
40 changes: 22 additions & 18 deletions
40
controller-api/src/main/kotlin/app/simplecloud/controller/api/impl/ControllerApiImpl.kt
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
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.
Uh oh!
There was an error while loading. Please reload this page.