| 
									
										
										
										
											2013-12-18 15:42:29 -05:00
										 |  |  | Setting up an election: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 0. vote/include/election-sql.php expects a secret config file that exists | 
					
						
							|  |  |  |    only on the server and is included as PHP code.  It's hard coded currently | 
					
						
							|  |  |  |    to: /home/admin/secret/anonvoting currently. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-18 17:09:04 -05:00
										 |  |  |    The file should look something like this: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <?php | 
					
						
							|  |  |  |        $mysql_host = "localhost"; | 
					
						
							|  |  |  |        $mysql_user = "someuser"; | 
					
						
							|  |  |  |        $mysql_password = "somepassword"; | 
					
						
							|  |  |  |        $mysql_db = "somedb"; | 
					
						
							|  |  |  | ?> | 
					
						
							| 
									
										
										
										
											2013-12-18 15:42:29 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 1. When I deploy, I create an account for the election, as the mysql root user: | 
					
						
							|  |  |  |    mysql -u root -p | 
					
						
							|  |  |  |    Password: <MYSQLROOTPW> | 
					
						
							|  |  |  |    mysql> CREATE USER 'someusername' identified by 'somepassword'; | 
					
						
							|  |  |  |    mysql> CREATE DATABASE somedbname; | 
					
						
							| 
									
										
										
										
											2013-12-18 15:43:58 -05:00
										 |  |  |    mysql> quit | 
					
						
							|  |  |  |    msyql -u root -p -D somedbname < ..../vote/include/schema.sql | 
					
						
							| 
									
										
										
										
											2013-12-18 17:09:49 -05:00
										 |  |  |    mysql -u root -p | 
					
						
							|  |  |  |    Password: <MYSQLROOTPW> | 
					
						
							|  |  |  |    mysql> GRANT SELECT on somedb.elections TO someuser@localhost; |