Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let's make publishing to the DWeb simple and fun with IPFS #114

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
**/node_modules/
**/*.log
test/repo-tests*
**/bundle.js
docs
# Logs
logs
*.log

coverage

# Runtime data
pids
*.pid
Expand All @@ -19,9 +26,18 @@ coverage
# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
build

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

lib
dist
test/fixtures/go-ipfs-repo/LOCK
test/fixtures/go-ipfs-repo/LOG
test/fixtures/go-ipfs-repo/LOG.old

# while testing npm5
package-lock.json
yarn.lock
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

82 changes: 30 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,50 @@
ipscend
=======
dweb-publish (previously known as ipscend)
============

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) ![](https://img.shields.io/badge/coverage-%3F-yellow.svg?style=flat-square) [![Dependency Status](https://david-dm.org/diasdavid/ipscend.svg?style=flat-square)](https://david-dm.org/diasdavid/ipscend) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
![](https://img.shields.io/badge/coverage-%3F-yellow.svg?style=flat-square)
[![](https://david-dm.org/ipfs-shipyard/dweb-publish.svg?style=flat-square)](https://david-dm.org/ipfs-shipyard/dweb-publish)
[![](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)

> Web Application publishing, simple and distributed with IPFS
> Publish Websites and Web Applications to the DWeb using IPFS

## Usage

Install via npm

```
$ npm install ipscend --global
```

Run the CLI to show the available commands

```
$ ipscend
Usage: ipscend COMMAND [OPTIONS]

Available commands:

browse Open your application in a browser
init Initialize a ipscend project
ipfs start Start your a local IPFS node
preview Preview your application before you publish it
publish Publish your project
screenshot View or generate screenshots for your application
versions Check each version published
```

### commands

#### `ipscend browse`

Opens the last published version of your application in the browser.

#### `ipscend init`
## `dweb-publish` Description and Goals

Initializes your project. Asks for the folder where the web application will be available and stores an `ipscend.json` object in your current path to store all the metadata it generates, such as published versions and taken screenshots.
Let's make publish to the DWeb super simple and fun ✨!

#### `ipscend ipfs start`
This project started as [`ipscend`](http://daviddias.me/blog/ipscend/) and it was a fun tool at the time to get Websites on the DWeb super quick. Things like DNSLink were still recent and IPFS itself didn't support multiple formats other than the MerkleDAG.

Start and init an IPFS node (in case you don't want to install and run IPFS yourself)
Today things are different! IPFS can now support other formats such as Git (so that you don't have to re-add files), it also has lot better APIs, the JS implementation is now fully interoperable with the Go implementation (no more need to run daemons separetly), APIs have improved a ton and there is also now dozens of Gateways and Pinning Services outthere for users to ensure that their Website stays in the network without having to run their own daemon.

#### `ipscend preview`
It is time to revamp the project and improve it so that we achieve the big goal, making the act of publishing a Website to the DWeb incredibly simple, enjoyful and functional! Below you can find the rough roadmap of the steps ahead. Want to help? Join the effort by contributing to this repo or show up at one of the [Weekly IPFS All Hands calls](https://github.com/ipfs/pm/#weekly-all-hands).

Serves your application on a local static file server, so that you can try it out before you feel ready to publish it.
### (rough) Roadmap

#### `ipscend publish`
#### v1 - Make a tool that enables Website authors and Web Developers to publish their Websites with IPFS

Publishes the current state of your application to IPFS and stores a reference to it.
- [ ] Refactor and update old ipscend code to use the latest and greatest IPFS APIs
- [ ] Create an ipfs-push tool that automatically pushes the latest publish to multiple IPFS Gateways
- [ ] Add support for IPFS Cluster pinbot so that the Website is stored

**Note:** You have to have a local IPFS node running in order to publish, check below for how to get your local IPFS node running.
#### v2 - Support git directly

#### `ipscend screenshot`
- [ ] Publish the Git Hash directly through IPFS using CID & IPLD. This will avoid duplicating the info that already exists on the git repo
- [ ] Add support to the IPFS Files API to understand Git graphs as files and folders (e.g. ipfs.io/ipfs/gitHash/public)

Opens a screenshot preview of all the published versions of your app. In order to generate the screenshots, you must first run `ipscend screenshot --gen`.
#### v3 - Autopublish

![](http://zippy.gfycat.com/TameDampKob.gif)
- [ ] Find .dweb files in Github repositories and make the published versions available automatically through IPFS

**Note:** The webapp used for this is [ipscend-screenshot-visualizer](https://github.com/diasdavid/ipscend-screenshot-visualizer).
## Usage

#### `ipscend versions`
Install via npm

Prints out the published versions for the app and its respective timestamp.
```
$ npm install dweb-publish --global
```

**Note:** In order to use this feature, you must set `API_ORIGIN=*` as an environment variable before running your IPFS node.
### Commands

## Use IPFS to host your webpage using a standard domain (includes cool DNS trick!)

Expand All @@ -76,7 +54,7 @@ Every IPFS node HTTP interface checks the host header when it receives a request

To make this work, simply:

1. Publish your application using `ipscend publish`.
1. Publish your application using `dweb-publish`.
2. Save the returned hash.
3. Find the IPFS ip addresses using `$ dig ipfs.io`. Example:

Expand Down
2 changes: 2 additions & 0 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Warning: This file is automatically synced from https://github.com/ipfs/ci-sync so if you want to change it, please change it there and ask someone to sync all repositories.
javascript()
12 changes: 0 additions & 12 deletions circle.yml

This file was deleted.

49 changes: 23 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,46 @@
{
"name": "ipscend",
"name": "dweb-publish",
"version": "0.4.3",
"description": "Web Application publishing made simple and distributed with IPFS ",
"bin": {
"ipscend": "src/cli/bin.js",
"lch": "src/cli/bin.js"
"dweb-publish": "src/bin.js"
},
"scripts": {
"lint": "aegir-lint",
"test": "aegir-test --env node",
"release": "aegir-release --env no-build",
"release-minor": "aegir-release --type minor --env no-build",
"release-major": "aegir-release --type major --env no-build",
"coverage": "aegir-coverage",
"coverage-publish": "aegir-coverage publish"
"lint": "aegir lint",
"test": "aegir test -t node",
"release": "aegir release --no-build",
"release-minor": "aegir release --type minor --no-build",
"release-major": "aegir release --type major --eno-build",
"coverage": "aegir coverage",
"coverage-publish": "aegir coverage publish"
},
"pre-commit": [
"lint"
],
"repository": {
"type": "git",
"url": "https://github.com/diasdavid/ipscend.git"
"url": "https://github.com/ipfs-shipyard/dweb-publish.git"
},
"keywords": [
"IPFS"
],
"author": "David Dias <daviddias@ipfs.io>",
"license": "MIT",
"bugs": {
"url": "https://github.com/diasdavid/ipscend/issues"
"url": "https://github.com/ipfs-shipyard/dweb-publish/issues"
},
"homepage": "https://github.com/diasdavid/ipscend",
"homepage": "https://github.com/ipfs-shipyard/dweb-publish",
"dependencies": {
"asking": "^0.1.2",
"ipfs-api": "^14.0.2",
"ipfsd-ctl": "^0.21.0",
"ndjson-aggregator": "^0.1.2",
"node-static": "^0.7.9",
"open": "0.0.5",
"ronin": "^0.3.11",
"webshot": "^0.18.0"
"asking": "~0.1.2",
"ipfs": "^0.32.3",
"ipfs-api": "^25.0.0",
"ipfsd-ctl": "^0.39.3",
"ipfsx": "~0.16.0",
"ndjson-aggregator": "~0.1.2",
"node-static": "~0.7.11",
"open": "~0.0.5",
"webshot": "~0.18.0",
"yargs": "^12.0.2"
},
"devDependencies": {
"aegir": "^11.0.2",
"pre-commit": "^1.2.2"
"aegir": "^15.3.1"
},
"contributors": [
"David Dias <daviddias.p@gmail.com>",
Expand Down
34 changes: 34 additions & 0 deletions src/bin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /usr/bin/env node

'use strict'

const yargs = require('yargs')
const fs = require('fs')
const updateNotifier = require('update-notifier')
const readPkgUp = require('read-pkg-up')

const pkg = readPkgUp.sync({ cwd: __dirname }).pkg
const week = 1000 * 60 * 60 * 24 * 7 // 1 week

updateNotifier({ pkg, updateCheckInterval: week }).notify()

const args = process.argv.slice(2)

yargs
.demandCommand(1)
// .epilog('wowza!') text after all commands
.fail((msg, err, yargs) => {
if (err) { throw err } // preserve stack

if (args.length > 0) {
console.log(msg)
}

yargs.showHelp()
})

fs.readdirSync(__dirname)
.filter((name) => !name.indexOf('command-'))
.forEach((command) => require('./' + command)(yargs))

yargs.argv // eslint-disable-line no-unused-expressions
10 changes: 0 additions & 10 deletions src/cli/bin.js

This file was deleted.

46 changes: 0 additions & 46 deletions src/cli/commands/ipfs/start.js

This file was deleted.

Loading