rgit icon indicating copy to clipboard operation
rgit copied to clipboard

error: one or more required arguments were not provided

Open ansible42 opened this issue 11 months ago • 6 comments

I keep getting required args not provided errors. Even if I am missing something simple it would be nice if the log gave a bit more info.

  rgit:
    container_name: rgit
    image: ghcr.io/w4/rgit:main
    restart: unless-stopped
    user: ${PUID}
    environment: 
      - REFRESH_INTERVAL=5m
    volumes:
        - ${GIT}:/git
    ports:
      - 3333:8000

ansible42 avatar Jan 13 '25 00:01 ansible42

The issue stems from the Dockerfile no longer calling into the entrypoint.sh, so the binary is expecting "[::]:8000" /git -d /tmp/rgit-cache.db to be passed in as arguments. Ideally the Dockerfile should be fixed though

w4 avatar Jan 13 '25 04:01 w4

I've been trying for the better part of an hour now, and it's not possible given the information in the readme to get this working in docker.

I've tried doas docker run --mount type=bind,source=/git,target=/git --user 1000:1000 -it ghcr.io/w4/rgit:main which returns error: one or more required arguments were not provided. I've tried using Portainer in a stack;

version: '3'
services:
  rgit:
    image: ghcr.io/w4/rgit:main
    volumes:
      - /path/to/my-repos:/git
    ports:
      - 3333:8000
    restart: unless-stopped

and get error: one or more required arguments were not provided in the docker log. It simply doesn't work.

zQueal avatar Mar 12 '25 00:03 zQueal

If you pass --help it should give you more information about the command. I don’t use Docker myself but I’d assume you need an args key with "[::]:8000" /git -d /tmp/rgit-cache.db

w4 avatar Mar 12 '25 04:03 w4

It is possible to add the necessary arguments in the docker compose file via the command setting:

version: '3'
services:
  rgit:
    image: ghcr.io/w4/rgit:main
    command:
      - "[::]:8000"
      - /git
      - -d /tmp/rgit-cache.db
    volumes:
      - /volume/git:/git
    ports:
      - 8000:8000
    environment:
      - REFRESH_INTERVAL=5m
    restart: unless-stopped

Alternatively, it is also feasible to replace the entrypoint with the entrypoint setting if you prefer.

paberr avatar Mar 14 '25 11:03 paberr

See also #103

stappersg avatar Mar 14 '25 12:03 stappersg

I ended up going with this;

[!NOTE] My VPS is IPv4 only, with a caddy2 reverse_proxy running in front.

version: '3'
services:
  rgit:
    image: ghcr.io/w4/rgit:main
    command:
      - "0.0.0.0:8000"
      - /git
      - -d /tmp/rgit-cache.db
    volumes:
      - /git:/git
    expose:
      - 8000
    environment:
      - REFRESH_INTERVAL=5m
    restart: unless-stopped

Caddyfile:

*domain.dev {
        encode zstd gzip
        @git host git.domain.dev
        handle @git {
                reverse_proxy {rgit_hash}:8000
        }
        @ping host ping.domain.dev
        handle @ping {
                respond "pong!"
        }
}

Using the caddy reverse_proxy ensures that it's not necessary to expose the ports of the container to the world (and its irresponsible to do). But this works perfectly fine.

Created PR to reflect the changes.

zQueal avatar Mar 14 '25 18:03 zQueal