Skip to content

Commit

Permalink
added backend, private repo, updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfk committed Aug 26, 2016
1 parent 920a035 commit 8a29bc7
Show file tree
Hide file tree
Showing 10 changed files with 186 additions and 106 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
All enhancements and patches to statuspage will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 0.6.0 [2016-07-26]
- Added an option to automate the update process.
- Switch to PyGithub as pygithub-redux is no longer needed
- Added an option to create private repositories
- Beefed up the docs

## 0.5.1 [2016-07-26]
- Updated dependencies: tqdm and pygithub-redux

Expand Down
127 changes: 36 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,127 +10,72 @@ issues to display incidents and labels for severity.

## Demo

![DEMO](https://github.com/pyupio/statuspage/blob/master/demo.gif)
![DEMO](https://github.com/jayfk/statuspage/blob/master/demo.gif)

See a real status page generated by this at [status.pyup.io](http://status.pyup.io/) or a [demo site](https://jayfk.github.io/statuspage-demo/)

## Before you start
## Quickstart

You'll need to create a GitHub API token. Go to your
[Personal Access tokens](https://github.com/settings/tokens) page, click on `Generate new token` and give it a description. Make
sure to check the `public_repo` scope. Copy the token somewhere safe, you won't be able to see it
again once you leave the page.


## Installation

### Using pip
Install statuspage with pip:

pip install statuspage

### Binaries
#### macOS (64Bit)
curl -L https://github.com/jayfk/statuspage/releases/download/0.5.1/statuspage-darwin-64 > /usr/local/bin/statuspage
chmod +x /usr/local/bin/statuspage

#### Linux (64Bit)
curl -L https://github.com/jayfk/statuspage/releases/download/0.5.1/statuspage-linux-64 > /usr/local/bin/statuspage
chmod +x /usr/local/bin/statuspage
*There are also binaries for macOS and Linux available, see [installation](docs/installation.md) for more.

Now, create an GitHub API token:

## Create a status page
- Go to your [Personal Access tokens](https://github.com/settings/tokens) page.
- Click on `Generate new token`.
- Make sure to check the `public_repo` and `write:repo_hook` scope.
- Copy the token somewhere safe, you won't be able to see it again once you leave the page.

To create a new status page, run
To create a new status page, run:

statuspage create --token=<yourtoken>

You'll be prompted for the name and the systems you want to show a status for.

Name: mystatuspage
Systems, eg (Website,API): Website, CDN, API

You'll be prompted for the name and the systems you want to show a status for.
*Please note: name, bla bla bla*

The command takes a couple of seconds to run. Once ready, it will output links to the issue tracker and your new status page.

- Name: This will be the name of the GitHub repo where your status page is hosted. It will
create a new GitHub repo on your account with that name, so make sure you don't use something
that already exists.
- Systems: The systems you want to show a status for. This can be your website, your API, your
CDN or whatever else you are using.
Create new issues at https://github.com/<login>/mystatuspage/issues
Visit your new status page at https://<login>.github.com/mystatuspage/

Next, you will be asked if you want to automate the update process, so that you don't have to run
the `statuspage update` command whenever you change anything on your repo.

The command takes a couple of seconds to run. Once ready, it will output the URLs to the issue tracker
and your new status page
Set up automation? [y/N]: y

Create new issues at https://github.com/<login>/mystatuspage/issues
Visit your new status page at https://<login>.github.com/mystatuspage/

If you want use the service, choose `y` and grab a key at the [shop](https://www.statuspage-backend.com).

If you don't want to use the service, choose `n`. The generator will then print the `statuspage update`
command filled with all the details you need to update your page.

## Create an issue

To create a new issue, go to your newly created repo and click on `New Issue`.

Click on the cog icon at labels on the right. What labels you choose next will tell the generator
about the affected system(s) and the severity. Your system's labels are all black.

Add a systems label, eg. `Website` and pick a severity eg. `major outage` and add them to the issue.
- Click on the cog icon next to labels on the right.
- Choose the affected systems (black labels)
- Choose a severity label (major outage, degraded performance, investigating)
- Fill in the title, leave a comment and click on `Submit new issue`.

Now, fill in the title, leave a comment and click on `Submit new issue`.
![Add New Issue](docs/new_issue.png)

Go back to your commandline and type:
Now, update your status page. Go back to your commandline and type:

statuspage update --token=<yourtoken>
Name: mystatuspage

This will update your status page and show a *major outage* on your *Website*.

If you change the issue (eg. when you add a new label, create a comment or close the issue), you'll
need to run `statuspage update` again.

## Use Organization Account

In order to create/update a status page for an organization, add the name of the organization to
the `--org` flag, e.g.:

statuspage create --org=my-org --name=..
Please note: You need to have the proper permissions to create a new repository for the given
organization.

## Customizing
See [customizing](docs/customizing.md)

**Important:** All customizations have to happen in the `gh-pages` branch. If you are using the
command line, make sure to

git checkout gh-pages

or, on the website, select the `gh-pages` branch before editing things.

### Template

The template is fully customizable, edit `template.html`.

### Logo

Add a `logo.png` to your repo's root and change `template.html` to point to that file.

### CSS

CSS is located at `style.css` in the root directory. Just edit it and commit the file.

### Use a subdomain

If you want to use your own domain to host your status page, you'll need to create a CNAME file
in your repository and set up a CNAME record pointing to that page with your DNS provider.

If you have e.g. the domain `mydomain.com`, your GitHub username is `myusername` and you want
your status page to be reachable at `status.mydomain.com`


- Create a `CNAME` file in the root of your repository

status.mydomain.com

- Go to your DNS provider and create a new CNAME record pointing to your


Name Type Value
status CNAME myusername.github.io

See [Using a custom domain with GitHub Pages](https://help.github.com/articles/using-a-custom-domain-with-github-pages/)
for more info.
## Options
See [options](docs/options.md)
42 changes: 42 additions & 0 deletions docs/customizing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## Customizing

**Important:** All customizations have to happen in the `gh-pages` branch. If you are using the
command line, make sure to

git checkout gh-pages

or, on the website, select the `gh-pages` branch before editing things.

### Template

The template is fully customizable, edit `template.html`.

### Logo

Add a `logo.png` to your repo's root and change `template.html` to point to that file.

### CSS

CSS is located at `style.css` in the root directory. Just edit it and commit the file.

### Use a subdomain

If you want to use your own domain to host your status page, you'll need to create a CNAME file
in your repository and set up a CNAME record pointing to that page with your DNS provider.

If you have e.g. the domain `mydomain.com`, your GitHub username is `myusername` and you want
your status page to be reachable at `status.mydomain.com`


- Create a `CNAME` file in the root of your repository

status.mydomain.com

- Go to your DNS provider and create a new CNAME record pointing to your


Name Type Value
status CNAME myusername.github.io

See [Using a custom domain with GitHub Pages](https://help.github.com/articles/using-a-custom-domain-with-github-pages/)
for more info.
Empty file added docs/index.md
Empty file.
15 changes: 15 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Installation

## Using pip
The prefered way to install statuspage is with Pythons package manager pip:

pip install statuspage

## Binaries
### macOS (64Bit)
curl -L https://github.com/jayfk/statuspage/releases/download/0.6.0/statuspage-darwin-64 > /usr/local/bin/statuspage
chmod +x /usr/local/bin/statuspage

### Linux (64Bit)
curl -L https://github.com/jayfk/statuspage/releases/download/0.6.0/statuspage-linux-64 > /usr/local/bin/statuspage
chmod +x /usr/local/bin/statuspage
Binary file added docs/new_issue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions docs/options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Options

## Create a private status page

*Please note: Your Github API token needs the `repo` scope.*

To create a private status page, set the `--private` flag.

statuspage create --private --token=<token>

This will create a private repository, however the GitHub page will be public.

## Use Organization Account

*Please note: You need to have the proper permissions to create a new repository for the given
organization.*

In order to create/update a status page for an organization, add the name of the organization to
the `--org` flag, e.g.:

statuspage create --org=my-org --name=..
3 changes: 2 additions & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pygithub-redux==1.30.0
click==6.6
jinja2==2.8
tqdm==4.8.1
tqdm==4.8.1
requests
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
history = history_file.read()

requirements = [
'pygithub-redux>=1.30.0',
'pygithub',
'click',
'jinja2',
'tqdm',
'requests'
]

long_description = readme + '\n\n' + history
Expand Down
Loading

0 comments on commit 8a29bc7

Please sign in to comment.