Quick Start Demos - wintersys-projects/adt-build-machine-scripts GitHub Wiki

QUICK START DEMOS PRE-REQUISITE STEPS (REQUIRED FOR ALL DEMOS)

The purpose of these quick start demos is to show you that with just some parameters you can achieve a lot using the Agile Deployment Toolkit with the possibility of going much deeper into it if you choose to.

For more information please see the spec and quickspec

OBJECTIVE:

After steps 1-8 below, you should have a text file on your laptop with content similar to the following sample/example values:

Build Machine User: "nuocial-deployer"
Build Machine Password: "gdjkbcijbue2hhfdy3e8"
Build Machine SSH PORT: "1035"
Laptop IP: 111.111.111.111
Linode account username : nuocialdeployer
Linode account email address : [email protected]
Laptop public key : ssh-rsa AAAAB3MbsHaC1Jc2EAA......8X8TGp19n root@penguin
Object Storage access key : PJX1HOLT157FQ9WCQ52K
Object Storage secret key: malXD6aIPRAlxR2zU3IrpDDFWbNSLoGKLA6T1JeP
Personal Access Token : 23c8b26866a9fd81634a83182da5e1193bcc73d731d9224732159a8e31989d29
Live Domain Name: demo.nuocial.org.uk
Core Website Name: nuocial


  1. Open up an empty text document on your laptop and make up a username, password and ssh port for your prospective build machine. Find the ip address of your laptop by going to whats my ip and enter the ip address of your laptop into your empty text document, for example,
  "Username: nuocial-deployer"
  "Password: gdjkbcijbue2hhfdy3e8"
  "Port: 1035"
  "Laptop IP: 111.111.111.111"  
  1. Setup an account with Linode Linode - make a note in your text document that you opened in 1 of the username of your linode account for example,
   "Linode account username : nuocialdeployer"  

and the email address you used to register your linode account under for example,

   "Linode account email address : [email protected]"
  1. Setup a pair of SSH Keys on your laptop if you haven't already - make a note in your text document that you opened in 1 of the full public key part of the key pair you just generated for example,
   "Laptop public key : ssh-rsa AAAAB3MbsHaC1Jc2EAA......8X8TGp19n root@penguin"  
  1. Setup Object Storage for your account if its not already setup according to Object Storage Setup - make a note in your text document of the access key and the secret key for your object storage for example,
   "Object Storage access key : PJX1HOLT157FQ9WCQ52K "  

and

   "Object Storage secret key: malXD6aIPRAlxR2zU3IrpDDFWbNSLoGKLA6T1JeP"  
  1. Generate a personal access token with all read and write permissions granted according to Generate Personal Access Token - make a note of your PAT in your text document for example,
   "Linode Personal Access Token : 23c8b26866a9fd81634a83182da5e1193bcc73d731d9224732159a8e31989d29"  
  1. Purchase a domain if you don't have one and change the nameservers of the domain to "ns1.linode.com, ns2.linode.com, ns3.linode.com, ns4.linode.com and ns5.linode.com" with your domain registrar (if you don't know how to purchase a domain and change its active nameservers, then, this toolkit probably isn't suitable for you).

  2. You now need to make a note of the domain name you are using to deploy to for example, if I have just purchased as set up a domain "nuocial.org.uk" in step 6, my intended domain name for my final website to be available at might be "demo.nuocial.org.uk" so make a note in your text file

   "Live Domain Name: demo.nuocial.org.uk"

You now need to update your linode DNS system with your new domain name. Click on "Domains" from the Linode GUI and add your domain name as a "Primary Domain" to the Linode DNS system in my case the primary domain will be "nuocial.org.uk"

  1. You need to make a note of the "core website name" which is "nuocial" if your domain name is "demo.nuocial.org.uk" and "testwebsite" if your domain name is "demo.testwebsite.uk"

You should now have a text file on your laptop that looks similar to my test/sample one listed under "objective" above.

What you now need to do to have your pre-requisite steps completed is enter the values that you have in your text file into the "AgileDeploymentToolkitDemo" Stackscript. To deploy the demo application, follow these steps

  1. Go to "Stackscripts" from the GUI system of your Linode Account and find the public Stackscript "AgileDeploymentToolkitDemo" and click "Deploy Linode"

  2. You will then see a list of configurable text-fields that you are going to selectively enter the data from the text file you now have on your laptop. Each text-field has a label and so to configure the Stackscript, find the label as I mention it below and enter the corresponding value from your text file into that text-field

  3. Label: "SSH Public Key from your laptop (required)" - value from YOUR text file which in my case is "AAAAB3MbsHaC1Jc2EAA......8X8TGp19n root@penguin"

  4. Label: "IP address of your laptop (required)" - value from YOUR text file which in my case is "111.111.111.111"

  5. Label: "The username of your Linode account (required)" - example value which in my case is "nuocialdeployer"

  6. Label: "The email address of your DNS provider (required)" - example value which in my case is "[email protected]"

  7. Label: "The S3 access key for your linode object storage (required)" - example value which in my case is "PJX1HOLT157FQ9WCQ52K"

  8. Label: "The S3 secret key for your linode object storage (required)" - example value which in my case is "malXD6aIPRAlxR2zU3IrpDDFWbNSLoGKLA6T1JeP"

  9. Label: "Your linode personal access token (which must have all rights granted) (required)" - example value which in my case is "23c8b26866a9fd81634a83182da5e1193bcc73d731d9224732159a8e31989d29"

  10. Label: "The domain name of your website which must be registered with your DNS provide" - example value which in my case is "demo.nuocial.org.uk"

  11. Label: "Website name if url is www.nuocial.org.uk this is nuocial (required)" - example value which in my case is "nuocial"


For every demo below you need to run through all the pre-requisite steps mentioned above. For each demo, before you click "Create Linode" at the bottom of the page make sure that you are creating a linode in the correct region (nl-ams), that the Linode has a root password set and that private ip addresses are enabled. The rest of the settings for your linode are left to your discretion. Once you click "Create Linode", the build will deploy which will take some minutes.

Once the build is completed you can:

You can ssh onto the build machine once it has started up with

 ssh -p 1035 nuocial-deployer@<build-machine-ip>

then do a

 sudo su <password as per step 4 above>
 cd adt-build-machine-scripts/logs
 tail -f buildout - to see the error stream and how the build is progressing

Note 1:

Using the default stack script will generate a live SSL certificate not a staging certificate each time you run the stack script and there are issuance limits per domain. If you want to run the Stackscript more times then the issuance limit will allow you can set SSL_LIVE_CERT to 0 in the Stackscript but you will get security warnings in your broswer if you do that.

Note 2:

Once your machines are built the UFW firewall will be installed on your build machine (the machine that was built using the StackScript) but you can tighten what the UFW configuration provides by default by creating a firewall called "adt-build-machine" through your linode gui adding the build machine to it and creating a rule to only allow access from your "LAPTOP IP" mentioned above to the "Build Machine SSH PORT" mentioned above. This will tighten up the security of your build machine to only allow SSH access from your laptop and to the specific port you have configured SSH to use through your selection. All the other ports on your build machine will be firewalled off making it more difficult to compromise because it has sensitive access keys and secret keys on it, for example. This will give you two layers of tightly configured fire walling for your build machine the native firewall which you optionally set up manually and the ufw firewalling that is set up automatically.

Note 3:

These are only demos and use naked DNS configurations (meaning no proxying through a service to facilitate a WAF and so on). If you want to get more serious you very likely will want to configure Cloudflare or modify the toolkit to support another service of your choice.


Demo 1 (Very simple Community Builder Joomla application)

  1. Follow the all the pre-requisite steps above
  2. You can play with additional settings such as machine size and so on, but, the demo application should install without needing any additional steps above and beyond what is outlined in the pre-requisite steps.
  3. Once the application is installed, the username is "webmaster" and the password is "mnbcxz098321QQZZ"

Demo 2 (Sample Drupal Application)

  1. Follow the all the pre-requisite steps above
  2. There is an already built version of the Drupal Opensocial application

In addition to the pre-requisite steps above alter the following settings in your Stackscript:

  • "The Display name for your website e.g. My Demo Website" to "My Opensocial Demo"
  • "APPLICATION" to "drupal"
  • "APPLICATION IDENTIFIER" to "3"
  • "BASELINE DB REPOSITORY" to "opensocial-db-baseline" (with sample data) or "opensocialvanilla-db-baseline" (without sample data)
  • "APPLICATION BASELINE SOURCECODE REPOSITORY" to "opensocial-webroot-sourcecode-baseline" (with sample data) or "opensocialvanilla-webroot-sourcecode-baseline" (without sample data)

Once the application is installed, the username is "webmaster" and the password is "mnbcxz098321QQZZ"


Demo 3 (Virgin Joomla install)

  1. Follow the all the pre-requisite steps above
  2. To install a virgin joomla deployment change the following additional values in your Stackscript
  • "The number (1, 2 or 3) of the template you are using" to "1"
  • "The Display name for your website e.g. My Demo Website" to "My Joomla Demo"
  • "APPLICATION" to "joomla"
  • "APPLICATION IDENTIFIER" to "1"
  • "JOOMLA VERSION" and set it to the latest version of Joomla for example, "5.0.1"
  • "BUILD CHOICE" to "0"
  • "BUILD ARCHIVE CHOICE" to "virgin"
  • "BASELINE DB REPOSITORY" to "VIRGIN"
  • "APPLICATION BASELINE SOURCECODE REPOSITORY" to "JOOMLA:5.0.1"

You can then deploy your Linode using your Stackscript and wait for your Joomla install will come online

You will then need to fill in all the installation values which you can find in the build log on your build machine

 /bin/cat ${BUILD_HOME}/logs/b*err*. 

You will also need to remove the file _J* from the installation folder when prompted and you can do this using the ConnectToWebserver.sh script in the helperscripts directory on your build machine.

cd ${BUILD_HOME}/helperscripts
/bin/sh ConnectToWebserver.sh
cd super
/bin/sh Super.sh
/bin/rm /var/www/html/installation/_J*

Demo 4 (Virgin Wordpress install)

  1. Follow the all the pre-requisite steps above
  2. To install a virgin wordpress deployment change the following additional values in your Stackscript
  • "The number (1, 2 or 3) of the template you are using" to "1"
  • "The Display name for your website e.g. My Demo Website" to "My Wordpress Demo"
  • "APPLICATION" to "wordpress"
  • "APPLICATION IDENTIFIER" to "2"
  • "BUILD CHOICE" to "0"
  • "BUILD ARCHIVE CHOICE" to "virgin"
  • "BASELINE DB REPOSITORY" to "VIRGIN"
  • "APPLICATION BASELINE SOURCECODE REPOSITORY" to "WORDPRESS"

You can then deploy your Linode using your Stackscript and wait for your Wordpress install will come online


Demo 5 (Virgin Drupal install)

  1. Follow the all the pre-requisite steps above
  2. To install a virgin drupal deployment change the following additional values in your Stackscript
  • "The number (1, 2 or 3) of the template you are using" to "1"
  • "The Display name for your website e.g. My Demo Website" to "My Drupal Demo"
  • "APPLICATION IDENTIFIER" to "3"
  • "DRUPAL VERSION" set it to the latest version of drupal for example, "10.0.10"
  • "BUILD CHOICE" to "0"
  • "BUILD ARCHIVE CHOICE" to "virgin"
  • "BASELINE DB REPOSITORY" to "VIRGIN"
  • "APPLICATION BASELINE SOURCECODE REPOSITORY" to "DRUPAL:10.0.10"

You can then deploy your Linode using your Stackscript and wait for your Drupal install will come online

Note:

You can install a vanilla copy of OpenSocial instead of a version of drupal by making the following adjustments to the 8 steps outlined above for demo 5

Change the value

  • "The Display name for your website e.g. My Demo Website" to "My Opensocial Demo"
  • "APPLICATION BASELINE SOURCECODE REPOSITORY" to "DRUPAL:social" and at the time of writing, PHP8.1 is the supported version for opensocial do you need to also set
  • "PHP VERSION" to "8.1"

Caveat for Opensocial - I have no knowledge of drupal and when I installed opensocial it had problems with the images not displaying if anyone with a deeper knowledge of drupal that makes one of these deployments knows what is happening that would be very cool.


Demo 6 (Virgin Moodle install)

  1. Follow the all the pre-requisite steps above
  2. To install a virgin moodle deployment change the following additional values in your Stackscript
  • "The number (1, 2 or 3) of the template you are using" to "1"
  • "The Display name for your website e.g. My Demo Website" to "My Moodle Demo"
  • "APPLICATION" to "moodle"
  • "APPLICATION IDENTIFIER" to "4"
  • "BUILD CHOICE" to "0"
  • "BUILD ARCHIVE CHOICE" to "virgin"
  • "BASELINE DB REPOSITORY" to "VIRGIN"
  • "APPLICATION BASELINE SOURCECODE REPOSITORY" to "MOODLE"

You can then deploy your Linode using your Stackscript and wait for your Moodle install will come online
Once moodle is installed, I go to demo.nuocial.org.uk/moodle and you should do the same for your domain.

The default username and password for your moodle installation are:

username: admin123
password: changeme17832

Both the username and password should be changed immediately your moodle instantiation is online