mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-09 17:58:20 +00:00
External IP configuration as well as other small improvements
This commit is contained in:
parent
0dfc962df5
commit
59f053433c
@ -5,4 +5,11 @@ BUILD_THREADS=1
|
|||||||
# Updates NET_VERSION in CMakeVariables.txt
|
# Updates NET_VERSION in CMakeVariables.txt
|
||||||
BUILD_VERSION=171022
|
BUILD_VERSION=171022
|
||||||
# make sure this is a long random string
|
# make sure this is a long random string
|
||||||
ACCOUNT_MANAGER_SECRET=
|
ACCOUNT_MANAGER_SECRET=
|
||||||
|
# Should be the externally facing IP of your server host
|
||||||
|
EXTERNAL_IP=localhost
|
||||||
|
# Database values
|
||||||
|
MARIADB_USER=SECRET_VALUE_CHANGE_ME
|
||||||
|
MARIADB_PASSWORD=SECRET_VALUE_CHANGE_ME
|
||||||
|
MARIADB_ROOT_PASSWORD=SECRET_VALUE_CHANGE_ME
|
||||||
|
MARIADB_DATABASE=SECRET_VALUE_CHANGE_ME
|
@ -14,6 +14,8 @@ services:
|
|||||||
- ./migrations/dlu:/docker-entrypoint-initdb.d
|
- ./migrations/dlu:/docker-entrypoint-initdb.d
|
||||||
networks:
|
networks:
|
||||||
- darkflame
|
- darkflame
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
|
||||||
darkflame:
|
darkflame:
|
||||||
container_name: DarkFlameServer
|
container_name: DarkFlameServer
|
||||||
@ -30,6 +32,7 @@ services:
|
|||||||
- DATABASE_HOST=database
|
- DATABASE_HOST=database
|
||||||
- DATABASE_USER=${MARIADB_USER:-darkflame}
|
- DATABASE_USER=${MARIADB_USER:-darkflame}
|
||||||
- DATABASE_PASSWORD=${MARIADB_PASSWORD:-darkflame}
|
- DATABASE_PASSWORD=${MARIADB_PASSWORD:-darkflame}
|
||||||
|
- EXTERNAL_IP=${EXTERNAL_IP:-darkflame}
|
||||||
volumes:
|
volumes:
|
||||||
- ${CLIENT_PATH:?err}:/client
|
- ${CLIENT_PATH:?err}:/client
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -82,6 +85,6 @@ services:
|
|||||||
|
|
||||||
networks:
|
networks:
|
||||||
darkflame:
|
darkflame:
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
database:
|
database:
|
||||||
|
@ -33,7 +33,7 @@ ARG BUILD_VERSION=171022
|
|||||||
RUN echo "Build server" && \
|
RUN echo "Build server" && \
|
||||||
mkdir -p build && \
|
mkdir -p build && \
|
||||||
cd build && \
|
cd build && \
|
||||||
sed -i -e "s/171022/${BUILD_VERSION}/g" ../CMakeVariables.txt && \
|
sed -i -e "s/171022/${BUILD_VERSION}/g" ../CMakeVariables.txt && \
|
||||||
cmake .. && \
|
cmake .. && \
|
||||||
make -j $BUILD_THREADS
|
make -j $BUILD_THREADS
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ RUN unzip /build/resources/navmeshes.zip -d /build/build/res/maps
|
|||||||
|
|
||||||
FROM gcc:11 as runtime
|
FROM gcc:11 as runtime
|
||||||
|
|
||||||
RUN --mount=type=cache,id=runtime-apt-cache,target=/var/cache/apt \
|
RUN --mount=type=cache,id=runtime-apt-cache,target=/var/cache/apt \
|
||||||
apt update && \
|
apt update && \
|
||||||
apt install mariadb-client python3 sudo sqlite3 -yqq --no-install-recommends && \
|
apt install mariadb-client python3 sudo sqlite3 -yqq --no-install-recommends && \
|
||||||
apt remove -y libmysqlcppconn7v5 libmysqlcppconn-dev && \
|
apt remove -y libmysqlcppconn7v5 libmysqlcppconn-dev && \
|
||||||
@ -61,4 +61,6 @@ COPY docker/start_server.sh /start_server.sh
|
|||||||
|
|
||||||
RUN chmod +x /start_server.sh
|
RUN chmod +x /start_server.sh
|
||||||
|
|
||||||
|
RUN mkdir /app/logs
|
||||||
|
|
||||||
CMD [ "/start_server.sh" ]
|
CMD [ "/start_server.sh" ]
|
@ -12,6 +12,7 @@ function set_defaults() {
|
|||||||
|
|
||||||
CHAT_SERVER_PORT=${CHAT_SERVER_PORT:-2005}
|
CHAT_SERVER_PORT=${CHAT_SERVER_PORT:-2005}
|
||||||
MAX_CLIENTS=${MAX_CLIENTS:-999}
|
MAX_CLIENTS=${MAX_CLIENTS:-999}
|
||||||
|
EXTERNAL_IP=${EXTERNAL_IP:-localhost}
|
||||||
|
|
||||||
echo "Start server with configuration:"
|
echo "Start server with configuration:"
|
||||||
echo "===== Database Config ========="
|
echo "===== Database Config ========="
|
||||||
@ -23,6 +24,7 @@ function set_defaults() {
|
|||||||
echo "===== Other settings =========="
|
echo "===== Other settings =========="
|
||||||
echo "Chat server port: $CHAT_SERVER_PORT"
|
echo "Chat server port: $CHAT_SERVER_PORT"
|
||||||
echo "Max clients: $MAX_CLIENTS"
|
echo "Max clients: $MAX_CLIENTS"
|
||||||
|
echo "External IP: $EXTERNAL_IP"
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_sql_connection() {
|
function check_sql_connection() {
|
||||||
@ -46,7 +48,7 @@ function update_database_ini_values_for() {
|
|||||||
update_ini $INI_FILE mysql_username $DATABASE_USER
|
update_ini $INI_FILE mysql_username $DATABASE_USER
|
||||||
update_ini $INI_FILE mysql_password $DATABASE_PASSWORD
|
update_ini $INI_FILE mysql_password $DATABASE_PASSWORD
|
||||||
if [[ "$INI_FILE" != "worldconfig.ini" ]]; then
|
if [[ "$INI_FILE" != "worldconfig.ini" ]]; then
|
||||||
update_ini $INI_FILE external_ip "darkflame"
|
update_ini $INI_FILE external_ip $EXTERNAL_IP
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,29 +66,25 @@ function symlink_client_files() {
|
|||||||
ln -s /client/client/res/macros/ /app/res/macros
|
ln -s /client/client/res/macros/ /app/res/macros
|
||||||
ln -s /client/client/res/BrickModels/ /app/res/BrickModels
|
ln -s /client/client/res/BrickModels/ /app/res/BrickModels
|
||||||
ln -s /client/client/res/chatplus_en_us.txt /app/res/chatplus_en_us.txt
|
ln -s /client/client/res/chatplus_en_us.txt /app/res/chatplus_en_us.txt
|
||||||
|
ln -s /client/client/res/maps/ /app/res/maps
|
||||||
ln -s /client/client/res/names/ /app/res/names
|
ln -s /client/client/res/names/ /app/res/names
|
||||||
ln -s /client/client/locale/locale.xml /app/locale/locale.xml
|
ln -s /client/client/locale/locale.xml /app/locale/locale.xml
|
||||||
(
|
|
||||||
cd /client/client/res/maps
|
|
||||||
readarray -d '' entries < <(printf '%s\0' * | sort -zV)
|
|
||||||
for entry in "${entries[@]}"; do
|
|
||||||
ln -s /client/client/res/maps/$entry /app/res/maps/
|
|
||||||
done
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function fdb_to_sqlite() {
|
function fdb_to_sqlite() {
|
||||||
echo "Run fdb_to_sqlite"
|
echo "Run fdb_to_sqlite"
|
||||||
python3 /app/utils/fdb_to_sqlite.py /client/client/res/CDClient.fdb --sqlite_path /app/res/CDServer.sqlite
|
python3 /app/utils/fdb_to_sqlite.py /client/client/res/cdclient.fdb --sqlite_path /client/client/res/CDServer.sqlite
|
||||||
|
|
||||||
(
|
(
|
||||||
cd /app/migrations/cdserver
|
cd /app/migrations/cdserver
|
||||||
readarray -d '' entries < <(printf '%s\0' *.sql | sort -zV)
|
readarray -d '' entries < <(printf '%s\0' *.sql | sort -zV)
|
||||||
for entry in "${entries[@]}"; do
|
for entry in "${entries[@]}"; do
|
||||||
echo "Execute $entry"
|
echo "Execute $entry"
|
||||||
sqlite3 /app/res/CDServer.sqlite < $entry
|
sqlite3 /client/client/res/CDServer.sqlite < $entry
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ln -s /client/client/res/CDServer.sqlite /app/res/CDServer.sqlite
|
||||||
}
|
}
|
||||||
|
|
||||||
set_defaults
|
set_defaults
|
||||||
|
Loading…
Reference in New Issue
Block a user