Skip to content

Commit

Permalink
Update the readme with usuage
Browse files Browse the repository at this point in the history
  • Loading branch information
MightyMoud committed Sep 14, 2024
1 parent 25072c5 commit 2f621c9
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 1 deletion.
74 changes: 73 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sidekick

<div align="center">
<h1>Sidekick</h1>
<div>
<img width="110px" src="https://emoji.aranja.com/static/emoji-data/img-apple-160/1f91c-1f3fb.png">
<img width="110px" src="https://emoji.aranja.com/static/emoji-data/img-apple-160/1f91b-1f3fb.png">
Expand All @@ -12,6 +12,9 @@ Bare metal to production ready in mins; imagine fly.io on your VPS
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/ms-mousa/sidekick)
![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/ms-mousa/sidekick)

<div>
<img width="500px" src="/demo/imgs/hero.png">
</div>
</div>

## Features
Expand All @@ -28,6 +31,75 @@ Bare metal to production ready in mins; imagine fly.io on your VPS
## Motivation
I'm tired of the complexity involved in hosting my side projects. While some platforms, like Fly.io, stand out in the crowded field of Heroku replacements, I believe a simple VPS can be just as effective. That's why I created Sidekick: to make hosting side projects as straightforward, affordable, and production-ready as possible. You'll be surprised how much traffic a $8/month instance on DigitalOcean can handle.

## Installation
With GO installed on your system you need to run
```bash
go install github.com/mightymoud/sidekick@latest
```

## Usage
Sidekick helps you along all the steps of deployment on your VPS. From basic setup to zero downtime deploys, we got you! ✊
First you need a VPS with Ubuntu LTS. I recommend DigitalOcean. Hetzner also gets very good reviews. You can host your own silicon too. As long as you have a public IP address you good to go and use sidekick.

Just make sure the following is true
- VPS running Ubuntu - LTS recommended
- SSH Public Key availble on your machine to login to VPS.

That's it, you're ready to use Sidekick
### VPS Setup
First you need to setup your VPS. To do this you need to run:
```bash
sidekick init
```
Then you need to enter the following:
- IP Address of your VPS
- An email address to use for setting up TSL certs
- Docker registery to host your docker images - defaults to `docker.io`
- Docker username in the said registery
- Confirm you are currently logged in to that said registery with the username - This is needed to be able to push images on your behalf

After that Sidekick will setup many things on your VPS - Usually takes around 2 mins
<details>
<summary>What does Sidekick do when I run this command</summary>

* Login with `root` user
* Make a new user `sidekick` and grant sudo access
* Logout from `root` and login with `sidekick`
* Update and upgrade your Ubuntu system
* Install `sops` and copy over the public key to your sidekick config file
* Install Docker
* Setup Traefik and TLS certs on your VPS
</details>

### Launch a new application
<div align="center" >
<img width="500px" src="/demo/imgs/launch.png">
</div>

In your application folder, make sure you have a working `Dockerfile` that you can build and run. Also make sure you know at which port your app is expecting to recieve traffic.

Then run:
```bash
sidekick launch
```
Then you need to enter the following:
- Url friendly name of your app - if you opt to use `sslip.io` domain for testing this would be your subdomain
- HTTP exposed port for your app to get requests - Sidekick will scan your docker file to try to extract this number and default it.
- Domain at which you want this application to be reachable - If you choose your own domain make sure to point the domain to your VPS IP address; otherwise we default to `sslip.io` domain so you can play around.
- If you have any `env` file with secrets in it. Sidekick will attempt to find `.env` file in the root of your folder. Sidekick will use `sops` to encrypt your env file and inject the values securely at run time.

Should take around 2 more mins to be able to visit your application live on the web if all goes well.

<details>
<summary>What does Sidekick do when I run this command</summary>

* Build your docker image locally for linux
* Push the docker image to the registery
* Encrpt your env file, if available and push it to your VPS
* Spin up your docker image and route traffic to it on the specified port using Traefik
</details>


## Inspiration
- https://fly.io/
- https://kamal-deploy.org/
Expand Down
Binary file added demo/imgs/hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/imgs/launch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/ms-mousa/sidekick v0.5.0 h1:DZc4H8+73IjS3dDnVQPZeI07sIJhSapy/1m7Wr6jO7w=
github.com/ms-mousa/sidekick v0.5.0/go.mod h1:gV6x7Rm1k3EiMQMdxxlnzj+NoHUAVBlNHvpjgywxckI=
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down

0 comments on commit 2f621c9

Please sign in to comment.