Vasco Freire created GUACAMOLE-2189:
---------------------------------------

             Summary: Timezone redirection is not working
                 Key: GUACAMOLE-2189
                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-2189
             Project: Guacamole
          Issue Type: Bug
    Affects Versions: 1.6.0
         Environment: Docker container started through the following script:

$env:MARIADB_ROOT_PASSWORD = "EXAMPLE_ROOT_PASSWORD"
$env:MARIADB_PASSWORD      = "EXAMPLE_PASSWORD"
$env:DB_PATH               = "$env:USERPROFILE\guac_docker_db"

docker pull guacamole/guacd
docker pull guacamole/guacamole
docker pull mariadb

docker run --rm guacamole/guacamole `
    /opt/guacamole/bin/initdb.sh --mysql `
    | Out-File -Encoding UTF8 guac-initdb.sql

docker network create guacnet 2>$null

docker run -d --name guacamoledb `
    --network guacnet `
    -e MARIADB_ROOT_PASSWORD=$env:MARIADB_ROOT_PASSWORD `
    -e MARIADB_DATABASE=guac `
    -e MARIADB_USER=guac `
    -e MARIADB_PASSWORD=$env:MARIADB_PASSWORD `
    -v "$env:DB_PATH:/var/lib/mysql" `
    mariadb

$maxAttempts = 10
$attempt = 0
$ready = $false

while (-not $ready -and $attempt -lt $maxAttempts) {
    $attempt++
    Start-Sleep -Seconds 2
    
    $healthCheck = docker exec guacamoledb mariadb -u root 
-p"$env:MARIADB_ROOT_PASSWORD" -e "SELECT 1;" 2>$null
    
    if ($LASTEXITCODE -eq 0) {
        $ready = $true
        Write-Host "MariaDB is ready!"
    } else {
        Write-Host "  Attempt $attempt/$maxAttempts - Waiting..."
    }
}

if (-not $ready) {
    Write-Host "ERROR: MariaDB failed to start within 60 seconds" 
-ForegroundColor Red
    exit 1
}

docker cp guac-initdb.sql guacamoledb:/initdb.sql

docker exec guacamoledb bash -c `
    "mariadb -u root -p$env:MARIADB_ROOT_PASSWORD guac < /initdb.sql"

docker run -d --name guacd `
    --network guacnet `
    guacamole/guacd

docker run -d --name guacamole `
    --network guacnet `
    -e GUACD_HOSTNAME=guacd `
    -e MYSQL_HOSTNAME=guacamoledb `
    -e MYSQL_DATABASE=guac `
    -e MYSQL_USER=guac `
    -e MYSQL_PASSWORD=$env:MARIADB_PASSWORD `
    -p 8080:8080 `
    guacamole/guacamole
            Reporter: Vasco Freire


After logging into my Windows 2022 RDP server through guacamole's RDP, I 
noticed that the timezone of the remote server is the system timezone instead 
of the timezone I have configured in my preferences. I've enabled timezone 
redirection in the windows registry and I've confirmed that guacamole is 
sending the correct timezone as it is included in the websocket's connect 
request payload:
{code:java}
...
GUAC_DPI: 129
GUAC_TIMEZONE: Europe/Berlin
...{code}
 

>From looking at the source code and reading the improvement's issue 
>https://issues.apache.org/jira/browse/GUACAMOLE-422, I gathered that the 
>implementation is dependent on how FreeRDP handles the client timezone since 
>there was no apparent API call to change it, with the solution being to set 
>the "TZ" environment variable. However, this doesn’t seem to work in either 
>FreeRDP 2.11 (default FreeRDP on {{guacd}} docker container) or FreeRDP 3.17 
>(recent release).

It looks like the situation changed with commit 
[https://github.com/FreeRDP/FreeRDP/commit/fc21b828805bcabe06d36e77e229a4ccb5bf32b7],
 which allows the client timezone to be overridden. However, this may have 
broken the existing implementation, because the client timezone is now 
initialized during settings initialization, therefore by the time guacamole 
tries to set it, it’s already too late.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to