SHA256
1
0
forked from pool/trytond

Accepting request 752392 from Application:ERP:GNUHealth:Factory

version bump (forwarded request 750811 from DocB)

OBS-URL: https://build.opensuse.org/request/show/752392
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/trytond?expand=0&rev=38
This commit is contained in:
Dominique Leuenberger 2019-12-04 12:51:14 +00:00 committed by Git OBS Bridge
commit 7d31ac1ccf
7 changed files with 46 additions and 70 deletions

View File

@ -1,48 +0,0 @@
diff -ruN a/trytond/res/user.py b/trytond/res/user.py
- --- a/trytond/res/user.py 2018-11-22 09:21:59.077931014 +0000
+++ b/trytond/res/user.py 2018-11-22 09:21:04.423129737 +0000
@@ -20,6 +20,7 @@
from sql.conditionals import Coalesce
from sql.aggregate import Count
from sql.operators import Concat
+from random import randint
try:
import bcrypt
@@ -542,12 +543,15 @@
'''
Return user id if password matches
'''
- - LoginAttempt = Pool().get('res.user.login.attempt')
- - count = LoginAttempt.count(login)
- - if count > config.getint('session', 'max_attempt', default=5):
- - LoginAttempt.add(login)
- - raise RateLimitException()
- - Transaction().atexit(time.sleep, 2 ** count - 1)
+ login_max_delay = config.getint('session', 'login_max_delay')
+
+ #Use a random delay (default between 1 and login_max_delay)
+ #If the param is not set, it defaults to 3
+
+ if (not login_max_delay) or (login_max_delay < 1):
+ login_max_delay = 3
+ delay = randint(1,login_max_delay)
+
for method in config.get(
'session', 'authentications', default='password').split(','):
try:
@@ -557,10 +561,11 @@
continue
user_id = func(login, parameters)
if user_id:
- - LoginAttempt.remove(login)
return user_id
- - LoginAttempt.add(login)
- -
+ else:
+ logger.warning('Invalid login from : %s', login)
+ time.sleep(delay)
+
@classmethod
def _login_password(cls, login, parameters):
if 'password' not in parameters:

View File

@ -160,9 +160,23 @@ For manual creation of the database, the folowing steps are to be performed:
As result you will have a bare Tryton database with the base modules installed.
See: http://doc.tryton.org/4.6/trytond/doc/topics/configuration.html
See: http://doc.tryton.org/4.2/trytond/doc/topics/configuration.html
Installation of the Webfrontend for tryton (sao) from package
-------------------------------------------------------------
For most openSUSE Flavours tryton-sao is packed. You can install it with
> zypper install tryton-sao
You need to edit /etc/tryton/trytond.conf. Installation of tryton-sao follows the
standards for nodejs-installations, so the path is within the node-modules:
In the section [web], set the path:
root = /usr/lib/node-modules/tryton-sao
Now restart trytond.
Installation of the Webfrontend for tryton (sao) from source
------------------------------------------------------------
@ -237,7 +251,7 @@ Now, you're finished with the system setup. Please be aware of the following thi
* Only the same major version of Tryton client and Tryton server can connect.
-- Axel Braun <axel.braun@gmx.de> März 20, 2019, 19:20:02
-- Axel Braun <axel.braun@gmx.de> MON Jun 11 10:27:14 UTC 2018
This file is based on tryton-server.README.Debian

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4892073d086b97ee3025bfbace9652f45fd36be87defc0cd0d36926c11607c06
size 611113

3
trytond-5.0.15.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:62d25144a13d89ede50a51515abe50a8036574929c20c26b295a217b42fe4723
size 648771

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Nov 21 14:01:30 UTC 2019 - Axel Braun <axel.braun@gmx.de>
- version 5.0.15 (upgrade to GNU Health 3.6.x)
get_login_trytond-46.patch removed
-------------------------------------------------------------------
Mon Nov 11 17:59:05 UTC 2019 - Axel Braun <axel.braun@gmx.de>

View File

@ -92,6 +92,16 @@ listen = [::]:8000
# The time (in seconds) until an inactive session expires
#timeout = 3600
# The server administration password used by the client for
# the execution of database management tasks. It is encrypted
# using using the Unix crypt(3) routine. A password can be
# generated using the following command line (on one line):
# $ python -c 'import getpass,crypt,random,string; \
# print crypt.crypt(getpass.getpass(), \
# "".join(random.sample(string.ascii_letters + string.digits, 8)))'
# Example password with 'admin'
#super_pwd = jkUbZGvFNeugk
[email]
# Mail settings

View File

@ -1,8 +1,8 @@
#
# spec file for package trytond
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2015-2018 Dr. Axel Braun
# Copyright (c) 2019 SUSE LLC.
# Copyright (c) 2015 2017 Dr. Axel Braun
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,25 +17,25 @@
#
%define majorver 4.6
%define majorver 5.0
%define base_name tryton
Name: trytond
Version: %{majorver}.22
Version: %{majorver}.15
Release: 0
Summary: An Enterprise Resource Planning (ERP) system
License: GPL-3.0-or-later
Group: Productivity/Office/Management
Url: http://www.tryton.org/
URL: http://www.tryton.org/
Source0: http://downloads.tryton.org/%{majorver}/%{name}-%{version}.tar.gz
#Patch0: trytond_get_login.patch
Source1: tryton-server.README.SUSE
Source2: trytond.conf.example
Source3: %{name}.conf
Source4: %{name}_log.conf
#Source11: %{name}.sysconfig
Source20: %{name}.service
Patch0: get_login_trytond-46.patch
#Patch0: %{name}_server.diff
# List of additional build dependencies
BuildRequires: fdupes
BuildRequires: python3-Werkzeug
@ -82,7 +82,7 @@ security.
%setup -q
cp %{S:1} .
cp %{S:2} .
%patch0 -p1
#%patch0 -p1
%build
python3 setup.py build
@ -98,16 +98,9 @@ mkdir -p $RPM_BUILD_ROOT%{_unitdir}
install -p -m 644 %{SOURCE20} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/{lib,log}/%{base_name}
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%fdupes -s %{buildroot}
%pre
#Write GH Variable /etc/tryton/gnuhealthrc
cat > /etc/tryton/gnuhealthrc << "EOF"
TRYTON_VERSION=%{version}
EOF
getent group tryton > /dev/null || %{_sbindir}/groupadd -r tryton || :
getent passwd tryton > /dev/null || %{_sbindir}/useradd -r -g tryton \
-d %{_localstatedir}/lib/tryton -s /sbin/nologin \
@ -132,6 +125,7 @@ getent passwd tryton > /dev/null || %{_sbindir}/useradd -r -g tryton \
%{_bindir}/%{name}
%{_bindir}/%{name}-admin
%{_bindir}/%{name}-cron
%{_bindir}/%{name}-worker
%{_unitdir}/%{name}.service
%attr(640,root,tryton) %config(noreplace)%{_sysconfdir}/%{base_name}/%{name}.conf
%attr(640,root,tryton) %config(noreplace)%{_sysconfdir}/%{base_name}/%{name}_log.conf