diff --git a/.sandstorm/build.sh b/.sandstorm/build.sh index d64822382..56ebf7189 100644 --- a/.sandstorm/build.sh +++ b/.sandstorm/build.sh @@ -19,5 +19,7 @@ set -euo pipefail # By default, this script does nothing. You'll have to modify it as # appropriate for your application. -cabal update -cabal install --root-cmd=sudo --global --prefix=/usr/local hledger-web \ No newline at end of file +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 index 68dec14b2..c46f3e573 100644 --- a/.sandstorm/changelog.md +++ b/.sandstorm/changelog.md @@ -1,3 +1,7 @@ +# V1.0.1-sandstorm1 (2016-11-15) + + * Upgrade to HLedger 1.0.1 + # V0 - * Initial release \ No newline at end of file + * Initial release diff --git a/.sandstorm/launcher.sh b/.sandstorm/launcher.sh index 0071b79cc..52842a343 100644 --- a/.sandstorm/launcher.sh +++ b/.sandstorm/launcher.sh @@ -26,9 +26,7 @@ set -euo pipefail # to think about such things. # * Launching other daemons your app needs (e.g. mysqld, redis-server, etc.) -# By default, this script does nothing. You'll have to modify it as -# appropriate for your application. mkdir -p /var/lib/hledger -touch /var/lib/hledger/ledger.dat +touch /var/lib/hledger/Ledger cd /var -hledger-web --server -f /var/lib/hledger/ledger.dat --port 8000 \ No newline at end of file +hledger-web --server --base-url='' -f /var/lib/hledger/Ledger --port 8000 \ No newline at end of file diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp index 4f13e0a75..6730805c6 100644 --- a/.sandstorm/sandstorm-pkgdef.capnp +++ b/.sandstorm/sandstorm-pkgdef.capnp @@ -1,4 +1,4 @@ -@0xb83da55f33c7fde7; +@0xbc169f81a53d625c; using Spk = import "/sandstorm/package.capnp"; # This imports: @@ -9,7 +9,7 @@ const pkgdef :Spk.PackageDefinition = ( # The package definition. Note that the spk tool looks specifically for the # "pkgdef" constant. - id = "wy71w9g29zevsc8dfcf8c322wgxm97z5fu29y8v9p02p95s6eqj0", + 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. @@ -17,11 +17,11 @@ const pkgdef :Spk.PackageDefinition = ( # This manifest is included in your app package to tell Sandstorm # about your app. - appTitle = (defaultText = "HLedger"), + appTitle = (defaultText = "HLedger Web"), - appVersion = 0, # Increment this for every release. + appVersion = 1, # Increment this for every release. - appMarketingVersion = (defaultText = "0.26"), + appMarketingVersion = (defaultText = "1.0.1-sandstorm1"), # Human-readable representation of appVersion. Should match the way you # identify versions of your app in documentation and marketing. @@ -34,11 +34,104 @@ const pkgdef :Spk.PackageDefinition = ( ) ], - continueCommand = .myCommand + 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://dev.thewordnerd.info/nolan/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 = ( @@ -63,12 +156,81 @@ const pkgdef :Spk.PackageDefinition = ( # `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 = [] + 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 = ( @@ -76,6 +238,10 @@ const myCommand :Spk.Manifest.Command = ( 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 = "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 index a13e90326..e05853d7f 100644 --- a/.sandstorm/setup.sh +++ b/.sandstorm/setup.sh @@ -21,5 +21,7 @@ set -euo pipefail # 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 haskell-platform libncurses-dev +apt-get install -y stack \ No newline at end of file diff --git a/hledger b/hledger index ff59e0c15..6d0716b0a 160000 --- a/hledger +++ b/hledger @@ -1 +1 @@ -Subproject commit ff59e0c15c6a10b91dcb904a80ac526cdb02cd56 +Subproject commit 6d0716b0a5f5cde48e462d429e871b21e944b583