Commit 88e6d9c7 authored by onny's avatar onny

Updated packages

parent 42b35ed2
# Contributor: Jonas Heinrich <onny@project-insanity.org>
# Contributor: Timothée Ravier <tim@siosm.fr>
# Maintainer: Jonas Heinrich <onny@project-insanity.org>
pkgname=etherpad-lite
pkgver=1.3.0
pkgrel=2
pkgdesc="A lightweight fork of etherpad based on javascript"
pkgver=1.4.0
pkgrel=1
pkgdesc="Lightweight fork of etherpad based on javascript"
arch=(any)
url="http://etherpad.org"
_watch=('http://etherpad.org','Documentation <small>v([\d.]*)</small>')
license=('GPL2')
depends=('curl' 'python2' 'openssl' 'nodejs')
optdepends=('sqlite: to use sqlite as databse'
'mariadb: to use mysql/mariadb as database'
'postgresql: to use postgresql as database')
conflicts=('etherpad-lite-git')
backup=(usr/share/webapps/etherpad-lite/settings.json)
install='etherpad-lite.install'
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/ether/${pkgname}/archive/${pkgver}.tar.gz"
"etherpad-lite.service")
sha512sums=('033d54c5ec9daa23d8f57b0543b8d87cb76e3568f888f5f380454821ad2c6171e1c6b64e56a4e9476c2f757da698fb75a170693c963334bcc42dfd4145fb181d'
'4964e3455892e9216c7f4c596c7e89591dabe5d4e14f1dc650f6aadaf142b8be62f992ab599d899f0391ccdf5b55abe7731dbdf8e2b7df93e528861f2096d550')
"etherpad-lite.service"
"etherpad-lite.tmpfile.d")
sha512sums=('9f07b12ef5079d0fc02bb0ac3339b290501fef5fcb262ee109132cbb967506305aa6faef008d4694fb99f42b69f5aba9e3f4c6eb1865d7b269bbc6d00c313385'
'5f1273a9effcc17c81cdc275a97c4f29ad6145f42969fb1c06d5e963300908717d018cc2c0ce26a5b1ad8b86dfea6dd9159dd528a6585307c4079b5b4417b0d6'
'8172f4fc2d1f394046cb9215b50917cc5f42559d030b408c5c1919e3b62e53776d56ec00674260a332533545aa08160993e8c61663ce2786c9d97a2dafd560e4')
prepare() {
cd "$srcdir/${pkgname}-${pkgver}"
sed -i "s/9001/19001/" settings.json.template
}
build() {
cd "$srcdir/${pkgname}-${pkgver}"
......@@ -25,9 +36,10 @@ build() {
package() {
cd "$srcdir/${pkgname}-${pkgver}"
mkdir -p "${pkgdir}/usr/share/webapps" "${pkgdir}/var/run/etherpad-lite"
rm start.bat
cp -r . "${pkgdir}/usr/share/webapps/${pkgname}"
install -Dm644 "${srcdir}/etherpad-lite.service" "${pkgdir}/usr/lib/systemd/system/etherpad-lite.service"
install -D "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
rm -r start.bat var
install -dm 755 "${pkgdir}"/usr/share/webapps/${pkgname}
cp -a . "${pkgdir}"/usr/share/webapps/${pkgname}
install -Dm644 "${srcdir}"/etherpad-lite.service "${pkgdir}"/usr/lib/systemd/system/etherpad-lite.service
install -Dm644 "${srcdir}"/etherpad-lite.tmpfile.d "${pkgdir}"/usr/lib/tmpfiles.d/etherpad-lite.conf
install -D LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
post_install(){
getent group etherpad >/dev/null 2>&1 || groupadd etherpad &>/dev/null
getent passwd etherpad >/dev/null 2>&1 || useradd -g etherpad -d /var/run/etherpad-lite -s /bin/false etherpad &>/dev/null
chown -R etherpad:etherpad /usr/share/webapps/etherpad-lite /var/run/etherpad-lite
}
getent group etherpad &>/dev/null || groupadd -r etherpad &>/dev/null
getent passwd etherpad &>/dev/null || \
useradd -r -s /usr/bin/bash -g etherpad -G etherpad,http -m \
-d /var/lib/etherpad-lite etherpad >/dev/null
#useradd -r -s /usr/bin/false -g etherpad -G etherpad,http -m \
ln -s /var/lib/etherpad-lite /usr/share/webapps/etherpad-lite/var
touch etherpad /usr/share/webapps/etherpad-lite/APIKEY.txt
chmod 644 /usr/share/webapps/etherpad-lite/APIKEY.txt
chown etherpad:etherpad /usr/share/webapps/etherpad-lite/APIKEY.txt
post_upgrade(){
getent group etherpad >/dev/null 2>&1 || groupadd etherpad &>/dev/null
getent passwd etherpad >/dev/null 2>&1 || useradd -g etherpad -d /var/run/etherpad-lite -s /bin/false etherpad &>/dev/null
chown -R etherpad:etherpad /usr/share/webapps/etherpad-lite /var/run/etherpad-lite
systemd-tmpfiles --create etherpad-lite.conf
}
post_remove() {
if getent passwd etherpad >/dev/null 2>&1; then
userdel etherpad
fi
if getent group etherpad >/dev/null 2>&1; then
groupdel etherpad
fi
getent passwd etherpad &>/dev/null && userdel etherpad >/dev/null
getent group etherpad &>/dev/null && groupdel etherpad >/dev/null
}
[Unit]
Description=Etherpad-Lite server
After=syslog.target
After=network.target
After=syslog.target network.target
[Service]
Type=simple
User=etherpad
Group=etherpad
PermissionsStartOnly=true
ExecStartPre=-/usr/bin/mkdir /var/run/etherpad-lite
ExecStartPre=/usr/bin/chown -R etherpad:etherpad /var/run/etherpad-lite
WorkingDirectory=/var/lib/etherpad-lite
ExecStart=/usr/share/webapps/etherpad-lite/bin/run.sh
[Install]
......
......@@ -7,48 +7,24 @@
# Contributor: gborzi
pkgname=freecad
pkgver=0.13.1830
pkgrel=6
pkgver=0.14.3692
pkgrel=2
pkgdesc='A general purpose 3D CAD modeler'
arch=('i686' 'x86_64')
url='http://www.freecadweb.org/'
license=('GPL')
depends=('boost-libs' 'curl' 'opencascade>=6.6.0' 'pivy-hg' 'python2-pyqt4' 'xerces-c' 'libspnav' 'shared-mime-info' 'hicolor-icon-theme' 'python2-matplotlib')
makedepends=('boost' 'eigen3' 'gcc-fortran' 'swig' 'xerces-c' 'desktop-file-utils' 'cmake' 'coin>=3.1.3-9')
optdepends=('python2-matplotlib' 'pycollada-git')
license=('LGPL')
depends=('boost-libs' 'curl' 'opencascade>=6.6.0' 'pivy-hg' 'xerces-c' 'libspnav' 'shared-mime-info' 'hicolor-icon-theme' 'python2-matplotlib' 'shiboken' 'python2-pyside')
makedepends=('boost' 'eigen' 'gcc-fortran' 'swig' 'xerces-c' 'desktop-file-utils' 'cmake' 'coin>=3.1.3-9')
optdepends=('python2-matplotlib' 'pycollada-git' 'python2-pyqt4')
options=(!libtool !makeflags)
install=freecad.install
source=("http://downloads.sourceforge.net/sourceforge/free-cad/freecad-${pkgver}.tar.gz"
"freecad-0.13.diff"
"${pkgname}.desktop"
"${pkgname}.xml"
"BRepOffsetAPI_MakePipeShellPyImp.patch")
"${pkgname}.xml")
sha512sums=('3e8d4eed8cace38da9615965f79a2b0da21d31a6df793ceaf3f732e0abd5666e9715ec9eb162e6ff998718e8d609a7dff2d0993b28f493200b734318a2322160'
'f03c75239bd6d5429ecd9690b779a95c08ef791424f31bfe989594990750088300ae5fb75f50051c0028ba218eac3cace2b6c7f2666c1368a259f728c4098625'
sha512sums=('2d687fe334106c47035696641e832ead2a385b5503e24af3e15fcf5d94240be23daac6b7f51d4fdf61575dc0426eb65935ce428cf95f806e5c5e725882e93096'
'02098793ce4e2e4744ffeb4fcacd364ce680786a1eb0b1cece3c1d8d5033733d9b4bd15ac0a842b9dceeb006b2cd292e8a332fdbad9b187e943d934acf8ce9bf'
'ac0dfe1b2c58335867e94d4ce86696763b6354dcdca68a653bf115b6ea562f0f8ff7d243d42d0c6fd6e758bd488d626e30cd917bb1b5c676c1f0cafdece005d6'
'5f0cc54e6436a68ec93831021a123a39a32447b4f35e03f45cb6ffae61daca104c2554b6cec85d58b2010714dd50682434e5b6091b4c1dd8fca345903dea7ae5')
_installdir=/opt/$pkgname
# I prefer installing in opt because installing
# in /usr there are non standard dir.
# However if you prefer /usr uncomment the following line
# _installdir=/usr
prepare(){
cd "${srcdir}/freecad-${pkgver}/"
# compatibility issues with OCC-6.6
for _FILE in $( grep -Rl "BRepTools::OuterShell" * )
do
sed -e "s|BRepTools|BRepClass3d|g" -i "$_FILE"
done
# these patch contain some code taken from upstream
# thanks to cbuehler
patch -Np1 -i ../freecad-0.13.diff
patch -p0 -i ../BRepOffsetAPI_MakePipeShellPyImp.patch
}
'ac0dfe1b2c58335867e94d4ce86696763b6354dcdca68a653bf115b6ea562f0f8ff7d243d42d0c6fd6e758bd488d626e30cd917bb1b5c676c1f0cafdece005d6')
build() {
cd "${srcdir}/freecad-${pkgver}/"
......@@ -56,42 +32,34 @@ build() {
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=${_installdir} .. \
cmake -DCMAKE_INSTALL_PREFIX:PATH="/usr" .. \
-DCMAKE_INSTALL_DOCDIR:PATH="doc/freecad" \
-DCMAKE_INSTALL_DATADIR:PATH="share/freecad" \
-DCMAKE_INSTALL_LIBDIR:PATH="share/freecad" \
-DOCC_INCLUDE_DIR:PATH=/opt/opencascade/inc/ \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 \
-DFREECAD_USE_EXTERNAL_PIVY:BOOL=ON
# add these options if you don't want to update coin
# -DCMAKE_C_FLAGS:STRING="$CFLAGS -fpermissive" \
# -DCMAKE_CXX_FLAGS:STRING="$CXXFLAGS -fpermissive"
make
# Builds Qt plugin
cd ../src/Tools/plugins/widget/
qmake-qt4 plugin.pro
# fix LibDir in src/App/FreeCADInit.py
sed -i "46i\\\tModDir = '/usr/share/freecad/Mod'" ../src/App/FreeCADInit.py
make
}
package() {
cd "${srcdir}/freecad-${pkgver}/build"
# Install main program
make DESTDIR="${pkgdir}" install
# Symlink to /usr/bin
mkdir -p "${pkgdir}/usr/bin/"
ln -sf "${_installdir}/bin/FreeCAD" "${pkgdir}/usr/bin/freecad"
ln -sf "${_installdir}/bin/FreeCADCmd" "${pkgdir}/usr/bin/freecadcmd"
ln -sf "/usr/bin/FreeCAD" "${pkgdir}/usr/bin/freecad"
ln -sf "/usr/FreeCADCmd" "${pkgdir}/usr/bin/freecadcmd"
# Installs Qt plugin
install -Dm755 ../src/Tools/plugins/widget/libFreeCAD_widgets.so "${pkgdir}/usr/lib/qt4/plugins/designer/libFreeCAD_widgets.so"
cp -ra "${pkgdir}/usr/Mod" "${pkgdir}/usr/share/freecad/"
rm -r "${pkgdir}/usr/Mod"
# Install pixmaps and desktop shortcut
desktop-file-install \
--dir="${pkgdir}/usr/share/applications" \
"${srcdir}/${pkgname}.desktop"
# Mime info
install -D -m644 "${srcdir}/${pkgname}.xml" "${pkgdir}/usr/share/mime/packages/${pkgname}.xml"
# Mime info
install -D -m644 "${srcdir}/${pkgname}.xml" "${pkgdir}/usr/share/mime/packages/${pkgname}.xml"
}
# Maintainer: Jonas Heinrich <onny@project-insnaity.org>
# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Jonas Heinrich <onny@project-insnaity.org>
pkgname=gitlab-shell
pkgver=1.8.0
pkgrel=4
pkgdesc="Self hosted Git management software. (shell daemon)"
arch=(any)
url="http://gitlab.org/"
license=('MIT')
depends=('redis' 'ruby' 'git')
makedepends=('sudo')
options=('!strip')
install=gitlab-shell.install
backup=(etc/webapps/gitlab/shell.yml)
source=("$pkgname-$pkgver.tar.gz::https://gitlab.com/gitlab-org/gitlab-shell/repository/archive.tar.gz?ref=v${pkgver}")
sha512sums=('87ac2c431135d568095da057cd626808f2b1d54d707753ec51cdb1314dce968d48612074d487545498dc75120803538f28ae6627822dd0a4630a0cd40ce16d84')
package() {
local datadir=/usr/share/gitlab-shell
local homedir=/var/lib/gitlab
install -d \
"${pkgdir}${datadir}" \
"${pkgdir}${homedir}" \
"${pkgdir}/etc/webapps/gitlab"
cd "${srcdir}/${pkgname}.git"
sed -e 's|user: git|user: gitlab|' \
-e "s|/home/git/repositories|$homedir/repositories|" \
-e "s|/home/git|$homedir|" \
config.yml.example > "${pkgdir}/etc/webapps/gitlab/shell.yml"
ln -s /etc/webapps/gitlab/shell.yml "${pkgdir}${datadir}/config.yml"
cp -a VERSION bin hooks lib spec support "${pkgdir}${datadir}"
ln -s /usr/share/gitlab-shell ${pkgdir}/${homedir}/
install -dm700 "$pkgdir$homedir/.ssh"
touch "$pkgdir$homedir/.ssh/authorized_keys"
install -dm770 "$pkgdir$homedir/"{repositories,satellites}
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
datadir=/usr/share/gitlab-shell
homedir=/var/lib/gitlab
fix_perms() {
chown -R gitlab:gitlab $datadir $homedir
chmod -R go-rwx $homedir/.ssh
chmod g+s $homedir/repositories
}
post_install() {
groupadd gitlab &>/dev/null
useradd -d /var/lib/gitlab -g gitlab -s /usr/share/gitlab-shell/bin/gitlab-shell gitlab
fix_perms
sudo -u gitlab -H git config --global user.name "GitLab"
sudo -u gitlab -H git config --global user.email "gitlab@localhost"
}
post_upgrade() {
getent group gitlab >/dev/null 2>&1 || groupadd gitlab &>/dev/null
getent passwd gitlab >/dev/null 2>&1 || useradd -g gitlab -d $homedir -s /bin/false gitlab &>/dev/null
fix_perms
}
post_remove() {
if getent passwd gitlab >/dev/null 2>&1; then
userdel gitlab
fi
if getent group gitlab >/dev/null 2>&1; then
groupdel gitlab
fi
}
# GITLAB
# Maintainer: @tvn87
# App Version: 2.8
server.modules += (
"mod_simple_vhost",
"mod_proxy"
)
## The document root of a virtual host is document-root =
## simple-vhost.server-root + $HTTP["host"] + simple-vhost.document-root
simple-vhost.server-root = "/var/www"
simple-vhost.document-root = "htdocs"
## the default host if no host is sent
simple-vhost.default-host = "YOUR_SERVER_FQDN"
## uploads must be served as static files
$HTTP["url"] == "^/upload" {
var.vhost.name = "YOUR_SERVER_FQDN"
var.vhost.path = "/usr/share/webapps/gitlab/public"
}
## otherwise everything is proxied
else $HTTP["host"] == "YOUR_SERVER_FQDN" {
var.vhost_name = "YOUR_SERVER_FQDN"
var.vhost_path = "/var/www/YOUR_SERVER_FQDN" # This directory should be empty
proxy.server = ( "" => ( (
"host" => "127.0.0.1",
"port" => "8080"
),
)
)
ssl.pemfile = "/etc/lighttpd/certs/YOUR_SERVER_FQDN.pem" # If ssl is enabled
}
# Contributor: Jonas Heinrich <onny@project-insanity.org>
# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Pavol (Lopo) Hluchy <lopo AT losys DOT eu>
# Maintainer: Jonas Heinrich <onny@project-insanity.org>
pkgname=gitlab
pkgver=6.6.0
pkgrel=8
pkgdesc="Project management and code hosting application"
arch=('any')
url="https://www.gitlab.org"
license=('MIT')
depends=('ruby>=1.9.3' 'git>=1.7.10' 'ruby-bundler' 'python2>=2.5' 'gitlab-shell' 'openssh' 'redis>=2.0')
makedepends=('libxslt' 'icu')
optdepends=(
'mariadb: database backend'
'postgresql: database backend'
'python2-docutils: reStructuredText markup language support'
'postifx: mail server in order to receive mail notifications'
)
backup=(
etc/webapps/gitlab/gitlab.yml
etc/webapps/gitlab/database.yml
etc/webapps/gitlab/unicorn.rb
etc/logrotate.d/gitlab)
_server=()
if [[ -n $(which httpd 2> /dev/null) ]]; then
backup+=('etc/httpd/conf/extra/gitlab.conf'
'etc/httpd/conf/extra/gitlab-ssl.conf')
_server+=('apache')
fi
if [[ -n $(which nginx 2> /dev/null) ]]; then
backup+=('etc/nginx/sites-available/gitlab-ssl')
_server+=('nginx')
fi
if [[ -n $(which lighttpd 2> /dev/null) ]]; then
backup+=('etc/lighttpd/conf.d/10-gitlab.conf')
_server+=('lighttpd')
fi
source=("$pkgname-$pkgver.tar.gz::https://gitlab.com/gitlab-org/gitlab-ce/repository/archive.tar.gz?ref=v${pkgver}"
gitlab.target
gitlab-unicorn.service
gitlab-sidekiq.service
gitlab.conf
gitlab-ssl.conf
gitlab-ssl
10-gitlab.conf
gitlab.tmpfiles.d
gitlab.logrotate)
install='gitlab.install'
sha512sums=('48957282df895654fe5052a814ac1a6de85640d056c901e5f2821593a4498d2ec7a3d7c92e5b57c666196cba2c9f98b86598c07ee36248ff7f2cab363ac5c0c2'
'c88b7b500225c9a2bfaf10912fc09e5a3beb7c28890dcc1d49d55dfe92df02cef3f1865a138e7e2802b4e795c9a45cb130819be0a1c115eca9b566b8b9fb4395'
'b6724b4171a1a62dee10bea6c9e1fd20eb6788ba61622c58ced80bef9cf7401b7c6a17a5a5a38ad677a0b224b09ff2b0be3737d89e5718b4f1391a57d91148e9'
'08d5c013fde44220ad3ef57be29b4aa757f45a8a56603609fe4ca1b705fda2991b906a094b1246a8dbc03333829907c8781608d8dff3b592d2343f05c4c6a87a'
'f021ddcaaf8f4e92db7684f3a7eb34d4d00911efe5a3d57bc78ebb0b9636b2639b1990047c8da3f6d7339ad7a89574cfbfeb59a79c30b099e6f44ecfbf3166f7'
'12b1775f9457d62657e388125b6f6a24a87577632696d3f7b8d5765deb57c2feba13fe8037e93fc362f6d328f3cf00183ff563631ef6b4b8badf104af126854d'
'4a27e26f309063b615045f4ae0a789d4221389539d69aedafde81a7cde0e29f56aeaff2b17d2da51c6d615a9f6c2c087971d3565b3687c1e8023b498c2ec1202'
'c78b6f46abcf603d8db6e38cf50868e14145928422ddfe17c88e2f006b5b910dddf456ec5d6d724b250994530643963809688a98f7e12ebd5b5dabf7f96f0e06'
'b98ba6cbd8745a649046386f4aad6ee3d869b8e14820560e25b3207683dcd0841e1af8afb5537e6e06bf19d9436489420db59348c57f4c096c69b0ea4f2e7978'
'8b0094a4f7bffb909a0ded0d86fbe93c96dd684902354e191844361e36a61109c4696b2003734d57d2d4fe65ba4ebafb87d211c1a9ee532cdc87a1a8abeec0f6')
options=('!strip')
_homedir='/var/lib/gitlab'
_datadir='/usr/share/webapps/gitlab'
_wo=()
prepare() {
if [[ `pacman -T libmariadbclient` != '' ]]; then
_wo+=('mysql')
fi
if [[ `pacman -T postgresql-libs` != '' ]]; then
_wo+=('postgres')
fi
if [[ ${#_wo[@]} == 2 ]]; then
error "Usable DB libs not found"
msg2 "Install at least libmariadbclient or postgresql-libs"
return 1
fi
cd "${srcdir}/gitlab-ce.git"
# Patching config files:
sed -e "s|# user: git|user: gitlab|" \
-e "s|/home/git/repositories|${_homedir}/repositories|" \
-e "s|/home/git/gitlab-satellites|${_homedir}/satellites|" \
-e "s|/home/git/gitlab-shell|/usr/share/gitlab-shell|" \
config/gitlab.yml.example > config/gitlab.yml
sed -e "s|/home/git/gitlab/tmp/.*/|/var/run/gitlab/|g" \
-e "s|/home/git/gitlab|${_datadir}|g" \
-e "s|timeout 30|timeout 300|" \
config/unicorn.rb.example > config/unicorn.rb
sed -e "s|username: git|username: gitlab|" \
config/database.yml.mysql > config/database.yml
}
build() {
cd "${srcdir}/gitlab-ce.git"
msg "Fetching bundled gems..."
# Gems will be installed into vendor/bundle
bundle install --no-cache --no-prune --deployment --without development test aws ${_wo[@]}
}
package() {
cd "${srcdir}/gitlab-ce.git"
install -d "${pkgdir}/usr/share/webapps"
cp -r "${srcdir}/gitlab-ce.git" "${pkgdir}${_datadir}"
# Creating directories
install -d \
"${pkgdir}/etc/webapps/gitlab" \
"${pkgdir}/usr/share/webapps" \
"${pkgdir}/usr/share/doc/${pkgname}" \
"${pkgdir}${_homedir}/www" \
"${pkgdir}${_datadir}/www" \
"${pkgdir}${_datadir}/public/uploads"
ln -fs /run/gitlab "${pkgdir}${_homedir}/pids"
ln -fs /run/gitlab "${pkgdir}${_homedir}/sockets"
# Install config files
for _file in gitlab.yml unicorn.rb database.yml; do
mv "config/${_file}" "${pkgdir}/etc/webapps/gitlab/"
[[ -f "${pkgdir}${_datadir}/config/${_file}" ]] && rm "${pkgdir}${_datadir}/config/${_file}"
ln -s "/etc/webapps/gitlab/${_file}" "${pkgdir}${_datadir}/config/"
done
# Install license and help files
mv README.md MAINTENANCE.md CONTRIBUTING.md CHANGELOG config/*.{example,mysql,postgresql} "${pkgdir}/usr/share/doc/${pkgname}"
install -D "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
rm "${pkgdir}/usr/share/webapps/gitlab/LICENSE"
# Install systemd service files
for _file in gitlab.target gitlab-unicorn.service gitlab-sidekiq.service; do
install -Dm0755 "${srcdir}/${_file}" "${pkgdir}/usr/lib/systemd/system/${_file}"
done
install -Dm644 "${srcdir}/gitlab.tmpfiles.d" "${pkgdir}/usr/lib/tmpfiles.d/gitlab.conf"
install -Dm644 "${srcdir}/gitlab.logrotate" "${pkgdir}/etc/logrotate.d/gitlab"
# Install apache, nginx and lighttpd template files (if they are installed)
for __server in ${_server[@]}; do
case ${__server} in
apache)
install -d "${pkgdir}/etc/httpd/conf/extra"
install -m 644 "${srcdir}/gitlab.conf" "${pkgdir}/etc/httpd/conf/extra/"
install -m 644 "${srcdir}/gitlab-ssl.conf" "${pkgdir}/etc/httpd/conf/extra/"
;;
nginx)
install -d "${pkgdir}/etc/nginx/sites-enabled"
install -m 644 "${srcdir}/gitlab-ssl" "${pkgdir}/etc/nginx/sites-enabled/"
;;
lighttpd)
install -d "${pkgdir}/etc/lighttpd/conf.d"
install -m 644 "${srcdir}/10-gitlab.conf" "${pkgdir}/etc/lighttpd/conf.d/"
;;
esac
done
}
# vim:set ts=4 sw=4 et:
#####################################################
#
# GitLab version : 5.x - 6.x
# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91
# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
#
####################################################
[Unit]
Description=GitLab Sidekiq Worker
[Service]
Type=forking
User=gitlab
WorkingDirectory=/usr/share/webapps/gitlab
Environment=RAILS_ENV=production
SyslogIdentifier=gitlab-sidekiq
PIDFile=/var/run/gitlab/sidekiq.pid
ExecStart=/usr/bin/bundle exec "sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e production -P /var/run/gitlab/sidekiq.pid -d -L log/sidekiq.log >> log/sidekiq.log 2>&1"
ExecStop=/usr/bin/bundle exec "sidekiqctl stop /var/run/gitlab/sidekiq.pid >> /var/lib/gitlab/log/sidekiq.log 2>&1"
[Install]
WantedBy=gitlab.target
# GITLAB
# Contributors: yin8086, sashkab, orkoden, axilleas
# App Version: 5.4 - 6.0
# Modified from nginx http version
# Modified from http://blog.phusion.nl/2012/04/21/tutorial-setting-up-gitlab-on-debian-6/
# You need to run openssl to generate a self-signed ssl certificate.
# cd /etc/nginx/
# sudo openssl req -new -x509 -nodes -days 3560 -out gitlab.crt -keyout gitlab.key
# sudo chmod o-r gitlab.key
# Also you need to edit gitlab-shell config.
# 1) Set "gitlab_url" param in gitlab-shell/config.yml to https://git.example.com
# 2) Set "ca_file" to /etc/nginx/gitlab.crt
# 3) Set "self_signed_cert" to true
# You also need to edit gitlab/config/gitlab.yml
# 1) Define port for http "port: 443"
# 2) Enable https "https: true"
# 3) Update ssl for gravatar "ssl_url: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm"
upstream gitlab {
## Uncomment if you have set up puma/unicorn to listen on a unix socket (recommended).
server unix:/var/run/gitlab/gitlab.socket;
## Uncomment if puma/unicorn are configured to listen on a tcp port.
## Check the port number in /home/git/gitlab/config/{puma.rb/unicorn.rb}
# server 127.0.0.1:9292;
}
# This is a normal HTTP host which redirects all traffic to the HTTPS host.
# Replace git.example.com with your FQDN.
server {
listen *:80;
server_name git.example.com;
server_tokens off;
root /nowhere; # this doesn't have to be a valid path since we are redirecting, you don't have to change it.
rewrite ^ https://$server_name$request_uri permanent;
}
server {
listen 443 ssl;
server_name git.example.com;
server_tokens off;
root /usr/share/webapps/gitlab/public;
ssl on;
ssl_certificate /etc/nginx/gitlab.crt;
ssl_certificate_key /etc/nginx/gitlab.key;
ssl_protocols SSLv3 TLSv1 TLSv1.2;
ssl_ciphers AES:HIGH:!ADH:!MD5;
ssl_prefer_server_ciphers on;
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
location / {
# serve static files from defined root folder;.
# @gitlab is a named location for the upstream fallback, see below
try_files $uri $uri/index.html $uri.html @gitlab;
}
# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @gitlab {
proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_redirect off;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://gitlab;
}
}
#This configuration has been tested on GitLab 6.0.0 and GitLab 6.0.1
#Note this config assumes unicorn is listening on default port 8080.
#Module dependencies
# mod_rewrite
# mod_ssl
# mod_proxy
# mod_proxy_http
# mod_headers
# This section is only needed if you want to redirect http traffic to https.
# You can live without it but clients will have to type in https:// to reach gitlab.
<VirtualHost *:80>
ServerName gitlab.example.com
ServerSignature Off
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L]
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
#strong encryption ciphers only
#see ciphers(1) http://www.openssl.org/docs/apps/ciphers.html
SSLCipherSuite SSLv3:TLSv1:+HIGH:!SSLv2:!MD5:!MEDIUM:!LOW:!EXP:!ADH:!eNULL:!aNULL
SSLCertificateFile /etc/httpd/ssl.crt/gitlab.example.com.crt
SSLCertificateKeyFile /etc/httpd/ssl.key/gitlab.example.com.key
SSLCACertificateFile /etc/httpd/ssl.crt/your-ca.crt
ServerName gitlab.example.com
ServerSignature Off
ProxyPreserveHost On
<Location />
Order deny,allow
Allow from all
ProxyPassReverse http://127.0.0.1:8080
ProxyPassReverse http://gitlab.example.com/
</Location>
#apache equivalent of nginx try files
# http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
# http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
RequestHeader set X_FORWARDED_PROTO 'https'
# needed for downloading attachments
DocumentRoot /usr/share/webapps/gitlab/public
#Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
ErrorDocument 404 /404.html
ErrorDocument 422 /422.html
ErrorDocument 500 /500.html
ErrorDocument 503 /deploy.html
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
ErrorLog /var/log/httpd/logs/gitlab.example.com_error.log
CustomLog /var/log/httpd/logs/gitlab.example.com_forwarded.log common_forwarded
CustomLog /var/log/httpd/logs/gitlab.example.com_access.log combined env=!dontlog
CustomLog /var/log/httpd/logs/gitlab.example.com.log combined
</VirtualHost>
#####################################################
#
# GitLab version : 5.x - 6.x
# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91
# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
#
####################################################
[Unit]
Description=GitLab Unicorn Server
[Service]
User=gitlab
WorkingDirectory=/usr/share/webapps/gitlab
Environment=RAILS_ENV=production
SyslogIdentifier=gitlab-unicorn
PIDFile=/var/run/gitlab/unicorn.pid
ExecStart=/usr/bin/bundle exec "unicorn_rails -c /usr/share/webapps/gitlab/config/unicorn.rb -E production"
ExecStop=/usr/bin/kill -QUIT $MAINPID
ExecReload=/usr/bin/kill -USR2 $MAINPID
[Install]
WantedBy=gitlab.target
#This configuration has been tested on GitLab 6.0.0 and GitLab 6.0.1
#Note this config assumes unicorn is listening on default port 8080.
#Module dependencies
# mod_rewrite
# mod_proxy
# mod_proxy_http
<VirtualHost *:80>
ServerName gitlab.example.com
ServerSignature Off
ProxyPreserveHost On
<Location />
Order deny,allow
Allow from all
ProxyPassReverse http://127.0.0.1:8080
ProxyPassReverse http://gitlab.example.com/
</Location>
#apache equivalent of nginx try files
# http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
# http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
# needed for downloading attachments
DocumentRoot /usr/share/webapps/gitlab/public
#Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
ErrorDocument 404 /404.html
ErrorDocument 422 /422.html
ErrorDocument 500 /500.html
ErrorDocument 503 /deploy.html
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
ErrorLog /var/log/httpd/logs/gitlab.example.com_error.log
CustomLog /var/log/httpd/logs/gitlab.example.com_forwarded.log common_forwarded