GSoC 2020: Week 1 and Week 2 Progress

Alexander Bokovoy ab at samba.org
Sat Jun 13 21:15:07 UTC 2020


Hi Hezekiah,

On to, 11 kesä 2020, hezekiah maina via samba-technical wrote:
> Sorry I didn't to give the link to the repo:
> Here it is: https://gitlab.com/HezekiahM/samba-ad-dc

Great to see quite a progress, thank you.

I deployed it on Fedora 32, here my notes:

- I had to create src/css or otherwise webpack did not complete
  successfully

- I needed to patch webpack.config.js to allow webpack to
  finish linking the code

- On Fedora Cockpit does have patternfly.css as patternfly.min.css, I
  had to change the reference

- There are some issues with the content security policy so I added one,
  may be it is not needed

- one needs to provision the domain first or loading the app never
  completes, this is because you never set addcStatus to 'false' in case
  testparm doesn't return "active directory domain controller" for the
  'server role'

- once provisioned, the app starts showing separate pages but I wasn't
  able to retrieve the domain details from the 127.0.0.1 IP address

There is something wrong with the state update -- at least, I was not able
to see values updated from the forms. This can be seen with domain info,
for example -- since ipAddress state is undefined by default, it is not
updated and 'samba-tool domain info ${ipAddress}' fails:

An Error Occurred
ERROR: Invalid IP address 'undefined'!

I'm attaching some of my fixes, feel free to check them.

It is a promising start, great to see it.  Please add breadcrumbs to
return back to the previous level from each separate page (e.g. from
samba-ad-dc/users/index.html to main page in samba-ad-dc/index.html, for
example). This would allow moving back and forth without reloading the
page.

Looking forward to next week update. ;)

> 
> On Thu, Jun 11, 2020 at 10:31 AM hezekiah maina <hezekiahmaina3 at gmail.com>
> wrote:
> 
> > Hi Members,
> >
> > I wanted to give you an update on my progress for the work I'm doing during
> > the GSoC 2020.
> > Week 1:
> >  I worked on some bits of the following:
> >   Computer Management - List, Create, Delete and Showing the AD Object
> >   Time - Showing the current time on the Server
> >    Domain Management - Provisioning and Domain Information.
> >    Sites Management - Creating and Deleting
> >    Contact Management - List, Create, Show and Delete Contact
> > Week 2:
> >  I have been working on the following:
> >  User Management - Creating and Listing Users
> > I will continue working on the same and hopefully write tests for the app
> > before the end of the week.
> >
> >


-- 
/ Alexander Bokovoy
-------------- next part --------------
diff --git a/Makefile b/Makefile
index 7caed7d..ae9be53 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ TEST_OS = centos-7
 endif
 export TEST_OS
 TARFILE=cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz
-RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q cockpit-starter-kit.spec.in).rpm
+RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q cockpit-samba-ad-dc.spec.in).rpm
 VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
 # stamp file to check if/when npm install ran
 NODE_MODULES_TEST=package-lock.json
diff --git a/src/ad-dc-status.js b/src/ad-dc-status.js
index a5bd342..7ff6531 100644
--- a/src/ad-dc-status.js
+++ b/src/ad-dc-status.js
@@ -16,6 +16,8 @@ export default function GetServerRole() {
                 .then((data) => {
                     if (data.includes("active directory domain controller")) {
                         setAdDcStatus(true);
+                    } else {
+                        setAdDcStatus(false);
                     }
                 })
                 .catch((exception) => {
diff --git a/src/computer/computer.html b/src/computer/computer.html
index 5ef3fbd..9563204 100644
--- a/src/computer/computer.html
+++ b/src/computer/computer.html
@@ -3,10 +3,10 @@
     <title translate>Computer</title>
     <meta charset="utf-8">
 
-    <link rel="stylesheet" href="../../base1/patternfly.css" type="text/css">
+    <link rel="stylesheet" href="../../base1/patternfly.min.css" type="text/css">
     <link rel="stylesheet" href="index.css">
 
-    <script type="text/javascript" src="../../base1/cockpit.js"></script>
+    <script type="text/javascript" src="../../base1/cockpit.min.js"></script>
     <script type="text/javascript" src="../../*/po.js"></script>
     <script type="text/javascript" src="index.js"></script>
   </head>
diff --git a/src/contact/contact.html b/src/contact/contact.html
index 4cbbc51..e4167b2 100644
--- a/src/contact/contact.html
+++ b/src/contact/contact.html
@@ -3,10 +3,10 @@
     <title translate>Computer</title>
     <meta charset="utf-8">
 
-    <link rel="stylesheet" href="../../base1/patternfly.css" type="text/css">
+    <link rel="stylesheet" href="../../base1/patternfly.min.css" type="text/css">
     <link rel="stylesheet" href="index.css">
 
-    <script type="text/javascript" src="../../base1/cockpit.js"></script>
+    <script type="text/javascript" src="../../base1/cockpit.min.js"></script>
     <script type="text/javascript" src="../../*/po.js"></script>
     <script type="text/javascript" src="index.js"></script>
   </head>
diff --git a/src/domain/domain.html b/src/domain/domain.html
index 361ca53..6e215d2 100644
--- a/src/domain/domain.html
+++ b/src/domain/domain.html
@@ -3,10 +3,10 @@
     <title translate>Domain</title>
     <meta charset="utf-8">
 
-    <link rel="stylesheet" href="../../base1/patternfly.css" type="text/css">
+    <link rel="stylesheet" href="../../base1/patternfly.min.css" type="text/css">
     <link rel="stylesheet" href="index.css">
 
-    <script type="text/javascript" src="../../base1/cockpit.js"></script>
+    <script type="text/javascript" src="../../base1/cockpit.min.js"></script>
     <script type="text/javascript" src="../../*/po.js"></script>
     <script type="text/javascript" src="index.js"></script>
   </head>
diff --git a/src/index.html b/src/index.html
index e0a3ed5..4fc93b7 100644
--- a/src/index.html
+++ b/src/index.html
@@ -6,10 +6,10 @@
     <meta name="description" content="">
     <meta name="viewport" content="width=device-width, initial-scale=1">
 
-    <link rel="stylesheet" href="../base1/patternfly.css">
+    <link rel="stylesheet" href="../base1/patternfly.min.css">
     <link rel="stylesheet" href="index.css">
 
-    <script type="text/javascript" src="../base1/cockpit.js"></script>
+    <script type="text/javascript" src="../base1/cockpit.min.js"></script>
     <script type="text/javascript" src="../*/po.js"></script>
     <script type="text/javascript" src="index.js"></script>
 </head>
diff --git a/src/sites/sites.html b/src/sites/sites.html
index f20b23f..89c6c2e 100644
--- a/src/sites/sites.html
+++ b/src/sites/sites.html
@@ -3,10 +3,10 @@
     <title translate>Sites</title>
     <meta charset="utf-8">
 
-    <link rel="stylesheet" href="../../base1/patternfly.css" type="text/css">
+    <link rel="stylesheet" href="../../base1/patternfly.min.css" type="text/css">
     <link rel="stylesheet" href="index.css">
 
-    <script type="text/javascript" src="../../base1/cockpit.js"></script>
+    <script type="text/javascript" src="../../base1/cockpit.min.js"></script>
     <script type="text/javascript" src="../../*/po.js"></script>
     <script type="text/javascript" src="index.js"></script>
   </head>
diff --git a/src/time/time.html b/src/time/time.html
index 5057411..3d9049a 100644
--- a/src/time/time.html
+++ b/src/time/time.html
@@ -3,10 +3,10 @@
     <title translate>Time</title>
     <meta charset="utf-8">
 
-    <link rel="stylesheet" href="../../base1/patternfly.css" type="text/css">
+    <link rel="stylesheet" href="../../base1/patternfly.min.css" type="text/css">
     <link rel="stylesheet" href="index.css">
 
-    <script type="text/javascript" src="../../base1/cockpit.js"></script>
+    <script type="text/javascript" src="../../base1/cockpit.min.js"></script>
     <script type="text/javascript" src="../../*/po.js"></script>
     <script type="text/javascript" src="index.js"></script>
   </head>
diff --git a/src/user/user.html b/src/user/user.html
index 13e4905..47dfe2d 100644
--- a/src/user/user.html
+++ b/src/user/user.html
@@ -3,10 +3,10 @@
     <title translate>User Management</title>
     <meta charset="utf-8">
 
-    <link rel="stylesheet" href="../../base1/patternfly.css" type="text/css">
+    <link rel="stylesheet" href="../../base1/patternfly.min.css" type="text/css">
     <link rel="stylesheet" href="index.css">
 
-    <script type="text/javascript" src="../../base1/cockpit.js"></script>
+    <script type="text/javascript" src="../../base1/cockpit.min.js"></script>
     <script type="text/javascript" src="../../*/po.js"></script>
     <script type="text/javascript" src="index.js"></script>
   </head>
diff --git a/webpack.config.js b/webpack.config.js
index 2f1531d..b1bee30 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -105,7 +105,7 @@ Object.keys(info.entries).forEach(function(key) {
 var files = [];
 info.files.forEach(function(value) {
     if (!section || value.indexOf(section) === 0)
-        files.push({ from: vpath("src", value), to: value });
+        files.push({ from: vpath(value), to: value });
 });
 info.files = files;
 


More information about the samba-technical mailing list