@noldova/checkpoints.git.linux-arm64 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +11 -2
  3. package/git/bin/git +0 -0
  4. package/git/bin/scalar +0 -0
  5. package/git/etc/gitconfig +13 -0
  6. package/git/libexec/git-core/git +0 -0
  7. package/git/libexec/git-core/git-archimport +1136 -0
  8. package/git/libexec/git-core/git-cvsexportcommit +469 -0
  9. package/git/libexec/git-core/git-cvsimport +1185 -0
  10. package/git/libexec/git-core/git-cvsserver +5109 -0
  11. package/git/libexec/git-core/git-daemon +0 -0
  12. package/git/libexec/git-core/git-difftool--helper +125 -0
  13. package/git/libexec/git-core/git-filter-branch +665 -0
  14. package/git/libexec/git-core/git-http-backend +0 -0
  15. package/git/libexec/git-core/git-http-fetch +0 -0
  16. package/git/libexec/git-core/git-imap-send +0 -0
  17. package/git/libexec/git-core/git-instaweb +786 -0
  18. package/git/libexec/git-core/git-merge-octopus +112 -0
  19. package/git/libexec/git-core/git-merge-one-file +167 -0
  20. package/git/libexec/git-core/git-merge-resolve +64 -0
  21. package/git/libexec/git-core/git-mergetool +579 -0
  22. package/git/libexec/git-core/git-mergetool--lib +549 -0
  23. package/git/libexec/git-core/git-quiltimport +155 -0
  24. package/git/libexec/git-core/git-receive-pack +0 -0
  25. package/git/libexec/git-core/git-remote-ftp +0 -0
  26. package/git/libexec/git-core/git-remote-ftps +0 -0
  27. package/git/libexec/git-core/git-remote-http +0 -0
  28. package/git/libexec/git-core/git-remote-https +0 -0
  29. package/git/libexec/git-core/git-request-pull +178 -0
  30. package/git/libexec/git-core/git-send-email +2474 -0
  31. package/git/libexec/git-core/git-sh-i18n +79 -0
  32. package/git/libexec/git-core/git-sh-i18n--envsubst +0 -0
  33. package/git/libexec/git-core/git-sh-setup +357 -0
  34. package/git/libexec/git-core/git-shell +0 -0
  35. package/git/libexec/git-core/git-submodule +671 -0
  36. package/git/libexec/git-core/git-upload-archive +0 -0
  37. package/git/libexec/git-core/git-upload-pack +0 -0
  38. package/git/libexec/git-core/git-web--browse +196 -0
  39. package/git/libexec/git-core/mergetools/araxis +26 -0
  40. package/git/libexec/git-core/mergetools/bc +37 -0
  41. package/git/libexec/git-core/mergetools/codecompare +31 -0
  42. package/git/libexec/git-core/mergetools/deltawalker +33 -0
  43. package/git/libexec/git-core/mergetools/diffmerge +26 -0
  44. package/git/libexec/git-core/mergetools/diffuse +23 -0
  45. package/git/libexec/git-core/mergetools/ecmerge +22 -0
  46. package/git/libexec/git-core/mergetools/emerge +34 -0
  47. package/git/libexec/git-core/mergetools/examdiff +24 -0
  48. package/git/libexec/git-core/mergetools/guiffy +26 -0
  49. package/git/libexec/git-core/mergetools/gvimdiff +1 -0
  50. package/git/libexec/git-core/mergetools/kdiff3 +44 -0
  51. package/git/libexec/git-core/mergetools/kompare +19 -0
  52. package/git/libexec/git-core/mergetools/meld +97 -0
  53. package/git/libexec/git-core/mergetools/nvimdiff +1 -0
  54. package/git/libexec/git-core/mergetools/opendiff +22 -0
  55. package/git/libexec/git-core/mergetools/p4merge +44 -0
  56. package/git/libexec/git-core/mergetools/smerge +20 -0
  57. package/git/libexec/git-core/mergetools/tkdiff +24 -0
  58. package/git/libexec/git-core/mergetools/tortoisemerge +40 -0
  59. package/git/libexec/git-core/mergetools/vimdiff +657 -0
  60. package/git/libexec/git-core/mergetools/vscode +19 -0
  61. package/git/libexec/git-core/mergetools/winmerge +23 -0
  62. package/git/libexec/git-core/mergetools/xxdiff +38 -0
  63. package/git/libexec/git-core/scalar +0 -0
  64. package/git/share/bash-completion/completions/git +4115 -0
  65. package/git/share/git-core/templates/description +1 -0
  66. package/git/share/git-core/templates/hooks/applypatch-msg.sample +15 -0
  67. package/git/share/git-core/templates/hooks/commit-msg.sample +74 -0
  68. package/git/share/git-core/templates/hooks/fsmonitor-watchman.sample +168 -0
  69. package/git/share/git-core/templates/hooks/post-update.sample +8 -0
  70. package/git/share/git-core/templates/hooks/pre-applypatch.sample +14 -0
  71. package/git/share/git-core/templates/hooks/pre-commit.sample +49 -0
  72. package/git/share/git-core/templates/hooks/pre-merge-commit.sample +13 -0
  73. package/git/share/git-core/templates/hooks/pre-push.sample +53 -0
  74. package/git/share/git-core/templates/hooks/pre-rebase.sample +169 -0
  75. package/git/share/git-core/templates/hooks/pre-receive.sample +24 -0
  76. package/git/share/git-core/templates/hooks/prepare-commit-msg.sample +42 -0
  77. package/git/share/git-core/templates/hooks/push-to-checkout.sample +78 -0
  78. package/git/share/git-core/templates/hooks/sendemail-validate.sample +77 -0
  79. package/git/share/git-core/templates/hooks/update.sample +128 -0
  80. package/git/share/git-core/templates/info/exclude +6 -0
  81. package/git/share/gitweb/gitweb.cgi +8499 -0
  82. package/git/share/gitweb/static/git-favicon.png +0 -0
  83. package/git/share/gitweb/static/git-logo.png +0 -0
  84. package/git/share/gitweb/static/gitweb.css +756 -0
  85. package/git/share/gitweb/static/gitweb.js +1579 -0
  86. package/git/share/locale/af/LC_MESSAGES/git.mo +0 -0
  87. package/git/share/locale/bg/LC_MESSAGES/git.mo +0 -0
  88. package/git/share/locale/ca/LC_MESSAGES/git.mo +0 -0
  89. package/git/share/locale/de/LC_MESSAGES/git.mo +0 -0
  90. package/git/share/locale/el/LC_MESSAGES/git.mo +0 -0
  91. package/git/share/locale/es/LC_MESSAGES/git.mo +0 -0
  92. package/git/share/locale/fr/LC_MESSAGES/git.mo +0 -0
  93. package/git/share/locale/ga/LC_MESSAGES/git.mo +0 -0
  94. package/git/share/locale/id/LC_MESSAGES/git.mo +0 -0
  95. package/git/share/locale/is/LC_MESSAGES/git.mo +0 -0
  96. package/git/share/locale/it/LC_MESSAGES/git.mo +0 -0
  97. package/git/share/locale/ko/LC_MESSAGES/git.mo +0 -0
  98. package/git/share/locale/pl/LC_MESSAGES/git.mo +0 -0
  99. package/git/share/locale/pt_BR/LC_MESSAGES/git.mo +0 -0
  100. package/git/share/locale/pt_PT/LC_MESSAGES/git.mo +0 -0
  101. package/git/share/locale/ru/LC_MESSAGES/git.mo +0 -0
  102. package/git/share/locale/sv/LC_MESSAGES/git.mo +0 -0
  103. package/git/share/locale/tr/LC_MESSAGES/git.mo +0 -0
  104. package/git/share/locale/uk/LC_MESSAGES/git.mo +0 -0
  105. package/git/share/locale/vi/LC_MESSAGES/git.mo +0 -0
  106. package/git/share/locale/zh_CN/LC_MESSAGES/git.mo +0 -0
  107. package/git/share/locale/zh_TW/LC_MESSAGES/git.mo +0 -0
  108. package/git/share/perl5/FromCPAN/Error.pm +1040 -0
  109. package/git/share/perl5/FromCPAN/Mail/Address.pm +280 -0
  110. package/git/share/perl5/Git/I18N.pm +125 -0
  111. package/git/share/perl5/Git/IndexInfo.pm +35 -0
  112. package/git/share/perl5/Git/LoadCPAN/Error.pm +10 -0
  113. package/git/share/perl5/Git/LoadCPAN/Mail/Address.pm +10 -0
  114. package/git/share/perl5/Git/LoadCPAN.pm +104 -0
  115. package/git/share/perl5/Git/Packet.pm +173 -0
  116. package/git/share/perl5/Git/SVN/Editor.pm +605 -0
  117. package/git/share/perl5/Git/SVN/Fetcher.pm +622 -0
  118. package/git/share/perl5/Git/SVN/GlobSpec.pm +65 -0
  119. package/git/share/perl5/Git/SVN/Log.pm +400 -0
  120. package/git/share/perl5/Git/SVN/Memoize/YAML.pm +93 -0
  121. package/git/share/perl5/Git/SVN/Migration.pm +265 -0
  122. package/git/share/perl5/Git/SVN/Prompt.pm +184 -0
  123. package/git/share/perl5/Git/SVN/Ra.pm +708 -0
  124. package/git/share/perl5/Git/SVN/Utils.pm +232 -0
  125. package/git/share/perl5/Git/SVN.pm +2573 -0
  126. package/git/share/perl5/Git.pm +1780 -0
  127. package/licenses/git/COPYING +360 -0
  128. package/licenses/git/LGPL-2.1 +511 -0
  129. package/licenses/perl-modules-from-cpan/Artistic +131 -0
  130. package/licenses/perl-modules-from-cpan/Copying +250 -0
  131. package/package.json +167 -4
@@ -0,0 +1,786 @@
1
+ #!/bin/sh
2
+ #
3
+ # Copyright (c) 2006 Eric Wong
4
+ #
5
+
6
+ PERL='/usr/bin/perl'
7
+ OPTIONS_KEEPDASHDASH=
8
+ OPTIONS_STUCKLONG=
9
+ OPTIONS_SPEC="\
10
+ git instaweb [options] (--start | --stop | --restart)
11
+ --
12
+ l,local only bind on 127.0.0.1
13
+ p,port= the port to bind to
14
+ d,httpd= the command to launch
15
+ b,browser= the browser to launch
16
+ m,module-path= the module path (only needed for apache2)
17
+ Action
18
+ stop stop the web server
19
+ start start the web server
20
+ restart restart the web server
21
+ "
22
+
23
+ SUBDIRECTORY_OK=Yes
24
+ . git-sh-setup
25
+
26
+ fqgitdir="$GIT_DIR"
27
+ local="$(git config --bool --get instaweb.local)"
28
+ httpd="$(git config --get instaweb.httpd)"
29
+ root="$(git config --get instaweb.gitwebdir)"
30
+ port=$(git config --get instaweb.port)
31
+ module_path="$(git config --get instaweb.modulepath)"
32
+ action="browse"
33
+
34
+ conf="$GIT_DIR/gitweb/httpd.conf"
35
+
36
+ # Defaults:
37
+
38
+ # if installed, it doesn't need further configuration (module_path)
39
+ test -z "$httpd" && httpd='lighttpd -f'
40
+
41
+ # Default is //share/gitweb
42
+ test -z "$root" && root='//share/gitweb'
43
+
44
+ # any untaken local port will do...
45
+ test -z "$port" && port=1234
46
+
47
+ resolve_full_httpd () {
48
+ case "$httpd" in
49
+ *apache2*|*lighttpd*|*httpd*)
50
+ # yes, *httpd* covers *lighttpd* above, but it is there for clarity
51
+ # ensure that the apache2/lighttpd command ends with "-f"
52
+ if ! echo "$httpd" | grep -- '-f *$' >/dev/null 2>&1
53
+ then
54
+ httpd="$httpd -f"
55
+ fi
56
+ ;;
57
+ *plackup*)
58
+ # server is started by running via generated gitweb.psgi in $fqgitdir/gitweb
59
+ full_httpd="$fqgitdir/gitweb/gitweb.psgi"
60
+ httpd_only="${httpd%% *}" # cut on first space
61
+ return
62
+ ;;
63
+ *webrick*)
64
+ # server is started by running via generated webrick.rb in
65
+ # $fqgitdir/gitweb
66
+ full_httpd="$fqgitdir/gitweb/webrick.rb"
67
+ httpd_only="${httpd%% *}" # cut on first space
68
+ return
69
+ ;;
70
+ *python*)
71
+ # server is started by running via generated gitweb.py in
72
+ # $fqgitdir/gitweb
73
+ full_httpd="$fqgitdir/gitweb/gitweb.py"
74
+ httpd_only="${httpd%% *}" # cut on first space
75
+ return
76
+ ;;
77
+ esac
78
+
79
+ httpd_only="$(echo $httpd | cut -f1 -d' ')"
80
+ if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null 2>&1;; esac
81
+ then
82
+ full_httpd=$httpd
83
+ else
84
+ # many httpds are installed in /usr/sbin or /usr/local/sbin
85
+ # these days and those are not in most users $PATHs
86
+ # in addition, we may have generated a server script
87
+ # in $fqgitdir/gitweb.
88
+ for i in /usr/local/sbin /usr/sbin "$root" "$fqgitdir/gitweb"
89
+ do
90
+ if test -x "$i/$httpd_only"
91
+ then
92
+ full_httpd=$i/$httpd
93
+ return
94
+ fi
95
+ done
96
+
97
+ echo >&2 "$httpd_only not found. Install $httpd_only or use" \
98
+ "--httpd to specify another httpd daemon."
99
+ exit 1
100
+ fi
101
+ }
102
+
103
+ start_httpd () {
104
+ if test -f "$fqgitdir/pid"; then
105
+ echo "Instance already running. Restarting..."
106
+ stop_httpd
107
+ fi
108
+
109
+ # here $httpd should have a meaningful value
110
+ resolve_full_httpd
111
+ mkdir -p "$fqgitdir/gitweb/$httpd_only"
112
+ conf="$fqgitdir/gitweb/$httpd_only.conf"
113
+
114
+ # generate correct config file if it doesn't exist
115
+ test -f "$conf" || configure_httpd
116
+ test -f "$fqgitdir/gitweb/gitweb_config.perl" || gitweb_conf
117
+
118
+ # don't quote $full_httpd, there can be arguments to it (-f)
119
+ case "$httpd" in
120
+ *mongoose*|*plackup*|*python*)
121
+ #These servers don't have a daemon mode so we'll have to fork it
122
+ $full_httpd "$conf" &
123
+ #Save the pid before doing anything else (we'll print it later)
124
+ pid=$!
125
+
126
+ if test $? != 0; then
127
+ echo "Could not execute http daemon $httpd."
128
+ exit 1
129
+ fi
130
+
131
+ cat > "$fqgitdir/pid" <<EOF
132
+ $pid
133
+ EOF
134
+ ;;
135
+ *)
136
+ $full_httpd "$conf"
137
+ if test $? != 0; then
138
+ echo "Could not execute http daemon $httpd."
139
+ exit 1
140
+ fi
141
+ ;;
142
+ esac
143
+ }
144
+
145
+ stop_httpd () {
146
+ test -f "$fqgitdir/pid" && kill $(cat "$fqgitdir/pid")
147
+ rm -f "$fqgitdir/pid"
148
+ }
149
+
150
+ httpd_is_ready () {
151
+ "$PERL" -MIO::Socket::INET -e "
152
+ local \$| = 1; # turn on autoflush
153
+ exit if (IO::Socket::INET->new('127.0.0.1:$port'));
154
+ print 'Waiting for \'$httpd\' to start ..';
155
+ do {
156
+ print '.';
157
+ sleep(1);
158
+ } until (IO::Socket::INET->new('127.0.0.1:$port'));
159
+ print qq! (done)\n!;
160
+ "
161
+ }
162
+
163
+ while test $# != 0
164
+ do
165
+ case "$1" in
166
+ --stop|stop)
167
+ action="stop"
168
+ ;;
169
+ --start|start)
170
+ action="start"
171
+ ;;
172
+ --restart|restart)
173
+ action="restart"
174
+ ;;
175
+ -l|--local)
176
+ local=true
177
+ ;;
178
+ -d|--httpd)
179
+ shift
180
+ httpd="$1"
181
+ ;;
182
+ -b|--browser)
183
+ shift
184
+ browser="$1"
185
+ ;;
186
+ -p|--port)
187
+ shift
188
+ port="$1"
189
+ ;;
190
+ -m|--module-path)
191
+ shift
192
+ module_path="$1"
193
+ ;;
194
+ --)
195
+ ;;
196
+ *)
197
+ usage
198
+ ;;
199
+ esac
200
+ shift
201
+ done
202
+
203
+ mkdir -p "$GIT_DIR/gitweb/tmp"
204
+ GIT_EXEC_PATH="$(git --exec-path)"
205
+ GIT_DIR="$fqgitdir"
206
+ GITWEB_CONFIG="$fqgitdir/gitweb/gitweb_config.perl"
207
+ export GIT_EXEC_PATH GIT_DIR GITWEB_CONFIG
208
+
209
+ webrick_conf () {
210
+ # webrick seems to have no way of passing arbitrary environment
211
+ # variables to the underlying CGI executable, so we wrap the
212
+ # actual gitweb.cgi using a shell script to force it
213
+ wrapper="$fqgitdir/gitweb/$httpd/wrapper.sh"
214
+ cat > "$wrapper" <<EOF
215
+ #!/bin/sh
216
+ # we use this shell script wrapper around the real gitweb.cgi since
217
+ # there appears to be no other way to pass arbitrary environment variables
218
+ # into the CGI process
219
+ GIT_EXEC_PATH=$GIT_EXEC_PATH GIT_DIR=$GIT_DIR GITWEB_CONFIG=$GITWEB_CONFIG
220
+ export GIT_EXEC_PATH GIT_DIR GITWEB_CONFIG
221
+ exec $root/gitweb.cgi
222
+ EOF
223
+ chmod +x "$wrapper"
224
+
225
+ # This assumes _ruby_ is in the user's $PATH. that's _one_
226
+ # portable way to run ruby, which could be installed anywhere, really.
227
+ # generate a standalone server script in $fqgitdir/gitweb.
228
+ cat >"$fqgitdir/gitweb/$httpd.rb" <<EOF
229
+ #!/usr/bin/env ruby
230
+ require 'webrick'
231
+ require 'logger'
232
+ options = {
233
+ :Port => $port,
234
+ :DocumentRoot => "$root",
235
+ :Logger => Logger.new('$fqgitdir/gitweb/error.log'),
236
+ :AccessLog => [
237
+ [ Logger.new('$fqgitdir/gitweb/access.log'),
238
+ WEBrick::AccessLog::COMBINED_LOG_FORMAT ]
239
+ ],
240
+ :DirectoryIndex => ["gitweb.cgi"],
241
+ :CGIInterpreter => "$wrapper",
242
+ :StartCallback => lambda do
243
+ File.open("$fqgitdir/pid", "w") { |f| f.puts Process.pid }
244
+ end,
245
+ :ServerType => WEBrick::Daemon,
246
+ }
247
+ options[:BindAddress] = '127.0.0.1' if "$local" == "true"
248
+ server = WEBrick::HTTPServer.new(options)
249
+ ['INT', 'TERM'].each do |signal|
250
+ trap(signal) {server.shutdown}
251
+ end
252
+ server.start
253
+ EOF
254
+ chmod +x "$fqgitdir/gitweb/$httpd.rb"
255
+ # configuration is embedded in server script file, webrick.rb
256
+ rm -f "$conf"
257
+ }
258
+
259
+ lighttpd_conf () {
260
+ cat > "$conf" <<EOF
261
+ server.document-root = "$root"
262
+ server.port = $port
263
+ server.modules = ( "mod_setenv", "mod_cgi" )
264
+ server.indexfiles = ( "gitweb.cgi" )
265
+ server.pid-file = "$fqgitdir/pid"
266
+ server.errorlog = "$fqgitdir/gitweb/$httpd_only/error.log"
267
+
268
+ # to enable, add "mod_access", "mod_accesslog" to server.modules
269
+ # variable above and uncomment this
270
+ #accesslog.filename = "$fqgitdir/gitweb/$httpd_only/access.log"
271
+
272
+ setenv.add-environment = ( "PATH" => env.PATH, "GITWEB_CONFIG" => env.GITWEB_CONFIG )
273
+
274
+ cgi.assign = ( ".cgi" => "" )
275
+
276
+ # mimetype mapping
277
+ mimetype.assign = (
278
+ ".pdf" => "application/pdf",
279
+ ".sig" => "application/pgp-signature",
280
+ ".spl" => "application/futuresplash",
281
+ ".class" => "application/octet-stream",
282
+ ".ps" => "application/postscript",
283
+ ".torrent" => "application/x-bittorrent",
284
+ ".dvi" => "application/x-dvi",
285
+ ".gz" => "application/x-gzip",
286
+ ".pac" => "application/x-ns-proxy-autoconfig",
287
+ ".swf" => "application/x-shockwave-flash",
288
+ ".tar.gz" => "application/x-tgz",
289
+ ".tgz" => "application/x-tgz",
290
+ ".tar" => "application/x-tar",
291
+ ".zip" => "application/zip",
292
+ ".mp3" => "audio/mpeg",
293
+ ".m3u" => "audio/x-mpegurl",
294
+ ".wma" => "audio/x-ms-wma",
295
+ ".wax" => "audio/x-ms-wax",
296
+ ".ogg" => "application/ogg",
297
+ ".wav" => "audio/x-wav",
298
+ ".gif" => "image/gif",
299
+ ".jpg" => "image/jpeg",
300
+ ".jpeg" => "image/jpeg",
301
+ ".png" => "image/png",
302
+ ".xbm" => "image/x-xbitmap",
303
+ ".xpm" => "image/x-xpixmap",
304
+ ".xwd" => "image/x-xwindowdump",
305
+ ".css" => "text/css",
306
+ ".html" => "text/html",
307
+ ".htm" => "text/html",
308
+ ".js" => "text/javascript",
309
+ ".asc" => "text/plain",
310
+ ".c" => "text/plain",
311
+ ".cpp" => "text/plain",
312
+ ".log" => "text/plain",
313
+ ".conf" => "text/plain",
314
+ ".text" => "text/plain",
315
+ ".txt" => "text/plain",
316
+ ".dtd" => "text/xml",
317
+ ".xml" => "text/xml",
318
+ ".mpeg" => "video/mpeg",
319
+ ".mpg" => "video/mpeg",
320
+ ".mov" => "video/quicktime",
321
+ ".qt" => "video/quicktime",
322
+ ".avi" => "video/x-msvideo",
323
+ ".asf" => "video/x-ms-asf",
324
+ ".asx" => "video/x-ms-asf",
325
+ ".wmv" => "video/x-ms-wmv",
326
+ ".bz2" => "application/x-bzip",
327
+ ".tbz" => "application/x-bzip-compressed-tar",
328
+ ".tar.bz2" => "application/x-bzip-compressed-tar",
329
+ "" => "text/plain"
330
+ )
331
+ EOF
332
+ test x"$local" = xtrue && echo 'server.bind = "127.0.0.1"' >> "$conf"
333
+ }
334
+
335
+ apache2_conf () {
336
+ for candidate in \
337
+ /etc/httpd \
338
+ /usr/lib/apache2 \
339
+ /usr/lib/httpd ;
340
+ do
341
+ if test -d "$candidate/modules"
342
+ then
343
+ module_path="$candidate/modules"
344
+ break
345
+ fi
346
+ done
347
+ bind=
348
+ test x"$local" = xtrue && bind='127.0.0.1:'
349
+ echo 'text/css css' > "$fqgitdir/mime.types"
350
+ cat > "$conf" <<EOF
351
+ ServerName "git-instaweb"
352
+ ServerRoot "$root"
353
+ DocumentRoot "$root"
354
+ ErrorLog "$fqgitdir/gitweb/$httpd_only/error.log"
355
+ CustomLog "$fqgitdir/gitweb/$httpd_only/access.log" combined
356
+ PidFile "$fqgitdir/pid"
357
+ Listen $bind$port
358
+ EOF
359
+
360
+ for mod in mpm_event mpm_prefork mpm_worker
361
+ do
362
+ if test -e $module_path/mod_${mod}.so
363
+ then
364
+ echo "LoadModule ${mod}_module " \
365
+ "$module_path/mod_${mod}.so" >> "$conf"
366
+ # only one mpm module permitted
367
+ break
368
+ fi
369
+ done
370
+ for mod in mime dir env log_config authz_core unixd
371
+ do
372
+ if test -e $module_path/mod_${mod}.so
373
+ then
374
+ echo "LoadModule ${mod}_module " \
375
+ "$module_path/mod_${mod}.so" >> "$conf"
376
+ fi
377
+ done
378
+ cat >> "$conf" <<EOF
379
+ TypesConfig "$fqgitdir/mime.types"
380
+ DirectoryIndex gitweb.cgi
381
+ EOF
382
+
383
+ if test -f "$module_path/mod_perl.so"
384
+ then
385
+ # favor mod_perl if available
386
+ cat >> "$conf" <<EOF
387
+ LoadModule perl_module $module_path/mod_perl.so
388
+ PerlPassEnv GIT_DIR
389
+ PerlPassEnv GIT_EXEC_PATH
390
+ PerlPassEnv GITWEB_CONFIG
391
+ <Location /gitweb.cgi>
392
+ SetHandler perl-script
393
+ PerlResponseHandler ModPerl::Registry
394
+ PerlOptions +ParseHeaders
395
+ Options +ExecCGI
396
+ </Location>
397
+ EOF
398
+ else
399
+ # plain-old CGI
400
+ resolve_full_httpd
401
+ list_mods=$(echo "$full_httpd" | sed 's/-f$/-l/')
402
+ $list_mods | grep 'mod_cgi\.c' >/dev/null 2>&1 || \
403
+ if test -f "$module_path/mod_cgi.so"
404
+ then
405
+ echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf"
406
+ else
407
+ $list_mods | grep 'mod_cgid\.c' >/dev/null 2>&1 || \
408
+ if test -f "$module_path/mod_cgid.so"
409
+ then
410
+ echo "LoadModule cgid_module $module_path/mod_cgid.so" \
411
+ >> "$conf"
412
+ else
413
+ echo "You have no CGI support!"
414
+ exit 2
415
+ fi
416
+ echo "ScriptSock logs/gitweb.sock" >> "$conf"
417
+ fi
418
+ cat >> "$conf" <<EOF
419
+ PassEnv GIT_DIR
420
+ PassEnv GIT_EXEC_PATH
421
+ PassEnv GITWEB_CONFIG
422
+ AddHandler cgi-script .cgi
423
+ <Location /gitweb.cgi>
424
+ Options +ExecCGI
425
+ </Location>
426
+ EOF
427
+ fi
428
+ }
429
+
430
+ mongoose_conf() {
431
+ cat > "$conf" <<EOF
432
+ # Mongoose web server configuration file.
433
+ # Lines starting with '#' and empty lines are ignored.
434
+ # For detailed description of every option, visit
435
+ # https://code.google.com/p/mongoose/wiki/MongooseManual
436
+
437
+ root $root
438
+ ports $port
439
+ index_files gitweb.cgi
440
+ #ssl_cert $fqgitdir/gitweb/ssl_cert.pem
441
+ error_log $fqgitdir/gitweb/$httpd_only/error.log
442
+ access_log $fqgitdir/gitweb/$httpd_only/access.log
443
+
444
+ #cgi setup
445
+ cgi_env PATH=$PATH,GIT_DIR=$GIT_DIR,GIT_EXEC_PATH=$GIT_EXEC_PATH,GITWEB_CONFIG=$GITWEB_CONFIG
446
+ cgi_interp $PERL
447
+ cgi_ext cgi,pl
448
+
449
+ # mimetype mapping
450
+ mime_types .gz=application/x-gzip,.tar.gz=application/x-tgz,.tgz=application/x-tgz,.tar=application/x-tar,.zip=application/zip,.gif=image/gif,.jpg=image/jpeg,.jpeg=image/jpeg,.png=image/png,.css=text/css,.html=text/html,.htm=text/html,.js=text/javascript,.c=text/plain,.cpp=text/plain,.log=text/plain,.conf=text/plain,.text=text/plain,.txt=text/plain,.dtd=text/xml,.bz2=application/x-bzip,.tbz=application/x-bzip-compressed-tar,.tar.bz2=application/x-bzip-compressed-tar
451
+ EOF
452
+ }
453
+
454
+ plackup_conf () {
455
+ # generate a standalone 'plackup' server script in $fqgitdir/gitweb
456
+ # with embedded configuration; it does not use "$conf" file
457
+ cat > "$fqgitdir/gitweb/gitweb.psgi" <<EOF
458
+ #!$PERL
459
+
460
+ # gitweb - simple web interface to track changes in git repositories
461
+ # PSGI wrapper and server starter (see https://plackperl.org)
462
+
463
+ use strict;
464
+
465
+ use IO::Handle;
466
+ use Plack::MIME;
467
+ use Plack::Builder;
468
+ use Plack::App::WrapCGI;
469
+ use CGI::Emulate::PSGI 0.07; # minimum version required to work with gitweb
470
+
471
+ # mimetype mapping (from lighttpd_conf)
472
+ Plack::MIME->add_type(
473
+ ".pdf" => "application/pdf",
474
+ ".sig" => "application/pgp-signature",
475
+ ".spl" => "application/futuresplash",
476
+ ".class" => "application/octet-stream",
477
+ ".ps" => "application/postscript",
478
+ ".torrent" => "application/x-bittorrent",
479
+ ".dvi" => "application/x-dvi",
480
+ ".gz" => "application/x-gzip",
481
+ ".pac" => "application/x-ns-proxy-autoconfig",
482
+ ".swf" => "application/x-shockwave-flash",
483
+ ".tar.gz" => "application/x-tgz",
484
+ ".tgz" => "application/x-tgz",
485
+ ".tar" => "application/x-tar",
486
+ ".zip" => "application/zip",
487
+ ".mp3" => "audio/mpeg",
488
+ ".m3u" => "audio/x-mpegurl",
489
+ ".wma" => "audio/x-ms-wma",
490
+ ".wax" => "audio/x-ms-wax",
491
+ ".ogg" => "application/ogg",
492
+ ".wav" => "audio/x-wav",
493
+ ".gif" => "image/gif",
494
+ ".jpg" => "image/jpeg",
495
+ ".jpeg" => "image/jpeg",
496
+ ".png" => "image/png",
497
+ ".xbm" => "image/x-xbitmap",
498
+ ".xpm" => "image/x-xpixmap",
499
+ ".xwd" => "image/x-xwindowdump",
500
+ ".css" => "text/css",
501
+ ".html" => "text/html",
502
+ ".htm" => "text/html",
503
+ ".js" => "text/javascript",
504
+ ".asc" => "text/plain",
505
+ ".c" => "text/plain",
506
+ ".cpp" => "text/plain",
507
+ ".log" => "text/plain",
508
+ ".conf" => "text/plain",
509
+ ".text" => "text/plain",
510
+ ".txt" => "text/plain",
511
+ ".dtd" => "text/xml",
512
+ ".xml" => "text/xml",
513
+ ".mpeg" => "video/mpeg",
514
+ ".mpg" => "video/mpeg",
515
+ ".mov" => "video/quicktime",
516
+ ".qt" => "video/quicktime",
517
+ ".avi" => "video/x-msvideo",
518
+ ".asf" => "video/x-ms-asf",
519
+ ".asx" => "video/x-ms-asf",
520
+ ".wmv" => "video/x-ms-wmv",
521
+ ".bz2" => "application/x-bzip",
522
+ ".tbz" => "application/x-bzip-compressed-tar",
523
+ ".tar.bz2" => "application/x-bzip-compressed-tar",
524
+ "" => "text/plain"
525
+ );
526
+
527
+ my \$app = builder {
528
+ # to be able to override \$SIG{__WARN__} to log build time warnings
529
+ use CGI::Carp; # it sets \$SIG{__WARN__} itself
530
+
531
+ my \$logdir = "$fqgitdir/gitweb/$httpd_only";
532
+ open my \$access_log_fh, '>>', "\$logdir/access.log"
533
+ or die "Couldn't open access log '\$logdir/access.log': \$!";
534
+ open my \$error_log_fh, '>>', "\$logdir/error.log"
535
+ or die "Couldn't open error log '\$logdir/error.log': \$!";
536
+
537
+ \$access_log_fh->autoflush(1);
538
+ \$error_log_fh->autoflush(1);
539
+
540
+ # redirect build time warnings to error.log
541
+ \$SIG{'__WARN__'} = sub {
542
+ my \$msg = shift;
543
+ # timestamp warning like in CGI::Carp::warn
544
+ my \$stamp = CGI::Carp::stamp();
545
+ \$msg =~ s/^/\$stamp/gm;
546
+ print \$error_log_fh \$msg;
547
+ };
548
+
549
+ # write errors to error.log, access to access.log
550
+ enable 'AccessLog',
551
+ format => "combined",
552
+ logger => sub { print \$access_log_fh @_; };
553
+ enable sub {
554
+ my \$app = shift;
555
+ sub {
556
+ my \$env = shift;
557
+ \$env->{'psgi.errors'} = \$error_log_fh;
558
+ \$app->(\$env);
559
+ }
560
+ };
561
+ # gitweb currently doesn't work with $SIG{CHLD} set to 'IGNORE',
562
+ # because it uses 'close $fd or die...' on piped filehandle $fh
563
+ # (which causes the parent process to wait for child to finish).
564
+ enable_if { \$SIG{'CHLD'} eq 'IGNORE' } sub {
565
+ my \$app = shift;
566
+ sub {
567
+ my \$env = shift;
568
+ local \$SIG{'CHLD'} = 'DEFAULT';
569
+ local \$SIG{'CLD'} = 'DEFAULT';
570
+ \$app->(\$env);
571
+ }
572
+ };
573
+ # serve static files, i.e. stylesheet, images, script
574
+ enable 'Static',
575
+ path => sub { m!\.(js|css|png)\$! && s!^/gitweb/!! },
576
+ root => "$root/",
577
+ encoding => 'utf-8'; # encoding for 'text/plain' files
578
+ # convert CGI application to PSGI app
579
+ Plack::App::WrapCGI->new(script => "$root/gitweb.cgi")->to_app;
580
+ };
581
+
582
+ # make it runnable as standalone app,
583
+ # like it would be run via 'plackup' utility
584
+ if (caller) {
585
+ return \$app;
586
+ } else {
587
+ require Plack::Runner;
588
+
589
+ my \$runner = Plack::Runner->new();
590
+ \$runner->parse_options(qw(--env deployment --port $port),
591
+ "$local" ? qw(--host 127.0.0.1) : ());
592
+ \$runner->run(\$app);
593
+ }
594
+ __END__
595
+ EOF
596
+
597
+ chmod a+x "$fqgitdir/gitweb/gitweb.psgi"
598
+ # configuration is embedded in server script file, gitweb.psgi
599
+ rm -f "$conf"
600
+ }
601
+
602
+ python_conf() {
603
+ # Python's builtin http.server and its CGI support is very limited.
604
+ # CGI handler is capable of running CGI script only from inside a directory.
605
+ # Trying to set cgi_directories=["/"] will add double slash to SCRIPT_NAME
606
+ # and that in turn breaks gitweb's relative link generation.
607
+
608
+ # create a simple web root where $fqgitdir/gitweb/$httpd_only is our root
609
+ mkdir -p "$fqgitdir/gitweb/$httpd_only/cgi-bin"
610
+ # Python http.server follows the symlinks
611
+ ln -sf "$root/gitweb.cgi" "$fqgitdir/gitweb/$httpd_only/cgi-bin/gitweb.cgi"
612
+ ln -sf "$root/static" "$fqgitdir/gitweb/$httpd_only/"
613
+
614
+ # generate a standalone 'python http.server' script in $fqgitdir/gitweb
615
+ # This assumes that python is in user's $PATH
616
+ # This script is Python 2 and 3 compatible
617
+ cat > "$fqgitdir/gitweb/gitweb.py" <<EOF
618
+ #!/usr/bin/env python
619
+ import os
620
+ import sys
621
+
622
+ # Open log file in line buffering mode
623
+ accesslogfile = open("$fqgitdir/gitweb/access.log", 'a', buffering=1)
624
+ errorlogfile = open("$fqgitdir/gitweb/error.log", 'a', buffering=1)
625
+
626
+ # and replace our stdout and stderr with log files
627
+ # also do a lowlevel duplicate of the logfile file descriptors so that
628
+ # our CGI child process writes any stderr warning also to the log file
629
+ _orig_stdout_fd = sys.stdout.fileno()
630
+ sys.stdout.close()
631
+ os.dup2(accesslogfile.fileno(), _orig_stdout_fd)
632
+ sys.stdout = accesslogfile
633
+
634
+ _orig_stderr_fd = sys.stderr.fileno()
635
+ sys.stderr.close()
636
+ os.dup2(errorlogfile.fileno(), _orig_stderr_fd)
637
+ sys.stderr = errorlogfile
638
+
639
+ from functools import partial
640
+
641
+ if sys.version_info < (3, 0): # Python 2
642
+ from CGIHTTPServer import CGIHTTPRequestHandler
643
+ from BaseHTTPServer import HTTPServer as ServerClass
644
+ else: # Python 3
645
+ from http.server import CGIHTTPRequestHandler
646
+ from http.server import HTTPServer as ServerClass
647
+
648
+
649
+ # Those environment variables will be passed to the cgi script
650
+ os.environ.update({
651
+ "GIT_EXEC_PATH": "$GIT_EXEC_PATH",
652
+ "GIT_DIR": "$GIT_DIR",
653
+ "GITWEB_CONFIG": "$GITWEB_CONFIG"
654
+ })
655
+
656
+
657
+ class GitWebRequestHandler(CGIHTTPRequestHandler):
658
+
659
+ def log_message(self, format, *args):
660
+ # Write access logs to stdout
661
+ sys.stdout.write("%s - - [%s] %s\n" %
662
+ (self.address_string(),
663
+ self.log_date_time_string(),
664
+ format%args))
665
+
666
+ def do_HEAD(self):
667
+ self.redirect_path()
668
+ CGIHTTPRequestHandler.do_HEAD(self)
669
+
670
+ def do_GET(self):
671
+ if self.path == "/":
672
+ self.send_response(303, "See Other")
673
+ self.send_header("Location", "/cgi-bin/gitweb.cgi")
674
+ self.end_headers()
675
+ return
676
+ self.redirect_path()
677
+ CGIHTTPRequestHandler.do_GET(self)
678
+
679
+ def do_POST(self):
680
+ self.redirect_path()
681
+ CGIHTTPRequestHandler.do_POST(self)
682
+
683
+ # rewrite path of every request that is not gitweb.cgi to out of cgi-bin
684
+ def redirect_path(self):
685
+ if not self.path.startswith("/cgi-bin/gitweb.cgi"):
686
+ self.path = self.path.replace("/cgi-bin/", "/")
687
+
688
+ # gitweb.cgi is the only thing that is ever going to be run here.
689
+ # Ignore everything else
690
+ def is_cgi(self):
691
+ result = False
692
+ if self.path.startswith('/cgi-bin/gitweb.cgi'):
693
+ result = CGIHTTPRequestHandler.is_cgi(self)
694
+ return result
695
+
696
+
697
+ bind = "0.0.0.0"
698
+ if "$local" == "true":
699
+ bind = "127.0.0.1"
700
+
701
+ # Set our http root directory
702
+ # This is a work around for a missing directory argument in older Python versions
703
+ # as this was added to SimpleHTTPRequestHandler in Python 3.7
704
+ os.chdir("$fqgitdir/gitweb/$httpd_only/")
705
+
706
+ GitWebRequestHandler.protocol_version = "HTTP/1.0"
707
+ httpd = ServerClass((bind, $port), GitWebRequestHandler)
708
+
709
+ sa = httpd.socket.getsockname()
710
+ print("Serving HTTP on", sa[0], "port", sa[1], "...")
711
+ httpd.serve_forever()
712
+ EOF
713
+
714
+ chmod a+x "$fqgitdir/gitweb/gitweb.py"
715
+ }
716
+
717
+ gitweb_conf() {
718
+ cat > "$fqgitdir/gitweb/gitweb_config.perl" <<EOF
719
+ #!/usr/bin/perl
720
+ our \$projectroot = "$(dirname "$fqgitdir")";
721
+ our \$git_temp = "$fqgitdir/gitweb/tmp";
722
+ our \$projects_list = \$projectroot;
723
+
724
+ \$feature{'remote_heads'}{'default'} = [1];
725
+ EOF
726
+ }
727
+
728
+ configure_httpd() {
729
+ case "$httpd" in
730
+ *lighttpd*)
731
+ lighttpd_conf
732
+ ;;
733
+ *apache2*|*httpd*)
734
+ apache2_conf
735
+ ;;
736
+ webrick)
737
+ webrick_conf
738
+ ;;
739
+ *mongoose*)
740
+ mongoose_conf
741
+ ;;
742
+ *plackup*)
743
+ plackup_conf
744
+ ;;
745
+ *python*)
746
+ python_conf
747
+ ;;
748
+ *)
749
+ echo "Unknown httpd specified: $httpd"
750
+ exit 1
751
+ ;;
752
+ esac
753
+ }
754
+
755
+ case "$action" in
756
+ stop)
757
+ stop_httpd
758
+ exit 0
759
+ ;;
760
+ start)
761
+ start_httpd
762
+ exit 0
763
+ ;;
764
+ restart)
765
+ stop_httpd
766
+ start_httpd
767
+ exit 0
768
+ ;;
769
+ esac
770
+
771
+ gitweb_conf
772
+
773
+ resolve_full_httpd
774
+ mkdir -p "$fqgitdir/gitweb/$httpd_only"
775
+ conf="$fqgitdir/gitweb/$httpd_only.conf"
776
+
777
+ configure_httpd
778
+
779
+ start_httpd
780
+ url=http://127.0.0.1:$port
781
+
782
+ if test -n "$browser"; then
783
+ httpd_is_ready && git web--browse -b "$browser" $url || echo $url
784
+ else
785
+ httpd_is_ready && git web--browse -c "instaweb.browser" $url || echo $url
786
+ fi