Skip to content

Commit

Permalink
Merge pull request #44 from magneticflux-/config-refactor
Browse files Browse the repository at this point in the history
Config refactor and 1.17 update
  • Loading branch information
magneticflux- authored Jun 22, 2021
2 parents b6ffa96 + 3e49a34 commit c569557
Show file tree
Hide file tree
Showing 38 changed files with 1,161 additions and 620 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#
# CI build that assembles artifacts and runs tests.
# If validation is successful this workflow releases from the main dev branch.
#
# - skipping CI: add [skip ci] to the commit message
# - skipping release: add [skip release] to the commit message
#
name: CI

on:
push:
branches: [ 'develop', 'release/**' ]
tags-ignore: [ v* ] # release tags are autogenerated after a successful CI, no need to run CI against them
pull_request:
branches: [ '**' ]

jobs:

assemble:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '16'
- uses: burrunan/gradle-cache-action@v1
with:
gradle-distribution-sha-256-sum-warning: false
- name: Assemble
run: ./gradlew assemble
spotless:
needs: assemble
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '16'
- uses: burrunan/gradle-cache-action@v1
with:
gradle-distribution-sha-256-sum-warning: false
- name: Spotless
run: ./gradlew spotlessCheck
test:
needs: assemble
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '16'
- uses: burrunan/gradle-cache-action@v1
with:
gradle-distribution-sha-256-sum-warning: false
- name: Test
run: ./gradlew test

publish:
needs: [ spotless, test ]
runs-on: ubuntu-latest
if: github.event_name == 'push'
&& github.ref == 'refs/heads/release/mc-1.17.x'
&& github.repository == 'magneticflux-/fabric-mumblelink-mod'
&& !(contains(toJSON(github.event.commits.*.message), '[skip release]') || contains(toJSON(github.event.commits.*.message), '[skip ci]'))

steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci

- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '16'

- uses: burrunan/gradle-cache-action@v1
with:
gradle-distribution-sha-256-sum-warning: false

- name: Perform release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }}
run: ./gradlew githubRelease publish
31 changes: 31 additions & 0 deletions .idea/codeStyles/Project.xml

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

4 changes: 2 additions & 2 deletions .idea/codeStyles/codeStyleConfig.xml

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

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/ktlint.xml

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

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

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

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

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

2 changes: 1 addition & 1 deletion .idea/kotlinScripting.xml

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

65 changes: 65 additions & 0 deletions .idea/libraries-with-intellij-classes.xml

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

4 changes: 2 additions & 2 deletions .idea/misc.xml

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

29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Trivial configuring of the server may be done by specifying the host and port. C
Dimension separation may also be accomplished by _users_ setting the "Y-Axis multiplier for dimension IDs" to a value above 512. This makes users in the Nether and End appear 512 blocks below and above users in the Overworld, respectively. This approach is not recommended for larger servers, but it may work fine for servers with < 5 people.

### Non-trivial
Most of the non-trivial configuration is done through the use of templated strings. The path and the query string of the URI sent to clients to be opened are template strings, so parts of them may be replaced by user- and server-specific information. Below is a table of available template values:
Before going any further, make sure you understand RFC 3986! Most of the non-trivial configuration is done through the use of templated strings. The `userinfo`, `path`, `query`, and `fragment` strings of the URI sent to clients to be opened are template strings, so parts of them may be replaced by user- and server-specific information. Below is a table of available template values:

| Template index | Value source | Example values |
| -------------- | -------------------- | -------------- |
Expand Down Expand Up @@ -77,11 +77,11 @@ In TeamSpeak, the channel path should go in a query parameter called `channel`.

# Security considerations

Servers with this mod will be able to open Mumble or TeamSpeak URIs through your client. Servers _cannot_ open arbitrary URLs, because only the required information ([host](https://tools.ietf.org/html/rfc3986#section-3.2.2), [port](https://tools.ietf.org/html/rfc3986#section-3.2.3), [path](https://tools.ietf.org/html/rfc3986#section-3.3), and [query](https://tools.ietf.org/html/rfc3986#section-3.4)) is sent to the client. It is important to note that a full URL is _not_ sent to the client; the [scheme](https://tools.ietf.org/html/rfc3986#section-3.1), [user info](https://tools.ietf.org/html/rfc3986#section-3.2.1), and [fragment identifier](https://tools.ietf.org/html/rfc3986#section-3.5) are hard-coded. Only vulnerabilities in Mumble or TeamSpeak may be exploited, and only by servers trusted by the player.
Servers with this mod will be able to open Mumble or TeamSpeak URIs through your client. Servers _cannot_ open arbitrary URLs, because only the required information ([userinfo](https://tools.ietf.org/html/rfc3986#section-3.2.1), [host](https://tools.ietf.org/html/rfc3986#section-3.2.2), [port](https://tools.ietf.org/html/rfc3986#section-3.2.3), [path](https://tools.ietf.org/html/rfc3986#section-3.3), [query](https://tools.ietf.org/html/rfc3986#section-3.4), and [fragment](https://tools.ietf.org/html/rfc3986#section-3.5)) is sent to the client. It is important to note that a full URL is _not_ sent to the client; the [scheme](https://tools.ietf.org/html/rfc3986#section-3.1) is hard-coded. Only vulnerabilities in Mumble or TeamSpeak may be exploited, and only by servers trusted by the player.

The client-side URI construction is this fragment:
The client-side URI construction is this snippet from `ClientMumbleLinkMod.kt`:
```kotlin
val uri = URI(voipClient.scheme, null, host, port, path, query, null)
val uri = URI(voipClient.scheme, userinfo, host, port, path, query, fragment)
```

---
Expand Down
Loading

0 comments on commit c569557

Please sign in to comment.