SliTaz SliTaz Forum

#1 2014-08-22 13:41:57

lexeii
Administrator
Inscrit(e): 2012-03-21
Messages: 1 853

tramys — TRAnslate MY SliTaz

dialog-warning.png Warning!

This topic describes the development of a tramys application. Things change very quickly, so the first post is no longer relevant. To download the latest version of the client, use the following page: http://cook.slitaz.org/cooker.cgi?pkg=tramys-client

Hi dear friends!

I want to present you my new script tramys2.

Now you can translate your whole SliTaz to your native language in a few easy steps.

 

How to install

I not prepared package yet, and right now you can install it this way:

[c]su
(blind type root password here)

wget -O /usr/bin/tramys2 http://people.slitaz.org/~lexeii/tramys/tramys2

chmod a+x /usr/bin/tramys2[/c]
 

Preconditioning

Check your locale setting using command in terminal:

[c]printenv LANG[/c]

Change it if you need using Applications menu → Preferences → System language

Check your internet connection. You'll get nothing without working internet connection.

 

How to use

Note, you should be root to modify/install system files:

[c]su
(blind type root password here)

tramys2[/c]
 

What it costs

I have about 700 packages installed on my SliTaz desktop.

It costs in time about 20 seconds of waiting, then about 3 seconds of downloading file.

It costs in traffic about 2.5 MB (note my ~700 packages).

 

How to hack

You'll find tramys's files here: http://people.slitaz.org/~lexeii/tramys/

See also previous version here: http://hg.slitaz.org/wok/file/tip/tramys

 

Happy translating! big_smile

Leave your notes, comments and wishes here.

Hors ligne

#2 2014-08-22 23:20:11

Sidini
Membre
Inscrit(e): 2014-05-19
Messages: 72

Re: tramys — TRAnslate MY SliTaz

Very nice initiative!

It will help more people to use Slitaz in their native language.

If you could pack (.tazpkg) it, it'll be more practical for most users. (Yeah, I'm a bit lazy... hehehe)

Thanks Aleksej!

Hors ligne

#3 2014-08-23 13:31:22

necrophcodr
Membre
Inscrit(e): 2014-02-20
Messages: 101

Re: tramys — TRAnslate MY SliTaz

-deleted-

Yeah, why not post a release directly?

Hors ligne

#4 2014-08-23 13:45:22

necrophcodr
Membre
Inscrit(e): 2014-02-20
Messages: 101

Re: tramys — TRAnslate MY SliTaz

It also appears that the download contains nothing. When downloading the tramys.tgz file, unpacking it results in no content being extracted, and the download itself is listed as being 85 bytes.

Hors ligne

#5 2014-08-23 13:50:05

Ceel
Administrator
Inscrit(e): 2011-04-02
Messages: 1 423

Re: tramys — TRAnslate MY SliTaz

Well done Aleksej!

You should stick your post on the home page of the forum or in a few month it'll be lost in its depths.

Hors ligne

#6 2014-08-23 19:56:03

lexeii
Administrator
Inscrit(e): 2012-03-21
Messages: 1 853

Re: tramys — TRAnslate MY SliTaz

Hi guys,

Thanks for your comments!

First release coming soon.

Just I need to implement more features and to write nice GUI for it.

necrophcodr,

Analyzing server logs I see 8 attempts from your IP address, first and last using web browser. Other using busybox's wget.

Strange thing is why server does not receive list of your packages.

Maybe you are using old and uncompatible version of wget? Can you report it, please?

Here output from busybox wget --help from my current SliTaz rolling:

[c]Command line: busybox wget --help

BusyBox v1.22.1 (2014-08-20 16:03:24 Europe) multi-call binary.

Usage: wget [-c|--continue] [-s|--spider] [-q|--quiet] [-O|--output-document FILE]
    [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]
    [-U|--user-agent AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

    -s    Spider mode - only check file existence
    -c    Continue retrieval of aborted transfer
    -q    Quiet
    -P DIR    Save to DIR (default .)
    -T SEC    Network read timeout is SEC seconds
    -O FILE    Save to FILE ('-' for stdout)
    -U STR    Use STR for User-Agent header
    -Y    Use proxy ('on' or 'off')[/c]

And here from my dusty SliTaz 4.0:

[c]Command line: busybox wget --help

BusyBox v1.18.4 (2012-03-14 03:32:25 CET) multi-call binary.

Usage: wget [-c|--continue] [-s|--spider] [-q|--quiet] [-O|--output-document FILE]
    [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]
    [--no-check-certificate] [-U|--user-agent AGENT][-T SEC]  URL

Retrieve files via HTTP or FTP

Options:
    -s    Spider mode - only check file existence
    -c    Continue retrieval of aborted transfer
    -q    Quiet
    -P DIR    Save to DIR (default .)
    -T SEC    Network read timeout is SEC seconds
    -O FILE    Save to FILE ('-' for stdout)
    -U STR    Use STR for User-Agent header
    -Y    Use proxy ('on' or 'off')[/c]

I gave up to transfer packages list to server using HTTP headers because only short headers are supported. And I found nothing to make HTTP POST in the busybox. And here a trick: I transfer list using the UserAgent string (-U option). It can be so large to contain full list of packages, and we do not need to care about encoding/decoding some symbols like "+" in the "gtk+" to some other forms.

Here a question, necrophcodr, do your wget supports "-U" option?

Hors ligne

#7 2014-08-24 16:21:11

necrophcodr
Membre
Inscrit(e): 2014-02-20
Messages: 101

Re: tramys — TRAnslate MY SliTaz

@Aleksej my version of wget is the same as yours, however the issue pending is that I do not wish to transfer a list of all my installed packages to the server. Hence, I attempted to download the file straight away.

It didn't work though, as you might imagine.

But why not release the new software as a tazpkg? Or at least as a receipt? What keeps you from doing just that?

Hors ligne

#8 2014-08-24 20:42:28

lexeii
Administrator
Inscrit(e): 2012-03-21
Messages: 1 853

Re: tramys — TRAnslate MY SliTaz

necrophcodr,

OK, I've understand you. Do you think, is it a security issue to give server your package list? I'm not joke.

Do I need a little note "Your package list will be transferred to SliTaz server."?

You can use tramys version 1 which not sended list to server.

And now... Release! For all big_smile

Yes, it works for me. Tested right now.

http://cook.slitaz.org/cooker.cgi?pkg=tramys-client

Download using Download link, then install as you like (using terminal or GUI double click downloaded file).

After some time (really I don't know) you'll find package in the SliTaz repo using command [c]# tazpkg recharge[/c] (not now).

It designed to work in the SliTaz 4.0/stable too.

After package installing you'll find "tramys" icon in the Application menu → Preferences. Yes, here is a GUI now.

Request for comments.

Hors ligne

#9 2014-08-24 21:01:54

necrophcodr
Membre
Inscrit(e): 2014-02-20
Messages: 101

Re: tramys — TRAnslate MY SliTaz

@Aleksej

I do think it could possibly be a security issue, but more so a privacy issue. Users should not need to inform any server of their packages, unless given consent to.

Furthermore, would it be possible to avoid installing the above client and run the GUI script as a user?

Hors ligne

#10 2014-08-24 23:18:43

lexeii
Administrator
Inscrit(e): 2012-03-21
Messages: 1 853

Re: tramys — TRAnslate MY SliTaz

necrophcodr,

As far as I understand, this script does not reduces the level of user privacy.

As you know all server access are logging. And there somewhere in the server's access log is written that you (someone from your IP address) downloaded a few packages...

When you using first version of tramys, it just downloads few specified files. And it logged too. Someone who have access to server logs and who knows your IP will know your locale (because you download specific files) and (reduced) list of your packages (only that which has translations for your locale).

I think you understand that I don't need any information from users, and I don't collect this information and don't track SliTaz users.

As for GUI. No. This GUI is for client-server architecture in tramys2 only.

You can use tramys (not tramys2) in your console using command

[c]tramys -g[/c]
You can get help using command:

[c]tramys -h[/c]
Or you can download any files using FTP connection in the Midnight Commander using address ftp://cook.slitaz.org/

But you should understand that “every your step” is logged on server.

Any suggestions?

Hors ligne

#11 2014-08-25 12:01:04

lexeii
Administrator
Inscrit(e): 2012-03-21
Messages: 1 853

Re: tramys — TRAnslate MY SliTaz

I have an idea, and need some time to implement it.

What server logs? User's IP address, HTTP request with GET variables, User Agent. And I not sure about timestamp logs or no. Possibly yes.

As you may know, two main HTTP protocols are GET and POST. If we post our request to server using HTTP POST, it will not logs. I mean that we still can see in the access log: IP, UA, but base URL without details about locale and packages list. Good. Seems it's better solution.

Problem is in busybox. I see no tool inside busybox to make HTTP POST.

GNU wget can send POST data, but I not want to add any extra depends to base system.

Maybe anyone have an idea how to do POST in the SliTaz base environment?

Right now I have another idea. It is a trick too, but it may solve issue with server logs and privacy.

Reading sources:

http://git.busybox.net/busybox/tree/networking/httpd.c#n1365

I've found that I can use only several HTTP headers where I can store request:

HTTP_USER_AGENT, HTTP_ACCEPT, HTTP_ACCEPT_LANGUAGE, HTTP_COOKIE, CONTENT_TYPE and HTTP_REFERER.

I think it's not bad to use HTTP_ACCEPT_LANGUAGE to store locale, and use HTTP_COOKIE to store packages list.

Any suggestions?

Hors ligne

#12 2014-08-25 16:14:10

necrophcodr
Membre
Inscrit(e): 2014-02-20
Messages: 101

Re: tramys — TRAnslate MY SliTaz

Well, for POSTing, you can read the TinyCM code and see that there is already POST possible on the server side, with no issues at all.

However, on the client side, I am not sure how well it would work with wget. cURL supports POSTing data though, but I am not sure if this is installed with a base install of SliTaz, possibly not.

In that case it would not be possible to use POST I suppose,but it is good to see that SliTaz does not do any kind of tracking. It is best avoided, and serves no greater use for the user base, nor the developers.

Hors ligne

#13 2014-08-25 16:21:48

mscythe
Membre
Inscrit(e): 2012-02-24
Messages: 76

Re: tramys — TRAnslate MY SliTaz

Yes, use curl: http://cook.slitaz.org/cooker.cgi?pkg=curl

Post Example: [c]curl http://127.0.0.1:8081 -XPOST -H 'Accept: application/json' -d 'user=me&message=hello'[/c]

Hors ligne

#14 2014-08-25 23:16:19

lexeii
Administrator
Inscrit(e): 2012-03-21
Messages: 1 853

Re: tramys — TRAnslate MY SliTaz

mscythe,

Thank you for examples.

Curl is my favorite networking tool big_smile I have written several programs using it. Referers, post, get, cookies... It can do everything... But there is a situation that SliTaz not uses cURL "out of the box". And I think that would be overkill to install cURL for my little tool.

necrophcodr,

I really can not figure out whether you're talking about serious and deliberate, or just kidding?

What are you talking about?

Yes, trimmed wget from Busybox can not do POST. But it does not mean absolutely nothing.

Now you write a message on this forum in the browser. You press the button "Send Post" and, of course, it is sent by the browser to the SliTaz server using the HTTP POST method. Can not you guess? Does the using this method of browsers says about whether tracking users? Complete crap. The point is not to POST... I have doubts, do you know actually, what came up with the POST method? If not, do not worry. Just do not need to make far-reaching conclusions without understanding.

And do not you know that all servers are maintained logs? SliTaz servers are no exception. If you go on the forum, if you are downloading the packages - it's all you can see in the logs. Will I advise you that you have not used SliTaz distro and SliTaz servers? No, I will not. I think that the mind still win. And paranoia will go away.

it is good to see that SliTaz does not do any kind of tracking.

Sources of all our developments you'll always find at hg.slitaz.org. We are open. Believe me, there are a lot of interesting things other than keep track of which packages are installed by the user. And as usual, you are free to use or not to use my script.

Oh, wait! A little announcement for those who do not understand our dialogue.

I have not written a tool for tracking users big_smile And believe me, that is a serious insult to me sad

I wrote a tool that allows user in a few mouse clicks, without hesitation, to translate all of the SliTaz programs onto your native language, be it Polish, German, Belarusian or Afrikaans...

I'll be happy to continue to use this program. You do as you wish.

Hors ligne

#15 2014-08-25 23:25:08

Sidini
Membre
Inscrit(e): 2014-05-19
Messages: 72

Re: tramys — TRAnslate MY SliTaz

Hi Aleksej!

I tested your script at Slitaz 5.0 RC2 (LiveCD), and it works well here! Thanks!

One suggestion: in case you have free-time enough, why don't you write a Guide at Doc section, explaining users on how to use tramys? As Ceel said above, here in Forum your post will "disapear" in a few months.

Have a nice day!

Hors ligne

#16 2014-08-26 03:28:24

mscythe
Membre
Inscrit(e): 2012-02-24
Messages: 76

Re: tramys — TRAnslate MY SliTaz

Hey Aleksej,

I didn't notice the part you said that don't want any additional dependencies, so your idea to use the HTTP variables is a good option.

I tried to run tramys2 in a fresh version of Slitaz 5.0-RC2 using VirtualBox.

[c]printenv LANG[/c] gives me [c]POSIX[/c], even after change it in Preferences->System Language. So, I setted LANG manually using [c]export[/c].

When I try to open tramys2 it gives me:

[c]Connecting to cook.slitaz.org (**IP HERE**)
tar: invalid magic
tar: short read
cp: can't stat '/tmp/tmp.gUSdkW/*': No such file or directory[/c]
Any tips?

Edit: [c]export[/c] is not changing [c]printenv LANG[/c] result

Hors ligne

#17 2014-08-26 09:59:10

lexeii
Administrator
Inscrit(e): 2012-03-21
Messages: 1 853

Re: tramys — TRAnslate MY SliTaz

Hi Yuri,

Oh really. I now changed my locale using Applications menu → Preferences → System Language.

I have not found reports that after changing the locale you need to log off and log in again.

Really need to add this notice.

Please, report is it helps you in your VirtualBox installation (I'm lazy to do such a things).

Test /etc/locale.conf content:

[c]cat /etc/locale.conf[/c]
Test LANG environment variable again:

[c]printenv LANG[/c]
If your installation type is Live / Frugal then you need to add locale (and keyboard) settings to the kernel line in the bootloader. Something like this:

kernel (hd0,0)/boot/vmlinuz-3.2.53-slitaz rw root=/dev/null lang=pt_BR kmap=br-abnt2

(See http://doc.slitaz.org/pt:handbook:livecd#opcoeslang-xx-e-kmap-xx )

---

Now I'm almost finished the new version (that uses HTTP headers only). And found a new issue. Files that the program downloads and installs on your system, do not belong to any package! They can not belong to a tramys package (because you can upgrade this package). It would be better if I create a virtual package tramys-data. In the future, if you wish you can remove the package tramys-data and all translation files (downloaded before) will removed.

---

PS. Anyway, at any time you can run tramys2 with specified locale like this:

[c]LANG=pt_BR tramys2[/c]

Hors ligne

#18 2014-08-26 10:49:57

lexeii
Administrator
Inscrit(e): 2012-03-21
Messages: 1 853

Re: tramys — TRAnslate MY SliTaz

An important message for all!

Have been developed and successfully tested a new version of the client and server parts of tramys2.

The new version of tramys2-server is installed on the SliTaz server. It will not work anymore with an old client. So, please, upgrade your client up to the current version:

Here: http://cook.slitaz.org/cooker.cgi?pkg=tramys-client

Click download link, save file, double click file to install this new package.

---

Please note that currently tramys system working, but it still at the edge of development. So be prepared to follow me in the future. I'll release new changes (virtual package "tramys-data" creation) tomorrow, possibly.

---

For all who interesting in hacking (in the best, original sense of this word) and reading sources.

You are strongly invited! smile

http://hg.slitaz.org/wok/file/tip/tramys-client/

http://hg.slitaz.org/wok/file/tip/tramys-server/

Hors ligne

#19 2014-08-26 18:28:35

mscythe
Membre
Inscrit(e): 2012-02-24
Messages: 76

Re: tramys — TRAnslate MY SliTaz

@Aleksej,

In Live install of [c]Slitaz 5.0[/c], the kernel language parameters are already appended (LANG is right, before install).

In Full installation:

Logout fix the LANG problem, now [c]printenv LANG[/c] shows the right language.

[c]less /etc/locale.conf:
LANG=pt_BR
LC_ALL=pt_BR[/c]
But even after login/logout I still get the [c]magic[/c] problem.

[c]tar: invalid magic
tar: short read
cp: can't stat '/tmp/tmp.auXb8p/*': No such file or directory[/c]

Hors ligne

#20 2014-08-26 20:30:52

lexeii
Administrator
Inscrit(e): 2012-03-21
Messages: 1 853

Re: tramys — TRAnslate MY SliTaz

Hi Yuri,

Good, you're on a right way.

I think "short read" means that your archive is empty (zero bytes length).

So it seems (as for me) that you forgot to update your client (please, read my previous post).

Maybe I not right and it's something related tgz archive unpacking in the clean SliTaz installation, I not checked it, sorry.

Hors ligne

#21 2014-08-27 04:02:41

mscythe
Membre
Inscrit(e): 2012-02-24
Messages: 76

Re: tramys — TRAnslate MY SliTaz

Thanks, updating tramys-client solved my magic problem.

In tramys2 I could not [c]edit[/c] the language.

If I try to edit, I select the language then a new window appears with [c]Locale set to **[/c] and suddenly closes.

Otherwise, if I press [c]OK[/c] at the first time everything works fine (It works with LANG=pt_BR command too).

Sorry if I miss some post but I could not find the downloaded files.

Hors ligne

#22 2014-09-19 23:20:25

lexeii
Administrator
Inscrit(e): 2012-03-21
Messages: 1 853

Re: tramys — TRAnslate MY SliTaz

Hi all!

Here a few words about current state of tramys project.

Recently I set up a web interface for those who have no internet connection in their SliTaz.

An idea is you can visit your friend, download all you need, then transfer it using USB flash or CD-RW to your SliTaz, and then install these packages with simple mouse double click. Or you can use your smartphone!

Currently existing web interface is far from finish. But it contains some interesting things, that I wish to share with you.

Day / night themes. It is dark when night, and bright at day. And you can change theme by clicking to Sun icon.

It displays page on your language (oh, really I need translators for this project — currently only default English, and Russian and Ukrainian are supported).

You can change language of interface using languages menu (click on "Language Icon" in the second row).

It displays SliTaz links at top row on a large displays and displays menu button on a tiny screens. You can play with width of your browser screen.

You can search within 280 supported locales. And AJAX is used on a page — page displays search results smoothly without reloading. Now you can use English (or Russian with Russian interface) to search locale which belongs to your language or country. You can type only 2-3 letters from beginning of language or country name.

And finally you can download your locale package! big_smile

Development of this interface was very interesting for me, and I spend all my free time for it. And I read many interesting things on a Stack Overflow and other sites. And touch an Android bug that lasts for five years not fixed!..

I tested tramys web interface in few browsers: Qupzilla (best), TazWeb (significant problems with file saving) on desktop; and on Android: stock web browser in 4.1.2, SlimBoat (best), and Opera Classic (few strange things but not bad at all).

Please, visit http://cook.slitaz.org/tramys2.cgi

Leave your comments.

And there is code for those who interested: http://people.slitaz.org/~lexeii/tramys2/

Hors ligne

#23 2014-09-20 00:14:35

claudinei
Administrator
Inscrit(e): 2011-03-29
Messages: 102

Re: tramys — TRAnslate MY SliTaz

Hi Aleksej,

Here a quick first translation for the pt.po (attached). What about adding tramys to the slitaz-tools repo?

Hors ligne

#24 2014-09-20 19:35:05

lexeii
Administrator
Inscrit(e): 2012-03-21
Messages: 1 853

Re: tramys — TRAnslate MY SliTaz

Hi Claudinei,

Thank you for translation. You can see it in the tramys web service now.

I plan to add more texts in the future.

How do you think? Do I need to add current code to the SliTaz repo?

I develop tramys alone on my home web server (yes, my local developer copy is in the /var/www/tramys2 folder). There is too many changes almost every day. I can put the code to repo right now for collaborative work. And I planned to do it when no one "Under construction" message leaves on the web page.

Note, I not hide my code. But, really, at the moment it is under big big construction smile

Hors ligne

Utilisateurs enregistrés en ligne dans ce sujet: 0, Invité(s): 1
[Bot] ClaudeBot

Pied de page

Propulsé par FluxBB
Modifié par Visman Traduit par N-Studio18

[ Généré en 0.019 secondes, 7 requêtes exécutées - Utilisation de la mémoire: 1.6 MiO (Pic : 1.77 MiO) ]