diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6b721b2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Ian Adam Naval + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..0cdb89f --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +ianonavy +======== + +Source code for my personal website. + +Requirements +------------ + +* python 2.6+ +* pip +* virtualenv +* nginx +* supervisord + +Installing +---------- + +Exact commands vary with OS. + +1. Clone git repository. +2. Create a virtual environment in the same directory, and source the `activate` script. +3. Navigate into the directory and install the required Python packages with `pip install -r requirements.txt`. +4. Symlink or copy the file `conf/nginx.conf` into the nginx configuration directory (e.g. `/etc/nginx/conf.d/ianonavy.conf` for CentOS). +5. Symlink or copy the file `conf/supervisord.conf` into the supervisord configuration directory. +6. Reload the config files of both nginx and supervisord, and ensure that both daemons are running. + +Note that you probably need to edit the config files to point to the directory in which you cloned this repo as well as the `server_name` for nginx. + +Updating +-------- + +To update, just run `git pull` in the repository. For the Web service, you may need to instruct supervisord to restart the daemons. diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..4baab0e --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,40 @@ +server { + listen 80; + listen 443 default_server ssl; + + ssl_certificate /var/sites/ianonavy.com/ssl/unified.crt; + ssl_certificate_key /var/sites/ianonavy.com/ssl/ssl-decrypted.key; + + server_name *.ianonavy.com ianonavy.com www.ianonavy.com; + + access_log /var/log/nginx/ianonavy.access.log; + error_log /var/log/nginx/ianonavy.error.log; + + if ($host != 'ianonavy.com') { + rewrite ^/(.*)$ https://ianonavy.com/$1 permanent; + } + + root /var/sites/ianonavy.com/www; + + location = /robots.txt { + alias /var/www/robots/all/robots.txt; + } + + location /static/ { # STATIC_URL + alias /var/sites/ianonavy.com/www/src/static/; # STATIC_ROOT + expires off; + } + + location = /google9677fb7678857b96.html { + rewrite ^/(.*) $1; + return 200 "google-site-verification: google9677fb7678857b96.html"; + } + + location / { try_files $uri @ianonavy; } + location @ianonavy { + include fastcgi_params; + fastcgi_param PATH_INFO $fastcgi_script_name; + fastcgi_param SCRIPT_NAME ""; + fastcgi_pass unix:/tmp/ianonavy-fcgi.sock; + } +} diff --git a/conf/supervisord.conf b/conf/supervisord.conf new file mode 100644 index 0000000..d74983d --- /dev/null +++ b/conf/supervisord.conf @@ -0,0 +1,24 @@ +[fcgi-program:ianonavy] +command=/var/sites/ianonavy.com/www/src/ianonavy.fcgi +socket=unix:///tmp/ianonavy-fcgi.sock +process_name=%(program_name)s_%(process_num)02d +directory=/var/sites/ianonavy.com/www/src +environment=PATH="/var/sites/ianonavy.com/www/bin" +numprocs=5 +priority=999 +autostart=true +autorestart=true +startsecs=1 +startretries=3 +exitcodes=0,2 +stopsignal=QUIT +stopwaitsecs=10 +user=app +redirect_stderr=true +stdout_logfile=/tmp/ianonavy.log +stdout_logfile_maxbytes=1MB +stdout_logfile_backups=10 +stderr_logfile=/tmp/ianonavy_err.log +stderr_logfile_maxbytes=1MB +stderr_logfile_backups=10 + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5e605c2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +Flask +flup \ No newline at end of file diff --git a/src/ianonavy.fcgi b/src/ianonavy.fcgi new file mode 100755 index 0000000..448b011 --- /dev/null +++ b/src/ianonavy.fcgi @@ -0,0 +1,6 @@ +#!/usr/bin/env python +from flup.server.fcgi import WSGIServer +from server import app + +if __name__ == '__main__': + WSGIServer(app, bindAddress='/tmp/ianonavy-fcgi.sock', umask=0002).run() diff --git a/src/static/css/portfolio.css b/src/static/css/portfolio.css index 61c82e2..cb035b2 100644 --- a/src/static/css/portfolio.css +++ b/src/static/css/portfolio.css @@ -37,7 +37,7 @@ text-align: center; background-color: #e8e8e8; color: #000; - box-shadow: 4px 4px 6px #000; + box-shadow: 2px 2px 10px #0F0907; flex: 1 0 auto; } .portfolio-item p { margin: 0; @@ -45,10 +45,31 @@ /* iPhone */ @media only screen and (min-device-width: 320px) and (max-device-width: 568px) { + #header { + font-size: .8em; } + + .section { + padding: 8px; } + + .about-section { + margin: 0; + max-width: 288px; } + + .about-section ul { + padding: 0; + list-style: none; } + + .portfolio-items { + padding: 0; } + .portfolio-item { + margin: 8px 0 0; width: 256px; } - #calendar { + .technology-list img { + width: 100%; } + + #calendar, #calendar-label { display: none; } } .screenshot { margin: 0; @@ -58,7 +79,8 @@ #calendar { width: 100%; max-width: 1320px; - height: 480px; } + height: 480px; + border: 0; } /* Force image on its own line for two-column layout */ @media only screen and (min-width: 691px) and (max-width: 1054px) { diff --git a/src/static/css/portfolio.scss b/src/static/css/portfolio.scss index c0f85de..c7dfcb4 100644 --- a/src/static/css/portfolio.scss +++ b/src/static/css/portfolio.scss @@ -46,7 +46,7 @@ text-align: center; background-color: #e8e8e8; color: #000; - box-shadow: 4px 4px 6px #000; + box-shadow: 2px 2px 10px #0F0907; flex: 1 0 auto; p { @@ -59,11 +59,38 @@ @media only screen and (min-device-width : 320px) and (max-device-width : 568px) { + #header { + font-size: .8em; + } + + .section { + padding: 8px; + } + + .about-section { + margin: 0; + max-width: 288px; + } + + .about-section ul { + padding: 0; + list-style: none; + } + + .portfolio-items { + padding: 0; + } + .portfolio-item { + margin: 8px 0 0; width: 256px; } - #calendar { + .technology-list img { + width: 100%; + } + + #calendar, #calendar-label { display: none; } } @@ -78,6 +105,7 @@ and (max-device-width : 568px) { width: 100%; max-width: 1320px; height: 480px; + border: 0; } /* Force image on its own line for two-column layout */ diff --git a/src/static/css/style.css b/src/static/css/style.css index 2adaf06..fac4309 100644 --- a/src/static/css/style.css +++ b/src/static/css/style.css @@ -16,7 +16,7 @@ h1, h2, h3, h4 { /* Header */ #header { margin: 0; - padding: 16px; + padding: 16px 0 0; text-align: center; background: #222; color: #0f0; @@ -30,16 +30,19 @@ h1, h2, h3, h4 { } #tagline { - margin: 0; + margin: 0 auto; + padding: 0 0 8px; font-size: .9em; - color: #39e639; + color: #72bbfa; + border-bottom: 1px solid #fff; + width: 304px; } /* Navigation */ #nav { width: 100%; - margin: 16px 0 0; + margin: 8px 0 0; padding: 0; text-align: center; } @@ -52,13 +55,17 @@ h1, h2, h3, h4 { } #nav li { + /*width: 61px;*/ + margin: 0; display: inline-block; list-style: none; - padding: 0 1em 0; + padding: 4px 8px; + background-color: #fff; + border-radius: 2px 2px 0 0; } #nav a { - color: #b9f73e; + color: #428bca; } /* Main body */ @@ -95,6 +102,7 @@ h1, h2, h3, h4 { margin: 0; padding: .5em; clear: both; - background: #fff; + background: #222; + color: #fff; font-size: 1em; } diff --git a/src/static/img/competition.png b/src/static/img/competition.png new file mode 100644 index 0000000..75d5e8e Binary files /dev/null and b/src/static/img/competition.png differ diff --git a/src/static/img/ian-280.jpg b/src/static/img/ian-280.jpg new file mode 100644 index 0000000..25210b9 Binary files /dev/null and b/src/static/img/ian-280.jpg differ diff --git a/src/static/img/ian.jpg b/src/static/img/ian-original.jpg similarity index 100% rename from src/static/img/ian.jpg rename to src/static/img/ian-original.jpg diff --git a/src/templates/base.html b/src/templates/base.html index 81e9b42..f1bfacd 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -8,17 +8,15 @@ - + {% block extrastyle %}{% endblock extrastyle %} - -