-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement player data synchronization on redis, add translatable bund…
…le and override logging systems to json
- Loading branch information
Xharos
committed
Jun 25, 2024
1 parent
3b34826
commit a820897
Showing
28 changed files
with
1,051 additions
and
120 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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,7 @@ | ||
FROM redis:latest | ||
|
||
# Copy the custom entrypoint script | ||
COPY custom-entrypoint.sh /usr/local/bin/custom-entrypoint.sh | ||
RUN chmod +x /usr/local/bin/custom-entrypoint.sh | ||
|
||
ENTRYPOINT ["/usr/local/bin/custom-entrypoint.sh"] |
This file contains 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,28 @@ | ||
#!/bin/sh | ||
|
||
# Paths to the secrets files | ||
REDIS_USERNAME_FILE=/run/secrets/redis_username | ||
REDIS_PASSWORD_FILE=/run/secrets/redis_password | ||
|
||
# Read the contents of the secrets files | ||
REDIS_USERNAME=$(cat $REDIS_USERNAME_FILE) | ||
REDIS_PASSWORD=$(cat $REDIS_PASSWORD_FILE) | ||
|
||
# Set up Redis configuration directory | ||
mkdir -p /usr/local/etc/redis | ||
|
||
# Dynamically generate Redis configuration and ACL files | ||
echo "aclfile /usr/local/etc/redis/custom_aclfile.acl" > /usr/local/etc/redis/redis.conf | ||
|
||
# Generate ACL file using secrets contents | ||
if [ -n "$REDIS_USERNAME" ] && [ -n "$REDIS_PASSWORD" ]; then | ||
echo "user $REDIS_USERNAME on allkeys allchannels allcommands >$REDIS_PASSWORD" > /usr/local/etc/redis/custom_aclfile.acl | ||
fi | ||
|
||
# Disable default user | ||
if [ "$REDIS_DISABLE_DEFAULT_USER" = "true" ]; then | ||
echo "user default off nopass nocommands" >> /usr/local/etc/redis/custom_aclfile.acl | ||
fi | ||
|
||
# Call the original Docker entrypoint script with redis-server and the path to the custom Redis configuration | ||
exec docker-entrypoint.sh redis-server /usr/local/etc/redis/redis.conf |
This file contains 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
36 changes: 36 additions & 0 deletions
36
src/main/java/fr/islandswars/ineundo/lang/IneundoError.java
This file contains 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,36 @@ | ||
package fr.islandswars.ineundo.lang; | ||
|
||
/** | ||
* File <b>IneundoError</b> located on fr.islandswars.ineundo.lang | ||
* IneundoError is a part of ineundo. | ||
* <p> | ||
* Copyright (c) 2017 - 2024 Islands Wars. | ||
* <p> | ||
* ineundo is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* <p> | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* <p> | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <a href="http://www.gnu.org/licenses/">GNU license</a>. | ||
* <p> | ||
* | ||
* @author Jangliu, {@literal <[email protected]>} | ||
* Created the 25/06/2024 at 21:15 | ||
* @since 0.1 | ||
*/ | ||
public class IneundoError extends RuntimeException { | ||
|
||
public IneundoError(String message) { | ||
super(message); | ||
} | ||
|
||
public IneundoError(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
This file contains 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.