#!/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
if [ ! -r /etc/pki/tls/certs/localhost.crt ]; then
echo "Generating key/cert for web server..."
openssl genrsa 2048 > /etc/pki/tls/private/localhost.key
chmod go-rwx /etc/pki/tls/private/localhost.key
echo -e "--\nSomeState\nSomeCity\nSomeOrg\nSomeOrgUnit\nlocalhost.localdomain\nroot@localhost.localdomain\n" \
| openssl req -new -key /etc/pki/tls/private/localhost.key \
-x509 -sha256 -days 7300 -set_serial `date +%s` \
-extensions v3_req \
-out /etc/pki/tls/certs/localhost.crt
fi
(
sed -i -e 's/ default_server//g' /etc/nginx/nginx.conf
cd /etc/nginx/conf.d
sed -r \
-e 's/listen (.*);/listen \1 default_server;/g' \
rocketgit.conf.sample \
> rocketgit.conf
)
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
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