git: Refactor hierarcy and names
git/client is now git and in software submodule git/server is now git-server
This commit is contained in:
parent
e13b87324c
commit
90142649d7
13 changed files with 6 additions and 44 deletions
26
roles/git-server/files/git.conf
Normal file
26
roles/git-server/files/git.conf
Normal file
|
@ -0,0 +1,26 @@
|
|||
# git clone http support
|
||||
SetEnv GIT_PROJECT_ROOT /srv/git
|
||||
SetEnv GIT_HTTP_EXPORT_ALL
|
||||
|
||||
# gitweb settings
|
||||
SetEnv GITWEB_PROJECTROOT /srv/git
|
||||
|
||||
Alias /static/ /var/www/git/static/
|
||||
|
||||
#AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /srv/git/$1
|
||||
#AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /srv/git/$1
|
||||
|
||||
<Directory /usr/libexec/git-core>
|
||||
Require all granted
|
||||
</Directory>
|
||||
ScriptAliasMatch \
|
||||
"(?x)^/(.*/(HEAD | \
|
||||
info/refs | \
|
||||
objects/info/[^/]+ | \
|
||||
git-(upload|receive)-pack))$" \
|
||||
/usr/libexec/git-core/git-http-backend/$1
|
||||
|
||||
ScriptAlias /gitweb.cgi /var/www/git/gitweb.cgi
|
||||
<Location />
|
||||
DirectoryIndex gitweb.cgi
|
||||
</Location>
|
24
roles/git-server/files/gitweb-local.css
Normal file
24
roles/git-server/files/gitweb-local.css
Normal file
|
@ -0,0 +1,24 @@
|
|||
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
img.logo {
|
||||
height: 50px;
|
||||
width: 172px;
|
||||
float: left;
|
||||
margin-right: 50px;
|
||||
}
|
||||
|
||||
div.page_header {
|
||||
background: #000;
|
||||
height: 50px;
|
||||
padding-top: 15px;
|
||||
padding-left: 0px;
|
||||
padding-bottom: 0px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
div.page_header a:visited {
|
||||
color: #fff;
|
||||
}
|
26
roles/git-server/files/gitweb.conf
Normal file
26
roles/git-server/files/gitweb.conf
Normal file
|
@ -0,0 +1,26 @@
|
|||
|
||||
# read git repo root from env or use default
|
||||
our $projectroot = $ENV{'GITWEB_PROJECTROOT'};
|
||||
|
||||
# site name
|
||||
our $site_name = "foo.sh - Public GIT repositories";
|
||||
|
||||
# add custom css
|
||||
push @stylesheets, "/static/gitweb-local.css";
|
||||
our $logo = "/static/logo.png";
|
||||
our $logo_label = "https://www.foo.sh/";
|
||||
|
||||
# base urls
|
||||
our $logo_url = "https://www.foo.sh/";
|
||||
our $home_link = "https://git.foo.sh";
|
||||
our $home_link_str = "https://git.foo.sh";
|
||||
|
||||
# avatar support
|
||||
$feature{"avatar"}{"default"} = ["gravatar"];
|
||||
|
||||
# add support for bz2 and zip snapshots
|
||||
$feature{"snapshot"}{"default"} = ["tgz", "tbz2", "zip"];
|
||||
|
||||
# syntax highlight (rhel8 supports detection without known extension)
|
||||
$highlight_bin = "highlight";
|
||||
$feature{"highlight"}{"defaut"} = [1];
|
BIN
roles/git-server/files/logo.png
Normal file
BIN
roles/git-server/files/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
5
roles/git-server/meta/main.yml
Normal file
5
roles/git-server/meta/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
|
||||
dependencies:
|
||||
- {role: git}
|
||||
- {role: apache}
|
59
roles/git-server/tasks/main.yml
Normal file
59
roles/git-server/tasks/main.yml
Normal file
|
@ -0,0 +1,59 @@
|
|||
---
|
||||
|
||||
- name: install git server packages
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: installed
|
||||
with_items:
|
||||
- gitweb
|
||||
- highlight
|
||||
- perl-Digest-MD5
|
||||
|
||||
- name: fix selinux context from data directory
|
||||
sefcontext:
|
||||
path: /export/git(/.*)?
|
||||
setype: git_sys_content_t
|
||||
|
||||
- name: create git directory
|
||||
file:
|
||||
path: /srv/git
|
||||
src: /export/git
|
||||
state: link
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: create gitweb config
|
||||
copy:
|
||||
dest: /etc/gitweb.conf
|
||||
src: gitweb.conf
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: create robots.txt
|
||||
copy:
|
||||
dest: /var/www/git/robots.txt
|
||||
content: "User-agent: *\nDisallow:\n"
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: copy local layout files
|
||||
copy:
|
||||
dest: "/var/www/git/static/{{ item }}"
|
||||
src: "{{ item }}"
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
with_items:
|
||||
- logo.png
|
||||
- gitweb-local.css
|
||||
|
||||
- name: create apache git config
|
||||
copy:
|
||||
dest: /etc/httpd/conf.local.d/git.conf
|
||||
src: git.conf
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: restart apache
|
Loading…
Add table
Add a link
Reference in a new issue