Bug 34388 - EC2 appliance mode and first steps
EC2 appliance mode and first steps
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Basic settings
UCS 3.2
Other Linux
: P5 enhancement (vote)
: UCS 3.2-2-errata
Assigned To: Erik Damrose
Janek Walkenhorst
:
: 33763 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-24 09:06 CET by Stefan Gohmann
Modified: 2014-08-07 17:43 CEST (History)
4 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2014-03-24 09:06:41 CET
We should describe the EC2 setup steps on the apache startside.
Comment 1 Erik Damrose univentionstaff 2014-07-09 14:02:24 CEST
r51656 univention-system-setup 7.0.69-10.571.201407091358
r51657 yaml

NOT yet merged to UCS 4, as i am sure there will be further improvements due to feedback. In addition, the package has not been transferred to the UCS 4 branch yet.

Additonal ideas regarding this solution / possible improvement options: 
- Read server address and print it into the infobox' ssh cmdline 
- Should we provide a link to the ucs quickstart guide? I am thinking the welcome page should be as small and clean as possible, to not overwhelm the user.
- With this change, the new welcome page is the apache default site. Previously, the umc setup module was loaded directly. Are there cases in which this behaviour is not desired? Note that this does not affect the appliance mode for vmware images, as firefox is called with the correct URL from the startxwithfirefox script
Comment 2 Alexander Kläser univentionstaff 2014-07-16 13:09:33 CEST
The adapted UCS overview page looks nice :) .
Some open points nevertheless.

Currently, the page is installed along with the system-setup-boot package. As I understand, it should only be installed for EC2 images.

js-initialsetup/initialstartsite.js → it would be nice, not to duplicate the code from the UCS overview site in this package. We can have a look together at it in order to find a better solution. I also think it is fine to put this javascript file into /var/www/ucs-overview/js instead of its own JS folder.

po2json.py → in the umc-dev package, there exists the tool dh-umc-po2json which seems to do the same job.

> if [ "$startsite" = 'ucs-overview/initialsetup.html' ]; then
Would it make more sense to reset the start site without this check?
Comment 3 Florian Best univentionstaff 2014-07-23 10:20:43 CEST
Please have a look at the page with javascript disabled.
Comment 4 Erik Damrose univentionstaff 2014-07-23 14:22:07 CEST
(In reply to Alexander Kläser from comment #2)
> Currently, the page is installed along with the system-setup-boot package.
> As I understand, it should only be installed for EC2 images.
As discussed, the page is only shown if UCRV server/amazon=true

> js-initialsetup/initialstartsite.js → it would be nice, not to duplicate the
> code from the UCS overview site in this package. We can have a look together
> at it in order to find a better solution. I also think it is fine to put
> this javascript file into /var/www/ucs-overview/js instead of its own JS
> folder.
The code has been refactored

> po2json.py → in the umc-dev package, there exists the tool dh-umc-po2json
> which seems to do the same job.
umc-dev dh tool is now used

> > if [ "$startsite" = 'ucs-overview/initialsetup.html' ]; then
> Would it make more sense to reset the start site without this check?
As discussed, for uss-boot package update/remove reasons this code has to be present.

r52108 univention-system-setup 7.0.69-34
r52115 yaml update

r52113 merge to UCS 4
Comment 5 Erik Damrose univentionstaff 2014-07-23 15:28:22 CEST
Updated the URL to the appliance wizard:

r52123 univention-system-setup 7.0.69-37
r52124 merge to UCS 4
Comment 6 Florian Best univentionstaff 2014-07-24 15:35:04 CEST
Currently i am getting redirected to:
/?module=setup%2Foverview%3Dfalse%2FdisplayUsername%3Dfalse%2Fusername%3Droot&lang=de-DE
(parameter-chars are urlencoded)
univention-system-setup                        7.0.69-38.605.201407241450
Comment 7 Alexander Kläser univentionstaff 2014-07-24 15:59:16 CEST
Seems to be a problem with quoting for &-characters with Apache, the UCRV ist set correctly. Here is the reponse header for the initial request:

> HTTP/1.1 302 Found
> Date: Thu, 24 Jul 2014 14:00:42 GMT
> Server: Apache/2.2.16 (Univention)
> Location: http://XXX.XXX.XXX.XXXunivention-management-console/?module=setup/overview=false/displayUsername=false/username=root
> Vary: Accept-Encoding
> Content-Encoding: gzip
> Content-Length: 293
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: text/html; charset=iso-8859-1
Comment 8 Florian Best univentionstaff 2014-07-24 16:02:29 CEST
The correct sent bytes are:
Location: http:///univention-management-console/?module=setup/overview=false/displayUsername=false/username=root
→ no host part...
Comment 9 Alexander Kläser univentionstaff 2014-07-24 16:03:18 CEST
> root@master:~# rgrep displayUser /etc/apache2/sites-available
> /etc/apache2/sites-available/default:   RedirectMatch ^/$ /univention-management-console/?module=setup&overview=false&displayUsername=false&username=root

Probably & needs to be escaped as \&.
Comment 10 Florian Best univentionstaff 2014-07-24 16:09:57 CEST
(In reply to Alexander Kläser from comment #9)
> > root@master:~# rgrep displayUser /etc/apache2/sites-available
> > /etc/apache2/sites-available/default:   RedirectMatch ^/$ /univention-management-console/?module=setup&overview=false&displayUsername=false&username=root
> 
> Probably & needs to be escaped as \&.
yes, & is intepreted as regex reference.
Comment 11 Erik Damrose univentionstaff 2014-07-25 10:15:35 CEST
Escaping with \& works. Fixed in

r52205 univention-system-setup 7.0.69-40
Comment 12 Erik Damrose univentionstaff 2014-07-25 10:52:20 CEST
r52209 merge to ucs 4
Comment 13 Florian Best univentionstaff 2014-07-25 11:36:45 CEST
Bug #33763 fixed within here?
Comment 14 Erik Damrose univentionstaff 2014-07-25 11:44:58 CEST
(In reply to Florian Best from comment #13)
> Bug #33763 fixed within here?

Yes. The link to the system setup is called with overview=false
Comment 15 Erik Damrose univentionstaff 2014-07-25 11:45:23 CEST
*** Bug 33763 has been marked as a duplicate of this bug. ***
Comment 16 Philipp Hahn univentionstaff 2014-07-25 12:57:00 CEST
r52108 contains the following hunk:
--- ucs-3.2-2/base/univention-system-setup/debian/univention-system-setup-boot.init
+++ ucs-3.2-2/base/univention-system-setup/debian/univention-system-setup-boot.init
@@ -61,6 +61,9 @@ case "$1" in
                        if ! grep -q "$key" /root/.ssh/authorized_keys; then
                                echo "$key"  >>/root/.ssh/authorized_keys
                        fi
+
+                       ucr set apache2/startsite="ucs-overview/initialsetup.html"
+                       invoke-rc.d apache2 reload
                fi
 
                if is_ucr_true server/amazon && is_ucr_true system/setup/boot/networking; then

This part is executed on *each* reboot of an EC2 VM, especially after the release update by ucs-test.
This then breaks the two tests 09_updater/45component-server and 09_updater/46component-port:
#   ConfigurationError: Configuration error: non-existing prefix ".": http://member097/./

Any request for /. then gets re-directed to that not-existing page:
# ucr get apache2/startsite 
ucs-overview/initialsetup.html
# HEAD http://member097/./
404 Not Found

# ucr set apache2/startsite=ucs-overview/
# /etc/init.d/apache2 graceful
# HEAD http://member097/./
200 OK

FYI: The two tests are special from all the other tests as they configure repository/online/prefix=. to stop the updater from using the default prefix "repository-prefix/". This is needed to guarantee that both the lookup for the main UCS release repository and the component repository succeeds, as the same prefix is used in both cases.
Comment 17 Philipp Hahn univentionstaff 2014-07-25 13:08:18 CEST
The test fails on {S3,S4}×{Backup,Slave,Member}, because univention-system-setup-boot was removed there, as that package depends on univention-server-master, which conflicts with the other role packages.
Due to the removal /var/www/ucs-overview/initialsetup.html got removed, which now produces the HTTP 404 error.
Comment 18 Erik Damrose univentionstaff 2014-07-25 13:21:03 CEST
Fix: Only redirect apache2 startsite on unjoined systems

r52231 univention-system-setup 7.0.69-41
r52232 merge to ucs 4
Comment 19 Erik Damrose univentionstaff 2014-08-01 12:18:55 CEST
Fixed links to system setup again:

r52455 univention-system-setup 7.0.69-45
r52460 merge to ucs3.2-3
r52461 merge to ucs4.0
r52464 3.2-2 yaml update
Comment 20 Janek Walkenhorst univentionstaff 2014-08-01 18:20:32 CEST
Landing page looks good.
It is added for AWS and removed after completing system setup.
Advisory: OK
Comment 21 Janek Walkenhorst univentionstaff 2014-08-07 17:43:27 CEST
http://errata.univention.de/ucs/3.2/160.html