The repository for my website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Austin Gill b550275e5e Add player statistics from tournament 1 month ago
agill.xyz Document things that configure.sh does 1 month ago
blog.agill.xyz Add static page to redirect to GitHub blog. 1 year ago
mc.agill.xyz Add player statistics from tournament 1 month ago
nginx Add player statistics from tournament 1 month ago
research.agill.xyz Fix broken research site. 5 months ago
shared_content Update VPN docs 1 month ago
.gitignore ignore backup files 6 months ago
LICENSE Initial commit 1 year ago
README.md Add TODOs for this summer 2 months ago
deploy.py Add Nginx configs for other subdomains. 1 year ago
requirements.txt update requirements 1 month ago
secret.py Add script to generate Django secret 1 year ago
symlinks.py Add django project for minecraft subdomain 1 year ago

README.md

Website

Repository for agill.xyz and all subdomains, as well as any shared content and Nginx configuration.


Repository Layout

  • agill.xyz/ - Django project for agill.xyz.
  • research.agill.xyz - Django project for research.agill.xyz.
  • shared_content/ - Static content and configuration shared across all Django projects. Things like CSS, headers, footers, etc. The smylinks.py script generates the necessary symlinks for each project to find this chared content.
  • nginx/ - Nginx and uWSGI configurations for each subdomain.
  • symlinks.py - Script to create symlinks for shared static content and Nginx configurations as above.
  • deploy.py - Deploys Nginx and uWSGI configurations to where they need to go.

TODO

  • Consider switching to Flask before doing renovation?
    • Django is too big for what I need. I don’t need the kitchen, much less the kitchen sink.
    • Should definitely be done before renovation…
  • What about large binary assets like PDFs, video, music, etc?
  • Find a better way to serve assets. Maybe even a static.agill.xyz Nginx server?
    • I’m frustrated with the current URLs
    • I’m frustrated by running ./manage.py collectstatic and how it works.
  • Maybe make deploy.py detect if a config is already there and make a backup?
  • Put sockets in /run/. Will require googling?
  • Add uWSGI master process to Emperor?
  • Add development Nginx configs that don’t require SSL. Other option: Use ./manage.py runserver
  • Collect scripts into one.
  • Figure out how to easily set up a development environment
  • Use bootstrap instead of home-grown CSS
  • Use markdown or html for pages?
  • Move content from wiki to website.
    • Find the right site layout for this.
    • Move to notes repository instead?
  • Redirect https://notgnoshi.github.io to https://blog.agill.xyz and make sure every link works.
    • Add pagination…
    • Add MathJax…
    • Remove Google Analytics in favor of writing a script to parse server logs. Could be an interesting data analytics project.
  • Update ubuntu configuration again
    • Change layout to be a documented form of my bashrc et al?
    • Two part documentation?
    • How to install and configure
    • The contents of my dotfiles

Site Structure

  • agill.xyz - about page with links to everything in the nav bar.
  • agill.xyz/docs/ - ubuntu configuration docs, anything worth saving from wiki
  • blog.agill.xyz - reproduce every post from notgnoshi.github.io without using Jekyll.
  • research.agill.xyz - The same kind of stuff. Need to restructure to make each project get its own page.

Deploying with Nginx and uWSGI

  1. Run sudo ./secret.py to create a Django secret to /etc/django/secret.txt. Only needs to be ran once.
  2. Run ./symlinks.py
  3. In each subdomain, run ./manage.py collectstatic.
  4. Then deploy the Nginx and uWSGI configurations by running the deploy.py script.

    sudo ./deploy.py --clean
    sudo ./deploy.py --enable --startup
    
    sudo systemctl daemon-reload
    sudo service nginx restart
    sudo service emperor start
    
    less /tmp/emperor.log
    less /var/log/nginx/error.log
    

Deploying with Django using Development settings

Use the Django manage.py to run a test server with the SSL and other settings disabled.

git checkout master
git pull --rebase
git checkout -b dev/<name>
git apply shared_content/Add-development-settings.patch
git commit -am "NOMERGE: Add development settings."

Then run

# Write the /etc/django/secret.txt file.
sudo ./secret.py
# Set up the necessary symlinks between shared content and each site.
./symlinks.py
# Run the site being worked on.
cd <site name>
./manage.py runserver

and make the desired changes. Once development is done, interactively rebase onto master, dropping the NOMERGE commit.

git rebase --interactive master
# Drop the NOMERGE commit
git checkout master
git merge dev/<name>

Dependencies

  • django-pygmentify
  • django
  • uwsgi