Compare commits

..

10 Commits

Author SHA1 Message Date
ba2807a8f8 Fix deployment 2025-03-04 20:24:34 +01:00
3ea80eda6c Nu 2do 2025-02-27 21:35:31 +01:00
b53c19929a Hard-code DB credentials to ZnoteAAC 2025-02-27 21:34:35 +01:00
d4f49c7637 Install php-apcu module 2025-02-27 21:16:09 +01:00
f4aae5f578 Install Apache2 ZnoteAAC virtual host 2025-02-27 21:10:59 +01:00
66a1ce279e Added hardcodded pw 2025-02-27 20:47:36 +01:00
cfe1d1a2b6 Install and configure PMA 2025-02-27 20:38:49 +01:00
ac2fde70c7 PMA Conf 2025-02-27 20:16:26 +01:00
3b4cd5c128 Major upgrade and refactor 2025-02-27 20:12:11 +01:00
a3b780efe0 Fix dir path 2025-02-27 15:24:23 +01:00
13 changed files with 127 additions and 17 deletions

View File

@@ -1,3 +1,4 @@
.git .git
SabrehavenServer.tar.gz SabrehavenServer.tar.gz
ZnoteAAC.tar.gz ZnoteAAC.tar.gz
pma_install.sh.bak

9
2do.txt Normal file
View File

@@ -0,0 +1,9 @@
2do list:
Critical:
- When phpmyadmin install-script generates a password, it doesnt match with the password stored in '/etc/phpmyadmin/config-db.php'.
Refactor:
- Remove phpmyadmin dependencies written in install-script. Dependencies should be in the dockerfile. (Also make a copy of the original script).
- Check for more phpmyadmin errors. Proper php.ini tweaking?
- Tweak /var/www/ZnoteAAC/config.php properly.

View File

@@ -9,10 +9,13 @@ GRANT ALL PRIVILEGES ON forgottenserver.* TO 'forgottenserver'@'localhost';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
-- forgottenserver database schema installation -- forgottenserver database schema installation
SOURCE '/home/tibia/SabrehavenServer/sabrehaven.sql'; USE forgottenserver;
SOURCE /home/tibia/SabrehavenServer/sabrehaven.sql;
-- ZnoteAAC database schema installation -- ZnoteAAC database schema installation
SOURCE '/var/www/ZnoteAAC/engine/database/znote_schema.sql'; USE forgottenserver;
SOURCE /var/www/ZnoteAAC/engine/database/znote_schema.sql;
-- Install sabrehaven_znote.sql for Sabrehaven usage -- Install sabrehaven_znote.sql for Sabrehaven usage
SOURCE '/home/tibia/SabrehavenServer/sabrehaven_znote.sql'; USE forgottenserver;
SOURCE /home/tibia/SabrehavenServer/sabrehaven_znote.sql;

2
app/1mindeploy/DBCI.sh Normal file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
mariadb -u root < '/home/tibia/1mindeploy/DATABASE_CREATION_AND_INSTALLATION.sql'

4
app/1mindeploy/entrypoint.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
service mariadb start > /dev/null 2>&1
service apache2 start > /dev/null 2>&1
/bin/sh

View File

@@ -0,0 +1,24 @@
# phpMyAdmin default Apache configuration
Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
Options SymLinksIfOwnerMatch
DirectoryIndex index.php
# limit libapache2-mod-php to files and directories necessary by pma
<IfModule mod_php7.c>
php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
php_admin_value open_basedir /usr/share/phpmyadmin/:/usr/share/doc/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/:/usr/share/javascript/
</IfModule>
</Directory>
# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/templates>
Require all denied
</Directory>
<Directory /usr/share/phpmyadmin/libraries>
Require all denied
</Directory>

37
app/1mindeploy/pma_install.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
# Ensure the script runs with root privileges
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Update package list and install necessary packages
apt-get update
apt-get install -y mariadb-server
service mariadb start
###
# Set debconf to non-interactive mode
export DEBIAN_FRONTEND=noninteractive
# Set the phpMyAdmin password (leave blank for random password)
PHPADMIN_PASSWORD=""
# Set the web server (1 for apache2, 2 for lighttpd)
WEB_SERVER="apache2"
# Preconfigure the phpMyAdmin installation
echo "phpmyadmin phpmyadmin/dbconfig-install boolean true" | debconf-set-selections
echo "phpmyadmin phpmyadmin/app-password-confirm password $PHPADMIN_PASSWORD" | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/admin-pass password" | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/app-pass password $PHPADMIN_PASSWORD" | debconf-set-selections
echo "phpmyadmin phpmyadmin/reconfigure-webserver select $WEB_SERVER" | debconf-set-selections
# Install phpMyAdmin
apt install -y phpmyadmin
# If using apache2, restart the apache2 service (adjust if using other web servers)
service apache2 restart
echo "phpMyAdmin installation completed successfully."

View File

@@ -0,0 +1,5 @@
#!/bin/bash
cp /home/tibia/1mindeploy/znoteaac.conf /etc/apache2/sites-available/
a2dissite 000-default.conf
a2ensite znoteaac.conf
service apache2 reload

View File

@@ -0,0 +1,16 @@
<VirtualHost *:80>
Alias /znoteaac /var/www/ZnoteAAC
ServerAdmin webmaster@localhost
DocumentRoot /var/www/ZnoteAAC
<Directory /var/www/ZnoteAAC>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/znoteaac-error.log
CustomLog ${APACHE_LOG_DIR}/znoteaac-access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

View File

@@ -30,13 +30,13 @@
// ------------------------ \\ // ------------------------ \\
// phpmyadmin username for OT server: (DONT USE "root" if you are hosting to public). // phpmyadmin username for OT server: (DONT USE "root" if you are hosting to public).
$config['sqlUser'] = 'tfs13'; $config['sqlUser'] = 'forgottenserver';
// phpmyadmin password for OT server: // phpmyadmin password for OT server:
$config['sqlPassword'] = 'tfs13'; $config['sqlPassword'] = 'forgotten';
// The database name to connect to. (This is usually same as username). // The database name to connect to. (This is usually same as username).
$config['sqlDatabase'] = 'tfs13'; $config['sqlDatabase'] = 'forgottenserver';
// Hostname is usually localhost or 127.0.0.1. // Hostname is usually localhost or 127.0.0.1.
$config['sqlHost'] = '127.0.0.1'; $config['sqlHost'] = '127.0.0.1';
@@ -637,7 +637,7 @@
// What client version and server port are you using on this OT? // What client version and server port are you using on this OT?
// Used for the Downloads page. // Used for the Downloads page.
$config['client'] = 1098; // 954 = client 9.54 $config['client'] = 792; // 954 = client 9.54
// Download link to client. // Download link to client.
$config['client_download'] = 'http://tibiaclient.otslist.eu/download/tibia'. $config['client'] .'.exe'; $config['client_download'] = 'http://tibiaclient.otslist.eu/download/tibia'. $config['client'] .'.exe';

View File

@@ -2,23 +2,32 @@ FROM debian:bullseye
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update && apt-get upgrade -y && apt-get install -y git cmake build-essential libluajit-5.1-dev libmariadb-dev-compat libboost-date-time-dev libboost-system-dev libboost-iostreams-dev libpugixml-dev libcrypto++-dev libfmt-dev zlib1g-dev libgmp-dev libboost-all-dev curl iproute2 apt update && apt-get upgrade -y && apt-get install -y git cmake build-essential libluajit-5.1-dev libmariadb-dev-compat libboost-date-time-dev libboost-system-dev libboost-iostreams-dev libpugixml-dev libcrypto++-dev libfmt-dev zlib1g-dev libgmp-dev libboost-all-dev curl iproute2 apache2 mariadb-client mariadb-server bash-completion vim php php-apcu
RUN useradd -m -s /bin/bash tibia RUN useradd -m -s /bin/bash tibia
RUN echo "tibia:tibia" | chpasswd RUN echo "tibia:tibia" | chpasswd
RUN chown -R tibia:tibia /home/tibia
#USER tibia
WORKDIR /home/tibia WORKDIR /home/tibia
COPY app/ZnoteAAC /var/www/ZnoteAAC
COPY app/SabrehavenServer /home/tibia/SabrehavenServer
COPY app/1mindeploy /home/tibia/1mindeploy
RUN chown -R tibia:tibia /home/tibia && chown -R www-data:www-data /var/www/ZnoteAAC
COPY app /home/tibia RUN chown -R tibia:tibia /home/tibia && chmod a+x /home/tibia/1mindeploy/*.sh && service mariadb start && /home/tibia/1mindeploy/DBCI.sh && /home/tibia/1mindeploy/pma_install.sh && /home/tibia/1mindeploy/znoteaac-virtualhost-install.sh
ENTRYPOINT ["/home/tibia/1mindeploy/entrypoint.sh"]
#RUN mv SabrehavenServer /home/tibia USER root
#USER tibia
ENV TIBIA_VERSION="7.92"
ENV DB_USER="forgottenserver"
ENV DB_PASSWORD="forgotten"
ENV DB_DATABASE="forgottenserver"
ENV MYSQLSOCK="/run/mysqld/mysqld.sock"
#RUN chown -R tibia:tibia /home/tibia/SabrehavenServer ENV BIND_ONLY_GLOBAL_ADDRESS="false"
ENV PUBLIC_IP="127.0.0.1"
ENTRYPOINT ["/bin/bash"] ENV LOGIN_PROTOCOL_PORT="7171"
ENV GAME_PROTOCOL_PORT="7172"
ENV TIBIA_VERSION="8.0" ENV STATUS_PROTOCOL_PORT="7171"