├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── Vagrantfile ├── civcraft_dev └── namelayer-git.sh ├── puppet ├── manifests │ └── site.pp ├── modules │ └── .README └── third-party │ └── .README ├── scripts ├── minecraft │ ├── control.sh │ └── get_and_start_vanilla.sh └── spigot │ └── get_and_build_spigot.sh └── vagrant_cleanup.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant/ 2 | **/*.jar 3 | /minecraft 4 | /spigot 5 | ext.vdi 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Daniel Boston 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 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # civcraft-vm 2 | Virtual Machine appliance using Vagrant and puppet to auto provision a Civcraft-compatible testing machine 3 | 4 | --------- 5 | 6 | **DISCLAIMER:** Use of this VM appliance indicates you agree with Minecraft's EULA! If you don't, or don't know what I'm talking about, don't use this VM appliance until you do, and can agree with it. 7 | 8 | ---------------- 9 | 10 | My target for this is to get as far along the path to having a working, running Civcraft server at the end of the script as possible. What I have so far: 11 | 12 | 1. Basic VM provisioning 13 | 14 | 2. Java and other dependency installations (git, maven) 15 | 16 | 3. Minecraft server install 17 | 18 | 4. Minecraft server startup 19 | 20 | 5. Spigot server download 21 | 22 | 6. Spigot server replace Minecraft 23 | 24 | with the core mods being in the hands of the developer -- for now. That's next. 25 | 26 | I'll likely also add here *first* some how-tos in terms of getting mods set up that play nice with the server, and will submit refined versions to go in Dr_Jawa and/or Erocs' guides. 27 | 28 | -------------------------- 29 | 30 | ## How to use this appliance 31 | 32 | 1. Get git: https://git-scm.com/downloads 33 | 34 | 2. Get Vagrant: https://www.vagrantup.com/downloads.html 35 | 36 | 3. Get VirtualBox: http://download.virtualbox.org/virtualbox/ 37 | 38 | * (check LATEST.TXT for which to download) 39 | 40 | * Note that if you are running Windows 8, be warned that installing VirtualBox's bridge adapter may [break standby and Windows 8 Fast Shutdown](http://www.reddit.com/r/Civcraft/comments/38nrd2/morning_changelog_20150605/crwvoqc). 41 | 42 | 4. Install git (or one of the many GUI clients, ya wuss) 43 | 44 | 5. Install Vagrant (may require restart) 45 | 46 | 6. Install VirtualBox (will disconnect your internet, so log off Civcraft) 47 | 48 | 7. Clone this repository locally: `git clone git@github.com:ProgrammerDan/civcraft-vm.git` 49 | 50 | 8. cd into that repository: cd civcraft-vm 51 | 52 | 9. Issue `vagrant up`. Note, this will take *a long time* so go do other things while waiting. 53 | 54 | 10. SSH into vagrant: `vagrant@127.0.0.1:2222` default password `vagrant` 55 | 56 | 11. Until automated, seek out other resources for setting up Civcraft. 57 | 58 | ---------------------- 59 | 60 | ## Setting up Civcraft in your new VM 61 | 62 | 1. The puppet provisioning issued by Vagrant (don't worry about the details) will handle most of the setup. 63 | 64 | 1. Minecraft 1.8.7 will be properly initialized 65 | 66 | 2. EULA will be accepted -- **if you object to this, don't use this VM.** 67 | 68 | 3. Spigot 1.8.7 will be built locally using BuildTools 69 | 70 | 4. Spigot will be installed as the minecraft_server.jar 71 | 72 | 5. Vanilla MC to Spigot conversion will occur. 73 | 74 | 2. Now, test your server by connecting to it: localhost:25565 75 | 76 | Note: If you need to restart your Vagrant for any reason, issue "vagrant reload" at the host terminal. 77 | 78 | 3. Proceed into installing Civcraft server mods. 79 | 80 | -------------------- 81 | 82 | ## Setting up your host machine as a development environment 83 | 84 | 1. Install Maven: https://maven.apache.org/download.cgi 85 | 86 | 2. Install a Java Development Environment 87 | 88 | * Eclipse is good: https://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/lunasr2 89 | 90 | * IntelliJ is good: https://www.jetbrains.com/idea/download/ 91 | 92 | * Hardcore? Notepad++ is popular: https://notepad-plus-plus.org/download/ 93 | 94 | * Textpad is a good hardcore for Windows: http://www.textpad.com/download/ 95 | 96 | * Badass? Vim: http://www.vim.org/download.php or Emacs: http://www.gnu.org/software/emacs/#Obtaining 97 | 98 | 3. Install git if you haven't already: https://git-scm.com/downloads 99 | 100 | 4. Install spigot & craftbukkit into your maven repository: 101 | 102 | mvn install:install-file -Dfile=./spigot/spigot-1.8.7.jar -DgroupId=org.spigotmc -DartifactId=spigot -Dversion=1.8.7 -Dpackaging=jar -DpomFile=./spigot/spigot-pom.xml 103 | 104 | mvn install:install-file -Dfile=./spigot/craftbukkit-1.8.7.jar -DgroupId=org.bukkit -DartifactId=craftbukkit -Dversion=1.8.7 -Dpackaging=jar -DpomFile=./spigot/craftbukkit-pom.xml 105 | 106 | -------------------- 107 | 108 | ## Setting up the VM as a development environment 109 | 110 | Already done! Unlike your local machine, the dev environment has already installed spigot and craftbukkit compiled artifacts into the Maven repository, so you're ready to start developing out of the box. 111 | 112 | -------------------- 113 | 114 | ## Post set-up in either case 115 | 116 | 1. Check out your favorite Civcraft mod and start hacking: https://github.com/Civcraft/ 117 | 118 | 2. Most of them are "good" mods and after cloning them locally you can issue: 119 | 120 | * `mvn clean package "-Dbuild.number=Local"` 121 | 122 | * That builds the mod, and puts the output jar in ./target off the repository root. 123 | 124 | * The build.number stuff just gives a meaningful assignment to the incremental build number in the POM (maven details, go read up on it). 125 | 126 | 3. Drop the built jars into the vm's `/minecraft/plugins` folder and restart the minecraft server on the VM. 127 | 128 | ----------------- 129 | 130 | ## Civcraft Clone TODO 131 | 132 | Note that currently, Namelayer and Citadel are in constant flux as Rourke and team work on Mercury / Sharding. The following is a stable plugin set: 133 | 134 | CivModCore 1.0.3 135 | 136 | NameLayer 2.3.5-136 137 | 138 | Citadel 3.2.8-130 139 | 140 | If you want to contribute to these plugins, you're going to need to go to most recent version on the plugin's master branch; I'll help you as I can. 141 | 142 | ### CivModCore Setup (1.0.3) 143 | 144 | 1. Grab the latest CivModCore jar from the Civcraft build server, or build locally 145 | 146 | 2. Put the jar into `/minecraft/plugins` 147 | 148 | 3. Continue. 149 | 150 | 151 | ### Namelayer Setup (2.3.5-136) 152 | 153 | 1. Grab the latest jar from Civcraft build server, or build locally 154 | 155 | 2. Put the jar into `/minecraft/plugins` 156 | 157 | 3. Start the server, observe the errors 158 | 159 | 4. Shut down the server. 160 | 161 | 5. Open `/minecraft/plugins/Namelayer/config.yml` -- note the need for username and password 162 | 163 | 6. Install mysql -- `sudo apt-get install mysql-server` 164 | 165 | * It's up to you if you want to set a root password; if you don't you'll be asked a bunch of times. 166 | 167 | 7. Log in to mysql -- `mysql -uroot -p` with whatever password you set, or omit the `-p` if you did not set one. 168 | 169 | 8. Create namelayer credentials -- `CREATE USER mc_namelayer IDENTIFIED BY 'minecraft';` -- clearly not high security here. 170 | 171 | 9. Create a database for this user -- `CREATE DATABASE IF NOT EXISTS namelayer` 172 | 173 | 10. Give permission to use the database to your user -- `GRANT ALL ON namelayer.* TO mc_namelayer` 174 | 175 | 11. `exit` the mysql shell. 176 | 177 | 12. Test your user and database -- `mysql namelayer -umc_namelayer -p` entering in password `minecraft` -- if this gives no errors, you're ready to go. 178 | 179 | 13. Go back to `/minecraft/plugins/Namelayer/config.yml` and edit it to look like this: 180 | 181 | sql: 182 | hostname: localhost 183 | port: 3306 184 | dbname: namelayer 185 | username: 'mc_namelayer' 186 | password: 'minecraft' 187 | groups: 188 | enable: true 189 | 190 | 14. Restart the spigot server. 191 | 192 | 15. If there are tons of errors, let me know. Any such things are on my to-do to fix this. 193 | 194 | 16. Stop and restart spigot one last time. 195 | 196 | ### Citadel Setup (3.2.8-130) 197 | 198 | 1. If Namelayer is installed, just grab the latest jar from Civcraft build server, or build locally 199 | 200 | 2. Put the jar into `/minecraft/plugins` 201 | 202 | 3. Start the server, observe the errors 203 | 204 | ### Humbug Setup 205 | 206 | ### FactoryMod Setup 207 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | #If api.puppetlabs.com is down or otherwise unreachable, everything will break. 5 | #There is no workaround currently in place. 6 | $puppet_update_script = <