diff mbox series

send-error-report: Use https instead of http protocol

Message ID 20190204181314.22496-1-raj.khem@gmail.com
State Accepted
Commit f540fed0aec24e28eff8522fddbe3cf7ee45e30b
Headers show
Series send-error-report: Use https instead of http protocol | expand

Commit Message

Khem Raj Feb. 4, 2019, 6:13 p.m. UTC
errors.yp.org can understand https

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 scripts/send-error-report | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.20.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Robert Yang March 4, 2019, 7:50 a.m. UTC | #1
Hi Khem,

We have an internal error web server, this patch breaks it:

You're accessing the development server over HTTPS, but it only supports HTTP

So I tried to use runsslserver, but it doesn't work either since the host is
Ubuntu 14.04 (python 2.7.6):

$ python manage.py runsslserver

[snip]
     ssl_version=ssl.PROTOCOL_TLSv1_2,
AttributeError: 'module' object has no attribute 'PROTOCOL_TLSv1_2'

This is because python is old.

I think that make it default to https would make the server harder to set up,
so is it possible to:

* Make it default to http, and add an option such as --https (or --ssl) for https

Or:

* Add an option such as --no-ssl to make it use http.

I prefer the first one since https server is harder to setup than http in 
django. I can work on it if no objections.

// Robert

On 2/5/19 2:13 AM, Khem Raj wrote:
> errors.yp.org can understand https

> 

> Signed-off-by: Khem Raj <raj.khem@gmail.com>

> ---

>   scripts/send-error-report | 6 +++---

>   1 file changed, 3 insertions(+), 3 deletions(-)

> 

> diff --git a/scripts/send-error-report b/scripts/send-error-report

> index 8939f5f594..3528cf93a9 100755

> --- a/scripts/send-error-report

> +++ b/scripts/send-error-report

> @@ -62,7 +62,7 @@ def edit_content(json_file_path):

>   

>   def prepare_data(args):

>       # attempt to get the max_log_size from the server's settings

> -    max_log_size = getPayloadLimit("http://"+args.server+"/ClientPost/JSON")

> +    max_log_size = getPayloadLimit("https://"+args.server+"/ClientPost/JSON")

>   

>       if not os.path.isfile(args.error_file):

>           log.error("No data file found.")

> @@ -132,9 +132,9 @@ def send_data(data, args):

>       headers={'Content-type': 'application/json', 'User-Agent': "send-error-report/"+version}

>   

>       if args.json:

> -        url = "http://"+args.server+"/ClientPost/JSON/"

> +        url = "https://"+args.server+"/ClientPost/JSON/"

>       else:

> -        url = "http://"+args.server+"/ClientPost/"

> +        url = "https://"+args.server+"/ClientPost/"

>   

>       req = urllib.request.Request(url, data=data, headers=headers)

>       try:

> 

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Richard Purdie March 4, 2019, 9:23 a.m. UTC | #2
On Mon, 2019-03-04 at 15:50 +0800, Robert Yang wrote:
> Hi Khem,

> 

> We have an internal error web server, this patch breaks it:

> 

> You're accessing the development server over HTTPS, but it only

> supports HTTP

> 

> So I tried to use runsslserver, but it doesn't work either since the

> host is

> Ubuntu 14.04 (python 2.7.6):

> 

> $ python manage.py runsslserver

> 

> [snip]

>      ssl_version=ssl.PROTOCOL_TLSv1_2,

> AttributeError: 'module' object has no attribute 'PROTOCOL_TLSv1_2'

> 

> This is because python is old.

> 

> I think that make it default to https would make the server harder to

> set up,

> so is it possible to:

> 

> * Make it default to http, and add an option such as --https (or --

> ssl) for https

> 

> Or:

> 

> * Add an option such as --no-ssl to make it use http.

> 

> I prefer the first one since https server is harder to setup than

> http in django. I can work on it if no objections.


At this point the project does require python3 so python2 being old
shouldn't be a reason to be changing this.

The project also needs to be seen to encourage secure practises so I
think https should be the default but adding an option to use http
should be ok.

Cheers,

Richard



-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Robert Yang March 4, 2019, 10:02 a.m. UTC | #3
Hi RP,

On 3/4/19 5:23 PM, Richard Purdie wrote:
> On Mon, 2019-03-04 at 15:50 +0800, Robert Yang wrote:

>> Hi Khem,

>>

>> We have an internal error web server, this patch breaks it:

>>

>> You're accessing the development server over HTTPS, but it only

>> supports HTTP

>>

>> So I tried to use runsslserver, but it doesn't work either since the

>> host is

>> Ubuntu 14.04 (python 2.7.6):

>>

>> $ python manage.py runsslserver

>>

>> [snip]

>>       ssl_version=ssl.PROTOCOL_TLSv1_2,

>> AttributeError: 'module' object has no attribute 'PROTOCOL_TLSv1_2'

>>

>> This is because python is old.

>>

>> I think that make it default to https would make the server harder to

>> set up,

>> so is it possible to:

>>

>> * Make it default to http, and add an option such as --https (or --

>> ssl) for https

>>

>> Or:

>>

>> * Add an option such as --no-ssl to make it use http.

>>

>> I prefer the first one since https server is harder to setup than

>> http in django. I can work on it if no objections.

> 

> At this point the project does require python3 so python2 being old

> shouldn't be a reason to be changing this.


The python3 + error-report-web doesn't work for me:

$ python3 manage.py runserver ip:8000

And when I tried to access http://128.224.156.132:8000, it raised errors:

error-report-web/Post/views.py", line 16, in <module>
     from parser import Parser
ImportError: cannot import name 'Parser'

So I use python 2 for it. I thought that it didn't support python3, or didn't
test well.

> 

> The project also needs to be seen to encourage secure practises so I

> think https should be the default but adding an option to use http

> should be ok.


Thanks, I will send a patch for it.

// Robert

> 

> Cheers,

> 

> Richard

> 

> 

> 

> 

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Richard Purdie March 4, 2019, 10:26 a.m. UTC | #4
On Mon, 2019-03-04 at 18:02 +0800, Robert Yang wrote:
> Hi RP,

> 

> On 3/4/19 5:23 PM, Richard Purdie wrote:

> > On Mon, 2019-03-04 at 15:50 +0800, Robert Yang wrote:

> > > Hi Khem,

> > > 

> > > We have an internal error web server, this patch breaks it:

> > > 

> > > You're accessing the development server over HTTPS, but it only

> > > supports HTTP

> > > 

> > > So I tried to use runsslserver, but it doesn't work either since

> > > the

> > > host is

> > > Ubuntu 14.04 (python 2.7.6):

> > > 

> > > $ python manage.py runsslserver

> > > 

> > > [snip]

> > >       ssl_version=ssl.PROTOCOL_TLSv1_2,

> > > AttributeError: 'module' object has no attribute

> > > 'PROTOCOL_TLSv1_2'

> > > 

> > > This is because python is old.

> > > 

> > > I think that make it default to https would make the server

> > > harder to

> > > set up,

> > > so is it possible to:

> > > 

> > > * Make it default to http, and add an option such as --https (or

> > > --

> > > ssl) for https

> > > 

> > > Or:

> > > 

> > > * Add an option such as --no-ssl to make it use http.

> > > 

> > > I prefer the first one since https server is harder to setup than

> > > http in django. I can work on it if no objections.

> > 

> > At this point the project does require python3 so python2 being old

> > shouldn't be a reason to be changing this.

> 

> The python3 + error-report-web doesn't work for me:

> 

> $ python3 manage.py runserver ip:8000

> 

> And when I tried to access http://128.224.156.132:8000, it raised

> errors:

> 

> error-report-web/Post/views.py", line 16, in <module>

>      from parser import Parser

> ImportError: cannot import name 'Parser'

> 

> So I use python 2 for it. I thought that it didn't support python3,

> or didn't

> test well.


Fixing it to work with python3 would be the preferred option...

Cheers,

Richard

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Robert Yang March 4, 2019, 10:33 a.m. UTC | #5
On 3/4/19 6:26 PM, Richard Purdie wrote:
> On Mon, 2019-03-04 at 18:02 +0800, Robert Yang wrote:

>> Hi RP,

>>

>> On 3/4/19 5:23 PM, Richard Purdie wrote:

>>> On Mon, 2019-03-04 at 15:50 +0800, Robert Yang wrote:

>>>> Hi Khem,

>>>>

>>>> We have an internal error web server, this patch breaks it:

>>>>

>>>> You're accessing the development server over HTTPS, but it only

>>>> supports HTTP

>>>>

>>>> So I tried to use runsslserver, but it doesn't work either since

>>>> the

>>>> host is

>>>> Ubuntu 14.04 (python 2.7.6):

>>>>

>>>> $ python manage.py runsslserver

>>>>

>>>> [snip]

>>>>        ssl_version=ssl.PROTOCOL_TLSv1_2,

>>>> AttributeError: 'module' object has no attribute

>>>> 'PROTOCOL_TLSv1_2'

>>>>

>>>> This is because python is old.

>>>>

>>>> I think that make it default to https would make the server

>>>> harder to

>>>> set up,

>>>> so is it possible to:

>>>>

>>>> * Make it default to http, and add an option such as --https (or

>>>> --

>>>> ssl) for https

>>>>

>>>> Or:

>>>>

>>>> * Add an option such as --no-ssl to make it use http.

>>>>

>>>> I prefer the first one since https server is harder to setup than

>>>> http in django. I can work on it if no objections.

>>>

>>> At this point the project does require python3 so python2 being old

>>> shouldn't be a reason to be changing this.

>>

>> The python3 + error-report-web doesn't work for me:

>>

>> $ python3 manage.py runserver ip:8000

>>

>> And when I tried to access http://128.224.156.132:8000, it raised

>> errors:

>>

>> error-report-web/Post/views.py", line 16, in <module>

>>       from parser import Parser

>> ImportError: cannot import name 'Parser'

>>

>> So I use python 2 for it. I thought that it didn't support python3,

>> or didn't

>> test well.

> 

> Fixing it to work with python3 would be the preferred option...


Sounds good, I will work on it.

// Robert

> 

> Cheers,

> 

> Richard

> 

> 

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Robert Yang March 5, 2019, 8:54 a.m. UTC | #6
Hi RP,

I've sent a patch to fix for python3:

https://lists.yoctoproject.org/pipermail/yocto/2019-March/044387.html

And CC-ed michael.g.wood@intel.com, I assumed that he is the maintainer,
but seems that the email is not valid any more.

I think that we have more work to do with error report web, e.g.:
- The 'Similar' tag on the web isn't correct, it doesn't calculate correctly

- Sometimes, there is an error like:
   File "/buildarea/lyang1/error-report-web/Post/parser.py", line 101, in parse
     num_similar_errors = f.get_similar_fails_count()
UnboundLocalError: local variable 'f' referenced before assignment

- We can make report-error.bbclass to catch more errors such as NoProvider
   errors, Parse errors, and so on.

I'd like to maintain it if it has no maintainers.

// Robert

On 3/4/19 6:33 PM, Robert Yang wrote:
> 
> 
> On 3/4/19 6:26 PM, Richard Purdie wrote:
>> On Mon, 2019-03-04 at 18:02 +0800, Robert Yang wrote:
>>> Hi RP,
>>>
>>> On 3/4/19 5:23 PM, Richard Purdie wrote:
>>>> On Mon, 2019-03-04 at 15:50 +0800, Robert Yang wrote:
>>>>> Hi Khem,
>>>>>
>>>>> We have an internal error web server, this patch breaks it:
>>>>>
>>>>> You're accessing the development server over HTTPS, but it only
>>>>> supports HTTP
>>>>>
>>>>> So I tried to use runsslserver, but it doesn't work either since
>>>>> the
>>>>> host is
>>>>> Ubuntu 14.04 (python 2.7.6):
>>>>>
>>>>> $ python manage.py runsslserver
>>>>>
>>>>> [snip]
>>>>>        ssl_version=ssl.PROTOCOL_TLSv1_2,
>>>>> AttributeError: 'module' object has no attribute
>>>>> 'PROTOCOL_TLSv1_2'
>>>>>
>>>>> This is because python is old.
>>>>>
>>>>> I think that make it default to https would make the server
>>>>> harder to
>>>>> set up,
>>>>> so is it possible to:
>>>>>
>>>>> * Make it default to http, and add an option such as --https (or
>>>>> -- 
>>>>> ssl) for https
>>>>>
>>>>> Or:
>>>>>
>>>>> * Add an option such as --no-ssl to make it use http.
>>>>>
>>>>> I prefer the first one since https server is harder to setup than
>>>>> http in django. I can work on it if no objections.
>>>>
>>>> At this point the project does require python3 so python2 being old
>>>> shouldn't be a reason to be changing this.
>>>
>>> The python3 + error-report-web doesn't work for me:
>>>
>>> $ python3 manage.py runserver ip:8000
>>>
>>> And when I tried to access http://128.224.156.132:8000, it raised
>>> errors:
>>>
>>> error-report-web/Post/views.py", line 16, in <module>
>>>       from parser import Parser
>>> ImportError: cannot import name 'Parser'
>>>
>>> So I use python 2 for it. I thought that it didn't support python3,
>>> or didn't
>>> test well.
>>
>> Fixing it to work with python3 would be the preferred option...
> 
> Sounds good, I will work on it.
> 
> // Robert
> 
>>
>> Cheers,
>>
>> Richard
>>
>>
diff mbox series

Patch

diff --git a/scripts/send-error-report b/scripts/send-error-report
index 8939f5f594..3528cf93a9 100755
--- a/scripts/send-error-report
+++ b/scripts/send-error-report
@@ -62,7 +62,7 @@  def edit_content(json_file_path):
 
 def prepare_data(args):
     # attempt to get the max_log_size from the server's settings
-    max_log_size = getPayloadLimit("http://"+args.server+"/ClientPost/JSON")
+    max_log_size = getPayloadLimit("https://"+args.server+"/ClientPost/JSON")
 
     if not os.path.isfile(args.error_file):
         log.error("No data file found.")
@@ -132,9 +132,9 @@  def send_data(data, args):
     headers={'Content-type': 'application/json', 'User-Agent': "send-error-report/"+version}
 
     if args.json:
-        url = "http://"+args.server+"/ClientPost/JSON/"
+        url = "https://"+args.server+"/ClientPost/JSON/"
     else:
-        url = "http://"+args.server+"/ClientPost/"
+        url = "https://"+args.server+"/ClientPost/"
 
     req = urllib.request.Request(url, data=data, headers=headers)
     try: