public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/, doc/
@ 2011-12-29 21:24 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2011-12-29 21:24 UTC (permalink / raw
  To: gentoo-commits

commit:     28505920f31d9e0ccc15bf755255b9ea4408491a
Author:     Michael (kensington) <gentoo <AT> scribeofthenile <DOT> com>
AuthorDate: Thu Dec 29 21:23:19 2011 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 21:23:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=28505920

Update the docs for --lui

Reported-By: Maurice Volaski <mvolaski <AT> aecom.yu.edu>
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
X-Gentoo-Bug: 379581
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=379581

---
 WebappConfig/config.py  |    8 +++-----
 doc/webapp-config.8.xml |   13 +++++--------
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index e5bbf1e..0968dee 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -572,11 +572,9 @@ class Config:
                          '--lui',
                          action='store_true',
                          help = 'List all master images which currently a'
-                         're not used. Use * for the package name and/or '
-                         'version number to list more than one package / '
-                         'version of a package. Remember to include the *'
-                         ' in single quotes to stop your shell from expan'
-                         'ding it first!!')
+                         're not used. Optionally, provide a package and/'
+                         'or version number as arguments to restrict the '
+                         'listing.')
 
         group.add_option('--show-installed',
                          '--si',

diff --git a/doc/webapp-config.8.xml b/doc/webapp-config.8.xml
index e51e172..e3f2c08 100644
--- a/doc/webapp-config.8.xml
+++ b/doc/webapp-config.8.xml
@@ -133,16 +133,14 @@
 	  <arg choice="plain">
 	    <option>--list-unused-installs</option>
 	  </arg>
-	  <group choice="opt">
-	    <arg>
-	      <replaceable>app-name</replaceable>
+	  <arg choice="opt">
+	    <arg choice="req">
+	      <replaceable>app-version</replaceable>
 	    </arg>
-	  </group>
-	  <group choice="opt">
-	    <arg>
+	    <arg choice="opt">
 	      <replaceable>app-version</replaceable>
 	    </arg>
-	  </group>
+	  </arg>
 	</cmdsynopsis>
 
 	<cmdsynopsis>
@@ -281,7 +279,6 @@
 	    <term><option>--lui</option> <replaceable>app-name</replaceable> <replaceable>app-version</replaceable></term>
 	    <listitem>
 	      <para>Outputs a list of all the master copies of the <replaceable>app-name</replaceable>-<replaceable>app-version</replaceable> package that have not been installed using <command>webapp-config</command> <option>-I</option>.</para>
-	      <para>Both <replaceable>app-name</replaceable> or <replaceable>app-version</replaceable> can be <emphasis>*</emphasis> to search for multiple packages or versions.</para>
 	    </listitem>
 	  </varlistentry>
 



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/, doc/
@ 2013-03-29 23:03 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2013-03-29 23:03 UTC (permalink / raw
  To: gentoo-commits

commit:     55d20d366085adcfd8783d56de11bb024a446bb1
Author:     twitch153 <twitch153 <AT> hotmail <DOT> com>
AuthorDate: Fri Mar 29 03:16:53 2013 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri Mar 29 22:57:22 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=55d20d36

WebappConfig/{config,worker}.py: add option to copy files

This adds an option to copy the webapp files rather than hardlink
them even if they are on the same filesystem.  While this takes
up more disk space, it allows one to modify different instances
of webapp installations without affecting other instances.

X-Gentoo-Bug: 231482
X-Gentoo-Bug-URL: https://bugs.gentoo.org/231482
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

---
 WebappConfig/config.py  |   16 ++++++++++++++++
 WebappConfig/worker.py  |   36 ++++++++++++++++++++++++++++++++++++
 doc/webapp-config.8.xml |   18 ++++++++++++++----
 3 files changed, 66 insertions(+), 4 deletions(-)

diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index 37fb0e2..fd106c5 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -490,6 +490,13 @@ class Config:
                          ' when creating virtual files. <NOTE>: some pack'
                          'ages will not work if you use this option')
 
+        group.add_option('--cp',
+                         '--copy',
+                         action='store_true',
+                         help = 'Directly copy the webapp files from'
+             ' the /usr/share/webapps/ directory when installing'
+             ' the webapp.')
+
         group.add_option('--virtual-files',
                          '--vf',
                          type = 'choice',
@@ -845,6 +852,7 @@ class Config:
                             'user'         : 'vhost_config_uid',
                             'group'        : 'vhost_config_gid',
                             'soft'         : 'g_soft',
+                            'copy'         : 'g_copy',
                             'virtual_files': 'vhost_config_virtual_files',
                             'default_dirs' : 'vhost_config_default_dirs',
                             'pretend'      : 'g_pretend',
@@ -990,6 +998,14 @@ class Config:
             OUT.debug('Selecting soft links' , 7)
 
             self.config.set('USER', 'g_link_type', 'soft')
+
+        elif (self.config.has_option('USER', 'g_copy') and
+              self.config.getboolean('USER', 'g_copy')):
+
+            OUT.debug('Selecting copying of links', 7)
+
+            self.config.set('USER', 'g_link_type', 'clone')
+
         else:
 
             OUT.debug('Selecting hard links' , 7)

diff --git a/WebappConfig/worker.py b/WebappConfig/worker.py
index 07a2f1a..250f068 100644
--- a/WebappConfig/worker.py
+++ b/WebappConfig/worker.py
@@ -495,6 +495,10 @@ class WebappAdd:
                     OUT.debug('Trying to softlink', 8)
 
                     if not self.__p:
+                        if self.__v:
+                            print("\n>>> SOFTLINKING FILE: ")
+                            print(">>> Source: " + src_name +
+                                  "\n>>> Destination: " + dst_name + "\n")
                         os.symlink(src_name, dst_name)
 
                     my_contenttype = 'sym'
@@ -504,12 +508,35 @@ class WebappAdd:
                     if self.__v:
                         OUT.warn('Failed to softlink (' + str(e) + ')')
 
+            elif self.__link_type == 'clone':
+                try:
+
+                    OUT.debug('Trying to copy files directly', 8)
+
+                    if not self.__p:
+                        if self.__v:
+                            print("\n>>> COPYING FILE: ")
+                            print(">>> Source: " + src_name +
+                                  "\n>>> Destination: " + dst_name + "\n")
+                        shutil.copy(src_name, dst_name)
+
+                    my_contenttype = 'file'
+
+                except Exception as e:
+
+                    if self.__v:
+                        OUT.warn('Failed to copy (' + str(e) + ')')
+
             elif os.path.islink(src_name):
                 try:
 
                     OUT.debug('Trying to copy symlink', 8)
 
                     if not self.__p:
+                        if self.__v:
+                            print("\n>>> SYMLINK COPY: ")
+                            print(">>> Source: " + src_name +
+                                  "\n>>> Destination: " + dst_name + "\n")
                         os.symlink(os.readlink(src_name), dst_name)
 
                     my_contenttype = 'sym'
@@ -525,6 +552,10 @@ class WebappAdd:
                     OUT.debug('Trying to hardlink', 8)
 
                     if not self.__p:
+                        if self.__v:
+                            print("\n>>> HARDLINKING FILE: ")
+                            print(">>> Source: " + src_name +
+                                  "\n>>> Destination: " + dst_name + "\n")
                         os.link(src_name, dst_name)
 
                     my_contenttype = 'file'
@@ -535,7 +566,12 @@ class WebappAdd:
                         OUT.warn('Failed to hardlink (' + str(e) + ')')
 
         if not my_contenttype:
+
             if not self.__p:
+                if self.__v:
+                    print("\n>>> COPYING FILE: ")
+                    print(">>> Source: " + src_name +
+                          "\n>>> Destination: " + dst_name + "\n")
                 shutil.copy(src_name, dst_name)
             my_contenttype = 'file'
 

diff --git a/doc/webapp-config.8.xml b/doc/webapp-config.8.xml
index e3f2c08..dda1ec4 100644
--- a/doc/webapp-config.8.xml
+++ b/doc/webapp-config.8.xml
@@ -68,6 +68,7 @@
 	  <arg choice="opt">
 	    <option>-dghusDE</option>
 	    <option>--soft</option>
+	    <option>--copy</option>
 	    <option>--secure</option>
 	  </arg>
 	  <arg choice="req">
@@ -217,14 +218,15 @@
 	</refsect2>
 
 	<refsect2>
-	  <title>Hard Linking vs Soft Linking</title>
+	  <title>File Copying Options</title>
 	  <para>A <glossterm>virtual copy</glossterm> is built mostly by creating hard links to files under <filename>/usr/share/webapps</filename>.  If a hard link cannot be created, the file is copied from <filename>/usr/share/webapps</filename> instead.</para>
 	  <para>Hard links can only be created to files on the same filesystem.  If you keep <filename>/usr/share/webapps</filename> and <filename>/var/www</filename> on different filesystems, <command>webapp-config</command> cannot use hard links, and will be forced to copy the files instead.</para>
-	  <para>There are two ways to get around the hard link problem.</para>
+	  <para>There are three ways to get around the hard link problem.</para>
 	  <para>The easiest way is to make <filename>/usr/share/webapps</filename> a symlink to a directory under <filename>/var/www</filename>.  For most people, this will ensure that everything is on the same filesystem.</para>
 	  <para>However, if you keep the websites you host on separate filesystems (like I do), then <command>webapp-config</command> is never going to be able to hard-link files for you.</para>
-	  <para>You can choose to use the <option>--soft</option> command-line switch instead.  This switch tells <command>webapp-config</command> to create symbolic links instead of hard links.  Symbolic links work across filesystems.</para>
+	  <para>As an alternative you can choose to use the <option>--soft</option> command-line switch.  This switch tells <command>webapp-config</command> to create symbolic links instead of hard links.  Symbolic links work across filesystems.</para>
 	  <para>The problem with using symbolic links is that some packages do not work when the virtual copy is made from symbolic links.  Many users - and system administrators alas - have also complained that they find directories full of symbolic links confusing.  For these reasons, symbolic links are not used by default in <command>webapp-config</command> any more.</para>
+          <para>You may also choose the <option>--copy</option> command-line switch.  This particular switch tells <command>webapp-config</command> to directly copy the files from <filename>/usr/share/webapps/</filename> instead of hard links.  Copying directly works across filesystems with the drawback of using more space but if you are going to use it across file systems you may want this instead of symbolic links, as this means that the files in <filename>/usr/share/webapps/</filename> will not be touched when the files in the location of your virtualhost are altered.</para>
 	</refsect2>
 
         <refsect2>
@@ -465,12 +467,20 @@
 	  <varlistentry>
 	    <term><option>--soft</option></term>
 	    <listitem>
-	      <para>Use this option to create the virtual copy using symbolic links instead of hard links.</para>
+	      <para>Use this option to create the virtual copy using symbolic links.</para>
 	      <para>You may find this option useful if <filename>/usr/share/webapps</filename> is on a different filesystem to your htdocs directories.  However, it has been discovered that some packages do not work with this option, which is why it is no longer the default behaviour.  You are always better off making <filename>/usr/share/webapps</filename> a symlink to a directory on the same filesystem as your htdocs directories.</para>
 	    </listitem>
 	  </varlistentry>
 
 	  <varlistentry>
+	    <term><option>--cp</option></term>
+	    <term><option>--copy</option></term>
+	    <listitem>
+	      <para>Use this option to create the virtual copy by copying the files from the <filename>/usr/share/webapps/</filename> directories.</para>
+	      <para>This option is useful if you want to copy the files directly from <filename>/usr/share/webapps/</filename> to your virtual host in /var/www without the use of softlinks, or hardlinks. Be aware that because this is a direct copying of files it will prove to take up more space on your filesystem as opposed to the other two options since you are duplicating the webapp.</para>
+	  </varlistentry>
+
+	  <varlistentry>
 	    <term><option>--secure</option></term>
 	    <listitem>
 	      <para>Use this option to install into the <filename>htdocs-secure</filename> directory rather than into the <filename>htdocs</filename> directory.</para>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/, doc/
@ 2013-03-29 23:10 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2013-03-29 23:10 UTC (permalink / raw
  To: gentoo-commits

commit:     a1e489227f090025610d08e4d2a43faa7e4cf80e
Author:     Devan Franchini <twitch153 <AT> hotmail <DOT> com>
AuthorDate: Fri Mar 29 03:16:53 2013 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri Mar 29 23:10:00 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=a1e48922

WebappConfig/{config,worker}.py: add option to copy files

This adds an option to copy the webapp files rather than hardlink
them even if they are on the same filesystem.  While this takes
up more disk space, it allows one to modify different instances
of webapp installations without affecting other instances.

X-Gentoo-Bug: 231482
X-Gentoo-Bug-URL: https://bugs.gentoo.org/231482
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

---
 WebappConfig/config.py  |   16 ++++++++++++++++
 WebappConfig/worker.py  |   36 ++++++++++++++++++++++++++++++++++++
 doc/webapp-config.8.xml |   18 ++++++++++++++----
 3 files changed, 66 insertions(+), 4 deletions(-)

diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index 37fb0e2..fd106c5 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -490,6 +490,13 @@ class Config:
                          ' when creating virtual files. <NOTE>: some pack'
                          'ages will not work if you use this option')
 
+        group.add_option('--cp',
+                         '--copy',
+                         action='store_true',
+                         help = 'Directly copy the webapp files from'
+             ' the /usr/share/webapps/ directory when installing'
+             ' the webapp.')
+
         group.add_option('--virtual-files',
                          '--vf',
                          type = 'choice',
@@ -845,6 +852,7 @@ class Config:
                             'user'         : 'vhost_config_uid',
                             'group'        : 'vhost_config_gid',
                             'soft'         : 'g_soft',
+                            'copy'         : 'g_copy',
                             'virtual_files': 'vhost_config_virtual_files',
                             'default_dirs' : 'vhost_config_default_dirs',
                             'pretend'      : 'g_pretend',
@@ -990,6 +998,14 @@ class Config:
             OUT.debug('Selecting soft links' , 7)
 
             self.config.set('USER', 'g_link_type', 'soft')
+
+        elif (self.config.has_option('USER', 'g_copy') and
+              self.config.getboolean('USER', 'g_copy')):
+
+            OUT.debug('Selecting copying of links', 7)
+
+            self.config.set('USER', 'g_link_type', 'clone')
+
         else:
 
             OUT.debug('Selecting hard links' , 7)

diff --git a/WebappConfig/worker.py b/WebappConfig/worker.py
index 07a2f1a..250f068 100644
--- a/WebappConfig/worker.py
+++ b/WebappConfig/worker.py
@@ -495,6 +495,10 @@ class WebappAdd:
                     OUT.debug('Trying to softlink', 8)
 
                     if not self.__p:
+                        if self.__v:
+                            print("\n>>> SOFTLINKING FILE: ")
+                            print(">>> Source: " + src_name +
+                                  "\n>>> Destination: " + dst_name + "\n")
                         os.symlink(src_name, dst_name)
 
                     my_contenttype = 'sym'
@@ -504,12 +508,35 @@ class WebappAdd:
                     if self.__v:
                         OUT.warn('Failed to softlink (' + str(e) + ')')
 
+            elif self.__link_type == 'clone':
+                try:
+
+                    OUT.debug('Trying to copy files directly', 8)
+
+                    if not self.__p:
+                        if self.__v:
+                            print("\n>>> COPYING FILE: ")
+                            print(">>> Source: " + src_name +
+                                  "\n>>> Destination: " + dst_name + "\n")
+                        shutil.copy(src_name, dst_name)
+
+                    my_contenttype = 'file'
+
+                except Exception as e:
+
+                    if self.__v:
+                        OUT.warn('Failed to copy (' + str(e) + ')')
+
             elif os.path.islink(src_name):
                 try:
 
                     OUT.debug('Trying to copy symlink', 8)
 
                     if not self.__p:
+                        if self.__v:
+                            print("\n>>> SYMLINK COPY: ")
+                            print(">>> Source: " + src_name +
+                                  "\n>>> Destination: " + dst_name + "\n")
                         os.symlink(os.readlink(src_name), dst_name)
 
                     my_contenttype = 'sym'
@@ -525,6 +552,10 @@ class WebappAdd:
                     OUT.debug('Trying to hardlink', 8)
 
                     if not self.__p:
+                        if self.__v:
+                            print("\n>>> HARDLINKING FILE: ")
+                            print(">>> Source: " + src_name +
+                                  "\n>>> Destination: " + dst_name + "\n")
                         os.link(src_name, dst_name)
 
                     my_contenttype = 'file'
@@ -535,7 +566,12 @@ class WebappAdd:
                         OUT.warn('Failed to hardlink (' + str(e) + ')')
 
         if not my_contenttype:
+
             if not self.__p:
+                if self.__v:
+                    print("\n>>> COPYING FILE: ")
+                    print(">>> Source: " + src_name +
+                          "\n>>> Destination: " + dst_name + "\n")
                 shutil.copy(src_name, dst_name)
             my_contenttype = 'file'
 

diff --git a/doc/webapp-config.8.xml b/doc/webapp-config.8.xml
index e3f2c08..dda1ec4 100644
--- a/doc/webapp-config.8.xml
+++ b/doc/webapp-config.8.xml
@@ -68,6 +68,7 @@
 	  <arg choice="opt">
 	    <option>-dghusDE</option>
 	    <option>--soft</option>
+	    <option>--copy</option>
 	    <option>--secure</option>
 	  </arg>
 	  <arg choice="req">
@@ -217,14 +218,15 @@
 	</refsect2>
 
 	<refsect2>
-	  <title>Hard Linking vs Soft Linking</title>
+	  <title>File Copying Options</title>
 	  <para>A <glossterm>virtual copy</glossterm> is built mostly by creating hard links to files under <filename>/usr/share/webapps</filename>.  If a hard link cannot be created, the file is copied from <filename>/usr/share/webapps</filename> instead.</para>
 	  <para>Hard links can only be created to files on the same filesystem.  If you keep <filename>/usr/share/webapps</filename> and <filename>/var/www</filename> on different filesystems, <command>webapp-config</command> cannot use hard links, and will be forced to copy the files instead.</para>
-	  <para>There are two ways to get around the hard link problem.</para>
+	  <para>There are three ways to get around the hard link problem.</para>
 	  <para>The easiest way is to make <filename>/usr/share/webapps</filename> a symlink to a directory under <filename>/var/www</filename>.  For most people, this will ensure that everything is on the same filesystem.</para>
 	  <para>However, if you keep the websites you host on separate filesystems (like I do), then <command>webapp-config</command> is never going to be able to hard-link files for you.</para>
-	  <para>You can choose to use the <option>--soft</option> command-line switch instead.  This switch tells <command>webapp-config</command> to create symbolic links instead of hard links.  Symbolic links work across filesystems.</para>
+	  <para>As an alternative you can choose to use the <option>--soft</option> command-line switch.  This switch tells <command>webapp-config</command> to create symbolic links instead of hard links.  Symbolic links work across filesystems.</para>
 	  <para>The problem with using symbolic links is that some packages do not work when the virtual copy is made from symbolic links.  Many users - and system administrators alas - have also complained that they find directories full of symbolic links confusing.  For these reasons, symbolic links are not used by default in <command>webapp-config</command> any more.</para>
+          <para>You may also choose the <option>--copy</option> command-line switch.  This particular switch tells <command>webapp-config</command> to directly copy the files from <filename>/usr/share/webapps/</filename> instead of hard links.  Copying directly works across filesystems with the drawback of using more space but if you are going to use it across file systems you may want this instead of symbolic links, as this means that the files in <filename>/usr/share/webapps/</filename> will not be touched when the files in the location of your virtualhost are altered.</para>
 	</refsect2>
 
         <refsect2>
@@ -465,12 +467,20 @@
 	  <varlistentry>
 	    <term><option>--soft</option></term>
 	    <listitem>
-	      <para>Use this option to create the virtual copy using symbolic links instead of hard links.</para>
+	      <para>Use this option to create the virtual copy using symbolic links.</para>
 	      <para>You may find this option useful if <filename>/usr/share/webapps</filename> is on a different filesystem to your htdocs directories.  However, it has been discovered that some packages do not work with this option, which is why it is no longer the default behaviour.  You are always better off making <filename>/usr/share/webapps</filename> a symlink to a directory on the same filesystem as your htdocs directories.</para>
 	    </listitem>
 	  </varlistentry>
 
 	  <varlistentry>
+	    <term><option>--cp</option></term>
+	    <term><option>--copy</option></term>
+	    <listitem>
+	      <para>Use this option to create the virtual copy by copying the files from the <filename>/usr/share/webapps/</filename> directories.</para>
+	      <para>This option is useful if you want to copy the files directly from <filename>/usr/share/webapps/</filename> to your virtual host in /var/www without the use of softlinks, or hardlinks. Be aware that because this is a direct copying of files it will prove to take up more space on your filesystem as opposed to the other two options since you are duplicating the webapp.</para>
+	  </varlistentry>
+
+	  <varlistentry>
 	    <term><option>--secure</option></term>
 	    <listitem>
 	      <para>Use this option to install into the <filename>htdocs-secure</filename> directory rather than into the <filename>htdocs</filename> directory.</para>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/, doc/
@ 2013-08-03 13:24 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2013-08-03 13:24 UTC (permalink / raw
  To: gentoo-commits

commit:     a0eaa253b2950ecd1a88db3b3a3b298b03498e4c
Author:     Vincent Brillault <gentoo <AT> lerya <DOT> net>
AuthorDate: Sat Aug  3 13:08:42 2013 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 13:19:39 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=a0eaa253

WebappConfig/{config.py,server.py}: set server uid/gid in the config

X-Gentoo-Bug: 432908
X-Gentoo-Bug-URL: https://bugs.gentoo.org/432908

---
 WebappConfig/config.py  | 36 ++++++++++++++++++++++++++++++------
 WebappConfig/server.py  | 20 +++++++++++---------
 doc/webapp-config.5.xml | 20 ++++++++++++++++++++
 3 files changed, 61 insertions(+), 15 deletions(-)

diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index 04fb6f2..bf55d1e 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -708,6 +708,18 @@ class Config:
                     ' variable "' + user + "'")
         return result
 
+    def maybe_get_user(self, user):
+        result = None
+        input_user = self.maybe_get(user)
+        if not input_user:
+            return result
+        try:
+            result = Perm.get_user(input_user)
+        except KeyError:
+            OUT.die('You specified an invalid user value for the'
+                    ' variable "' + user + "'")
+        return result
+
     def get_group(self, group):
         result = None
         try:
@@ -717,6 +729,18 @@ class Config:
                     ' variable "' + group + "'")
         return result
 
+    def maybe_get_group(self, group):
+        result = None
+        input_group = self.maybe_get(group)
+        if not input_group:
+            return result
+        try:
+            result = Perm.get_group(input_group)
+        except KeyError:
+            OUT.die('You specified an invalid group value for the'
+                    ' variable "' + group + "'")
+        return result
+
     def installdir(self):
         return self.maybe_get('g_installdir')
 
@@ -1514,27 +1538,27 @@ class Config:
                                             self.get_group('vhost_default_gid'),
                                             self.get_perm('vhost_perms_virtualowned_file')],
                           # These will be re-set by the servers
-                          'server-owned' : [None,
-                                            None,
+                          'server-owned' : [self.maybe_get_user('vhost_server_uid'),
+                                            self.maybe_get_group('vhost_server_gid'),
                                             self.get_perm('vhost_perms_serverowned_file')],
                           'config-owned' : [self.get_user('vhost_config_uid'),
                                             self.get_group('vhost_config_gid'),
                                             self.get_perm('vhost_perms_configowned_file')],
                           'config-server-owned' : [self.get_user('vhost_config_uid'),
-                                                   None,
+                                                   self.maybe_get_group('vhost_server_gid'),
                                                    self.get_perm('vhost_perms_serverowned_file')],},
                 'dir' :  {'default-owned' :[self.get_user('vhost_default_uid'),
                                             self.get_group('vhost_default_gid'),
                                             self.get_perm('vhost_perms_defaultowned_dir')],
                           # These will be re-set by the servers
-                          'server-owned' : [None,
-                                            None,
+                          'server-owned' : [self.maybe_get_user('vhost_server_uid'),
+                                            self.maybe_get_group('vhost_server_gid'),
                                             self.get_perm('vhost_perms_serverowned_dir')],
                           'config-owned' : [self.get_user('vhost_config_uid'),
                                             self.get_group('vhost_config_gid'),
                                             self.get_perm('vhost_perms_configowned_dir')],
                           'config-server-owned' : [self.get_user('vhost_config_uid'),
-                                                  None,
+                                                  self.maybe_get_group('vhost_server_gid'),
                                                   self.get_perm('vhost_perms_serverowned_dir')],
                           'install-owned': [self.get_user('vhost_default_uid'),
                                             self.get_group('vhost_default_gid'),

diff --git a/WebappConfig/server.py b/WebappConfig/server.py
index f67ecdb..a2b8e3f 100644
--- a/WebappConfig/server.py
+++ b/WebappConfig/server.py
@@ -67,15 +67,17 @@ class Basic:
         self.__vhostroot = directories['vhostroot']
 
         # + server owned
-        permissions['file']['server-owned'][0] = self.vhost_server_uid
-        permissions['file']['server-owned'][1] = self.vhost_server_gid
-        permissions['dir']['server-owned'][0]  = self.vhost_server_uid
-        permissions['dir']['server-owned'][1]  = self.vhost_server_gid
-        # and config owned directories have server gid
-        permissions['dir']['config-owned'][1]  = self.vhost_server_gid
-        # allows server and config owned
-        permissions['file']['config-server-owned'][1] = self.vhost_server_gid
-        permissions['dir']['config-server-owned'][1]  = self.vhost_server_gid
+        if permissions['file']['server-owned'][0] == 0:
+            permissions['file']['server-owned'][0] = self.vhost_server_uid
+            permissions['dir']['server-owned'][0]  = self.vhost_server_uid
+        if permissions['file']['server-owned'][1] == 0:
+            permissions['file']['server-owned'][1] = self.vhost_server_gid
+            permissions['dir']['server-owned'][1]  = self.vhost_server_gid
+            # and config owned directories have server gid
+            permissions['dir']['config-owned'][1]  = self.vhost_server_gid
+            # allows server and config owned
+            permissions['file']['config-server-owned'][1] = self.vhost_server_gid
+            permissions['dir']['config-server-owned'][1]  = self.vhost_server_gid
 
         self.__perm      = permissions
         self.__handler   = handler

diff --git a/doc/webapp-config.5.xml b/doc/webapp-config.5.xml
index 49de978..f7fdab4 100644
--- a/doc/webapp-config.5.xml
+++ b/doc/webapp-config.5.xml
@@ -118,6 +118,26 @@
 	  </varlistentry>
 
 	  <varlistentry>
+	    <term>vhost_server_uid</term>
+	    <listitem>
+	      <para>Overiding parameter for the server-dependant hardcoded uid which specifies the user to own all files and directories that are server-owned.</para>
+	      <para>Warning: <command>webapp-config</command>'s <option>-s</option> switch does not overide this parameter.</para>
+	      <para>By default, this is disabled.</para>
+	      <para>This can be <emphasis>either</emphasis> the name of a user or their numerical user id.</para>
+	    </listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term>vhost_server_gid</term>
+	    <listitem>
+	      <para>Overiding parameter for the server-dependant hardcoded gid which specifies the group to own all files and directories that are server-owned.</para>
+	      <para>Warning: <command>webapp-config</command>'s <option>-s</option> switch does not overide this parameter.</para>
+	      <para>By default, this is disabled.</para>
+	      <para>This can be <emphasis>either</emphasis> the name of a group or their numerical group id.</para>
+	    </listitem>
+	  </varlistentry>
+
+	  <varlistentry>
 	    <term>vhost_config_uid</term>
 	    <listitem>
 	      <para>Default value when <command>webapp-config</command>'s <option>-u</option> switch hasn't been used.</para>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/, doc/
@ 2013-08-24 23:06 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2013-08-24 23:06 UTC (permalink / raw
  To: gentoo-commits

commit:     3bbdf6579d88c0abe77519e0148dd0a7dcc7d3fe
Author:     Devan Franchini <twitch153 <AT> hotmail <DOT> com>
AuthorDate: Fri Aug 23 19:39:31 2013 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Aug 24 23:02:51 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=3bbdf657

Webappconfig/{config.py,worker.py}: Adds configurable --copy option.

This allows for altering the value of vhost_link_type in
/etc/vhosts/webapp-config to copy files by default when installing
a webapp as opposed to soft-linking or hard-linking.  This patch also
repairs the previous damage in which the behavior of the --copy flag
was being ignored; due to the fact that the boolean g_copy was not
being passed down throughout the program because of the extra --cp
flag.  Man page alterations have also been made to reflect the removal
of the --cp flag in the program.

X-Gentoo-Bug: 231482
X-Gentoo-Bug-URL: https://bugs.gentoo.org/231482

Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

---
 WebappConfig/config.py  | 11 ++++++-----
 WebappConfig/worker.py  |  2 +-
 doc/webapp-config.8.xml |  1 -
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index bb86a55..26eab59 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -490,8 +490,7 @@ class Config:
                          ' when creating virtual files. <NOTE>: some pack'
                          'ages will not work if you use this option')
 
-        group.add_option('--cp',
-                         '--copy',
+        group.add_option('--copy',
                          action='store_true',
                          help = 'Directly copy the webapp files from'
              ' the /usr/share/webapps/ directory when installing'
@@ -1027,12 +1026,14 @@ class Config:
 
             self.config.set('USER', 'g_link_type', 'soft')
 
-        elif (self.config.has_option('USER', 'g_copy') and
-              self.config.getboolean('USER', 'g_copy')):
+        elif ((self.config.has_option('USER', 'vhost_link_type') and
+               self.config.get('USER', 'vhost_link_type') == 'soft') or
+              (self.config.has_option('USER', 'g_copy') and
+               self.config.getboolean('USER', 'g_copy'))):
 
             OUT.debug('Selecting copying of links', 7)
 
-            self.config.set('USER', 'g_link_type', 'clone')
+            self.config.set('USER', 'g_link_type', 'copy')
 
         else:
 

diff --git a/WebappConfig/worker.py b/WebappConfig/worker.py
index 250f068..5b10060 100644
--- a/WebappConfig/worker.py
+++ b/WebappConfig/worker.py
@@ -508,7 +508,7 @@ class WebappAdd:
                     if self.__v:
                         OUT.warn('Failed to softlink (' + str(e) + ')')
 
-            elif self.__link_type == 'clone':
+            elif self.__link_type == 'copy':
                 try:
 
                     OUT.debug('Trying to copy files directly', 8)

diff --git a/doc/webapp-config.8.xml b/doc/webapp-config.8.xml
index 5b0048b..459e301 100644
--- a/doc/webapp-config.8.xml
+++ b/doc/webapp-config.8.xml
@@ -473,7 +473,6 @@
 	  </varlistentry>
 
 	  <varlistentry>
-	    <term><option>--cp</option></term>
 	    <term><option>--copy</option></term>
 	    <listitem>
 	      <para>Use this option to create the virtual copy by copying the files from the <filename>/usr/share/webapps/</filename> directories.</para>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/, doc/
@ 2015-07-02 14:31 Devan Franchini
  0 siblings, 0 replies; 6+ messages in thread
From: Devan Franchini @ 2015-07-02 14:31 UTC (permalink / raw
  To: gentoo-commits

commit:     1d9f8b0faf147d454e997143be16a212c9c86144
Author:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Thu Jul  2 14:25:14 2015 +0000
Commit:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
CommitDate: Thu Jul  2 14:25:14 2015 +0000
URL:        https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=1d9f8b0f

Bump to version 1.54

webapp-{eclass, config}.{5, 8}.xml: Adds Devan Franchini to authors

 WebappConfig/version.py |  2 +-
 doc/webapp-config.5.xml | 12 ++++++++++--
 doc/webapp-config.8.xml | 12 ++++++++++--
 doc/webapp-eclass.5.xml | 12 ++++++++++--
 4 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/WebappConfig/version.py b/WebappConfig/version.py
index 76448f2..a795719 100644
--- a/WebappConfig/version.py
+++ b/WebappConfig/version.py
@@ -13,7 +13,7 @@
 #
 # ========================================================================
 
-WCVERSION = '1.53-git'
+WCVERSION = '1.54'
 
 if __name__ == '__main__':
     print(WCVERSION)

diff --git a/doc/webapp-config.5.xml b/doc/webapp-config.5.xml
index f7fdab4..a3f69b0 100644
--- a/doc/webapp-config.5.xml
+++ b/doc/webapp-config.5.xml
@@ -28,13 +28,21 @@
           <address><email>php@gunnarwrobel.de</email></address>
         </affiliation>
       </author>
+      <author>
+        <firstname>Devan</firstname>
+        <surname>Franchini</surname>
+        <affiliation>
+          <address><email>twitch153@gentoo.org</email></address>
+        </affiliation>
+      </author>
     </authorgroup>
 
     <copyright>
-      <year>2003-2005</year>
+      <year>2003-2015</year>
       <holder>Stuart Herbert</holder>
       <holder>Renat Lumpau</holder>
       <holder>Gunnar Wrobel</holder>
+      <holder>Devan Franchini</holder>
     </copyright>
 
   </articleinfo>
@@ -45,7 +53,7 @@
     <refentry>
       <refentryinfo>
         <title>webapp-config</title>
-	<date>November 2005</date>
+	<date>July 2015</date>
 	<productname>Gentoo Linux</productname>
       </refentryinfo>
       <refmeta>

diff --git a/doc/webapp-config.8.xml b/doc/webapp-config.8.xml
index 5ab475d..2214d47 100644
--- a/doc/webapp-config.8.xml
+++ b/doc/webapp-config.8.xml
@@ -28,13 +28,21 @@
           <address><email>php@gunnarwrobel.de</email></address>
         </affiliation>
       </author>
+      <author>
+        <firstname>Devan</firstname>
+        <surname>Franchini</surname>
+        <affiliation>
+          <address><email>twitch153@gentoo.org</email></address>
+        </affiliation>
+      </author>
     </authorgroup>
 
     <copyright>
-      <year>2003-2005</year>
+      <year>2003-2015</year>
       <holder>Stuart Herbert</holder>
       <holder>Renat Lumpau</holder>
       <holder>Gunnar Wrobel</holder>
+      <holder>Devan Franchini</holder>
     </copyright>
   </articleinfo>
 
@@ -44,7 +52,7 @@
     <refentry>
       <refentryinfo>
         <title>webapp-config</title>
-	<date>November 2005</date>
+	<date>July 2015</date>
 	<productname>Gentoo Linux</productname>
       </refentryinfo>
       <refmeta>

diff --git a/doc/webapp-eclass.5.xml b/doc/webapp-eclass.5.xml
index f2a0990..56a993e 100644
--- a/doc/webapp-eclass.5.xml
+++ b/doc/webapp-eclass.5.xml
@@ -28,13 +28,21 @@
           <address><email>wrobel@gentoo.org</email></address>
         </affiliation>
       </author>
+      <author>
+        <firstname>Devan</firstname>
+        <surname>Franchini</surname>
+        <affiliation>
+          <address><email>twitch153@gentoo.org</email></address>
+        </affiliation>
+      </author>
     </authorgroup>
 
     <copyright>
-      <year>2003-2006</year>
+      <year>2003-2015</year>
       <holder>Stuart Herbert</holder>
       <holder>Renat Lumpau</holder>
       <holder>Gunnar Wrobel</holder>
+      <holder>Devan Franchini</holder>
     </copyright>
   </articleinfo>
 
@@ -44,7 +52,7 @@
     <refentry>
       <refentryinfo>
         <title>webapp-eclass</title>
-	<date>January 2006</date>
+	<date>July 2015</date>
 	<productname>Gentoo Linux</productname>
       </refentryinfo>
       <refmeta>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-07-02 14:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-29 21:24 [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/, doc/ Anthony G. Basile
  -- strict thread matches above, loose matches on Subject: below --
2013-03-29 23:03 Anthony G. Basile
2013-03-29 23:10 Anthony G. Basile
2013-08-03 13:24 Anthony G. Basile
2013-08-24 23:06 Anthony G. Basile
2015-07-02 14:31 Devan Franchini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox