Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.
Anily-twPublic archive

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

35 Commits

Folders and files

Repository files navigation

Anily scripts

This is main part of Anily infrastructure.

Setting up

  1. Clone scripts
$ git clone https://github.com/Anily-tw/scripts.git servers
$ cd ~/servers
  1. Edit enviroment variables for preffered
$ nano ~/servers/set_enviroment.sh
  1. Create python-venv for python scripts
$ sudo apt-get install python3-full
$ python3 -m venv script-venv
  1. Install needed packages
$ source ~/script-venv/bin/activate
$ pip install requests mysql-connector-python nextcord watchdog
  1. Make Bash/Zsh use Anily enviroment by default
$ echo "source ~/servers/set_enviroment.sh" >> ~/.bashrc
$ echo "echo \"Loaded Anily enviroment\"" >> ~/.bashrc
$ echo "source ~/servers/script-venv/bin/activate" >> ~/.bashrc
$ echo "echo \"Loaded Python venv enviroment\"" >> ~/.bashrc

Database

If you already have SQL dump, just import it and specify credentials in set_enviroment.sh and ddrace/mysql.cfg

If you don't have SQL dump, create new scheme, specify it in set_enviroment.sh and ddrace/mysql.cfg, and set last argument of add_sqlserver to 1 Like this:

add_sqlserver r teeworlds record teeworlds "superPass" "localhost" "3306" 1
add_sqlserver w teeworlds record teeworlds "superPass" "localhost" "3306" 1
                ^ scheme name                                             ^ 1 to setup database
  • Don't forget to set it back to 0 after first start

Crontab

crontab file contains my crontab routine for restarting servers and uploading maps to repository. To make map updating work, you need to change remote in ddrace/maps and configure git to store your credentials.

Permissions

I use web interface for uploading and updating maps. It's working on apache2, so www-data user does not have permissions to needed directories. I create group ddrace:

$ sudo addgroup ddrace

Add there $USER and www-data:

$ sudo usermod -aG ddrace $USER
$ sudo usermod -aG ddrace www-data

Set servers's owner to $USER:ddrace:

$ sudo chown -R --changes "$USER:ddrace" -- servers

Give group permissions:

$ sudo chmod -R --changes "a-x,ug=rwX,o=rX" -- servers

Servers

To run the servers themselves you need server executable placed at ddrace root, or clone ddnet next to ddrace directory and specify path in set_enviroment.sh, then use ddrace/update.sh.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages