xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
<root> / docker / rg.sh (e64c72b5f82a6d0be91a2b9ac548c9e2120ffcb5) (1,663B) (mode 100755) [raw]
#!/bin/bash

# This file will be included in docker 'rocketgit' Dockerfile

sed -i -e "s|\$rg_sql = .*$|\$rg_sql = 'host=${RP_PORT_5432_TCP_ADDR} port=${RP_PORT_5432_TCP_PORT} user=rocketgit dbname=rocketgit connect_timeout=10';|" /etc/rocketgit/config.php

echo "Generating sshd keys..."
for i in rsa ecdsa ed25519; do
	/usr/libexec/openssh/sshd-keygen ${i}
done

while [ 1 ]; do
	# rocketgit-fpm will be started automatically!
	if [ "`ps ax|grep -v grep|grep \"pool rocketgit\"`" = "" ]; then
		echo "Running rocketgit-fpm..."
		/usr/sbin/php-fpm --fpm-config /etc/rocketgit/php-fpm.conf \
			--daemonize
		if [ "${?}" != "0" ]; then
			echo "ERROR: could not start rocketgit-fpm!"
		fi
	fi

	if [ "`ps ax|grep -v grep|grep nginx`" = "" ]; then
		echo "Running nginx..."
		/usr/sbin/nginx
		if [ "${?}" != "0" ]; then
			echo "ERROR: could not start the web server!"
		fi
	fi

	if [ "`ps ax|grep -v grep|grep cron`" = "" ]; then
		echo "Running cron..."
		crond
		if [ "${?}" != "0" ]; then
			echo "ERROR: could not start crond!"
		fi
	fi

	if [ "`ps ax|grep -v grep|grep sendmail`" = "" ]; then
		echo "Running sendmail..."
		/usr/sbin/sendmail -bd -q1h
		if [ "${?}" != "0" ]; then
			echo "ERROR: could not start sendmail!"
		fi
	fi

	if [ "`ps ax|grep -v grep|grep xinetd`" = "" ]; then
		echo "Running xinetd..."
		/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
		if [ "${?}" != "0" ]; then
			echo "ERROR: could not start xinetd!"
		fi
	fi

	if [ "`ps ax|grep -v grep|grep sshd`" = "" ]; then
		echo "Running sshd..."
		/usr/sbin/sshd &>/tmp/sshd.log
		if [ "${?}" != "0" ]; then
			echo "ERROR: could not start sshd!"
		fi
	fi

	sleep 30
done
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master