Skip to content

Commit

Permalink
removing license checking for now. distribution with scarf
Browse files Browse the repository at this point in the history
  • Loading branch information
aviaviavi committed May 10, 2019
1 parent 67c6437 commit 57c4583
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 46 deletions.
5 changes: 1 addition & 4 deletions Dockerfile → Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ EXPOSE 9001
# have to install stack to make the binary from the previous step work in our
# container
RUN apt-get update
RUN apt-get install -y wget python-setuptools python-dev build-essential
RUN apt-get install -y wget build-essential
RUN wget -qO- https://get.haskellstack.org/ | sh

RUN easy_install pip
RUN pip install pycrypto

CMD ["toodles","-d","/repo/"]
9 changes: 9 additions & 0 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM debian:stretch

RUN curl -L https://scarf.sh/install | bash

ENV PATH $PATH:~/.scarf/bin

RUN scarf install toodles

CMD ["toodles","-d","/repo/"]
42 changes: 20 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,15 @@ These languages will be scanned for any TODO's:
Submit a PR if you'd like a language to be added. There will eventually be
support for this to be user configurable

### Running with Docker
### Installing with Scarf

[Scarf](https://scarf.sh) is the easiest way to get Toodles.

```bash
$ scarf install toodles
```

### Installing with Docker

You can run a pre-built toodles for your current directory via docker:

Expand All @@ -105,40 +113,30 @@ You can run a pre-built toodles for your current directory via docker:
$ docker run -it -v $(pwd):/repo -p 9001:9001 aviaviavi/toodles
```

Just mount your project into the container's `/repo` and direct a port of your choice to the container's `9001`.
Just mount your project into the container's `/repo` and direct a port of your
choice to the container's `9001`.

### Building Toodles

Toodles builds with stack [stack](https://docs.haskellstack.org). Just a `stack
build` should do it. If you'd like to build toodles without cloning the source,
you can have stack build toodles with `stack install --resolver=lts-12.14`!

#### Building with Docker

For convenience this repository also provides a `Dockerfile` to automatically
build toodles.

```bash
# to build container run:
$ cd /path/to/toodles/repo
$ docker build -t toodles .
$ docker build -t toodles Dockerfile.dev .
# afterwards you can run the following command to execute toodles for the
# directory you are currently in:
$ docker run -it -v $(pwd):/repo -p 9001:9001 toodles

```

### Installing manually

The best way to install manually is with [stack](https://docs.haskellstack.org).
Just a `stack install --resolver=lts-12.14 toodles` and you're done! Alternatively, with GHC 8.4.3
you can use [cabal](https://www.haskell.org/cabal/download.html).

You'll also need to PyCrypto. If you have pip, you can run:

```bash
$ pip install pycrypto
```

If you've closed the toodles repo directly, you can also run

```bash
$ cd path/to/toodles
$ pip install -r requirements.txt
```

### Running

Invoking `toodles` with no arguments will treat the current directory as the
Expand Down
4 changes: 2 additions & 2 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: toodles
version: 1.1.1
version: 1.2.1
github: "aviaviavi/toodles"
license: MIT
author: "Avi Press"
maintainer: "[email protected]"
copyright: "2018 Avi Press"
copyright: "2019 Avi Press"
category: Project Management

extra-source-files:
Expand Down
2 changes: 1 addition & 1 deletion src/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ getFullSearchResults (ToodlesState ref _ tierRef) recompute = do
then do
putStrLn "refreshing todo's"
userArgs <- toodlesArgs >>= setAbsolutePath
sResults <- runFullSearch (userArgs { limit_results = if userLicense == Commercial then 0 else freeResultsLimit})
sResults <- runFullSearch (userArgs { limit_results = 0 })
atomicModifyIORef' ref (const (Just sResults, sResults))
else
return $ fromMaybe (error "tried to read from the cache when there wasn't anything there") result
Expand Down
36 changes: 36 additions & 0 deletions toodles-scarf.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
-- import scarf dhall definitions at the top
-- then, you'll specify a list of distributions (one per platform)
-- `URI` can point to a local tar archive or a remote one
let platforms = ../scarf-server/scarf/example-packages/scarf.dhall

in { name =
"toodles"
, author =
"Avi Press"
, copyright =
"2019 Avi Press"
, license =
"MIT"
, version =
"1.2.1"
, distributions =
[ { platform =
platforms.mac
, simpleExecutableInstall =
"toodles"
, uri =
"./toodles-1.2.1-mac.tar.gz"
, includes =
[ "web" ]
}
, { platform =
platforms.linux_x86_64
, simpleExecutableInstall =
"toodles"
, uri =
"./toodles-1.2.1-linux.tar.gz"
, includes =
[ "web" ]
}
]
}
6 changes: 3 additions & 3 deletions toodles.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: bc494ef165b0b679287cc77c353f22a8bdd36eb0ab597a64bfc9c7180235ea7b
-- hash: f1065a51b86ff48993a22be460338247dcf2d32b7beb90b72f0e4e23622d3f8c

name: toodles
version: 1.1.1
version: 1.2.1
synopsis: Manage the TODO entries in your code
description: Toodles scrapes your entire repository for TODO entries and organizes them so you can manage your project directly from the code. View, filter, sort, and edit your TODO\'s with an easy to use web application. When you make changes via toodles, the edits will be applied directly the TODO entries in your code. When you\'re done, commit and push your changes to share them with your team!
category: Project Management
homepage: https://github.com/aviaviavi/toodles#readme
bug-reports: https://github.com/aviaviavi/toodles/issues
author: Avi Press
maintainer: [email protected]
copyright: 2018 Avi Press
copyright: 2019 Avi Press
license: MIT
license-file: LICENSE
build-type: Simple
Expand Down
14 changes: 1 addition & 13 deletions web/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="navbar-brand">
<div class="navbar-item" href="#">
<span><img src="/static/img/favicon.png" alt="favicon" height="25" width="25"></span>
<span class="toodles-nav-title-text">Toodles <span v-show="license == 'Commercial'">| Pro</span></span>
<span class="toodles-nav-title-text">Toodles</span>
</div>
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" v-on:click="toggleMenuBurger">
<span aria-hidden="true"></span>
Expand Down Expand Up @@ -59,18 +59,6 @@
</div>
</nav>

<section v-show="license == 'BadLicense'" class="bad-license-banner is-fullwidth" >
<div class="container">
Your license file is invalid. <a v-on:click="getLicense">Try again</a>
</div>
</section>

<section v-show="limited" class="warning-banner is-fullwidth" >
<div class="container">
The free edition of Toodles lets you manage up to 100 TODO's, so your results here are truncated. Please <a href="http://toodles.avi.press/#pricing">upgrade to Toodles Pro</a> in order to manage all of your code's TODO's.
</div>
</section>

<div class="modal">
<div class="modal-background" @click="closeModal"></div>
<div class="modal-content">
Expand Down
1 change: 0 additions & 1 deletion web/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ $(document).ready(function() {
},
created: function() {
this.refresh()()
return this.getLicense()
},
methods: {
// higher order for ease of calling from vue templates
Expand Down

0 comments on commit 57c4583

Please sign in to comment.