initial commit of file from CVS for smeserver-gitweb on Thu Oct 9 11:47:34 AEDT 2025
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
*.rpm
|
||||||
|
*.log
|
||||||
|
*spec-20*
|
||||||
|
*.tar.gz
|
19
Makefile
Normal file
19
Makefile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
NAME := smeserver-gitweb
|
||||||
|
SPECFILE = $(firstword $(wildcard *.spec))
|
||||||
|
|
||||||
|
define find-makefile-common
|
||||||
|
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||||
|
endef
|
||||||
|
|
||||||
|
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||||
|
|
||||||
|
ifeq ($(MAKEFILE_COMMON),)
|
||||||
|
# attept a checkout
|
||||||
|
define checkout-makefile-common
|
||||||
|
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||||
|
endef
|
||||||
|
|
||||||
|
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||||
|
endif
|
||||||
|
|
||||||
|
include $(MAKEFILE_COMMON)
|
16
README.md
16
README.md
@@ -1,3 +1,15 @@
|
|||||||
# smeserver-gitweb
|
# <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> smeserver-gitweb
|
||||||
|
|
||||||
SMEServer Koozali developed git repo for smeserver-gitweb smecontribs
|
SMEServer Koozali developed git repo for smeserver-gitweb smecontribs
|
||||||
|
|
||||||
|
## Wiki
|
||||||
|
<br />https://wiki.koozali.org/
|
||||||
|
|
||||||
|
## Bugzilla
|
||||||
|
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-gitweb&product=SME%20Contribs&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
|
||||||
|
*Once it has been checked, then this comment will be deleted*
|
||||||
|
<br />
|
||||||
|
1
contriborbase
Normal file
1
contriborbase
Normal file
@@ -0,0 +1 @@
|
|||||||
|
contribs10
|
35
createlinks
Executable file
35
createlinks
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/usr/bin/perl -w
|
||||||
|
use esmith::Build::CreateLinks qw(:all);
|
||||||
|
# our event specific for updating with yum without reboot
|
||||||
|
$event = 'smeserver-gitweb-update';
|
||||||
|
#add here the path to your templates needed to expand
|
||||||
|
#see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event
|
||||||
|
|
||||||
|
foreach my $file (qw(
|
||||||
|
/etc/systemd/system-preset/49-koozali.preset
|
||||||
|
))
|
||||||
|
{
|
||||||
|
templates2events( $file, $event );
|
||||||
|
}
|
||||||
|
#action needed in case we have a systemd unit
|
||||||
|
event_link('systemd-default', $event, '10');
|
||||||
|
event_link('systemd-reload', $event, '50');
|
||||||
|
#action specific to this package
|
||||||
|
#event_link('action', $event, '30');
|
||||||
|
#services we need to restart
|
||||||
|
safe_symlink('restart',"root/etc/e-smith/events/$event/services2adjust/e-smith-httpd");
|
||||||
|
#and Server Manager panel link
|
||||||
|
#panel_link('somefunction', 'manager');
|
||||||
|
|
||||||
|
use File::Basename;
|
||||||
|
|
||||||
|
# Domain Modify
|
||||||
|
# -------------
|
||||||
|
|
||||||
|
for my $event ( qw( domain-modify update-ifcfg smeserver-gitweb-update ) )
|
||||||
|
{
|
||||||
|
#safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
|
||||||
|
templates2events("/etc/gitweb.conf", $event);
|
||||||
|
templates2events("/etc/e-smith/web/common/gitweb/home_text.html", $event);
|
||||||
|
templates2events("/etc/httpd/conf/httpd.conf", $event);
|
||||||
|
}
|
1
root/etc/e-smith/db/configuration/defaults/git/GitWeb
Executable file
1
root/etc/e-smith/db/configuration/defaults/git/GitWeb
Executable file
@@ -0,0 +1 @@
|
|||||||
|
enabled
|
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
# Setup the home link
|
||||||
|
# Allow override with: config setprop git SystemName <name>
|
||||||
|
# and/or: config setprop git DomainName <name>
|
||||||
|
# Otherwise default to the primary system domain
|
||||||
|
|
||||||
|
use esmith::ConfigDB;
|
||||||
|
|
||||||
|
my $config_db = esmith::ConfigDB->open_ro() or
|
||||||
|
die "Couldn't open ConfigDB\n";
|
||||||
|
|
||||||
|
my $SystemName = $git\{'SystemName'\} || $config_db->get("SystemName")->value;
|
||||||
|
my $DomainName = $git\{'DomainName'\} || $config_db->get("DomainName")->value;
|
||||||
|
my $GitWebHomeLink = $SystemName . "." . $DomainName . "/git";
|
||||||
|
|
||||||
|
$OUT = "";
|
||||||
|
$OUT .= "<div class=\"page_nav\">\n";
|
||||||
|
$OUT .= " Cloning a repository:\n";
|
||||||
|
$OUT .= " <pre>\n";
|
||||||
|
$OUT .= " <code>git clone " . "https://" . $GitWebHomeLink . "/foo.git</code>\n";
|
||||||
|
$OUT .= " </pre>\n";
|
||||||
|
$OUT .= " <a href=\"https://nobody\@" . $GitWebHomeLink . "\?reqauth=1\">Force Authentication</a> to see private repositories.\n";
|
||||||
|
$OUT .= "</div>\n";
|
||||||
|
}
|
@@ -0,0 +1 @@
|
|||||||
|
<!-- begin home_text.html -->
|
@@ -0,0 +1 @@
|
|||||||
|
<!-- end of home_text.html -->
|
7
root/etc/e-smith/templates/etc/gitweb.conf/00Intro
Executable file
7
root/etc/e-smith/templates/etc/gitweb.conf/00Intro
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
# The gitweb config file is a fragment of perl code. You can set variables
|
||||||
|
# using "our $variable = value"; text from "#" character until the end of a
|
||||||
|
# line is ignored. See perlsyn(1) man page for details.
|
||||||
|
#
|
||||||
|
# See /usr/share/doc/gitweb-*/README and /usr/share/doc/gitweb-*/INSTALL for
|
||||||
|
# more details and available configuration variables.
|
9
root/etc/e-smith/templates/etc/gitweb.conf/10ProjectRoot
Executable file
9
root/etc/e-smith/templates/etc/gitweb.conf/10ProjectRoot
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
# Set the path to git projects. This is an absolute filesystem path which will
|
||||||
|
# be prepended to the project path. The use of the environment variable
|
||||||
|
# GITWEB_PROJECTROOT allows the webserver to redirect the Gitweb view
|
||||||
|
# to user home directories that may be used to keep personal Git
|
||||||
|
# repositories.
|
||||||
|
|
||||||
|
our $projectroot = $ENV\{'GITWEB_PROJECTROOT'\} || "/home/e-smith/files/git";
|
||||||
|
|
20
root/etc/e-smith/templates/etc/gitweb.conf/15HomeLink
Normal file
20
root/etc/e-smith/templates/etc/gitweb.conf/15HomeLink
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
# Setup the home link
|
||||||
|
# Allow override with: config setprop git SystemName <name>
|
||||||
|
# and/or: config setprop git DomainName <name>
|
||||||
|
# Otherwise it default to the primary system and domain name
|
||||||
|
|
||||||
|
use esmith::ConfigDB;
|
||||||
|
|
||||||
|
my $config_db = esmith::ConfigDB->open_ro() or
|
||||||
|
die "Couldn't open ConfigDB\n";
|
||||||
|
|
||||||
|
my $SystemName = $git\{'SystemName'\} || $config_db->get("SystemName")->value;
|
||||||
|
my $DomainName = $git\{'DomainName'\} || $config_db->get("DomainName")->value;
|
||||||
|
my $GitWebHomeLink = $SystemName . "." . $DomainName . "/git";
|
||||||
|
|
||||||
|
$OUT = "\n";
|
||||||
|
$OUT .= "# Home Link:\n";
|
||||||
|
$OUT .= "\$home_link = \"" . "https://" . $GitWebHomeLink . "\"\;\n";
|
||||||
|
$OUT .= "\$home_link_str = \"" . $GitWebHomeLink . "\"\;\n";
|
||||||
|
}
|
12
root/etc/e-smith/templates/etc/gitweb.conf/15URI
Normal file
12
root/etc/e-smith/templates/etc/gitweb.conf/15URI
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# base URI
|
||||||
|
$my_uri = "/git/";
|
||||||
|
# URI of stylesheets
|
||||||
|
@stylesheets = ("/git/gitweb.css");
|
||||||
|
# URI of GIT logo (72x27 size)
|
||||||
|
$logo = "/git/git-logo.png";
|
||||||
|
# URI of GIT favicon, assumed to be image/png type
|
||||||
|
$favicon = "/git/git-favicon.png";
|
||||||
|
# URI of gitweb.js (JavaScript code for gitweb)
|
||||||
|
$javascript = "/git/gitweb.js";
|
||||||
|
|
3
root/etc/e-smith/templates/etc/gitweb.conf/17HomeText
Executable file
3
root/etc/e-smith/templates/etc/gitweb.conf/17HomeText
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
# Included at top of home page
|
||||||
|
$home_text = "/etc/e-smith/web/common/gitweb/home_text.html";
|
19
root/etc/e-smith/templates/etc/gitweb.conf/20BaseUrl
Normal file
19
root/etc/e-smith/templates/etc/gitweb.conf/20BaseUrl
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
# Setup the base URL
|
||||||
|
# Allow override with: config setprop git SystemName <name>
|
||||||
|
# and/or: config setprop git DomainName <name>
|
||||||
|
# Otherwise it default to the primary system and domain name
|
||||||
|
|
||||||
|
use esmith::ConfigDB;
|
||||||
|
|
||||||
|
my $config_db = esmith::ConfigDB->open_ro() or
|
||||||
|
die "Couldn't open ConfigDB\n";
|
||||||
|
|
||||||
|
my $SystemName = $git\{'SystemName'\} || $config_db->get("SystemName")->value;
|
||||||
|
my $DomainName = $git\{'DomainName'\} || $config_db->get("DomainName")->value;
|
||||||
|
my $GitWebBaseUrl = "https://" . $SystemName . "." . $DomainName . "/git";
|
||||||
|
|
||||||
|
$OUT = "";
|
||||||
|
$OUT .= "# Base URL:\n";
|
||||||
|
$OUT .= "\$base_url = \"" . $GitWebBaseUrl . "\"\;\n";
|
||||||
|
}
|
19
root/etc/e-smith/templates/etc/gitweb.conf/21CloneUrl
Executable file
19
root/etc/e-smith/templates/etc/gitweb.conf/21CloneUrl
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
# Setup the base URL
|
||||||
|
# Allow override with: config setprop git SystemName <name>
|
||||||
|
# and/or: config setprop git DomainName <name>
|
||||||
|
# Otherwise it default to the primary system and domain name
|
||||||
|
|
||||||
|
use esmith::ConfigDB;
|
||||||
|
|
||||||
|
my $config_db = esmith::ConfigDB->open_ro() or
|
||||||
|
die "Couldn't open ConfigDB\n";
|
||||||
|
|
||||||
|
my $SystemName = $git\{'SystemName'\} || $config_db->get("SystemName")->value;
|
||||||
|
my $DomainName = $git\{'DomainName'\} || $config_db->get("DomainName")->value;
|
||||||
|
my $GitWebBaseUrl = "https://" . $SystemName . "." . $DomainName . "/git";
|
||||||
|
|
||||||
|
$OUT = "";
|
||||||
|
$OUT .= "# Set the list of git base URLs to fetch project from\n";
|
||||||
|
$OUT .= "\@git_base_url_list = \"" . $GitWebBaseUrl . "\"\;\n\n";
|
||||||
|
}
|
13
root/etc/e-smith/templates/etc/gitweb.conf/22LocalIPAddress
Normal file
13
root/etc/e-smith/templates/etc/gitweb.conf/22LocalIPAddress
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
# Retrieve the server local IP address
|
||||||
|
use esmith::NetworksDB;
|
||||||
|
|
||||||
|
my $networks_db = esmith::NetworksDB->open_ro() or
|
||||||
|
die "Could not open the NetworksDB";
|
||||||
|
|
||||||
|
# Get server private IP address and mask for access to the local network only
|
||||||
|
my $network_setting = $networks_db->local_access_spec('private');
|
||||||
|
|
||||||
|
$OUT .= "# The server local IP address and mask\n";
|
||||||
|
$OUT .= "\$local_network_setting = \"" . $network_setting . "\"\;\n";
|
||||||
|
}
|
19
root/etc/e-smith/templates/etc/gitweb.conf/25SiteName
Executable file
19
root/etc/e-smith/templates/etc/gitweb.conf/25SiteName
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
# Setup the site name
|
||||||
|
# Allow override with: config setprop git SystemName <name>
|
||||||
|
# and/or: config setprop git DomainName <name>
|
||||||
|
# Otherwise it default to the primary system and domain name
|
||||||
|
|
||||||
|
use esmith::ConfigDB;
|
||||||
|
|
||||||
|
my $config_db = esmith::ConfigDB->open_ro() or
|
||||||
|
die "Couldn't open ConfigDB\n";
|
||||||
|
|
||||||
|
my $SystemName = $git\{'SystemName'\} || $config_db->get("SystemName")->value;
|
||||||
|
my $DomainName = $git\{'DomainName'\} || $config_db->get("DomainName")->value;
|
||||||
|
my $GitWebSiteName = $SystemName . "." . $DomainName;
|
||||||
|
|
||||||
|
$OUT = "";
|
||||||
|
$OUT .= "# Site Name:\n";
|
||||||
|
$OUT .= "\$site_name = \"" . $GitWebSiteName . "\"\;\n";
|
||||||
|
}
|
3
root/etc/e-smith/templates/etc/gitweb.conf/27ProjectListWidth
Executable file
3
root/etc/e-smith/templates/etc/gitweb.conf/27ProjectListWidth
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
# Length of the project description column in the webpage.
|
||||||
|
$projects_list_description_width = 200;
|
8
root/etc/e-smith/templates/etc/gitweb.conf/30FeatureBlameView
Executable file
8
root/etc/e-smith/templates/etc/gitweb.conf/30FeatureBlameView
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
# Enable the 'blame' blob view, showing the last commit that modified
|
||||||
|
# each line in the file. This can be very CPU-intensive. Disabled by default
|
||||||
|
$feature\{'blame'\}\{'default'\} = [1];
|
||||||
|
|
||||||
|
# Allow projects to override the default setting via git config file.
|
||||||
|
# Example: gitweb.blame = 0|1;
|
||||||
|
$feature\{'blame'\}\{'override'\} = 1;
|
4
root/etc/e-smith/templates/etc/gitweb.conf/31FeaturePathInfo
Executable file
4
root/etc/e-smith/templates/etc/gitweb.conf/31FeaturePathInfo
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
# Use clean URLs
|
||||||
|
$feature\{'pathinfo'\}\{'default'\} = [0];
|
||||||
|
|
12
root/etc/e-smith/templates/etc/gitweb.conf/32FeatureSnapshotLink
Executable file
12
root/etc/e-smith/templates/etc/gitweb.conf/32FeatureSnapshotLink
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# Disable the 'snapshot' link, providing a compressed archive of any tree. This
|
||||||
|
# can potentially generate high traffic if you have large project. Enabled for
|
||||||
|
# .tar.gz snapshots by default.
|
||||||
|
|
||||||
|
# Value is a list of formats defined in %known_snapshot_formats that you wish
|
||||||
|
# to offer.
|
||||||
|
$feature\{'snapshot'\}\{'default'\} = ['zip', 'tgz'];
|
||||||
|
|
||||||
|
# Allow projects to override the default setting via git config file.
|
||||||
|
# Example: gitweb.snapshot = tbz2,zip; (use "none" to disable)
|
||||||
|
$feature\{'snapshot'\}\{'override'\} = 1;
|
3
root/etc/e-smith/templates/etc/gitweb.conf/34FeatureAvatar
Executable file
3
root/etc/e-smith/templates/etc/gitweb.conf/34FeatureAvatar
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
$feature\{'avatar'\}\{'default'\} = ['gravatar'];
|
||||||
|
$feature\{'avatar'\}\{'override'\} = 1;
|
5
root/etc/e-smith/templates/etc/gitweb.conf/36FeatureHighlight
Executable file
5
root/etc/e-smith/templates/etc/gitweb.conf/36FeatureHighlight
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
$feature\{'highlight'\}\{'default'\} = [1];
|
||||||
|
$feature\{'highlight'\}\{'override'\} = 1;
|
||||||
|
|
||||||
|
|
10
root/etc/e-smith/templates/etc/gitweb.conf/38FeatureGrepSearch
Executable file
10
root/etc/e-smith/templates/etc/gitweb.conf/38FeatureGrepSearch
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# Disable grep search, which will list the files in currently selected tree
|
||||||
|
# containing the given string. This can be potentially CPU-intensive, of
|
||||||
|
# course. Enabled by default.
|
||||||
|
$feature\{'grep'\}\{'default'\} = [1];
|
||||||
|
|
||||||
|
# Allow projects to override the default setting via git config file.
|
||||||
|
# Example: gitweb.grep = 0|1;
|
||||||
|
$feature\{'grep'\}\{'override'\} = 1;
|
||||||
|
|
9
root/etc/e-smith/templates/etc/gitweb.conf/40FeaturePickaxeSearch
Executable file
9
root/etc/e-smith/templates/etc/gitweb.conf/40FeaturePickaxeSearch
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
# Disable the pickaxe search, which will list the commits that modified a given
|
||||||
|
# string in a file. This can be practical and quite faster alternative to
|
||||||
|
# 'blame', but still potentially CPU-intensive. Enabled by default.
|
||||||
|
$feature{'pickaxe'}{'default'} = [1];
|
||||||
|
|
||||||
|
# Allow projects to override the default setting via git config file.
|
||||||
|
# Example: gitweb.pickaxe = 0|1;
|
||||||
|
$feature\{'pickaxe'\}\{'override'\} = 1;
|
4
root/etc/e-smith/templates/etc/gitweb.conf/42PreventXSS
Executable file
4
root/etc/e-smith/templates/etc/gitweb.conf/42PreventXSS
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
# Allow the use of README.html in repository directories as we trust the submitters of our repositories.
|
||||||
|
$prevent_xss = 0;
|
||||||
|
|
25
root/etc/e-smith/templates/etc/gitweb.conf/52AuthError
Normal file
25
root/etc/e-smith/templates/etc/gitweb.conf/52AuthError
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
####
|
||||||
|
# Authentication Error Magic:
|
||||||
|
sub auth_error \{
|
||||||
|
my $status = shift;
|
||||||
|
my $error = esc_html(shift);
|
||||||
|
|
||||||
|
my $headers = \{ -type => $content_type,
|
||||||
|
-charset => 'utf-8',
|
||||||
|
-status => $status \};
|
||||||
|
$headers->\{"WWW-Authenticate"\} = 'Basic realm="Git Repositories"' if ($status =~ /^401/);
|
||||||
|
|
||||||
|
print $cgi->header($headers);
|
||||||
|
git_header_html(undef, undef, -no_http_header => 1);
|
||||||
|
print "<div class=\"index_include\"><br /><br />";
|
||||||
|
print "$status - <b>Error:</b> $error";
|
||||||
|
print "<br />";
|
||||||
|
if ($cgi->param("reqauth") && $status =~ /^401/) \{
|
||||||
|
print '<a href="?">Click here</a> to retry without authentication<br />';
|
||||||
|
\}
|
||||||
|
print "</div>";
|
||||||
|
git_footer_html();
|
||||||
|
goto DONE_GITWEB;
|
||||||
|
\};
|
||||||
|
|
158
root/etc/e-smith/templates/etc/gitweb.conf/60ExportAuthHook
Normal file
158
root/etc/e-smith/templates/etc/gitweb.conf/60ExportAuthHook
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
####
|
||||||
|
# Password Check - Returns 0 when password validated OK, or !0 otherwise
|
||||||
|
#
|
||||||
|
|
||||||
|
sub trypass \{
|
||||||
|
my $userid= $_[0];
|
||||||
|
my $passwd= $_[1];
|
||||||
|
|
||||||
|
# Find the pwauth program. It is in a different location in SME8 and SME9
|
||||||
|
if( -f "/usr/bin/pwauth" ) \{
|
||||||
|
$pwauth_path= "/usr/bin/pwauth";
|
||||||
|
\}
|
||||||
|
elsif( -f "/usr/lib/httpd/modules/pwauth" ) \{
|
||||||
|
$pwauth_path= "/usr/lib/httpd/modules/pwauth";
|
||||||
|
\}
|
||||||
|
else \{
|
||||||
|
$pwauth_path = "";
|
||||||
|
\}
|
||||||
|
|
||||||
|
open PWAUTH, "|$pwauth_path" or die("Could not run $pwauth_path");
|
||||||
|
print PWAUTH "$userid\n$passwd\n";
|
||||||
|
close PWAUTH;
|
||||||
|
return $?;
|
||||||
|
\}
|
||||||
|
|
||||||
|
####
|
||||||
|
# Install a export authorisation hook to ensure Gitweb only list thise projects that the user
|
||||||
|
# is authorised to see.
|
||||||
|
# local_unauthorised internet_unauthorised local_authorised internet_authorised
|
||||||
|
# internet anonymous pull Yes Yes Yes
|
||||||
|
# local anonymous pull Yes No Yes
|
||||||
|
# internet && authorised pull Yes No Yes
|
||||||
|
# local && authorised pull Yes No Yes
|
||||||
|
|
||||||
|
use esmith::GitDB;
|
||||||
|
use MIME::Base64;
|
||||||
|
use NetAddr::IP;
|
||||||
|
|
||||||
|
$export_auth_hook = sub \{
|
||||||
|
my $isindex = 0;
|
||||||
|
my $projectdir = shift;
|
||||||
|
|
||||||
|
our $cgi;
|
||||||
|
|
||||||
|
# If "reqauth" parameter is set, send back a 401 if there's no auth
|
||||||
|
if ($cgi->param("reqauth") and not defined $ENV\{"HTTP_AUTHORIZATION"\}) \{
|
||||||
|
auth_error("401 Unauthorized",
|
||||||
|
"You wanted to provide authorization, so I asked for it.");
|
||||||
|
\}
|
||||||
|
|
||||||
|
# Don't allow hidden .git dirs (like the toplevel one)
|
||||||
|
return 0 if ($projectdir =~ m-/.git-);
|
||||||
|
|
||||||
|
if ($action =~ m/^(?:opml|project_list|project_index)$/) \{
|
||||||
|
# They're viewing an index.
|
||||||
|
|
||||||
|
# If gitweb-noindex is in the repo, disallow it now.
|
||||||
|
return 0 if (-e "$projectdir/gitweb-noindex");
|
||||||
|
|
||||||
|
$isindex = 1;
|
||||||
|
\}
|
||||||
|
|
||||||
|
# Check authorisation
|
||||||
|
|
||||||
|
my $repository_view_allowed = 0;
|
||||||
|
my $internet_access_allowed = 0;
|
||||||
|
my $host_request_allowed = 0; # Will be 1 when the view is allowed based on the current host address and 'allow_access_from' setting
|
||||||
|
my $anonymous_pull = 0; # Will be 1 when the repository does not require pull authorisation
|
||||||
|
my $authorised_repository_view_allowed = 0; # Will be 1 when the authorised user has pull permissions on the repository
|
||||||
|
my $pull_users = '';
|
||||||
|
|
||||||
|
# Retrieve project properties from DB
|
||||||
|
|
||||||
|
if($projectdir =~ (/(.*?)\.git/)) \{
|
||||||
|
my $projectname = basename($1);
|
||||||
|
|
||||||
|
# Retrieve project properties from database
|
||||||
|
my $git_db = esmith::GitDB->open_ro() or
|
||||||
|
auth_error( "500 Internal Error", "Could not open the Git repository database! Does the web server have permission to read the git database file?" );
|
||||||
|
|
||||||
|
my $repository = $git_db->get($projectname) or
|
||||||
|
auth_error( "500 Internal Error", "The git repository '$projectname' does not seem to exist in the repository database!" );
|
||||||
|
|
||||||
|
my %properties = $repository->props;
|
||||||
|
|
||||||
|
# Check if the request is from a local IP address for this host
|
||||||
|
my @network_set = split(/ /, $local_network_setting );
|
||||||
|
|
||||||
|
for my $cur_network (@network_set) \{
|
||||||
|
$cur_network = "$cur_network/255.255.255.255" unless $cur_network =~ /[0-9.]*\/[0-9.]*/;
|
||||||
|
|
||||||
|
# Get server private IP address and mask for access to the local
|
||||||
|
# network only
|
||||||
|
my @network_setting = split(/\//, $cur_network );
|
||||||
|
|
||||||
|
# Check if the REMOTE_ADDR is within the range of the
|
||||||
|
# 'private' address for this server
|
||||||
|
my $remote_addr = NetAddr::IP->new( $ENV{'REMOTE_ADDR'} );
|
||||||
|
if( $remote_addr->within( new NetAddr::IP @network_setting[0], @network_setting[1] ) ) \{
|
||||||
|
return 1; # EXIT LOCAL HOST -> REPOSITORY VIEW ALLOWED
|
||||||
|
\}
|
||||||
|
\}
|
||||||
|
|
||||||
|
# See if internet access is allowed on this repository.
|
||||||
|
if ($properties\{'allow_access_from'\}) \{
|
||||||
|
if ($properties\{'allow_access_from'\} eq 'internet') \{
|
||||||
|
$internet_access_allowed = 1;
|
||||||
|
\}
|
||||||
|
\}
|
||||||
|
|
||||||
|
# See if anonymous pull is allowed on this repository.
|
||||||
|
if( ($properties\{'pull_groups'\} eq '') && ($properties\{'pull_users'\} eq '') ) \{
|
||||||
|
$anonymous_pull = 1;
|
||||||
|
\}
|
||||||
|
|
||||||
|
if( $internet_access_allowed && $anonymous_pull ) \{
|
||||||
|
return 1; # EXIT INTERNET ACCESS WITH ANONYMOUS PULL -> REPOSITORY VIEW ALLOWED
|
||||||
|
\}
|
||||||
|
|
||||||
|
# For the remaining access from the internet, we need an authorised user
|
||||||
|
# that is allowed to either pull or push this repository.
|
||||||
|
|
||||||
|
# Check if we have:
|
||||||
|
# a) a user that is listed in the repository pull or push permissions
|
||||||
|
# b) valid credentials i.e password can be validated.
|
||||||
|
if( $ENV\{'HTTP_AUTHORIZATION'\} ) \{
|
||||||
|
my @http_authorisation = split(/ /, $ENV\{'HTTP_AUTHORIZATION'\} );
|
||||||
|
my @http_digest = split( /:/, decode_base64( @http_authorisation[1] ) );
|
||||||
|
|
||||||
|
# See who the effective users are for this repository. The AccountsDB needs
|
||||||
|
# to have world read permissions to allow this to work.
|
||||||
|
my @pulled_user_groups;
|
||||||
|
for my $ggroup (split(',',$properties\{'pull_groups'\}))
|
||||||
|
\{
|
||||||
|
my ($name,$passwd,$gid,$members)=getgrnam($ggroup);
|
||||||
|
push @pulled_user_groups , split(' ',$members);
|
||||||
|
\}
|
||||||
|
push @pulled_user_groups, split(',',$properties\{'pull_users'\});
|
||||||
|
@pulled_user_groups = do \{ my %seen; grep \{ !$seen\{$_\}++ \} @pulled_user_groups \};
|
||||||
|
|
||||||
|
if( @http_digest[0] ~~ @pulled_user_groups ) \{
|
||||||
|
# USER IN AUTHORISED LIST -> CHECK PASSWORD
|
||||||
|
if( trypass( @http_digest[0], @http_digest[1] ) == 0 ) \{
|
||||||
|
return 1; # EXIT USER IS AUTHORISED -> REPOSITORY VIEW ALLOWED
|
||||||
|
\} else \{
|
||||||
|
auth_error( "401 Unauthorized", "Permission denied" );
|
||||||
|
\}
|
||||||
|
\} else \{
|
||||||
|
return 0; # EXIT USER NOT IN AUTHORISED LIST -> DENY REPOSITORY VIEW
|
||||||
|
\}
|
||||||
|
\} else \{
|
||||||
|
return 0; # EXIT NO AUTHORISATION SUPPLIED -> DENY REPOSITORY VIEW
|
||||||
|
\}
|
||||||
|
\}
|
||||||
|
|
||||||
|
# Not reached. No access.
|
||||||
|
return 0;
|
||||||
|
\};
|
11
root/etc/e-smith/templates/etc/gitweb.conf/70GravatarURL
Executable file
11
root/etc/e-smith/templates/etc/gitweb.conf/70GravatarURL
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
####
|
||||||
|
# Override gravatar function so we can use https, and choose a default
|
||||||
|
sub gravatar_url \{
|
||||||
|
my $email = lc shift;
|
||||||
|
my $size = shift;
|
||||||
|
$avatar_cache\{$email\} ||=
|
||||||
|
"https://secure.gravatar.com/avatar/" .
|
||||||
|
Digest::MD5::md5_hex($email) . "?d=mm&s=";
|
||||||
|
return $avatar_cache\{$email\} . $size;
|
||||||
|
\}
|
19
root/etc/e-smith/templates/etc/gitweb.conf/template-begin
Executable file
19
root/etc/e-smith/templates/etc/gitweb.conf/template-begin
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#------------------------------------------------------------
|
||||||
|
# *** DO NOT MODIFY THIS FILE! ***
|
||||||
|
#
|
||||||
|
# This is the configuration file for GitWeb.
|
||||||
|
#
|
||||||
|
# It is updated automatically by the SME Server software.
|
||||||
|
#
|
||||||
|
# To modify copy the required template fragment from
|
||||||
|
# /etc/e-smith/templates/etc/gitweb.conf into
|
||||||
|
# /etc/e-smith/templates-custom/etc/gitweb.conf and
|
||||||
|
# modify it there.
|
||||||
|
#
|
||||||
|
# The use "expand-template /etc/gitweb.conf"
|
||||||
|
#
|
||||||
|
# For more information, see http://wiki.contribs.org/Template_Tutorial
|
||||||
|
#
|
||||||
|
# Copyright (C) 2012 Marco Hess <marco.hess@through-ip.com>
|
||||||
|
#------------------------------------------------------------
|
||||||
|
|
0
root/etc/e-smith/templates/etc/httpd/conf/.gitignore
vendored
Normal file
0
root/etc/e-smith/templates/etc/httpd/conf/.gitignore
vendored
Normal file
1
root/etc/e-smith/web/common/gitweb/home_text.html
Executable file
1
root/etc/e-smith/web/common/gitweb/home_text.html
Executable file
@@ -0,0 +1 @@
|
|||||||
|
This text is in /etc/e-smith/web/common/gitweb/home_text.html
|
30
root/usr/share/markdown/License.text
Executable file
30
root/usr/share/markdown/License.text
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
Copyright (c) 2004, John Gruber
|
||||||
|
<http://daringfireball.net/>
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name "Markdown" nor the names of its contributors may
|
||||||
|
be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
|
||||||
|
This software is provided by the copyright holders and contributors "as
|
||||||
|
is" and any express or implied warranties, including, but not limited
|
||||||
|
to, the implied warranties of merchantability and fitness for a
|
||||||
|
particular purpose are disclaimed. In no event shall the copyright owner
|
||||||
|
or contributors be liable for any direct, indirect, incidental, special,
|
||||||
|
exemplary, or consequential damages (including, but not limited to,
|
||||||
|
procurement of substitute goods or services; loss of use, data, or
|
||||||
|
profits; or business interruption) however caused and on any theory of
|
||||||
|
liability, whether in contract, strict liability, or tort (including
|
||||||
|
negligence or otherwise) arising in any way out of the use of this
|
||||||
|
software, even if advised of the possibility of such damage.
|
1450
root/usr/share/markdown/Markdown.pl
Executable file
1450
root/usr/share/markdown/Markdown.pl
Executable file
File diff suppressed because it is too large
Load Diff
341
root/usr/share/markdown/Markdown_Readme.text
Executable file
341
root/usr/share/markdown/Markdown_Readme.text
Executable file
@@ -0,0 +1,341 @@
|
|||||||
|
Markdown
|
||||||
|
========
|
||||||
|
|
||||||
|
Version 1.0.1 - Tue 14 Dec 2004
|
||||||
|
|
||||||
|
by John Gruber
|
||||||
|
<http://daringfireball.net/>
|
||||||
|
|
||||||
|
|
||||||
|
Introduction
|
||||||
|
------------
|
||||||
|
|
||||||
|
Markdown is a text-to-HTML conversion tool for web writers. Markdown
|
||||||
|
allows you to write using an easy-to-read, easy-to-write plain text
|
||||||
|
format, then convert it to structurally valid XHTML (or HTML).
|
||||||
|
|
||||||
|
Thus, "Markdown" is two things: a plain text markup syntax, and a
|
||||||
|
software tool, written in Perl, that converts the plain text markup
|
||||||
|
to HTML.
|
||||||
|
|
||||||
|
Markdown works both as a Movable Type plug-in and as a standalone Perl
|
||||||
|
script -- which means it can also be used as a text filter in BBEdit
|
||||||
|
(or any other application that supporst filters written in Perl).
|
||||||
|
|
||||||
|
Full documentation of Markdown's syntax and configuration options is
|
||||||
|
available on the web: <http://daringfireball.net/projects/markdown/>.
|
||||||
|
(Note: this readme file is formatted in Markdown.)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Installation and Requirements
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
Markdown requires Perl 5.6.0 or later. Welcome to the 21st Century.
|
||||||
|
Markdown also requires the standard Perl library module `Digest::MD5`.
|
||||||
|
|
||||||
|
|
||||||
|
### Movable Type ###
|
||||||
|
|
||||||
|
Markdown works with Movable Type version 2.6 or later (including
|
||||||
|
MT 3.0 or later).
|
||||||
|
|
||||||
|
1. Copy the "Markdown.pl" file into your Movable Type "plugins"
|
||||||
|
directory. The "plugins" directory should be in the same directory
|
||||||
|
as "mt.cgi"; if the "plugins" directory doesn't already exist, use
|
||||||
|
your FTP program to create it. Your installation should look like
|
||||||
|
this:
|
||||||
|
|
||||||
|
(mt home)/plugins/Markdown.pl
|
||||||
|
|
||||||
|
2. Once installed, Markdown will appear as an option in Movable Type's
|
||||||
|
Text Formatting pop-up menu. This is selectable on a per-post basis.
|
||||||
|
Markdown translates your posts to HTML when you publish; the posts
|
||||||
|
themselves are stored in your MT database in Markdown format.
|
||||||
|
|
||||||
|
3. If you also install SmartyPants 1.5 (or later), Markdown will offer
|
||||||
|
a second text formatting option: "Markdown with SmartyPants". This
|
||||||
|
option is the same as the regular "Markdown" formatter, except that
|
||||||
|
automatically uses SmartyPants to create typographically correct
|
||||||
|
curly quotes, em-dashes, and ellipses. See the SmartyPants web page
|
||||||
|
for more information: <http://daringfireball.net/projects/smartypants/>
|
||||||
|
|
||||||
|
4. To make Markdown (or "Markdown with SmartyPants") your default
|
||||||
|
text formatting option for new posts, go to Weblog Config ->
|
||||||
|
Preferences.
|
||||||
|
|
||||||
|
Note that by default, Markdown produces XHTML output. To configure
|
||||||
|
Markdown to produce HTML 4 output, see "Configuration", below.
|
||||||
|
|
||||||
|
|
||||||
|
### Blosxom ###
|
||||||
|
|
||||||
|
Markdown works with Blosxom version 2.x.
|
||||||
|
|
||||||
|
1. Rename the "Markdown.pl" plug-in to "Markdown" (case is
|
||||||
|
important). Movable Type requires plug-ins to have a ".pl"
|
||||||
|
extension; Blosxom forbids it.
|
||||||
|
|
||||||
|
2. Copy the "Markdown" plug-in file to your Blosxom plug-ins folder.
|
||||||
|
If you're not sure where your Blosxom plug-ins folder is, see the
|
||||||
|
Blosxom documentation for information.
|
||||||
|
|
||||||
|
3. That's it. The entries in your weblog will now automatically be
|
||||||
|
processed by Markdown.
|
||||||
|
|
||||||
|
4. If you'd like to apply Markdown formatting only to certain posts,
|
||||||
|
rather than all of them, see Jason Clark's instructions for using
|
||||||
|
Markdown in conjunction with Blosxom's Meta plugin:
|
||||||
|
|
||||||
|
<http://jclark.org/weblog/WebDev/Blosxom/Markdown.html>
|
||||||
|
|
||||||
|
|
||||||
|
### BBEdit ###
|
||||||
|
|
||||||
|
Markdown works with BBEdit 6.1 or later on Mac OS X. (It also works
|
||||||
|
with BBEdit 5.1 or later and MacPerl 5.6.1 on Mac OS 8.6 or later.)
|
||||||
|
|
||||||
|
1. Copy the "Markdown.pl" file to appropriate filters folder in your
|
||||||
|
"BBEdit Support" folder. On Mac OS X, this should be:
|
||||||
|
|
||||||
|
BBEdit Support/Unix Support/Unix Filters/
|
||||||
|
|
||||||
|
See the BBEdit documentation for more details on the location of
|
||||||
|
these folders.
|
||||||
|
|
||||||
|
You can rename "Markdown.pl" to whatever you wish.
|
||||||
|
|
||||||
|
2. That's it. To use Markdown, select some text in a BBEdit document,
|
||||||
|
then choose Markdown from the Filters sub-menu in the "#!" menu, or
|
||||||
|
the Filters floating palette
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
-------------
|
||||||
|
|
||||||
|
By default, Markdown produces XHTML output for tags with empty elements.
|
||||||
|
E.g.:
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
Markdown can be configured to produce HTML-style tags; e.g.:
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
### Movable Type ###
|
||||||
|
|
||||||
|
You need to use a special `MTMarkdownOptions` container tag in each
|
||||||
|
Movable Type template where you want HTML 4-style output:
|
||||||
|
|
||||||
|
<MTMarkdownOptions output='html4'>
|
||||||
|
... put your entry content here ...
|
||||||
|
</MTMarkdownOptions>
|
||||||
|
|
||||||
|
The easiest way to use MTMarkdownOptions is probably to put the
|
||||||
|
opening tag right after your `<body>` tag, and the closing tag right
|
||||||
|
before `</body>`.
|
||||||
|
|
||||||
|
To suppress Markdown processing in a particular template, i.e. to
|
||||||
|
publish the raw Markdown-formatted text without translation into
|
||||||
|
(X)HTML, set the `output` attribute to 'raw':
|
||||||
|
|
||||||
|
<MTMarkdownOptions output='raw'>
|
||||||
|
... put your entry content here ...
|
||||||
|
</MTMarkdownOptions>
|
||||||
|
|
||||||
|
|
||||||
|
### Command-Line ###
|
||||||
|
|
||||||
|
Use the `--html4tags` command-line switch to produce HTML output from a
|
||||||
|
Unix-style command line. E.g.:
|
||||||
|
|
||||||
|
% perl Markdown.pl --html4tags foo.text
|
||||||
|
|
||||||
|
Type `perldoc Markdown.pl`, or read the POD documentation within the
|
||||||
|
Markdown.pl source code for more information.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Bugs
|
||||||
|
----
|
||||||
|
|
||||||
|
To file bug reports or feature requests please send email to:
|
||||||
|
<markdown@daringfireball.net>.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Version History
|
||||||
|
---------------
|
||||||
|
|
||||||
|
1.0.1 (14 Dec 2004):
|
||||||
|
|
||||||
|
+ Changed the syntax rules for code blocks and spans. Previously,
|
||||||
|
backslash escapes for special Markdown characters were processed
|
||||||
|
everywhere other than within inline HTML tags. Now, the contents
|
||||||
|
of code blocks and spans are no longer processed for backslash
|
||||||
|
escapes. This means that code blocks and spans are now treated
|
||||||
|
literally, with no special rules to worry about regarding
|
||||||
|
backslashes.
|
||||||
|
|
||||||
|
**NOTE**: This changes the syntax from all previous versions of
|
||||||
|
Markdown. Code blocks and spans involving backslash characters
|
||||||
|
will now generate different output than before.
|
||||||
|
|
||||||
|
+ Tweaked the rules for link definitions so that they must occur
|
||||||
|
within three spaces of the left margin. Thus if you indent a link
|
||||||
|
definition by four spaces or a tab, it will now be a code block.
|
||||||
|
|
||||||
|
[a]: /url/ "Indented 3 spaces, this is a link def"
|
||||||
|
|
||||||
|
[b]: /url/ "Indented 4 spaces, this is a code block"
|
||||||
|
|
||||||
|
**IMPORTANT**: This may affect existing Markdown content if it
|
||||||
|
contains link definitions indented by 4 or more spaces.
|
||||||
|
|
||||||
|
+ Added `>`, `+`, and `-` to the list of backslash-escapable
|
||||||
|
characters. These should have been done when these characters
|
||||||
|
were added as unordered list item markers.
|
||||||
|
|
||||||
|
+ Trailing spaces and tabs following HTML comments and `<hr/>` tags
|
||||||
|
are now ignored.
|
||||||
|
|
||||||
|
+ Inline links using `<` and `>` URL delimiters weren't working:
|
||||||
|
|
||||||
|
like [this](<http://example.com/>)
|
||||||
|
|
||||||
|
+ Added a bit of tolerance for trailing spaces and tabs after
|
||||||
|
Markdown hr's.
|
||||||
|
|
||||||
|
+ Fixed bug where auto-links were being processed within code spans:
|
||||||
|
|
||||||
|
like this: `<http://example.com/>`
|
||||||
|
|
||||||
|
+ Sort-of fixed a bug where lines in the middle of hard-wrapped
|
||||||
|
paragraphs, which lines look like the start of a list item,
|
||||||
|
would accidentally trigger the creation of a list. E.g. a
|
||||||
|
paragraph that looked like this:
|
||||||
|
|
||||||
|
I recommend upgrading to version
|
||||||
|
8. Oops, now this line is treated
|
||||||
|
as a sub-list.
|
||||||
|
|
||||||
|
This is fixed for top-level lists, but it can still happen for
|
||||||
|
sub-lists. E.g., the following list item will not be parsed
|
||||||
|
properly:
|
||||||
|
|
||||||
|
+ I recommend upgrading to version
|
||||||
|
8. Oops, now this line is treated
|
||||||
|
as a sub-list.
|
||||||
|
|
||||||
|
Given Markdown's list-creation rules, I'm not sure this can
|
||||||
|
be fixed.
|
||||||
|
|
||||||
|
+ Standalone HTML comments are now handled; previously, they'd get
|
||||||
|
wrapped in a spurious `<p>` tag.
|
||||||
|
|
||||||
|
+ Fix for horizontal rules preceded by 2 or 3 spaces.
|
||||||
|
|
||||||
|
+ `<hr>` HTML tags in must occur within three spaces of left
|
||||||
|
margin. (With 4 spaces or a tab, they should be code blocks, but
|
||||||
|
weren't before this fix.)
|
||||||
|
|
||||||
|
+ Capitalized "With" in "Markdown With SmartyPants" for
|
||||||
|
consistency with the same string label in SmartyPants.pl.
|
||||||
|
(This fix is specific to the MT plug-in interface.)
|
||||||
|
|
||||||
|
+ Auto-linked email address can now optionally contain
|
||||||
|
a 'mailto:' protocol. I.e. these are equivalent:
|
||||||
|
|
||||||
|
<mailto:user@example.com>
|
||||||
|
<user@example.com>
|
||||||
|
|
||||||
|
+ Fixed annoying bug where nested lists would wind up with
|
||||||
|
spurious (and invalid) `<p>` tags.
|
||||||
|
|
||||||
|
+ You can now write empty links:
|
||||||
|
|
||||||
|
[like this]()
|
||||||
|
|
||||||
|
and they'll be turned into anchor tags with empty href attributes.
|
||||||
|
This should have worked before, but didn't.
|
||||||
|
|
||||||
|
+ `***this***` and `___this___` are now turned into
|
||||||
|
|
||||||
|
<strong><em>this</em></strong>
|
||||||
|
|
||||||
|
Instead of
|
||||||
|
|
||||||
|
<strong><em>this</strong></em>
|
||||||
|
|
||||||
|
which isn't valid. (Thanks to Michel Fortin for the fix.)
|
||||||
|
|
||||||
|
+ Added a new substitution in `_EncodeCode()`: s/\$/$/g; This
|
||||||
|
is only for the benefit of Blosxom users, because Blosxom
|
||||||
|
(sometimes?) interpolates Perl scalars in your article bodies.
|
||||||
|
|
||||||
|
+ Fixed problem for links defined with urls that include parens, e.g.:
|
||||||
|
|
||||||
|
[1]: http://sources.wikipedia.org/wiki/Middle_East_Policy_(Chomsky)
|
||||||
|
|
||||||
|
"Chomsky" was being erroneously treated as the URL's title.
|
||||||
|
|
||||||
|
+ At some point during 1.0's beta cycle, I changed every sub's
|
||||||
|
argument fetching from this idiom:
|
||||||
|
|
||||||
|
my $text = shift;
|
||||||
|
|
||||||
|
to:
|
||||||
|
|
||||||
|
my $text = shift || return '';
|
||||||
|
|
||||||
|
The idea was to keep Markdown from doing any work in a sub
|
||||||
|
if the input was empty. This introduced a bug, though:
|
||||||
|
if the input to any function was the single-character string
|
||||||
|
"0", it would also evaluate as false and return immediately.
|
||||||
|
How silly. Now fixed.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Donations
|
||||||
|
---------
|
||||||
|
|
||||||
|
Donations to support Markdown's development are happily accepted. See:
|
||||||
|
<http://daringfireball.net/projects/markdown/> for details.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Copyright and License
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
Copyright (c) 2003-2004 John Gruber
|
||||||
|
<http://daringfireball.net/>
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name "Markdown" nor the names of its contributors may
|
||||||
|
be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
|
||||||
|
This software is provided by the copyright holders and contributors "as
|
||||||
|
is" and any express or implied warranties, including, but not limited
|
||||||
|
to, the implied warranties of merchantability and fitness for a
|
||||||
|
particular purpose are disclaimed. In no event shall the copyright owner
|
||||||
|
or contributors be liable for any direct, indirect, incidental, special,
|
||||||
|
exemplary, or consequential damages (including, but not limited to,
|
||||||
|
procurement of substitute goods or services; loss of use, data, or
|
||||||
|
profits; or business interruption) however caused and on any theory of
|
||||||
|
liability, whether in contract, strict liability, or tort (including
|
||||||
|
negligence or otherwise) arising in any way out of the use of this
|
||||||
|
software, even if advised of the possibility of such damage.
|
127
smeserver-gitweb.spec
Executable file
127
smeserver-gitweb.spec
Executable file
@@ -0,0 +1,127 @@
|
|||||||
|
%define name smeserver-gitweb
|
||||||
|
%define version 1.1.0
|
||||||
|
%define release 15
|
||||||
|
Summary: GitWeb is a web based Git repository viewer on SME Server
|
||||||
|
Name: %{name}
|
||||||
|
Version: %{version}
|
||||||
|
Release: %{release}%{?dist}
|
||||||
|
Distribution: SME Server
|
||||||
|
License: GNU GPL version 2
|
||||||
|
URL: http://www.through-ip.com
|
||||||
|
Group: SMEserver/addon
|
||||||
|
Source: smeserver-gitweb-%{version}.tar.xz
|
||||||
|
Packager: Marco Hess <marco.hess@through-ip.com>
|
||||||
|
BuildArchitectures: noarch
|
||||||
|
BuildRoot: /var/tmp/%{name}-%{version}
|
||||||
|
BuildRequires: e-smith-devtools
|
||||||
|
Requires: e-smith-release >= 9.0
|
||||||
|
Requires: smeserver-git
|
||||||
|
Requires: gitweb
|
||||||
|
Requires: highlight
|
||||||
|
AutoReqProv: no
|
||||||
|
|
||||||
|
%description
|
||||||
|
HTTP access to https://git.host.com provides a gitweb view of the repositories.
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Thu Oct 09 2025 cvs2git.sh aka Brian Read <brianr@koozali.org> 1.1.0-15.sme
|
||||||
|
- Roll up patches and move to git repo [SME: 12338]
|
||||||
|
|
||||||
|
* Thu Oct 09 2025 BogusDateBot
|
||||||
|
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
|
||||||
|
by assuming the date is correct and changing the weekday.
|
||||||
|
|
||||||
|
* Fri Mar 26 2021 Brian Read <brianr@bjsystems.co.uk> 1.1.0-14.sme
|
||||||
|
- Add Update event to createlinks [SME: 11286]
|
||||||
|
|
||||||
|
* Fri Mar 26 2021 BogusDateBot
|
||||||
|
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
|
||||||
|
by assuming the date is correct and changing the weekday.
|
||||||
|
|
||||||
|
* Sun Dec 20 2020 Brian Read <brianr@bjsystems.co.uk> 1.1.0-13.sme
|
||||||
|
- Initial import to SME10 tree [SME: 11286]
|
||||||
|
|
||||||
|
* Mon Feb 06 2017 Jean-Philipe Pialasse <tests@pialasse.com> 1.1.0-12.sme
|
||||||
|
- revert local patch wrongly applied [SME: 10077]
|
||||||
|
|
||||||
|
* Fri Jun 24 2016 Jean-Philipe Pialasse <tests@pialasse.com> 1.1.0-11.sme
|
||||||
|
- removed one missed linefeed
|
||||||
|
|
||||||
|
* Wed Jun 22 2016 Jean-Philipe Pialasse <tests@pialasse.com> 1.1.0-8.sme
|
||||||
|
- smeserver-git-1.1.0-locale-2016-06-22.patch
|
||||||
|
|
||||||
|
* Wed Jun 22 2016 Jean-Philipe Pialasse <tests@pialasse.com> 1.1.0-7.sme
|
||||||
|
- Add Update event to createlinks 500 error after auth on remote access [SME: 9614]
|
||||||
|
- check all trusted networks [SME: 9578]
|
||||||
|
- Add Update event to createlinks git db readable by everybody [SME: 9615]
|
||||||
|
|
||||||
|
* Sat Jun 11 2016 Jean-Philipe Pialasse <tests@pialasse.com> 1.1.0-6.sme
|
||||||
|
- Add Update event to createlinks auth from remote IP [SME: 9202]
|
||||||
|
|
||||||
|
* Fri Jun 10 2016 Jean-Philipe Pialasse <tests@pialasse.com> 1.1.0-5.sme
|
||||||
|
- Add Update event to createlinks short url to repo not working [SME: 9202]
|
||||||
|
|
||||||
|
* Thu Feb 18 2016 Marco Hess <marco.hess@through-ip.com> 1.1.0-4
|
||||||
|
- Removed chmod 644 /home/e-smith/db/networks from spec file as
|
||||||
|
it is no longer required for gitweb.conf
|
||||||
|
|
||||||
|
* Wed Feb 17 2016 Marco Hess <marco.hess@through-ip.com> 1.1.0-3
|
||||||
|
- Changed the trypass function in 60ExportAuthHook to dynamically
|
||||||
|
check for the location of pwauth so this becomes universal for
|
||||||
|
SME8 and SME9.
|
||||||
|
|
||||||
|
* Wed Feb 17 2016 Marco Hess <marco.hess@through-ip.com> 1.1.0-2
|
||||||
|
- Remove runtime access to NetworkDB [SME: 9217]
|
||||||
|
- Some trailing whitespace cleanup
|
||||||
|
|
||||||
|
* Thu Feb 11 2016 Marco Hess <marco.hess@through-ip.com> 1.1.0-1
|
||||||
|
- Remove unused line feeds from auth_error messages [SME: 9217]
|
||||||
|
|
||||||
|
* Fri Jan 30 2015 Marco Hess <marco.hess@through-ip.com> 1.1.0-0
|
||||||
|
- Split spec package to version 1.1 for SME9
|
||||||
|
- Fixed user authorisation for repositories viewable from internet
|
||||||
|
|
||||||
|
* Fri Jan 24 2014 Marco Hess <marco.hess@through-ip.com> 1.0.0-12
|
||||||
|
- Added support for displaying a clone URL.
|
||||||
|
|
||||||
|
* Mon Jul 23 2012 Marco Hess <marco.hess@through-ip.com> 1.0.0-3
|
||||||
|
- Setup default config parameters for gitweb as a service
|
||||||
|
- Removed HTTP template as this is shared with smeserver-git
|
||||||
|
- Added require on gitweb rpm
|
||||||
|
|
||||||
|
* Sun Jun 17 2012 Jonathan Martens <smeserver-contribs@snetram.nl> 1.0.0-2
|
||||||
|
- Remove all smeserver-git related files in order to split the packages
|
||||||
|
|
||||||
|
* Sun Apr 29 2012 Marco Hess <marco.hess@through-ip.com> 1.0.0-1
|
||||||
|
- initial release
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup
|
||||||
|
|
||||||
|
|
||||||
|
%build
|
||||||
|
perl createlinks
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
|
||||||
|
rm -f %{name}-%{version}-filelist
|
||||||
|
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%post
|
||||||
|
echo "Ensuring git database is accessible to GitWeb ..."
|
||||||
|
touch /home/e-smith/db/git
|
||||||
|
chmod 644 /home/e-smith/db/git
|
||||||
|
echo "Expanding gitweb.conf template ..."
|
||||||
|
/sbin/e-smith/expand-template /etc/gitweb.conf
|
||||||
|
echo "Expanding GitWeb home page text template ..."
|
||||||
|
/sbin/e-smith/expand-template /etc/e-smith/web/common/gitweb/home_text.html
|
||||||
|
echo "Expanding web server template ..."
|
||||||
|
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
|
||||||
|
#/etc/rc7.d/S86httpd-e-smith sighup
|
||||||
|
|
||||||
|
%files -f %{name}-%{version}-filelist
|
||||||
|
%defattr(-,root,root)
|
Reference in New Issue
Block a user