Skip to content

How to use

Rostyslav Bryzgunov edited this page Mar 25, 2018 · 1 revision

Now when your project is up & running - let's create some stuff and share it.

Create superuser

You need a Django superuser. SSH to the host and do:

sudo su developer
workon code.kottenator.com
manage.py createsuperuser

Create project

You need a separate user which will be allowed to access a particular project files.

Go to Admin site (http://code.kottenator.com/admin/) → "Users" → "Add user". Don't grant him/her any admin roles! Put some random password - it won't be used for authentication.

For example, you've created visitor1 user. Now for authentication create some access keys (you can create multiple keys for the same user): Django Admin site → "Access keys" → "Add access key".

You have setup the authentication; now you need a project: Django Admin site → "Projects" → "Add project". Put some slug or ID into the "Code" field - it will be used in URL. E.g. secret-ui-42 → http://code.kottenator.com/projects/secret-ui-42/. And add some users with access to the project. If you'll leave "Users" empty - the project will be publicly available.

Create project files

SSH to the host and do:

sudo su developer
workon code.kottenator.com
mkdir src/vault/secret-ui-42/
nano src/vault/secret-ui-42/index.html
<h1>Hello, World!</h1>

Now logout from the Admin site and try to visit http://code.kottenator.com/projects/secret-ui-42/

It will require to enter an access key for the user who has permissions to view the project. Once you've authorized - it will be kept in session so you don't need to enter it every time.

This also affects static files, e.g. http://code.kottenator.com/projects/secret-ui-42/static/js/script.js will have the same level of protection.

Clone this wiki locally