Skip to content

Vanilla PHP application written in the OOP paradigm & MVC design pattern with a relational database (MySQL). Styling: Bootstrap. Deployment: Docker, NameCheap, DigitalOcean, Certbot (Let's Encrypt) & SMTP2GO. Development: VSCode + Remote - SSH extension.

License

Notifications You must be signed in to change notification settings

gusalbukrk/simpletables

Repository files navigation


simpletables.xyz

Overview

Sign up page

Log in page

Reset password page

Databases page

Tables page

Records page

Database's users page

How to run

  • ./run.sh <password> = start app, password argument is to be used as MySQL root user password
  • docker compose down = stop app

How to deploy

Register a domain

Set up hosting

  • create an account on DigitalOcean
  • create a project and a SSH key on settings
  • create a droplet inside the project created previously and select the SSH key created on the previous step as the authentication method
  • change DNS provider from Namecheap to DigitalOcean
    • access the domain config page at Namecheap and change "nameservers" from "Namecheap BasicDNS" to "Custom DNS" and add DigitalOcean's nameservers (instructions)
    • access DigitalOcean, add domain to the droplet and create a wildcard A record pointing to *
    • NOTE: later you'll revert to use Namecheap but for now using DigitalOcean is necessary to easily issue a SSL certificate

Initial server configuration

Issue Let's Encrypt certificate

  • enable SSL using Let's Encrpyt
    • NOTE: at section 'Step 3 - Issuing a Certificate', instead of using one of the commands provided as example, use instead (source): sudo certbot certonly --dns-digitalocean --dns-digitalocean-credentials ~/certbot-creds.ini -d simpletables.xyz -d '*.simpletables.xyz' to acquire a wildcard certificate
    • NOTE: during step 2 you'll need to create a DigitalOcean token (instructions)
    • NOTE: DigitalOcean must be the DNS provider because you're using the certbot-dns-digitalocean plugin, if using any other provider you will get the error Unable to determine base domain for simpletables.xyz

Set up a free email

  • until now you used DigitalOcean as the DNS provider, however Namecheap offers functionalities DigitalOcean doesn't because of that you'll switch to Namecheap
    • on DigitalOcean, delete domain
    • on Namecheap, remove DigitalOcean's nameservers by choosing 'Namecheap BasicDNS' and adding the following records:
      • type: A record, host: @, value: droplet ip
      • type: A record, host: *, value: droplet ip
  • configure Namecheap to forward emails sent to a custom domain address (e.g. [email protected]) to a regular email (e.g. [email protected]) — at 'REDIRECT EMAIL' section add the following record (source):
  • to be able to send emails with your custom domain, you must set up a SMTP server — sign up to SMTP2GO with a custom domain email and follow given instructions
    • in SMTP2GO, SMTP username must be simpletables and have the same password as the one passed to run.sh script.

Renew certificate

  • first, you'll need to switch back to DigitalOcean from Namecheap when it's time to renew the SSL certificate otherwise you'll get the error Unable to determine base domain for simpletables.xyz
    • access the domain config page at Namecheap and change "nameservers" from "Namecheap BasicDNS" to "Custom DNS" and add DigitalOcean's nameservers (instructions); now on DigitalOcean, add domain to droplet the droplet and create a wildcard A record pointing to *
  • run sudo certbot renew --dry-run -v first to check everything will work and then sudo certbot renew to actually renew certificates that're near their expiration date
    • if you encounter the error Error finding domain using the DigitalOcean API: Unable to authenticate you (Did you provide a valid API token?) it's because the DigitalOcean's personal access token expired and you need to generate a new one and replace it on the file you created at Issue Let's Encrypt certificate section (if you followed the instructions precisely, file path is ~/certbot-creds.ini)
  • restart the droplet for the changes to take effect
  • when everything is working, you can switch back to Namecheap - check Set up a free email section for instructions

About

Vanilla PHP application written in the OOP paradigm & MVC design pattern with a relational database (MySQL). Styling: Bootstrap. Deployment: Docker, NameCheap, DigitalOcean, Certbot (Let's Encrypt) & SMTP2GO. Development: VSCode + Remote - SSH extension.

Topics

Resources

License

Stars

Watchers

Forks