Skip to content
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

Update luckperms #5

Merged
merged 23 commits into from
Sep 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6d2a5a6
Fix issues with postgres storage backend (#3647)
lucko Jun 8, 2023
8048427
Tag docker images with LP version
lucko Jun 8, 2023
da08be0
Fix github action to fetch repo with tags
lucko Jun 8, 2023
d859085
Update Fabric/Forge to Minecraft 1.20
lucko May 30, 2023
2e5a1d7
Switch back to official Postgres JDBC driver
lucko Jun 11, 2023
081a4f8
Fix Forge reobf shadowjar (#3675)
lucko Jun 14, 2023
acd8d6e
Include standalone data directory in gitignore (#3671)
powercasgamer Jun 14, 2023
3542a6c
Improve console detection on Fabric/Forge (#3673)
DrexHD Jun 14, 2023
5dd8087
Update Forge/Fabric to 1.20.1
lucko Jun 14, 2023
9f1e74f
Fix user deletion not being correctly processed on SQL backends (#3664)
lucko Jun 18, 2023
7a59536
Add support for redis cluster (#3670)
Dominik48N Jun 23, 2023
feef08a
Update GitHub URLs to new location (#3686)
mja00 Jun 23, 2023
86cc90f
Refactor gradle plugin version handling (#3665)
powercasgamer Jun 23, 2023
35dfc2c
Render minimessage in prefix/suffix/meta values (#3672)
powercasgamer Jun 23, 2023
7297fb8
whoops (#3691)
powercasgamer Jun 24, 2023
f788088
Delete temporary H2 v1 to v2 migration script if exists (#3693)
lucko Jun 25, 2023
77a5a7b
Print test output when ran through Gradle
lucko Jun 25, 2023
9f4082c
Add more unit/integration tests
lucko Jun 25, 2023
8fbd791
Add missing future join call to storage test
lucko Jun 25, 2023
6d8b6bd
Add jacoco report gradle plugin
lucko Aug 5, 2023
b8d1f52
Use ansi component serializer
lucko Aug 5, 2023
71416ba
Use driver class instead of datasource for Postgres (#3705)
lucko Aug 5, 2023
f12d3cd
Fix race error in bulk update integration test
lucko Aug 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
with:
fetch-depth: 0

- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
Expand Down Expand Up @@ -74,17 +77,15 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Retrieve saved standalone jar artifact
uses: actions/download-artifact@v3
with:
name: standalone-binary
path: standalone/docker/

- name: Display structure of downloaded files
run: ls -R
working-directory: standalone/docker/

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand All @@ -98,13 +99,23 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine the LuckPerms version
run: |
echo "luckperms_version=$(git describe --tags | awk -F "-" '{print $1 "." $2}')" >> "$GITHUB_ENV"

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=${{ github.ref == 'refs/heads/master' }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,enable=${{ github.ref == 'refs/heads/master' }},value=${{ env.luckperms_version }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### LuckPerms Standalone ###
standalone/loader/data/

### Gradle & IntelliJ ###
.gradle/
/.idea/
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Before reporting a bug or issue, please make sure that the issue is actually bei

If you're unsure, feel free to ask using the above resources BEFORE making a report.

Bugs or issues should be reported using the [GitHub Issues tab](https://github.com/lucko/LuckPerms/issues).
Bugs or issues should be reported using the [GitHub Issues tab](https://github.com/LuckPerms/LuckPerms/issues).

### :pencil: Want to contribute code?
#### Pull Requests
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ For more information, see the wiki article on [Why LuckPerms?](https://luckperms
LuckPerms uses Gradle to handle dependencies & building.

#### Requirements
* Java 8 JDK or newer
* Java 17 JDK or newer
* Git

#### Compiling from source
```sh
git clone https://github.com/lucko/LuckPerms.git
git clone https://github.com/LuckPerms/LuckPerms.git
cd LuckPerms/
./gradlew build
```
Expand All @@ -56,4 +56,4 @@ The project is split up into a few separate modules.
* **Bukkit, BungeeCord, Fabric, Forge, Nukkit, Sponge & Velocity** - Each use the common module to implement plugins on the respective server platforms.

## License
LuckPerms is licensed under the permissive MIT license. Please see [`LICENSE.txt`](https://github.com/lucko/LuckPerms/blob/master/LICENSE.txt) for more info.
LuckPerms is licensed under the permissive MIT license. Please see [`LICENSE.txt`](https://github.com/LuckPerms/LuckPerms/blob/master/LICENSE.txt) for more info.
17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
plugins {
id 'org.cadixdev.licenser' version '0.6.1' apply false
alias(libs.plugins.licenser) apply false
}

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

defaultTasks 'licenseFormat', 'build'

subprojects {
Expand All @@ -15,10 +18,20 @@ subprojects {
sourceCompatibility = 1.8
targetCompatibility = 1.8

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}

tasks.withType(Test).configureEach {
testLogging {
events = [TestLogEvent.PASSED, TestLogEvent.FAILED, TestLogEvent.SKIPPED]
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
}

jar {
from '../LICENSE.txt'
}
Expand Down
4 changes: 2 additions & 2 deletions bukkit-legacy/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
alias(libs.plugins.shadow)
}

dependencies {
Expand Down Expand Up @@ -29,7 +29,7 @@ shadowJar {
relocate 'me.lucko.commodore', 'me.lucko.luckperms.lib.commodore'
relocate 'org.mariadb.jdbc', 'me.lucko.luckperms.lib.mariadb'
relocate 'com.mysql', 'me.lucko.luckperms.lib.mysql'
relocate 'com.impossibl', 'me.lucko.luckperms.lib.postgresql'
relocate 'org.postgresql', 'me.lucko.luckperms.lib.postgresql'
relocate 'com.zaxxer.hikari', 'me.lucko.luckperms.lib.hikari'
relocate 'com.mongodb', 'me.lucko.luckperms.lib.mongodb'
relocate 'org.bson', 'me.lucko.luckperms.lib.bson'
Expand Down
2 changes: 1 addition & 1 deletion bukkit-legacy/loader/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.github.johnrengelman.shadow'
alias(libs.plugins.shadow)
}

repositories {
Expand Down
4 changes: 2 additions & 2 deletions bukkit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
alias(libs.plugins.shadow)
}

repositories {
Expand Down Expand Up @@ -39,7 +39,7 @@ shadowJar {
relocate 'me.lucko.commodore', 'me.lucko.luckperms.lib.commodore'
relocate 'org.mariadb.jdbc', 'me.lucko.luckperms.lib.mariadb'
relocate 'com.mysql', 'me.lucko.luckperms.lib.mysql'
relocate 'com.impossibl', 'me.lucko.luckperms.lib.postgresql'
relocate 'org.postgresql', 'me.lucko.luckperms.lib.postgresql'
relocate 'com.zaxxer.hikari', 'me.lucko.luckperms.lib.hikari'
relocate 'com.mongodb', 'me.lucko.luckperms.lib.mongodb'
relocate 'org.bson', 'me.lucko.luckperms.lib.bson'
Expand Down
2 changes: 1 addition & 1 deletion bukkit/loader/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.github.johnrengelman.shadow'
alias(libs.plugins.shadow)
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ protected void setupPlatformHooks() {
* Vault in their onEnable without depending on us.
*
* Noteworthy discussion here:
* - https://github.com/lucko/LuckPerms/issues/1959
* - https://github.com/LuckPerms/LuckPerms/issues/1959
* - https://hub.spigotmc.org/jira/browse/SPIGOT-5546
* - https://github.com/PaperMC/Paper/pull/3509
*/
Expand Down
3 changes: 2 additions & 1 deletion bukkit/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# | | #
# | WIKI: https://luckperms.net/wiki | #
# | DISCORD: https://discord.gg/luckperms | #
# | BUG REPORTS: https://github.com/lucko/LuckPerms/issues | #
# | BUG REPORTS: https://github.com/LuckPerms/LuckPerms/issues | #
# | | #
# | Each option in this file is documented and explained here: | #
# | ==> https://luckperms.net/wiki/Configuration | #
Expand Down Expand Up @@ -262,6 +262,7 @@ broadcast-received-log-entries: true

# Settings for Redis.
# Port 6379 is used by default; set address to "host:port" if differs
# Multiple Redis nodes can be specified in the same format as a string list under the name "addresses".
redis:
enabled: false
address: localhost
Expand Down
4 changes: 2 additions & 2 deletions bungee/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
alias(libs.plugins.shadow)
}

dependencies {
Expand Down Expand Up @@ -31,7 +31,7 @@ shadowJar {
relocate 'me.lucko.commodore', 'me.lucko.luckperms.lib.commodore'
relocate 'org.mariadb.jdbc', 'me.lucko.luckperms.lib.mariadb'
relocate 'com.mysql', 'me.lucko.luckperms.lib.mysql'
relocate 'com.impossibl', 'me.lucko.luckperms.lib.postgresql'
relocate 'org.postgresql', 'me.lucko.luckperms.lib.postgresql'
relocate 'com.zaxxer.hikari', 'me.lucko.luckperms.lib.hikari'
relocate 'com.mongodb', 'me.lucko.luckperms.lib.mongodb'
relocate 'org.bson', 'me.lucko.luckperms.lib.bson'
Expand Down
2 changes: 1 addition & 1 deletion bungee/loader/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.github.johnrengelman.shadow'
alias(libs.plugins.shadow)
}

dependencies {
Expand Down
3 changes: 2 additions & 1 deletion bungee/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# | | #
# | WIKI: https://luckperms.net/wiki | #
# | DISCORD: https://discord.gg/luckperms | #
# | BUG REPORTS: https://github.com/lucko/LuckPerms/issues | #
# | BUG REPORTS: https://github.com/LuckPerms/LuckPerms/issues | #
# | | #
# | Each option in this file is documented and explained here: | #
# | ==> https://luckperms.net/wiki/Configuration | #
Expand Down Expand Up @@ -260,6 +260,7 @@ broadcast-received-log-entries: false

# Settings for Redis.
# Port 6379 is used by default; set address to "host:port" if differs
# Multiple Redis nodes can be specified in the same format as a string list under the name "addresses".
redis:
enabled: false
address: localhost
Expand Down
16 changes: 13 additions & 3 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
plugins {
id 'java-library'
id("java-library")
id("jacoco")
}

test {
useJUnitPlatform {}
}

jacocoTestReport {
dependsOn test
}

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
Expand Down Expand Up @@ -45,6 +50,11 @@ dependencies {
exclude(module: 'adventure-api')
}

api("net.kyori:adventure-text-minimessage:4.11.0") {
exclude(module: 'adventure-bom')
exclude(module: 'adventure-api')
}

api('net.kyori:event-api:3.0.0') {
exclude(module: 'checker-qual')
exclude(module: 'guava')
Expand Down Expand Up @@ -74,10 +84,10 @@ dependencies {
transitive = false
}
compileOnly 'com.zaxxer:HikariCP:4.0.3'
compileOnly 'redis.clients:jedis:3.5.2'
compileOnly 'redis.clients:jedis:4.4.3'
compileOnly 'io.nats:jnats:2.16.4'
compileOnly 'com.rabbitmq:amqp-client:5.12.0'
compileOnly 'org.mongodb:mongodb-driver-legacy:4.5.0'
compileOnly 'com.impossibl.pgjdbc-ng:pgjdbc-ng:0.8.9'
compileOnly 'org.postgresql:postgresql:42.6.0'
compileOnly 'org.yaml:snakeyaml:1.28'
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ public CompletableFuture<T> request() {
}
}

/**
* Gets if the request buffer has been enqueued
*
* @return if the buffer is enqueued
*/
public boolean isEnqueued() {
synchronized (this.mutex) {
return this.processor != null;
}
}

/**
* Requests the value, bypassing the buffer
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void execute(LuckPermsPlugin plugin, Sender sender, T target, ArgumentLis

Message.EDITOR_START.send(sender);

WebEditorSession.createAndOpen(holders, Collections.emptyList(), sender, label, plugin);
WebEditorSession.create(holders, Collections.emptyList(), sender, label, plugin).open();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void execute(LuckPermsPlugin plugin, Sender sender, ArgumentList args, St

Message.EDITOR_START.send(sender);

WebEditorSession.createAndOpen(holders, tracks, sender, label, plugin);
WebEditorSession.create(holders, tracks, sender, label, plugin).open();
}

private enum Type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void execute(LuckPermsPlugin plugin, Sender sender, Track target, Argumen

Message.EDITOR_START.send(sender);

WebEditorSession.createAndOpen(holders, Collections.singletonList(target), sender, label, plugin);
WebEditorSession.create(holders, Collections.singletonList(target), sender, label, plugin).open();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import static me.lucko.luckperms.common.config.generic.key.ConfigKeyFactory.mapKey;
import static me.lucko.luckperms.common.config.generic.key.ConfigKeyFactory.notReloadable;
import static me.lucko.luckperms.common.config.generic.key.ConfigKeyFactory.stringKey;
import static me.lucko.luckperms.common.config.generic.key.ConfigKeyFactory.stringListKey;

/**
* All of the {@link ConfigKey}s used by LuckPerms.
Expand Down Expand Up @@ -639,6 +640,11 @@ private ConfigKeys() {}
*/
public static final ConfigKey<String> REDIS_ADDRESS = notReloadable(stringKey("redis.address", null));

/**
* The addresses of the redis servers (only for redis clusters)
*/
public static final ConfigKey<List<String>> REDIS_ADDRESSES = notReloadable(stringListKey("redis.addresses", ImmutableList.of()));

/**
* The username to connect with, or an empty string if it should use default
*/
Expand Down Expand Up @@ -719,6 +725,11 @@ private ConfigKeys() {}
*/
public static final ConfigKey<String> BYTESOCKS_HOST = stringKey("bytesocks-host", "usersockets.luckperms.net");

/**
* If TLS (https/wss) should be used when connecting to bytesocks
*/
public static final ConfigKey<Boolean> BYTESOCKS_USE_TLS = booleanKey("bytesocks-use-tls", true);

/**
* The URL of the web editor
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.google.common.collect.ImmutableMap;
import me.lucko.luckperms.common.config.generic.adapter.ConfigurationAdapter;

import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.function.Function;
Expand All @@ -36,6 +37,7 @@ public interface ConfigKeyFactory<T> {

ConfigKeyFactory<Boolean> BOOLEAN = ConfigurationAdapter::getBoolean;
ConfigKeyFactory<String> STRING = ConfigurationAdapter::getString;
ConfigKeyFactory<List<String>> STRING_LIST = ConfigurationAdapter::getStringList;
ConfigKeyFactory<String> LOWERCASE_STRING = (adapter, path, def) -> adapter.getString(path, def).toLowerCase(Locale.ROOT);
ConfigKeyFactory<Map<String, String>> STRING_MAP = (config, path, def) -> ImmutableMap.copyOf(config.getStringMap(path, ImmutableMap.of()));

Expand All @@ -56,6 +58,10 @@ static SimpleConfigKey<String> stringKey(String path, String def) {
return key(new Bound<>(STRING, path, def));
}

static SimpleConfigKey<List<String>> stringListKey(String path, List<String> def) {
return key(new Bound<>(STRING_LIST, path, def));
}

static SimpleConfigKey<String> lowercaseStringKey(String path, String def) {
return key(new Bound<>(LOWERCASE_STRING, path, def));
}
Expand Down
Loading
Loading