Giter Site home page Giter Site logo

zymurgic / hackspace-foundation-sites Goto Github PK

View Code? Open in Web Editor NEW

This project forked from londonhackspace/hackspace-foundation-sites

0.0 1.0 0.0 3.07 MB

London Hackspace web site

Home Page: https://london.hackspace.org.uk

Python 2.41% Shell 0.19% PHP 82.95% Ruby 1.81% Perl 0.10% JavaScript 0.47% HTML 11.12% PLpgSQL 0.06% CSS 0.85% Hack 0.04%

hackspace-foundation-sites's Introduction

This is the source code for the London Hackspace web site

Getting Started

We use Vagrant to deploy a consistent development environment. To get your development environment set up:

  • Install Vagrant and Virtualbox
  • Run vagrant up in this directory. This will create and configure a virtual machine.
  • Create config file (the defaults are fine): cp etc/config.php.example etc/config.php
  • Fetch libraries: git submodule update --init

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 psql hackspace from the SSH shell.

Making yourself an admin

In the postgres shell:

hackspace=# update users set subscribed=True;
hackspace=# update users set admin=True;

to make yourself a member and an admin

letting apache add ldap users (!)

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

Enabling Calendar management

  1. Enable the Calendar API at https://console.developers.google.com/.../apiui/api
  2. Create a service account for OAuth at https://console.developers.google.com/.../apiui/credential
  3. Put the OAuth certificate in ./var, and correct the service_account_name and key_file_location in lib/calendar.php
  4. Go to the Hackspace calendar on Google and share it with the same service_account_name address

API documentation https://developers.google.com/api-client-library/php/

Upgrading from 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:

  • etc/create-flourish-tables.sql
  • etc/restore-column-defaults.sql
  • etc/restore-multicolumn-pks.sql

And don't forget to run:

env/bin/python manage.py collectstatic

after each deployment.

hackspace-foundation-sites's People

Contributors

alexmuller avatar chixor avatar chrislo avatar dekstop avatar fahadsadah avatar gausie avatar increpare avatar jasiek avatar jasperwallace avatar jonty avatar maciejgryka avatar marksteward avatar mentarus avatar montyphy avatar oskarpearson avatar padski avatar paullessing avatar russss avatar samlr avatar sde1000 avatar solexious avatar teabot avatar tharax avatar theorbtwo avatar timrterrible avatar yamatt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.