diff --git a/README.md b/README.md index 2dd67c7..52b63f9 100644 --- a/README.md +++ b/README.md @@ -165,65 +165,32 @@ Before proceeding from this section, review the section checklist to ensure you | [ ] | Network specific ansible inventory file was created | | [ ] | Ansible runs through the entire playbook with no errors | +### Configure The Panel +I need to create an account on the panel, https://panel.mjb-stage.com/register with the email address manager@mjb-stage.com. - - - - - - - - - - - - - - - - - -### Step 1: Machine Selection - -First, I should layout the servers. At least one panel, build, store and certbot server will be needed to run the platform. One or more webservers will be needed to serve blogs. - -These servers should all be Debian 11 machines. I will also need a machine to install from, which should have git, ansible, and SSH access to all of the other machines. - -I have choosen to lay out the machines as follows. The private IP addresses will be used to limit database access. - -| Machine | Public IP | Private IP | Domain | -| -------- | --------------- | --------------- | ------------------------- | -| panel | 45.79.91.170 | 192.168.134.89 | panel.myjekyllblog.net | -| build | 173.255.209.214 | 192.168.202.60 | build.myjekyllblog.net | -| store | 173.255.209.241 | 192.168.207.169 | store.myjekyllblog.net | -| certbot | 104.200.24.149 | 192.168.210.55 | certbot.myjekyllblog.net | -| web-west | 104.200.24.174 | N/A | web-west.myjekyllblog.net | -| web-east | 45.79.171.182 | N/A | web-east.myjekyllblog.net | - -Each of these machines is now online, brought up on Linode with their default Debian 11 image. - -Next I will need to checkout the repository and update the configuration file. +Once I create the account, I need to promote it to an admin. From a shell on panel.mjb-stage.com server, I run the following. ```bash -git clone ... -cd devops/ansible/ -mkdir -p env/staging -cp config.example.yml env/staging/inventory.yml -vim env/staging/inventory.yml +cd mjb/Web +./script/mjb flip_admin manager@mjb-stage.com ``` -I named the configuration file `env/staging/inventory.yml`, since this will be a staging environment. I placed this in its own directory because some environment specific files will be stored in the inventory directory, and keeping seperate directories will prevent file clobbering. One should pay special attention to go through this example config file and update it with details of their network. Once this is complete, the installation should be smooth sailing with ansible. I use the following command to get everything installed. +Now that I have an admin account, I can access the Servers tab at https://panel.mjb-stage.com/admin/servers -```bash -ansible-playbook -i env/staging/inventory.yml site.yml -``` +The tab configures web servers that the system will deploy blogs to. Each of the webservers that were configures by Ansible should go here, so I enter `web-west.mjb-stage.com` and then `web-west.mjb-stage.com`. The servers tab now lists these two servers. -This command took about two and a half hours to complete, it should largely setup the whole platform across all of the machines. +Next I need to go to the Domains tab and add `mjb-stage-blog.com`. + +There is a drop down for SSL Challenge. When selecting `HTTP`, each time a blog is added, certbot will be used to complete an HTTP challenge for the domain. When selecting `DNS-Linode`, a Wildcard SSL certificate will be obtained and then blogs will not need their own certificates. `DNS-Linode` requires a Linode account and API credentials. -### Step 2: Manual Steps +| X | Section Checklist Items | +| --- | --------------------------------------------------------- | +| [ ] | Created admin account, can login and view Admin Panel | +| [ ] | Added Web Servers to Admin Panel -> Servers | +| [ ] | Added Hosted Domains to Admin Panel -> Domains | -Now the ansible playbook has run successfully, and all of the machines are set up. +### Configure The Store During the installation process, an SSH keypair was created. The public key must be added to the Gitea user that was setup. This must be done through the Gitea web panel. @@ -243,13 +210,41 @@ Once this is done, you'll need to create the mjb organization. 3. Name the organization "mjb" 4. Click "Create Organization" +Now we need to add a Jekyll blog as a template. + +Get a shell into the build server and create a new Jekyll blog. + +```bash +# Create the default blog +alias jekyll="podman run -ti --rm -v .:/srv/jekyll -e JEKYLL_ROOTLESS=1 docker.io/jekyll/jekyll jekyll" +jekyll new jekyll-default + +# Push this default to the panel_config.jekyll_init_repo repository +cd jekyll-default +git init +git remote add origin git@store.mjb-stage.com:manager/jekyll-default.git +git add * .gitignore +git commit -m "Initial Commit" +git push origin master +``` + +Now that the `panel_config.jekyll_init_repo repository` repository exists, we should be ready to rock and roll. + +| X | Section Checklist Items | +| --- | ----------------------------------------------------------- | +| [ ] | Confirmed login to the Gitea install on store server | +| [ ] | Added SSH key to the gitea user account | +| [ ] | Added mjb organization for blog repos to be added under | +| [ ] | Pushed the jekyll repo to the jekyll\_init\_repo address | + Everything should be setup now. ### Step 3: Confirm It All Works! 1. Create a user account 2. Create a blog -3. Delete a post +3. Create a post +4. Delete a post ## Development Guide