Bug 52792 - Portal: Allow multiple paths for the portal
Portal: Allow multiple paths for the portal
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Portal
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Dirk Wiesenthal
Florian Best
:
: 51798 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-12 15:00 CET by Dirk Wiesenthal
Modified: 2024-02-12 13:54 CET (History)
1 user (show)

See Also:
What kind of report is it?: Feature Request
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
Screenshot (53.32 KB, image/png)
2021-02-17 10:56 CET, Florian Best
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2021-02-12 15:00:38 CET
The default path /univention/portal/ would serve the default portal.

But specialized portals may be used under different paths.

E.g., /univention/umc/
Comment 1 Florian Best univentionstaff 2021-02-13 20:27:43 CET
git:0aec3d6af374790e644a1af26fb29a4c530ba9dd

E:0004-12: conffiles/etc/apache2/sites-available/univention-portal.conf: template file contains variables that are not registered in file entry:
        - portal/paths
E:0004-36: Module file "symlink_portal" does not exist
→ move to conffiles
E:0010-2: symlink_portal: file contains no copyright text block
W:0020-W605: conffiles/etc/apache2/ucs-sites.conf.d/univention-portal.conf:17:-209: invalid escape sequence '\.'
W:0020-W605: conffiles/etc/apache2/ucs-sites.conf.d/univention-portal.conf:17:-196: invalid escape sequence '\.'

management/univention-portal/symlink_portal
→ this is not python 2 compatible. And it is not indented with tabs.
Comment 2 Florian Best univentionstaff 2021-02-16 09:51:45 CET
./python/univention/portal/extensions/portal.py:34:1: F401 'requests' imported but unused
./python/univention/portal/extensions/portal.py:319:10: F821 undefined name 'portal'
Comment 3 Dirk Wiesenthal univentionstaff 2021-02-16 11:21:51 CET
Fixed in
  univention-portal 4.0.4-7A~5.0.0.202102160223


New portals can be added by setting
  ucr set portal/paths='/univention/portal/, ..., ...'

where the default is now:
  ucr set portal/paths='/univention/portal/, /univention/umc/'

(You have to restart apache and univention-portal-server by hand.)


It works by removing or adding parts in the Apache config and symlinks to /usr/share/univention-portal/


A dummy implementation of the UMC overview can be found at /univention/umc/ if you did
  univention-portal add-default --update
(or, later, if it is a brand new DVD)

The usefulness / beauty of the UMC overview is not part of this bug.
Comment 4 Dirk Wiesenthal univentionstaff 2021-02-16 11:22:16 CET
> management/univention-portal/symlink_portal
> → this is not python 2 compatible. And it is not indented with tabs.

It does not need to be. It is an independent script.
Comment 5 Florian Best univentionstaff 2021-02-16 11:39:31 CET
(In reply to Dirk Wiesenthal from comment #4)
> > management/univention-portal/symlink_portal
> > → this is not python 2 compatible. And it is not indented with tabs.
> 
> It does not need to be. It is an independent script.

You are right, that's nice!:
python2 $(which ucr) set portal/paths='/univention/portal/, /univention/umc/'
Comment 6 Florian Best univentionstaff 2021-02-16 12:00:42 CET
Are you sure the following line works in every environment?:
git:b7c62853ec2e3007c74290750b60272498b7d649
+               client = Client(None, "Administrator", "univention")
Comment 7 Florian Best univentionstaff 2021-02-17 10:38:45 CET
During upgrade on a newly installed system I see the errors:

File: /etc/apache2/ucs-sites.conf.d/univention-portal.conf
Traceback (most recent call last):
  File "<stdin>", line 9, in <module>
AttributeError: 'NoneType' object has no attribute 'split'
File: /etc/logrotate.d/univention-portal
Script: /etc/univention/templates/scripts/symlink_portal
File: /etc/apache2/sites-available/univention-portal.conf
Traceback (most recent call last):
  File "<stdin>", line 10, in <module>
AttributeError: 'NoneType' object has no attribute 'split'
Comment 8 Florian Best univentionstaff 2021-02-17 10:40:55 CET
# systemctl restart apache2.service 
# curl http://localhost/univention/umc/
<html><title>404: Not Found</title><body>404: Not Found</body></html>

→ Nothing available after installation.
Comment 9 Florian Best univentionstaff 2021-02-17 10:56:13 CET
Created attachment 10621 [details]
Screenshot

* The folder Installed Applications should not be displayed if it has no content (like UMC).

* The tiles have no icons.

* The description/title of a folder is hardcoded "Title" instead of e.g. "Domain".

* It's not possible to use any wished path:

# ucr set portal/paths='/univention/portal/, /univention/umc/, /dataport/phoenix/' 
Setting portal/paths
Script: /etc/univention/templates/scripts/symlink_portal
Removing portal link to /var/www/univention/xxx...
Linking /var/www/dataport/phoenix to portal content...
Traceback (most recent call last):
  File "/etc/univention/templates/scripts/symlink_portal", line 63, in <module>
    os.symlink(portal_path, path)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/univention-portal' -> '/var/www/dataport/phoenix'
File: /etc/apache2/ucs-sites.conf.d/univention-portal.conf
File: /etc/apache2/sites-available/univention-portal.conf
Comment 10 Florian Best univentionstaff 2021-02-17 11:02:16 CET
* The links are not displayed. They seem to link to http://www.univention.com/.

Refused to display 'https://www.univention.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

* The items in the folder are not sorted like it's done in UMC (sort by "priority" key).
Comment 11 Dirk Wiesenthal univentionstaff 2021-02-17 22:39:13 CET
I addressed the tracebacks in
  univention-portal 4.0.4-8A~5.0.0.202102171734

There may still be problems with paths not starting with /univention/. I added a hint in the UCRV description: One may need additional Apache config that we do not want to do automatically. (I'd say)

As for the UMC issues, I will open a new bug for them. It is out of scope of this bug.
Comment 12 Florian Best univentionstaff 2021-02-19 11:20:02 CET
OK: The basics work so far.
It's not possible to use Paths not under /univention/.

All the other points mentioned in the comments are moved to another user story.
You can reopen this bug if you plan to use it for the further adjustments.
Comment 13 Florian Best univentionstaff 2021-02-23 18:00:21 CET
I found another error:

# ucr set portal/paths='/univention/portal/, /univention/umc/, /univention/foo/'                                                                                              
Setting portal/paths                                                                                                                                                    
File: /etc/apache2/sites-available/univention-portal.conf                                          
Script: /etc/univention/templates/scripts/symlink_portal              
Linking /var/www/univention/foo to portal content...
File: /etc/apache2/ucs-sites.conf.d/univention-portal.conf     
# ls /var/www/univention/
foo  js  languages.json  login  maintenance  management  server-overview  setup  system-info  udm  umc
^^^
# ucr unset portal/paths             
Unsetting portal/paths                                                  
W: portal/paths is still set in scope "default"                                     
File: /etc/apache2/sites-available/univention-portal.conf 
Script: /etc/univention/templates/scripts/symlink_portal          
File: /etc/apache2/ucs-sites.conf.d/univention-portal.conf
# ls /var/www/univention/                       
foo  js  languages.json  login  maintenance  management  server-overview  setup  system-info  udm  umc
^^^ → why is this still here?
Comment 14 Florian Best univentionstaff 2021-02-23 18:12:22 CET
The UCR definition is wrong:

[portal/paths]
…
Type=int
     ^^^
Comment 15 Dirk Wiesenthal univentionstaff 2021-04-21 03:31:30 CEST
(In reply to Florian Best from comment #14)
> The UCR definition is wrong:
> 
> [portal/paths]
> …
> Type=int
>      ^^^

Fixed in 
  univention-portal 4.0.5-32A~5.0.0.202104210331

(In reply to Florian Best from comment #13)
> I found another error:
> 
> # ucr set portal/paths='/univention/portal/, /univention/umc/,
> /univention/foo/'                                                           
> 
> Setting portal/paths                                                        
> 
> File: /etc/apache2/sites-available/univention-portal.conf                   
> 
> Script: /etc/univention/templates/scripts/symlink_portal              
> Linking /var/www/univention/foo to portal content...
> File: /etc/apache2/ucs-sites.conf.d/univention-portal.conf     
> # ls /var/www/univention/
> foo  js  languages.json  login  maintenance  management  server-overview 
> setup  system-info  udm  umc
> ^^^
> # ucr unset portal/paths             
> Unsetting portal/paths                                                  
> W: portal/paths is still set in scope "default"                             
> 
> File: /etc/apache2/sites-available/univention-portal.conf 
> Script: /etc/univention/templates/scripts/symlink_portal          
> File: /etc/apache2/ucs-sites.conf.d/univention-portal.conf
> # ls /var/www/univention/                       
> foo  js  languages.json  login  maintenance  management  server-overview 
> setup  system-info  udm  umc
> ^^^ → why is this still here?

This was some UCR glitch.
Comment 16 Florian Best univentionstaff 2021-04-23 01:42:27 CEST
missing changelog entry.
Comment 17 Dirk Wiesenthal univentionstaff 2021-04-23 01:54:14 CEST
Added in 2d3dda3b9b
Comment 18 Florian Best univentionstaff 2021-04-23 02:00:45 CEST
OK: functionality (tested some weeks ago)
OK: code review: recent changes
OK: changelog entry
Comment 19 Florian Best univentionstaff 2021-05-25 16:00:34 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

If this error occurs again, please use "Clone This Bug".
Comment 20 Florian Best univentionstaff 2024-02-12 13:54:05 CET
*** Bug 51798 has been marked as a duplicate of this bug. ***