Project

General

Profile

Actions

Bug #2282

closed

One can not omit the configuration of a base URL in rudder properties

Added by Matthieu CERDA about 12 years ago. Updated over 11 years ago.

Status:
Released
Priority:
3
Category:
Web - UI & UX
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

In a lot of cases, the user might want to comment out the base URL in the rudder-web.properties file to have a "generic" root that is not locked on a defined FQDN (the application using only relative, instead of absolute, paths).

When I tried to comment this entry during tests, the application did not break completely but parts of if failed to load.

I can see odd paths in the head section of the page:

    <base href="${base.url}/" />

    <link media="screen" type="text/css" rel="stylesheet" href="/rudder/style/rudder.css" />

    <link type="text/css" rel="stylesheet" href="/rudder/images/themes/ui-lightness/jquery.ui.all.css" />
    <link type="text/css" rel="stylesheet" href="/rudder/style/jquery-rudder-bridge.css" />

    <link type="image/x-icon" rel="icon" href="/rudder/images/rudder-favicon.ico" />
    <script src="javascript/jquery/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery-ui-1.8.13.custom.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery.ui.core.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery.ui.widget.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery.ui.mouse.js" type="text/javascript"></script>

    <script src="/rudder/javascript/jquery/ui/jquery.ui.sortable.js" type="text/javascript"></script>
    <script src="javascript/jquery/jquery.bgiframe-2.1.1.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery.ui.button.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery.ui.draggable.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery.ui.position.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery.ui.dialog.js" type="text/javascript"></script>

    <script src="/rudder/javascript/jquery/ui/jquery.ui.resizable.js" type="text/javascript"></script>
    <script src="/rudder/javascript/rudder/rudder.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery.effects.core.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery.effects.blind.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery.effects.explode.js" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/ui/jquery.ui.tabs.js" type="text/javascript"></script>

    <script src="/rudder/javascript/jquery/ui/jquery.ui.progressbar.js" type="text/javascript"></script>
    <script src="/rudder/javascript/datatables/js/jquery.dataTables.js" language="javascript" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/jquery-tooltip/jquery.tooltip.js" language="javascript" type="text/javascript"></script>
    <script src="/rudder/javascript/jquery/tooltips.js" language="javascript" type="text/javascript"></script>
    <script type="text/javascript">
      // <![CDATA[
      $(document).ready(function() {
        correctButtons();
        $("a", "form").click(function() { return false; });
        createTooltip();
      });
      // ]]>
    </script>
    <script type="text/javascript" src="javascript/jquery/jquery.corner.js"></script>

    <script type="text/javascript">
      // <![CDATA[
      $(document).ready(function() {roundTabs();});
      // ]]>
    </script>
        <script id="simplemodal" src="javascript/jquery/jquery.simplemodal-1.4.1.js" type="text/javascript"></script>

I imagine that the base href is not intended to be left as is, and some includes use javascript/ instead of /rudder/javascript/ (baaaad idea : leads to a 404 not found)


Related issues 1 (0 open1 closed)

Related to Rudder - Bug #2264: When using the webapp through port forwarding, the css are not loadedRejected2012-02-09Actions
Actions #1

Updated by Jonathan CLARKE about 12 years ago

  • Target version changed from 2.4.0~alpha5 to 2.4.0~alpha6
Actions #2

Updated by Nicolas CHARLES about 12 years ago

  • Status changed from New to Discussion
  • Assignee changed from Nicolas CHARLES to Matthieu CERDA

Matthieu, I recall you don't use this parameter anymore, and it doesn't lead to any kind of error, or is it ?
On my test system I don't have any base.url and it looks fine

Actions #3

Updated by Matthieu CERDA about 12 years ago

  • Assignee changed from Matthieu CERDA to Nicolas CHARLES

Actually I reverted the commit (that simply made the rudder-init script ignore the base.url setting part) because on a Vagrant machine and Orch-3, it totally breaks the CSS and Javascripts. What differences do you think there is between your environment and orch-3 ?

Actions #4

Updated by Nicolas CHARLES almost 12 years ago

I'm digging out this old ticket.
The goal of this property is to allow for url rewrite.
With localhost, it doesn't have much meaning. If you access directly to the IP adress of the machine, you shouldn't have any problem either.

But if you want to specify an URL on with to talk to the Web Interface, then it is mandatory

Actions #5

Updated by François ARMAND almost 12 years ago

  • Target version changed from 2.4.0~alpha6 to 2.4.0~beta2
Actions #6

Updated by Nicolas CHARLES almost 12 years ago

  • Assignee changed from Nicolas CHARLES to Matthieu CERDA

Matthieu, can you be a bit more specific about what you'd like in this ticket ?

Actions #7

Updated by Matthieu CERDA almost 12 years ago

  • Assignee changed from Matthieu CERDA to Nicolas CHARLES

Well, all I want is to know if it is possible in some cases not to fill this configuration property, because having to specify the machine FQDN at every installation is quickly boring. Maybe we should have Rudder detect that the base.url parameter is empty, and in this case detect automatically the machine fqdn and use it, thus behaving like if base.url=http://<fqdn>/rudder have been set.

base.url would then become only useful in case of exceptions, or "funky" configurations.

Actions #8

Updated by Nicolas CHARLES almost 12 years ago

base.url is NOT mandatory, as said in #4
If it's not filled, then all resources will be searched in the relative path to where you are

Actions #9

Updated by Nicolas PERRON almost 12 years ago

  • Target version changed from 2.4.0~beta2 to 2.4.0~beta3

2.4.0~beta2 has been released. This ticket must be moved to 2.4.0~beta3.

Actions #10

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.4.0~beta3 to 2.4.0~beta4

So, what is about this issue ? Should we reject it ? Is there only a discussion ?

Meanwhile, I moved this issue to the next run as this is not a blocking issue.

Actions #11

Updated by Jonathan CLARKE over 11 years ago

  • Assignee changed from Nicolas CHARLES to Arthur ANGLADE
  • Target version changed from 2.4.0~beta4 to 2.4.0~beta5

Arthur, can you test the impact of this by using a Vagrant install (not a dev vagrant install though)?

Actions #12

Updated by Jonathan CLARKE over 11 years ago

  • Target version changed from 2.4.0~beta5 to 2.4.0~rc1
Actions #13

Updated by Jonathan CLARKE over 11 years ago

  • Assignee changed from Arthur ANGLADE to Vincent MEMBRÉ
Actions #14

Updated by Vincent MEMBRÉ over 11 years ago

  • Status changed from Discussion to In progress

I'm on it,

I have already repaired a good part of broken links.

For now it is working when server is behind a proxy. It will be finished very soon.

Actions #15

Updated by François ARMAND over 11 years ago

  • Target version changed from 2.4.0~rc1 to 2.4.0~rc2
Actions #16

Updated by Vincent MEMBRÉ over 11 years ago

  • Status changed from In progress to Pending technical review
  • % Done changed from 0 to 100
Actions #17

Updated by Vincent MEMBRÉ over 11 years ago

  • Status changed from Pending technical review to In progress

properties, base.url is now useless, but it was not removed from rudder code.

I haven't removed it yet, beacause it has a lot of consequences on packaging, but it will be done very soon. (before 2.4 release)

Actions #18

Updated by Vincent MEMBRÉ over 11 years ago

for now to configure your base url (rudder url looks like : http://server:port*/baseurl*/url)

you have to modify /opt/rudder/jetty7/contexts/rudder.xml and change content of line (line 5 in default file)

        <Set name="contextPath">/XXX</Set>

then modify /etc/apache2/sites-enabled/rudder-default and change the XXX with what you put in previous file

 
       # Rudder webapp
       RewriteEngine on
       RewriteRule   ^/$ /XXX [R]

       ProxyPass         "/XXX" "http://localhost:8080/XXX" 
       ProxyPassReverse  "/XXX" "http://localhost:8080/XXX" 
       ProxyRequests     Off

That should allow you to access rudder with http://server:port/XXX

Actions #19

Updated by François ARMAND over 11 years ago

  • Status changed from In progress to Pending technical review
Actions #20

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.4.0~rc2 to 2.4.0~beta5
Actions #21

Updated by Nicolas PERRON over 11 years ago

  • Status changed from Pending technical review to In progress
  • Assignee changed from Vincent MEMBRÉ to Nicolas PERRON
  • % Done changed from 100 to 80

Some packaging is needed now. I'll work on it.

François or Nicolas, could you do some technical review for the previous commit, please ?

Actions #22

Updated by Nicolas CHARLES over 11 years ago

The technical review for the scala/html/js part is ok (even in Vincent sneaked in others corrections in 64be6907081de3722c656f1dec198f8b5b15fbbf)

Actions #23

Updated by François ARMAND over 11 years ago

Some more question on the HTML/CCS part:

- I think there is a missing "/" in rudder-web/src/main/webapp/secure/nodeManager/searchNodes.html line 25
- the special instruction for IE < 7 in common-layout.html, line 52, does not have an URL starting with "/"
- "http://localhost:8080/images/favicon.[png, ico]" in rudder-loading.html smell fishy
- I don't understand some modifications in 64be6907081de3722c656f1dec198f8b5b15fbb
- only the first witch add a "/" seems related to this bug, all other (adding .value, a case in pattern matching, removing css modifier ":first" for table) seems to belong to an other (set of) ticket. Did something be mixed in that commit ?

Actions #24

Updated by Vincent MEMBRÉ over 11 years ago

François ARMAND wrote:

Some more question on the HTML/CCS part:

- I think there is a missing "/" in rudder-web/src/main/webapp/secure/nodeManager/searchNodes.html line 25
- the special instruction for IE < 7 in common-layout.html, line 52, does not have an URL starting with "/"
- "http://localhost:8080/images/favicon.[png, ico]" in rudder-loading.html smell fishy

I corrected those in 52aa095f

- I don't understand some modifications in 64be6907081de3722c656f1dec198f8b5b15fbb
- only the first witch add a "/" seems related to this bug, all other (adding .value, a case in pattern matching, removing css modifier ":first" for table) seems to belong to an other (set of) ticket. Did something be mixed in that commit ?

I mixed some corrections more related to #2838 (some .value fixes some links (remove nodeId) or some display, pattern match removes a warning, the first was useless))

Do i have to revert that commit and make two of them ?

Actions #25

Updated by Nicolas PERRON over 11 years ago

In rudder-server-root postinst script, I use base.url from rudder-web.properties in order to add an hostname in the inventory of the Rudder server (#2745 #2778).

With this attribute removed, a new solution should be found to know the hostname of the machine. I see two solutions:
  • Use hostname -f but we can't rely on it to be used by Rudder
  • Search for root server hostname in the LDAP with slapcat

I suppose the second choice is the better. Jon, do you agree ?

Actions #26

Updated by Nicolas PERRON over 11 years ago

Nicolas PERRON wrote:

In rudder-server-root postinst script, I use base.url from rudder-web.properties in order to add an hostname in the inventory of the Rudder server (#2745 #2778).

With this attribute removed, a new solution should be found to know the hostname of the machine. I see two solutions:
  • Use hostname -f but we can't rely on it to be used by Rudder
  • Search for root server hostname in the LDAP with slapcat

I suppose the second choice is the better. Jon, do you agree ?

The fixes for these issues have been changed then this question doesn't need to be addressed anymore.

Actions #27

Updated by Nicolas PERRON over 11 years ago

I have asked on the wsrong issue (#2745):

Another question:

In rudder-init.sh script, a part is made for set the server hostname. This hostname initially is used for:
  • Set the base.url which permit to access Rudder WebUI
  • Set the nodeHostname in LDAP (indeed, replace %POLICY_SERVER_HOSTNAME%)

The first action is not important and we can't stop to do it, but it's not the same for the second one. Should we let rudder-init.sh to insert into LDAP %POLICY_SERVER_HOSTNAME% ? At least, the nodeHostname will be fixed with the new inventory send to Rudder.

The answer is simple: The hostname should continue to be ask for the moment.

Actions #28

Updated by Nicolas PERRON over 11 years ago

  • Status changed from In progress to Pending technical review
  • % Done changed from 80 to 100

Applied in changeset commit:09868b0f114b0ebe29266c6219a7adaf0fa8e7ae.

Actions #29

Updated by Jonathan CLARKE over 11 years ago

  • Status changed from Pending technical review to Discussion
  • Assignee changed from Nicolas PERRON to Vincent MEMBRÉ

This commit looks good, but I have a question: how will Rudder behave if "base.url" contains the setting we used to have in it? ie, "http://rudder.mycompany.com/rudder/" or something similar? Will links break, or is this supported, or just plain ignored?

Actions #30

Updated by Nicolas PERRON over 11 years ago

Jonathan CLARKE wrote:

This commit looks good, but I have a question: how will Rudder behave if "base.url" contains the setting we used to have in it? ie, "http://rudder.mycompany.com/rudder/" or something similar? Will links break, or is this supported, or just plain ignored?

I've tried to set some broken links in rudder-web.properties and it seems that base.url isn't used anymore.

Actions #31

Updated by Vincent MEMBRÉ over 11 years ago

base.url is not used anymore in rudder, I kept all the services and the property in the code, but it is never used in any part of the webapp.

I kept the possibility to use it in the webapp, and to use that property, but I removed every usage of it.

So you could set any value for it, it has no impact on the webapp.

I think we should keep the property, but commented, to keep a trace of the base.url used before migration.

We should at least indicate that the property is now useless in rudder

Actions #32

Updated by Nicolas PERRON over 11 years ago

  • Status changed from Discussion to In progress
  • % Done changed from 100 to 90

Vincent MEMBRÉ wrote:

base.url is not used anymore in rudder, I kept all the services and the property in the code, but it is never used in any part of the webapp.

I kept the possibility to use it in the webapp, and to use that property, but I removed every usage of it.

So you could set any value for it, it has no impact on the webapp.

I think we should keep the property, but commented, to keep a trace of the base.url used before migration.

We should at least indicate that the property is now useless in rudder

Ok, I agree with you and will comment this attribute at once in the sample property file (rudder repository) and in the rudder-upgrade script.

Actions #33

Updated by Nicolas PERRON over 11 years ago

  • Status changed from In progress to Pending technical review
  • % Done changed from 90 to 100

Ok, I agree with you and will comment this attribute at once in the sample property file (rudder repository) and in the rudder-upgrade script.

This is done. Newer versions of rudder should comment this attribute, now.

Actions #34

Updated by Jonathan CLARKE over 11 years ago

  • Status changed from Pending technical review to Released

Looks good to me, thanks Nico.

Actions

Also available in: Atom PDF