diff --git a/.gitignore b/.gitignore
index 4596713be..a07408d16 100644
--- a/.gitignore
+++ b/.gitignore
@@ -73,4 +73,8 @@ hledger-web/static/tmp/
hledger-web/yesod-devel/
.hledger-web_client_session_key.aes
+# sandstorm stuff
+.vagrant
+*.spk
+
# recent stuff
diff --git a/.sandstorm/Vagrantfile b/.sandstorm/Vagrantfile
new file mode 100644
index 000000000..3fd1303e3
--- /dev/null
+++ b/.sandstorm/Vagrantfile
@@ -0,0 +1,95 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Guess at a reasonable name for the VM based on the folder vagrant-spk is
+# run from. The timestamp is there to avoid conflicts if you have multiple
+# folders with the same name.
+VM_NAME = File.basename(File.dirname(File.dirname(__FILE__))) + "_sandstorm_#{Time.now.utc.to_i}"
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+ config.vm.box = "sandstorm/debian-jessie64"
+
+ if Vagrant.has_plugin?("vagrant-vbguest") then
+ # vagrant-vbguest is a Vagrant plugin that upgrades
+ # the version of VirtualBox Guest Additions within each
+ # guest. If you have the vagrant-vbguest plugin, then it
+ # needs to know how to compile kernel modules, etc., and so
+ # we give it this hint about operating system type.
+ config.vm.guest = "debian"
+ end
+
+ # We forward port 6080, the Sandstorm web port, so that developers can
+ # visit their sandstorm app from their browser as local.sandstorm.io:6080
+ # (aka 127.0.0.1:6080).
+ config.vm.network :forwarded_port, guest: 6080, host: 6080
+
+ # Use a shell script to "provision" the box. This installs Sandstorm using
+ # the bundled installer.
+ config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/global-setup.sh", keep_color: true
+ # Then, do stack-specific and app-specific setup.
+ config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/setup.sh", keep_color: true
+
+ # Shared folders are configured per-provider since vboxsf can't handle >4096 open files,
+ # NFS requires privilege escalation every time you bring a VM up,
+ # and 9p is only available on libvirt.
+
+ # Calculate the number of CPUs and the amount of RAM the system has,
+ # in a platform-dependent way; further logic below.
+ cpus = nil
+ total_kB_ram = nil
+
+ host = RbConfig::CONFIG['host_os']
+ if host =~ /darwin/
+ cpus = `sysctl -n hw.ncpu`.to_i
+ total_kB_ram = `sysctl -n hw.memsize`.to_i / 1024
+ elsif host =~ /linux/
+ cpus = `nproc`.to_i
+ total_kB_ram = `grep MemTotal /proc/meminfo | awk '{print $2}'`.to_i
+ elsif host =~ /mingw/
+ # powershell may not be available on Windows XP and Vista, so wrap this in a rescue block
+ begin
+ cpus = `powershell -Command "(Get-WmiObject Win32_Processor -Property NumberOfLogicalProcessors | Select-Object -Property NumberOfLogicalProcessors | Measure-Object NumberOfLogicalProcessors -Sum).Sum"`.to_i
+ total_kB_ram = `powershell -Command "Get-CimInstance -class cim_physicalmemory | % $_.Capacity}"`.to_i / 1024
+ rescue
+ end
+ end
+ # Use the same number of CPUs within Vagrant as the system, with 1
+ # as a default.
+ #
+ # Use at least 512MB of RAM, and if the system has more than 2GB of
+ # RAM, use 1/4 of the system RAM. This seems a reasonable compromise
+ # between having the Vagrant guest operating system not run out of
+ # RAM entirely (which it basically would if we went much lower than
+ # 512MB) and also allowing it to use up a healthily large amount of
+ # RAM so it can run faster on systems that can afford it.
+ if cpus.nil? or cpus.zero?
+ cpus = 1
+ end
+ if total_kB_ram.nil? or total_kB_ram < 2048000
+ assign_ram_mb = 512
+ else
+ assign_ram_mb = (total_kB_ram / 1024 / 2)
+ end
+ # Actually apply these CPU/memory values to the providers.
+ config.vm.provider :virtualbox do |vb, override|
+ vb.cpus = cpus
+ vb.memory = assign_ram_mb
+ vb.name = VM_NAME
+
+ override.vm.synced_folder "..", "/opt/app"
+ override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm"
+ override.vm.synced_folder "..", "/vagrant"
+ end
+ config.vm.provider :libvirt do |libvirt, override|
+ libvirt.cpus = cpus
+ libvirt.memory = assign_ram_mb
+ libvirt.default_prefix = VM_NAME
+
+ override.vm.synced_folder "..", "/opt/app", type: "9p", accessmode: "passthrough"
+ override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm", type: "9p", accessmode: "passthrough"
+ override.vm.synced_folder "..", "/vagrant", type: "9p", accessmode: "passthrough"
+ end
+end
diff --git a/.sandstorm/appGrid.svg b/.sandstorm/appGrid.svg
new file mode 100644
index 000000000..ae8ff6447
--- /dev/null
+++ b/.sandstorm/appGrid.svg
@@ -0,0 +1,51 @@
+
+
+
diff --git a/.sandstorm/build.sh b/.sandstorm/build.sh
new file mode 100644
index 000000000..56ebf7189
--- /dev/null
+++ b/.sandstorm/build.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -euo pipefail
+# This script is run in the VM each time you run `vagrant-spk dev`. This is
+# the ideal place to invoke anything which is normally part of your app's build
+# process - transforming the code in your repository into the collection of files
+# which can actually run the service in production
+#
+# Some examples:
+#
+# * For a C/C++ application, calling
+# ./configure && make && make install
+# * For a Python application, creating a virtualenv and installing
+# app-specific package dependencies:
+# virtualenv /opt/app/env
+# /opt/app/env/bin/pip install -r /opt/app/requirements.txt
+# * Building static assets from .less or .sass, or bundle and minify JS
+# * Collecting various build artifacts or assets into a deployment-ready
+# directory structure
+
+# By default, this script does nothing. You'll have to modify it as
+# appropriate for your application.
+cd /opt/app/hledger
+stack setup
+stack install hledger-web
+sudo cp /home/vagrant/.local/bin/hledger-web /usr/local/bin
diff --git a/.sandstorm/changelog.md b/.sandstorm/changelog.md
new file mode 100644
index 000000000..eb6a9b56d
--- /dev/null
+++ b/.sandstorm/changelog.md
@@ -0,0 +1,11 @@
+# V1.1-sandstorm2 (2017-03-21)
+
+ * Upgrade to HLedger 1.1
+
+# V1.0.1-sandstorm1 (2016-11-15)
+
+ * Upgrade to HLedger 1.0.1
+
+# V0
+
+ * Initial release
diff --git a/.sandstorm/description.md b/.sandstorm/description.md
new file mode 100644
index 000000000..13cddf41a
--- /dev/null
+++ b/.sandstorm/description.md
@@ -0,0 +1 @@
+hledger is a lightweight accounting program for tracking money, time, or other commodities, on unix, mac and windows. With simple yet powerful functionality accessed from command line, terminal or web browser, it is a reliable, cross-platform alternative to Quicken, GnuCash, spreadsheets etc.
\ No newline at end of file
diff --git a/.sandstorm/global-setup.sh b/.sandstorm/global-setup.sh
new file mode 100644
index 000000000..303c9d22c
--- /dev/null
+++ b/.sandstorm/global-setup.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+set -euo pipefail
+echo localhost > /etc/hostname
+hostname localhost
+curl https://install.sandstorm.io/ > /host-dot-sandstorm/caches/install.sh
+SANDSTORM_CURRENT_VERSION=$(curl -fs "https://install.sandstorm.io/dev?from=0&type=install")
+SANDSTORM_PACKAGE="sandstorm-$SANDSTORM_CURRENT_VERSION.tar.xz"
+if [[ ! -f /host-dot-sandstorm/caches/$SANDSTORM_PACKAGE ]] ; then
+ curl --output "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" "https://dl.sandstorm.io/$SANDSTORM_PACKAGE"
+fi
+bash /host-dot-sandstorm/caches/install.sh -d -e "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE"
+modprobe ip_tables
+# Make the vagrant user part of the sandstorm group so that commands like
+# `spk dev` work.
+usermod -a -G 'sandstorm' 'vagrant'
+# Bind to all addresses, so the vagrant port-forward works.
+sudo sed --in-place='' \
+ --expression='s/^BIND_IP=.*/BIND_IP=0.0.0.0/' \
+ /opt/sandstorm/sandstorm.conf
+# TODO: update sandstorm installer script to ask about dev accounts, and
+# specify a value for this option in the default config?
+if ! grep --quiet --no-messages ALLOW_DEV_ACCOUNTS=true /opt/sandstorm/sandstorm.conf ; then
+ echo "ALLOW_DEV_ACCOUNTS=true" | sudo tee -a /opt/sandstorm/sandstorm.conf
+ sudo service sandstorm restart
+fi
+# Enable apt-cacher-ng proxy to make things faster if one appears to be running on the gateway IP
+GATEWAY_IP=$(ip route | grep ^default | cut -d ' ' -f 3)
+if nc -z "$GATEWAY_IP" 3142 ; then
+ echo "Acquire::http::Proxy \"http://$GATEWAY_IP:3142\";" > /etc/apt/apt.conf.d/80httpproxy
+fi
diff --git a/.sandstorm/grain.svg b/.sandstorm/grain.svg
new file mode 100644
index 000000000..037854be7
--- /dev/null
+++ b/.sandstorm/grain.svg
@@ -0,0 +1,48 @@
+
+
+
diff --git a/.sandstorm/launcher.sh b/.sandstorm/launcher.sh
new file mode 100644
index 000000000..70b83848b
--- /dev/null
+++ b/.sandstorm/launcher.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+set -euo pipefail
+# This script is run every time an instance of our app - aka grain - starts up.
+# This is the entry point for your application both when a grain is first launched
+# and when a grain resumes after being previously shut down.
+#
+# This script is responsible for launching everything your app needs to run. The
+# thing it should do *last* is:
+#
+# * Start a process in the foreground listening on port 8000 for HTTP requests.
+#
+# This is how you indicate to the platform that your application is up and
+# ready to receive requests. Often, this will be something like nginx serving
+# static files and reverse proxying for some other dynamic backend service.
+#
+# Other things you probably want to do in this script include:
+#
+# * Building folder structures in /var. /var is the only non-tmpfs folder
+# mounted read-write in the sandbox, and when a grain is first launched, it
+# will start out empty. It will persist between runs of the same grain, but
+# be unique per app instance. That is, two instances of the same app have
+# separate instances of /var.
+# * Preparing a database and running migrations. As your package changes
+# over time and you release updates, you will need to deal with migrating
+# data from previous schema versions to new ones, since users should not have
+# to think about such things.
+# * Launching other daemons your app needs (e.g. mysqld, redis-server, etc.)
+
+mkdir -p /var/lib/hledger
+touch /var/lib/hledger/Ledger
+cd /var
+hledger-web --serve --base-url='' -f /var/lib/hledger/Ledger --port 8000
diff --git a/.sandstorm/market.svg b/.sandstorm/market.svg
new file mode 100644
index 000000000..658c8b315
--- /dev/null
+++ b/.sandstorm/market.svg
@@ -0,0 +1,47 @@
+
+
+
diff --git a/.sandstorm/pgp-keyring b/.sandstorm/pgp-keyring
new file mode 100644
index 000000000..ee890dff6
Binary files /dev/null and b/.sandstorm/pgp-keyring differ
diff --git a/.sandstorm/pgp-signature b/.sandstorm/pgp-signature
new file mode 100644
index 000000000..dbdbcdf72
Binary files /dev/null and b/.sandstorm/pgp-signature differ
diff --git a/.sandstorm/sandstorm-files.list b/.sandstorm/sandstorm-files.list
new file mode 100644
index 000000000..999859f3d
--- /dev/null
+++ b/.sandstorm/sandstorm-files.list
@@ -0,0 +1,56 @@
+# *** WARNING: GENERATED FILE ***
+# This file is automatically updated and rewritten in sorted order every time
+# the app runs in dev mode. You may manually add or remove files, but don't
+# expect comments or ordering to be retained.
+bin/bash
+bin/mkdir
+bin/touch
+etc/gai.conf
+etc/ld.so.cache
+etc/localtime
+lib/terminfo/d/dumb
+lib/x86_64-linux-gnu/ld-2.19.so
+lib/x86_64-linux-gnu/libc-2.19.so
+lib/x86_64-linux-gnu/libc.so.6
+lib/x86_64-linux-gnu/libdl-2.19.so
+lib/x86_64-linux-gnu/libdl.so.2
+lib/x86_64-linux-gnu/libgcc_s.so.1
+lib/x86_64-linux-gnu/libm-2.19.so
+lib/x86_64-linux-gnu/libm.so.6
+lib/x86_64-linux-gnu/libncurses.so.5
+lib/x86_64-linux-gnu/libncurses.so.5.9
+lib/x86_64-linux-gnu/libnsl-2.19.so
+lib/x86_64-linux-gnu/libnsl.so.1
+lib/x86_64-linux-gnu/libnss_compat-2.19.so
+lib/x86_64-linux-gnu/libnss_compat.so.2
+lib/x86_64-linux-gnu/libnss_files-2.19.so
+lib/x86_64-linux-gnu/libnss_files.so.2
+lib/x86_64-linux-gnu/libnss_nis-2.19.so
+lib/x86_64-linux-gnu/libnss_nis.so.2
+lib/x86_64-linux-gnu/libpcre.so.3
+lib/x86_64-linux-gnu/libpcre.so.3.13.1
+lib/x86_64-linux-gnu/libpthread-2.19.so
+lib/x86_64-linux-gnu/libpthread.so.0
+lib/x86_64-linux-gnu/librt-2.19.so
+lib/x86_64-linux-gnu/librt.so.1
+lib/x86_64-linux-gnu/libselinux.so.1
+lib/x86_64-linux-gnu/libtinfo.so.5
+lib/x86_64-linux-gnu/libtinfo.so.5.9
+lib/x86_64-linux-gnu/libutil-2.19.so
+lib/x86_64-linux-gnu/libutil.so.1
+lib/x86_64-linux-gnu/libz.so.1
+lib/x86_64-linux-gnu/libz.so.1.2.8
+lib64/ld-linux-x86-64.so.2
+opt/app/.sandstorm/launcher.sh
+proc/cpuinfo
+sandstorm-http-bridge
+sandstorm-http-bridge-config
+sandstorm-manifest
+usr/bin/touch
+usr/lib/x86_64-linux-gnu/gconv/UTF-32.so
+usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
+usr/lib/x86_64-linux-gnu/libffi.so.6
+usr/lib/x86_64-linux-gnu/libffi.so.6.0.2
+usr/lib/x86_64-linux-gnu/libgmp.so.10
+usr/lib/x86_64-linux-gnu/libgmp.so.10.2.0
+usr/local/bin/hledger-web
diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp
new file mode 100644
index 000000000..5a15bd851
--- /dev/null
+++ b/.sandstorm/sandstorm-pkgdef.capnp
@@ -0,0 +1,247 @@
+@0xbc169f81a53d625c;
+
+using Spk = import "/sandstorm/package.capnp";
+# This imports:
+# $SANDSTORM_HOME/latest/usr/include/sandstorm/package.capnp
+# Check out that file to see the full, documented package definition format.
+
+const pkgdef :Spk.PackageDefinition = (
+ # The package definition. Note that the spk tool looks specifically for the
+ # "pkgdef" constant.
+
+ id = "8x12h6p0x0nrzk73hfq6zh2jxtgyzzcty7qsatkg7jfg2mzw5n90",
+ # Your app ID is actually its public key. The private key was placed in
+ # your keyring. All updates must be signed with the same key.
+
+ manifest = (
+ # This manifest is included in your app package to tell Sandstorm
+ # about your app.
+
+ appTitle = (defaultText = "HLedger Web"),
+
+ appVersion = 2, # Increment this for every release.
+
+ appMarketingVersion = (defaultText = "1.1-sandstorm2"),
+ # Human-readable representation of appVersion. Should match the way you
+ # identify versions of your app in documentation and marketing.
+
+ actions = [
+ # Define your "new document" handlers here.
+ ( title = (defaultText = "New Ledger"),
+ command = .myCommand
+ # The command to run when starting for the first time. (".myCommand"
+ # is just a constant defined at the bottom of the file.)
+ )
+ ],
+
+ continueCommand = .myCommand,
+ # This is the command called to start your app back up after it has been
+ # shut down for inactivity. Here we're using the same command as for
+ # starting a new instance, but you could use different commands for each
+ # case.
+
+ metadata = (
+ # Data which is not needed specifically to execute the app, but is useful
+ # for purposes like marketing and display. These fields are documented at
+ # https://docs.sandstorm.io/en/latest/developing/publishing-apps/#add-required-metadata
+ # and (in deeper detail) in the sandstorm source code, in the Metadata section of
+ # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/package.capnp
+ icons = (
+ # Various icons to represent the app in various contexts.
+ appGrid = (svg = embed "appGrid.svg"),
+ grain = (svg = embed "grain.svg"),
+ market = (svg = embed "market.svg"),
+ #marketBig = (svg = embed "path/to/market-big-300x300.svg"),
+ ),
+
+ website = "http://hledger.org",
+ # This should be the app's main website url.
+
+ codeUrl = "https://github.com/ndarilek/hledger-sandstorm",
+ # URL of the app's source code repository, e.g. a GitHub URL.
+ # Required if you specify a license requiring redistributing code, but optional otherwise.
+
+ license = (openSource = gpl2),
+ # The license this package is distributed under. See
+ # https://docs.sandstorm.io/en/latest/developing/publishing-apps/#license
+
+ categories = [office, productivity],
+ # A list of categories/genres to which this app belongs, sorted with best fit first.
+ # See the list of categories at
+ # https://docs.sandstorm.io/en/latest/developing/publishing-apps/#categories
+
+ author = (
+ # Fields relating to the author of this app.
+
+ contactEmail = "nolan@thewordnerd.info",
+ # Email address to contact for any issues with this app. This includes end-user support
+ # requests as well as app store administrator requests, so it is very important that this be a
+ # valid address with someone paying attention to it.
+
+ pgpSignature = embed "pgp-signature",
+ # PGP signature attesting responsibility for the app ID. This is a binary-format detached
+ # signature of the following ASCII message (not including the quotes, no newlines, and
+ # replacing with the standard base-32 text format of the app's ID):
+ #
+ # "I am the author of the Sandstorm.io app with the following ID: "
+ #
+ # You can create a signature file using `gpg` like so:
+ #
+ # echo -n "I am the author of the Sandstorm.io app with the following ID: " | gpg --sign > pgp-signature
+ #
+ # Further details including how to set up GPG and how to use keybase.io can be found
+ # at https://docs.sandstorm.io/en/latest/developing/publishing-apps/#verify-your-identity
+
+ upstreamAuthor = "HLedger Team",
+ # Name of the original primary author of this app, if it is different from the person who
+ # produced the Sandstorm package. Setting this implies that the author connected to the PGP
+ # signature only "packaged" the app for Sandstorm, rather than developing the app.
+ # Remove this line if you consider yourself as the author of the app.
+ ),
+
+ pgpKeyring = embed "pgp-keyring",
+ # A keyring in GPG keyring format containing all public keys needed to verify PGP signatures in
+ # this manifest (as of this writing, there is only one: `author.pgpSignature`).
+ #
+ # To generate a keyring containing just your public key, do:
+ #
+ # gpg --export > keyring
+ #
+ # Where `` is a PGP key ID or email address associated with the key.
+
+ description = (defaultText = embed "description.md"),
+ # The app's description description in Github-flavored Markdown format, to be displayed e.g.
+ # in an app store. Note that the Markdown is not permitted to contain HTML nor image tags (but
+ # you can include a list of screenshots separately).
+
+ shortDescription = (defaultText = "Web-based Accounting"),
+ # A very short (one-to-three words) description of what the app does. For example,
+ # "Document editor", or "Notetaking", or "Email client". This will be displayed under the app
+ # title in the grid view in the app market.
+
+ screenshots = [
+ # Screenshots to use for marketing purposes. Examples below.
+ # Sizes are given in device-independent pixels, so if you took these
+ # screenshots on a Retina-style high DPI screen, divide each dimension by two.
+
+ #(width = 746, height = 795, jpeg = embed "path/to/screenshot-1.jpeg"),
+ #(width = 640, height = 480, png = embed "path/to/screenshot-2.png"),
+ ],
+ changeLog = (defaultText = embed "changelog.md"),
+ # Documents the history of changes in Github-flavored markdown format (with the same restrictions
+ # as govern `description`). We recommend formatting this with an H1 heading for each version
+ # followed by a bullet list of changes.
+ ),
+ ),
+
+ sourceMap = (
+ # Here we defined where to look for files to copy into your package. The
+ # `spk dev` command actually figures out what files your app needs
+ # automatically by running it on a FUSE filesystem. So, the mappings
+ # here are only to tell it where to find files that the app wants.
+ searchPath = [
+ ( sourcePath = "." ), # Search this directory first.
+ ( sourcePath = "/", # Then search the system root directory.
+ hidePaths = [ "home", "proc", "sys",
+ "etc/passwd", "etc/hosts", "etc/host.conf",
+ "etc/nsswitch.conf", "etc/resolv.conf" ]
+ # You probably don't want the app pulling files from these places,
+ # so we hide them. Note that /dev, /var, and /tmp are implicitly
+ # hidden because Sandstorm itself provides them.
+ )
+ ]
+ ),
+
+ fileList = "sandstorm-files.list",
+ # `spk dev` will write a list of all the files your app uses to this file.
+ # You should review it later, before shipping your app.
+
+ alwaysInclude = [],
+ # Fill this list with more names of files or directories that should be
+ # included in your package, even if not listed in sandstorm-files.list.
+ # Use this to force-include stuff that you know you need but which may
+ # not have been detected as a dependency during `spk dev`. If you list
+ # a directory here, its entire contents will be included recursively.
+
+ #bridgeConfig = (
+ # # Used for integrating permissions and roles into the Sandstorm shell
+ # # and for sandstorm-http-bridge to pass to your app.
+ # # Uncomment this block and adjust the permissions and roles to make
+ # # sense for your app.
+ # # For more information, see high-level documentation at
+ # # https://docs.sandstorm.io/en/latest/developing/auth/
+ # # and advanced details in the "BridgeConfig" section of
+ # # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/package.capnp
+ # viewInfo = (
+ # # For details on the viewInfo field, consult "ViewInfo" in
+ # # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/grain.capnp
+ #
+ # permissions = [
+ # # Permissions which a user may or may not possess. A user's current
+ # # permissions are passed to the app as a comma-separated list of `name`
+ # # fields in the X-Sandstorm-Permissions header with each request.
+ # #
+ # # IMPORTANT: only ever append to this list! Reordering or removing fields
+ # # will change behavior and permissions for existing grains! To deprecate a
+ # # permission, or for more information, see "PermissionDef" in
+ # # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/grain.capnp
+ # (
+ # name = "editor",
+ # # Name of the permission, used as an identifier for the permission in cases where string
+ # # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.
+ #
+ # title = (defaultText = "editor"),
+ # # Display name of the permission, e.g. to display in a checklist of permissions
+ # # that may be assigned when sharing.
+ #
+ # description = (defaultText = "grants ability to modify data"),
+ # # Prose describing what this role means, suitable for a tool tip or similar help text.
+ # ),
+ # ],
+ # roles = [
+ # # Roles are logical collections of permissions. For instance, your app may have
+ # # a "viewer" role and an "editor" role
+ # (
+ # title = (defaultText = "editor"),
+ # # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.
+ #
+ # permissions = [true],
+ # # An array indicating which permissions this role carries.
+ # # It should be the same length as the permissions array in
+ # # viewInfo, and the order of the lists must match.
+ #
+ # verbPhrase = (defaultText = "can make changes to the document"),
+ # # Brief explanatory text to show in the sharing UI indicating
+ # # what a user assigned this role will be able to do with the grain.
+ #
+ # description = (defaultText = "editors may view all site data and change settings."),
+ # # Prose describing what this role means, suitable for a tool tip or similar help text.
+ # ),
+ # (
+ # title = (defaultText = "viewer"),
+ # permissions = [false],
+ # verbPhrase = (defaultText = "can view the document"),
+ # description = (defaultText = "viewers may view what other users have written."),
+ # ),
+ # ],
+ # ),
+ # #apiPath = "/api",
+ # # Apps can export an API to the world. The API is to be used primarily by Javascript
+ # # code and native apps, so it can't serve out regular HTML to browsers. If a request
+ # # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with
+ # # this string, if specified.
+ #),
+);
+
+const myCommand :Spk.Manifest.Command = (
+ # Here we define the command used to start up your server.
+ argv = ["/sandstorm-http-bridge", "8000", "--", "/opt/app/.sandstorm/launcher.sh"],
+ environ = [
+ # Note that this defines the *entire* environment seen by your app.
+ (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin"),
+ (key = "SANDSTORM", value = "1"),
+ # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm
+ # can detect if $SANDSTORM="1" at runtime, switching UI and/or backend to use
+ # the app's Sandstorm-specific integration code.
+ ]
+);
diff --git a/.sandstorm/setup.sh b/.sandstorm/setup.sh
new file mode 100644
index 000000000..e05853d7f
--- /dev/null
+++ b/.sandstorm/setup.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+set -euo pipefail
+# This script is run in the VM once when you first run `vagrant-spk up`. It is
+# useful for installing system-global dependencies. It is run exactly once
+# over the lifetime of the VM.
+#
+# This is the ideal place to do things like:
+#
+# export DEBIAN_FRONTEND=noninteractive
+# apt-get install -y nginx nodejs nodejs-legacy python2.7 mysql-server
+#
+# If the packages you're installing here need some configuration adjustments,
+# this is also a good place to do that:
+#
+# sed --in-place='' \
+# --expression 's/^user www-data/#user www-data/' \
+# --expression 's#^pid /run/nginx.pid#pid /var/run/nginx.pid#' \
+# --expression 's/^\s*error_log.*/error_log stderr;/' \
+# --expression 's/^\s*access_log.*/access_log off;/' \
+# /etc/nginx/nginx.conf
+
+# By default, this script does nothing. You'll have to modify it as
+# appropriate for your application.
+wget -q -O- https://s3.amazonaws.com/download.fpcomplete.com/debian/fpco.key | sudo apt-key add -
+echo 'deb http://download.fpcomplete.com/debian/jessie stable main'|sudo tee /etc/apt/sources.list.d/fpco.list
+apt-get update
+apt-get install -y stack
\ No newline at end of file
diff --git a/.sandstorm/stack b/.sandstorm/stack
new file mode 100644
index 000000000..7c3182e51
--- /dev/null
+++ b/.sandstorm/stack
@@ -0,0 +1 @@
+diy