Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Rebagliati committed Jun 6, 2021
1 parent 1591098 commit a2a0a80
Showing 1 changed file with 86 additions and 43 deletions.
129 changes: 86 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,114 +58,157 @@ Now with the traffic redirected to localhost and the certificate installed you a
sudo ./app.py
```

If every thins is ok you will see this when the app connects and download the files
You have some options
```
Options:
-h, --host TEXT Listen host [default: 0.0.0.0]
-p, --port INTEGER Listen port [default: 443]
--cert PATH Certificate File [default: ssl/cert.pem]
--key PATH Key File [default: ssl/key.pem]
--static-xml Serve static XML
--debug Debug mode
--help Show this message and exit.
```

### XML options

You have two options, by default when you run the server it will download all the xml from the TC Electronic server.
Then it will apply a patch to enable the edit mode, and will serve that xml.

Or you can serve your own modified xml with the parameter ```--static-xml```.

The only problem with patch the xml in real time is because you need to add ```tp.tcelectronic.com``` to the hosts file it will not be able to connect to it.

That its why I added a docker file, because in that way you can use different dns in the container (or run the server in a VM).

### Use it with docker

***Build***
```
docker build -t toneprint --rm .
or
docker-compose build
```

***Run***
```
docker run --rm --dns=8.8.8.8 -p 443:443 --name toneprint toneprint
```

Or if you want to serve the static XML and try things (you don't need to use the ```--dns``` option this way)

```
docker run --rm -p 443:443 -v $(pwd)/src/xml:/app/xml --name toneprint toneprint --static-xml
```

Keep in mind that no matter if you use the static xml or the patched online, the reponse is cached.

So if you modify the xml by hand you will need to restart it.


If every thing is ok you will see this when the app connects and download the files

```
--------------------------------
Headers: Host: tp.tcelectronic.com
-2021-06-06 21:37:54,583 - __main__ - INFO - --------------------------------------
2021-06-06 21:37:54,583 - __main__ - INFO - Request for Action:GetVersionsAndInfo
2021-06-06 21:37:54,583 - __main__ - DEBUG - Headers: Host: tp.tcelectronic.com
Content-Type: text/xml; charset=utf-8
Connection: keep-alive
Soapaction: "http://tempuri.org/ITonePrintService/GetVersionsAndInfo"
Accept: */*
Accept-Language: es-xl
Accept-Language: es-es
Content-Length: 176
Accept-Encoding: br, gzip, deflate
User-Agent: TonePrint/4.2.0 CFNetwork/902.6 Darwin/17.7.0 (x86_64)
Action: GetVersionsAndInfo
File: xml/GetVersionsAndInfoResponse.xml for action: GetVersionsAndInfo
127.0.0.1 - - [06/Jun/2021 12:24:33] "POST /TonePrintService.svc HTTP/1.1" 200 -
--------------------------------
Headers: Host: tp.tcelectronic.com
2021-06-06 21:37:54,584 - werkzeug - INFO - 172.17.0.1 - - [06/Jun/2021 21:37:54] "POST /TonePrintService.svc HTTP/1.1" 200 -
2021-06-06 21:37:54,837 - __main__ - INFO - --------------------------------------
2021-06-06 21:37:54,838 - __main__ - INFO - Request for Action:GetAllToneprintsFullBeta
2021-06-06 21:37:54,839 - __main__ - DEBUG - Headers: Host: tp.tcelectronic.com
Content-Type: text/xml; charset=utf-8
Connection: keep-alive
Soapaction: "http://tempuri.org/ITonePrintService/GetAllToneprintsFullBeta"
Accept: */*
Accept-Language: es-xl
Accept-Language: es-es
Content-Length: 212
Accept-Encoding: br, gzip, deflate
User-Agent: TonePrint/4.2.0 CFNetwork/902.6 Darwin/17.7.0 (x86_64)
Action: GetAllToneprintsFullBeta
File: xml/toneprints.xml for action: GetAllToneprintsFullBeta
127.0.0.1 - - [06/Jun/2021 12:24:33] "POST /TonePrintService.svc HTTP/1.1" 200 -
--------------------------------
Headers: Host: tp.tcelectronic.com
2021-06-06 21:37:54,856 - werkzeug - INFO - 172.17.0.1 - - [06/Jun/2021 21:37:54] "POST /TonePrintService.svc HTTP/1.1" 200 -
2021-06-06 21:37:55,704 - __main__ - INFO - --------------------------------------
2021-06-06 21:37:55,705 - __main__ - INFO - Request for Action:GetAllArtistsFullBeta
2021-06-06 21:37:55,706 - __main__ - DEBUG - Headers: Host: tp.tcelectronic.com
Content-Type: text/xml; charset=utf-8
Connection: keep-alive
Soapaction: "http://tempuri.org/ITonePrintService/GetAllArtistsFullBeta"
Accept: */*
Accept-Language: es-xl
Accept-Language: es-es
Content-Length: 206
Accept-Encoding: br, gzip, deflate
User-Agent: TonePrint/4.2.0 CFNetwork/902.6 Darwin/17.7.0 (x86_64)
Action: GetAllArtistsFullBeta
File: xml/artists.xml for action: GetAllArtistsFullBeta
127.0.0.1 - - [06/Jun/2021 12:24:34] "POST /TonePrintService.svc HTTP/1.1" 200 -
--------------------------------
Headers: Host: tp.tcelectronic.com
2021-06-06 21:37:55,707 - werkzeug - INFO - 172.17.0.1 - - [06/Jun/2021 21:37:55] "POST /TonePrintService.svc HTTP/1.1" 200 -
2021-06-06 21:37:55,767 - __main__ - INFO - --------------------------------------
2021-06-06 21:37:55,768 - __main__ - INFO - Request for Action:GetAllProductsFullBeta
2021-06-06 21:37:55,769 - __main__ - DEBUG - Headers: Host: tp.tcelectronic.com
Content-Type: text/xml; charset=utf-8
Connection: keep-alive
Soapaction: "http://tempuri.org/ITonePrintService/GetAllProductsFullBeta"
Accept: */*
Accept-Language: es-xl
Accept-Language: es-es
Content-Length: 208
Accept-Encoding: br, gzip, deflate
User-Agent: TonePrint/4.2.0 CFNetwork/902.6 Darwin/17.7.0 (x86_64)
Action: GetAllProductsFullBeta
File: xml/products.xml for action: GetAllProductsFullBeta
127.0.0.1 - - [06/Jun/2021 12:24:34] "POST /TonePrintService.svc HTTP/1.1" 200 -
--------------------------------
Headers: Host: tp.tcelectronic.com
2021-06-06 21:37:55,771 - werkzeug - INFO - 172.17.0.1 - - [06/Jun/2021 21:37:55] "POST /TonePrintService.svc HTTP/1.1" 200 -
2021-06-06 21:37:55,818 - __main__ - INFO - --------------------------------------
2021-06-06 21:37:55,819 - __main__ - INFO - Request for Action:GetAllEffectsFullBeta
2021-06-06 21:37:55,820 - __main__ - DEBUG - Headers: Host: tp.tcelectronic.com
Content-Type: text/xml; charset=utf-8
Connection: keep-alive
Soapaction: "http://tempuri.org/ITonePrintService/GetAllEffectsFullBeta"
Accept: */*
Accept-Language: es-xl
Accept-Language: es-es
Content-Length: 206
Accept-Encoding: br, gzip, deflate
User-Agent: TonePrint/4.2.0 CFNetwork/902.6 Darwin/17.7.0 (x86_64)
Action: GetAllEffectsFullBeta
File: xml/effects.xml for action: GetAllEffectsFullBeta
127.0.0.1 - - [06/Jun/2021 12:24:34] "POST /TonePrintService.svc HTTP/1.1" 200 -
--------------------------------
Headers: Host: tp.tcelectronic.com
2021-06-06 21:37:55,821 - werkzeug - INFO - 172.17.0.1 - - [06/Jun/2021 21:37:55] "POST /TonePrintService.svc HTTP/1.1" 200 -
2021-06-06 21:37:55,861 - __main__ - INFO - --------------------------------------
2021-06-06 21:37:55,861 - __main__ - INFO - Request for Action:GetAllProductTypesFull
2021-06-06 21:37:55,862 - __main__ - DEBUG - Headers: Host: tp.tcelectronic.com
Content-Type: text/xml; charset=utf-8
Connection: keep-alive
Soapaction: "http://tempuri.org/ITonePrintService/GetAllProductTypesFull"
Accept: */*
Accept-Language: es-xl
Accept-Language: es-es
Content-Length: 208
Accept-Encoding: br, gzip, deflate
User-Agent: TonePrint/4.2.0 CFNetwork/902.6 Darwin/17.7.0 (x86_64)
Action: GetAllProductTypesFull
File: xml/producttypes.xml for action: GetAllProductTypesFull
127.0.0.1 - - [06/Jun/2021 12:24:34] "POST /TonePrintService.svc HTTP/1.1" 200 -
--------------------------------
Headers: Host: tp.tcelectronic.com
2021-06-06 21:37:55,862 - werkzeug - INFO - 172.17.0.1 - - [06/Jun/2021 21:37:55] "POST /TonePrintService.svc HTTP/1.1" 200 -
2021-06-06 21:37:55,901 - __main__ - INFO - --------------------------------------
2021-06-06 21:37:55,901 - __main__ - INFO - Request for Action:GetAllSelectTypes
2021-06-06 21:37:55,902 - __main__ - DEBUG - Headers: Host: tp.tcelectronic.com
Content-Type: text/xml; charset=utf-8
Connection: keep-alive
Soapaction: "http://tempuri.org/ITonePrintService/GetAllSelectTypes"
Accept: */*
Accept-Language: es-xl
Accept-Language: es-es
Content-Length: 198
Accept-Encoding: br, gzip, deflate
User-Agent: TonePrint/4.2.0 CFNetwork/902.6 Darwin/17.7.0 (x86_64)
Action: GetAllSelectTypes
File: xml/selecttypes.xml for action: GetAllSelectTypes
127.0.0.1 - - [06/Jun/2021 12:24:34] "POST /TonePrintService.svc HTTP/1.1" 200 -
2021-06-06 21:37:55,903 - werkzeug - INFO - 172.17.0.1 - - [06/Jun/2021 21:37:55] "POST /TonePrintService.svc HTTP/1.1" 200 -
```

![Example](./media/edit_enabled.jpg)
Expand Down

0 comments on commit a2a0a80

Please sign in to comment.