Commit graph

480 commits

Author SHA1 Message Date
230eafdf58 Use Jinja2 strict rendering.
For this I had to create an Jinja2 explicit environment, so I put a
function in `ihatemoney.utils.create_jinja2_env(strict_rendering=False)`.

When using this environment and if `strict_rendering` is activated,
templates using undefined variables will now error out rather than
failing silently.
2018-01-14 18:37:10 +01:00
0504fd82f5 Fix the supervisord template.
The script was relying on the presence of an environment variable, which
is only set when the virtualenv is activated. But a virtualenv does not
have to be activated to work (it's possible to call the python command
directly).

This fixes it by relying on `sys.executable` which should be correct at
all times.

Fixes #306
2018-01-14 15:55:06 +01:00
JocelynDelalande
34a2161650
Merge pull request #308 from spiral-project/almet/fix-template-inclusion-packaging
Include all .j2 files in the packaged version.
2018-01-07 23:01:34 +01:00
c24ee6f1c4 Update the CHANGELOG. 2018-01-07 22:46:07 +01:00
59ff2dd6b2 Merge branch 'almet/fix-template-inclusion-packaging' of github.com:spiral-project/ihatemoney into almet/fix-template-inclusion-packaging 2018-01-07 21:44:33 +01:00
f1e2a2d84c Add a changelog entry 2018-01-07 21:43:35 +01:00
JocelynDelalande
2019b398f1 manage commands testing (#313)
* Rename manage.ConfigTemplate → manage.GenerateConfig

To be consistent with the CLI name: `generate-config`.

* Add tests for manage.py commands

* Run tests from pip-installed package

To be able to detect packaging-related issues on test runs.

refs #305
2018-01-07 00:27:42 +01:00
3b2e11ab63 Include all .j2 files in the packaged version.
I've also renamed the templates to *.j2 in order to make things clearer
to others. Having extensions with the name of the locale doesn't seem to
be a good practice, and would need us to add the locales in the MANIFEST
file each time we add one.

Fix #305
2018-01-05 22:06:11 +01:00
donkers
4ab8863eb2 Enable basic auth passthrough for API (#303)
* Enable basic auth passthrough for API

Added the couple of apache configuration lines necessary to get the basic authentication working for the API.

* Revert the addition of "AuthType Basic"

Did some more testing on my server here and I totally agree, don't need "AuthType Basic".
2018-01-05 12:32:46 +01:00
JocelynDelalande
c002cdbf94 Allow to disable/enable member via API (#301)
Disable was already (kind-of) possible via API via DELETE, but not re-enabling.

Kudos to @almet for helping me fixing that damn BooleanField :-)
2017-12-29 18:07:39 +01:00
Jocelyn Delalande
40e5a833a1 Fix tests layout so that API tests are not ran twice
Bad inheritance was causing APITestsCase tests to be ran twice.
2017-12-27 23:27:41 +01:00
Jocelyn Delalande
8fdf6407eb Back to development: 2.1 2017-12-27 19:10:00 +01:00
Jocelyn Delalande
b9d1a9c450 Preparing release 2.0 2017-12-27 19:09:05 +01:00
Jocelyn Delalande
d00f99b7ef Add missing entry to ChangeLog 2017-12-27 19:04:47 +01:00
JocelynDelalande
2dd7a0740a
Merge pull request #299 from spiral-project/fix-duplicate-member-validation
Fix duplicate member validation
2017-12-27 19:00:09 +01:00
JocelynDelalande
1c9120e68b Silent stderr output during app init for some commands (#293)
Avoid confusing the user for the commands outputing text to the user.

fix #277
2017-12-27 17:28:18 +01:00
867f77905b Require flask-rest 1.3 minimum.
Fixes #294
2017-12-27 17:26:16 +01:00
9fea0ffe2c Add tests for #294 2017-12-27 17:06:46 +01:00
JocelynDelalande
f2a53eb1e3 Position flash messages with CSS rather than JS (#292)
Visual result is exactly the same, but less black magic :-).
2017-12-27 16:10:29 +01:00
JocelynDelalande
4d359ce11b Fix PUT api/project/:code/members/:id (#297)
* Fix PUT api/project/:code/members/:id

Before that commit, every PUT *must* change the name of the members, so that was :
- no idempotence,
- no ability to change only weight

fix #295

* Remove redundant comment
2017-12-27 15:58:40 +01:00
JocelynDelalande
0189313c1f Remove un-needed sidebar block (#291)
{% block sidebar %} is used by sidebar_table_layout.html and its children, not by
layout.html nor its direct children.

This is dead code removal.
2017-12-23 01:38:12 +01:00
JocelynDelalande
b65ee59b1b Remove API password (#290)
* Remove the password from API GET responses

While keeping it for POST/PUT.

fix #289

* Add a test to check password change via API
2017-12-22 17:39:48 +01:00
JocelynDelalande
5160dac4a5 Replace some CSS by some JS (#288) 2017-12-21 20:35:18 +01:00
0livd
c6f72e112b Use hashed passwords for projects (#286)
- Remove all occurences of clear text project passwords.
- Migrate the database to hash the previously stored passwords.
Closes #232
2017-12-21 13:57:01 +01:00
JocelynDelalande
0dfb9c5f94 Add missing properties in API docs (#287)
* Mention weights in API doc

Because this is reality :-)

* Mention balance property in API doc

Still because this is reality.
2017-12-21 13:56:25 +01:00
0livd
8a68ac0d5b Use token based auth in invitation e-mails (#280)
* Use token based auth in invitation e-mails

Invitation e-mails no longer contain the clear
text project password

* Skip invite page after project creation

- Replace ``The project identifier is demo, remember it!``
by ``Invite other people to join this project!``
(linking to the invite page)
- Encourage users to share the project password via other
communication means in the reminder email
2017-12-15 17:10:28 +01:00
Alexandre Avenel
2866c868d5 Fix some typos using codespell (#285) 2017-11-11 18:11:15 +01:00
0livd
974485690c Add a database revision makefile recipe (#281) 2017-11-02 22:38:58 +01:00
5c645a5b0b Print out when pip is missing. 2017-11-01 22:29:16 +01:00
JocelynDelalande
16465846ce
Merge pull request #279 from JocelynDelalande/jd-upgrade-doc
Add an upgrade guide
2017-11-01 21:52:08 +01:00
Jocelyn Delalande
59fc6e0d78 Add an upgrade guide
fix #274
2017-11-01 21:51:47 +01:00
9d67c32a84
Parse requirements.txt in setup.py. Fix #273 (#284) 2017-11-01 18:36:44 +01:00
9d7376d46b
Add some information about Yunohost in the documentation. (#283) 2017-11-01 18:36:25 +01:00
Lucas Verney
0453599752 Update installation doc to include doc about production values, fix #266. (#282) 2017-11-01 01:56:05 +01:00
0livd
b94bad829c Use token based auth to reset passwords (#269)
Send a mail containing a password reset
token link instead of sending a clear text
password.

Ref #232
2017-10-26 19:46:34 +02:00
0livd
b4961f646a Add a DockerFile (#272)
Can be used to deploy the latest version from
PyPI in a production environment or from the
master branch in a dev environment.
2017-10-25 23:37:55 +02:00
0livd
293735eca7 Make authentication logic simpler and safer (#270)
* Fixed exposed password in session

The project password was set in clear text
in the session cookie. The cookie payload is
only base64 encoded so it must not be used to
store private information. The password is
simply replaced by a boolean.

* Simplify authentication logic
2017-10-23 23:03:44 +02:00
74e9af59e6 Fix Travis-CI integration (#276)
Use tox-travis to solve the current issues with Travis-CI
2017-10-23 22:58:04 +02:00
JocelynDelalande
e3285bef36 Enhance install process by generating config files from templates (#275)
* Add a command to generate configuration examples

Config files are generated from templates (which remplace previous example files).

- solve the issue of hard-to-explain configuration examples
- ease pkg path seeking (avoid it, actually)
- add working defaults for sqlite and unix socket paths (instead of
  /replace/me/path/example)
- move settings comments from default_settings.py to ihatemoney.cfg.j2, as it is
  the one that will be facing user.

* Use generate-config command  in install doc

Also follow the new working defaults of templates for socket and db path.

* Fix doc settings table

On the long term, plaintext tables might destroy humanity.

* Mention templates dir URL in documentation

As requested by @almet
2017-10-23 18:05:50 +02:00
0livd
efd2b66ac6 Do not import the whole werkzeug pkg (#271) 2017-09-07 11:02:12 +02:00
JocelynDelalande
6ccf86919e Normalize changelog (#265)
* Fix RST markup

This was formatted as markdown while this is a .rst

* Mention Issue/PR numbers in ChangeLog

* Rephrase changelog entries to be more succint

And clearer, IMHO.

* Move changes to Changed section.

* Remove redundant entry
2017-09-06 15:01:44 +02:00
JocelynDelalande
2964b8958c BREAKING CHANGE: Rename supervisor program (#268)
To match `budget` name disparition (package got renamed in #243).

This should be mentioned in upgrade guide.

ref #243 #264
2017-09-06 10:27:04 +02:00
JocelynDelalande
40dda53607 Fix default SQLALCHEMY_DATABASE_URI value in doc (#267)
Reality-sync with default_settings.py

Not fixing the whole table layout because

- my text editor doesn't do it ;
- I'm too lazy ;
- #251 is IMHO the real way to this issue :)
2017-09-06 10:26:48 +02:00
0livd
7a918c9349 Enhance the dashboard. (#262)
* Update to a more flexible admin authentication
* Admin can now access any project
* Add delete and edit options in the dashboard
* Add a link to the dashboard in the nav bar

This is a rework of the changes proposed by @Olivd, so they can apply on top of
the latest master without trouble. All credit goes to him for the code.
2017-09-04 15:44:20 +02:00
JocelynDelalande
ee1ecbf3e7 Add doc building instructions (#263) 2017-08-24 17:00:58 +02:00
0livd
2ec4fb589f Add a statistics tab (#257) 2017-08-21 23:51:32 +02:00
0livd
ec4a099f18 Protect admin endpoints against brute force attacks (#249)
* Protect admin endpoints against brute force attacks

Add a throttling mechanism to prevent a client brute
forcing the authentication form, based on its ip address
Closes #245

* Reset attempt counters if they get memory hungry
2017-08-20 12:37:12 +02:00
JocelynDelalande
68e4114735 Streamline installation doc, now using pip (#252)
* Fix conf files to reflect module renaming

Python module was renamed budget → ihatemoney (see #243 and 6923367).
Now, "budget" relates to nothing.

* Harmonize `APPLICATION_ROOT` doc with other settings

* Fix link markup

* Switch documentation to recomend pip over git

- Update installation instruction
- Clearly separate dev setup from installation
- Some rewordings/section-ization by the way

* Add a hint on how to find the static path

This is a downside on the pip choice over git for installation.

We will have to ease that a bit. By doc or by code, before next release.

* Make the nginx deployment doc more accurate

* Add a big fat warning about SECRET_KEY in doc
2017-08-20 12:25:57 +02:00
0livd
a0d4917ac4 Fix misplaced datepicker configuration (#258)
Bootstrap-datepicker is only included in the
list_bills template but its configuration was
living in the layout template, leading to a
javascript error on every page except list_bills.

Fixes #256
2017-08-20 12:22:47 +02:00
0livd
75104d9c19 Add python 3.6 support (#259)
Closes #253
2017-08-20 12:21:59 +02:00