Giter Club home page Giter Club logo

haskell-ricochet's Introduction

haskell-ricochet

A wip Haskell library for ricochet.im.

Idea

We really like Ricochet but the application is a monolithic Qt-based one.

We are developing this library for those reasons:

  • Different frontends – like ncurses

  • Possibility to build bots

  • Easier to extend the protocol using new channel types (adding these is meant to be easy using our library)

Stability and Security

Don’t use this project unless you are developing on it. It is probably neither stable nor secure and far from being finished.

Building and Documentation

We tested everything using the following nix-workflow but you should also get it to work using stack or cabal.

cabal2nix . > haskell-ricochet.nix
nix-shell -A env                       # for dependencies
cabal configure
cabal build
cabal haddock                          # documentation
cabal repl                             # for playing around
cabal test                             # tests (need tor running with control port open)

Get in touch!

haskell-ricochet's People

Contributors

fkarg avatar froozen avatar mrphs avatar photm5 avatar sternenseemann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

haskell-ricochet's Issues

Move to self-hosted

GitHub sucks for lots of reasons. Some of them are:

  • Lots of things cannot be done without running proprietary JavaScript
  • They are a centralized service
  • Their backend is not free software (by that, I mean sth. similar to the AGPL)
  • Issue tracking data cannot be exported
  • You cannot create pull requests without a GitHub account

Thus, I propose to host stuff ourselves. A simple git repository and mailing list would suffice for the beginning. That would solve all of the points above.

Deal with the version negotiation

It would be nice to have a higher level abstraction of this, in case we or our libraries’ users will want to support future (or own) versions of the protocol.

Create C-bindings

When we started out, we decided we wanted to have working C-bindings as well.
We should put them in another repository, once we get to it.
This issue serves only as a reminder of that fact.

Write nice monadic run functions

As we're exporting our own monad, we should provide some pleasant functions to "run" it.
I'd propose
startRicochet :: Socket -> [Contact] -> PortID -> Map Word8 (Connectiont -> Ricochet ()) -> IO ()
and
startRicochet' :: ByteString -> PortID -> [Contact] -> PortID -> Map Word8 (Connectiont -> Ricochet ()) -> IO ()

The second one takes the private key and the Tor control port and does the port-mapping for the user.

root needed to run the demos

I'm not sure if only I have this issue, but I need to run the demos as root, otherwise I'll get the following error:

server: /var/lib/tor/control_auth_cookie: openBinaryFile: permission denied (Permission denied)

This is quite problematic as users will need root permissions to run anything using haskell-ricochet, which makes it damn near worthless.
Any ideas on how to fix this?

Implement Network.Ricochet.Crypto

We will need a module with nice crypto-related utility functions.
One thing we need is the generation of 1024-Bit private RSA keys in base64 for network-anonymous-tor.

Document Network.Ricochet

The Network.Ricochet module still needs module header documentation.
As this will be the main module, its documentation should contain a lengthy explanation of the project, as well as example code.

Include hprotoc in the build system

I tried to add a pre-config hook to Setup.hs, using this code:

import Distribution.Simple
import Data.Monoid((<>))

curry2 :: ((a -> b -> c) -> (a1 -> b1 -> c1) -> d) -> (((a, b) -> c) -> ((a1, b1) -> c1) -> d)
curry2 = flip (.) curry . flip . flip (.) curry . flip

combine' :: (Monad m, Monoid b) => (a -> m b) -> (a -> m b) -> (a -> m b)
combine' f g x = f x >>= \rf -> g x >>= \rg -> return $ rf <> rg

--combine :: (Monad m, Monoid c) => (a -> b -> m c) -> (a -> b -> m c) -> (a -> b -> m c)
--combine = uncurry . combine' . curry2

preConfHook = preConf simpleUserHooks `combine` const const (putStrLn "test")
main = defaultMainWithHooks $ simpleUserHooks { preConf = preConfHook }

Sadly, the commented out part doesn’t compile.

Agree on a simpler includes style

Our current policy is to just not care about the style and run stylish-haskell sometime later, when noone currently develops any PR. I don’t like this, since the includes look ugly for a long time.

I’d propose to agree on a simpler includes style, since that way, the includes will look good all the time, and we won’t have to arbitrarly specify some point in time where noone develops any PR. It could always be that someone we don’t know is currently working on some great improvement, and he isn’t motivated anymore as soon as he sees himself facing a huge amount of work because of merge conflicts.

Write the library.

Please reference every issue regarding the library to here. More complicated problems can be discussed here.

Testing

We should write a lot of test cases and use a CI service for automatic testing on Github.

What should one use to test Haskell applications? Something usable trough cabal test I suppose.

Demos don't seem to be working

Running client and telling it to connect to the server doesn't seem to be doing anything for me.
Looking at its code, it seems like it should print Connected!, but it doesn't do that.
Am I the only one with that problem or does it not work for you as well?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.