No more Web-ui access with nightly builds 8074-75

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
super-poussin
Posts: 74
Joined: Sun Mar 15, 2009 8:04 pm

No more Web-ui access with nightly builds 8074-75

Post by super-poussin »

password encryption is used in last nightly build so I think the password must be in encrypted form in settings.json but does any one knows how to encrypt it ?

cause since last build I can no more access webui if rpc-authentication is set to 1
Last edited by super-poussin on Thu Mar 19, 2009 7:48 pm, edited 3 times in total.
livings124
Transmission Developer
Posts: 3142
Joined: Fri Jan 13, 2006 8:08 pm

Re: password encryption

Post by livings124 »

It's already encrypted. ;)
super-poussin
Posts: 74
Joined: Sun Mar 15, 2009 8:04 pm

Re: password encryption

Post by super-poussin »

I launched transmission like this :

Code: Select all

start-stop-daemon --chuid nobody --start --pidfile /var/run/transmission-daemon.pid --make-pidfile \
            --exec /usr/local/bin/transmission-daemon --background --  -g /c/webroot/transmission-config/transmission-daemon

my setting.json is :

Code: Select all

{
    "blocklist-enabled": 1,
    "download-dir": "\/c\/media\/BitTorrent",
    "download-limit": 200,
    "download-limit-enabled": 0,
    "encryption": 1,
    "lazy-bitfield-enabled": 1,
    "max-peers-global": 200,
    "message-level": 2,
    "open-file-limit": 32,
    "peer-limit-global": 240,
    "peer-limit-per-torrent": 60,
    "peer-port": 51413,
    "peer-port-random-enabled": 0,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 1024,
    "peer-socket-tos": 8,
    "pex-enabled": 1,
    "port-forwarding-enabled": 1,
    "preallocation": 1,
    "proxy": "",
    "proxy-auth-enabled": 0,
    "proxy-auth-password": "",
    "proxy-auth-username": "",
    "proxy-enabled": 0,
    "proxy-port": 80,
    "proxy-type": 0,
    "ratio-limit": "1.500000",
    "ratio-limit-enabled": 1,
    "rpc-authentication-required": 1,
    "rpc-enabled": 1,
    "rpc-password": "password1",
    "rpc-port": 8181,
    "rpc-username": "admin",
    "rpc-whitelist": "*",
    "rpc-whitelist-enabled": 1,
    "upload-limit": 10,
    "upload-limit-enabled": 1,
    "upload-slots-per-torrent": 14,
    "watch-dir": "\/c\/media\/BitTorrent\/sources\/",
    "watch-dir-enabled": 1
}


and I can no more connect to web ui using admin and password1
super-poussin
Posts: 74
Joined: Sun Mar 15, 2009 8:04 pm

Re: password encryption

Post by super-poussin »

did someone see the same problem ?
KyleK
Posts: 57
Joined: Fri Feb 29, 2008 10:41 pm

Re: password encryption

Post by KyleK »

Yes, same problem here. Build 8074, neither transmission-remote nor the web interface can login.
super-poussin
Posts: 74
Joined: Sun Mar 15, 2009 8:04 pm

Re: password encryption

Post by super-poussin »

same with 8075
super-poussin
Posts: 74
Joined: Sun Mar 15, 2009 8:04 pm

Re: No more Web-ui access with nightly builds 8074-75

Post by super-poussin »

same with 8079 :(
dairinin
Posts: 5
Joined: Mon Mar 23, 2009 10:51 am

Re: No more Web-ui access with nightly builds 8074-75

Post by dairinin »

For all of us not using GTK frontend.

Here is a small app derived from transmission src:

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/bn.h>
#include <openssl/des.h>
#include <openssl/dh.h>
#include <openssl/rand.h>
#include <assert.h>
#include <inttypes.h>

int tr_cryptoRandInt( int );
int tr_cryptoWeakRandInt( int );
uint64_t tr_date( void );

int main( int argc, char** argv ) {

    static const char * salter = "0123456789"
                                 "abcdefghijklmnopqrstuvwxyz"
                                 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                 "./";
    static const size_t salter_len = 64;

    int i;
    char salt[12];

    if(argc != 2) {
        printf("Usage: %s password\n", argv[0]);
        return 1;
    }

    memcpy( salt, "$1$", 3 );
    for( i=0; i<8; ++i )
        salt[3+i] = salter[ tr_cryptoRandInt( salter_len ) ];
    salt[11] = '\0';

    printf("%s\n", DES_crypt( argv[1], salt ) );
    return 0;
}

int tr_cryptoRandInt( int upperBound ) {
    int noise;
    int val;

    if( RAND_pseudo_bytes ( (unsigned char *) &noise, sizeof noise ) >= 0 )
    {
        val = abs( noise ) % upperBound;
    }
    else /* fall back to a weaker implementation... */
    {
        val = tr_cryptoWeakRandInt( upperBound );
    }

    assert( val >= 0 );
    assert( val < upperBound );
    return val;
}

int tr_cryptoWeakRandInt( int upperBound ) {
    static int init = 0;

    assert( upperBound > 0 );

    if( !init )
    {
        srand( tr_date( ) );
        init = 1;
    }

    return rand( ) % upperBound;
}

uint64_t tr_date( void ) {
    struct timeval tv;

    gettimeofday( &tv, NULL );
    return (uint64_t) tv.tv_sec * 1000 + ( tv.tv_usec / 1000 );
}
save into crypt.c, Compile:

Code: Select all

gcc -lssl crypt.c -o crypt
...and run:

Code: Select all

./crypt <yout_password>
Copy-paste it's output into settings.json instead of your password and restart transmission-daemon

Worked for me.
super-poussin
Posts: 74
Joined: Sun Mar 15, 2009 8:04 pm

Re: No more Web-ui access with nightly builds 8074-75

Post by super-poussin »

works fine :)

I have actually no solution for scripts using transmission-remote

hope we will have something in the web ui :)
dairinin
Posts: 5
Joined: Mon Mar 23, 2009 10:51 am

Re: No more Web-ui access with nightly builds 8074-75

Post by dairinin »

Mine transmission-remote works fine with clear-text password, ie "-n user:password"
super-poussin
Posts: 74
Joined: Sun Mar 15, 2009 8:04 pm

Re: No more Web-ui access with nightly builds 8074-75

Post by super-poussin »

you're right :)


will try to work on a php frontend for your crypt :)

Perhaps you can rename it to trans-crypt or something else cause a crypt program already exist in linux
jhujhiti
Posts: 8
Joined: Sun Dec 07, 2008 1:38 am

Re: No more Web-ui access with nightly builds 8074-75

Post by jhujhiti »

Fixed in r8080. Anyone who ran trunk or a nightly between r8072 and r8080 will need to reset their password from the Preferences dialog or directly in settings.json. When editing settings.json, you can enter a cleartext password and it will be hashed when Transmission next writes the file.

commitdiff
super-poussin
Posts: 74
Joined: Sun Mar 15, 2009 8:04 pm

Re: No more Web-ui access with nightly builds 8074-75

Post by super-poussin »

after 2-3 restart it works :)

but the password stay in plain text in settings.json is it normal ?
jhujhiti
Posts: 8
Joined: Sun Dec 07, 2008 1:38 am

Re: No more Web-ui access with nightly builds 8074-75

Post by jhujhiti »

super-poussin wrote:but the password stay in plain text in settings.json is it normal ?
fixed in r8085
super-poussin
Posts: 74
Joined: Sun Mar 15, 2009 8:04 pm

Re: No more Web-ui access with nightly builds 8074-75

Post by super-poussin »

yes it is many thanks :)
Post Reply