@@ -35,16 +35,50 @@ RUN set -eux ; \
35
35
mv /opt/gitblit/data $gbetc ; \
36
36
ln -s $gbetc /opt/gitblit/data ; \
37
37
\
38
+ # Make sure that the most current default properties file is available
39
+ # unedited to Gitblit.
40
+ mkdir -p /opt/gitblit/etc/ ; \
41
+ mv $gbetc/defaults.properties /opt/gitblit/etc ; \
42
+ printf "\
43
+ 6 c\\\n \
44
+ \\\n \
45
+ \\\n \
46
+ ""#\\\n \
47
+ ""# DO NOT EDIT THIS FILE. IT CAN BE OVERWRITTEN BY UPDATES.\\\n \
48
+ ""# FOR YOUR OWN CUSTOM SETTINGS USE THE FILE ${gbetc}/gitblit.properties\\\n \
49
+ ""# THIS FILE IS ONLY FOR REFERENCE.\\\n \
50
+ ""#\\\n \
51
+ \\\n \
52
+ \\\n \
53
+ \n \
54
+ /^# Base folder for repositories/,/^git.repositoriesFolder/d\n \
55
+ /^# The location to save the filestore blobs/,/^filestore.storageFolder/d\n \
56
+ /^# Specify the location of the Lucene Ticket index/,/^tickets.indexFolder/d\n \
57
+ /^# The destination folder for cached federation proposals/,/^federation.proposalsFolder/d\n \
58
+ /^# The temporary folder to decompress/,/^server.tempFolder/d\n \
59
+ s/^server.httpPort.*/#server.httpPort = 8080/\n \
60
+ s/^server.httpsPort.*/#server.httpsPort = 8443/\n \
61
+ s/^server.redirectToHttpsPort.*/#server.redirectToHttpsPort = true/\n \
62
+ " > /tmp/defaults.sed ; \
63
+ sed -f /tmp/defaults.sed /opt/gitblit/etc/defaults.properties > $gbetc/defaults.properties ; \
64
+ rm -f /tmp/defaults.sed ; \
65
+ # Check that removal worked
66
+ grep "^git.repositoriesFolder" $gbetc/defaults.properties && false ; \
67
+ grep "^filestore.storageFolder" $gbetc/defaults.properties && false ; \
68
+ grep "^tickets.indexFolder" $gbetc/defaults.properties && false ; \
69
+ grep "^federation.proposalsFolder" $gbetc/defaults.properties && false ; \
70
+ grep "^server.tempFolder" $gbetc/defaults.properties && false ; \
71
+ \
38
72
# Create a system.properties file that sets the defaults for this docker setup.
39
73
# This is not available outside and should not be changed.
40
- echo "git.repositoriesFolder = ${gbsrv}/git" > /opt/gitblit/system.properties ; \
41
- echo "filestore.storageFolder = ${gbsrv}/lfs" >> /opt/gitblit/system.properties ; \
42
- echo "tickets.indexFolder = ${gbsrv}/tickets/lucene" >> /opt/gitblit/system.properties ; \
43
- echo "federation.proposalsFolder = ${gbsrv}/fedproposals" >> /opt/gitblit/system.properties ; \
44
- echo "server.tempFolder = ${GITBLIT_VAR}/temp" >> /opt/gitblit/system.properties ; \
45
- echo "server.httpPort= 8080" >> /opt/gitblit/system.properties ; \
46
- echo "server.httpsPort= 8443" >> /opt/gitblit/system.properties ; \
47
- echo "server.redirectToHttpsPort= true" >> /opt/gitblit/system.properties ; \
74
+ echo "git.repositoriesFolder = ${gbsrv}/git" > /opt/gitblit/etc/ system.properties ; \
75
+ echo "filestore.storageFolder = ${gbsrv}/lfs" >> /opt/gitblit/etc/ system.properties ; \
76
+ echo "tickets.indexFolder = ${gbsrv}/tickets/lucene" >> /opt/gitblit/etc/ system.properties ; \
77
+ echo "federation.proposalsFolder = ${gbsrv}/fedproposals" >> /opt/gitblit/etc/ system.properties ; \
78
+ echo "server.tempFolder = ${GITBLIT_VAR}/temp" >> /opt/gitblit/etc/ system.properties ; \
79
+ echo "server.httpPort = 8080" >> /opt/gitblit/etc /system.properties ; \
80
+ echo "server.httpsPort = 8443" >> /opt/gitblit/etc /system.properties ; \
81
+ echo "server.redirectToHttpsPort = true" >> /opt/gitblit/etc /system.properties ; \
48
82
\
49
83
# Create a properties file for settings that can be set via environment variables from docker
50
84
printf '\
@@ -58,10 +92,14 @@ RUN set -eux ; \
58
92
''# Do not define your custom settings in this file. Your overrides or\n \
59
93
''# custom settings should be defined in the "gitblit.properties" file.\n \
60
94
''#\n \
95
+ include = /opt/gitblit/etc/defaults.properties,/opt/gitblit/etc/system.properties\
61
96
\n ' > $gbetc/gitblit-docker.properties ; \
62
97
# Currently RPC is enabled by default
63
98
echo "web.enableRpcManagement=true" >> $gbetc/gitblit-docker.properties ; \
64
99
echo "web.enableRpcAdministration=true" >> $gbetc/gitblit-docker.properties ; \
100
+ sed -i -e 's/^web.enableRpcManagement.*/#web.enableRpcManagement=true/' \
101
+ -e 's/^web.enableRpcAdministration.*/#web.enableRpcAdministration=true/' \
102
+ $gbetc/defaults.properties ; \
65
103
\
66
104
# Create the gitblit.properties file that the user can use for customization.
67
105
printf '\
@@ -81,7 +119,7 @@ RUN set -eux ; \
81
119
''# The present files define the default settings for the docker container. If you\n \
82
120
''# remove them or change the order, things may break.\n \
83
121
''#\n \
84
- include = defaults.properties,/opt/gitblit/system.properties, gitblit-docker.properties\n \
122
+ include = gitblit-docker.properties\n \
85
123
\n \
86
124
''#\n \
87
125
''# Define your overrides or custom settings below\n \
0 commit comments