A minimal blog engine written in Go, compatible with Ghost themes
kabukky.github.io
kabukky.github.io
I've been working on this blog engine in my spare time for the last few months. My blog has been running on it without hiccups for about a month now (low volume, 700 visits a day tops).
I'd like some opinions if anyone has the time to try it out. (Worth pursuing? Any ideas for features? Should I die in a fire because my code quality sucks?)
Thanks :)
Here's my high priority feature list right now:
Gzip support, hashes for serving static assets, multi-user support, support for all of the Ghost theme helpers, MySQL, Postgres, and Google App Engine support.
So consider this a vote for "static site support". If I were to express that as a requirement it would be something like "Site is served off a set of static pages that were generated on demand as the content on them or around them changed."
Wrote my own engine for exactly this reason.
All python, no templates and only one imported module (markdown) which I'm going to use pythons (why not in the first place?). I concur with the idea. Whole blog is about 1.4Mb of text. Images are hosted so it's AUD3.5/month to host the blog + domain.
It's not Ghost compatible. I based my template on Jeckyl. That is YAML front-matter followed by markdown. All contained in text files. It's a bit slot at the moment but works a charm.
What format are you following?
* hotdog (binary) -> site (worked there)
* blosxom (perl) -> site
* perl -> TT -> ftp -> site
* python -> webpy -> appengine -> site
now * python -> markdown -> ftp/ssh -> site
future
* [some back-end language/Rpi] -> js [front-end/iPad] -> [some transport layer] -> site
I'm trading simplicity for speed and turn-around. The tool-chain is all cli, vim + browser. At some stage soon I'll write either an api/server to allow a simple interface to speed up process.
The basic ideas are based on Dave Winer and Scripting.com
If it doesn't yet support multi domain will it ever?
I'll add that to the list as well. I think that might be a useful feature.
Couldn't you use panic/recover locally, inside functions - just for having a single error handling code?
Rob Pike has written ideas here on how to clean up error handling if-blocks: http://blog.golang.org/errors-are-values
The panic/recover idiom is extremely useful in parsers. For example, Go's JSON decoder: http://golang.org/src/encoding/json/decode.go
Panic/recover are usually meant to catch "coding" and "assertion"-type errors (null pointers, array overflows, etc), not runtime errors. The latter is what the "error" values are used for.
"gonads" would be my choice of name for this library.
http://www.infoq.com/presentations/functional-pros-cons?utm_...
I don't know why so often, the immediate reaction to legitimate criticism of this wart in Go is to argue against exceptions, even when nobody has even brought up exceptions as an alternative.
I agree that, probably universally, the people who fervently argue for either exceptions or explicit Go-style error handling don't know about Maybe/Either/Result. Then again, all this is pretty much impossible to replicate in Go.
That said, even something as simple as errors being literal values that you can pattern match on is surprisingly versatile. Exceptions don't necessarily have to be awful weights that spill down all over the call stack, either. They can be distilled to a more basic catch/throw mechanism for shuffling around error properties and states.
What I've seen a lot of is swallowing of errors. For example readFromFile().orElse("") where there is no indication from an outsider that anything wrong happened. A cool feature would be logging any instance of when orElse was the result.
Would be curious how these work in other languages.
Personally I find them essential in particular for larger codebases. They allow for centralised, consistent error handling behaviour. For example paging application support teams only for certain types of errors.
And you can always emulate explicit error recovery with exceptions. So what is so bad about having the flexibilty to accomodate different styles of error handling.
https://en.wikipedia.org/wiki/Memory_safety
Memory safety is enforced in Go via best practices–like C and C++ ecosystems. However because of gc and channels race conditions happen less often in Go but there's no explicitly tooling to prevent them from happening:
That way you would be catching a lot more code issues then just unused imports, variables etc.
In the current context (NSA, generalized spying, ...), I hope that everybody realizes it's not an ideal way to distribute software.
Please provide cryptographic signatures or at least sha sums, if you really think this is the best way to distribute software.
Regarding Journey:
You can always compile from source. Go makes that easy, dependencies on GitHub will be downloaded automatically.
If you trust my builds, the releases page on GitHub is served via HTTPS, so no one should be tinkering with the binary on the way from the server to you.
If you don't want/know how to use PGP you can also publish the SHA1 sums of the files available on your download page. It's better than nothing.
The second alternative is weaker because an attacker would simply need to change the binary and the sum on the website. In the PGP case, the attacker must get access to your PGP private key, and provided that you use PGP reasonably (no private key on your web server), this is harder.
Having source code readily available didn't stop heartbleed.
If you're downloading rpms/debs, verifying the signatures, and you trust the signer, then you're probably fine. Those signature signing/checking mechanisms are already built into rpm/deb, which is why they're being argued for.
Being able to drop one binary over to a host (as opposed to the usual "DLL hell" of installing binary packages which, despite not being DLLs, is still quite common on Linux and other modern UNIX systems in the form of package versions) is insanely simpler than the usual methods.
Now, whether we trust that binary is a wholly separate matter. Maybe we do, maybe we don't, maybe it is signed by the original source, maybe we got it from a trusted source, maybe we built it ourselves from source after an extensive security audit (hopefully some variant of Ken Thompson's [part of the go team, though I present this as an interesting curiosity and nothing more] compiler hack isn't in play). But the security concerns surrounding the trust in the origin of the software and the ease of installation concerns are separate concerns. You can have one or both or neither.
Installing this blog software directly from a pre-built unsigned binary you ftp'd off some random site without ever looking at the source would be neither, but that doesn't negate the deployment benefits of "one single binary" which can be provided with both (at least to the degree that you can trust any 3rd party software).
I do love the idea of just copying a single binary (thanks go) to any server and running Journey. Is Journey's editing/writing interface up to snuff with ghost? Support for tags, SEO metadata, full markdown support, image upload?
Two major points drove me while developing Journey: I wanted to learn (more) about Go (the bigger point here). And I wanted something that I could just drag and drop on any server to quickly create a temporary blog or micro site without setting up dependencies like nginx or node.
At any rate, once everything is setup Node only takes about +3x the memory to run so it's not near as bad as Ruby/PHP.
Like C++, you could run go on a router it's so small and fast.
Yes for everything except for SEO metadata. That's planned tough.
And I have a initial implementation of the thing I envisioned at http://fiatjaf.alhur.es/classless/showcase/
I'm really curious about your Lua integration. I had also not previously heard of gopher-lua. How has your experience with this been?
If you use it in a web server that executes Lua with requests, take a look at the LState pool pattern[1].
[1] https://github.com/yuin/gopher-lua#the-lstate-pool-pattern
Worth pursuing?
Yes, can you make money on it? maybe depending on demand. There's always a market for well designed tools, especially if you could make it, 'the key tool' to create and prototype themes.
I'm not looking to make money off it. It is tempting to expand the functionality into a full CMS, but that should be a task for a fork.
> high priority goals are support of MySQL, PostgreSQL, and Google App Engine.
I'm working on being able to just drag and drop a Ghost db in there and loading that one. Only the timestamps need to be converted for that to work.
jb:~/web/journey_blog$ sh journey
journey: line 1: ELF4LS�4: not found
journey: line 10: syntax error: unexpected word
and using bash:
jb:~/web/journey_blog$ bash journey
journey: journey: cannot execute binary file
jb:~/web/journey_blog$ ls -ahls journey
11716 -rwxr-xr-x 1 jbrown jbrown 11.4M Apr 28 21:25 journey
You can also try compiling from source (see the Journey Wiki on GitHub for instructions).
You looking for contributes?
Gzip support, hashes for serving static assets (and/or expires headers), multi-user support, support for all of the Ghost theme helpers, MySQL, Postgres, and Google App Engine support.
"X that no one uses, now written in Go"
Also ghost lists a number of users including NASA, mailgun, and coinbase. https://ghost.org
Before that "I wrote a thing in Haskell", before that "I wrote a thing in Common Lisp".
It doesn't really matter how novel, interesting, or well-constructed the project is, if it's implemented in whatever language is popular at the time, it has a good chance of making it to the front page.
It's better for the emotional aspect of technical work to be out in the open, instead of rationalizing itself surreptitiously, as it usually has to—leading to such unproductive phenomena as (a) the sober engineering analysis that just happens to conclude that the best choice for X is programmer's favorite; and (b) the intellectual depression that comes from prolonged working with tools that give one no pleasure. "There is no play in them," as Thoreau said.
The need for play is deep and should be accommodated, since it affects things whether we want it to or not. I think if one revises one's model of software economics to include this factor then the yet-another projects you're criticizing come out looking pretty different. Also the HN connection is clear—this is a site where gratifying curiosity and creative impulses is celebrated. No justification required.
But I'm glad you've registered anyhow. Hopefully you'll discuss some of the things that gratify you!