Skip to content

Commit

Permalink
Add gitbook documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SamyPesse committed Mar 17, 2016
1 parent c47bbb7 commit 447b700
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 19 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ build/Release
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

.env
.env

docs/_book/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Nuts is a simple (and smart) application to serve desktop-application releases.

![Schema](./schema.png)
![Schema](./docs/schema.png)

It uses GitHub as a backend to store assets, and it can easily be deployed to Heroku as a stateless service. It supports GitHub private repositories (useful to store releases of a closed-source application available on GitHub).

Expand Down
24 changes: 24 additions & 0 deletions book.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var pkg = require('./package.json');

module.exports = {
// Documentation for Nuts is stored under "docs"
root: './docs',
title: 'Nuts Documentation',

// Enforce use of GitBook v3
gitbook: '>=3.0.0-pre.0',

// Use the "official" theme
plugins: ['theme-official', 'sitemap'],
theme: 'official',

variables: {
version: pkg.version
},

pluginsConfig: {
sitemap: {
hostname: 'https://nuts.gitbook.com'
}
}
};
28 changes: 21 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
# Nuts Documentation

Please make sure that you use the documents that match your Nuts version.
Nuts is a simple (and smart) application to serve desktop-application releases.

It uses GitHub as a backend to store assets, and it can easily be deployed to Heroku as a stateless service. GitHub private repositories are supported (useful to store releases of a closed-source application available on GitHub).

![Schema](./schema.png)

Please make sure that you use the documentation that match your Nuts version (Latest version is **{{ book.version }}**).

### FAQ

There are questions that are asked quite often, [check this out before creating an issue](faq.md).

### Help and Support

We're always happy to help out with any questions you might have. You can ask a question or signal an issue on [GitHub](https://github.com/GitbookIO/nuts/issues).

### Guides

- [Deploy it!](deploy.md)
- [Upload assets](assets.md)
- [Setup GitHub webhook](github.md)
- [OS X Auto-Updater](update-osx.md)
- [Windows Auto-Updater](update-windows.md)
We've created a few guides to help you getting started:

- [Deploy Nuts](deploy.md)
- [Upload release's assets](assets.md)
- [Setup GitHub integration](github.md)
- [Setup OS X Auto-Updater](update-osx.md)
- [Setup Windows Auto-Updater](update-windows.md)
- [Debug API](api.md)
- [Use it as a node module](module.md)
- [Use it as a Node.js middleware](module.md)

----

Using Nuts for your application? [Add it to the list](using-it.md).
17 changes: 17 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Summary

- [F.A.Q](faq.md)

---

- [Deploy Nuts](deploy.md)
- [Upload Releases](assets.md)
- [Setup GitHub webhook](github.md)
- [Mac / OS X Auto-Updater](update-osx.md)
- [Windows Auto-Updater](update-windows.md)

---

- [Debug API](api.md)
- [Node.js Middleware](module.md)

14 changes: 8 additions & 6 deletions docs/assets.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Assets for releases
# Upload assets for releases

Nuts uses GitHub releases and assets to serve the right file to the right user.
Nuts uses GitHub Releases and assets to serve the right file to the right user.

### Filename
See GitHub guides: [About Releases](https://help.github.com/articles/about-releases/) & [Creating Releases](https://help.github.com/articles/creating-releases/).

It uses some filename/extension conventions to serve the correct asset to a specific request:
### Naming

Platform will be detected from the filename:
Nuts uses some filename/extension conventions to serve the correct asset to a specific request:

The platform/OS will be detected from the filename:

- Windows: filename should contain `win`
- Mac/OS X: filename should contain `mac` or `osx`
Expand All @@ -23,7 +25,7 @@ Filetype and usage will be detected from the extension:
| Linux | `.deb`, `.rpm`, `.zip` |


## Example
### Example

Here is a list of files in one of the latest release of our [GitBook Editor](https://www.gitbook.com/editor):

Expand Down
6 changes: 5 additions & 1 deletion docs/deploy.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Deployment

Nuts can be easily be deployed to a state-less server or PaaS.
Nuts can be easily be deployed to a state-less server or PaaS. It only uses the disk as a cache for assets.

### On Heroku:

Heroku is the perfect solution to host a Nuts instance.

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)

### With docker

Nuts can also be run as a Docker container:

```
docker run -it -p 80:80 -e GITHUB_REPO=username/repo gitbook/nuts
```
Expand Down
20 changes: 17 additions & 3 deletions docs/github.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# GitHub Setup
# GitHub Integration

Add `http://download.myapp.com/refresh` as a GitHub webhook to refresh versions cache everytime you update a release on GitHub.
By default Nuts fetch releases from GitHub Releases; but sicne Nuts is caching informations, there might be a delay before the creation of the release and the release being served to users.

The secret can be configured using `GITHUB_SECRET` (default value is `secret`).
To solve this issue, you can setup a webhook between Nuts and GitHub, to notify your nuts instance each time GitHub Releases are updated (created/removed/updated).

### Webhook URL

Add a [GitHub Webhook](https://help.github.com/articles/about-webhooks/) with the url:

```
http://download.myapp.com/refresh`
```

It'll refresh versions cache everytime you update a release on GitHub.

### Secret

The GitHub Webhook secret can be configured as a environment variable on Nuts: `GITHUB_SECRET` (default value is `secret`).
File renamed without changes

0 comments on commit 447b700

Please sign in to comment.