Only for the first time starting your local instance of RO, you must build the Image for Docker:
docker build -t hercules-docker .
Then start it up with:
docker-compose up
Fix User permissions and create a unique admin profile for phpmyadmin.
-
Access the sql server through the docker terminal:
database
-
Log in to mySQL with root
mysql -u
(empty password is allowed, as set on line 73 in thedocker-compose
file) -
mysql -u
-
SHOW DATABASES;
// sanity check I'm in the right terminal/db instance -
CREATE USER 'admin'@'%' IDENTIFIED BY 'admin';
-
GRANT ALL PRIVILEGES ON * . * TO 'admin'@'%' WITH GRANT OPTION;
-
FLUSH PRIVILEGES;
I used PHPMYADMIN to set up the tables because I don't know SQL syntax very well.
Log in as your new superadmin to phpmyadmin.
- Phpmyadmin should be running on
localhost:8081
as soon as youdocker compose up
- Copy contents of
main.sql
andlogs.sql
The rest of the .sql files are referenced internally by the engine, so is not required that you import them for Hercules to run, but is great for website databases of your mobs and whatnot. :)
Grant all privileges to the ragnarok
user while you are in here, to prevent issues with the user hercules needs to read/write
Now you can log into the app container and create a user for non-root execution of the emulator. Hercules gets VERY angry at you if you try to tell him what to do with more authority than he has. :)
- login to terminal of container
sandbox-game_servers
- add new user with the password something simple, like 'admin'
useradd --create-home --shell /bin/bash hercules1 && passwd hercules1
- set your password
- chmod the entire hercules directory now to avoid permission denied issues later.
chmod 777 -R app/hercules
The PACKETVER must match what the client you intend to use is Hexed to! Don't change it unless you can Hex a new client. :| As of this writing, all of those DiffPatchers have done extinct.
CLIENT PACKET VERSION: 20190605
This must be explicitly set to work with the client provided. Otherwise you have to figure out how to get another hexed client. ...
- login as your non-root user before configuring.
login hercules1
cd app/hercules && ./configure --enable-packetver=20190605
make clean
(optional) andmake sql
to set up SQL configurations from confs
./athena-start start
Since this is meant to be a 'fixed' image of this game, updating shouldn't really be necessary.
- Hercules Github: https://github.com/HerculesWS/Hercules
- Copy the config files from
/config-templates/import-tmpl
to/app/hercules/conf/import
. This is where all of the server connection and other settings are stored.
Clone this as your nonroot user, or before continuing or if you have permission denied errors.
Login as the nonroot user in another terminal window to continue with the configuration and setup.
I had all kinds of issues getting the athena-start
script to run, and learned all about sh
, dash
, bash
being different versions of the same utility that isn't always installed in the same place depending on your Linux version. &^$#^#$%@!!! >:[
'Fixed' by making sure the linux/dos line endings were correct:
tr -d '\r' < athena-start.sh > athena-start_u.sh
This was mostly due to some 'feature' with the mysql container setup in docker-compose creating the default user with no permissions.
Checking privileges for the sql users
$ mysql -u root -p -h database
$ mysql -u ragnarok -p -h database
mysql> show grants for 'ragnarok'@'database';
mysql
CREATE USER 'admin'@'%' IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON * . * TO 'admin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
- Hercules Support Team for keeping Athena alive for another 10+ years!!