Skip to content

Repo not cloned if directory already exists #7

@joeworkman

Description

@joeworkman

Describe the issue

I noticed that if I already have the folder created (/var/www/aspecthq.com), then the repo would not get initialized. I have to run the initial git clone myself. Not a huge deal. I would expect it to work though.

Configuration

Paste full Caddyfile below:

{
    git {
        repo aspecthq.com {
            base_dir /var/www
            url https://gitlab.com/joeworkman/aspecthq.com.git
            branch master
            depth 1
            # auth ssh /var/www/ssh/id_rsa.pub
            webhook name X-Gitlab-Token go-caddy-git-go
            # post pull exec {
            #     name Pager
            #     command /usr/local/bin/pager
            #     args "pulled authp.github.io repo"
            # }
        }
    }
}
aspecthq.com {
    redir https://www.aspecthq.com{uri}
}
www.aspecthq.com {
    log {
        output file /var/log/caddy/aspecthq.com/access.log {
            roll_size 3MiB
            roll_keep 5
            roll_keep_for 48h
        }
    }
    handle_errors {
        respond "{http.error.status_code} {http.error.status_text}"
        # rewrite * /{http.error.status_code}.html
        # file_server
    }
    route /update {
        git update repo aspecthq.com
    }
    encode gzip zstd
    php_fastcgi unix//run/php/php8.1-fpm.sock
    file_server
    root * /var/www/aspecthq.com
    push
}

Version Information

Provide output of caddy list-modules -versions | grep git below:

git v1.0.4
http.handlers.git v1.0.4

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions