diff options
| author | dautor <karlo98.m@gmail.com> | 2024-11-15 13:47:50 +0100 |
|---|---|---|
| committer | dautor <karlo98.m@gmail.com> | 2024-11-16 14:25:00 +0100 |
| commit | bdd2396d19f5465ecaac3195deeceef29a867d52 (patch) | |
| tree | 2dbe4c83c833ef8b8bfe1473fda3a028136b4299 /cgit | |
Create example structure and add 2 examples
Diffstat (limited to 'cgit')
| -rw-r--r-- | cgit/description | 8 | ||||
| -rw-r--r-- | cgit/host/conf | 23 | ||||
| -rw-r--r-- | cgit/host/root/etc/rc.conf | 6 | ||||
| -rw-r--r-- | cgit/host/root/etc/resolv.conf | 1 | ||||
| -rw-r--r-- | cgit/host/root/usr/local/etc/cgitrc | 10 | ||||
| -rw-r--r-- | cgit/host/root/usr/local/etc/nginx/nginx.conf | 31 | ||||
| -rwxr-xr-x | cgit/start.sh | 11 | ||||
| -rwxr-xr-x | cgit/stop.sh | 7 |
8 files changed, 97 insertions, 0 deletions
diff --git a/cgit/description b/cgit/description new file mode 100644 index 0000000..bf08df4 --- /dev/null +++ b/cgit/description @@ -0,0 +1,8 @@ + +cgit_net 10.2.0.1/24 <-> cgit_host 10.2.0.2/24 + +cgit_host: + Running nginx, fcgiwrap and cgit. + cgit is serving /git directory. + Host's /lab/git is mounted to /git. + Working dataset is at /tmp/cgit_host. diff --git a/cgit/host/conf b/cgit/host/conf new file mode 100644 index 0000000..1471d6f --- /dev/null +++ b/cgit/host/conf @@ -0,0 +1,23 @@ +{ + module: sf.jail + configuration: { + interfaces: { + eth0 { type: eiface } + } + filesystem: { + layers: [ + cgit/host/root + /tmp/lamina.cgit + /tmp/lamina.machine + /lab/jail/base/14.1-RELEASE + ] + temporary: /tmp/cgit_host + volumes: [ + { source: "/lab/git", target: "/git" } + ] + devfs: 0 + } + init: [ sh, /etc/rc ] + shutdown: [ sh, /etc/rc.shutdown ] + } +} diff --git a/cgit/host/root/etc/rc.conf b/cgit/host/root/etc/rc.conf new file mode 100644 index 0000000..9d1ff9d --- /dev/null +++ b/cgit/host/root/etc/rc.conf @@ -0,0 +1,6 @@ +hostname="cgit" +ifconfig_eth0="inet 10.2.0.2/24 up" +defaultrouter="10.2.0.1" + +fcgiwrap_enable="YES" +nginx_enable="YES" diff --git a/cgit/host/root/etc/resolv.conf b/cgit/host/root/etc/resolv.conf new file mode 100644 index 0000000..35fb6f9 --- /dev/null +++ b/cgit/host/root/etc/resolv.conf @@ -0,0 +1 @@ +nameserver 1.0.0.1 diff --git a/cgit/host/root/usr/local/etc/cgitrc b/cgit/host/root/usr/local/etc/cgitrc new file mode 100644 index 0000000..5622531 --- /dev/null +++ b/cgit/host/root/usr/local/etc/cgitrc @@ -0,0 +1,10 @@ +css=/cgit.css +logo=/cgit.png + +virtual-root=/ +clone-prefix=http://10.2.0.2 +root-title=git server +root-desc= +readme=master:README.md + +scan-path=/git diff --git a/cgit/host/root/usr/local/etc/nginx/nginx.conf b/cgit/host/root/usr/local/etc/nginx/nginx.conf new file mode 100644 index 0000000..f779a68 --- /dev/null +++ b/cgit/host/root/usr/local/etc/nginx/nginx.conf @@ -0,0 +1,31 @@ + +user nobody; +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + gzip on; + + server { + listen 80 default_server; + + root /usr/local/www/cgit; + try_files $uri @cgit; + + location @cgit { + fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap.sock; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/local/www/cgit/cgit.cgi; + fastcgi_param PATH_INFO $uri; + fastcgi_param QUERY_STRING $args; + fastcgi_param HTTP_HOST $server_name; + } + } +} diff --git a/cgit/start.sh b/cgit/start.sh new file mode 100755 index 0000000..ea3b4f0 --- /dev/null +++ b/cgit/start.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e +. layer-recipes/util.sh +require-layer machine +require-layer cgit + +export SF_PATH=run + +sf.base node start cgit_net '{ module: sf.eiface, configuration: { inet: "10.2.0.1/24" } }' +sf.base node start cgit_host "$(cat cgit/host/conf)" +sf.base link start cgit_net_link cgit_net '' cgit_host eth0 diff --git a/cgit/stop.sh b/cgit/stop.sh new file mode 100755 index 0000000..5039de1 --- /dev/null +++ b/cgit/stop.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +export SF_PATH=run + +sf.base node stop cgit_host +sf.base node stop cgit_net |
