This is the source code for the London Hackspace web site
We use Vagrant to deploy a consistent development environment. To get your development environment set up:
git submodule update --init
cp etc/config.php.example etc/config.php
cp lhs/production_settings.py.example lhs/production_settings.py
vagrant up
You should now be able to connect to http://localhost:8000 to view your development site. Changes you make on your machine will be reflected on the VM.
If you need to log into the VM for any reason, you can just run
vagrant ssh
To access the postgres database, run from the SSH shell
psql hackspace
In the postgres shell:
hackspace=# update users set subscribed=True;
hackspace=# update users set admin=True;
to make yourself a member and an admin
use visudo to add this:
www-data ALL=(www-data:ldapadmin) NOPASSWD:NOSETENV: /var/www/hackspace-foundation-sites/bin/ldap-add.sh, /var/www/hackspace-foundation-sites/bin/ldap-delete.sh
and then:
groupadd ldapadmin
chgrp ldapadmin /etc/smbldap-tools/smbldap_bind.conf
chmod 0640 /etc/smbldap-tools/smbldap_bind.conf
API documentation https://developers.google.com/api-client-library/php/
Add to cron:
0 4 * * * www-data /var/www/hackspace-foundation-sites/manage.sh clearsessions
After setting the credentials appropriately and taking a backup, run:
env/bin/python manage.py migrate main 0001 --fake-initial
env/bin/python manage.py migrate sites
env/bin/python manage.py migrate
And then run in the following SQL files:
And don't forget to run:
env/bin/python manage.py collectstatic
after each deployment.
This is a work-in-progress, but likely to take over from Vagrant quickly.
docker-compose up
To clear out the database and PHP sessions:
docker-compose down -v
To access the DB:
docker-compose exec db psql postgres://hackspace:hackspace@db/hackspace