Statically generated site for Redbrick https://www.redbrick.dcu.ie
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Cian Butler ceb03c092f
Merge pull request #317 from d-fens/patch-2
1 年之前
.circleci use mailto over form (#238) 4 年之前
.github Add pull request template. 4 年之前
bin fall back to sendmail if smtp server is disabled (#136) 4 年之前
lib Jest has been added in order to test the app 4 年之前
production move to alpine for docker (#195) 4 年之前
routes use mailto over form (#238) 4 年之前
scaffolds annouce for week 4 (#68) 5 年之前
source Merge pull request #317 from d-fens/patch-2 1 年之前
themes Add Connor Mulready (mulreac) to helpdesk page 3 年之前
views add docker file 5 年之前
.dockerignore move to alpine for docker (#195) 4 年之前
.env.example make smtp more configurable (#200) 4 年之前
.eslintignore switch linter to eslint and fix errors (#135) 4 年之前
.eslintrc Jest has been added in order to test the app 4 年之前
.gitignore Submodule (#116) 4 年之前
.gitmodules Submodule (#116) 4 年之前
.markdown.style.rb add codeclimate (#192) 4 年之前
.mdlrc add codeclimate (#192) 4 年之前
.nvmrc set node version as 6.9 for production (#89) 5 年之前
.yarnclean add git to regenerate api - close #76 (#117) 4 年之前
CODE_OF_CONDUCT.md try ratify both code of conducts 4 年之前
CONTRIBUTING.md try ratify both code of conducts 4 年之前
Dockerfile move to alpine for docker (#195) 4 年之前
LICENSE Replace the MIT license with GPL. 4 年之前
README.md Rewrap copyright notice. 4 年之前
_config.yml Fixes minutes icon + latest minutes 3 年之前
app.js use mailto over form (#238) 4 年之前
docker-compose.yml improve setup instriuctions (#201) 4 年之前
npm-shrinkwrap.json add codeclimate (#192) 4 年之前
package.json Jest has been added in order to test the app 4 年之前
yarn.lock Jest has been added in order to test the app 4 年之前

README.md

Static-Site

CircleCI Code Climate Docker Build Status

A Static Site for redbrick generated with hexo using a theme based off icarus

Requirements

  1. Node : v6.9(LTS) Download Node

Development

To set up the for development

  • yarn this will install all the dependencies

  • copy .env.example to .env

  • yarn start to create start the serve

  • To generate new posts

    • Run yarn posts [title] This will create a new post in source/_post/[title].md
  • To generate new pages:

    • Run yarn page [title] this will create a new page in source/[title]/index.md
  • To edit the sidebar:

    • Edit themes/redbrick-theme/_config.yaml - this is where all the theme configuration is controlled from.

Docker

Theres a docker-compose.yml for development.

  • Copy .env.example to .env
  • Run docker-compose up

Generate

  • To demo the site run yarn start. This will create a server that runs on localhost:3000
  • To work on css and have it auto regenerate use yarn hexo. This will create a server that runs on localhost:4000

CSS and Templates

  • You can edit the css for the theme in themes/redbrick-theme/source/css
  • You can edit the templates in themes/redbrick-theme/layout

Google analytics

Analytics can be enabled by adding your analytics key to theme/redbrick/_config.yaml

Production

Setup

To deploy to a server run:

  • yarn this will install all the dependencies
  • modify _config.yml as needed
  • copy production/website.service to /etc/systemd/system
  • yarn generate to create initial site
  • systemctl start website to start the express server

You will also need to create three files:

  • mailing_list a newline-separated list of email addresses
  • email_update_log a newline-separated reverse-chronological list of times email updates were sent
  • .env by copying .env.example and modifying values (important)
  • Set any Environment Variables through the env file

mailing_list and email_update_log can be left blank, though updates for every post in history will be sent if no previous send date is specified.

Then using apache or nginx proxy traffic to port 3000.

And done.

Docker

To use docker in production theres a docker-compose.yml in the production folder.

  • Copy the .env.example to .env relative to the docker-compose.yml.
  • Modify .env
  • Create a file called mailing_list and add email addresses for announce
  • run docker-compose up -d

Generate via API

  • While the server is live, a visit to http://[sitehost]/api/regenerate?token=your_secret_token will run hexo generate and send emails for any new posts so long as that process is not already underway.

Mail Options

To use sendmail rather then SMTP in the _config.yml set useSendMail to true.

To disable auth on SMTP leave auth.user and auth.pass as empty.

Modify the host, and port options as needed for SMTP either in the config or using the env variables.

Environment Variables

Variable Example Description
SECRET_API_TOKEN API key for regenerating the site
RECAPTCHA_SECRET_KEY Recaptcha server key from Google
RECAPTCHA_SITE_KEY Recaptcha site key same as the on in the theme
LOG_ROTATE 24h When to rotate logs
SMTP_HOST mailhost.redbrick.dcu.ie SMTP host address
SMTP_PORT 25 SMTP port for server
SMTP_SECURE false if using SSL or not
SMTP_USER no-reply redbrick username for SMTP auth leave off the @redbrick.dcu.ie
SMTP_PASS account password
SMTP_AUTH_METHOD plain auth method to use with SMTP. Defaults to plain
PORT 3000 port to run the server on defaults to 3000

License

Official website of DCU Redbrick Society.

Copyright (C) 2017 Redbrick and all contributors.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.