PHP HTML JavaScript CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
SQL
api
assets
bs
config
css
custom
data
js
php
plugins
template
.gitignore
LICENSE
README.md
favicon.ico
index.php
logo.png
logo_1hgj.png

README.md

OneHourGameJam

Source code required to run your very own One hour game jam event.

Requirements

Requires a web server with PHP 5.4 or later and MySQL.

Installing

What you need is a web server capable of running PHP, for example Apache.

1: Apache

For windows: https://www.apachefriends.org/download.html For linux: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu For mac: http://jason.pureconcepts.net/2012/10/install-apache-php-mysql-mac-os-x/

If these guides are out of date at the time you are reading this, simply google "Install apache on %OS%" where %OS% is the operating system you wish to use.

Also install MySQL (available in XAMPP), connect to it (via PHPMYADMIN or MySQL Workbench) and execute the contents of the provided sql file in SQL/1hgj.sql. This will create the database structure

Open php/db.php and edit the database connection details at the top.

2: Deploying

Once you have your web server set up, copy the contents of this repository to it.

It is possible that you will need to change the permissions on the /data and /config dirrectories, so that your scripts will be able to write to them. This depends to how your web server is set up. If needed, change them to 777 and it should work. Tutorial: http://www.linux.org/threads/file-permissions-chmod.4094/. It is however likely that you will not need to do this.

3. First startup

Open the page in your browser and register a user. This first user will be a site administrator.

Common tasks

This project is in-development, so some administrative tasks do not yet have a pretty interface. It was much more important to add the functionality quickly and then add interfaces as needed. Interfaces for these tasks will be made soon, for now, follow the guide below.

Registering

Done on the website. The first registered account will have admin rights.

Adding more admins

Adding or removing administrators can be done via the "Manage users" administrative menu.

Adding jams

Done on the website - can be scheduled for the future in which case the theme is only revealed once the set time passes.

Removing or editing jams and entries

Editing jams can be done via the website's "edit content" menu. Deleting is done by directly editing the database. Set the jam_deleted volumn to 1.

Removing a user

Manually remove them from the database table 'user'

Remotely log out a user or all users

Manually remove their entry from data/sessions.json; or delete the file to log out all users.

Migrating to a new server

The site uses a site-wide pepper (for password and session id salting*). This pepper is generated the first time you launch the website, so it's unique for each deployment. It's saved in config/config.txt. Changing this will invalidate all session IDs and passwords. When migrating, it is important to preserve this pepper value.

The simplest way to migrate is to simply copy the files from one server and paste them onto the new server. You might need to ensure file permissions are set correctly on the new server though (See "Deploying")

*The site also uses per-user salts, not just the site-wide pepper.

Solving performance issues

In order to ensure security of passwords and sessions, the site salts and peppers them, then hashes them with SHA256 between 10k and 20k times, by default. If the site takes too long to load for users, you might want to change these values to something lower. They can be found in php/authentication.php -> RegisterUser(), HashPassword() and EditUserPassword().

It's also possible for the number of sessions to build up. If data/sessions.json becomes too large it may cause performance issues, consider deleting data/sessions.json if this happen. Note that this logs out all users.