Compare commits
10 Commits
b146e9d730
...
main
Author | SHA1 | Date | |
---|---|---|---|
ba2807a8f8 | |||
3ea80eda6c | |||
b53c19929a | |||
d4f49c7637 | |||
f4aae5f578 | |||
66a1ce279e | |||
cfe1d1a2b6 | |||
ac2fde70c7 | |||
3b4cd5c128 | |||
a3b780efe0 |
@@ -1,3 +1,4 @@
|
||||
.git
|
||||
SabrehavenServer.tar.gz
|
||||
ZnoteAAC.tar.gz
|
||||
pma_install.sh.bak
|
||||
|
9
2do.txt
Normal file
9
2do.txt
Normal 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.
|
@@ -9,10 +9,13 @@ GRANT ALL PRIVILEGES ON forgottenserver.* TO 'forgottenserver'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
-- forgottenserver database schema installation
|
||||
SOURCE '/home/tibia/SabrehavenServer/sabrehaven.sql';
|
||||
USE forgottenserver;
|
||||
SOURCE /home/tibia/SabrehavenServer/sabrehaven.sql;
|
||||
|
||||
-- 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
|
||||
SOURCE '/home/tibia/SabrehavenServer/sabrehaven_znote.sql';
|
||||
USE forgottenserver;
|
||||
SOURCE /home/tibia/SabrehavenServer/sabrehaven_znote.sql;
|
2
app/1mindeploy/DBCI.sh
Normal file
2
app/1mindeploy/DBCI.sh
Normal 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
4
app/1mindeploy/entrypoint.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
service mariadb start > /dev/null 2>&1
|
||||
service apache2 start > /dev/null 2>&1
|
||||
/bin/sh
|
24
app/1mindeploy/phpmyadmin.conf
Normal file
24
app/1mindeploy/phpmyadmin.conf
Normal 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
37
app/1mindeploy/pma_install.sh
Executable 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."
|
5
app/1mindeploy/znoteaac-virtualhost-install.sh
Normal file
5
app/1mindeploy/znoteaac-virtualhost-install.sh
Normal 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
|
16
app/1mindeploy/znoteaac.conf
Normal file
16
app/1mindeploy/znoteaac.conf
Normal 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
|
@@ -30,13 +30,13 @@
|
||||
// ------------------------ \\
|
||||
|
||||
// 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:
|
||||
$config['sqlPassword'] = 'tfs13';
|
||||
$config['sqlPassword'] = 'forgotten';
|
||||
|
||||
// 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.
|
||||
$config['sqlHost'] = '127.0.0.1';
|
||||
@@ -637,7 +637,7 @@
|
||||
|
||||
// What client version and server port are you using on this OT?
|
||||
// Used for the Downloads page.
|
||||
$config['client'] = 1098; // 954 = client 9.54
|
||||
$config['client'] = 792; // 954 = client 9.54
|
||||
|
||||
// Download link to client.
|
||||
$config['client_download'] = 'http://tibiaclient.otslist.eu/download/tibia'. $config['client'] .'.exe';
|
||||
|
29
dockerfile
29
dockerfile
@@ -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 --mount=type=cache,target=/var/cache/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 echo "tibia:tibia" | chpasswd
|
||||
RUN chown -R tibia:tibia /home/tibia
|
||||
#USER 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
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
ENV TIBIA_VERSION="8.0"
|
||||
ENV BIND_ONLY_GLOBAL_ADDRESS="false"
|
||||
ENV PUBLIC_IP="127.0.0.1"
|
||||
ENV LOGIN_PROTOCOL_PORT="7171"
|
||||
ENV GAME_PROTOCOL_PORT="7172"
|
||||
ENV STATUS_PROTOCOL_PORT="7171"
|
||||
|
Reference in New Issue
Block a user