klaussilveira / gitlist

An elegant and modern git repository viewer
https://gitlist.org/
BSD 3-Clause "New" or "Revised" License
2.92k stars 517 forks source link

Support needed on installing #920

Open satel-kalletuulos opened 2 years ago

satel-kalletuulos commented 2 years ago

I'm trying to install Gitlist 2.0 from zip file to Ubuntu 22.04 server, running Apache2. The server has PHP 8.1.

The normal WWW directory, i.e. from where pages are served, is: /var/www/html

Gitlist is unzipped installed in directory: /var/www/html/gitlist

File /etc/apache2/conf-enabled/gitlist.conf is as follows:

Alias /gitlist /var/www/html/gitlist/public
<Directory /var/www/html/gitlist>
  Options FollowSymLinks
  AllowOverride All
</Directory>

The config/config.yml has been configured as follows:

  # List of directories containing repositories
  default_repository_dir: /var/www/html/git-mirror/github.com
  repositories:
    - '%env(default:default_repository_dir:DEFAULT_REPOSITORY_DIR)%'
....
  # How many levels should be recursively traversed looking for repositories
  repository_depth: '1'

I have cloned two repositories from Github as follows:

/var/www/html/git-mirror/github.com/meta-rust/meta-rust.git
/var/www/html/git-mirror/github.com/nxp-imx/imx-manifest.git

When I open the gitlist URL, I get following page (styled with Markdown, copy&paste from Chrome):

--8<---8<--- GitList Repositories Help Report an Issue imx-manifest.git RSS Unnamed repository; edit this file 'description' to name the repository. meta-rust.git RSS Unnamed repository; edit this file 'description' to name the repository. © 2012 - 2022 Powered by GitList.org --8<---8<---

When I try to click either of those repositories, I just get error "Not Found, The Requested URL was not found on this server." It seems that gitlist does not create some logical links when it scans directories for repositories. Anyway, there are no error messages on the var/log/prod.log , only following is printed:

[2022-10-18T17:07:36.951207+03:00] request.INFO: Matched route "repository_list". {"route":"repository_list","route_parameters":{"_route":"repository_list","_controller":"GitList\\App\\Controller\\Repository::list"},"request_uri":"http://192.168.0.226/gitlist/","method":"GET"} []

Could you please give a simple example, how to configure gitlist to work with just couple of cloned repositories?

gsnw commented 2 years ago

If I see this correctly, it is the same error as #915 Workaround is change repository_depth: '1' to '0' and put all repositorys in one main folder "/var/www/html/git-mirror/github.com/"

klaussilveira commented 2 years ago

Marking as bug since there might be an issue in the recursive iterator.

beastie-git commented 1 year ago

Hi,

I have the same issue. I have configured the following directories : /data/git for my git repos, and '/data/www/html/002-git' for my webroot.

i tried workaround with repository_depth:0 and create some .git repos on my git directory

[ Versions ] php-fpm8.1 Apache/2.4.54 (Debian) git version 2.30.2

[config] apache conf

<IfModule mod_ssl.c>
  <VirtualHost *:443>
    ServerAdmin webmaster@unixyourbrain.org
    ServerName git.unixyourbrain.org
    DocumentRoot /data/www/htdocs/002-git/public

    <Directory /data/www/htdocs/002-git/>
      Options FollowSymLinks
      AllowOverride All
      Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/000-default-error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # enable HTTP/2, if available
    Protocols h2 http/1.1

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/git.unixyourbrain.org/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/git.unixyourbrain.org/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/git.unixyourbrain.org/chain.pem
  </VirtualHost>
</IfModule>

config.yml

default_repository_dir: /data/git
repository_depth: '0'

I can list repositories created on /data/git, but cant browse them.

i have the same message on the Gitlist log file :

[2023-01-30T13:37:29.420023+00:00] request.INFO: Matched route "repository_list". {"route":"repository_list","route_parameters":{"_route":"repository_list","_controller":"GitList\\App\\Controller\\Repository::list"},"request_uri":"https://git.unixyourbrain.org/","method":"GET"} []