summary refs log tree commit diff
path: root/OpenBSD/www
diff options
context:
space:
mode:
Diffstat (limited to 'OpenBSD/www')
-rw-r--r--OpenBSD/www/cgit-pink/Makefile39
-rw-r--r--OpenBSD/www/cgit-pink/distinfo4
-rw-r--r--OpenBSD/www/cgit-pink/patches/patch-Makefile30
-rw-r--r--OpenBSD/www/cgit-pink/patches/patch-cgit_mk11
-rw-r--r--OpenBSD/www/cgit-pink/patches/patch-setup_c20
-rw-r--r--OpenBSD/www/cgit-pink/pkg/DESCR2
-rw-r--r--OpenBSD/www/cgit-pink/pkg/PLIST14
-rw-r--r--OpenBSD/www/cgit-pink/pkg/README74
8 files changed, 194 insertions, 0 deletions
diff --git a/OpenBSD/www/cgit-pink/Makefile b/OpenBSD/www/cgit-pink/Makefile
new file mode 100644
index 0000000..845c0f9
--- /dev/null
+++ b/OpenBSD/www/cgit-pink/Makefile
@@ -0,0 +1,39 @@
+# $OpenBSD: Makefile,v 1.27 2020/04/04 19:28:31 kn Exp $
+
+COMMENT =	web frontend for git repositories
+
+DISTNAME =	cgit-pink-1.3.0
+CATEGORIES =	www devel
+
+DISTFILES =	${DISTNAME}.tar.gz:0 \
+		git-2.35.1.tar.gz:1
+
+MASTER_SITES0 =		https://git.causal.agency/cgit-pink/snapshot/
+MASTER_SITES1 =		https://www.kernel.org/pub/software/scm/git/
+HOMEPAGE =		https://git.causal.agency/cgit-pink/about/
+
+# GPLv2
+PERMIT_PACKAGE =	Yes
+
+USE_GMAKE =	yes
+
+BUILD_DEPENDS =	textproc/asciidoc
+LIB_DEPENDS =	converters/libiconv
+
+PREFIX =	${VARBASE}/www
+MAKE_FLAGS +=	V=1 NO_GETTEXT=1 EXTRA_GIT_TARGETS='git git-http-backend' LDFLAGS+='${STATIC} -L${LOCALBASE}/lib'
+
+ALL_TARGET =	all doc-man
+
+post-extract:
+	rmdir ${WRKSRC}/git
+	mv ${WRKDIR}/git-* ${WRKSRC}/git
+
+post-install:
+	mv ${PREFIX}/htdocs ${PREFIX}/cgit
+	${INSTALL_MAN} ${WRKBUILD}/cgitrc.5 ${WRKINST}${LOCALBASE}/man/man5
+	${INSTALL_PROGRAM_DIR} ${PREFIX}/bin
+	${INSTALL_PROGRAM} ${WRKBUILD}/git/git ${PREFIX}/bin
+	${INSTALL_PROGRAM} ${WRKBUILD}/git/git-http-backend ${PREFIX}/cgi-bin
+
+.include <bsd.port.mk>
diff --git a/OpenBSD/www/cgit-pink/distinfo b/OpenBSD/www/cgit-pink/distinfo
new file mode 100644
index 0000000..09172a8
--- /dev/null
+++ b/OpenBSD/www/cgit-pink/distinfo
@@ -0,0 +1,4 @@
+SHA256 (cgit-pink-1.3.0.tar.gz) = oL46NWgqi1VqKNEt0QGBWNXbi2l7nOQDZy1aMivcWuM=
+SHA256 (git-2.35.1.tar.gz) = mEWjfdAfn6qn2KogeDmdOuqRtDgZpe/qbih3sK8JvUM=
+SIZE (cgit-pink-1.3.0.tar.gz) = 103989
+SIZE (git-2.35.1.tar.gz) = 10511581
diff --git a/OpenBSD/www/cgit-pink/patches/patch-Makefile b/OpenBSD/www/cgit-pink/patches/patch-Makefile
new file mode 100644
index 0000000..b49eb37
--- /dev/null
+++ b/OpenBSD/www/cgit-pink/patches/patch-Makefile
@@ -0,0 +1,30 @@
+$OpenBSD: patch-Makefile,v 1.9 2018/08/04 09:19:35 kn Exp $
+Index: Makefile
+--- Makefile.orig
++++ Makefile
+@@ -2,11 +2,11 @@ all::
+ 
+ CGIT_VERSION = v1.2.1
+ CGIT_SCRIPT_NAME = cgit.cgi
+-CGIT_SCRIPT_PATH = /var/www/htdocs/cgit
+-CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH)
+-CGIT_CONFIG = /etc/cgitrc
+-CACHE_ROOT = /var/cache/cgit
+-prefix = /usr/local
++CGIT_SCRIPT_PATH = /var/www/cgi-bin
++CGIT_DATA_PATH = /var/www/htdocs
++CGIT_CONFIG = /conf/cgitrc
++CACHE_ROOT = /tmp/cgit
++prefix = ${PREFIX}
+ libdir = $(prefix)/lib
+ filterdir = $(libdir)/cgit/filters
+ docdir = $(prefix)/share/doc/cgit
+@@ -90,8 +90,6 @@ install: all
+ 	$(INSTALL) -m 0644 cgit.png $(DESTDIR)$(CGIT_DATA_PATH)/cgit.png
+ 	$(INSTALL) -m 0644 favicon.ico $(DESTDIR)$(CGIT_DATA_PATH)/favicon.ico
+ 	$(INSTALL) -m 0644 robots.txt $(DESTDIR)$(CGIT_DATA_PATH)/robots.txt
+-	$(INSTALL) -m 0755 -d $(DESTDIR)$(filterdir)
+-	$(COPYTREE) filters/* $(DESTDIR)$(filterdir)
+ 
+ install-doc: install-man install-html install-pdf
+ 
diff --git a/OpenBSD/www/cgit-pink/patches/patch-cgit_mk b/OpenBSD/www/cgit-pink/patches/patch-cgit_mk
new file mode 100644
index 0000000..c74f62d
--- /dev/null
+++ b/OpenBSD/www/cgit-pink/patches/patch-cgit_mk
@@ -0,0 +1,11 @@
+$OpenBSD: patch-cgit_mk,v 1.1 2013/07/15 07:00:49 jasper Exp $
+--- cgit.mk.orig	Sun Jul 14 23:18:05 2013
++++ cgit.mk	Sun Jul 14 23:18:39 2013
+@@ -17,6 +17,7 @@ $(CGIT_PREFIX)VERSION: force-version
+ 
+ # CGIT_CFLAGS is a separate variable so that we can track it separately
+ # and avoid rebuilding all of Git when these variables change.
++CGIT_CFLAGS += -L${LOCALBASE}/include
+ CGIT_CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"'
+ CGIT_CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"'
+ CGIT_CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"'
diff --git a/OpenBSD/www/cgit-pink/patches/patch-setup_c b/OpenBSD/www/cgit-pink/patches/patch-setup_c
new file mode 100644
index 0000000..eae3fc0
--- /dev/null
+++ b/OpenBSD/www/cgit-pink/patches/patch-setup_c
@@ -0,0 +1,20 @@
+$OpenBSD: patch-setup_c,v 1.1 2017/03/22 20:23:52 landry Exp $
+
+Dont openbsd dev/null, doesnt exist in the default chroot
+
+--- git/setup.c.orig	Wed Mar  1 21:01:06 2017
++++ git/setup.c	Wed Mar  1 21:01:56 2017
+@@ -1488,11 +1488,13 @@ const char *resolve_gitdir_gently(const char *suspect, int *return_error_code)
+ /* if any standard file descriptor is missing open it to /dev/null */
+ void sanitize_stdfds(void)
+ {
++#if 0
+ 	int fd = xopen("/dev/null", O_RDWR);
+ 	while (fd < 2)
+ 		fd = xdup(fd);
+ 	if (fd > 2)
+ 		close(fd);
++#endif
+ }
+ 
+ int daemonize(void)
diff --git a/OpenBSD/www/cgit-pink/pkg/DESCR b/OpenBSD/www/cgit-pink/pkg/DESCR
new file mode 100644
index 0000000..f85c78a
--- /dev/null
+++ b/OpenBSD/www/cgit-pink/pkg/DESCR
@@ -0,0 +1,2 @@
+This is an attempt to create a fast web interface for the git scm,
+using a builtin cache to decrease server io-pressure.
diff --git a/OpenBSD/www/cgit-pink/pkg/PLIST b/OpenBSD/www/cgit-pink/pkg/PLIST
new file mode 100644
index 0000000..aeb2763
--- /dev/null
+++ b/OpenBSD/www/cgit-pink/pkg/PLIST
@@ -0,0 +1,14 @@
+@comment $OpenBSD: PLIST,v 1.6 2018/09/04 12:46:24 espie Exp $
+@conflict cgit-*
+@group daemon
+@bin bin/git
+@bin cgi-bin/cgit.cgi
+@bin cgi-bin/git-http-backend
+@group
+cgit/
+cgit/cgit.css
+cgit/cgit.png
+cgit/robots.txt
+@cwd ${LOCALBASE}
+@man man/man5/cgitrc.5
+share/doc/pkg-readmes/${PKGSTEM}
diff --git a/OpenBSD/www/cgit-pink/pkg/README b/OpenBSD/www/cgit-pink/pkg/README
new file mode 100644
index 0000000..816ad9e
--- /dev/null
+++ b/OpenBSD/www/cgit-pink/pkg/README
@@ -0,0 +1,74 @@
+$OpenBSD: README,v 1.5 2018/09/04 12:46:24 espie Exp $
+
++-----------------------------------------------------------------------
+| Running ${PKGSTEM} on OpenBSD
++-----------------------------------------------------------------------
+
+Cgit config
+===========
+By default, the cgitrc config file is searched in ${PREFIX}/conf/cgitrc.
+Refer to cgitrc(5) for the syntax.
+
+Webserver config
+================
+
+OpenBSD httpd
+-------------
+server "default" {
+	listen on egress port 80
+
+	# don't serve static files from cgit CGI: cgit.css and cgit.png
+	location "/cgit.*" {
+		root "/cgit"
+		no fastcgi
+	}
+	root "/cgi-bin/cgit.cgi"
+	fastcgi socket "/run/slowcgi.sock"
+}
+
+Nginx
+-----
+An example nginx config snippet is provided below, to run with
+slowcgi:
+
+server {
+	server_name cgit.example.com;
+	access_log logs/cgit-access main;
+	error_log logs/cgit-error warn;
+	location ~ /cgit.(png|css) {
+		root /var/www/htdocs;
+	}
+	location / {
+		rewrite /(.*) /cgi-bin/cgit.cgi/$1;
+	}
+	location /cgi-bin/ {
+		fastcgi_pass unix:run/slowcgi.sock;
+		fastcgi_split_path_info ^(/cgi-bin/[^/]+)(.*);
+		fastcgi_param  PATH_INFO $fastcgi_path_info;
+		include fastcgi_params;
+	}
+}
+
+Apache config
+-------------
+
+This config snippet works with Apache:
+
+ScriptAlias /cgit /cgi-bin/cgit.cgi
+<Location "/cgit">
+	AllowOverride None
+	Options +ExecCGI
+	Order allow,deny
+	Allow from all
+</Location>
+
+
+snapshots
+---------
+Nginx and OpenBSD httpd use chroot(2).
+
+For .tar.gz snapshot support a static binary in $chroot/bin/gzip is required.
+
+	cd /usr/src/usr.bin/compress
+	make clean && make LDFLAGS="-static -pie"
+	cp obj/compress $chroot/bin/gzip
ight'> Update to git version v2.19.1. Required changes follow upstream commits: * commit: add repository argument to get_cached_commit_buffer (3ce85f7e5a41116145179f0fae2ce6d86558d099) * commit: add repository argument to lookup_commit_reference (2122f6754c93be8f02bfb5704ed96c88fc9837a8) * object: add repository argument to parse_object (109cd76dd3467bd05f8d2145b857006649741d5c) * tag: add repository argument to deref_tag (a74093da5ed601a09fa158e5ba6f6f14c1142a3e) * tag: add repository argument to lookup_tag (ce71efb713f97f476a2d2ab541a0c73f684a5db3) * tree: add repository argument to lookup_tree (f86bcc7b2ce6cad68ba1a48a528e380c6126705e) * archive.c: avoid access to the_index (b612ee202a48f129f81f8f6a5af6cf71d1a9caef) * for_each_*_object: move declarations to object-store.h (0889aae1cd18c1804ba01c1a4229e516dfb9fe9b) Signed-off-by: Christian Hesse <mail@eworm.de> 2018-09-11ui-ssdiff: ban strcat()Christian Hesse Git upstream bans strcat() with commit: banned.h: mark strcat() as banned 1b11b64b815db62f93a04242e4aed5687a448748 Signed-off-by: Christian Hesse <mail@eworm.de> 2018-09-11ui-ssdiff: ban strncpy()Christian Hesse Git upstream bans strncpy() with commit: banned.h: mark strncpy() as banned e488b7aba743d23b830d239dcc33d9ca0745a9ad Signed-off-by: Christian Hesse <mail@eworm.de> 2018-09-11ui-shared: ban strcat()Christian Hesse Git upstream bans strcat() with commit: banned.h: mark strcat() as banned 1b11b64b815db62f93a04242e4aed5687a448748 To avoid compiler warnings from gcc 8.1.x we get the hard way. Signed-off-by: Christian Hesse <mail@eworm.de> 2018-09-11ui-patch: ban sprintf()Christian Hesse Git upstream bans sprintf() with commit: banned.h: mark sprintf() as banned cc8fdaee1eeaf05d8dd55ff11f111b815f673c58 Signed-off-by: Christian Hesse <mail@eworm.de> 2018-09-11ui-log: ban strncpy()Christian Hesse Git upstream bans strncpy() with commit: banned.h: mark strncpy() as banned e488b7aba743d23b830d239dcc33d9ca0745a9ad Signed-off-by: Christian Hesse <mail@eworm.de> 2018-09-11ui-log: ban strcpy()Christian Hesse Git upstream bans strcpy() with commit: automatically ban strcpy() c8af66ab8ad7cd78557f0f9f5ef6a52fd46ee6dd Signed-off-by: Christian Hesse <mail@eworm.de> 2018-09-11parsing: ban sprintf()Christian Hesse Git upstream bans sprintf() with commit: banned.h: mark sprintf() as banned cc8fdaee1eeaf05d8dd55ff11f111b815f673c58 Signed-off-by: Christian Hesse <mail@eworm.de> 2018-09-11parsing: ban strncpy()Christian Hesse Git upstream bans strncpy() with commit: banned.h: mark strncpy() as banned e488b7aba743d23b830d239dcc33d9ca0745a9ad Signed-off-by: Christian Hesse <mail@eworm.de> 2018-08-28filters: generate anchor links from markdownChristian Hesse This makes the markdown filter generate anchor links for headings. Signed-off-by: Christian Hesse <mail@eworm.de> Tested-by: jean-christophe manciot <actionmystique@gmail.com> 2018-08-03Bump version.Jason A. Donenfeld Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> 2018-08-03clone: fix directory traversalJason A. Donenfeld This was introduced in the initial version of this code, way back when in 2008. $ curl http://127.0.0.1/cgit/repo/objects/?path=../../../../../../../../../etc/passwd root:x:0:0:root:/root:/bin/sh ... Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Reported-by: Jann Horn <jannh@google.com> 2018-08-03config: record repo.snapshot-prefix in the per-repo configKonstantin Ryabitsev