Skip to content

Commit 861e551

Browse files
authored
Release v1.5.4
Merge pull request #166 from Global-Tags/development
2 parents 20624d1 + 9589ada commit 861e551

File tree

121 files changed

+2869
-2235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2869
-2235
lines changed

.env

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,19 @@
1414
###########
1515

1616
# GT_PORT=5500
17-
# GT_PROXY_IP_HEADER=x-real-ip
1817
# GT_STRICT_AUTH=true
1918
# GT_LOG_LEVEL=Info
2019
# GT_BASE_URL=http://localhost:5500
20+
# GT_ICON_URL='https://cdn.rappytv.com/globaltags/icons/role/{role}.png'
2121
# GT_MONGODB_CONNECTION=''
2222

23+
#########
24+
# Proxy #
25+
#########
26+
27+
# GT_PROXY_ENABLED=false
28+
# GT_PROXY_IP_HEADER=x-real-ip
29+
2330
##############
2431
# Validation #
2532
##############
@@ -31,14 +38,7 @@
3138
# GT_VALIDATION_ICON_MAX_RESOLUTION=512
3239
# GT_VALIDATION_ICON_BLACKLIST=
3340
# GT_VALIDATION_NOTES_MAX_LENGTH=100
34-
35-
##########
36-
# GitHub #
37-
##########
38-
39-
# GT_GITHUB_OWNER=Global-Tags
40-
# GT_GITHUB_REPOSITORY=API
41-
# GT_GITHUB_BRANCH=master
41+
# GT_VALIDATION_ROLE_NAME_MAX_LENGTH=20
4242

4343
##########
4444
# Sentry #
@@ -53,7 +53,7 @@
5353

5454
# GT_METRICS_ENABLED=true
5555
# GT_METRICS_CRON=0 0 0 * * *
56-
# GT_METRICS_ADMIN_ROLE=ADMIN
56+
# GT_METRICS_ADMIN_ROLE=
5757

5858
##########
5959
# Mailer #
@@ -80,9 +80,9 @@
8080

8181
# GT_DISCORD_BOT_ENABLED=false
8282
# GT_DISCORD_BOT_TOKEN=
83+
# GT_DISCORD_BOT_SERVER=
8384

8485
# GT_DISCORD_BOT_SYNCED_ROLES_ENABLED=false
85-
# GT_DISCORD_BOT_SYNCED_ROLES_GUILD=
8686
# GT_DISCORD_BOT_SYNCED_ROLES_ADMIN=
8787
# GT_DISCORD_BOT_SYNCED_ROLES_DEVELOPER=
8888
# GT_DISCORD_BOT_SYNCED_ROLES_MODERATOR=
@@ -108,6 +108,7 @@
108108
# GT_DISCORD_BOT_REFERRALS_CHANNEL=
109109

110110
# GT_DISCORD_BOT_ACCOUNT_CONNECTIONS_ENABLED=false
111+
# GT_DISCORD_BOT_ACCOUNT_CONNECTIONS_HIDE_EMAILS=true
111112
# GT_DISCORD_BOT_ACCOUNT_CONNECTIONS_CHANNEL=
112113
# GT_DISCORD_BOT_ACCOUNT_CONNECTIONS_ROLE=
113114

CONTRIBUTING.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
11
# Contributing to GlobalTagsAPI
22

3-
You can read about contributing to the GlobalTagsAPI [here](https://docs.globaltags.xyz/api/custom-auth-provider/)!
3+
You can read about contributing to the GlobalTagsAPI [here](https://docs.globaltags.xyz/api/custom-auth-provider/)!
4+
5+
### Naming Conventions
6+
7+
Previously, this project did not enforce strict conventions, which may have resulted in some inconsistencies across the codebase, such as variations in naming styles or file organization. While we are now adopting these standardized conventions to maintain consistency and improve readability, you may still encounter older patterns that deviate from the new guidelines.
8+
9+
- **Translations**: Use `snake_case` for all keys in translation files.
10+
_Example_: `welcome_message`, `error_invalid_input`.
11+
12+
- **Database Keys**: Always follow `snake_case` for all keys in the database.
13+
_Example_: `user_id`, `created_at`.
14+
15+
- **TypeScript Classes**: Use `PascalCase` for class names.
16+
_Example_: `UserManager`, `ApiService`.
17+
18+
- **Normal TypeScript Files**: Use `kebab-case` for file names.
19+
_Example_: `user-manager.ts`, `api-service.ts`.
20+
21+
- **TypeScript Enum Values**: Use `Capitalcase` for enum values.
22+
_Example_: `enum Role { Admin, User, Guest }`.
23+
24+
- **Database Enum Values**: Use `snake_case` for database enum values.
25+
_Example_: `admin`, `regular_user`.
26+
27+
### Time Handling in the Database
28+
29+
- Always use mongodb date strings for time-related fields in the database instead of numeric timestamps.
30+
_Example_: `"2025-01-09T12:34:56Z"` instead of `1673262896`.

bun.lockb

387 Bytes
Binary file not shown.

config/roles.json

Lines changed: 0 additions & 52 deletions
This file was deleted.

docs/api/configuration-guide.md

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,6 @@ Defines all active rate-limiting rules.
4040

4141
---
4242

43-
### `roles.json`
44-
45-
This file lists all available roles for the system.
46-
47-
- **`name`**: Specifies the name of the role.
48-
- **`permissions`**: A string array in PascalCase format, listing all the permissions assigned to the role.
49-
Those are all valid permissions:
50-
- `BypassValidation`
51-
- `CustomIcon`
52-
- `ManageBans`
53-
- `ManageNotes`
54-
- `ManageSubscriptions`
55-
- `ManageRoles`
56-
- `ManageTags`
57-
- `ManageWatchlist`
58-
- `ReportImmunity`
59-
60-
---
61-
6243
### `skus.json`
6344
Lists all obtainable entitlement SKUs for subscription management.
6445

@@ -76,13 +57,21 @@ Environment variables configure essential application settings. Below is a detai
7657
### General Configuration
7758

7859
- **`GT_PORT`**: Specifies the port on which the API runs.
79-
- **`GT_PROXY_IP_HEADER`**: The header name that may contain the client’s real IP address when behind a proxy.
8060
- **`GT_STRICT_AUTH`**: Boolean that determines if unauthenticated requests are allowed on the `/players/:uuid` route. Set to `true` to require valid authorization for all requests.
8161
- **`GT_LOG_LEVEL`**: Specifies the level of logging detail. Valid values: `Error`, `Warn`, `Info`, `Debug`.
62+
- **`GT_BASE_URL`**: Defines the root URL of the API, excluding any trailing slashes. This is the URL where the API can be accessed and should be consistent with your deployment setup.
63+
- **`GT_ICON_URL`**: Provides a URL template for accessing role icons. The `{role}` placeholder in the template will be dynamically replaced with the role name.
8264
- **`GT_MONGODB_CONNECTION`** (**required**): MongoDB connection string. Follow the [MongoDB documentation](https://www.mongodb.com/docs/manual/reference/connection-string/) to construct this string.
8365

8466
---
8567

68+
### Proxy Settings
69+
70+
- **`GT_PROXY_ENABLED`**: Boolean that determines if the API should operate behind a proxy. Set to `true` to enable trusting a header for real client IPs.
71+
- **`GT_PROXY_IP_HEADER`**: The name of the HTTP header that contains the real client IP address when the API is behind a proxy. Common values include `x-forwarded-for` or `cf-connecting-ip`. Defaults to `x-real-ip`.
72+
73+
---
74+
8675
### Tag Validation Settings
8776

8877
- **`GT_VALIDATION_TAG_MIN_LENGTH`**: Minimum character length for tags.
@@ -92,6 +81,7 @@ Environment variables configure essential application settings. Below is a detai
9281
- **`GT_VALIDATION_ICON_MAX_RESOLUTION`**: Maximum resolution (e.g., `512` for 512x512) for custom icons.
9382
- **`GT_VALIDATION_ICON_BLACKLIST`**: Array of disallowed default icons.
9483
- **`GT_VALIDATION_NOTES_MAX_LENGTH`**: Maximum character length for staff notes.
84+
- **`GT_VALIDATION_ROLE_NAME_MAX_LENGTH`**: Maximum character length for role names.
9585

9686
---
9787

@@ -137,10 +127,10 @@ Environment variables configure essential application settings. Below is a detai
137127
- **General**
138128
- **`GT_DISCORD_BOT_ENABLED`**: Enables or disables the Discord bot.
139129
- **`GT_DISCORD_BOT_TOKEN`**: Token used for bot authentication.
130+
- **`GT_DISCORD_BOT_SERVER`**: ID of the main Discord guild for various feature including role synchronization.
140131

141132
- **Role Synchronization**
142133
- **`GT_DISCORD_BOT_SYNCED_ROLES_ENABLED`**: Enables role synchronization between GlobalTags and Discord.
143-
- **`GT_DISCORD_BOT_SYNCED_ROLES_GUILD`**: ID of the Discord guild for role synchronization.
144134
- **`GT_DISCORD_BOT_SYNCED_ROLES_{ROLE}`**: Maps GlobalTags roles to Discord role IDs. Example:
145135
```env
146136
GT_DISCORD_BOT_SYNCED_ROLES_ADMIN=123456,987654
@@ -170,6 +160,7 @@ Environment variables configure essential application settings. Below is a detai
170160
171161
- **Account connections**:
172162
- **`GT_DISCORD_BOT_ACCOUNT_CONNECTIONS_ENABLED`**: Enables or disables the ability for users to link their Discord account (via `/gt link discord` in-game or `/link` on Discord).
163+
- **`GT_DISCORD_BOT_ACCOUNT_CONNECTIONS_HIDE_EMAILS`**: Enables or disables if emails should be redacted in the log or not.
173164
- **`GT_DISCORD_BOT_ACCOUNT_CONNECTIONS_CHANNEL`**: Specifies the Discord channel ID where new account connection notifications are sent.
174165
- **`GT_DISCORD_BOT_ACCOUNT_CONNECTIONS_ROLE`**: Defines the ID of a Discord role treated as a "Verified" role for linked accounts.
175166

docs/api/guide.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,7 @@ https://cdn.rappytv.com/globaltags/icons/role/<name>.png
7676

7777
## Troubleshooting
7878

79-
### 1. **Malformed authorization header**
80-
81-
**Error message**: `You've entered a malformed authorization header!`
82-
83-
**Cause**: This error occurs when you either omit the `Authorization` header for a protected route or provide an invalid auth provider `id` that doesn't match any registered providers.
84-
85-
**Solution**: Ensure that the `Authorization` header follows the correct format:
86-
87-
```
88-
Authorization: <auth provider id> <token>
89-
```
90-
Verify that the auth provider `id` is valid and corresponds to a registered provider.
91-
92-
---
93-
94-
### 2. **Database Connection Issue**
79+
### 1. **Database Connection Issue**
9580

9681
**Error message**: `The database is not connected. Please try again later!`
9782

@@ -101,7 +86,7 @@ Verify that the auth provider `id` is valid and corresponds to a registered prov
10186

10287
---
10388

104-
### 3. **Unknown Error**
89+
### 2. **Unknown Error**
10590

10691
**Error message**: `An unknown error ocurred! Please try again later`
10792

docs/faq.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
### What do the different role icons mean?
66
| Icon | Role |
77
| ---- | ---- |
8-
| ![Purple](https://cdn.rappytv.com/globaltags/icons/role/admin.png){ width=32 } | <p style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">Admin</p> |
9-
| ![Purple](https://cdn.rappytv.com/globaltags/icons/role/developer.png){ width=32 } | <p style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">Developer</p> |
10-
| ![Purple](https://cdn.rappytv.com/globaltags/icons/role/moderator.png){ width=32 } | <p style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">Discord Moderator</p> |
11-
| ![Purple](https://cdn.rappytv.com/globaltags/icons/role/partner.png){ width=32 } | <p style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">Partner</p> |
12-
| ![Purple](https://cdn.rappytv.com/globaltags/icons/role/supporter.png){ width=32 } | <p style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">GlobalTags Premium</p> |
8+
| ![Admin](https://cdn.rappytv.com/globaltags/icons/role/admin.png){ width=32 } | <p style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">Admin</p> |
9+
| ![Developer](https://cdn.rappytv.com/globaltags/icons/role/developer.png){ width=32 } | <p style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">Developer</p> |
10+
| ![Moderator](https://cdn.rappytv.com/globaltags/icons/role/moderator.png){ width=32 } | <p style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">Discord Moderator</p> |
11+
| ![Partner](https://cdn.rappytv.com/globaltags/icons/role/partner.png){ width=32 } | <p style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">Partner</p> |
12+
| ![Translator](https://cdn.rappytv.com/globaltags/icons/role/translator.png){ width=32 } | <p style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">Translator</p> |
13+
| ![Premium](https://cdn.rappytv.com/globaltags/icons/role/premium.png){ width=32 } | <p style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">GlobalTags Premium</p> |
1314

1415
### Which commands can I use?
1516

docs/rules.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,28 @@
22

33
The GlobalTags system is provided for use by players and developers in the Minecraft community. We allow a lot of freedom in the choice of tags, but there are some limits that must not be exceeded. Your use of the service is subject to the following conditions:
44

5+
<div class="annotate" markdown>
6+
57
1. Advertisement of any kind **is allowed**.
68
2. Any form of racism/extremism is **not** allowed.
7-
3. Curse words are allowed as long as they don't insult or target a specific user or group
8-
4. Sharing any information about another person without their consent is **strictly forbidden**. This is also referred to as <u>doxing</u>.
9+
3. Curse words are allowed as long as they don't insult or target a specific user or group.
10+
4. Sharing sensitive information about any person, including yourself, is **strictly prohibited**, regardless of consent. This practice, commonly referred to as *doxing*, includes but is not limited to:
11+
1. Full names
12+
2. Telephone numbers
13+
3. Addresses
14+
4. Coordinates or any other means of sharing specific locations
915
5. Icons must not include inappropriate content, such as NSFW material, gore, or other offensive imagery.
1016
6. You must not violate any applicable laws or regulations.
1117
7. It is not allowed to exploit bugs or vulnerabilities within the API or mod implementation to gain unfair advantage.
18+
8. Creating unnecessary whitespaces, whether intentionally or accidentally, is strongly discouraged. (1)
19+
20+
</div>
21+
22+
1. For example, avoid putting spaces after color codes as this results in a whitespace:
23+
24+
|||
25+
| :---: | :---: |
26+
| `&5Test Tag` | `&5 Test Tag` |
27+
| `<#ff0000>My cool tag!` | `<#ff0000> My cool tag!` |
1228

1329
Violating these rules may result in a permanent suspension from GlobalTags services, without any refunds for prior purchases. See <a href="https://globaltags.xyz/legal/terms" target="_blank">General Terms and Conditions</a>

docs/wrappers/java.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ To implement the wrapper, create a class that extends the `GlobalTagsAPI<T>` cla
8888

8989
@Override
9090
public Agent getAgent() {
91-
return new Agent("MyMod", "v1.0.0", "1.21"); // (2)
91+
return new Agent("MyMod", "1.0.0", "1.21"); // (2)
9292
}
9393

9494
@Override
@@ -199,7 +199,7 @@ The wrapper comes with a built-in caching mechanism to minimize redundant API ca
199199

200200
@Override
201201
public Agent getAgent() {
202-
return new Agent("MyMod", "v1.0.0", "1.21");
202+
return new Agent("MyMod", "1.0.0", "1.21");
203203
}
204204

205205
@Override

locales/de_de.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
"success": {
3232
"self": "Dein Icon wurde erfolgreich ausgewählt!",
3333
"admin": "Das Icon des Spielers wurde erfolgreich geändert!"
34+
},
35+
"role_icon": {
36+
"success": {
37+
"hidden": "Dein Rollenicon ist nun versteckt!",
38+
"shown": "Dein Rollenicon wird nun angezeigt!"
39+
}
3440
}
3541
},
3642
"position": {
@@ -178,5 +184,15 @@
178184
"not_found": "Die Notiz wurde nicht gefunden!",
179185
"success": "Die Notiz wurde erfolgreich gelöscht!"
180186
}
187+
},
188+
"roles": {
189+
"not_found": "Die Rolle wurde nicht gefunden!",
190+
"create": {
191+
"already_exists": "Die Rolle '<role>' existiert bereits!",
192+
"success": "Die Rolle wurde erfolgreich erstellt!"
193+
},
194+
"delete": {
195+
"success": "Die Rolle wurde erfolgreich gelöscht!"
196+
}
181197
}
182198
}

0 commit comments

Comments
 (0)