Host-app is a server application (like Heroku or Dokku), but simplified for only one user and under your own domain.

Adem Aytaç 75af12f8bb npm replaced by yarn 2 years ago
scripts 75af12f8bb npm replaced by yarn 2 years ago
.editorconfig ce8896c43b init 2 years ago
.gitignore f4d270f429 structure changed 2 years ago
LICENSE ce8896c43b init 2 years ago
README.md 75af12f8bb npm replaced by yarn 2 years ago
setup 73ff7c03da ha fix 2 years ago

README.md

Host-app

Host-app is a server application (like Heroku or Dokku), but simplified for only one user and under your own domain.

You need to run the script on a freshly installed VPS, it will configure your hostname, hosts, add a sudo user, add the nessecary scripts.

Current State

The scripts will work only on Arch Linux, but in the future I will try to add scripts for other Distros and OS.

It works as a simple server, but if you find some security issues, please contact me about it, or create a fork and make a pull request with the fix.

Only Node projects are supported. You can create a pull request for other type of projects as well.

Prerequisites

  • Create wildcard record in your DNS zone ```bash
    • CNAME app.@ ``` @ point to your domain (eg. example.com)

Setup

After installing a fresh Arch Linux, run the following as a root user.

pacman -S ca-certificates ca-certificates-utils ca-certificates-cacert ca-certificates-mozilla
cd ~
git clone https://github.com/aytacworld/host-app
cd host-app
chmod +x ./setup
./setup

After the setup, you should be able to navigate to your FQDN(eg. app.example.com) from any browser.

Usage

  • ha new
  • ha update
  • ha delete
  • ha list
  • ha update-host
  • TODO

    • package.json engines (run an app with specific version of node, npm, yarn, ...)
    • add bash-completion
    • update node easily with dependencies(node-nvm-version, npm, yarn, pm2)

    Troubleshooting

    If the setup stops at certain step, you can continue from that step running the setup script like this

    ./setup <step-number>
    

    If you get this error

    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 10453: ordinal not in range(128)
    

    try to find a unicode character, which is failing the script, by doing:

    sudo grep -r -P '[^\x00-\x7f]' /etc/nginx /etc/letsencrypt
    

    If it returns some outputs, open the files, and remove those characters. And rerun the setup script from where you left(./setup 3)

    Npm command not found

    /home/user/host-app/scripts/4/script.sh: line 17: npm: command not found
    

    type exit, so you will be on root account, then relogin as user su -l <USERNAME>, and rerun the setup script cd host-app && ./setup 4