loftwah / god-tier-self-hosting

God tier self-hosting with Loftwah. Because open source and self-hosting is my religion.

Home Page:https://loftwah.github.io/god-tier-self-hosting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Self Hosting

Banner Image

This is a repo for stuff that I host myself locally. Since Heroku has notified people it is removing the free tier you might want to check out free-for.dev.

Table of Contents

Table of Contents

Requirements

The requirements to run most of what is in here are as follows:

Localtunnel

Localtunnel | Localtunnel Server

Localtunnel is great if you don't have a static IP address, or if you are behind carrier grade NAT.

Localtunnel Usage

To quickly set up localtunnel, run the following command:

npx localtunnel --port 8000

Or if you want to install the package:

npm install -g localtunnel
lt --port 8000
  • --subdomain request a named subdomain on the localtunnel server (default is random characters)
  • --local-host proxy to a hostname other than localhost

Example:

lt --port 8000 --subdomain loftwah-sucks --local-host loftwah.local

This would expose loftwah-sucks.localtunnel.me to loftwah.local:8000 on your local network.

Nginx Proxy Manager

Nginx Proxy Manager

Nginx Proxy Manager is a great way to manage your proxies. Use the Docker Compose template in the nginx-proxy-manager directory.

Default credentials are:

Default User Default Password
admin@example.com changeme
cd nginx-proxy-manager
docker-compose up -d

Piping Server

Piping Server

Infinitely transfer between every device over HTTP/HTTPS

Transfer

Piping Server is simple. You can transfer as follows.

# Send
echo 'hello, world' | curl -T - https://ppng.io/hello
# Get
curl https://ppng.io/hello > hello.txt

Piping Server transfers data to POST /hello or PUT /hello into GET /hello. The path /hello can be anything such as /mypath or /mypath/123/. A sender and receivers who specify the same path can transfer. Both the sender and the recipient can start the transfer first. The first one waits for the other.

You can also use Web UI like ppng.io on your browser. A more modern UI is found in piping-ui.org, which supports E2E encryption.

Self-host on Docker

Run a Piping Server on localhost:8080 as follows.

docker run -p 8080:8080 nwtgck/piping-server

Run a server in background and it automatically always restarts.

docker run -p 8080:8080 -d --restart=always nwtgck/piping-server

Portainer

Portainer | Shipwright

Portainer is a web interface for Docker.

Portainer Templates

Selfhosted Pro | Technorabilia | Pi-hosted

Portainer templates are great for people who don't want to get their hands dirty in the command line, or don't have the greatest understanding of Docker or Linux. It makes it easier to get it up and running quickly. I'm not sure which templates are the best but here are a couple of repositories that have some good templates.

Vaultwarden

Vaultwarden | Vaultwarden Backup

Vaultwarden is a self hostable version of Bitwarden. It can be launched via Docker Compose.

Vaultwarden Usage

Important: We assume you already read the vaultwarden documentation.

Configure Rclone

For backup, you need to configure Rclone first, otherwise the backup tool will not work.

For restore, it is not necessary.

We upload the backup files to the storage system by Rclone.

Visit GitHub for more storage system tutorials. Different systems get tokens differently.

Configure and Check

You can get the token by the following command.

docker run --rm -it \
  --mount type=volume,source=vaultwarden-rclone-data,target=/config/ \
  ttionya/vaultwarden-backup:latest \
  rclone config

We recommend setting the remote name to BitwardenBackup, otherwise you need to specify the environment variable RCLONE_REMOTE_NAME as the remote name you set.

After setting, check the configuration content by the following command.

docker run --rm -it \
  --mount type=volume,source=vaultwarden-rclone-data,target=/config/ \
  ttionya/vaultwarden-backup:latest \
  rclone config show

# Microsoft Onedrive Example
# [BitwardenBackup]
# type = onedrive
# token = {"access_token":"access token","token_type":"token type","refresh_token":"refresh token","expiry":"expiry time"}
# drive_id = driveid
# drive_type = personal

Backup

If you are a new user or are rebuilding vaultwarden, it is recommended to use the docker-compose.yml from the project.

Download docker-compose.yml to you machine, edit environment variables and start it.

You need to go to the directory where the docker-compose.yml file is saved.

# Start
docker-compose up -d

# Stop
docker-compose stop

# Restart
docker-compose restart

# Remove
docker-compose down

Restore

Important: Restore will overwrite the existing files.

You need to stop the Docker container before the restore.

You also need to download the backup files to your local machine.

Because the host's files are not accessible in the Docker container, you need to map the directory where the backup files that need to be restored are located to the docker container.

And go to the directory where your backup files to be restored are located.

If you use the docker-compose.yml provided with this project, you can use the following command.

docker run --rm -it \
  --mount type=volume,source=vaultwarden-data,target=/bitwarden/data/ \
  --mount type=bind,source=$(pwd),target=/bitwarden/restore/ \
  ttionya/vaultwarden-backup:latest restore \
  [OPTIONS]

About

God tier self-hosting with Loftwah. Because open source and self-hosting is my religion.

https://loftwah.github.io/god-tier-self-hosting