Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo not cloned if directory already exists #7

Open
joeworkman opened this issue Jan 14, 2022 · 3 comments
Open

Repo not cloned if directory already exists #7

joeworkman opened this issue Jan 14, 2022 · 3 comments
Assignees

Comments

@joeworkman
Copy link

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
@greenpau
Copy link
Owner

I noticed that if I already have the folder created (/var/www/aspecthq.com), then the repo would not get initialized.

@joeworkman , yes, because it is unclear what is that directory, i.e. cannot simply remove it.

I have to run the initial git clone myself. Not a huge deal. I would expect it to work though.

Say it discovers a directory (due to misconfiguration). What would be the logic to decide to pull it?

@joeworkman
Copy link
Author

joeworkman commented Jan 15, 2022

What would you remove it? With the git clone command, do you not have to ability to define where you want the destination for the clone? Via terminal I use...

git clone https://gitlab.com/joeworkman/aspecthq.com.git /var/www/aspecthq.com

@greenpau
Copy link
Owner

@joeworkman , is this still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants