Commit 5fbf1e74 authored by Henry's avatar Henry

assets: switch to go-bindata

License: MIT
Signed-off-by: default avatarHenry <cryptix@riseup.net>
parent 0d42a6a7
......@@ -4,10 +4,10 @@
Do not edit the .go files directly.
Instead, edit the source files and use `go2doc` from within the
Instead, edit the source files and use `go generate` from within the
assets directory:
```
go get github.com/whyrusleeping/doc2go
go get -u github.com/jteeuwen/go-bindata/...
go generate
```
package assets
var Init_doc_about = `
IPFS -- Inter-Planetary File system
IPFS is a global, versioned, peer-to-peer filesystem. It combines good ideas
from Git, BitTorrent, Kademlia, SFS, and the Web. It is like a single bit-
torrent swarm, exchanging git objects. IPFS provides an interface as simple
as the HTTP web, but with permanence built in. You can also mount the world
at /ipfs.
IPFS is a protocol:
- defines a content-addressed file system
- coordinates content delivery
- combines Kademlia + BitTorrent + Git
IPFS is a filesystem:
- has directories and files
- mountable filesystem (via FUSE)
IPFS is a web:
- can be used to view documents like the web
- files accessible via HTTP at 'http://ipfs.io/<path>'
- browsers or extensions can learn to use 'ipfs://' directly
- hash-addressed content guarantees authenticity
IPFS is modular:
- connection layer over any network protocol
- routing layer
- uses a routing layer DHT (kademlia/coral)
- uses a path-based naming service
- uses bittorrent-inspired block exchange
IPFS uses crypto:
- cryptographic-hash content addressing
- block-level deduplication
- file integrity + versioning
- filesystem-level encryption + signing support
IPFS is p2p:
- worldwide peer-to-peer file transfers
- completely decentralized architecture
- **no** central point of failure
IPFS is a cdn:
- add a file to the filesystem locally, and it's now available to the world
- caching-friendly (content-hash naming)
- bittorrent-based bandwidth distribution
IPFS has a name service:
- IPNS, an SFS inspired name system
- global namespace based on PKI
- serves to build trust chains
- compatible with other NSes
- can map DNS, .onion, .bit, etc to IPNS
`
//go:generate doc2go -in=init-doc/about -out=about.go -package=assets
//go:generate doc2go -in=init-doc/readme -out=readme.go -package=assets
//go:generate doc2go -in=init-doc/help -out=help.go -package=assets
//go:generate doc2go -in=init-doc/contact -out=contact.go -package=assets
//go:generate doc2go -in=init-doc/security-notes -out=security-notes.go -package=assets
//go:generate doc2go -in=init-doc/quick-start -out=quick-start.go -package=assets
//go:generate go-bindata -pkg=assets init-doc
package assets
var Init_dir = map[string]string{
"about": Init_doc_about,
"readme": Init_doc_readme,
"help": Init_doc_help,
"contact": Init_doc_contact,
"security-notes": Init_doc_security_notes,
"quick-start": Init_doc_quick_start,
var InitDir = map[string][]byte{
"about": MustAsset("init-doc/about"),
"readme": MustAsset("init-doc/readme"),
"help": MustAsset("init-doc/help"),
"contact": MustAsset("init-doc/contact"),
"security-notes": MustAsset("init-doc/security-notes"),
"quick-start": MustAsset("init-doc/quick-start"),
}
This diff is collapsed.
package assets
var Init_doc_contact = `Come hang out in our IRC chat room if you have any questions.
Contact the ipfs dev team:
- Bugs: https://github.com/ipfs/go-ipfs/issues
- Help: irc.freenode.org/#ipfs
- Email: dev@ipfs.io
`
package assets
var Init_doc_help = `Some helpful resources for finding your way around ipfs:
- quick-start: a quick show of various ipfs features.
- ipfs commands: a list of all commands
- ipfs --help: every command describes itself
- https://github.com/ipfs/go-ipfs -- the src repository
- #ipfs on irc.freenode.org -- the community irc channel
`
package assets
var Init_doc_quick_start = `# 0.1 - Quick Start
This is a set of short examples with minmal explanation. It is meant as
a "quick start". Soon, we'll write a longer tour :-)
Add a file to ipfs:
echo "hello world" >hello
ipfs add hello
View it:
ipfs cat <the-hash-you-got-here>
Try a directory:
mkdir foo
mkdir foo/bar
echo "baz" > foo/baz
echo "baz" > foo/bar/baz
ipfs add -r foo
View things:
ipfs ls <the-hash-here>
ipfs ls <the-hash-here>/bar
ipfs cat <the-hash-here>/baz
ipfs cat <the-hash-here>/bar/baz
ipfs cat <the-hash-here>/bar
ipfs ls <the-hash-here>/baz
References:
ipfs refs <the-hash-here>
ipfs refs -r <the-hash-here>
ipfs refs --help
Get:
ipfs get <the-hash-here> foo2
diff foo foo2
Objects:
ipfs object get <the-hash-here>
ipfs object get <the-hash-here>/foo2
ipfs object --help
Pin + GC:
ipfs pin -r <the-hash-here>
ipfs gc
ipfs ls <the-hash-here>
ipfs unpin -r <the-hash-here>
ipfs gc
Daemon:
ipfs daemon (in another terminal)
ipfs id
Network:
(must be online)
ipfs swarm peers
ipfs id
ipfs cat <hash-of-remote-object>
Mount:
(warning: fuse is finicky!)
ipfs mount
cd /ipfs/<
Tool:
ipfs version
ipfs update
ipfs commands
ipfs config --help
open http://localhost:5001/webui
Browse:
webui:
http://localhost:5001/webui
video:
http://localhost:8080/ipfs/QmVc6zuAneKJzicnJpfrqCH9gSy6bz54JhcypfJYhGUFQu/play#/ipfs/QmTKZgRNwDNZwHtJSjCp6r5FYefzpULfy37JvMt9DwvXse
images:
http://localhost:8080/ipfs/QmZpc3HvfjEXvLWGQPWbHk3AjD5j8NEN4gmFN8Jmrd5g83/cs
markdown renderer app:
http://localhost:8080/ipfs/QmX7M9CiYXjVeFnkfVGf3y5ixTZ2ACeSGyL1vBJY1HvQPp/mdown
`
package assets
var Init_doc_readme = `Hello and Welcome to IPFS!
██╗██████╗ ███████╗███████╗
██║██╔══██╗██╔════╝██╔════╝
██║██████╔╝█████╗ ███████╗
██║██╔═══╝ ██╔══╝ ╚════██║
██║██║ ██║ ███████║
╚═╝╚═╝ ╚═╝ ╚══════╝
If you're seeing this, you have successfully installed
IPFS and are now interfacing with the ipfs merkledag!
-------------------------------------------------------
| Warning: |
| This is alpha software. use at your own discretion! |
| Much is missing or lacking polish. There are bugs. |
| Not yet secure. Read the security notes for more. |
-------------------------------------------------------
Check out some of the other files in this directory:
./about
./help
./quick-start <-- usage examples
./readme <-- this file
./security-notes
`
package assets
var Init_doc_security_notes = ` IPFS Alpha Security Notes
We try hard to ensure our system is safe and robust, but all software
has bugs, especially new software. This distribution is meant to be an
alpha preview, don't use it for anything mission critical.
Please note the following:
- This is alpha software and has not been audited. It is our goal
to conduct a proper security audit once we close in on a 1.0 release.
- ipfs is a networked program, and may have serious undiscovered
vulnerabilities. It is written in Go, and we do not execute any
user provided data. But please point any problems out to us in a
github issue, or email security@ipfs.io privately.
- ipfs uses encryption for all communication, but it's NOT PROVEN SECURE
YET! It may be totally broken. For now, the code is included to make
sure we benchmark our operations with encryption in mind. In the future,
there will be an "unsafe" mode for high performance intranet apps.
If this is a blocking feature for you, please contact us.
`
......@@ -170,8 +170,8 @@ func addDefaultAssets(out io.Writer, repoRoot string) error {
dirb := uio.NewDirectory(nd.DAG)
// add every file in the assets pkg
for fname, file := range assets.Init_dir {
buf := bytes.NewBufferString(file)
for fname, file := range assets.InitDir {
buf := bytes.NewBuffer(file)
s, err := coreunix.Add(nd, buf)
if err != nil {
return err
......
# this file defines several useful hashes used across the test codebase.
# thus they can be defined + changed in one place
HASH_WELCOME_DOCS="Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj"
HASH_WELCOME_DOCS="QmUaZRPqxSpkeQ5QvtYWYzRQA9K4zDPfQkkYjVgLx2XWrd"
HASH_HELP_PAGE="QmY5heUM5qgRubMDD1og9fhCPA6QdkMp3QCwd4s7gJsyE7"
HASH_EMPTY_DIR="QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment