Skip to content

Flatpage/static site manager for the Daily Bruin (proxy for Google Drive)

Notifications You must be signed in to change notification settings

dailybruin/kerckhoff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kerckhoff logo

Kerckhoff

Dependencies Dev dependencies

Kerckhoff is a static-site management and deployment solution used by the Daily Bruin, UCLA's student run daily newspaper.

This project is currently under active development.

Features/Roadmap

You can find the spec here. An @media.ucla.edu email is required.

Setting Up the Development Environment

We are using Docker and Docker-Compose for deployment and development. Feel free to read up more on Docker if you're interested in the details of how it works, or reach out to us on Slack.

  1. Install Docker from the official website. Follow the instructions for your specific platform.

  2. Use git clone https://github.com/daily-bruin/kerckhoff.git to clone the repository.

    • Note: If you're using Windows, run the following two commands before cloning the repository:
    • git config --global core.eol lf
    • git config --global core.autocrlf input
  3. Create a .env file in your repository folder with the following contents:

    DATABASE_URL=postgres://postgres@db:5432/postgres
    SITE_HOST=localhost
    DEBUG=True
    SECRET_KEY=kerchkoff-secrets
    S3_SITE_UPLOAD_BUCKET=dev.kerckhoff.dailybruin.com
    S3_ASSETS_UPLOAD_BUCKET=assets.dailybruin.com
    AWS_ACCESS_KEY_ID=<your key here>
    AWS_SECRET_ACCESS_KEY=<your secret key here>
    REPOSITORY_FOLDER_ID=<your id here>
    LIVE_PUSH_SERVER=google.com
    DJANGO_SETTINGS_MODULE=kerckhoff.settings
    • Note: You need values for AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and REPOSITORY_FOLDER_ID, but if you aren't in Daily Bruin, you can't use ours ;). If you are, click here!
  4. Now we need to install node version 8! There are several ways to do this. I recommend using nvm or n.

  5. Now we need to start webpack! Run npm install then npm run watch.

  6. Use docker-compose build to build/pull and configure the Docker images for the Django server. Then run docker-compose up to start the server. Lastly, use docker-compose run web ./kerckhoff/manage.py migrate to set up the database.

  7. The site should now be running on localhost:5000, and the server will automatically restart after any edits you make to Python and JS source files. Refresh the page to see them!

  8. Let's do some server side stuff. You should create an admin user to log in. Create a superuser using docker-compose run web ./kerckhoff/manage.py createsuperuser Remember your admin username and password!

  9. Now you will want to set up login for your Kerckhoff instance. Create or get a Google OAuth client id and secret, and visit localhost:5000/admin/. Login with your newly created admin account, and create a new Social Application (under Social Accounts). Select Google as provider. Set name to Google, fill in the Client ID and secret key and move the site (example.com) to the right. (help!). You can find the Client ID and the secret key here Now you can log out, and log in with the usual flow by visiting localhost:5000/manage

How to Contribute

  1. Set up the development environment properly.

  2. Look for an open issue (could be a feature or a bugfix) or create one of your own (so we know you're working on a new thing!)

  3. Create a branch with git checkout -b feature/<my-awesome-feature> for a feature or git checkout -b fix/<my-cool-fix> for a fix.

  4. Write some badass code.

  5. Stage your files with git add <files I want to update> or git add .. (The latter adds all the files in the current directory, so be careful!)

  6. Commit your changes with git commit -m <a commit message explaining what you did>.

    • Important: Don't commit secret keys or any sort of sensitive information into git! Always use git status to double check if you're not sure.
  7. Push your commits with git push. The push will usually fail for a brand new feature branch. Just follow the instructions on your terminal to resolve it.

  8. Create a pull request (request to merge your branch into the master branch) using the button on Github!

Remeber to migrate and createsuperuser!

About

Flatpage/static site manager for the Daily Bruin (proxy for Google Drive)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published