Bug 215155

Summary: [NEW PORT] www/py-horizon: OpenStack Dashboard
Product: Ports & Packages Reporter: Alexander Nusov <alexander.nusov>
Component: Individual Port(s)Assignee: Roman Bogorodskiy <novel>
Status: Closed FIXED    
Severity: Affects Only Me CC: novel
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 215146, 215147, 215149, 215151    
Bug Blocks:    
Attachments:
Description Flags
py-horizon
none
py-horizon
none
updated port, v2
none
added GID and UID
none
UIDs and GIDs for Horizon pseudo-user none

Description Alexander Nusov 2016-12-08 13:19:05 UTC
Created attachment 177801 [details]
py-horizon

Horizon is a Django-based project aimed at providing a complete OpenStack Dashboard along with an extensible framework for building new dashboards from reusable components. The openstack_dashboard module is a reference implementation of a Django site that uses the horizon app to provide web-based interactions with the various OpenStack projects.
Comment 1 Alexander Nusov 2016-12-11 11:22:54 UTC
Created attachment 177866 [details]
py-horizon

move django-* ports www/
Comment 2 Roman Bogorodskiy freebsd_committer freebsd_triage 2016-12-18 13:57:59 UTC
Created attachment 178049 [details]
updated port, v2

I've made some updates to the original patch.

Specifically:

 - fixed some space/tab issues pointed out by portlint -a
 - adjusted deps according to the recent clients rename
 - moved pkg-message to files/pkg-message.in and
   added SUB_(FILES|LIST) to avoid hardcoding python paths

Renaming questions:

 - The patch seems to be missing UID/GID changes for the horizon user
 - Can we do chown'ing in the package instead of making user doing that
   manually?
Comment 3 Alexander Nusov 2016-12-18 14:26:51 UTC
(In reply to Roman Bogorodskiy from comment #2)
> - fixed some space/tab issues pointed out by portlint -a
> - adjusted deps according to the recent clients rename
> - moved pkg-message to files/pkg-message.in and
>   added SUB_(FILES|LIST) to avoid hardcoding python paths
Thanks!

> - The patch seems to be missing UID/GID changes for the horizon user
Oh, I will add missing diff for UIDs/GIDs


> - Can we do chown'ing in the package instead of making user doing that
   manually?
Well, chown'ing is only required when horizon is served by apache with default local_config.

Theoretically it's possible to change the ownership in pkg-plist but when the user will make a more advanced setup (e.g. pre-compile css, disable django-compressor, move .secret files into separate directory), ownership for those directories should be changed back to the "root".

I don't have an opinion yet on this topic so I added a notice in pkg-message to change ownership manually if you need to.

one question,
for current version of the port, having a real directory for the horizon user (/var/lib/horizon) is not required but may be required in the future.
If we set home directory  to /nonexistent now and change that later, will this change be applied automatically?
Comment 4 Alexander Nusov 2016-12-18 15:12:41 UTC
Created attachment 178051 [details]
added GID and UID
Comment 5 Roman Bogorodskiy freebsd_committer freebsd_triage 2016-12-19 13:24:22 UTC
(In reply to Alexander Nusov from comment #3)

 - wrt chown'ing: sound good, if that's not always required, let's leave it as is.

 - as for user: I *think* the change will not be applied if a user already has horizon port installed and the 'horizon' user created. We'll have to create an UPDATING entry if we need to modify user (search for "pw usermod" for examples)
Comment 6 Alexander Nusov 2016-12-19 13:39:27 UTC
(In reply to Roman Bogorodskiy from comment #5)
Got it.
I will update GIDs/UIDs to point the home directory to /var/lib/horizon
it seems horizon requires it for the .novaclient and .cinderclient temporary files

root@controller ~]# find /var/lib/horizon/ -type d
/var/lib/horizon/
/var/lib/horizon/.novaclient
/var/lib/horizon/.novaclient/d41d8cd98f00b204e9800998ecf8427e
/var/lib/horizon/.cinderclient
/var/lib/horizon/.cinderclient/d41d8cd98f00b204e9800998ecf8427e
Comment 7 Alexander Nusov 2016-12-19 13:42:13 UTC
Created attachment 178101 [details]
UIDs and GIDs for Horizon pseudo-user
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-12-19 16:39:24 UTC
A commit references this bug:

Author: novel
Date: Mon Dec 19 16:39:07 UTC 2016
New revision: 428952
URL: https://svnweb.freebsd.org/changeset/ports/428952

Log:
  Add www/py-horizon, OpenStack Dashboard

  Horizon is a Django-based project aimed at providing
  a complete OpenStack Dashboard along with an extensible framework
  for building new dashboards from reusable components.

  PR:		215155
  Submitted by:	Alexander Nusov (alexander.nusov@nfvexpress.com)

Changes:
  head/GIDs
  head/UIDs
  head/www/Makefile
  head/www/py-horizon/
  head/www/py-horizon/Makefile
  head/www/py-horizon/distinfo
  head/www/py-horizon/files/
  head/www/py-horizon/files/01-django.patch
  head/www/py-horizon/files/pkg-message.in
  head/www/py-horizon/pkg-descr
Comment 9 Roman Bogorodskiy freebsd_committer freebsd_triage 2016-12-19 16:41:13 UTC
Committed, thanks!

PS Does not depend on 215145, pkg-descr thing is not a blocker.