configuration v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Wed, 24 Apr 2019 17:29:04 +0200
branchv_0
changeset 21735961d9596e
parent 20 8cd5d49dfaa2
child 22 b2cb46ae50f7
configuration
etc/apache2/git.conf
etc/apache2/hg.conf
etc/cgit/cgitrc
etc/client.cfg
etc/mercurial/hg-serve.cfg
etc/server.cfg
etc/systemd/vcs-backup-clone.service
etc/systemd/vcs-backup-createSubvolume.service
etc/systemd/vcs-backup-web-hg.service
systemd/vcs-backup-clone.service
systemd/vcs-backup-subvolume.service
systemd/vcs-backup-web-hg.service
vcs-backup.sh
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/etc/apache2/git.conf	Wed Apr 24 17:29:04 2019 +0200
     1.3 @@ -0,0 +1,23 @@
     1.4 +<VirtualHost *:80>
     1.5 +		ServerName  …
     1.6 +		ServerAlias …
     1.7 +
     1.8 +		ServerAdmin webmaster@localhost
     1.9 +		DocumentRoot /var/www/html
    1.10 +
    1.11 +		Alias /cgit-css "/usr/share/cgit/"
    1.12 +		ScriptAlias / "/usr/lib/cgit/cgit.cgi/"
    1.13 +		<Directory "/usr/share/cgit/">
    1.14 +			AllowOverride None
    1.15 +			Options None
    1.16 +			Require all granted
    1.17 +		</Directory>
    1.18 +		<Directory "/usr/lib/cgit/">
    1.19 +			AllowOverride None
    1.20 +			Options ExecCGI FollowSymlinks
    1.21 +			Require all granted
    1.22 +		</Directory>
    1.23 +
    1.24 +		ErrorLog ${APACHE_LOG_DIR}/error.log
    1.25 +		CustomLog ${APACHE_LOG_DIR}/access.log combined
    1.26 +</VirtualHost>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/etc/apache2/hg.conf	Wed Apr 24 17:29:04 2019 +0200
     2.3 @@ -0,0 +1,13 @@
     2.4 +<VirtualHost *:80>
     2.5 +		ServerName  …
     2.6 +		ServerAlias …
     2.7 +
     2.8 +		ServerAdmin webmaster@localhost
     2.9 +		DocumentRoot /var/www/html
    2.10 +
    2.11 +		ProxyPass "/" "http://localhost:16169/"
    2.12 +		ProxyPassReverse "/" "http://localhost:16169/"
    2.13 +
    2.14 +		ErrorLog ${APACHE_LOG_DIR}/error.log
    2.15 +		CustomLog ${APACHE_LOG_DIR}/access.log combined
    2.16 +</VirtualHost>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/etc/cgit/cgitrc	Wed Apr 24 17:29:04 2019 +0200
     3.3 @@ -0,0 +1,10 @@
     3.4 +#
     3.5 +# cgit config
     3.6 +# see cgitrc(5) for details
     3.7 +
     3.8 +css=/cgit-css/cgit.css
     3.9 +logo=/cgit-css/cgit.png
    3.10 +
    3.11 +virtual-root=/
    3.12 +
    3.13 +scan-path=/mnt/data/public/git/
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/etc/client.cfg	Wed Apr 24 17:29:04 2019 +0200
     4.3 @@ -0,0 +1,5 @@
     4.4 +# VCS Backup
     4.5 +# Client-side configuration:
     4.6 +
     4.7 +VCS_BACKUP_SERVER="vcs-backup-manager@LOCALHOST";
     4.8 +VCS_BACKUP_SSH_COMMAND=(ssh "$VCS_BACKUP_SERVER");
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/etc/mercurial/hg-serve.cfg	Wed Apr 24 17:29:04 2019 +0200
     5.3 @@ -0,0 +1,4 @@
     5.4 +[paths]
     5.5 +/ = /mnt/data/public/hg/*
     5.6 +[web]
     5.7 +style = gitweb
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/etc/server.cfg	Wed Apr 24 17:29:04 2019 +0200
     6.3 @@ -0,0 +1,4 @@
     6.4 +# VCS Backup
     6.5 +# Server-side configuration:
     6.6 +
     6.7 +# currently not needed, can be used to override variables from the script
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/etc/systemd/vcs-backup-clone.service	Wed Apr 24 17:29:04 2019 +0200
     7.3 @@ -0,0 +1,10 @@
     7.4 +[Unit]
     7.5 +Description = VCS Backup: clone
     7.6 +After = network.target
     7.7 +
     7.8 +[Service]
     7.9 +User=vcs-backup
    7.10 +ExecStart = /usr/local/bin/vcs-backup.sh serverStartCloneService
    7.11 +
    7.12 +[Install]
    7.13 +WantedBy = multi-user.target
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/etc/systemd/vcs-backup-createSubvolume.service	Wed Apr 24 17:29:04 2019 +0200
     8.3 @@ -0,0 +1,9 @@
     8.4 +[Unit]
     8.5 +Description = VCS Backup: createSubvolume
     8.6 +After = network.target
     8.7 +
     8.8 +[Service]
     8.9 +ExecStart = /usr/local/bin/vcs-backup.sh serverStartSubvolumeService
    8.10 +
    8.11 +[Install]
    8.12 +WantedBy = multi-user.target
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/etc/systemd/vcs-backup-web-hg.service	Wed Apr 24 17:29:04 2019 +0200
     9.3 @@ -0,0 +1,11 @@
     9.4 +[Unit]
     9.5 +Description = Mercurial
     9.6 +After = syslog.target network.target
     9.7 +
     9.8 +[Service]
     9.9 +User=vcs-backup
    9.10 +ExecStart = /usr/bin/hg serve --web-conf /mnt/data/etc/hg-serve.cfg --address 127.0.0.1 --port 16169
    9.11 +SuccessExitStatus = 255
    9.12 +
    9.13 +[Install]
    9.14 +WantedBy = multi-user.target
    10.1 --- a/systemd/vcs-backup-clone.service	Wed Apr 24 17:09:27 2019 +0200
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,10 +0,0 @@
    10.4 -[Unit]
    10.5 -Description = VCS Backup: clone
    10.6 -After = network.target
    10.7 -
    10.8 -[Service]
    10.9 -User=vcs-backup
   10.10 -ExecStart = /usr/local/bin/vcs-backup.sh serverStartCloneService
   10.11 -
   10.12 -[Install]
   10.13 -WantedBy = multi-user.target
    11.1 --- a/systemd/vcs-backup-subvolume.service	Wed Apr 24 17:09:27 2019 +0200
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,9 +0,0 @@
    11.4 -[Unit]
    11.5 -Description = VCS Backup: subvolume
    11.6 -After = network.target
    11.7 -
    11.8 -[Service]
    11.9 -ExecStart = /usr/local/bin/vcs-backup.sh serverStartSubvolumeService
   11.10 -
   11.11 -[Install]
   11.12 -WantedBy = multi-user.target
    12.1 --- a/systemd/vcs-backup-web-hg.service	Wed Apr 24 17:09:27 2019 +0200
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,18 +0,0 @@
    12.4 -[Unit]
    12.5 -Description = Mercurial
    12.6 -After = syslog.target network.target
    12.7 -
    12.8 -[Service]
    12.9 -User=vcs-backup
   12.10 -ExecStart = /usr/bin/hg serve --web-conf /mnt/data/etc/hg-serve.cfg --address 127.0.0.1 --port 16169
   12.11 -SuccessExitStatus = 255
   12.12 -
   12.13 -[Install]
   12.14 -WantedBy = multi-user.target
   12.15 -
   12.16 -
   12.17 -# Configura in etc/hg-serve.cfg:
   12.18 -# [paths]
   12.19 -# / = /mnt/data/current/hg/*
   12.20 -# [web]
   12.21 -# style = gitweb
    13.1 --- a/vcs-backup.sh	Wed Apr 24 17:09:27 2019 +0200
    13.2 +++ b/vcs-backup.sh	Wed Apr 24 17:29:04 2019 +0200
    13.3 @@ -17,7 +17,7 @@
    13.4  # along with this program. If not, see <http://www.gnu.org/licenses/>.
    13.5  
    13.6  
    13.7 -# VCS Backup is a configuration for setting up a version control system mirrors.
    13.8 +# VCS Backup is a configuration for setting up VCS (version control system) mirrors.
    13.9  # Currently Mercurial (Hg) and Git are supported.
   13.10  # Features:
   13.11  #  - mirrors remote repositories
   13.12 @@ -279,8 +279,8 @@
   13.13  			pullDuration=$(( $pullFinishedMiliseconds - $pullStartedMiliseconds ));
   13.14  		fi
   13.15  
   13.16 +		printRecfileKeyValue "type"            "$vcsType";
   13.17  		printRecfileKeyValue "serverPath"      "$absolutePath";
   13.18 -		printRecfileKeyValue "type"            "$vcsType";
   13.19  		printRecfileKeyValue "state"           "$state";
   13.20  		printRecfileKeyValue "started"         "$pullStarted";
   13.21  		printRecfileKeyValue "finished"        "$pullFinished";