├── .gitattributes ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md └── bootstrap.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at support@thepool.life. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 DirtyHarryDev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Dirty Harry`s YiiMP Server Installer ! 2 | 3 | ## This is opened as a public repo - all features are not final! 4 | 5 | All in one installer for your yiimp server. 6 | 7 | **Dirty Harry YiiMP Server Installer! ** Automates most of the tedious tasks of the following releases: 8 | 9 | * YiiMP 10 | 11 | 12 | ## ▶️ Table Of Contents 13 | 14 | - [Installation](#-installation) 15 | - [Usage](#-usage) 16 | - [YiiMP Single Server Install](#-yiimp-single-server-install) 17 | - [Commands](#-commands) 18 | - [YiiMP Multi-Server Install](#-yiimp-multi-server-install) 19 | - [Credits](#-credits) 20 | - [License](#-license) 21 | 22 | 23 | ## ▶️ Installation 24 | 25 | Installation: 26 | 27 | Requires a fresh Ubuntu 16.04 or Ubuntu 18.04 installation. 28 | 29 | ``` 30 | curl https://raw.githubusercontent.com/DirtyHarryDev/Yiimp-Server-Installer/master/bootstrap.sh | bash 31 | ``` 32 | 33 | 34 | ## ▶️ Usage 35 | 36 | You may run the installer under root or an existing account. If you already have a user account created on your server that account must already be part of the sudo group. 37 | 38 | If you are running as root the installer will prompt you to create a new account. 39 | 40 | After creating the new user account or updating your existing account, you MUST reboot the machine in order for the accounts permissions to be updated properly. 41 | 42 | After rebooting the server to your user to start the installer type: 43 | ``` 44 | yiimpserver 45 | ``` 46 | 47 | ## YiiMP Single Server Install 48 | 49 | The Yiimp Single Server Install is recommend for private or very small pools. It is recommended to have at least 4GB ram in order to function properly. 50 | Setup is automated after the following questions are answered: 51 | 52 | Question | Default | Help 53 | :--|:-:|:-- 54 | Are you using a domain name | no | If you plan to use something like example.com, make sure DNS is updated 55 | Are you using a sub-domain as the main domain | no | If you plan to use something like pool.example.com 56 | Domain Name | localhost | Change to your domain either example.com or pool.example.com 57 | Stratum Domain | stratum.domain.name | This should be something other then your domain name 58 | Install SSL | yes | Installs a 90 day cert from LetsEncrypt 59 | Support Email | root@localhost | Used to send you system alerts 60 | Your Public IP | pulls ip last used to acess web server | To verify go to http://www.whatsmyip.org 61 | DB Root Password | autogenerated 36 character password | Default mysql root password 62 | DB Panel User Password | autogenerated 36 character password | Default mysql frontend password 63 | DB Stratum Password | autogenerated 36 character password | Default mysql stratum password 64 | Admin Portal Access Location | AdminPortal | to access example.com/site/AdminPortal 65 | 66 | Installation will take about 25 minutes to fully complete. You will get a message on the screen letting you know it has finished. 67 | 68 | #### A server reboot is REQUIRED after the installer is completed to finalize the installation process! 69 | 70 | #### On first reboot it may take up to 10 minutes before the cron screens auto-start. After waiting ten minutes type: 71 | ``` 72 | motd 73 | ``` 74 | #### To help make your server more secure we have changed the install locations and directory structure of YiiMP as follows: 75 | 76 | Directory | Files 77 | :--|:-: 78 | /home/yiimp-data/yiimp | General install location for YiiMP 79 | /home/yiimp-data/yiimp/starts | screens and stratum sh files - you do not need to run these 80 | /home/yiimp-data/yiimp/site | - 81 | /home/yiimp-data/yiimp/site/web | New location for YiiMP web files 82 | /home/yiimp-data/yiimp/site/backup | backup location for mysql DB 83 | /home/yiimp-data/yiimp/site/configuration | New location of your serverconfig.php 84 | /home/yiimp-data/yiimp/site/crons | New location of the `main:blocks:loop2` sh files 85 | /home/yiimp-data/yiimp/site/log | New location for debug.log and your nginx server log 86 | /home/yiimp-data/yiimp/site/stratum | New location for your stratum files 87 | /home/yiimp-data/wallets | New location for wallets 88 | 89 | Permissions have been setup correctly allowing your main user write acess to the /home/yiimp-data directories! Changing file or directory permissions after install will cause your YiiMP to not function correctly, you have been warned!! 90 | 91 | By default even though all stratum algos start on server start, the ports have been blocked by the firewall. To open a port type: 92 | ``` 93 | sudo ufw allow port number 94 | ``` 95 | From there your YiiMP Single Server installation is fully completed. You can now go to example.com/site/AdminPortal to access your admin section and start adding your coins. 96 | 97 | 98 | #### ▶️ Commands 99 | 100 | To view a screen type: 101 | ``` 102 | screen -r main|loop2|blocks|debug 103 | ``` 104 | To detach from a screen type: 105 | ``` 106 | ctrl+a+d 107 | ``` 108 | To start, stop or restart main|loop2|blocks|debug type: 109 | ``` 110 | screens start|stop|restart main|loop2|blocks|debug 111 | ``` 112 | We also suggest that you type: 113 | ``` 114 | yiimp 115 | ``` 116 | and get to know those commands as well! 117 | 118 | 119 | ## ▶️ YiiMP Multi-Server Install 120 | 121 | The YiiMP Multi-Server Install is recommended for those that want to run larger public pools. This offers the most security and is a lot more complex on the setup. 122 | 123 | The following two tables show you the perfered server setup for the multi-server setup: 124 | 125 | Role | OS Version | Recommended Ram 126 | :--|:--|:-: 127 | Web Server | Ubuntu 16.04 or Ubuntu 18.04 | 2GB 128 | DB & Stratum Server | Ubuntu 16.04 or Ubuntu 18.04 | 16GB 129 | Daemon Server | Ubuntu 16.04 or Ubuntu 18.04 | 8GB+ 130 | 131 | or 132 | 133 | Role | OS Version | Recommended Ram 134 | :--|:--|:-: 135 | Web Server | Ubuntu 16.04 or Ubuntu 18.04 | 2GB 136 | DB Server | Ubuntu 16.04 or Ubuntu 18.04 | 2GB 137 | Stratum Server | Ubuntu 16.04 or Ubuntu 18.04 | 8GB 138 | Daemon Server | Ubuntu 16.04 or Ubuntu 18.04 | 8GB+ 139 | 140 | It is also highly recommended to use a provider that offers private IP's between your servers. If your provider only offers public IP's you must install Wireguard (Installer provided). This will setup a secure VPN connection between your servers for the backend communication. 141 | 142 | #### If installing wireguard do not modify the default private IP's that are provide. Installation will fail! 143 | 144 | Just like with the single server install there must be a user account created. If you attempt to run the script under root, it will force you to create a new user account and log in to it. 145 | 146 | After the user accounts are created on each server, setup MUST begin on the server that is hosting your database. You do not need to run the installer individually on each server. 147 | 148 | #### During the setup process you will be prompted to enter the user name and password for each of your servers. This is required for the installer to be able to SSH in to each server to perform the installation tasks on that server. 149 | 150 | Installation will take about 25 minutes to fully complete. You will get a message on the screen letting you know it has finished. 151 | 152 | #### A server reboot is REQUIRED after the installer is completed to finalize the installation process! 153 | 154 | #### On first reboot it may take up to 1 minute before the cron screens auto-start. After waiting one minute type: 155 | ``` 156 | motd 157 | ``` 158 | 159 | #### To help make your server more secure we have changed the install locations and directory structure of YiiMP as follows: 160 | 161 | Directory | Files | Server 162 | :--|:-:|:-- 163 | /home/yiimp-data/yiimp | General install location for YiiMP | All 164 | /home/yiimp-data/yiimp/starts | screens and stratum sh files - you do not need to run these | Web and Stratum 165 | /home/yiimp-data/yiimp/site | - | Web and Stratum 166 | /home/yiimp-data/yiimp/site/web | New location for YiiMP web files | Web 167 | /home/yiimp-data/yiimp/site/backup | backup location for mysql DB | Web 168 | /home/yiimp-data/yiimp/site/configuration | New location of your serverconfig.php | Web 169 | /home/yiimp-data/yiimp/site/crons | New location of the `main:blocks:loop2` sh files | Web 170 | /home/yiimp-data/yiimp/site/log | New location for debug.log and your nginx server log | Web 171 | /home/yiimp-data/yiimp/site/stratum | New location for your stratum files | Stratum 172 | /home/yiimp-data/wallets | New location for wallets | Daemon 173 | 174 | 175 | Permissions have been setup correctly allowing your main user write acess to the /home/yiimp-data directories! Changing file or directory permissions after install will cause your YiiMP to not function correctly, you have been warned!! 176 | 177 | By default even though all stratum algos start on server start, the ports have been blocked by the firewall. To open a port type: 178 | ``` 179 | sudo ufw allow port number 180 | ``` 181 | You MUST also open the RPC Port number on the daemon server when adding new coins. Failing to open the port will result in a connection time out error. 182 | 183 | From there your YiiMP Multi Server installation is fully completed. You can now go to example.com/site/AdminPortal to access your admin section and start adding your coins. 184 | 185 | #### 🔗 Commands 186 | 187 | To view a screen type: 188 | ``` 189 | screen -r main|loop2|blocks|debug 190 | ``` 191 | To detach from a screen type: 192 | ``` 193 | ctrl+a+d 194 | ``` 195 | To start, stop or restart main|loop2|blocks|debug type: 196 | ``` 197 | screens start|stop|restart main|loop2|blocks|debug 198 | ``` 199 | We also suggest that you type: 200 | ``` 201 | yiimp 202 | ``` 203 | and get to know those commands as well! 204 | 205 | 206 | ## ▶️ Credits 207 | 208 | The following GitHubs have been a source of inspiration and code: 209 | 210 | * [mailinabox](https://github.com/mail-in-a-box/mailinabox) 211 | * [realeas-it](https://github.com/webpro/release-it) 212 | * [cryptopool.builders](https://github.com/cryptopool-builders) 213 | * [Kudaraidee](https://github.com/Kudaraidee) 214 | 215 | The following forks have been used in the making of the script: 216 | 217 | * [YiiMP](https://github.com/tpruvot/yiimp) 218 | 219 | 220 | ## ▶️ License 221 | 222 | [MIT](http://webpro.mit-license.org/) 223 | 224 | 225 | ## ▶️ Support 226 | 227 | Join our active discord channel: 228 | 229 | https://discord.gg/myUAcrgNfc 230 | -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ########################################################################################################### 4 | # Source https://mailinabox.email/ https://github.com/mail-in-a-box/mailinabox # 5 | # Updated by Dirty Harry for crypto use... # 6 | # This script is intended to be run like this: # 7 | # # 8 | # curl https://raw.githubusercontent.com/DirtyHarryDev/Yiimp-Server-Installer/master/bootstrap.sh | bash # 9 | # # 10 | ########################################################################################################### 11 | 12 | 13 | # Clone the Yiimp Server repository if it doesn't exist. 14 | 15 | echo Installing git . . . 16 | apt-get -q -q update 17 | apt-get -q -q install -y git < /dev/null 18 | echo 19 | 20 | echo Downloading Yiimp Server Installer v1.0. . . 21 | git clone https://github.com/DirtyHarryDev/yiimp_server_setup "$HOME"/yiimpserver/install < /dev/null 2> /dev/null 22 | echo 23 | 24 | # Start setup script. 25 | bash $HOME/yiimpserver/install/start.sh 26 | --------------------------------------------------------------------------------