Permanote: a note-taking app for Sandstorm - beta release for comments

50 views
Skip to first unread message

Tom Atkins

unread,
Feb 21, 2016, 5:39:27 PM2/21/16
to Sandstorm Development
I've managed to get a little note-taking app working on Sandstorm. I'm hoping to get it in the app market. Any suggestions gratefully received.

Here's a screencast which shows what it does: https://www.youtube.com/watch?v=PEitcxKYcbs&feature=youtu.be


The source is here and the README summarises the main features: https://github.com/keybits/permanote

I'm a novice programmer and this was hacked together over a couple of days - so there's some horrible code in there. I'll clean it up when I get a chance (or pull requests gratefully received). I'll even add some tests soon! But a great thing about Sandstorm apps is that I don't have to worry too much about dodgy code as long as it works :-)

I think I've completed all the requirements for app market submission.

It's a Python Flask application and since it's designed to be single user, I've set it to run with just the Flask development server. I had to do a few interesting things to get it working on Oasis and I'll blog about these soon, to help anyone who tries this in the future.

One thing that wasn't super clear in the docs was how to sign the spk with my Keybase key. So I wrote a blog post about how to do that: http://www.keybits.net/2016/02/import-keybase-private-key/ (Let me know if I've got things wrong there too!)

Thanks to Asheesh for his help with various questions I emailed to him.

Tom in Ireland.

Jake Weisz

unread,
Feb 21, 2016, 5:49:35 PM2/21/16
to Tom Atkins, Sandstorm Development
Wow, watching the video, the simple copy/paste of images into it looks really awesome.

I wrote a bunch of the app packaging stuff in Sandstorm's docs regarding app signing and stuff. If I did a bad job, definitely tell me and/or Asheesh how one of us can make those docs more clear.

-Jacob Weisz

--
You received this message because you are subscribed to the Google Groups "Sandstorm Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sandstorm-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jake Weisz

unread,
Feb 21, 2016, 6:04:12 PM2/21/16
to Tom Atkins, Sandstorm Development
Side note: My favorite thing about copy/pasting to this is I can use Windows Snipping Tool, and paste directly to this, without ever saving a local copy on my drive I need to remember to delete.

-Jacob Weisz

Kenton Varda

unread,
Feb 21, 2016, 7:27:06 PM2/21/16
to Tom Atkins, Sandstorm Development
Hi Tom,

This looks pretty great! It does the job, look good, and is properly granular for a Sandstorm app (want multiple notebooks? create multiple grains). I also love that the spk is tiny and starts up fast.

In testing this, I did find one pretty big bug: After POSTing a note, the server response with a 303 redirect that always uses HTTPS. Some Sandstorm servers are HTTP-only (especially local test servers), and on those the result is an error.

To fix this I recommend setting the Location header to be host-relative, i.e. omit the protocol and host and start with a /. Relative URLs in Location headers have been supported by all browsers for a long time and were recently standardized. Alternatively, you can determine which protocol to use by examining the X-Forwarded-Proto header or the X-Sandstorm-Base-Path header on the POST request.

I also have two very small nitpicks which you can feel free to ignore:
- Your action title is the default "New instance", which leads grains to be titled "Untitled Permanote instance" by default. I'd recommend "New notebook" instead.
- On the "create note" form, pressing tab while in the "title" field jumps to the "help" link rather than into the "content" field. I found this a bit annoying as I was trying to edit notes -- I would press tab and start typing, and it wouldn't work.

Longer-term, I'd love to see this app extended to support Sandstorm permissions so that I can give someone read-only access to my notebook.

But anyway, I think only the location header issue is a showstopper. Once that's fixed please re-submit to the app market; I'm eager to have this on there!

Also, I'm very interested to know what you had to do differently on Oasis. In theory it should be identical to regular Sandstorm.

-Kenton

--

Tom Atkins

unread,
Feb 22, 2016, 3:16:16 AM2/22/16
to Sandstorm Development, t...@keybits.net
Thanks for the replies.

Glad you like the copy and paste image uploading Jacob. I'm planning to implement dynamic resizing of image display so that larger images will fit nicely on the page.

Thanks for taking a detailed look Kenton. The bug you found is related to what I had to do to make it work on Oasis with HTTPS. The location header for the app is already host-relative and most of it worked fine. But redirects after a POST didn't. To make it work on Oasis I forced Flask to use HTTPS for redirects after a POST. This is done when it detects the Sandstorm environment variable:


But clearly this is a nasty hack and doesn't work on locally hosted Sandstorm instances without HTTPS. I'll redo this so that it examines the X-Sandstorm-Base-Path header to prevent the https part being hard coded.

Already fixed the other two suggestions. And, yes, sharing of notes is definitely on my todo list :-)

Tom Atkins

unread,
Feb 22, 2016, 4:44:59 AM2/22/16
to Sandstorm Development, t...@keybits.net
The location header bug is now fixed. 'X-Forwarded-Proto' is now inspected within Sandstorm environments to make POST redirects work correctly with HTTP or HTTPS.

I incremented the Sandstorm version number and tested upgrading it. I love how this makes it simple to upgrade existing grains. (Hoping I don't need to change database schema or have to consider migrations!)

Resubmitted the spk to the app market and replaced the test spk here: https://oasis.sandstorm.io/shared/mhCdl7_rBr706QrGzzW5APXr5_uT7PY93oImbImIuzr

I'm definitely planning to maintain and improve the app. I'll add issues and a roadmap to the repo over the next few days.

Thanks again for your help.

Kenton Varda

unread,
Feb 22, 2016, 1:13:49 PM2/22/16
to Tom Atkins, Sandstorm Development
Nice! I've approved the fixed version. This is now on the app market. Thanks!

It looks like we're due for a bunch of new apps this week. Later in the week I'll re-order the "featured apps" list to highlight some of them (currently new apps land in the middle by default).

-Kenton

--

Tom Atkins

unread,
Feb 22, 2016, 2:13:43 PM2/22/16
to Sandstorm Development, t...@keybits.net
Yay! Achievement unlocked :-)
Reply all
Reply to author
Forward
0 new messages