gitprep / lib / Gitprep.pm /
Newer Older
426 lines | 12.014kb
copy gitweblite soruce code
root authored on 2012-11-23
1
use 5.008007;
renamed gitpub to gitprep
Yuki Kimoto authored on 2012-11-26
2
package Gitprep;
copy gitweblite soruce code
root authored on 2012-11-23
3
use Mojo::Base 'Mojolicious';
cleanup
Yuki Kimoto authored on 2013-05-14
4

            
5
use Carp 'croak';
added start page
Yuki Kimoto authored on 2013-02-09
6
use DBIx::Custom;
little more secure login
Yuki Kimoto authored on 2013-03-16
7
use Gitprep::API;
cleanup
Yuki Kimoto authored on 2013-05-14
8
use Gitprep::Git;
fixed tags page paging bug a...
Yuki Kimoto authored on 2013-05-01
9
use Gitprep::Manager;
added RepManager rename feat...
Yuki Kimoto authored on 2013-03-27
10
use Scalar::Util 'weaken';
cleanup
Yuki Kimoto authored on 2013-05-14
11
use Validator::Custom;
fix bug that forst . is not ...
Yuki Kimoto authored on 2014-04-21
12
use Mojolicious::Plugin::AutoRoute::Util 'template';
copy gitweblite soruce code
root authored on 2012-11-23
13

            
fix bug that in CGI reposito...
Yuki Kimoto authored on 2015-11-05
14

            
Digest::SHA loading to Mojo:...
Yuki Kimoto authored on 2013-08-13
15
# Digest::SHA loading to Mojo::Util if not loaded
16
{
17
  package Mojo::Util;
18
  eval {require Digest::SHA; import Digest::SHA qw(sha1 sha1_hex)};
19
}
20

            
add Mojolicious::Plugin::DBV...
Yuki Kimoto authored on 2016-03-26
21
our $VERSION = 'v2.00_dev';
cleanup
Yuki Kimoto authored on 2013-05-14
22

            
added start page
Yuki Kimoto authored on 2013-02-09
23
has 'dbi';
revert encoding support
Yuki Kimoto authored on 2013-11-22
24
has 'git';
added RepManager rename feat...
Yuki Kimoto authored on 2013-03-27
25
has 'manager';
rename validator to vc to up...
Yuki Kimoto authored on 2013-12-02
26
has 'vc';
revert encoding support
Yuki Kimoto authored on 2013-11-22
27

            
28
use constant BUFFER_SIZE => 8192;
add /info/refs request
Yuki Kimoto authored on 2013-10-01
29

            
copy gitweblite soruce code
root authored on 2012-11-23
30
sub startup {
31
  my $self = shift;
32
  
cleanup
Yuki Kimoto authored on 2013-05-14
33
  # Config file
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
34
  $self->plugin('INIConfig', {ext => 'conf'});
35
  
cleanup
Yuki Kimoto authored on 2013-05-14
36
  # Config file for developper
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
37
  unless ($ENV{GITPREP_NO_MYCONFIG}) {
38
    my $my_conf_file = $self->home->rel_file('gitprep.my.conf');
39
    $self->plugin('INIConfig', {file => $my_conf_file}) if -f $my_conf_file;
40
  }
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
41
  
cleanup
Yuki Kimoto authored on 2013-05-14
42
  # Listen
copy gitweblite soruce code
root authored on 2012-11-23
43
  my $conf = $self->config;
cleanup
Yuki Kimoto authored on 2013-05-14
44
  my $listen = $conf->{hypnotoad}{listen} ||= ['http://*:10020'];
45
  $listen = [split /,/, $listen] unless ref $listen eq 'ARRAY';
fixed listen bug
Yuki Kimoto authored on 2013-03-29
46
  $conf->{hypnotoad}{listen} = $listen;
copy gitweblite soruce code
root authored on 2012-11-23
47
  
revert encoding support
Yuki Kimoto authored on 2013-11-22
48
  # Git
renamed gitpub to gitprep
Yuki Kimoto authored on 2012-11-26
49
  my $git = Gitprep::Git->new;
cleanup
Yuki Kimoto authored on 2013-05-14
50
  my $git_bin
51
    = $conf->{basic}{git_bin} ? $conf->{basic}{git_bin} : $git->search_bin;
fix mini bug
Yuki Kimoto authored on 2013-03-31
52
  if (!$git_bin || ! -e $git_bin) {
53
    $git_bin ||= '';
cleanup
Yuki Kimoto authored on 2013-05-14
54
    my $error = "Can't detect or found git command ($git_bin)."
55
      . " set git_bin in gitprep.conf";
fixed git_bin not found bug
Yuki Kimoto authored on 2013-03-31
56
    $self->log->error($error);
57
    croak $error;
58
  }
improve code structures
Yuki Kimoto authored on 2013-11-19
59
  $git->bin($git_bin);
revert encoding support
Yuki Kimoto authored on 2013-11-22
60
  
Supported specific character...
Tetsuya Hayashi authored on 2014-03-15
61
  # Encoding suspects list for Git
62
  my $encoding_suspects
63
    = $conf->{basic}{encoding_suspects} ||= 'utf8';
64
  $encoding_suspects = [split /,/, $encoding_suspects] unless ref $encoding_suspects eq 'ARRAY';
65
  $git->encoding_suspects($encoding_suspects);
66

            
revert encoding support
Yuki Kimoto authored on 2013-11-22
67
  # Repository Manager
68
  my $manager = Gitprep::Manager->new(app => $self);
69
  weaken $manager->{app};
70
  $self->manager($manager);
71
  
add key delete feature and u...
gitprep authored on 2014-05-19
72
  # authorized_keys file
fix authorized_keys_file bug
Yuki Kimoto authored on 2015-11-04
73
  my $authorized_keys_file = $conf->{basic}{authorized_keys_file};
add key delete feature and u...
gitprep authored on 2014-05-19
74
  unless (defined $authorized_keys_file) {
75
    if (defined $ENV{HOME}) {
fix update_authorized_keys_f...
gitprep authored on 2014-05-19
76
      $authorized_keys_file = "$ENV{HOME}/.ssh/authorized_keys";
add key delete feature and u...
gitprep authored on 2014-05-19
77
    }
78
  }
79
  if (defined $authorized_keys_file) {
80
    $self->manager->authorized_keys_file($authorized_keys_file);
81
  }
82
  else {
83
    $self->app->log->warn(qq/Config "authorized_keys_file" can't be detected/);
84
  }
85
  
fixed git_bin not found bug
Yuki Kimoto authored on 2013-03-31
86
  # Repository home
cleanup
Yuki Kimoto authored on 2013-05-14
87
  my $rep_home = $ENV{GITPREP_REP_HOME} || $self->home->rel_file('data/rep');
revert encoding support
Yuki Kimoto authored on 2013-11-22
88
  $git->rep_home($rep_home);
added create repository feat...
Yuki Kimoto authored on 2013-03-18
89
  unless (-d $rep_home) {
90
    mkdir $rep_home
91
      or croak "Can't create directory $rep_home: $!";
92
  }
cleanup
Yuki Kimoto authored on 2013-05-14
93
  
add time zone system
Yuki Kimoto authored on 2014-03-08
94
  # Time Zone
95
  if (my $time_zone = $conf->{basic}{time_zone}) {
96
    
97
    if ($time_zone =~ /^([\+-])?([0-9]?[0-9]):([0-9][0-9])$/) {
98
      my $sign = $1 || '';
99
      my $hour = $2;
100
      my $min = $3;
101
      
102
      my $time_zone_second = $sign . ($hour * 60 * 60) + ($min * 60);
103
      $git->time_zone_second($time_zone_second);
104
    }
105
    else {
106
      $self->log->warn("Bad time zone $time_zone. Time zone become GMT");
107
    }
108
  }
109
  $self->git($git);
cleanup
Yuki Kimoto authored on 2013-05-14
110
  
improved create repository f...
Yuki Kimoto authored on 2013-03-21
111
  # DBI
added test
Yuki Kimoto authored on 2013-04-30
112
  my $db_file = $ENV{GITPREP_DB_FILE}
113
    || $self->home->rel_file('data/gitprep.db');
improved create repository f...
Yuki Kimoto authored on 2013-03-21
114
  my $dbi = DBIx::Custom->connect(
115
    dsn => "dbi:SQLite:database=$db_file",
116
    connector => 1,
added original_pid column
Yuki Kimoto authored on 2013-04-18
117
    option => {sqlite_unicode => 1, sqlite_use_immediate_transaction => 1}
improved create repository f...
Yuki Kimoto authored on 2013-03-21
118
  );
119
  $self->dbi($dbi);
120
  
cleanup
Yuki Kimoto authored on 2013-05-14
121
  # Database file permision
fixed database file permissi...
Yuki Kimoto authored on 2013-04-19
122
  if (my $user = $self->config->{hypnotoad}{user}) {
123
    my $uid = (getpwnam $user)[2];
124
    chown $uid, -1, $db_file;
125
  }
126
  if (my $group = $self->config->{hypnotoad}{group}) {
127
    my $gid = (getgrnam $group)[2];
128
    chown -1, $gid, $db_file;
129
  }
130
  
added tab_index columns
Yuki Kimoto authored on 2013-04-11
131
  # Setup database
132
  $self->manager->setup_database;
improved create repository f...
Yuki Kimoto authored on 2013-03-21
133
  
134
  # Model
135
  my $models = [
136
    {table => 'user', primary_key => 'id'},
fix ssh key authentication b...
gitprep authored on 2014-05-20
137
    {table => 'ssh_public_key', primary_key => 'key'},
added original_pid column
Yuki Kimoto authored on 2013-04-18
138
    {table => 'project', primary_key => ['user_id', 'name']},
add collaborator register lo...
Yuki Kimoto authored on 2013-11-17
139
    {table => 'number', primary_key => 'key'},
140
    {table => 'collaboration', primary_key => ['user_id', 'project_name', 'collaborator_id']}
improved create repository f...
Yuki Kimoto authored on 2013-03-21
141
  ];
142
  $dbi->create_model($_) for @$models;
143

            
144
  # Validator
rename validator to vc to up...
Yuki Kimoto authored on 2013-12-02
145
  my $vc = Validator::Custom->new;
146
  $self->vc($vc);
147
  $vc->register_constraint(
added project delete feature
Yuki Kimoto authored on 2013-03-24
148
    user_name => sub {
149
      my $value = shift;
150
      
allow . as project name
Yuki Kimoto authored on 2014-04-21
151
      return ($value || '') =~ /^[a-zA-Z0-9_\-]+$/;
added project delete feature
Yuki Kimoto authored on 2013-03-24
152
    },
153
    project_name => sub {
154
      my $value = shift;
allow . as project name
Yuki Kimoto authored on 2014-04-21
155
      return 0 unless defined $value;
156
      return 0 if $value eq '.' || $value eq '..';
157

            
158
      return ($value || '') =~ /[a-zA-Z0-9_\-\.]+$/;
added project delete feature
Yuki Kimoto authored on 2013-03-24
159
    }
160
  );
improved create repository f...
Yuki Kimoto authored on 2013-03-21
161
  
cleanup setting validation
Yuki Kimoto authored on 2016-02-09
162
  $vc->add_check(project_name => sub {
163
    my ($vc, $value) = @_;
164
    
165
    return 0 unless defined $value;
166
    return 0 if $value eq '.' || $value eq '..';
167
    
168
    return ($value || '') =~ /[a-zA-Z0-9_\-\.]+$/;
169
  });
cleanup create user validati...
Yuki Kimoto authored on 2016-02-09
170
  $vc->add_check(user_name => sub {
171
    my ($vc, $value) = @_;
172
    
173
    return ($value || '') =~ /^[a-zA-Z0-9_\-]+$/;
174
  });
cleanup setting validation
Yuki Kimoto authored on 2016-02-09
175
  
fixed receive pack bug and a...
Yuki Kimoto authored on 2013-10-03
176
  # Basic auth plugin
177
  $self->plugin('BasicAuth');
added admin user tests
Yuki Kimoto authored on 2013-05-17
178

            
added login page
Yuki Kimoto authored on 2013-02-09
179
  {
cleanup
Yuki Kimoto authored on 2013-05-14
180
    my $r = $self->routes;
181

            
182
    # DBViewer(only development)
add Mojolicious::Plugin::DBV...
Yuki Kimoto authored on 2016-03-26
183
    # /dbviewer
cleanup
Yuki Kimoto authored on 2013-05-14
184
    if ($self->mode eq 'development') {
185
      eval {
186
        $self->plugin(
187
          'DBViewer',
188
          dsn => "dbi:SQLite:database=$db_file"
189
        );
190
      };
added reset password feature
Yuki Kimoto authored on 2013-04-10
191
    }
added AutoRoute plugin
Yuki Kimoto authored on 2013-04-09
192
    
cleanup
Yuki Kimoto authored on 2013-05-14
193
    # Auto route
cleanup many pages
Yuki Kimoto authored on 2013-03-31
194
    {
cleanup
Yuki Kimoto authored on 2013-05-14
195
      my $r = $r->under(sub {
196
        my $self = shift;
197
        
198
        my $api = $self->gitprep_api;
199
        
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
200
        # Authentication
cleanup
Yuki Kimoto authored on 2013-05-14
201
        {
202
          my $path = $self->req->url->path->parts->[0] || '';
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
203
          
204
          # Admin
cleanup
Yuki Kimoto authored on 2013-05-14
205
          if ($path eq '_admin' && !$api->logined_admin) {
206
            $self->redirect_to('/');
207
            return;
208
          }
209
        }
210
        
211
        return 1; 
212
      });
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
213
      
214
      # Auto routes
cleanup
Yuki Kimoto authored on 2013-05-14
215
      $self->plugin('AutoRoute', route => $r);
fix bug that forst . is not ...
Yuki Kimoto authored on 2014-04-21
216
      
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
217
      # Custom routes
cleanup
Yuki Kimoto authored on 2013-05-14
218
      {
add ssh key add feature
gitprep authored on 2014-05-17
219
        # Show ssh keys
do success xt tests
Yuki Kimoto authored on 2016-03-25
220
        $r->get('/(:user).keys' => template '/user-keys');
add ssh key add feature
gitprep authored on 2014-05-17
221
        
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
222
        # User
allow . as project name
Yuki Kimoto authored on 2014-04-21
223
        my $r = $r->route('/:user');
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
224
        {
225
          # Home
fix bug that forst . is not ...
Yuki Kimoto authored on 2014-04-21
226
          $r->get('/' => [format => 0] => template '/user');
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
227
          
228
          # Settings
229
          $r->get('/_settings' => template '/user-settings');
add ssh keys page design
gitprep authored on 2014-05-17
230
          
231
          # SSH keys
add ssh key add feature
gitprep authored on 2014-05-17
232
          $r->any('/_settings/ssh' => template '/user-settings/ssh');
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
233
        }
add /info/refs request
Yuki Kimoto authored on 2013-10-01
234

            
235
        # Smart HTTP
236
        {
allow . as project name
Yuki Kimoto authored on 2014-04-21
237
          my $r = $r->route('/(#project).git');
add /info/refs request
Yuki Kimoto authored on 2013-10-01
238
          
fixed receive pack bug and a...
Yuki Kimoto authored on 2013-10-03
239
          {
240
            my $r = $r->under(sub {
241
              my $self = shift;
242
              
cleanup
Yuki Kimoto authored on 2013-11-16
243
              my $api = $self->gitprep_api;
complete private repository ...
Yuki Kimoto authored on 2013-11-16
244
              my $user = $self->param('user');
245
              my $project = $self->param('project');
246
              my $private = $self->app->manager->is_private_project($user, $project);
cleanup
Yuki Kimoto authored on 2013-11-16
247
              
fixed receive pack bug and a...
Yuki Kimoto authored on 2013-10-03
248
              # Basic auth when push request
249
              my $service = $self->param('service') || '';
complete private repository ...
Yuki Kimoto authored on 2013-11-16
250
              if ($service eq 'git-receive-pack' || $private) {
fixed receive pack bug and a...
Yuki Kimoto authored on 2013-10-03
251
                
252
                $self->basic_auth("Git Area", sub {
complete private repository ...
Yuki Kimoto authored on 2013-11-16
253
                  my ($auth_user, $auth_password) = @_;
add warnings when authentica...
Yuki Kimoto authored on 2014-02-18
254
                  
255
                  if (!defined $auth_user || !length $auth_user) {
256
                    $self->app->log->warn("Authentication: User name is empty");
257
                  }
258
                  
fix warnings
Yuki Kimoto authored on 2013-11-18
259
                  $auth_user = '' unless defined $auth_user;
260
                  $auth_password = '' unless defined $auth_password;
fixed receive pack bug and a...
Yuki Kimoto authored on 2013-10-03
261
                  
complete collaborator featur...
Yuki Kimoto authored on 2013-11-17
262
                  my $is_valid =
263
                    ($user eq $auth_user || $api->is_collaborator($user, $project, $auth_user))
264
                    && $api->check_user_and_password($auth_user, $auth_password);
fixed receive pack bug and a...
Yuki Kimoto authored on 2013-10-03
265
                  
266
                  return $is_valid;
267
                });
268
              }
269
              else {
270
                return 1;
271
              }
272
            });
273
            
redirect .git access to /use...
Yuki Kimoto authored on 2014-02-26
274
            # /
275
            $r->get('/')->to(cb => sub {
276
              my $self = shift;
277
              
278
              my $user = $self->param('user');
279
              my $project = $self->param('project');
280
              
281
              $self->redirect_to("/$user/$project");
282
            });
283
            
fixed receive pack bug and a...
Yuki Kimoto authored on 2013-10-03
284
            # /info/refs
285
            $r->get('/info/refs' => template 'smart-http/info-refs');
286
            
287
            # /git-upload-pack or /git-receive-pack
288
            $r->any('/git-(:service)'
289
              => [service => qr/(?:upload-pack|receive-pack)/]
290
              => template 'smart-http/service'
291
            );
292
            
293
            # Static file
294
            $r->get('/(*Path)' => template 'smart-http/static');
295
          }
add /info/refs request
Yuki Kimoto authored on 2013-10-01
296
        }
297
                
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
298
        # Project
299
        {
allow . as project name
Yuki Kimoto authored on 2014-04-21
300
          my $r = $r->route('/#project');
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
301
          
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
302
          {
303
            my $r = $r->under(sub {
304
              my $self = shift;
305
              
cleanup
Yuki Kimoto authored on 2013-11-16
306
              # API
307
              my $api = $self->gitprep_api;
improve code structures
Yuki Kimoto authored on 2013-11-19
308
              
309
              # Private
revert encoding support
Yuki Kimoto authored on 2013-11-22
310
              my $user = $self->param('user');
311
              my $project = $self->param('project');
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
312
              my $private = $self->app->manager->is_private_project($user, $project);
313
              if ($private) {
complete collaborator featur...
Yuki Kimoto authored on 2013-11-17
314
                if ($api->can_access_private_project($user, $project)) {
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
315
                  return 1;
316
                }
317
                else {
318
                  $self->render('private');
319
                  return 0;
320
                }
321
              }
322
              else {
323
                return 1;
324
              }
325
            });
326
            
327
            # Home
improve commits header desig...
Yuki Kimoto authored on 2015-12-19
328
            $r->get('/' => template '/tree');
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
329
            
330
            # Commit
331
            $r->get('/commit/*diff' => template '/commit');
add atom feed part
Yuki Kimoto authored on 2014-10-02
332

            
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
333
            # Commits
334
            $r->get('/commits/*rev_file' => template '/commits');
335
            
336
            # Branches
improve some branches page
Yuki Kimoto authored on 2015-12-23
337
            $r->any('/branches/:display' => {display => undef} => template '/branches');
added feature that you see p...
Yuki Kimoto authored on 2013-04-11
338

            
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
339
            # Tags
340
            $r->get('/tags' => template '/tags');
improved network page
Yuki Kimoto authored on 2013-04-16
341

            
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
342
            # Tree
343
            $r->get('/tree/*rev_dir' => template '/tree');
344
            
345
            # Blob
346
            $r->get('/blob/*rev_file' => template '/blob');
347
            
348
            # Sub module
349
            $r->get('/submodule/*rev_file' => template '/submodule');
add blame method
Yuki Kimoto authored on 2013-08-10
350

            
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
351
            # Raw
352
            $r->get('/raw/*rev_file' => template '/raw');
add blame method
Yuki Kimoto authored on 2013-08-10
353

            
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
354
            # Blame
355
            $r->get('/blame/*rev_file' => template '/blame');
356
            
357
            # Archive
358
            $r->get('/archive/(*rev).tar.gz' => template '/archive')->to(archive_type => 'tar');
359
            $r->get('/archive/(*rev).zip' => template '/archive')->to(archive_type => 'zip' );
360
            
361
            # Compare
362
            $r->get('/compare/(*rev1)...(*rev2)' => template '/compare');
363
            
364
            # Settings
improve tab design
Yuki Kimoto authored on 2016-01-26
365
            {
366
              my $r = $r->route('/settings')->to(tab => 'settings');
367
              
368
              # Settings
369
              $r->any('/' => template '/settings');
370
              
371
              # Collaboration
372
              $r->any('/collaboration' => template '/settings/collaboration');
373
            }
add collaboration page
Yuki Kimoto authored on 2013-11-17
374
            
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
375
            # Fork
376
            $r->any('/fork' => template '/fork');
improve tab design
Yuki Kimoto authored on 2016-01-26
377
            
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
378
            # Network
improve tab design
Yuki Kimoto authored on 2016-01-26
379
            {
380
              my $r = $r->route('/network')->to(tab => 'graph');
381
              
382
              # Network
383
              $r->get('/' => template '/network');
cleanup
Yuki Kimoto authored on 2013-05-14
384

            
improve tab design
Yuki Kimoto authored on 2016-01-26
385
              # Network Graph
386
              $r->get('/graph/(*rev1)...(*rev2_abs)' => template '/network/graph');
387
            }
add pull page design
Yuki Kimoto authored on 2013-08-13
388

            
add private reporitory featu...
Yuki Kimoto authored on 2013-11-16
389
            # Import branch
390
            $r->any('/import-branch/:remote_user/:remote_project' => template '/import-branch');
391
            
392
            # Get branches and tags
393
            $r->get('/api/revs' => template '/api/revs');
394
          }
add need_login_always_option
Yuki Kimoto authored on 2013-08-21
395
        }
cleanup
Yuki Kimoto authored on 2013-05-14
396
      }
added AutoRoute plugin
Yuki Kimoto authored on 2013-04-09
397
    }
398
  }
added admin user tests
Yuki Kimoto authored on 2013-05-17
399

            
400
  # Helper
401
  {
402
    # API
403
    $self->helper(gitprep_api => sub { Gitprep::API->new(shift) });
404
  }
added reverse proxy path_dep...
Yuki Kimoto authored on 2013-04-22
405
  
added AutoRoute plugin
Yuki Kimoto authored on 2013-04-09
406
  # Reverse proxy support
added reverse proxy path_dep...
Yuki Kimoto authored on 2013-04-22
407
  my $reverse_proxy_on = $self->config->{reverse_proxy}{on};
408
  my $path_depth = $self->config->{reverse_proxy}{path_depth};
409
  if ($reverse_proxy_on) {
410
    $ENV{MOJO_REVERSE_PROXY} = 1;
411
    if ($path_depth) {
412
      $self->hook('before_dispatch' => sub {
413
        my $self = shift;
414
        for (1 .. $path_depth) {
415
          my $prefix = shift @{$self->req->url->path->parts};
416
          push @{$self->req->url->base->path->parts}, $prefix;
417
        }
418
      });
added AutoRoute plugin
Yuki Kimoto authored on 2013-04-09
419
    }
added reverse proxy path_dep...
Yuki Kimoto authored on 2013-04-22
420
  }
cleanup
Yuki Kimoto authored on 2013-10-11
421
  
422
  # Smart HTTP Buffer size
fix bug that lerge repositor...
Yuki Kimoto authored on 2014-02-17
423
  $ENV{GITPREP_SMART_HTTP_BUFFER_SIZE} ||= 16384;
copy gitweblite soruce code
root authored on 2012-11-23
424
}
425

            
426
1;