<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hosting on blog.iankulin.com</title><link>https://blog.iankulin.com/tags/hosting/</link><description>Recent content in Hosting on blog.iankulin.com</description><generator>Hugo</generator><language>en-AU</language><lastBuildDate>Mon, 18 Mar 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.iankulin.com/tags/hosting/index.xml" rel="self" type="application/rss+xml"/><item><title>Certbot - removing a domain</title><link>https://blog.iankulin.com/certbot-removing-a-domain/</link><pubDate>Mon, 18 Mar 2024 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/certbot-removing-a-domain/</guid><description>&lt;p&gt;I had a number of domains all running on one host when I first set them up with certbot. One started to be serious, so I moved it to another host and ran certbot there. That all worked perfectly, but of course, the old domain is still part of the original certificate, so when I went to renew it, it came up with some errors.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a few commands that are going to help navigate this situation if you&amp;rsquo;ve found yourself in the same spot:&lt;/p&gt;
&lt;h4 id="show-all-certificates-and-which-domains"&gt;Show all certificates and which domains&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo certbot certificates
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="renew-just-some-domains"&gt;Renew just some domains&lt;/h4&gt;
&lt;p&gt;There&amp;rsquo;s no way to delete a domain from a certificate, the process is to renew it, but just for the domains you want to keep. Certbot will notice you&amp;rsquo;ve missed some and warn you that you&amp;rsquo;re effectively deleting them.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo certbot --cert-name &amp;lt;certifcate-name&amp;gt; -d &amp;lt;domain1&amp;gt; -d &amp;lt;domain-2&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Digital Ocean first impressions</title><link>https://blog.iankulin.com/digital-ocean-first-impressions/</link><pubDate>Sat, 19 Aug 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/digital-ocean-first-impressions/</guid><description>&lt;p&gt;I&amp;rsquo;ve been thinking about the time it takes me to provision a guest VM in Proxmox. I seem to remember on &lt;a href="https://www.binarylane.com.au/"&gt;BinaryLane&lt;/a&gt; it was seconds rather than minutes. This seemed to be a good excuse to use the free credit I&amp;rsquo;ve heard about for &lt;a href="https://www.linode.com/lp/free-credit-100/?promo=sitelin100-02162023&amp;amp;promo_value=100&amp;amp;promo_length=60&amp;amp;utm_source=google&amp;amp;utm_medium=cpc&amp;amp;utm_campaign=11178784684_109179223363&amp;amp;utm_term=g_kwd-2629795801_e_linode&amp;amp;utm_content=466889596558&amp;amp;locationid=1000676&amp;amp;device=c_c&amp;amp;gclid=CjwKCAjw-7OlBhB8EiwAnoOEk9lQtzb_l17rAJmoU1KzhTUcWc6TF6C8KBTZU3j6tJ3d1qLWqqiRgxoC6qUQAvD_BwE"&gt;Linode&lt;/a&gt; or Digital Ocean hundreds of times in podcast adverts, so I claimed the &lt;a href="http://do.co/lnl"&gt;$200 credit for being a Late Night Linux listener&lt;/a&gt; at Digital Ocean. They extracted $5 out of me in the process, so I guess they are in front on that transaction. $200 would run a little VM for a couple of years at their rates, but of course it&amp;rsquo;s limited to two months, at the end of which I will have an account sitting there, with my credit card already recorded - so all the friction is gone if I need an internet facing machine for some purpose - which is clearly their dastardly plan&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-07-11-at-7.50.07-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-11-at-7.50.07-pm.png" width="351" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The process of creating a &amp;lsquo;droplet&amp;rsquo; (that&amp;rsquo;s what they call their VM&amp;rsquo;s) was straightforward - select the datacentre, machine size etc You can upload your SSH key which is a nice touch.&lt;/p&gt;
&lt;p&gt;When I got to the end of all that, I hit create and timed the boot up of the Debian 12 system I&amp;rsquo;d chosen - 42.13 seconds.&lt;/p&gt;
&lt;p&gt;I could ping the public IP, so it existed, but couldn&amp;rsquo;t ssh in as root, and didn&amp;rsquo;t know my user name. After trawling through their Getting Started docs, I found one that said to use your email that you signed up with. That didn&amp;rsquo;t make sense or work. I &lt;a href="https://www.youtube.com/watch?v=kzThZOZj1S4&amp;amp;t=417"&gt;watched a video&lt;/a&gt;, then searched further and found I should have gone into the advanced options and written a script to add a user - a sample one was provided.&lt;/p&gt;
&lt;p&gt;I destroyed the first machine and created a second one with the sample user script (which I&amp;rsquo;ve since gone back and searched for but could not find) which basically adds the user and assigns the ssh key. Once that was booted I could ssh in, but not sudo since I didn&amp;rsquo;t know the password.&lt;/p&gt;
&lt;p&gt;There is a &amp;lsquo;console&amp;rsquo; so I used that to set a password for the user the script had created, then was able to both ssh in and use sudo. I guess the idea of the script is great if you know what you&amp;rsquo;re doing and going to be creating a lot of VM&amp;rsquo;s, but this was a painful start compared to &lt;a href="https://www.binarylane.com.au/"&gt;BinaryLane&lt;/a&gt; or my homelab. I figured out afterwards, this was because I&amp;rsquo;d chosen Debian for the distro - you can&amp;rsquo;t ssh in as root. If I choose a more relaxed distro, I could do that, and create my user then patch up the root access.&lt;/p&gt;
&lt;p&gt;The rest of the experience was fine - the web interface is clear enough apart from my initial grumble. I couldn&amp;rsquo;t paste into the web console, and I&amp;rsquo;ve noticed that in Proxmox as well so I guess that&amp;rsquo;s some sort of limitation. In any case, once you&amp;rsquo;ve set up your ssh user properly you never need use it again.&lt;/p&gt;</description></item><item><title>Updating SSL Certificates</title><link>https://blog.iankulin.com/updating-ssl-certificates/</link><pubDate>Wed, 12 Jul 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/updating-ssl-certificates/</guid><description>&lt;p&gt;When I first installed my SSL certificates, &lt;a href="https://blog.iankulin.com/installing-ssl-certificates-with-nginx-on-docker/"&gt;I mentioned&lt;/a&gt; it&amp;rsquo;s a process I need to automate before they came up for expiry, but here we are ten days out, and I haven&amp;rsquo;t done that yet, but I have been keeping an eye on it though the excellent display and notifications set up in &lt;a href="https://blog.iankulin.com/uptime-kuma-nfty/"&gt;Uptime Kuma&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-07-10-at-5.36.01-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-10-at-5.36.01-pm.png" width="800" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Updating the certificates is easy. When I went into the site at PorkBun (where I purchased the domain and who do the primary DNS for the site, the next certificates were sitting there to be downloaded. My existing certificates were due to expire on 30th July, and these had been generated on 3rd July.&lt;/p&gt;
&lt;p&gt;The bundle included the same files as last time. You might remember from last &lt;a href="https://blog.iankulin.com/installing-ssl-certificates-with-nginx-on-docker/"&gt;time&lt;/a&gt; that we need to join the &lt;code&gt;domain.cert.pem&lt;/code&gt; and &lt;code&gt;intermediate.cert.pem&lt;/code&gt; to make the &lt;code&gt;fullchain.pem&lt;/code&gt; file. I had just &lt;code&gt;cat&lt;/code&gt;&amp;rsquo;d them together and this had caused an issue as there&amp;rsquo;s no newline character at the end of the first file. I got smarter this time and googled up this &lt;a href="https://stackoverflow.com/questions/8183191/concatenating-files-and-insert-new-line-in-between-files/23549826#23549826"&gt;solution&lt;/a&gt; which did the trick by using echo to insert the newline:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-07-10-at-5.57.44-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-10-at-5.57.44-pm.png" width="1000" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once that was done, I uploaded them to the nginx directory where I stored them last time. Nginx reloads the config on restart, although there&amp;rsquo;s probably a neater way as well, so I just restarted the container with Docker compose to pick up the new certificates. While I was doing that I got the ping from Uptime Kuma via &lt;a href="https://ntfy.sh/"&gt;ntfy&lt;/a&gt; to say it was down, then up. I had a look at the display, and it&amp;rsquo;s showing I&amp;rsquo;ve got another 84 days left on the cert.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-07-10-at-6.10.32-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-10-at-6.10.32-pm.png" width="1000" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So, 84 days for me to get around to automating this.&lt;/p&gt;</description></item></channel></rss>