Commit acbacf07 authored by Benjamin Bouvier's avatar Benjamin Bouvier
Browse files

Merge and build of branch 'incoming' into master;

parents 1c9866eb 25523bb6
......@@ -6,3 +6,9 @@ build/
# ignore vendor JS files
client/flux/
client/vendor/
# ignore locales
shared/locales
# ignore kresus binary
bin/kresus.js
......@@ -3,9 +3,6 @@
env:
node: true
browser: true
globals:
"React": true
"$": true
ecmaFeatures:
jsx: false
rules:
......@@ -423,7 +420,7 @@
# specify the maximum length of a line in your program
max-len:
- 2
- 80
- 100
- 4 # Should kept in sync with the "indent" rule
# specify the maximum depth callbacks can be nested
max-nested-callbacks:
......
image: node:4.4.4-slim
before_script:
- npm install
test:
script:
- npm run test
......@@ -8,7 +8,7 @@
- Install the app's dependencies:
```make install-node-deps```
```make install-node-dev-deps```
- Some files needs to be compiled to JS, prepared and moved around, etc. There
are two ways to do this:
......
FROM node:4.4.4-slim
MAINTAINER Benjamin Bouvier <public@benj.me>
# Install system dependencies
RUN apt-get update -y && \
apt-get install -y python-weboob-core && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Setup project layout
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json package.json
RUN npm install --production
# Copy source
COPY build /usr/src/app/build
COPY bin /usr/src/app/bin
# Run server
ENV HOST 0.0.0.0
CMD bin/kresus.js
# Expose the port on which Kresus is running.
EXPOSE 9876
.PHONY: all build dev lint lint-client lint-server test release run run-cozy install-node-deps install install-debian-deps install-debian
.PHONY: help run run-cozy install-node-deps install install-debians-deps install-debian install-node-dev-deps build dev lint lint-client lint-server test release
all: build
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
build:
run: install-node-deps ## Runs the standalone version of kresus, from this directory.
node bin/kresus.js
run-cozy: install-node-deps ## Runs the CozyCloud version of kresus, from this directory.
node build/server/index.js
install-node-deps: ## Installs all node dependencies for a production environment.
npm install --production
install: ## Globally install the standalone version of kresus.
npm -g install --production
install-debian-deps: ## Install the extra Debian dependencies necessary to run Kresus.
sudo apt-get update
sudo apt-get install -y python-weboob-core
install-debian: install install-debian-deps ## Globally install Kresus and all its dependencies.
install-node-dev-deps: ## Installs all node dependencies for a development environment.
npm install
build: ## Transpiles ES6 files to ES5, moves files and concatenate them to obtain a usable build.
./scripts/build.sh
dev: build
dev: build ## As build, but retriggers incremental compilation as the files are changed on disk.
./scripts/dev.sh
lint:
lint: ## Runs the linter for the server and the client.
./scripts/lint.sh
lint-client:
lint-client: ## Runs the linter on the client.
./scripts/lint.sh ./client
lint-server:
lint-server: ## Runs the linter on the server.
./scripts/lint.sh ./server
test:
test: ## Runs all tests and style checks.
./scripts/test.sh
release: build
release: build ## Prepares for a release. To be done only on the `master` branch.
git add -f build/
npm shrinkwrap
git add npm-shrinkwrap.json
git status
run: install-node-deps
node bin/kresus.js
run-cozy: install-node-deps
node build/server/index.js
# npm install also causes a build, see package.json
install-node-deps:
npm install
install:
npm -g install
install-debian-deps:
sudo apt-get install -y python-dev libffi-dev libxml2-dev libxslt-dev libyaml-dev libjpeg-dev libyaml-dev python-virtualenv npm
install-debian: install-debian-deps install
......@@ -18,32 +18,17 @@ but is way different now.
## Pre-requisites
Kresus uses [Weboob](http://weboob.org/) under the hood, to connect to your
bank website. Either you should make sure that all Weboob's dependencies are
installed, or weboob should be globally installed.
bank website. You'll need to [install Weboob](http://weboob.org/install) core
modules so that the user executing the Kresus server can use them.
### Local weboob install (preferred way)
Note that Kresus needs the latest stable version of Weboob, which is 1.1 at
this point. Although Kresus would also work with the 1.0 version, it won't let
you run this version, because bank modules might be outdated and not updated
anymore, and as a result synchronization with your bank website would not work.
If you install dependencies necessary to compile Weboob, Kresus will handle all
of installation and update. In this case, you need the following dependencies:
This can be done with the following command, under Debian based systems:
- On **Debian** based operating systems, you need `python-dev libffi-dev
libxml2-dev libxslt-dev libyaml-dev libjpeg-dev python-virtualenv`. These can
be installed with `make install-debian-deps`.
- On **Fedora** (as of version 22), these are `python-devel libffi-devel
libxml2-devel libxslt-devel libyaml-devel libjpeg-devel virtualenv`.
- Optional requirement: the development version of `libyaml` (`libyaml-dev`
under Debian based, `libyaml-devel` under Fedora) can provide
additional performance to Weboob.
- You'll also need a machine with at least **1 GB of RAM**, for compiling
python modules needed for Weboob.
- Make sure your firewall is setup so as to allow cloning weboob's repos, see
the Firewall Reocommendations section of this document.
### Global weboob install
Install it globally with your favorite package manager. In this case, Kresus
won't be able to manage it (update it or reinstall it) and you may have to
manually do this chore by yourself.
make install-debian-deps
## Install on CozyCloud
......@@ -51,7 +36,7 @@ If you already have a Cozy instance set up, then you can install Kresus either
from the Marketplace or by hopping on the machine and running the following
command:
```cozy-monitor install kresus -r https://github.com/bnjbvr/kresus```
cozy-monitor install kresus -r https://github.com/bnjbvr/kresus
## Standalone install on Debian
......@@ -114,8 +99,6 @@ you can set several options at runtime:
You'll need the following firewall authorizations:
- if you chose to let Kresus handle the Weboob installation, you'll need git
access to `git.symlink.me/` and the `pipy` website.
- http/https access to your bank website, for fetching new operations on your
behalf.
......
......@@ -3,43 +3,13 @@
var path = require('path-extra');
var fs = require('fs');
var mainDir = process.env.KRESUS_DIR
? process.env.KRESUS_DIR
: path.join(path.homedir(), '.kresus');
var defaultDbPath = path.join(mainDir, 'db');
var mainDir = process.env.KRESUS_DIR ? process.env.KRESUS_DIR
: path.join(path.homedir(), '.kresus');
if (!fs.existsSync(mainDir)) {
fs.mkdirSync(mainDir);
}
function copyFiles(fromDir, toDir) {
fs.readdirSync(fromDir).forEach(function(child) {
var from = path.join(fromDir, child);
var to = path.join(toDir, child);
if (fs.statSync(from).isDirectory()) {
if (!fs.existsSync(to)) {
fs.mkdirSync(to);
}
// Don't copy the python env
if (child !== 'env') {
copyFiles(from, to);
}
} else if (!fs.existsSync(to)) {
var wr = fs.createWriteStream(to);
fs.createReadStream(from).pipe(wr);
wr.on('close', function() { fs.chmodSync(to, 0755); });
}
});
}
var weboobSrc = path.join(path.dirname(fs.realpathSync(__filename)), '..', 'weboob');
var weboobDest = path.join(mainDir, 'weboob');
if (!fs.existsSync(weboobDest)) {
fs.mkdirSync(weboobDest);
}
copyFiles(weboobSrc, weboobDest);
process.chdir(mainDir);
process.env.NODE_ENV = 'production';
......@@ -49,6 +19,8 @@ process.kresus.standalone = true;
var root = path.join(path.dirname(fs.realpathSync(__filename)), '..', 'build');
var start = require(path.join(root, 'server'));
var defaultDbPath = path.join(mainDir, 'db');
var opts = {
root: root,
port: process.env.PORT || 9876,
......
......@@ -1009,203 +1009,204 @@ th {
padding: 0;
}
.icon {
background-image: url(../images/sprite.png);
background-image: url('../images/sprite.png');
}
.icon-s2e {
.icon-cmso {
background-position: -0px -0px;
width: 48px;
height: 44px;
width: 46px;
height: 46px;
}
.icon-apievie {
background-position: -0px -44px;
width: 48px;
height: 47px;
.icon-alloresto {
background-position: -0px -46px;
width: 46px;
height: 46px;
}
.icon-cmso {
background-position: -0px -91px;
width: 48px;
height: 48px;
.icon-americanexpress {
background-position: -0px -92px;
width: 46px;
height: 46px;
}
.icon-alloresto {
background-position: -0px -139px;
width: 48px;
height: 48px;
.icon-apievie {
background-position: -0px -138px;
width: 46px;
height: 46px;
}
.icon-axabanque {
background-position: -0px -187px;
width: 48px;
height: 48px;
background-position: -0px -184px;
width: 46px;
height: 46px;
}
.icon-banqueaccord {
background-position: -0px -235px;
width: 48px;
height: 48px;
background-position: -0px -230px;
width: 46px;
height: 46px;
}
.icon-banquepopulaire {
background-position: -0px -283px;
width: 48px;
height: 48px;
background-position: -0px -276px;
width: 46px;
height: 46px;
}
.icon-barclays {
background-position: -0px -331px;
width: 48px;
height: 48px;
background-position: -0px -322px;
width: 46px;
height: 46px;
}
.icon-bforbank {
background-position: -0px -379px;
width: 44px;
height: 48px;
background-position: -0px -368px;
width: 46px;
height: 46px;
}
.icon-bnporc {
background-position: -0px -427px;
width: 48px;
height: 48px;
background-position: -0px -414px;
width: 46px;
height: 46px;
}
.icon-boursorama {
background-position: -0px -475px;
width: 48px;
height: 48px;
background-position: -0px -460px;
width: 46px;
height: 46px;
}
.icon-bp {
background-position: -0px -523px;
width: 48px;
height: 48px;
background-position: -0px -506px;
width: 46px;
height: 46px;
}
.icon-bred {
background-position: -0px -571px;
width: 48px;
height: 48px;
background-position: -0px -552px;
width: 46px;
height: 46px;
}
.icon-caissedepargne {
background-position: -0px -619px;
width: 48px;
height: 48px;
background-position: -0px -598px;
width: 46px;
height: 46px;
}
.icon-carrefourbanque {
background-position: -0px -667px;
width: 48px;
height: 48px;
background-position: -0px -644px;
width: 46px;
height: 46px;
}
.icon-cic {
background-position: -0px -715px;
width: 48px;
height: 48px;
background-position: -0px -690px;
width: 46px;
height: 46px;
}
.icon-citelis {
background-position: -0px -763px;
width: 48px;
height: 48px;
background-position: -0px -736px;
width: 46px;
height: 46px;
}
.icon-citibank {
background-position: -0px -811px;
width: 48px;
height: 48px;
background-position: -0px -782px;
width: 46px;
height: 46px;
}
.icon-cmb {
background-position: -0px -859px;
width: 48px;
height: 48px;
background-position: -0px -828px;
width: 46px;
height: 46px;
}
.icon-amazonstorecard {
background-position: -0px -907px;
width: 48px;
height: 48px;
background-position: -0px -874px;
width: 46px;
height: 46px;
}
.icon-cragr {
background-position: -0px -955px;
width: 48px;
height: 48px;
background-position: -0px -920px;
width: 46px;
height: 46px;
}
.icon-creditcooperatif {
background-position: -0px -1003px;
width: 48px;
height: 48px;
background-position: -0px -966px;
width: 46px;
height: 46px;
}
.icon-creditdunord {
background-position: -0px -1051px;
width: 48px;
height: 48px;
background-position: -0px -1012px;
width: 46px;
height: 46px;
}
.icon-creditmutuel {
background-position: -0px -1099px;
width: 48px;
height: 48px;
background-position: -0px -1058px;
width: 46px;
height: 46px;
}
.icon-delubac {
background-position: -0px -1147px;
width: 48px;
height: 48px;
background-position: -0px -1104px;
width: 46px;
height: 46px;
}
.icon-fortuneo {
background-position: -0px -1195px;
width: 48px;
height: 48px;
background-position: -0px -1150px;
width: 46px;
height: 46px;
}
.icon-ganassurances {
background-position: -0px -1243px;
width: 48px;
height: 48px;
background-position: -0px -1196px;
width: 46px;
height: 46px;
}
.icon-groupamaes {
background-position: -0px -1291px;
width: 48px;
height: 48px;
background-position: -0px -1242px;
width: 46px;
height: 46px;
}
.icon-hellobank {
background-position: -0px -1339px;
width: 48px;
height: 48px;
background-position: -0px -1288px;
width: 46px;
height: 46px;
}
.icon-hsbc {
background-position: -0px -1387px;
width: 48px;
height: 48px;
background-position: -0px -1334px;
width: 46px;
height: 46px;
}
.icon-ing {
background-position: -0px -1435px;
width: 48px;
height: 48px;
background-position: -0px -1380px;
width: 46px;
height: 46px;
}
.icon-kiwibank {
background-position: -0px -1483px;
width: 48px;
height: 48px;
background-position: -0px -1426px;
width: 46px;
height: 46px;
}
.icon-lcl {
background-position: -0px -1531px;
width: 48px;
height: 48px;
background-position: -0px -1472px;
width: 46px;
height: 46px;
}
.icon-oney {
background-position: -0px -1579px;
width: 48px;
height: 48px;
background-position: -0px -1518px;
width: 46px;
height: 46px;
}
.icon-paypal {
background-position: -0px -1627px;
width: 48px;
height: 48px;
background-position: -0px -1564px;
width: 46px;
height: 46px;
}
.icon-americanexpress {
background-position: -0px -1675px;
width: 48px;
height: 48px;
.icon-s2e {
background-position: -0px -1610px;
width: 46px;
height: 46px;
}
.icon-societegenerale {
background-position: -0px -1723px;
width: 48px;
height: 48px;
background-position: -0px -1656px;
width: 46px;
height: 46px;
}
.icon-vicseccard {
background-position: -0px -1771px;
width: 48px;
height: 48px;
background-position: -0px -1702px;
width: 46px;
height: 46px;
}
.icon-wellsfargo {
background-position: -0px -1819px;
width: 48px;
height: 48px;
}/* Global */
background-position: -0px -1748px;
width: 46px;
height: 46px;
}
/* Global */
@font-face {
font-family:Myriad Pro;
src: url(../fonts/MYRIADPRO-REGULAR.OTF);
......@@ -1309,7 +1310,7 @@ ul {
.navbar-default {
background-color: #FFF;
background-image: none;
border-color: #DDD;
border-color: #cfd9db;
box-shadow: none;
}
......@@ -1391,10 +1392,7 @@ ul {
/* Logo in the sidebar */
.logo {
line-height: 1.3em;
padding: 20px 0 20px 20px;
font-size: 22px;
font-weight: bold;
color: #fff;
}
......@@ -1402,6 +1400,13 @@ ul {
color: #fff;
}
.app-title {
line-height: 1.3em;
font-size: 22px;