Skip to content
bri25yu edited this page Nov 29, 2022 · 22 revisions

Welcome to the hknweb wiki!

Quick links

If you are new to development, check out the Git tutorial.

If you are new to web development, check out the HTML and CSS tutorials.

If you are new to Django, check out the Django tutorial.

If you are new to hknweb, check out the Layout section and the Contribution-Procedure page.

If you are maintaining hknweb, check out the Deployment section and the Miscellaneous page.

For more information, contact [email protected].

Layout

Where can I find what I'm looking for?

Path Description
.github/workflows Github actions config
config General non-python config files
hknweb The root application (hknweb)
keyrings/live GPG keyring, for authorizing access to encrypted secrets (Production Server Only)
scripts Top level scripts
tests Django tests
.gitattributes Git config for line endings (Windows \r\n -> Mac / Linux \n)
.gitignore Git config for files to ignore
LICENSE Legal license: open source, enforced by law
README.md General introduction file
bbtest.txt.gpg blackbox test file
fabfile.py Fabric deployment scripts
manage.py Django task runner
pyproject.toml Project maintenance config
run The production run script

Deployment

Our deployment pipeline deploys from compserv/master to OCF servers using fabfile.py.

# Activate our dev environment
conda activate hknweb-dev

# Depending on your ssh setup, this may or may not work for you:
fab deploy

# If your SSH key to the apphost requires a password to unlock:
fab --prompt-for-passphrase deploy

# If you have no SSH key to the apphost (shame on you), and require password authentication:
fab --prompt-for-login-password deploy

Rollback to Past Version

fab rollback --release <Timestamp of Folder>`

where the <Timestamp of Folder> with only the Folder Name you want to rollback to in ~/hknweb/prod/releases/ (you don't need the full path, just the name of the specific folder inside the "releases" folder)

Credits

The documentation on this wiki is largely written by @jameszhu and @ochan1. Thanks for their efforts at making compserv renewable!

Clone this wiki locally