Browse code

Erwarte das Datenverzeichnis außerhalb des webroot (momentan hardcoded 4 Ebenen über der include-Datei)

Bernd Wurst authored on 07/12/2018 22:19:19
Showing 8 changed files
1 1
deleted file mode 100644
... ...
@@ -1,3 +0,0 @@
1
-sshkey
2
-sshkey.pub
3
-gitolite-admin
4 0
deleted file mode 100755
... ...
@@ -1,5 +0,0 @@
1
-#!/bin/bash
2
-
3
-export GIT_SSH="$(dirname ${0})/ssh-wrapper.sh"
4
-cd "$(dirname ${0})/gitolite-admin"
5
-git "${@}"
6 0
deleted file mode 100755
... ...
@@ -1,2 +0,0 @@
1
-#!/bin/bash
2
-/usr/bin/ssh -i "$(dirname ${0})/sshkey" "${@}"
... ...
@@ -16,12 +16,12 @@ Nevertheless, in case you use a significant part of this code, we ask (but not r
16 16
 
17 17
 require_role(ROLE_SYSTEMUSER);
18 18
 
19
-$data_dir = realpath(dirname(__FILE__).'/../data/');
19
+$data_dir = realpath(dirname(__FILE__).'/../../../../gitolite-data/');
20 20
 $config_file = $data_dir.'/gitolite-admin/conf/webinterface.conf';
21 21
 $config_dir = $data_dir.'/gitolite-admin/conf/webinterface';
22 22
 $key_dir = $data_dir.'/gitolite-admin/keydir';
23 23
 DEBUG("gitolite-data_dir: ".$data_dir);
24
-$git_wrapper = $data_dir . '/git-wrapper.sh';
24
+$git_wrapper = realpath(dirname(__FILE__).'/../scripts/git-wrapper.sh');
25 25
 
26 26
 
27 27
 
28 28
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+Require all denied
0 2
new file mode 100755
... ...
@@ -0,0 +1,8 @@
1
+#!/bin/bash
2
+
3
+SCRIPTDIR="$(realpath "$(dirname ${0})")"
4
+WORKDIR="$(realpath "$SCRIPTDIR/../../../../gitolite-data")"
5
+
6
+export GIT_SSH="$SCRIPTDIR/ssh-wrapper.sh"
7
+cd "$WORKDIR/gitolite-admin"
8
+git "${@}"
0 9
similarity index 68%
1 10
rename from modules/gitolite/data/initialize.sh
2 11
rename to modules/gitolite/scripts/initialize.sh
... ...
@@ -1,22 +1,24 @@
1 1
 #!/bin/bash
2 2
 
3
-if [ -f "sshkey" ] ; then 
3
+SCRIPTDIR="$(realpath "$(dirname ${0})")"
4
+WORKDIR="$(realpath "$SCRIPTDIR/../../../../gitolite-data")"
5
+
6
+if [ -f "$WORKDIR/sshkey" ] ; then 
4 7
   echo 'SSH-Key exists!'
5 8
   exit 1
6 9
 fi
7 10
 
8
-WORKDIR="$(realpath "$(dirname ${0})")"
9
-
10 11
 ssh-keygen -t ecdsa -P '' -f "${WORKDIR}/sshkey"
11 12
 
12 13
 echo 'Paste the following public key in gitolite-config and allow it to access the gitolite-admin repository!'
13 14
 echo '----------------------'
14
-cat sshkey.pub
15
+cat "$WORKDIR/sshkey.pub"
15 16
 echo '----------------------'
16 17
 echo -n 'Press ENTER when ready...'
17 18
 read
18 19
 
19
-export GIT_SSH="${WORKDIR}/ssh-wrapper.sh"
20
+export GIT_SSH="$SCRIPTDIR/ssh-wrapper.sh"
21
+cd "$WORKDIR"
20 22
 git clone "git@git.$(hostname -d):gitolite-admin"
21 23
 
22 24
 cd "gitolite-admin"
23 25
new file mode 100755
... ...
@@ -0,0 +1,6 @@
1
+#!/bin/bash
2
+
3
+SCRIPTDIR="$(realpath "$(dirname ${0})")"
4
+WORKDIR="$(realpath "$SCRIPTDIR/../../../../gitolite-data")"
5
+
6
+/usr/bin/ssh -i "$WORKDIR/sshkey" "${@}"