--- /dev/null
+10.80.136.1 - - [21/Nov/2015:11:06:40 +0000] "POST /newuser HTTP/1.1" 200 2776 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:06:41 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:06:42 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:06:42 +0000] "GET /healthmetrics HTTP/1.1" 200 3048 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:06:42 +0000] "POST /newuser HTTP/1.1" 200 2776 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:06:42 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:06:42 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:06:42 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:06:43 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:07:39 +0000] "POST /newuser HTTP/1.1" 200 2776 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:07:40 +0000] "POST /login HTTP/1.1" 200 2825 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:07:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:07:40 +0000] "GET /healthmetrics HTTP/1.1" 200 3047 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:07:40 +0000] "POST /newuser HTTP/1.1" 200 2776 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:07:40 +0000] "POST /login HTTP/1.1" 200 2830 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:07:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:07:40 +0000] "POST /login HTTP/1.1" 200 2830 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:07:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:07:41 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:07:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:08:40 +0000] "POST /newuser HTTP/1.1" 200 2776 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:08:40 +0000] "POST /login HTTP/1.1" 200 2825 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:08:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:08:40 +0000] "GET /healthmetrics HTTP/1.1" 200 3049 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:08:41 +0000] "POST /newuser HTTP/1.1" 200 2776 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:08:41 +0000] "POST /login HTTP/1.1" 200 2823 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:08:41 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:08:41 +0000] "POST /login HTTP/1.1" 200 2823 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:08:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:08:42 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:08:42 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:09:40 +0000] "POST /newuser HTTP/1.1" 200 2776 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:09:40 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:09:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:09:40 +0000] "GET /healthmetrics HTTP/1.1" 200 3049 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:09:40 +0000] "POST /newuser HTTP/1.1" 200 2776 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:09:41 +0000] "POST /login HTTP/1.1" 200 2823 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:09:41 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:09:41 +0000] "POST /login HTTP/1.1" 200 2823 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:09:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:09:41 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:09:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:11:40 +0000] "POST /newuser HTTP/1.1" 200 2776 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:11:40 +0000] "POST /login HTTP/1.1" 200 2822 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:11:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:11:40 +0000] "GET /healthmetrics HTTP/1.1" 200 3049 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:11:40 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:11:40 +0000] "POST /login HTTP/1.1" 200 2825 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:11:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:11:41 +0000] "POST /login HTTP/1.1" 200 2825 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:11:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:11:41 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:11:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:12:40 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:12:40 +0000] "POST /login HTTP/1.1" 200 2830 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:12:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:12:40 +0000] "GET /healthmetrics HTTP/1.1" 200 3048 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:12:40 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:12:40 +0000] "POST /login HTTP/1.1" 200 2825 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:12:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:12:41 +0000] "POST /login HTTP/1.1" 200 2825 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:12:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:12:41 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:12:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:13:40 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:13:40 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:13:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:13:40 +0000] "GET /healthmetrics HTTP/1.1" 200 3047 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:13:40 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:13:41 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:13:41 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:13:41 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:13:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:13:41 +0000] "POST /login HTTP/1.1" 200 2823 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:13:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:14:40 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:14:40 +0000] "POST /login HTTP/1.1" 200 2830 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:14:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:14:40 +0000] "GET /healthmetrics HTTP/1.1" 200 3049 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:14:40 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:14:40 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:14:41 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:14:41 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:14:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:14:41 +0000] "POST /login HTTP/1.1" 200 2825 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:14:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:16:39 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:16:40 +0000] "POST /login HTTP/1.1" 200 2825 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:16:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:16:40 +0000] "GET /healthmetrics HTTP/1.1" 200 3048 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:16:40 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:16:40 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:16:40 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:16:41 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:16:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:16:41 +0000] "POST /login HTTP/1.1" 200 2825 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:16:41 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:17:51 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:17:51 +0000] "POST /login HTTP/1.1" 200 2822 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:17:51 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:17:51 +0000] "GET /healthmetrics HTTP/1.1" 200 3048 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:17:51 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:17:52 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:17:52 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:17:52 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:17:52 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:17:52 +0000] "POST /login HTTP/1.1" 200 2830 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:17:52 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:18:53 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:18:53 +0000] "POST /login HTTP/1.1" 200 2822 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:18:53 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:18:53 +0000] "GET /healthmetrics HTTP/1.1" 200 3049 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:18:54 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:18:54 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:18:54 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:18:54 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:18:54 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:18:54 +0000] "POST /login HTTP/1.1" 200 2823 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:18:55 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:19:51 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:19:51 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:19:51 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:19:51 +0000] "GET /healthmetrics HTTP/1.1" 200 3048 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:19:52 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:19:52 +0000] "POST /login HTTP/1.1" 200 2826 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:19:52 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:19:52 +0000] "POST /login HTTP/1.1" 200 2826 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:19:52 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:19:52 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:19:53 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:20:53 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:20:54 +0000] "POST /login HTTP/1.1" 200 2830 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:20:54 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:20:54 +0000] "GET /healthmetrics HTTP/1.1" 200 3049 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:20:54 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:20:54 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:20:54 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:20:55 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:20:55 +0000] "GET /healthmetrics HTTP/1.1" 200 3066 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:20:55 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:20:55 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:21:51 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:21:51 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:21:51 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:21:52 +0000] "GET /healthmetrics HTTP/1.1" 200 3048 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:21:52 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:21:52 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:21:52 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:21:52 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:21:52 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:21:53 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:21:53 +0000] "GET /healthmetrics HTTP/1.1" 200 3066 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:22:52 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:22:52 +0000] "POST /login HTTP/1.1" 200 2825 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:22:53 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:22:53 +0000] "GET /healthmetrics HTTP/1.1" 200 3049 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:22:53 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:22:53 +0000] "POST /login HTTP/1.1" 200 2823 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:22:53 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:22:53 +0000] "POST /login HTTP/1.1" 200 2823 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:22:54 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:22:54 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:22:54 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:23:52 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:23:52 +0000] "POST /login HTTP/1.1" 200 2829 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:23:52 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:23:52 +0000] "GET /healthmetrics HTTP/1.1" 200 3048 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:23:53 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:23:53 +0000] "POST /login HTTP/1.1" 200 2826 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:23:53 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:23:53 +0000] "POST /login HTTP/1.1" 200 2826 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:23:53 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:23:53 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:23:54 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:24:52 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:24:52 +0000] "POST /login HTTP/1.1" 200 2823 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:24:52 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:24:53 +0000] "GET /healthmetrics HTTP/1.1" 200 3048 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:24:53 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:24:53 +0000] "POST /login HTTP/1.1" 200 2822 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:24:53 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:24:53 +0000] "POST /login HTTP/1.1" 200 2822 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:24:53 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:24:54 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:24:54 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:25:51 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:25:51 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:25:52 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:25:52 +0000] "GET /healthmetrics HTTP/1.1" 200 3049 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:25:52 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:25:52 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:25:52 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:25:52 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:25:53 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:25:53 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:25:53 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:26:54 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:26:54 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:26:54 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:26:54 +0000] "GET /healthmetrics HTTP/1.1" 200 3049 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:26:55 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:26:55 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:26:55 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:26:55 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:26:55 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:26:55 +0000] "POST /login HTTP/1.1" 200 2826 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:26:56 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:27:54 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:27:54 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:27:54 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:27:54 +0000] "GET /healthmetrics HTTP/1.1" 200 3048 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:27:55 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:27:55 +0000] "POST /login HTTP/1.1" 200 2822 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:27:55 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:27:55 +0000] "POST /login HTTP/1.1" 200 2822 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:27:55 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:27:56 +0000] "POST /login HTTP/1.1" 200 2828 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:27:56 +0000] "GET /healthmetrics HTTP/1.1" 200 3067 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:28:53 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:28:53 +0000] "POST /login HTTP/1.1" 200 2826 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:28:53 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:28:53 +0000] "GET /healthmetrics HTTP/1.1" 200 3047 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:28:54 +0000] "POST /newuser HTTP/1.1" 200 2777 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:28:54 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:28:54 +0000] "POST /addhealthmetrics HTTP/1.1" 200 2840 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:28:54 +0000] "POST /login HTTP/1.1" 200 2824 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:28:54 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:28:55 +0000] "POST /login HTTP/1.1" 200 2822 "-" "Python-urllib/3.2"
+10.80.136.1 - - [21/Nov/2015:11:28:55 +0000] "GET /healthmetrics HTTP/1.1" 200 3068 "-" "Python-urllib/3.2"
--- /dev/null
+package main
+
+import (
+ "database/sql"
+ _ "github.com/mattn/go-sqlite3"
+ "errors"
+ "sync"
+)
+const (
+ DbName = "./health.db"
+ CreateIndicesTable = "CREATE TABLE IF NOT EXISTS healthIndices(id integer not null primary key AUTOINCREMENT, userId integer, weight integer, bp integer, pulse integer, walking_distance integer, comment text)"
+ InsertValues = "INSERT INTO healthIndices(userId, weight, bp, pulse, walking_distance, comment) VALUES (?, ?, ?, ?, ?, ?)"
+ SelectRows = "SELECT id, weight, bp, pulse, walking_distance, comment FROM healthIndices WHERE userId = ?"
+ SelectTopRows = "SELECT id, comment FROM healthIndices LIMIT 10"
+
+)
+
+const (
+ CreateUsersTable = "CREATE TABLE IF NOT EXISTS users(id integer not null primary key AUTOINCREMENT, login text, pass text)"
+ FindUserByLogin = "SELECT id, login FROM users WHERE login = ?"
+ FindUser = "SELECT id FROM users WHERE login = ? AND pass = ?"
+ AddUser = "INSERT INTO users (login, pass) VALUES (?, ?)"
+)
+
+const (
+ Success = iota
+ Error = iota
+ AlreadyExists = iota
+)
+
+var db *sql.DB
+var m sync.Mutex
+
+func tryAddMetrics(uId int, metrics *HealthMetrics) (bool, int64) {
+ m.Lock()
+ defer m.Unlock()
+
+ stmt, err := db.Prepare(InsertValues)
+ if err != nil {
+ logger.Fatal(err)
+ return false, -1
+ }
+ defer stmt.Close()
+
+ res, err := stmt.Exec(uId, metrics.Weight, metrics.BloodPressure, metrics.Pulse, metrics.WalkingDistance, metrics.Comment)
+ if err != nil {
+ logger.Fatal(err)
+ return false, -1
+ }
+
+ id, err := res.LastInsertId()
+ if err != nil {
+ logger.Fatal(err)
+ return false, -1
+ }
+
+ return true, id
+}
+
+func tryGetUserMetrics(uId string) (bool, []HealthMetrics) {
+ m.Lock()
+ defer m.Unlock()
+
+ var res []HealthMetrics
+
+ stmt, err := db.Prepare(SelectRows)
+ if err != nil {
+ logger.Fatal(err)
+ return false, nil
+ }
+ defer stmt.Close()
+
+ id := parseUId(uId)
+
+ rows, err := stmt.Query(id)
+ if err != nil {
+ logger.Fatal(err)
+ return false, nil
+ }
+ defer rows.Close()
+
+ for rows.Next() {
+ var id int
+ var weight int
+ var bp int
+ var pulse int
+ var wd int
+ var comment string
+ rows.Scan(&id, &weight, &bp, &pulse, &wd, &comment)
+ m := &HealthMetrics{weight, bp, pulse, wd, comment}
+ res = append(res, *m)
+ }
+ return true, res
+}
+
+func tryAddUser(user *User) (int, string){
+ m.Lock()
+ defer m.Unlock()
+
+ rows, err := db.Query(FindUserByLogin, user.Login)
+ if err != nil {
+ logger.Fatal(err)
+ return Error, ""
+ }
+ defer rows.Close()
+
+ if rows.Next() {
+ return AlreadyExists, ""
+ }
+
+ stmt, err := db.Prepare(AddUser)
+ if err != nil {
+ logger.Fatal(err)
+ return Error, ""
+ }
+ defer stmt.Close()
+
+ res, err := stmt.Exec(user.Login, user.Pass)
+ if err != nil {
+ logger.Fatal(err)
+ return Error, ""
+ }
+
+ id, err := res.LastInsertId()
+ if err != nil {
+ logger.Fatal(err)
+ return Error, ""
+ }
+
+ return Success, createUId(id)
+}
+
+func findUser(user *User) (string, error) {
+ m.Lock()
+ defer m.Unlock()
+
+ stmt, err := db.Prepare(FindUser)
+ if err != nil {
+ logger.Fatal(err)
+ return "", errors.New("Can't find user")
+ }
+ defer stmt.Close()
+
+ rows, err := stmt.Query(user.Login, user.Pass)
+ if err != nil {
+ logger.Fatal(err)
+ return "", errors.New("Can't find user")
+ }
+ defer rows.Close()
+
+ if rows.Next() {
+ var id int64
+ rows.Scan(&id)
+ return createUId(id), nil
+ }
+ return "", errors.New("")
+}
+
+func prepareDb() {
+ var err error
+ db, err = sql.Open("sqlite3", DbName)
+ checkErr(err)
+
+ _, err = db.Exec(CreateIndicesTable)
+ checkErr(err)
+
+ _, err = db.Exec(CreateUsersTable)
+ checkErr(err)
+}
+
+func checkErr(err error) {
+ if err != nil {
+ logger.Fatal(err)
+ panic(err)
+ }
+}
\ No newline at end of file
--- /dev/null
+package main
+
+import (
+ "net/http"
+ "strconv"
+ "fmt"
+)
+
+type HealthMetrics struct {
+ Weight int
+ BloodPressure int
+ Pulse int
+ WalkingDistance int
+ Comment string
+}
+
+func parseFromForm(r *http.Request) *HealthMetrics {
+ weight, err := strconv.Atoi(r.FormValue("Weight"))
+ if err != nil {
+ return nil
+ }
+ bp, err := strconv.Atoi(r.FormValue("BloodPressure"))
+ if err != nil {
+ return nil
+ }
+ pulse, err := strconv.Atoi(r.FormValue("Pulse"))
+ if err != nil {
+ return nil
+ }
+ wdistance, err := strconv.Atoi(r.FormValue("WalkingDistance"))
+ if err != nil {
+ return nil
+ }
+ comment := r.FormValue("Comment")
+
+ result := &HealthMetrics{weight, bp, pulse, wdistance, comment}
+ return result
+}
+
+func (this HealthMetrics) toString() string {
+ return fmt.Sprintf("%d, %d, %d, %d, %v", this.Weight, this.BloodPressure, this.Pulse, this.WalkingDistance, this.Comment)
+}
\ No newline at end of file
--- /dev/null
+2015/11/19 23:33:14 server.go:197: Port to start on: 8000
+2015/11/20 00:55:55 server.go:197: Port to start on: 8000
+2015/11/20 01:07:57 server.go:197: Port to start on: 8000
+2015/11/20 01:34:01 server.go:197: Port to start on: 8000
+2015/11/20 01:37:42 server.go:197: Port to start on: 8000
+2015/11/20 01:43:48 server.go:197: Port to start on: 8000
+2015/11/20 10:28:36 server.go:197: Port to start on: 8000
+2015/11/20 14:02:14 server.go:197: Port to start on: 8000
+2015/11/20 14:15:38 server.go:197: Port to start on: 8000
+2015/11/21 10:14:53 server.go:197: Port to start on: 8000
+2015/11/21 10:21:07 server.go:197: Port to start on: 8000
+2015/11/21 10:23:06 server.go:197: Port to start on: 8000
+2015/11/21 10:24:41 server.go:197: Port to start on: 8000
+2015/11/21 10:40:02 server.go:197: Port to start on: 8000
+2015/11/21 11:00:42 server.go:197: Port to start on: 8000
+2015/11/21 11:05:30 server.go:197: Port to start on: 8000
+2015/11/21 11:06:40 server.go:149: Incoming request: /newuser Login=Fpdjxuzrkgv; Pass=4902f6799a114bce440f655596ccce94229df3b0; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:06:41 server.go:149: Incoming request: /login Login=Fpdjxuzrkgv; Pass=4902f6799a114bce440f655596ccce94229df3b0; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:06:41 server.go:149: Incoming request: /addhealthmetrics Comment=Totally fine!; BloodPressure=106; Pulse=85; Weight=66; WalkingDistance=4398; Id cookie was set; Auth cookie was set;
+2015/11/21 11:06:42 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:06:42 server.go:149: Incoming request: /newuser Login=Ozmtgpdfqgm; Pass=4bc99c8e05aa9c721eca684355f744a86758def7; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:06:42 server.go:149: Incoming request: /login Login=Ozmtgpdfqgm; Pass=4bc99c8e05aa9c721eca684355f744a86758def7; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:06:42 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=9561; Comment=EKLH111Z5YCL84A6IVCBZD52V5EEVZZ=; BloodPressure=98; Pulse=117; Weight=41; Id cookie was set; Auth cookie was set;
+2015/11/21 11:06:42 server.go:149: Incoming request: /login Pass=4bc99c8e05aa9c721eca684355f744a86758def7; Login=Ozmtgpdfqgm; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:06:43 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:07:39 server.go:149: Incoming request: /newuser Login=Mtgaglh; Pass=a6dc5e4e60da14c7fc2376d6827ab02f243a8eb8; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:07:39 server.go:149: Incoming request: /login Login=Mtgaglh; Pass=a6dc5e4e60da14c7fc2376d6827ab02f243a8eb8; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:07:40 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=1165; Comment=Totally fine!; BloodPressure=83; Pulse=98; Weight=55; Id cookie was set; Auth cookie was set;
+2015/11/21 11:07:40 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:07:40 server.go:149: Incoming request: /newuser Login=Zuteyerzzrke; Pass=47e44ee7dca9067f40139ca8ca24663fe279b032; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:07:40 server.go:149: Incoming request: /login Login=Zuteyerzzrke; Pass=47e44ee7dca9067f40139ca8ca24663fe279b032; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:07:40 server.go:149: Incoming request: /addhealthmetrics Comment=YPXKUTE2DEDDGLC7NM5IPO5SF5BWERI=; BloodPressure=82; Pulse=138; Weight=45; WalkingDistance=3951; Id cookie was set; Auth cookie was set;
+2015/11/21 11:07:40 server.go:149: Incoming request: /login Login=Zuteyerzzrke; Pass=47e44ee7dca9067f40139ca8ca24663fe279b032; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:07:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:07:41 server.go:149: Incoming request: /login Login=Ozmtgpdfqgm; Pass=4bc99c8e05aa9c721eca684355f744a86758def7; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:07:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:08:40 server.go:149: Incoming request: /newuser Login=Llhxsny; Pass=b93d1b6a20027a7bc6b49ba107d9a62b4fbcaf0b; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:08:40 server.go:149: Incoming request: /login Pass=b93d1b6a20027a7bc6b49ba107d9a62b4fbcaf0b; Login=Llhxsny; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:08:40 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=9211; Comment=Totally fine!; BloodPressure=111; Pulse=114; Weight=71; Id cookie was set; Auth cookie was set;
+2015/11/21 11:08:40 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:08:41 server.go:149: Incoming request: /newuser Login=Rjotj; Pass=0506269acd48072e32f93ebf3c1733b78368adac; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:08:41 server.go:149: Incoming request: /login Login=Rjotj; Pass=0506269acd48072e32f93ebf3c1733b78368adac; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:08:41 server.go:149: Incoming request: /addhealthmetrics Comment=RO0OMJN3TW117BB3J3BO2ZD5IZ16A6D=; BloodPressure=108; Pulse=103; Weight=72; WalkingDistance=7256; Id cookie was set; Auth cookie was set;
+2015/11/21 11:08:41 server.go:149: Incoming request: /login Login=Rjotj; Pass=0506269acd48072e32f93ebf3c1733b78368adac; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:08:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:08:42 server.go:149: Incoming request: /login Login=Ozmtgpdfqgm; Pass=4bc99c8e05aa9c721eca684355f744a86758def7; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:08:42 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:09:40 server.go:149: Incoming request: /newuser Pass=8b674c2f32aeea736ce2a5ad5d8f407544fda78b; Login=Jyvstugudvn; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:09:40 server.go:149: Incoming request: /login Login=Jyvstugudvn; Pass=8b674c2f32aeea736ce2a5ad5d8f407544fda78b; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:09:40 server.go:149: Incoming request: /addhealthmetrics BloodPressure=102; Pulse=111; Weight=46; WalkingDistance=2776; Comment=Totally fine!; Id cookie was set; Auth cookie was set;
+2015/11/21 11:09:40 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:09:40 server.go:149: Incoming request: /newuser Login=Kgdzu; Pass=820aafc425289eea533ef3445d7abf13701ae279; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:09:41 server.go:149: Incoming request: /login Login=Kgdzu; Pass=820aafc425289eea533ef3445d7abf13701ae279; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:09:41 server.go:149: Incoming request: /addhealthmetrics Comment=2MG4QR2A459PQ9LOTMFKC4XGZ8V91QZ=; BloodPressure=86; Pulse=108; Weight=47; WalkingDistance=3909; Id cookie was set; Auth cookie was set;
+2015/11/21 11:09:41 server.go:149: Incoming request: /login Pass=820aafc425289eea533ef3445d7abf13701ae279; Login=Kgdzu; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:09:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:09:41 server.go:149: Incoming request: /login Login=Ozmtgpdfqgm; Pass=4bc99c8e05aa9c721eca684355f744a86758def7; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:09:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:11:40 server.go:149: Incoming request: /newuser Login=Xyvb; Pass=5aa94ec9a890cc43fe240eab5d28bbea524ef834; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:11:40 server.go:149: Incoming request: /login Login=Xyvb; Pass=5aa94ec9a890cc43fe240eab5d28bbea524ef834; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:11:40 server.go:149: Incoming request: /addhealthmetrics Comment=Totally fine!; BloodPressure=106; Pulse=146; Weight=45; WalkingDistance=4026; Id cookie was set; Auth cookie was set;
+2015/11/21 11:11:40 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:11:40 server.go:149: Incoming request: /newuser Login=Bgfhome; Pass=86ae7de32d35fa4bf2e4841f5745d86832eab7d0; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:11:40 server.go:149: Incoming request: /login Login=Bgfhome; Pass=86ae7de32d35fa4bf2e4841f5745d86832eab7d0; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:11:40 server.go:149: Incoming request: /addhealthmetrics Comment=71AEQA58OZ5B4HMWMBCEMUCILGYATN6=; BloodPressure=101; Pulse=94; Weight=85; WalkingDistance=5449; Id cookie was set; Auth cookie was set;
+2015/11/21 11:11:41 server.go:149: Incoming request: /login Login=Bgfhome; Pass=86ae7de32d35fa4bf2e4841f5745d86832eab7d0; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:11:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:11:41 server.go:149: Incoming request: /login Login=Ozmtgpdfqgm; Pass=4bc99c8e05aa9c721eca684355f744a86758def7; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:11:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:12:40 server.go:149: Incoming request: /newuser Login=Mjxqiurshjqq; Pass=5399ecacbb529cca9855ca4b7aeb22c10fffc175; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:12:40 server.go:149: Incoming request: /login Pass=5399ecacbb529cca9855ca4b7aeb22c10fffc175; Login=Mjxqiurshjqq; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:12:40 server.go:149: Incoming request: /addhealthmetrics Weight=49; WalkingDistance=9006; Comment=Totally fine!; BloodPressure=85; Pulse=116; Id cookie was set; Auth cookie was set;
+2015/11/21 11:12:40 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:12:40 server.go:149: Incoming request: /newuser Login=Uttazpb; Pass=7c74c7fa2dd5f7b2a715a1a9e3f93cffa5f348e9; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:12:40 server.go:149: Incoming request: /login Login=Uttazpb; Pass=7c74c7fa2dd5f7b2a715a1a9e3f93cffa5f348e9; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:12:40 server.go:149: Incoming request: /addhealthmetrics Weight=48; WalkingDistance=6153; Comment=CZM8MFS30TFW92ZNGFQ6MAT8MZPXK5V=; BloodPressure=112; Pulse=82; Id cookie was set; Auth cookie was set;
+2015/11/21 11:12:41 server.go:149: Incoming request: /login Login=Uttazpb; Pass=7c74c7fa2dd5f7b2a715a1a9e3f93cffa5f348e9; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:12:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:12:41 server.go:149: Incoming request: /login Login=Ozmtgpdfqgm; Pass=4bc99c8e05aa9c721eca684355f744a86758def7; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:12:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:13:40 server.go:149: Incoming request: /newuser Login=Xmgblpdruaf; Pass=a447e2a7ac958b0eb61623abaed9afea0a749d81; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:13:40 server.go:149: Incoming request: /login Login=Xmgblpdruaf; Pass=a447e2a7ac958b0eb61623abaed9afea0a749d81; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:13:40 server.go:149: Incoming request: /addhealthmetrics BloodPressure=96; Pulse=94; Weight=49; WalkingDistance=4527; Comment=Totally fine!; Id cookie was set; Auth cookie was set;
+2015/11/21 11:13:40 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:13:40 server.go:149: Incoming request: /newuser Login=Ojnort; Pass=70411338fc08651b53e7c4916f5d0ae33ef8aa37; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:13:40 server.go:149: Incoming request: /login Pass=70411338fc08651b53e7c4916f5d0ae33ef8aa37; Login=Ojnort; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:13:41 server.go:149: Incoming request: /addhealthmetrics Comment=PH2TJ5QBYN8FUNQ85Q88OGQWIDXG4BC=; BloodPressure=116; Pulse=130; Weight=70; WalkingDistance=5605; Id cookie was set; Auth cookie was set;
+2015/11/21 11:13:41 server.go:149: Incoming request: /login Login=Ojnort; Pass=70411338fc08651b53e7c4916f5d0ae33ef8aa37; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:13:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:13:41 server.go:149: Incoming request: /login Pass=820aafc425289eea533ef3445d7abf13701ae279; Login=Kgdzu; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:13:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:14:39 server.go:149: Incoming request: /newuser Login=Cndfiqemskgo; Pass=c1b72f2e769371e9b98fda9772b8b6791fa2c05e; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:14:40 server.go:149: Incoming request: /login Login=Cndfiqemskgo; Pass=c1b72f2e769371e9b98fda9772b8b6791fa2c05e; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:14:40 server.go:149: Incoming request: /addhealthmetrics Pulse=142; Weight=61; WalkingDistance=1312; Comment=Totally fine!; BloodPressure=100; Id cookie was set; Auth cookie was set;
+2015/11/21 11:14:40 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:14:40 server.go:149: Incoming request: /newuser Pass=69af11224f689096c20fad1615dea368cc644b88; Login=Pwgllxbhhi; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:14:40 server.go:149: Incoming request: /login Login=Pwgllxbhhi; Pass=69af11224f689096c20fad1615dea368cc644b88; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:14:40 server.go:149: Incoming request: /addhealthmetrics Comment=OX1XMTCOO37MQO3X93DBNZ3K88PR2WN=; BloodPressure=82; Pulse=104; Weight=65; WalkingDistance=4485; Id cookie was set; Auth cookie was set;
+2015/11/21 11:14:41 server.go:149: Incoming request: /login Pass=69af11224f689096c20fad1615dea368cc644b88; Login=Pwgllxbhhi; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:14:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:14:41 server.go:149: Incoming request: /login Login=Uttazpb; Pass=7c74c7fa2dd5f7b2a715a1a9e3f93cffa5f348e9; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:14:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:16:39 server.go:149: Incoming request: /newuser Login=Kigupnt; Pass=c8202aabf2e78b137644cc61f257f3bab09cf7f6; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:16:39 server.go:149: Incoming request: /login Pass=c8202aabf2e78b137644cc61f257f3bab09cf7f6; Login=Kigupnt; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:16:40 server.go:149: Incoming request: /addhealthmetrics Weight=53; WalkingDistance=7055; Comment=Totally fine!; BloodPressure=117; Pulse=86; Id cookie was set; Auth cookie was set;
+2015/11/21 11:16:40 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:16:40 server.go:149: Incoming request: /newuser Login=Rlmfqp; Pass=0826624eb0aeafd903cf58560e98852ef7dfabc2; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:16:40 server.go:149: Incoming request: /login Login=Rlmfqp; Pass=0826624eb0aeafd903cf58560e98852ef7dfabc2; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:16:40 server.go:149: Incoming request: /addhealthmetrics BloodPressure=105; Pulse=136; Weight=40; WalkingDistance=4752; Comment=RALTPQ5SCHSCRHM04R8AURA5OAH5FA2=; Id cookie was set; Auth cookie was set;
+2015/11/21 11:16:40 server.go:149: Incoming request: /login Pass=0826624eb0aeafd903cf58560e98852ef7dfabc2; Login=Rlmfqp; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:16:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:16:41 server.go:149: Incoming request: /login Login=Uttazpb; Pass=7c74c7fa2dd5f7b2a715a1a9e3f93cffa5f348e9; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:16:41 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:17:51 server.go:149: Incoming request: /newuser Login=Ylib; Pass=60ab9b14b89f9ac64a4542ed200b31bc13b66b00; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:17:51 server.go:149: Incoming request: /login Login=Ylib; Pass=60ab9b14b89f9ac64a4542ed200b31bc13b66b00; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:17:51 server.go:149: Incoming request: /addhealthmetrics BloodPressure=114; Pulse=81; Weight=91; WalkingDistance=6005; Comment=Totally fine!; Id cookie was set; Auth cookie was set;
+2015/11/21 11:17:51 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:17:51 server.go:149: Incoming request: /newuser Pass=8e6734391d3a288612fc0d56344fe3c977fac689; Login=Atdfqbaxpq; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:17:51 server.go:149: Incoming request: /login Pass=8e6734391d3a288612fc0d56344fe3c977fac689; Login=Atdfqbaxpq; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:17:52 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=5418; Comment=ZN4M8D09XEJEADZ4FGBKZPV49B4HK0F=; BloodPressure=108; Pulse=120; Weight=46; Id cookie was set; Auth cookie was set;
+2015/11/21 11:17:52 server.go:149: Incoming request: /login Login=Atdfqbaxpq; Pass=8e6734391d3a288612fc0d56344fe3c977fac689; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:17:52 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:17:52 server.go:149: Incoming request: /login Login=Zuteyerzzrke; Pass=47e44ee7dca9067f40139ca8ca24663fe279b032; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:17:52 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:18:53 server.go:149: Incoming request: /newuser Pass=1c7d6943cf21836ddf40e108d5ce10133f28d8e7; Login=Hsrh; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:18:53 server.go:149: Incoming request: /login Login=Hsrh; Pass=1c7d6943cf21836ddf40e108d5ce10133f28d8e7; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:18:53 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=4573; Comment=Totally fine!; BloodPressure=115; Pulse=131; Weight=76; Id cookie was set; Auth cookie was set;
+2015/11/21 11:18:53 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:18:54 server.go:149: Incoming request: /newuser Login=Borpnu; Pass=db46f062ba58d73ca201a2216cd692efe4e7b7da; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:18:54 server.go:149: Incoming request: /login Login=Borpnu; Pass=db46f062ba58d73ca201a2216cd692efe4e7b7da; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:18:54 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=4091; Comment=4B4SL3KRM7D9ASFGH9ZW98KKCRWXHOX=; BloodPressure=94; Pulse=104; Weight=59; Id cookie was set; Auth cookie was set;
+2015/11/21 11:18:54 server.go:149: Incoming request: /login Login=Borpnu; Pass=db46f062ba58d73ca201a2216cd692efe4e7b7da; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:18:54 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:18:54 server.go:149: Incoming request: /login Login=Kgdzu; Pass=820aafc425289eea533ef3445d7abf13701ae279; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:18:55 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:19:51 server.go:149: Incoming request: /newuser Login=Ldskvxfxpb; Pass=700e17546c289f36b1066e49ea3c124962751f7e; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:19:51 server.go:149: Incoming request: /login Login=Ldskvxfxpb; Pass=700e17546c289f36b1066e49ea3c124962751f7e; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:19:51 server.go:149: Incoming request: /addhealthmetrics Comment=Totally fine!; BloodPressure=87; Pulse=113; Weight=93; WalkingDistance=1010; Id cookie was set; Auth cookie was set;
+2015/11/21 11:19:51 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:19:51 server.go:149: Incoming request: /newuser Login=Tzvjmybt; Pass=f566a8c8fcf6467369abb4ebab4c2b2c3dba3d4c; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:19:52 server.go:149: Incoming request: /login Login=Tzvjmybt; Pass=f566a8c8fcf6467369abb4ebab4c2b2c3dba3d4c; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:19:52 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=9450; Comment=7UH84B6NDROVMZHPM8N7KEG1C2KLDJA=; BloodPressure=101; Pulse=135; Weight=56; Id cookie was set; Auth cookie was set;
+2015/11/21 11:19:52 server.go:149: Incoming request: /login Login=Tzvjmybt; Pass=f566a8c8fcf6467369abb4ebab4c2b2c3dba3d4c; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:19:52 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:19:52 server.go:149: Incoming request: /login Login=Ojnort; Pass=70411338fc08651b53e7c4916f5d0ae33ef8aa37; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:19:52 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:20:53 server.go:149: Incoming request: /newuser Login=Njvbecsixyxr; Pass=597c273205a05dba9427b40c4b486693818c9689; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:20:53 server.go:149: Incoming request: /login Login=Njvbecsixyxr; Pass=597c273205a05dba9427b40c4b486693818c9689; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:20:54 server.go:149: Incoming request: /addhealthmetrics Comment=Totally fine!; BloodPressure=111; Pulse=144; Weight=97; WalkingDistance=3485; Id cookie was set; Auth cookie was set;
+2015/11/21 11:20:54 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:20:54 server.go:149: Incoming request: /newuser Pass=0a8e24e23cc39b549952c61d1feb5dfcf09ba9b2; Login=Sxqooeihgiu; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:20:54 server.go:149: Incoming request: /login Pass=0a8e24e23cc39b549952c61d1feb5dfcf09ba9b2; Login=Sxqooeihgiu; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:20:54 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=1524; Comment=TKDVNB2F8JSAHA81O09J5R3OD1Y8ADP=; BloodPressure=92; Pulse=95; Weight=87; Id cookie was set; Auth cookie was set;
+2015/11/21 11:20:55 server.go:149: Incoming request: /login Pass=0a8e24e23cc39b549952c61d1feb5dfcf09ba9b2; Login=Sxqooeihgiu; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:20:55 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:20:55 server.go:149: Incoming request: /login Login=Rlmfqp; Pass=0826624eb0aeafd903cf58560e98852ef7dfabc2; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:20:55 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:21:51 server.go:149: Incoming request: /newuser Login=Ekohpk; Pass=f8f45b253b63b6abccfce872a4c37063e08e5087; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:21:51 server.go:149: Incoming request: /login Pass=f8f45b253b63b6abccfce872a4c37063e08e5087; Login=Ekohpk; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:21:51 server.go:149: Incoming request: /addhealthmetrics Comment=Totally fine!; BloodPressure=86; Pulse=104; Weight=64; WalkingDistance=3920; Id cookie was set; Auth cookie was set;
+2015/11/21 11:21:52 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:21:52 server.go:149: Incoming request: /newuser Login=Femkaxmbos; Pass=e585c6bd9bc05775d416dd3671691d3d93dddf35; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:21:52 server.go:149: Incoming request: /login Login=Femkaxmbos; Pass=e585c6bd9bc05775d416dd3671691d3d93dddf35; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:21:52 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=2488; Comment=MEODL5LY08CPUEXNDG9BVQSFKQ97HEJ=; BloodPressure=106; Pulse=103; Weight=85; Id cookie was set; Auth cookie was set;
+2015/11/21 11:21:52 server.go:149: Incoming request: /login Login=Femkaxmbos; Pass=e585c6bd9bc05775d416dd3671691d3d93dddf35; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:21:52 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:21:53 server.go:149: Incoming request: /login Login=Sxqooeihgiu; Pass=0a8e24e23cc39b549952c61d1feb5dfcf09ba9b2; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:21:53 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:22:52 server.go:149: Incoming request: /newuser Login=Ejmienh; Pass=99509ee3c647076a2cd841828cb6fea971655695; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:22:52 server.go:149: Incoming request: /login Login=Ejmienh; Pass=99509ee3c647076a2cd841828cb6fea971655695; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:22:52 server.go:149: Incoming request: /addhealthmetrics Weight=59; WalkingDistance=4497; Comment=Totally fine!; BloodPressure=108; Pulse=118; Id cookie was set; Auth cookie was set;
+2015/11/21 11:22:53 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:22:53 server.go:149: Incoming request: /newuser Login=Vacjj; Pass=c14f80cbfdfd89459024f3d7538787fb7aa3f654; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:22:53 server.go:149: Incoming request: /login Pass=c14f80cbfdfd89459024f3d7538787fb7aa3f654; Login=Vacjj; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:22:53 server.go:149: Incoming request: /addhealthmetrics BloodPressure=112; Pulse=106; Weight=66; WalkingDistance=7810; Comment=F0CUJMJGESSTIJT2M0CVXT52HPKLLZU=; Id cookie was set; Auth cookie was set;
+2015/11/21 11:22:53 server.go:149: Incoming request: /login Pass=c14f80cbfdfd89459024f3d7538787fb7aa3f654; Login=Vacjj; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:22:54 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:22:54 server.go:149: Incoming request: /login Login=Atdfqbaxpq; Pass=8e6734391d3a288612fc0d56344fe3c977fac689; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:22:54 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:23:52 server.go:149: Incoming request: /newuser Pass=a06b10a9bc3e5d4018cb570395d5e73a7d0c1ea4; Login=Leffritwlev; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:23:52 server.go:149: Incoming request: /login Pass=a06b10a9bc3e5d4018cb570395d5e73a7d0c1ea4; Login=Leffritwlev; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:23:52 server.go:149: Incoming request: /addhealthmetrics Weight=62; WalkingDistance=9116; Comment=Totally fine!; BloodPressure=89; Pulse=109; Id cookie was set; Auth cookie was set;
+2015/11/21 11:23:52 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:23:52 server.go:149: Incoming request: /newuser Login=Cbpmwtis; Pass=8a4a3caced3a2739dea91656662cc2cfe726f493; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:23:53 server.go:149: Incoming request: /login Login=Cbpmwtis; Pass=8a4a3caced3a2739dea91656662cc2cfe726f493; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:23:53 server.go:149: Incoming request: /addhealthmetrics Weight=87; WalkingDistance=7354; Comment=CE6ZB1L3VT588X7UHLYPXH4QHKB2ZF9=; BloodPressure=106; Pulse=122; Id cookie was set; Auth cookie was set;
+2015/11/21 11:23:53 server.go:149: Incoming request: /login Login=Cbpmwtis; Pass=8a4a3caced3a2739dea91656662cc2cfe726f493; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:23:53 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:23:53 server.go:149: Incoming request: /login Login=Pwgllxbhhi; Pass=69af11224f689096c20fad1615dea368cc644b88; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:23:53 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:24:46 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:24:46 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:24:47 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:24:47 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:24:47 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:24:52 server.go:149: Incoming request: /newuser Login=Mhtfn; Pass=6d293cb4cda917206ded3a3683d4f12905a08b76; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:24:52 server.go:149: Incoming request: /login Pass=6d293cb4cda917206ded3a3683d4f12905a08b76; Login=Mhtfn; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:24:52 server.go:149: Incoming request: /addhealthmetrics Pulse=145; Weight=87; WalkingDistance=9287; Comment=Totally fine!; BloodPressure=92; Id cookie was set; Auth cookie was set;
+2015/11/21 11:24:52 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:24:53 server.go:149: Incoming request: /newuser Login=Qgfq; Pass=8799811f270ee7e831a60cdfcbc55b9698caa732; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:24:53 server.go:149: Incoming request: /login Pass=8799811f270ee7e831a60cdfcbc55b9698caa732; Login=Qgfq; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:24:53 server.go:149: Incoming request: /addhealthmetrics Comment=BF8P0Q5R9YKQXL0VZSJDYA1U64H7NDP=; BloodPressure=84; Pulse=107; Weight=85; WalkingDistance=6571; Id cookie was set; Auth cookie was set;
+2015/11/21 11:24:53 server.go:149: Incoming request: /login Login=Qgfq; Pass=8799811f270ee7e831a60cdfcbc55b9698caa732; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:24:53 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:24:54 server.go:149: Incoming request: /login Login=Atdfqbaxpq; Pass=8e6734391d3a288612fc0d56344fe3c977fac689; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:24:54 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:25:51 server.go:149: Incoming request: /newuser Pass=6c5af46b4c9502a28a138a80d1bf559923be5887; Login=Awtzdgbwos; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:25:51 server.go:149: Incoming request: /login Login=Awtzdgbwos; Pass=6c5af46b4c9502a28a138a80d1bf559923be5887; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:25:51 server.go:149: Incoming request: /addhealthmetrics Comment=Totally fine!; BloodPressure=106; Pulse=121; Weight=57; WalkingDistance=8237; Id cookie was set; Auth cookie was set;
+2015/11/21 11:25:52 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:25:52 server.go:149: Incoming request: /newuser Pass=e1cae94e0fbac43581056557ed67e8d417fb65a0; Login=Vtucgqmhdd; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:25:52 server.go:149: Incoming request: /login Login=Vtucgqmhdd; Pass=e1cae94e0fbac43581056557ed67e8d417fb65a0; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:25:52 server.go:149: Incoming request: /addhealthmetrics Pulse=93; Weight=98; WalkingDistance=4590; Comment=YPAXIXS9TLMBF60SJ5RP34LRU5M0RVN=; BloodPressure=113; Id cookie was set; Auth cookie was set;
+2015/11/21 11:25:52 server.go:149: Incoming request: /login Login=Vtucgqmhdd; Pass=e1cae94e0fbac43581056557ed67e8d417fb65a0; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:25:52 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:25:53 server.go:149: Incoming request: /login Pass=70411338fc08651b53e7c4916f5d0ae33ef8aa37; Login=Ojnort; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:25:53 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:26:54 server.go:149: Incoming request: /newuser Login=Mbonsjitcp; Pass=1b4f3fbaf9a66b6419b0a9af660c38b78b75c05c; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:26:54 server.go:149: Incoming request: /login Login=Mbonsjitcp; Pass=1b4f3fbaf9a66b6419b0a9af660c38b78b75c05c; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:26:54 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=2837; Comment=Totally fine!; BloodPressure=102; Pulse=108; Weight=40; Id cookie was set; Auth cookie was set;
+2015/11/21 11:26:54 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:26:54 server.go:149: Incoming request: /newuser Login=Dzqtfi; Pass=5f1b7b75a92143bd31b8d2dcbd45a52b58467467; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:26:55 server.go:149: Incoming request: /login Login=Dzqtfi; Pass=5f1b7b75a92143bd31b8d2dcbd45a52b58467467; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:26:55 server.go:149: Incoming request: /addhealthmetrics Pulse=117; Weight=76; WalkingDistance=7029; Comment=VJ51064MK0OUGPO9WQOLF7C6OW62L7P=; BloodPressure=109; Id cookie was set; Auth cookie was set;
+2015/11/21 11:26:55 server.go:149: Incoming request: /login Login=Dzqtfi; Pass=5f1b7b75a92143bd31b8d2dcbd45a52b58467467; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:26:55 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:26:55 server.go:149: Incoming request: /login Login=Tzvjmybt; Pass=f566a8c8fcf6467369abb4ebab4c2b2c3dba3d4c; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:26:56 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:27:42 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:27:43 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:27:43 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:27:43 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:27:43 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:27:54 server.go:149: Incoming request: /newuser Login=Dbjszg; Pass=9bc3dbf26e359efed89235d0e256f296b322677d; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:27:54 server.go:149: Incoming request: /login Login=Dbjszg; Pass=9bc3dbf26e359efed89235d0e256f296b322677d; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:27:54 server.go:149: Incoming request: /addhealthmetrics Weight=59; WalkingDistance=4231; Comment=Totally fine!; BloodPressure=107; Pulse=85; Id cookie was set; Auth cookie was set;
+2015/11/21 11:27:54 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:27:55 server.go:149: Incoming request: /newuser Login=Ayce; Pass=9c29cf429390d913605e8cda0b64624e59c89405; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:27:55 server.go:149: Incoming request: /login Login=Ayce; Pass=9c29cf429390d913605e8cda0b64624e59c89405; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:27:55 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=7575; Comment=URTTHJ7CSQ98UC8A1G6SNWIC2QC3CAO=; BloodPressure=109; Pulse=122; Weight=71; Id cookie was set; Auth cookie was set;
+2015/11/21 11:27:55 server.go:149: Incoming request: /login Login=Ayce; Pass=9c29cf429390d913605e8cda0b64624e59c89405; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:27:55 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:27:56 server.go:149: Incoming request: /login Login=Vtucgqmhdd; Pass=e1cae94e0fbac43581056557ed67e8d417fb65a0; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:27:56 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:28:53 server.go:149: Incoming request: /newuser Login=Nuhnksji; Pass=fe3445061cbb2617d51b681e6df787415aaeba30; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:28:53 server.go:149: Incoming request: /login Login=Nuhnksji; Pass=fe3445061cbb2617d51b681e6df787415aaeba30; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:28:53 server.go:149: Incoming request: /addhealthmetrics BloodPressure=98; Pulse=94; Weight=47; WalkingDistance=4383; Comment=Totally fine!; Id cookie was set; Auth cookie was set;
+2015/11/21 11:28:53 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:28:54 server.go:149: Incoming request: /newuser Login=Jxbtgm; Pass=463ff76173d591bb74aef5eab1d6e117314851eb; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:28:54 server.go:149: Incoming request: /login Pass=463ff76173d591bb74aef5eab1d6e117314851eb; Login=Jxbtgm; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:28:54 server.go:149: Incoming request: /addhealthmetrics WalkingDistance=5487; Comment=6P4B0HSCJKK7UFGV2D5CGXJP112Z5NB=; BloodPressure=115; Pulse=111; Weight=97; Id cookie was set; Auth cookie was set;
+2015/11/21 11:28:54 server.go:149: Incoming request: /login Login=Jxbtgm; Pass=463ff76173d591bb74aef5eab1d6e117314851eb; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:28:54 server.go:149: Incoming request: /healthmetrics
+2015/11/21 11:28:55 server.go:149: Incoming request: /login Login=Ayce; Pass=9c29cf429390d913605e8cda0b64624e59c89405; Id cookie was not set; Auth cookie was not set;
+2015/11/21 11:28:55 server.go:149: Incoming request: /healthmetrics
--- /dev/null
+package main
+
+import (
+ "errors"
+ "strings"
+ "fmt"
+ "io"
+ "log"
+ "net/http"
+ "os"
+ "strconv"
+ "time"
+)
+
+const (
+ Unauthorized = "User is not authorized"
+ AuthenticationFailed = "Authentication failed"
+)
+
+const Key string = "f11ecd5521ddf2614e17e4fb074a86da"
+
+func addHealthMetrics(request *http.Request) (error) {
+
+ uId, err := getUserId(request)
+ if err != nil {
+ logger.Println("Can't get user from request")
+ return err
+ }
+
+ metrics := parseFromForm(request)
+ if metrics == nil {
+ logger.Println("Can't parse metrics from request")
+ return errors.New("Can't parse metrics from your request")
+ }
+
+ userId, err := strconv.Atoi(strings.Split(uId, "_")[1])
+ if err != nil {
+ logger.Println("Can't parse user Id: ", err)
+ return errors.New("Can't find user to add metrics for")
+ }
+
+ success, _ := tryAddMetrics(userId, metrics)
+ if (success) {
+ return nil
+ } else {
+ return errors.New("Metrics were not added")
+ }
+}
+
+func getHealthMetrics(request *http.Request) ([]HealthMetrics, error) {
+
+ var metrics []HealthMetrics
+
+ uId, err := getUserId(request)
+ if err != nil {
+ return metrics, err
+ } else {
+ var success bool
+ success, metrics = tryGetUserMetrics(uId)
+ if success {
+ return metrics, nil
+ } else {
+ return metrics, errors.New("Can't get user's metrics")
+ }
+ }
+}
+
+func addUser(request *http.Request) (string, error) {
+
+ user := parseUser(request)
+ if user == nil {
+ return "", errors.New("Not enough parameters to add user")
+ } else {
+ result, uId := tryAddUser(user)
+ if result == Success {
+ return fmt.Sprintf("User was successfully added, id assigned: %v", uId), nil
+ } else if result == AlreadyExists {
+ return "", errors.New("User with this login already exists")
+ } else {
+ return "", errors.New("Metrics were not added")
+ }
+ }
+}
+
+func getUserId(request *http.Request) (string, error) {
+ authCookie, err := request.Cookie("auth")
+ if err != nil {
+ return "", errors.New(Unauthorized)
+ }
+ auth := authCookie.Value
+
+ idCookie, err := request.Cookie("id")
+ if err != nil {
+ return "", errors.New(Unauthorized)
+ }
+ id := idCookie.Value
+
+ verified, err := authVerified(auth, id)
+ if err != nil {
+ return "", errors.New(AuthenticationFailed)
+ }
+ if verified {
+ uId := extractUid(id)
+ return uId, nil
+ } else {
+ return "", errors.New(Unauthorized)
+ }
+}
+
+func loggedin(request *http.Request) bool {
+ _, err := getUserId(request)
+ return err == nil
+}
+
+func extractUid(idStr string) string {
+ id := decodeBase64(idStr)
+ f := strings.FieldsFunc(id, split)
+ return f[len(f)-1]
+}
+
+func authVerified(auth string, uId string) (bool, error) {
+
+ id := decodeBase64(uId)
+
+ res := md5hash(Key, id)
+
+ if res == auth {
+ return true, nil
+ } else {
+ return false, errors.New(Unauthorized)
+ }
+}
+
+func login(request *http.Request) ( string, http.Cookie, http.Cookie) {
+ response := ""
+ var idCookie http.Cookie
+ var authCookie http.Cookie
+
+ user := parseUser(request)
+ if user == nil {
+ response = "You should specify both login and password"
+ } else {
+ uid, err := findUser(user)
+ if err != nil {
+ response = "There is no such user"
+ } else {
+ expire := time.Now().AddDate(1, 0, 0)
+ auth := md5hash(Key, uid)
+ id := encodeBase64(uid)
+ authCookie = http.Cookie{Name : "auth", Value: auth, Expires: expire}
+ idCookie = http.Cookie{Name : "id", Value: id, Expires: expire}
+ response = fmt.Sprintf("Welcome, %v", user.Login)
+ }
+ }
+ return response, authCookie, idCookie
+
+}
+
+func logout(request *http.Request) (http.Cookie, http.Cookie) {
+ expire := time.Now().AddDate(-1, 0, 0)
+ authCookie := http.Cookie{Name : "auth", Value: "", Expires: expire}
+ idCookie := http.Cookie{Name : "id", Value: "", Expires: expire}
+
+ return authCookie, idCookie
+}
+
+func setupLog(filename string) *log.Logger{
+ var logwriter io.Writer
+ file, err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
+ if err != nil {
+ fmt.Println("Failed to open log file", err)
+ logwriter = os.Stdout
+ }
+
+ logwriter = file
+
+ logger := log.New(logwriter, "", log.Ldate|log.Ltime|log.Lshortfile)
+ return logger
+}
\ No newline at end of file
--- /dev/null
+package main
+
+import (
+ "io"
+ "flag"
+ "fmt"
+ "html/template"
+ "log"
+ "net/http"
+ "strings"
+ "time"
+)
+
+const STATIC_URL string = "/static/"
+const STATIC_ROOT string = "static/"
+const LOG_FILE string = "log.txt"
+
+type Link struct {
+ LinkHref string
+ LinkText string
+}
+
+type Context struct {
+ LoggedIn bool
+ Text string
+ Metrics []HealthMetrics
+}
+
+func addHealthMetricsHandler(w http.ResponseWriter, request *http.Request) {
+
+ err := addHealthMetrics(request)
+ w.WriteHeader(http.StatusOK)
+
+ var response string
+ if err == nil {
+ response = fmt.Sprintf("Metrics were successfully added")
+ } else {
+ response = err.Error()
+ }
+
+ context := Context{LoggedIn: loggedin(request), Text: response}
+ render(w, "text", context)
+}
+
+func addHealthMetricsFormHandler(w http.ResponseWriter, request *http.Request) {
+ context := Context{LoggedIn: loggedin(request)}
+ render(w, "metrics", context)
+}
+
+func healthMetricsHandler(w http.ResponseWriter, request *http.Request) {
+
+ metrics, err := getHealthMetrics(request)
+ w.WriteHeader(http.StatusOK)
+
+ if err == nil {
+ context := Context{LoggedIn: loggedin(request), Metrics: metrics}
+ render(w, "table", context)
+ } else {
+ context := Context{LoggedIn: loggedin(request), Text: err.Error()}
+ render(w, "text", context)
+ }
+}
+
+func addUserHandler(w http.ResponseWriter, request *http.Request) {
+
+ response, err := addUser(request)
+ w.WriteHeader(http.StatusOK)
+
+ if err != nil {
+ response = err.Error()
+ }
+
+ context := Context{LoggedIn: loggedin(request), Text: response}
+ render(w, "text", context)
+}
+
+func loginHandler(w http.ResponseWriter, request *http.Request) {
+
+ response, c1, c2 := login(request)
+ http.SetCookie(w, &c1)
+ http.SetCookie(w, &c2)
+ w.WriteHeader(http.StatusOK)
+
+ loggedIn := &c1 != nil && &c2 != nil
+
+ context := Context{LoggedIn: loggedIn, Text: response}
+ render(w, "text", context)
+}
+
+func logoutHandler(w http.ResponseWriter, request *http.Request) {
+
+ c1, c2 := logout(request)
+ http.SetCookie(w, &c1)
+ http.SetCookie(w, &c2)
+ w.WriteHeader(http.StatusOK)
+
+ context := Context{LoggedIn: false, Text: "Bye-bye! Seeya!"}
+ render(w, "text", context)
+}
+
+func signupFormHandler(w http.ResponseWriter, request *http.Request) {
+ context := Context{LoggedIn: loggedin(request)}
+ render(w, "signup", context)
+}
+
+func loginformHandler(w http.ResponseWriter, request *http.Request) {
+ context := Context{LoggedIn: loggedin(request)}
+ render(w, "login", context)
+}
+
+func homeHandler(w http.ResponseWriter, request *http.Request) {
+ context := Context{LoggedIn: loggedin(request)}
+ render(w, "index", context)
+}
+
+func render(w http.ResponseWriter, tmpl string, context Context) {
+ tmpl_list := []string{"templates/base.html",
+ fmt.Sprintf("templates/%s.html", tmpl)}
+ t, err := template.ParseFiles(tmpl_list...)
+ if err != nil {
+ logger.Println("template parsing error: ", err)
+ }
+ err = t.Execute(w, context)
+ if err != nil {
+ logger.Println("template executing error: ", err)
+ }
+}
+
+func staticHandler(w http.ResponseWriter, req *http.Request) {
+ static_file := req.URL.Path[len(STATIC_URL):]
+ if len(static_file) != 0 {
+ f, err := http.Dir(STATIC_ROOT).Open(static_file)
+ if err == nil {
+ content := io.ReadSeeker(f)
+ http.ServeContent(w, req, static_file, time.Now(), content)
+ return
+ }
+ }
+ http.NotFound(w, req)
+}
+
+var mux map[string]func(http.ResponseWriter, *http.Request)
+
+type myHandler struct{}
+
+func (*myHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+ path := "/" + strings.Split(r.URL.String(), "/")[1]
+ if h, ok := mux[path]; ok {
+ logger.Println("Incoming request: ", path, printForm(r))
+ h(w, r)
+ return
+ }
+
+ logger.Println("Warn: requested path not found:", path)
+ http.Error(w, "404 page not found", 404)
+}
+
+func printForm(r *http.Request) string {
+ if r.Method == "GET" {
+ return ""
+ }
+ res := ""
+ r.ParseForm()
+ for key, _ := range r.Form {
+ res += key + "=" + r.FormValue(key) + "; "
+ }
+ _, err := r.Cookie("id")
+ if err != nil {
+ res += "Id cookie was not set; "
+ } else {
+ res += "Id cookie was set; "
+ }
+ _, err = r.Cookie("auth")
+ if err != nil {
+ res += "Auth cookie was not set; "
+ } else {
+ res += "Auth cookie was set; "
+ }
+ return res
+}
+
+var links map[string]Link
+
+var logger *log.Logger
+
+func initService(){
+ logger = setupLog(LOG_FILE)
+ prepareDb()
+}
+
+func main() {
+
+ initService()
+
+ var port = flag.String("port", "8000", "please specify the port to start server on")
+ flag.Parse()
+ logger.Println("Port to start on: " + *port)
+ server := http.Server{
+ Addr: ":" + *port,
+ Handler: &myHandler{},
+ }
+
+ mux = make(map[string]func(http.ResponseWriter, *http.Request))
+ mux["/"] = homeHandler
+ mux["/healthmetrics"] = healthMetricsHandler
+ mux["/addhealthmetrics"] = addHealthMetricsHandler
+ mux["/addhealthmetricsform"] = addHealthMetricsFormHandler
+ mux["/newuser"] = addUserHandler
+ mux["/signupform"] = signupFormHandler
+ mux["/login"] = loginHandler
+ mux["/loginform"] = loginformHandler
+ mux["/logout"] = logoutHandler
+ mux["/static"] = staticHandler
+
+ server.ListenAndServe()
+}
\ No newline at end of file
--- /dev/null
+Subproject commit 5651a9d9d49ec25811d08220ee972080378d52ea
--- /dev/null
+<!DOCTYPE html>
+<html lang="en-US">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <title>Health monitor • Turio • RuCTFE 2015</title>
+ <meta name="description" content="Track your health metrics and keep fit!">
+ <meta name="keywords" content="Turio, RuCTFE, Health Monitor" />
+ <meta name="author" content="Hackerdom team, hackerdom.ru, Polina Zonova">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link href='http://fonts.googleapis.com/css?family=Roboto:400,700,500' rel='stylesheet' type='text/css'> <!-- Body font -->
+ <link href='http://fonts.googleapis.com/css?family=Lato:300,400' rel='stylesheet' type='text/css'> <!-- Navbar font -->
+ <link rel="stylesheet" href="/static/inc/bootstrap/css/bootstrap.min.css">
+
+ <link rel="stylesheet" href="/static/css/unika.min.css">
+ <link rel="stylesheet" href="/static/css/turio.css">
+ </head>
+ <body class="service-page" data-spy="scroll" data-target="#main-navbar">
+ <div class="page-loader"></div> <!-- Display loading image while page loads -->
+ <div class="body">
+ <header id="header" class="header-main">
+ <nav id="main-navbar" class="navbar navbar-default navbar-fixed-top" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-navbar-collapse"></button>
+ <a class="navbar-brand main-page-link" href="/home">←</a>
+ <a class="navbar-brand" href="/">Health Monitor</a>
+ </div>
+
+ <div class="collapse navbar-collapse" id="bs-navbar-collapse">
+ <ul class="nav navbar-nav navbar-right">
+ <li><a href="/">Home</a></li>
+ {{if .LoggedIn}}
+ <li><a href="/healthmetrics">My Metrics</a></li>
+ <li><a href="/addhealthmetricsform">Add Metrics</a></li>
+ <li><a href="/logout">Log Out</a></li>
+ {{else}}
+ <li><a href="/loginform">Login</a></li>
+ <li><a href="/signupform">Sign Up</a></li>
+ {{end}}
+ </ul>
+ </div>
+ </div>
+ </nav>
+ </header>
+ <section class="main-block" data-stellar-background-ratio="0.5">
+ <div class="container">
+ <div class="caption">
+ <div class="row">
+ <div class="col-sm-2 center-block">
+ <a href="/">
+ <img src="/static/logos/health.png" class="logo img-responsive">
+ </a>
+ </div>
+ <div class="col-sm-8 content-block">
+ {{ template "content" . }}
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
+ </div>
+ <script src="/static/inc/jquery/jquery-1.11.1.min.js"></script>
+ <script src="/static/inc/bootstrap/js/bootstrap.min.js"></script>
+
+ <script src="/static/js/theme.js"></script>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+{{ define "content" }}
+ <h1>Health Monitor</h1>
+ {{if .LoggedIn}}
+ <div class="well">
+ <p>
+ Welcome to our service that helps you to track your everyday health metrics, your physical activity and save them forever!
+ </p>
+ <p>
+ Click <a href="/healthmetrics">here</a> to see the metrics you've added or <a href="/addhealthmetricsform">add</a> new ones.
+ </p>
+ </div>
+ {{else}}
+ <div class="well">Track your health metrics and keep fit!</div>
+ <a class="btn btn-default" href="/loginform" role="button">Login</a>
+ <a class="btn btn-default" href="/signupform" role="button">Sign up</a>
+ {{end}}
+{{ end }}
\ No newline at end of file
--- /dev/null
+{{ define "content" }}
+<div class="col-sm-8">
+ <form role="form" action="/login" method="POST">
+ <h4>Type your credentials</h4>
+ <div class="form-group">
+ <input name="Login" type="text" class="form-control" placeholder="Login">
+ </div>
+ <div class="form-group">
+ <input name="Pass" type="password" class="form-control" placeholder="Password">
+ </div>
+ <button id="submit" class="btn btn-default" data-wow-delay="0.8s">Login</button>
+ </form>
+</div>
+{{ end }}
\ No newline at end of file
--- /dev/null
+{{ define "content" }}
+<div class="col-sm-10">
+ <div class="contact-form">
+ <h4>How are you today? Write us your health indices and keep an eye on your progress!</h4>
+ <form role="form" action="/addhealthmetrics" method="POST">
+ <div class="row">
+ <div class="form-group col-sm-8">
+ <input name="Weight" type="text" class="form-control" placeholder="Current Weight" required>
+ </div>
+ <div class="form-group col-sm-8">
+ <input name="BloodPressure" type="text" class="form-control" placeholder="Blood Pressure" required>
+ </div>
+ <div class="form-group col-sm-8">
+ <input name="Pulse" type="text" class="form-control" placeholder="Pulse" required>
+ </div>
+ <div class="form-group col-sm-8">
+ <input name="WalkingDistance" type="text" class="form-control" placeholder="Walking Distance" required>
+ </div>
+ <div class="form-group col-sm-8">
+ <textarea name="Comment" class="form-control" rows="5" placeholder="How was your overall feeling?" required></textarea>
+ </div>
+ </div>
+ <button type="submit" class="btn btn-default wow bounceInRight" data-wow-delay="0.8s">Send</button>
+ </form>
+ </div>
+</div>
+
+{{ end }}
\ No newline at end of file
--- /dev/null
+{{ define "content" }}
+<div class="col-sm-8">
+ <form role="form" action="/newuser" method="POST">
+ <h4>Create user</h4>
+ <div class="form-group">
+ <input name="Login" type="text" class="form-control" placeholder="Login">
+ </div>
+ <div class="form-group">
+ <input name="Pass" type="password" class="form-control" placeholder="Password">
+ </div>
+ <button id="submit" class="btn btn-default" data-wow-delay="0.8s">Sign up</button>
+ </form>
+</div>
+{{ end }}
\ No newline at end of file
--- /dev/null
+{{ define "content" }}
+ <h4>Here are metrics you've added</h4>
+
+ {{if .Metrics}}
+ <table class="table">
+ <tr>
+ <th>Weight</th>
+ <th>Blood Pressure</th>
+ <th>Pulse</th>
+ <th>Walking Distance</th>
+ <th>Comment</th>
+ </tr>
+ {{range .Metrics}}
+ <tr><td>{{.Weight}}</td><td>{{.BloodPressure}}</td><td>{{.Pulse}}</td><td>{{.WalkingDistance}}</td><td>{{.Comment}}</td></tr>
+ {{end}}
+ </table>
+ {{else}}
+ You have not uploaded any metrics yet
+ {{end}}
+{{ end }}
\ No newline at end of file
--- /dev/null
+{{ define "content" }}
+<div class="col-sm-8 alert">
+ <div>
+ {{.Text}}.
+ <a href="javascript:history.back()">Back</a>.
+ </div>
+</div>
+{{ end }}
\ No newline at end of file
--- /dev/null
+package main
+
+import (
+ "net/http"
+ "strconv"
+ "strings"
+)
+
+type User struct {
+ Login string
+ Pass string
+}
+
+func parseUser(r *http.Request) *User {
+ login := r.FormValue("Login")
+ pass := r.FormValue("Pass")
+
+ if login == "" || pass == "" {
+ return nil
+ }
+
+ result := &User{login, md5hash(pass)}
+ return result
+}
+
+func createUId(id int64) string {
+ return "u_" + strconv.FormatInt(id, 10)
+}
+
+func parseUId(uId string) int {
+ res, err := strconv.Atoi(strings.Split(uId, "_")[1])
+ if err != nil {
+ logger.Fatal("Can't parse uId=", uId)
+ }
+ return res
+}
\ No newline at end of file
--- /dev/null
+package main
+
+import (
+ "fmt"
+ "encoding/base64"
+ "crypto/md5"
+ "io"
+)
+
+func decodeBase64(s string) string {
+ bytes, _ := base64.StdEncoding.DecodeString(s)
+ res := string(bytes)
+ return res
+}
+
+func encodeBase64(s string) string {
+ bytes := []byte(s)
+ res := base64.StdEncoding.EncodeToString(bytes)
+ return res
+}
+
+func split(c rune) bool {
+ return c == ';' || c == ' '
+}
+
+func md5hash(params ...string) string {
+ h := md5.New()
+ for _, param := range params {
+ io.WriteString(h, param)
+ }
+ res := fmt.Sprintf("%x", h.Sum(nil))
+ return res
+}
\ No newline at end of file