Skip to content

Commit

Permalink
mongo uri auth now
Browse files Browse the repository at this point in the history
  • Loading branch information
98ping committed Jan 4, 2023
1 parent 6c50912 commit 0401e48
Show file tree
Hide file tree
Showing 88 changed files with 33 additions and 12 deletions.
Binary file modified .gradle/7.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/7.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/7.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/7.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/7.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file modified .gradle/checksums/checksums.lock
Binary file not shown.
Binary file modified .gradle/checksums/sha1-checksums.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion .idea/codestream.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified spigot/build/kotlin/compileKotlin/build-history.bin
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
339
179
0
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified spigot/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Ǹ㗘淥영훊ǂ�힑˃훵Ǿ!Ǿ쨁ǜ更ǪǾǍǶ쌁
��G�m�
Binary file not shown.
Binary file modified spigot/build/kotlin/compileKotlin/last-build.bin
Binary file not shown.
3 changes: 3 additions & 0 deletions spigot/build/resources/main/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ mongo:
authDB: ""
database: "Alchemist"

#leave blank to not use!
uri: ""

#all redis information. This is used for messaging from server to server
redis:
host: "127.0.0.1"
Expand Down
Binary file modified spigot/build/tmp/kapt3/incApCache/main/classpath-structure.bin
Binary file not shown.
Binary file modified spigot/build/tmp/kapt3/incApCache/main/java-cache.bin
Binary file not shown.
Binary file modified spigot/lib/honey.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ltd.matrixstudios.alchemist
import co.aikar.commands.PaperCommandManager
import io.github.nosequel.data.connection.mongo.AuthenticatedMongoConnectionPool
import io.github.nosequel.data.connection.mongo.NoAuthMongoConnectionPool
import io.github.nosequel.data.connection.mongo.URIMongoConnectionPool
import ltd.matrixstudios.alchemist.aikar.ACFCommandController
import ltd.matrixstudios.alchemist.commands.grants.*
import ltd.matrixstudios.alchemist.commands.player.*
Expand Down Expand Up @@ -52,8 +53,22 @@ class AlchemistSpigotPlugin : JavaPlugin() {

val startMongo = System.currentTimeMillis()
val authEnabled = config.getBoolean("mongo.auth")
val uri = config.getString("uri")

if (authEnabled) {
if (uri != "") {
val connectionPool = URIMongoConnectionPool().apply {
this.databaseName = config.getString("mongo.database")
this.uri = uri

}

Alchemist.start(connectionPool,
config.getString("redis.host"),
config.getInt("redis.port"),
(if (config.getString("redis.username") == "") null else config.getString("redis.username")),
(if (config.getString("redis.password") == "") null else config.getString("redis.password"))
)
} else if (authEnabled) {
val connectionPool = AuthenticatedMongoConnectionPool().apply {
hostname = config.getString("mongo.host")
password = config.getString("mongo.password")
Expand Down
3 changes: 3 additions & 0 deletions spigot/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ mongo:
authDB: ""
database: "Alchemist"

#leave blank to not use!
uri: ""

#all redis information. This is used for messaging from server to server
redis:
host: "127.0.0.1"
Expand Down

0 comments on commit 0401e48

Please sign in to comment.