22 ms·
A minimal blog engine written in Go, compatible with Ghost themes
- deleted 11y ago[deleted]
- Kabukks 11y agoAuthor of Journey here (thanks Maksadbek for posting it on HN). I'm going to repost my comment from Reddit: 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 :)
- syntern 11y agoLooks like it is a neat project, thanks for open sourcing it. Do you plan to support static export?
- Kabukks 11y agoIt's not yet planned, but definitely something that would be useful. I'll add it to the list. 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.
- ChuckMcM 11y agoOne of the reasons I started playing with Ghost is because generating the site statically allows for a lot of performance on a $5 VPS with nothing special but a fat internet pipe. As blogs are typically not heavy on the "interaction" aspects of things, this works really well. 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."
- bootload 11y ago"One of the reasons I started playing with Ghost is because generating the site statically allows for a lot of performance on a $5 VPS with nothing special but a fat internet pipe. As blogs are typically not heavy on the "interaction" aspects of things, this works really well." 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?
- ChuckMcM 11y agoHeh, same. Used FrontPage for a while to basically "push" static pages to my site, then played with Blosxom for a bit but never published anything with it, wrote my own in Perl with Template toolkit and Markdown, and as that was going along, heard about and downloaded Ghost. Then built a 'theme' that matched my original skeumorphic notebook theme and basically have what I need to push the button on it (but haven't for some reason).
- bootload 11y agoprevious * 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
- Yhippa 11y agoI wish Octopress was this easy to use.
- tankenmate 11y agoI had a look at the docs on github (I haven't checked the source yet) but it doesn't mention if it supports more than one domain (or SNI, but I'm assuming it would piggy back on Go's support for SNI). If it doesn't yet support multi domain will it ever?
- Kabukks 11y agoInteresting. I haven't thought about that. It should be possible, but is not implemented yet. Go does indeed support SNI, but I'm using ListenAndServeTLS at the moment + I'm loading only one SSL certificate right now. I'll add that to the list as well. I think that might be a useful feature.
- mixu 11y agoIf you need static export, I wrote a project a while back that converts markdown to static output with Ghost theme support: https://github.com/mixu/ghost-render https://github.com/mixu/ghost-render
- Maksadbek 11y agoAuthor of the post here. I found your blog engine awesome. It inspired me to create my blog. Thanks for such a good project :)
- zura 11y agoRegarding Golang's if-hell e.g. in https://github.com/kabukky/journey/blob/master/database/update.go https://github.com/kabukky/journey/blob/master/database/upda... Couldn't you use panic/recover locally, inside functions - just for having a single error handling code?
- pdq 11y agoNo, panic/recover is a major hack. Rob Pike has written ideas here on how to clean up error handling if-blocks: http://blog.golang.org/errors-are-values http://blog.golang.org/errors-are-values
- burntsushi 11y agoNo, it's not a "major hack." That blog post is excellent, but it just doesn't always apply. The panic/recover idiom is extremely useful in parsers. For example, Go's JSON decoder: http://golang.org/src/encoding/json/decode.go http://golang.org/src/encoding/json/decode.go
- pdq 11y agoThe difference is that in parsers, errors are almost certainly fatal. As opposed to a runtime SQL error, where it could be a user error, value error, or other database error, which can be recovered from. 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.
- thirsteh 11y agoPanic/recover is no problem as long as it does not traverse API boundaries, i.e. affects the user of your package, unless it really is a "fatal user error" in a function that wouldn't otherwise return an error.
- burntsushi 11y agoI'm pretty sure you've misunderstood. Did you read the code I linked you to? Look at how it handles errors internally. Go's standard JSON decoder isn't going to crash your program if it fails to parse JSON---that would be disastrous. It exposes regular errors to the user. But internally, it uses panic/recover because it elides a lot of manual error checking.
- monk_e_boy 11y agoHow did using Go feel compared with other languages, I'm a php, ruby, python guy. Just wondering your opinion on why you chose Go?
- Kabukks 11y agoI chose Go because I wanted to learn it ;) In retrospect tough, I couldn't have wished for a better language to write a web server in. I especially like the opinionated handling of code formatting and memory safety (it won't let you compile if you have a unused variable for example) and the consistent error handling (I know, a lot people seem to dislike Go's error-oriented programming style).
- wting 11y agoUnused variables have nothing to do with memory safety. At most they'll take up some stack or heap space. https://en.wikipedia.org/wiki/Memory_safety 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: http://research.swtch.com/gorace http://research.swtch.com/gorace
- Kabukks 11y agoYou are right. I was thinking about the general fail-safety of my programs. Not letting me compile saved me from overlooking a (return) value more than once.
- threeseed 11y agoYou could accomplish the same thing by incorporating a code checker as part of your build process. That way you would be catching a lot more code issues then just unused imports, variables etc.
- Immortalin 11y agoIt would really great if you could convert it into a modular CMS with ecommerce features similar to Drupal Commerce.
- nodesocket 11y agoWe run our blog on Ghost (http://blog.commando.io http://blog.commando.io), and honestly not sure there is much wrong with the node.js implementation. It can handle insane traffic, gzip, expires headers already supported. You are correct, it does not support https, but you could either run nginx in front, or modify the source code a bit. 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?
- Kabukks 11y agoThere is definitely nothing wrong with Ghost and node.js. I've used it for some time now and I still love it :) 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.
- nodesocket 11y agoAbsolutely. I applaud the effort and enthusiasm to learn go. Go is awesome. My concerns are just feature parity for users wanting a blogging platform to run in production. You'll need rss feed, sitemaps, tags, SEO metadata, etc.
- Xeoncross 11y agobower (or was it NPM?) required over 256MB of RAM to compile dependencies on ubuntu. So I was not able to run it on a small VPS I had. 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.
- Kabukks 11y ago> Is Journey's editing/writing interface up to snuff with ghost? Support for tags, SEO metadata, full markdown support, image upload? Yes for everything except for SEO metadata. That's planned tough.
- melted 11y agoA template for getting on the front page: "X that no one uses, now written in Go"
- BenTheElder 11y agoThis looks like a nice side project. Complaining that HN seems to upvote go projects isn't really fair. Also ghost lists a number of users including NASA, mailgun, and coinbase. https://ghost.org https://ghost.org
- vitaut 11y agoI'd say more: "X that noone uses, now written in language Y that noone uses".
- hvs 11y agoThe name of this is site is "Hacker News". That would necessarily imply a site that encourages people to post things that are maybe off the beaten path.
- jacques_chester 11y ago"I wrote something in Go" is not off the beaten path for this site. Before that "I wrote a thing in Haskell", before that "I wrote a thing in Common Lisp".
- true_religion 11y ago
- _mpu 11y agoAre people serious when they say they "love the idea" of copying a binary to their server to run a blog service? It sounds very much like installing a shareware in the 90s. 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.
- giaour 11y agoYou could always `go get github.com/kabukky/journey` if you'd prefer to build from source.
- Kabukks 11y agoI agree that one shouldn't copy just any binary on their server and run it. I'd like to help with this. Are you just thinking about providing SHA sums next to the binaries/zip releases on the download page? What kind of cryptographic signatures do you have in mind? 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.
- arianvanp 11y agoYou could PGP sign the binaries.
- _mpu 11y agoIn your case, PGP would be the best and not so hard to implement. 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.
- narwally 11y ago
- Vecrios 11y agoDang, this was next on my side projects ideas. Looks good though. You looking for contributes?
- Kabukks 11y agoPull requests are very much welcome. :) Here's my high priority feature list right now: 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.
- guybrushT 11y agothis is very well made. i was hoping to make something like it - but way (way!) more minimal. here is the first draft - http://adombic.appspot.com http://adombic.appspot.com
- unicornporn 11y agoDoes it need a database? I see no such information. But, the Github project says > high priority goals are support of MySQL, PostgreSQL, and Google App Engine.
- Kabukks 11y agoIt uses SQLite internally. One Database file at journey/content/data/journey.db 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.
- unicornporn 11y agoCool. Even cooler: it would create static HTML files. I've been searching for a software like this for long. Jekyll only works on computers I've installed it on. I want an admin interface, but no db and static output. Only thing I've found is http://prose.io http://prose.io
- bootload 11y agoExcellent read, going through the source code this afternoon. How did you work the theme compatibility with Ghost: api? 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.
- Kabukks 11y agoI pretty much just reverse-engineered the Ghost helpers using the theme documentation. Take a look at https://github.com/kabukky/journey/blob/master/templates/helperfunctions.go https://github.com/kabukky/journey/blob/master/templates/hel... for all helpers that are implemented yet. 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.
- davis_m 11y agoWhy would you not name it Goul?
- zongitsrinzler 11y agoThis
- Kabukks 11y agoOh my god. I'm deeply ashamed now. /thread
- karmakaze 11y agoSource looks well factored to plug in alternate markups. Markdown is great, but sometimes too limiting.
- srameshc 11y agoSomething I through I would do to learn Go. Thanks it will be a little easy learning :)
- Rapzid 11y agoHi, this is really cool.. I'll admit to having never heard of or used Ghost, but I applaud the effort of building this to learn a new language. There is also a hidden value many people underestimate in having a project that is quite similar to others but in a different language. I'm really curious about your Lua integration. I had also not previously heard of gopher-lua. How has your experience with this been?
- Kabukks 11y agoUsing GopherLua is a pleasant experience. Easily integrated and surprisingly fast. But the documentation is lacking. 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 https://github.com/yuin/gopher-lua#the-lstate-pool-pattern
- Immortalin 11y agoI am really hoping for a good CMS in Go, I am currently using Drupal but the overhead sometimes is really huge.
- fiatjaf 11y agoAbout theme compatibility between CMSes of all kinds, I wrote a post at http://fiatjaf.alhur.es/programming/reusable-pure-css-themes/ http://fiatjaf.alhur.es/programming/reusable-pure-css-themes... And I have a initial implementation of the thing I envisioned at http://fiatjaf.alhur.es/classless/showcase/ http://fiatjaf.alhur.es/classless/showcase/
- relaxitup 11y agoLooks cool. Tried on Alpine Linux and no worky: 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
- Kabukks 11y agoThanks for trying it! I would guess this is because I build the linux releases with gnu libc. See here: http://www.blang.io/2015/04/19/golang-alpine-build-golang-binaries-for-alpine-linux.html http://www.blang.io/2015/04/19/golang-alpine-build-golang-bi... You can also try compiling from source (see the Journey Wiki on GitHub for instructions).