Site hosting on Github.com
Here is an overview of how to setup a site on Github.com, with RdbHost database hosting.
Create a Github Account:
This is very straightforward, following the prompts at Github. You do need an account per site, each with its own public key.
Create an Eponymous Repository
Create a new repository in your account, named for the account; If your account is named 'example', the repository would be 'example.github.com'. There are well-written step-by-step instructions for setting up pages on pages.github.com Read the 'User & Organization Pages' section at the top, and the 'Custom Domains' section at the bottom.
The instructions on github.com seem to expect a bash shell. I used windows git-bash, which is built on msys, and it works fine.
Once the eponymous repository is created, commited, and pushed, wait a few minutes, and you should have a site at 'example.github.com'. If you did not include an index.html file, you will see a github error page, but that's ok for now. We still need to setup the real domain name.
The following two screenshots show the sequence of git commands and git's responses, for setting up RdbHost's demo page.
Put Page Content in Repo
Create a file 'index.html' in your new repository, and commit and push it. The site indicates putting the file in the 'master' branch, but that is the default. Also create a file called 'CNAME', and put your domain name in it, as the only line. My repository CNAME file says 'gh.rdbhost.com', but domains without subdomain work as well.
We have a tutorial on setting up domain pointers at GoDaddy, and the following is a screenshot of how one registrar handles zone editing, and RdbHost's domain configuration. This example also illustrates the recommended practice of creating a TXT record with your account number.
After you commit and push the CNAME file, you should be able to access your static index.html at that domain.
Register Domain on RdbHost Account
Add the chosen domain to your RdbHost account configuration at the /mbr/domain page.
Develop Your App
Develop your app in your 'example.github.com' folder, and periodically commit and push it to the github.com server. You will be able to test it at the internet domain as well as on localhost.
We have a demonstration app, on gh.rdbhost.com, called 'Three Faves'. This is the simplest database example app I could think of that might be fun. You enter 3 favorite things, and it looks for other people in the database that also entered any of those things, and shows you what else they entered. It is completely anonymous, and has a crowd-sourced bad-words filter.
The 'Three Faves' app uses the preauth role, which is only permitted to run white-listed queries, so the database is protected from somebody trying to run arbitrary destructive queries as that role.
The creation of tables, views, indexes, etc, can be incorporated into your app, but the Rdbadmin utility is useful for creating initial tables and such. Use SQL GRANT to grant necessary privileges to the chosen roles.
To summarize the main points:
- You can host static pages on Github.com, under your own domain, and use RdbHost hosted databases from those static pages.
- Setup roles on RdbHost, and grant appropriate privileges to tables and other resources..
- Create tables and indexes using the Rdbadmin utility.
- Develop your application, clear the whitelist, repopulate with valid queries by testing every app feature, and you are done.