This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  7f50494365803961f1ca8257080694ed30613246 (commit)
      from  99f16c859c2971bfd6700df12e5d3b5dd4435f5d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=7f50494365803961f1ca8257080694ed30613246

commit 7f50494365803961f1ca8257080694ed30613246
Author: Franck Villaume <franck.villa...@trivialdev.com>
Date:   Tue Aug 8 13:06:18 2017 +0000

    scmhg: make anon access work. make auth dav clone work.

diff --git a/src/plugins/scmhg/common/HgPlugin.class.php 
b/src/plugins/scmhg/common/HgPlugin.class.php
index 8a4b064..082c0f1 100644
--- a/src/plugins/scmhg/common/HgPlugin.class.php
+++ b/src/plugins/scmhg/common/HgPlugin.class.php
@@ -261,7 +261,14 @@ Offer DAV or SSH access.");
                        if ($this->browserDisplayable($project)) {
                                $protocol = forge_get_config('use_ssl', 
'scmhg')? 'https' : 'http';
                                $box = forge_get_config('scm_host');
-                               $iframesrc = 
$protocol.'://'.$box.'/plugins/scmhg/cgi-bin/'.$project->getUnixName().'.cgi';
+
+                               if ($project->enableAnonSCM()) {
+                                       $iframesrc = 
$protocol.'://'.$box.'/anonscm/scmhg/cgi-bin/'.$project->getUnixName();
+                               } elseif (session_loggedin()) {
+                                       $logged_user = 
user_get_object(user_getid())->getUnixName();
+                                       $iframesrc = 
$protocol.'://'.$box.'/authscm/'.$logged_user.'/scmhg/cgi-bin/'.$project->getUnixName();
+                               }
+
                                if ($params['commit']) {
                                        $iframesrc .= '/rev/'.$params['commit'];
                                }
@@ -295,7 +302,7 @@ Offer DAV or SSH access.");
                /** per project configuration for http **/
                //get template hgweb.cgi
                $hgweb = 
forge_get_config('source_path').'/plugins/scmhg/cgi-bin/hgweb.cgi';
-               $project_hgweb = 
forge_get_config('source_path').'/www/plugins/scmhg/cgi-bin/'.$project_name.'.cgi';
+               $project_hgweb = 
forge_get_config('source_path').'/www/plugins/scmhg/cgi-bin/'.$project_name;
                if (!is_file($project_hgweb)) {
                        $lines = file($hgweb);
                        $repo_config = "";
diff --git a/src/plugins/scmhg/etc/httpd.conf.d/vhost-scm-plugin-scmhg.inc 
b/src/plugins/scmhg/etc/httpd.conf.d/vhost-scm-plugin-scmhg.inc
index 296dd61..911d672 100644
--- a/src/plugins/scmhg/etc/httpd.conf.d/vhost-scm-plugin-scmhg.inc
+++ b/src/plugins/scmhg/etc/httpd.conf.d/vhost-scm-plugin-scmhg.inc
@@ -2,15 +2,22 @@
   Include ${FF__core__config_path}/httpd.conf.d/disable-scripts.inc
 </Directory>
 
-ScriptAlias /plugins/scmhg/cgi-bin/ 
${FF__core__plugins_path}/scmhg/www/cgi-bin/
-AliasMatch ^/authscm/[^/]+/hg/(.*) ${FF__scmhg__repos_path}/$1
-AliasMatch ^/anonscm/[^/]+/hg/(.*) ${FF__scmhg__repos_path}/$1
+AliasMatch ^/authscm/[^/]+/hg/(.*)  
${FF__core__plugins_path}/scmhg/www/cgi-bin/$1
+AliasMatch ^/anonscm/hg/(.*) ${FF__core__plugins_path}/scmhg/www/cgi-bin/$1
+
+ScriptAlias /anonscm/scmhg/cgi-bin/ 
${FF__core__plugins_path}/scmhg/www/cgi-bin/
+ScriptAliasMatch ^/authscm/[^/]+/scmhg/cgi-bin/$ 
${FF__core__plugins_path}/scmhg/www/cgi-bin/
 
 <Directory ${FF__core__plugins_path}/scmhg/www/cgi-bin >
        Options +ExecCGI +FollowSymLinks +Multiviews
-       AddHandler cgi-script .cgi
+       SetHandler cgi-script
        RewriteEngine On
        RewriteRule .* - [E=REMOTE_USER:%{ENV:REDIRECT_REMOTE_USER}]
        AllowOverride None
        Require all granted
+       # Work-around for FF40 
https://bugzilla.mozilla.org/show_bug.cgi?id=647010
+       ErrorDocument 401 "Please <a href='' target='_top'>login to gitweb</a> 
to browse private source code.
+       # FF40 discards this, hopefully they'll make it work in the near future:
+       #Header always set Access-Control-Allow-Origin "${FF__core__web_host}"
+       #Header always set Access-Control-Allow-Credentials "true"
 </Directory>

-----------------------------------------------------------------------

Summary of changes:
 src/plugins/scmhg/common/HgPlugin.class.php               | 11 +++++++++--
 .../scmhg/etc/httpd.conf.d/vhost-scm-plugin-scmhg.inc     | 15 +++++++++++----
 2 files changed, 20 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
Fusionforge-commits@lists.fusionforge.org
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to