diff options
author | Karel Kočí <cynerd@email.cz> | 2019-03-03 16:30:52 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2019-03-03 16:30:52 +0100 |
commit | 03edb3c33f5ce3ea5cedc433ebb2026533acf787 (patch) | |
tree | 3f54a249ead6ddc8e62b5233e1039b2533baad05 /2019-installfest | |
parent | 0fef5a870e748d47ef1992b1ba88834551881515 (diff) | |
download | presentations-03edb3c33f5ce3ea5cedc433ebb2026533acf787.tar.gz presentations-03edb3c33f5ce3ea5cedc433ebb2026533acf787.tar.bz2 presentations-03edb3c33f5ce3ea5cedc433ebb2026533acf787.zip |
Installfest 2019: gitolite
Diffstat (limited to '2019-installfest')
-rw-r--r-- | 2019-installfest/gitolite/makefile | 10 | ||||
-rw-r--r-- | 2019-installfest/gitolite/pres.pdf | bin | 0 -> 188360 bytes | |||
-rw-r--r-- | 2019-installfest/gitolite/pres.tex | 305 |
3 files changed, 315 insertions, 0 deletions
diff --git a/2019-installfest/gitolite/makefile b/2019-installfest/gitolite/makefile new file mode 100644 index 0000000..7b97a99 --- /dev/null +++ b/2019-installfest/gitolite/makefile @@ -0,0 +1,10 @@ +FILE=pres + +$(FILE).pdf: $(FILE).tex $(patsubst %.svg,%.pdf,$(wildcard *.svg)) + pdflatex -shell-escape $< + +%.pdf: %.svg + inkscape -D -z --file=$< --export-pdf=$@ --export-latex + +clean: + ls | grep -v -E "($(FILE).tex|makefile|scheme|svg|png|jpg|eps)$$" | xargs rm -rf diff --git a/2019-installfest/gitolite/pres.pdf b/2019-installfest/gitolite/pres.pdf Binary files differnew file mode 100644 index 0000000..01891ca --- /dev/null +++ b/2019-installfest/gitolite/pres.pdf diff --git a/2019-installfest/gitolite/pres.tex b/2019-installfest/gitolite/pres.tex new file mode 100644 index 0000000..8646a03 --- /dev/null +++ b/2019-installfest/gitolite/pres.tex @@ -0,0 +1,305 @@ +\documentclass[aspectratio=169]{beamer} +\usetheme{metropolis} +\usepackage{lmodern} +\usepackage[czech]{babel} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{graphicx} +\usepackage{wrapfig} +\usepackage{color} +\usepackage{mathtools} +\usepackage{hyperref} +\usepackage{epstopdf} +\usepackage{amsmath} +\hypersetup{ + colorlinks, + citecolor=black, + filecolor=black, + linkcolor=black, + urlcolor=black +} +\usepackage{pdflscape} +\definecolor{omnia}{rgb}{0, 0.635, 0.886} + +\title{Osobní Git server s Gitolite a více} +\author{Kar(t)el Kočí} +\date{3.3.2018} + +\begin{document} + +\frame{\titlepage} + +\begin{frame}[fragile] + \frametitle{Proč?} + Proč mít osobní git server? + \begin{itemize} + \item Důvěryhodný hosting pro vaše soukromé repositáře + \item Bezpečné napojení na vaše systému a infrastrukturu + \item Nezanášíte kolaborační platformy nekolaborativními projekty + \end{itemize} + + Proč zrovna gitolite? + \begin{itemize} + \item Spravuje git repositáře a nic víc + \item Téměř: deploy and forget + \item Konfigurace je v gitu (spravujete git v gitu) + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Co je tedy přesněji gitolite?} + + \begin{itemize} + \item Manager přístupu k repositářům + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Jak nasadit?} + Když vám funguje SSH tak už stačí jen nainstalovat gitolite a: + \begin{verbatim} +useradd -U -m git +su - git +gitolite setup -pk /tmp/admin.pub +\end{verbatim} + + Naklonovat admin repo: + \begin{verbatim} +git clone git@server:gitolite-admin +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Co je v admin repu?} + + \begin{itemize} + \item Složka pro přístupové klíče: keydir + \item Konfigurační soubor: conf/gitolite.conf + \end{itemize} + + gitolite.conf + \begin{verbatim} +# Amin repo (comment) +repo gitolite-admin + RW+ = admin + +repo testing + RW+ = @all +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Přidnání repositáře} + \begin{verbatim} +repo gitolite-admin + RW+ = admin + +repo myproject + RW+ = admin +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Přidnání uživatele} + Přidáme veřejný klíč do složky keydir + + \begin{verbatim} +$ ls keydir +admin.pub +pepa.pub +\end{verbatim} + + \begin{verbatim} +repo gitolite-admin + RW+ = admin + +repo myproject + RW+ = admin + RW = pepa +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Skupiny} + \begin{verbatim} +@admins = admin lojza +@admin-repos = gitolite-admin admin-doc + +repo @admin-repos + RW+ = @admins + +repo myproject + RW+ = @admins + RW = pepa +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{@all} + \begin{verbatim} +@admins = admin lojza + +repo gitolite-admin + RW+ = @admins +repo @all + RW+ = @admins + +repo myproject + RW = pepa + R = @all +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Přístup k repositářům} + \begin{itemize} + \item ssh + \item git protokol (git-daemon) + \item http(s) (gitweb, cgit) + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{git-daemon} + Pro Alpine (openrc: /etc/conf.d/git-daemon) + \begin{verbatim} +GITDAEMON_OPTS="--syslog --base-path=/var/lib/git/repositories" +GIT_USER="nobody" +GIT_GROUP="git" +\end{verbatim} + + gitolite.conf + \begin{verbatim} +repo myproject + RW = pepa + R = daemon +\end{verbatim} + + \textit{git-daemon-export-ok} +\end{frame} + +\begin{frame}[fragile] + \frametitle{cgit} + \begin{verbatim} +root-title=Muj GIT +root-desc=Muj novy git +logo=/ico.svg +virtual-root=/ +enable-git-config=1 + +project-list=/var/lib/git/projects.list +scan-path=/var/lib/git/repositories/ +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{cgit - clone} + \begin{verbatim} +enable-http-clone=1 +clone-url=https://git.cynerd.cz/$CGIT_REPO_URL + git://cynerd.cz/$CGIT_REPO_URL.git + git@cynerd.cz:$CGIT_REPO_URL + +snapshots=tar.gz tar.bz2 zip +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{cgit - README a syntax} + \begin{verbatim} +mimetype.gif=image/gif +mimetype.html=text/html +mimetype.jpg=image/jpeg +mimetype.jpeg=image/jpeg +mimetype.pdf=application/pdf +mimetype.png=image/png +mimetype.svg=image/svg+xml + +source-filter=/usr/lib/cgit/filters/syntax-highlighting.py +about-filter=/usr/lib/cgit/filters/about-formatting.sh + +readme=:README.md +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{gitolite a cgit} + \begin{verbatim} +repo myproject + RW = pepa + R = daemon gitweb + config gitweb.description = "Huge project" +\end{verbatim} + + Na serveru v .gitolite.rc odkomentovat + \begin{verbatim} +# updates 'description' file instead of 'gitweb.description' config item +'cgit', +\end{verbatim} + A na serveru spustit jako uživatel git (fix everything) + \begin{verbatim} +gitolite setup +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Hooky} + \begin{verbatim} +repo myproject + RW = pepa + R = daemon gitweb + option hook.post-receive = build-trigger +\end{verbatim} + Skript build-trigger do: local/hooks/repo-specific/build-trigger + + Je nutné aktivovat (odkomentovat) na serveru v .gitolite.rc + \begin{verbatim} +# allow repo-specific hooks to be added +'repo-specific-hooks', +\end{verbatim} + A na serveru spustit jako uživatel git (fix everything) + \begin{verbatim} +gitolite setup +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Mirroring} + \begin{verbatim} +#!/bin/sh +[ -t 0 ] || cat >/dev/null # Drop all input from git +git push --mirror "git@gitlab.com:$MIRROR" +\end{verbatim} + + \begin{verbatim} +repo myproject + option ENV.MIRROR = "Lojza/project.git" + option hook.post-receive = smirror +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Pokročilé možnosti které jsme si neukázali} + \begin{itemize} + \item Templaty + \item Virtuální reference + \item Pokročilé řízení přístupu + \item Forkování, dynamické vytváření a pokročilejší správat + \end{itemize} +\end{frame} + +\begin{frame} + \Large Děkuji za pozornost. + + \url{git.cynerd.cz} +\end{frame} + +{ +\setbeamercolor{background canvas}{bg=omnia} +\begin{frame} + \pagecolor{yellow!30!orange} + \center \color{white} \Huge play.turris.cz +\end{frame} +} + +\end{document} |