Skip to content

Commit

Permalink
Merge pull request #80 from metaodi/https-change
Browse files Browse the repository at this point in the history
Switch to HTTPS
  • Loading branch information
metaodi authored Nov 10, 2020
2 parents 3b832a5 + 5b6f1c1 commit 5d8e069
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ npm-debug.log
node_modules/
.env
data/
certs/
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project follows [Semantic Versioning](http://semver.org/).

## [Unreleased][unreleased]
### Changed
- Redirect to HTTPS on heroku

### Added
- SSL certificate for openerz.metaodi.ch to enable HTTPS

## 4.0.0 - 2020-11-08
### Changed
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
[![Build Status](https://travis-ci.org/metaodi/openerz.svg?branch=master)](https://travis-ci.org/metaodi/openerz)
[![Build Status](https://github.com/metaodi/openerz/workflows/Build%20OpenERZ/badge.svg)](https://github.com/metaodi/openerz/actions?query=workflow%3A%22Build+OpenERZ%22)

**Access the public API here: http://openerz.metaodi.ch**
**Access the public API here: https://openerz.metaodi.ch**

Installation
============

If you want to run openerz yourself, here is how to set it up:

1. Clone this repository: `git clone [email protected]:metaodi/openerz.git`
1. Switch to the clones repository: `cd openerz`
1. Run `npm install`
1. Run `npm start`

Expand Down Expand Up @@ -38,11 +37,11 @@ To create a new release follow these steps:
1. Update the `CHANGELOG.md`
1. Create a [new release/tag on GitHub](https://github.com/metaodi/openerz/releases)

The new release on GitHub triggers a deployment of the application to heroku (http://openerz.metaodi.ch).
The new release on GitHub triggers a deployment of the application to heroku (https://openerz.metaodi.ch).

Credits
=======

The logo was created by sagit milshtein from the Noun Project (CC-BY 3.0)

<img src="http://openerz.metaodi.ch/static/logo.png" alt="OpenERZ-Logo" width="90"/>
<img src="https://openerz.metaodi.ch/static/logo.png" alt="OpenERZ-Logo" width="90"/>
4 changes: 4 additions & 0 deletions lib/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ function addApiDocRoutes(server) {
function redirectToDocs() {
return function(request, h) {
var protocol = 'http';

var host = request.headers.host;
if ('openerz.metaodi.ch' === host) {
protocol = 'https';
}
return h.redirect(protocol + '://' + host + '/documentation');
};
}
Expand Down

0 comments on commit 5d8e069

Please sign in to comment.