Re: [web2py] Re: pbkdf2(1000,20,sha512)$etc... in v2.22.5

2022-08-19 Thread Jim S
I think we'll need help from someone who knows more about this than I do.

-Jim


On Friday, August 19, 2022 at 6:27:15 AM UTC-5 lucas wrote:

> ok, i am trying to understand.  i'm using web2py 2.22.5 under centos 8 in 
> console only mode.  i searched all of my application files and there is no 
> hint of auth.settings.hmac_key = "such and such".  when i access auth, 
> session, request, etc., i can see an hmac_key key in auth.settings but it 
> is None, AND i see a session changing value under session.auth with an 
> equal value under response.  but again, that changes with each login.
>
> i grep'd "hmac_key" under gluon and found "pbkdf2_hex" and "simple_hash" 
> under gluon/packages/dal/pydal/validators.py, and i suspect i would access 
> and use these functions based on previous posts asking similar questions, 
> but i have no idea how to import them and then use them in a bash/python 
> script file to reproduce the hash in a password field under web2py.
>
> so i ask again: "in linux/bash script code, not web2py interface [or 
> application], how do i take a regular string and convert it into the 
> password that is stored in the password in the auth_user table under web2py 
> version 2.22.5?"
>
> lucas
>
> On Thursday, August 18, 2022 at 4:51:41 PM UTC-4 Jim S wrote:
>
>> I must be misunderstanding something, because that is what I thought I 
>> just showed.
>>
>> hashed_password 
>> = 
>> str(CRYPT(key="pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(plain_text_password)[0])
>>
>> "whatever-your-hash-string-is needs" to be the same as what you're 
>> assigning to auth.settings.hmac_key in db.py
>>
>> hashed_password should then match what is in auth_user.password
>>
>> -Jim
>>
>>
>> On Thursday, August 18, 2022 at 2:34:45 PM UTC-5 lucas wrote:
>>
>>> ok, that sets up the web2py environment.  i'm asking how to reproduce or 
>>> generate the hashed key from regular text within a separate shell script.  
>>> lucas
>>>
>>> On Thursday, August 18, 2022 at 8:53:38 AM UTC-4 Jim S wrote:
>>>
 It should be the same as auth.settings.hmac_key, probably set in db.py

 auth.settings.hmac_key = (
 "sha512:whatever-your-has-string-is"  # before define_tables()
 )



 On Thu, Aug 18, 2022 at 7:44 AM lucas  wrote:

> but how do you generate the hash string from the regular text string?
>
> On Thursday, August 18, 2022 at 8:40:35 AM UTC-4 Jim S wrote:
>
>> Here is what I'm using:
>>
>> password = str(CRYPT(key=
>> "pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(unhashed)[0])
>>
>> On Wednesday, August 17, 2022 at 9:01:32 PM UTC-5 lucas wrote:
>>
>>> hello one and all,
>>> in linux/bash script code, not web2py interface, how do i take a 
>>> regular string and convert it into the password that is stored in the 
>>> password in the auth_user table under web2py version 2.22.5?
>>> thank you in advance, lucas
>>>
>> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/801jh-wneL0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> web2py+un...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/web2py/2b0bd3f4-5dbc-49b5-b40e-e50e616b9d1dn%40googlegroups.com
>  
> 
> .
>


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6cf48519-6c19-49fd-9c44-5a0e6b657015n%40googlegroups.com.


Re: [web2py] Re: pbkdf2(1000,20,sha512)$etc... in v2.22.5

2022-08-19 Thread lucas
ok, i am trying to understand.  i'm using web2py 2.22.5 under centos 8 in 
console only mode.  i searched all of my application files and there is no 
hint of auth.settings.hmac_key = "such and such".  when i access auth, 
session, request, etc., i can see an hmac_key key in auth.settings but it 
is None, AND i see a session changing value under session.auth with an 
equal value under response.  but again, that changes with each login.

i grep'd "hmac_key" under gluon and found "pbkdf2_hex" and "simple_hash" 
under gluon/packages/dal/pydal/validators.py, and i suspect i would access 
and use these functions based on previous posts asking similar questions, 
but i have no idea how to import them and then use them in a bash/python 
script file to reproduce the hash in a password field under web2py.

so i ask again: "in linux/bash script code, not web2py interface [or 
application], how do i take a regular string and convert it into the 
password that is stored in the password in the auth_user table under web2py 
version 2.22.5?"

lucas

On Thursday, August 18, 2022 at 4:51:41 PM UTC-4 Jim S wrote:

> I must be misunderstanding something, because that is what I thought I 
> just showed.
>
> hashed_password 
> = 
> str(CRYPT(key="pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(plain_text_password)[0])
>
> "whatever-your-hash-string-is needs" to be the same as what you're 
> assigning to auth.settings.hmac_key in db.py
>
> hashed_password should then match what is in auth_user.password
>
> -Jim
>
>
> On Thursday, August 18, 2022 at 2:34:45 PM UTC-5 lucas wrote:
>
>> ok, that sets up the web2py environment.  i'm asking how to reproduce or 
>> generate the hashed key from regular text within a separate shell script.  
>> lucas
>>
>> On Thursday, August 18, 2022 at 8:53:38 AM UTC-4 Jim S wrote:
>>
>>> It should be the same as auth.settings.hmac_key, probably set in db.py
>>>
>>> auth.settings.hmac_key = (
>>> "sha512:whatever-your-has-string-is"  # before define_tables()
>>> )
>>>
>>>
>>>
>>> On Thu, Aug 18, 2022 at 7:44 AM lucas  wrote:
>>>
 but how do you generate the hash string from the regular text string?

 On Thursday, August 18, 2022 at 8:40:35 AM UTC-4 Jim S wrote:

> Here is what I'm using:
>
> password = str(CRYPT(key=
> "pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(unhashed)[0])
>
> On Wednesday, August 17, 2022 at 9:01:32 PM UTC-5 lucas wrote:
>
>> hello one and all,
>> in linux/bash script code, not web2py interface, how do i take a 
>> regular string and convert it into the password that is stored in the 
>> password in the auth_user table under web2py version 2.22.5?
>> thank you in advance, lucas
>>
> -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/801jh-wneL0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/2b0bd3f4-5dbc-49b5-b40e-e50e616b9d1dn%40googlegroups.com
  
 
 .

>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/8d2647c2-8cfa-4336-8e39-57e2b3b62b40n%40googlegroups.com.


[web2py] Re: Bug in gluon/scheduler.py

2022-08-19 Thread Dave S


On Monday, August 8, 2022 at 3:50:26 AM UTC-7 Tom Clerckx wrote:

> Version:
> Version 2.22.5-stable+timestamp.2022.06.04.18.13.51
>
> There is a problem with the calculation of next_run_time in 
> gluon/scheduler.py at line 1024
>
> It calculates:
> steps = secondspassed // task.period + 1
>
> However, there is no check done for task.period being 0
>
> This can cause the following scheduler error:
> ZeroDivisionError: float divmod()
>
> I think it would be better to initialize next_run_time and change the last 
> else condition to "elif task.period".
>

How did you get task.period == 0?

I'm wondering if this is a valid use-case; the scheduler has quite a test 
suite.

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/bb3962dc-6e9f-4d9b-8689-20a7e47cec54n%40googlegroups.com.


[web2py] Next 100 broken in appadmin queries?

2022-08-19 Thread Dave S
Is it just me, or has the "next 100" button (and the "previous 100" button) 
stopped working in 2.22.3?   When I try to use them, I get a form error 
with Query showing blank and the message "Cannot be empty".

URL: http://192.168.4.21:8008/QuarterMaster/appadmin/select/db?start=100
Query on the previous page (the start=0 page):  "db.QuarterMaster.id>0"

This seems pretty serious to me.

Dave S
/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/92ced4bd-98be-4d5f-b865-305efce55b70n%40googlegroups.com.