Skip to content
Snippets Groups Projects
Commit ec803548 authored by Éloïs's avatar Éloïs
Browse files

Add env var DUNITER_OPTS in docker-entrypoint

parent d62d4de2
No related branches found
No related tags found
No related merge requests found
...@@ -28,10 +28,12 @@ case "$DUNITER_CHAIN_NAME" in ...@@ -28,10 +28,12 @@ case "$DUNITER_CHAIN_NAME" in
;; ;;
esac esac
DUNITER_OPTS="${DUNITER_OPTS:---unsafe-ws-external}"
set -- "$@" \ set -- "$@" \
"${chain[@]}" \ "${chain[@]}" \
$(ternary "$DUNITER_DISABLE_PROMETHEUS" --no-prometheus) \ $(ternary "$DUNITER_DISABLE_PROMETHEUS" --no-prometheus) \
--unsafe-ws-external -d /var/lib/duniter -d /var/lib/duniter
echo "Starting duniter with parameters:" "$@" echo "Starting duniter with parameters:" "$@"
exec duniter "$@" exec duniter "$DUNITER_OPTS" "$@"
  • pini @pini-gh ·
    Maintainer

    This should be:

    DUNITER_OPTS="${DUNITER_OPTS:---unsafe-ws-external}"
    
    set -- "$@" \
      "${chain[@]}" \
      $(ternary "$DUNITER_DISABLE_PROMETHEUS" --no-prometheus) \
      $DUNITER_OPTS -d /var/lib/duniter
    
    echo "Starting duniter with parameters:" "$@"
    exec duniter "$@"

    Please note there must be no quotes around $DUNITER_OPTS to allow setting several options.

  • Éloïs @librelois ·
    Author Owner

    En fait non je me souviens maintenant (c'était tard hier soir), ce que tu propose ne marche pas non plus si on liste plusieurs options dans DUNITER_OPTS, de otute façno on à pas besoin de cette variable, je croyais que j'avais revert ce changement avant de merger.

  • Éloïs @librelois ·
    Author Owner

    J'avais essayé d'ajouter cette variable, car je croyais en avoir besoin via compose, jusqu'à ce que je trouve dans la doc de compose comment injecter des arguments supplémentaires

    Edited by Éloïs
  • pini @pini-gh ·
    Maintainer

    ce que tu propose ne marche pas non plus si on liste plusieurs options dans DUNITER_OPTS

    Ah bon ? Pourquoi ?

  • Éloïs @librelois ·
    Author Owner

    Parce que les arguments sont injectés dans le binaire comme un seul argument, et donc ça fail au dénarrage, j'en suis sûr puisque j'avais testé exactement ça hier soir

    Edited by Éloïs
  • pini @pini-gh ·
    Maintainer

    Non justement... Sans les doubles quotes ça n'est pas le cas.

  • Éloïs @librelois ·
    Author Owner

    Je sais plus si j'avais testé avec ou san sles double quote, bref finalement on à pas besoni de cette variable, si quelqu'un en à besoin un jour on l'ajoutera :)

  • pini @pini-gh ·
    Maintainer
    $ cat test.sh
    #!/bin/bash
    DUNITER_OPTS="${DUNITER_OPTS:---unsafe-ws-external}"
    set -- "$@" $DUNITER_OPTS
    for arg in "$@"; do
      echo "$arg"
    done
    $ DUNITER_OPTS="--option1 --option2 --option3" ./test.sh blah
    blah
    --option1
    --option2
    --option3
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment