• Stars
    star
    182
  • Rank 206,050 (Top 5 %)
  • Language
    Go
  • License
    Other
  • Created about 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Less than half of mastodon.

don

fknsrs.biz/p/don

I was interested by mastodon, but found it to be a little too heavyweight for me. I want something I can run as a single binary with no other services. To that end, I'm embarking on writing this - tentatively named don.

I'm not sure what it'll end up being. Right now it's just an experiment in plugging different protocols together a rudimentary read-only client. Maybe it'll be a full node implementation, but maybe not.

Beware!

I'm changing lots of things really often right now. I can't guarantee that you'll be able to upgrade from one version to the next without a lot of manual intervention at the moment. Once I've got some of the schemas and APIs nailed down, I'll enact a stability policy. Until then, I'll try to keep the really bad breaking changes to a minimum, and I'll try to batch them up whenever I can.

Prebuilt Binaries

You can download a binary from bintray.

On linux and macos you'll have to chmod +x the file after you download it. Keep in mind that this is a terminal program, so if you double-click it or try to open it from your downloads, you won't really see much happen. You'll need to open a terminal (Terminal.app on macos, cmd.exe on Windows, xterm or similar on linux), browse to the location of the binary, and run it like so:

$ ./don_dev_darwin-amd64 --public_url https://my-domain-name.com/

Change the filename and public_url argument to suit. Be sure to check out the help output (via --help) to see the available options.

Usage

usage: don --public_url=PUBLIC_URL [<flags>]

Really really small OStatus node.

Flags:
  --help                         Show context-sensitive help (also try --help-long and --help-man).
  --addr=":5000"                 Address to listen on.
  --database="don.db"            Where to put the SQLite database.
  --public_url=PUBLIC_URL        URL to use for callbacks etc.
  --log_level=INFO               How much to log.
  --pubsub_refresh_interval=15m  PubSub subscription refresh interval.
  --record_documents             Record all XML documents for debugging.

All these options are available as environment variables as well - just make them uppercase, e.g. addr is ADDR.

Build Portable Binary

Right now, you'll need the following:

  1. go (confirm via go version)
  2. docker (confirm via docker version)
$ go get fknsrs.biz/p/don
$ cd $GOPATH/src/fknsrs.biz/p/don
$ make

You should see something like the following:

cd client && yarn run build-server
yarn run v0.16.1
$ NODE_ENV=production webpack -p --bail --config webpack.config.server.js
[long output omitted]
cd client && yarn run build-client
yarn run v0.16.1
$ NODE_ENV=production webpack -p --bail --config webpack.config.client.js
[long output omitted]
go build -ldflags=-s -o don
rice append --exec don

At the end, you'll have a self-contained binary named don that you can move anywhere you like.

Build Cross-Platform Binaries

This is the same as above, except that you'll need one more tool:

  1. xgo

Now, instead of running make, you run make cross. You'll end up with binaries named don-darwin-10.6-amd64, don-linux-amd64, don-linux-arm-5, and don-windows-4.0-amd64.exe.

Development

Most of the work will probably be in the client code. To make this easier, there's a live_reload makefile target. This runs a couple of webpack processes, and the don server, wiring the server up so that it uses the hot reloading bits of webpack. If none of that made sense, don't worry. I've tried to paper over all the details on purpose - configuring webpack is not for the faint of heart.

All you need to know is that when you run the live reloading environment, you have to provide all your server parameters as environment variables. I suggest something like the following:

$ export PUBLIC_URL=http://my-host.com
$ export LOG_LEVEL=DEBUG
$ make live_reload

Once it's all running, you should be able to open http://127.0.0.1:5100/ in your browser. You'll see a very quick flash of unstyled content, but then the client JS should kick in and fix it up.

When this is running, you'll be able to save files and have the content in the browser update automatically. This makes working on client stuff much nicer.

Code Formatting

The main idea for the code formatting in this project is that it should be automated. Not just automatically checked, but automatically applied. No bikeshedding, no suggestions, no discussions. Computer is always right.

For go, use gofmt.

For JavaScript, use prettier with --single-quote and --trailing-comma es5.

For CSS, use csscomb with the config provided in client/.csscomb.json.

For shell scripts, use shfmt with -i 2.

Code Analysis

There are a couple of tools in use right now to do some static analysis on the application's code. I expect that this list will grow in time.

ESLint is a linter, and in this case it's used to catch some basic logic errors. It is not used for detecting problems with or enforcing a formatting style. That is handled by prettier in the "Code Formatting" section.

Flow is a static analysis and gradual type engine for JavaScript. I'm not aiming for 100% coverage with Flow - I'm just using it to help catch really obvious bugs (e.g. accessing properties on null/undefined).

flow-report (in client/flow-report.js) is used to make an HTML report (in client/coverage/flow) from the coverage data Flow can produce.

Acknowledgements

Some included icons were made by Freepik at Flaticon, which were shared under the CC 3.0 BY Creative Commons license.

The included username blacklist is based on The Big Username Blacklist by Martin Sandström, which was provided under the MIT license.

Some code for serialising forms was adapted from freiform by Falk Hoppe, which was provided under the Apache License 2.0.

More Repositories

1

npmrc

Switch between different .npmrc files with ease and grace.
JavaScript
439
star
2

dotty

Access properties of nested objects using dot-path notation
JavaScript
128
star
3

hl7

Go
102
star
4

bittorrent.js

BitTorrent implementation in JavaScript
JavaScript
88
star
5

jsmc

Pure JavaScript Minecraft server
JavaScript
82
star
6

dissolve

Parse and consume binary streams with a neat DSL
JavaScript
80
star
7

duplexer2

Like duplexer (http://npm.im/duplexer) but using streams2
JavaScript
72
star
8

paginator

Generic pagination algorithm wrapped in a CommonJS module
JavaScript
67
star
9

xvideos

Access xvideos.com programmatically
JavaScript
64
star
10

node-mediainfo

Wrapper around the `mediainfo' program for obtaining information about media files
JavaScript
55
star
11

proquint

Identifiers that are readable, spellable, and pronounceable.
JavaScript
40
star
12

node-ginger

Spicy templating for node and the browser inspired by Twig, Dust.JS and Hogan.JS
JavaScript
40
star
13

mqtt-protocol-c

Zero-copy, interruptible MQTT protocol parser and serialiser written in C
C
38
star
14

concentrate

Produce binary data with a neat DSL
JavaScript
34
star
15

whatcd

What.CD JSON API library
JavaScript
33
star
16

docker-events

Create an event emitter from dockerode's events response
JavaScript
32
star
17

ottoext

Event loop extensions for the otto JavaScript interpreter.
Go
28
star
18

combine-stream

Combine multiple duplex streams into just one
JavaScript
20
star
19

passports

Multi-tenancy (read: virtual hosts) for Passport.JS
JavaScript
19
star
20

fork-stream

Fork a stream in multiple directions according to a function
JavaScript
18
star
21

asciitable

Render tables in text for tabular terminal fun times!
JavaScript
18
star
22

instagit

No-frills ssh/git gateway
Shell
17
star
23

jesus

Resurrect processes if they die.
JavaScript
17
star
24

node-nyaatorrents

NyaaTorrents client for Node.JS
CSS
15
star
25

transformation-matrix-js

2D affine matrix power tools for JavaScript
JavaScript
15
star
26

frequencer

HTML5 audio sequencer
JavaScript
15
star
27

houkou

Teeny tiny router for node and the browser
JavaScript
15
star
28

wd

Web browser from an alternate timeline
C
14
star
29

protofudger

Go
14
star
30

libmcnet

An event based, zero-copy, portable Minecraft network protocol parser.
C
13
star
31

npm-gpg

Sign and verify npm packages using GPG
Shell
11
star
32

npm-ipfs

Go
10
star
33

jsm

It's like ASM, but it's JavaScript underneath
JavaScript
9
star
34

ecsx

Go
8
star
35

xml-c14n

XML canonicalisation for Node.JS
JavaScript
8
star
36

semver-c

Semantic versioning is back! In C form!
C
8
star
37

pillion

Make your burro a bit more comfortable with RPC!
JavaScript
8
star
38

dusty

Compile a collection of dust.js templates
JavaScript
8
star
39

suckit

Suck up a data stream and store it in LevelDB
JavaScript
8
star
40

mongo-oplog-watcher

JavaScript
7
star
41

bittorrent-dht-byo

A middle-level library for interacting with the BitTorrent DHT network. Bring your own transport layer and peer logic.
JavaScript
7
star
42

xml-dsig

XML digital signatures
JavaScript
7
star
43

node-mcnet

Node.JS bindings to libmcnet (An event based, zero-copy, portable Minecraft network protocol parser).
C++
7
star
44

node-polarssl

PolarSSL bindings for Node.JS
C++
7
star
45

xvideos-cli

Command line application for searching xvideos.com
JavaScript
7
star
46

scp

Go
6
star
47

irc-client

IRC client logic using irc-protocol for communication
JavaScript
6
star
48

headed-stream

JavaScript
6
star
49

SublimeReddit

Python
6
star
50

nibbit

JavaScript NBT encoder and decoder
JavaScript
6
star
51

mllp

Go
5
star
52

stream-smash

Smash two object streams together, or, `select * from stream1 join stream2 on stream1.x = stream2.y`
JavaScript
5
star
53

node-torrent-util

Various utility functions for making sense of .torrent files
JavaScript
5
star
54

mitsukeru

Experiment in search engine concepts
C++
5
star
55

node-tokyotosho

Tokyo Toshokan client for Node.JS
JavaScript
4
star
56

tiny-tcp-scanner

Really simple unix-y TCP scanner suite
C
4
star
57

nagiohdear

Rudimentary config parser/generator for Nagios
JavaScript
4
star
58

steez

The g of a mack and the steez of a geezer.
JavaScript
4
star
59

irc-protocol

Streaming parser and serialiser for IRC protocol data
JavaScript
4
star
60

riffmint

Riff Mint is a new way to create, share and collaborate on musical projects.
JavaScript
4
star
61

echo-logrus

Go
3
star
62

tinder

JavaScript
3
star
63

Twitter2IRC

Simple IRC bot that spews a twitter stream to an IRC channel
JavaScript
3
star
64

jsonix-smart

Smart context for Jsonix
JavaScript
3
star
65

nonmutable

JavaScript
3
star
66

flvee

Flash Video (FLV) parser and serialiser for Node.JS
JavaScript
3
star
67

react-in-go

Rendering React in go by providing a very tiny JavaScript environment (including the fetch API!)
JavaScript
3
star
68

ccs

Content Classification System
JavaScript
3
star
69

complimenter

9 out of 10 doctors say you have practically radiant knees.
JavaScript
3
star
70

bencode-stream

Bencode streaming encoder/decoder
JavaScript
3
star
71

jsm-c

C
3
star
72

xacml

JavaScript
3
star
73

cweather

Text-mode weather display program
C
2
star
74

web-analytics

Go
2
star
75

node-config-loader

Configuration loader for Node.JS
JavaScript
2
star
76

mongo-live-collection

JavaScript
2
star
77

metlink

Remember Metlink? Well it's back! In JS form!
JavaScript
2
star
78

xacml-wso2

JavaScript
2
star
79

quickbundle

Go
2
star
80

reaver-ui

Hacky UI to wrap around reaver-wps
JavaScript
2
star
81

config-c--

Generic classes for config file handing in C++
C++
2
star
82

jishaku-web

Jishaku Toshokan's web component!
Go
2
star
83

jishaku-torrent-storage

Everyone needs somewhere to put their loot!
JavaScript
2
star
84

node-mysql-getter

Very simple resource pooling for MySQL connections in node.js
JavaScript
2
star
85

dunn

Open source Node.js powered IRC bot for #webtech on freenode.
JavaScript
2
star
86

banner-grabber

Simple banner grabber based on libevent
C
1
star
87

xml-entities

JavaScript
1
star
88

jobserver

Go
1
star
89

kosu

Filter streams according to SIQL queries
JavaScript
1
star
90

avr-js

JavaScript
1
star
91

bintail

Like tail -f, but binary-safe!
JavaScript
1
star
92

souffle

Versioned, auditable objects with history and distillation
JavaScript
1
star
93

legobox

Pluggable console UI toolkit
JavaScript
1
star
94

suds

SOAP for Node.JS
JavaScript
1
star
95

jsuck

Streaming (optionally) newline/whitespace delimited JSON parser
JavaScript
1
star
96

hl7terser

Go
1
star
97

tiny-cplusplus-callbacks

Very small c++ callback library. Probably not even useful for most people.
C
1
star
98

info-hasher

Simple torrent consolidation tool
C++
1
star
99

connect-winston

winston logging for connect applications
JavaScript
1
star
100

create-a-huge-problem

JavaScript
1
star