This Blog Finally Has a SearchBar and other Ramblings
Tags: blog, coding, nginx
Published: 2022-08-23 12:07:10

---
title: This Blog Finally Has a SearchBar and other Ramblings
published: true
date: 2022-07-28 00:06:46 UTC
tags: blog,coding,nginx
canonical_url: https://lucas-schiavini.com/this-blog-finally-has-a-searchbar/
---

 ![This Blog Finally Has a SearchBar and other Ramblings](https://images.unsplash.com/photo-1510915228340-29c85a43dcfe?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDQ0fHxjb2RlfGVufDB8fHx8MTY1ODQ1MDMyNw&ixlib=rb-1.2.1&q=80&w=2000)

Damn it took Ghost long enough to provide this functionality, but this tale is more about filesystems, permissions than it is about Ghost.

I'm thankful to Ghost because of this new search thingy, it just took me a lot of time to actually run `ghost update`.

So let's go.

First things first. I decided on going the self deploy route.

So  I created a neat little Droplet on Digital Ocean(about $6/month), added an email sender called Mailgun, and also decided on setting up my own Comment's system with Disqus.

So how was it?

### Droplet

Getting a droplet to work on Digital Ocean took me a bit of trouble, specially navigating all the ins and outs of the other steps.

Everytime I'd make a change on the droplet, it would crash the site because I was very inexperienced using all the technologies required to actually run a website.

So I had trouble installing ghost using my url without `https`,  so that took a couple of days before I figured out I had to run nginx with the correct url, since I was using SSL.

### Mailgun

Then there was the email service with Mailgun. A headsup for you newbies out there. Digital Ocean blocks the default SMTP (Simple Mail Transfer Protocol) port to avoid people creating droplets and sending spam.

So I had to learn to navigate using Mailgun and set out on my nginx conf files another port.

There was also an issue with regards to the safety protocol, you should keep both your `config.production.json` file using the same security as your Mailgun account. It is recommended to keep the configuration using the most secure option.

If for some reason you still get 500 when trying to subscribe to your own website, check if the security on Mailgun matches your config.production.json file. To run a quick test, you can replace the following line `"secure" : true` with `"secure": false` and see if you get a return from the server.

```
"mail": {  
  "transport": "SMTP",  
  "options": {  
	"service": "Mailgun",  
	"host": "smtp.eu.mailgun.org",  
	"port": "587",  
	"secure": true,
	"auth": {  
	  "user": "postmaster@your_domain.com",  
	  "pass": "your_password"  
	}  
  }  
}

```

If the test returns positive, then you should review your Mailgun config on their platform to get the `"secure": true` working again.

If you need more details to solve your particular Ghost + Mailgun problem I highly recommend this [post here](https://dev.to/norberthnd/how-to-configure-ghost-with-mailgun-1p79-temp-slug-8138541).

### Comment System

The commenting system is pretty straightforward, it only took me a couple of tries before getting it right. So a word of advice, just follow [Ghost's goddamn tutorials](https://ghost.org/integrations/disqus/).

### SearchBar

Searchbar took me long enough, but thanks to the [amazing Ghost team](https://ghost.org/about/) the latest upgrade from Ghost has a built in search bar, and it works wonderfully (at least for people with under 10K posts).

Before anything, make sure you followed [this tutorial by ghost](https://ghost.org/docs/install/ubuntu/#create-a-directory) on creating a user and directory for your website.

What took me the most amount of time on this was having the correct file and folder permissions for the ghost folder on my remote machine. Because I didn't follow the above tutorial 😁.

Here's how my folder permissions looks at the moment. To see yours hit `ls -al` on your terminal.

```
	
    -rw-rw-r-- 1 myUser 799 Jun 20 12:56 config.production.json
    drwxrwxr-x 11 ghost ghost 4096 Jun 20 03:15 content 
    lrwxrwxrwx 1 myUser 29 Jun 20 03:19 current -> /[redacted]/versions/5.2.3 
    drwxr-xr-x 3 myUser root 4096 Jun 20 03:20 system 
    drwxrwxr-x 3 myUser myUser 4096 Jun 20 03:15 versions
    
```

_They don't really look like that, but you get the idea, replace myUser with yours and the versions with the one's you have._

After running `ghost update` I ended up breaking my system, so I actually had to run `ghost setup` again, and at the end `ghost update --force`.

If you have more issues with this latest update, you can check if this [solves your problem](https://forum.ghost.org/t/ghost-wont-start-after-kinda-failed-update/8287).

### What's Next?

So I'm pretty excited to be blogging under my own name and actually learning a lot of things about hosting a website, that gives me more comfidence to navigate better around terms like nginx, cloud access, ssh, file and folder permissions.

I'm sure I'll learn even more amazing things and I'll do my best to share them all the way. In detail, unlike this rambling post lol.

Here's some next steps I'm interested in taking with this blog:

- Google Analytics to learn more about SEO so I can handle better distribution.
- Learning to publish higher quality content on a weekly basis.
- Future article: Why Am I switching from Medium to Ghost?

---

## 😗 Enjoy my writing?
Forward to a friend and let them know where they can subscribe (hint: it’s [here](https://lucas-schiavini.com/#/portal)).

Anything else? Just say hello in the comments :).

Join an Exclusive Tech Friendly Community! Connect with like-minded people who are interested in tech, design, startups, and growing online — apply [here](https://yv4sdz1j7rv.typeform.com/to/lMJ2yhuJ).