[jitsi-issues] [JIRA] Created: (JITSI-1037) provision system variables

vieridipaola (JIRA) jira-no-reply at java.net
Fri Apr 27 14:41:08 CEST 2012


provision system variables
--------------------------

                 Key: JITSI-1037
                 URL: http://java.net/jira/browse/JITSI-1037
             Project: jitsi
          Issue Type: New Feature
          Components: development
            Reporter: vieridipaola


> 6) when a provisioning URL does not contain ${password} but contains
> ${username}, the username is sent blank. Can't the username with
> which the user has logged into the OS be sent instead? (eg., Linux
> 'whoami' or Windows %USERNAME%) That would allow for some easy
> provisioning cases without the unnecessary Jitsi dialog box asking
> for username and password, when a password is not really needed,
> according to admin.

Emil Ivov wrote:
Hmmm ... interesting. We could actually implement a mechanism that
allows retrieving any system property via provisioning. Something like
${system.property_name}. The user name would hence be available as
${system.user.name}

Mailing list:
java.net/nonav/projects/jitsi/lists/dev/archive/2012-04/message/155

Suggested implementation:

In ProvisioningServiceImpl.java:

within    private File retrieveConfigurationFile(String url)

add:
            int systemIx1 = -1;
            while ( (systemIx1 = (url.indexOf("${system.",systemIx1) + 1) ) > 0)
            {
                int systemIx2 = url.indexOf("}", systemIx1 + 1);
                if (systemIx2 > (systemIx1 + 8)) {
                    String sysProp = url.substring(systemIx1 + 8, systemIx2);
                    url = url.replace("${system." + sysProp + "}", System.getProperty(sysProp));
                }
            }

This allows me to set a provisioning url such as:

https://provisioning.domain.org/?system.user.name=${system.user.name}&system.user.home=${system.user.home}&system.user.dir=${system.user.dir}&ipaddr=${ipaddr}&hwaddr=${hwaddr}&osname=${osname}&build=${build}&arch=${arch}&uuid=${uuid}

In order to read the new system.* values I need to use these variables in my custom PHP provisioning script:

$_POST['system_user_name']
$_POST['system_user_home']
$_POST['system_user_dir']

I still didn't figure out why I can't receive the dotted variable names.
It must have something to do with character encoding in StringEntity in 'private static HttpEntity postForm' in HttpUtils.java.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        




More information about the issues mailing list