github.com/dzsibi/gophish@v0.7.1-0.20190719042945-1f16c7237d0d/docker/run.sh (about)

     1  #!/bin/bash
     2  
     3  # set config for admin_server
     4  if [ -n "${ADMIN_LISTEN_URL+set}" ] ; then
     5      jq -r \
     6          --arg ADMIN_LISTEN_URL "${ADMIN_LISTEN_URL}" \
     7          '.admin_server.listen_url = $ADMIN_LISTEN_URL' config.json > config.json.tmp && \
     8          mv config.json.tmp config.json
     9  fi
    10  if [ -n "${ADMIN_USE_TLS+set}" ] ; then
    11      jq -r \
    12          --argjson ADMIN_USE_TLS "${ADMIN_USE_TLS}" \
    13          '.admin_server.use_tls = $ADMIN_USE_TLS' config.json > config.json.tmp && \
    14          mv config.json.tmp config.json
    15  fi
    16  if [ -n "${ADMIN_CERT_PATH+set}" ] ; then
    17      jq -r \
    18          --arg ADMIN_CERT_PATH "${ADMIN_CERT_PATH}" \
    19          '.admin_server.cert_path = $ADMIN_CERT_PATH' config.json > config.json.tmp && \
    20          mv config.json.tmp config.json
    21  fi
    22  if [ -n "${ADMIN_KEY_PATH+set}" ] ; then
    23      jq -r \
    24          --arg ADMIN_KEY_PATH "${ADMIN_KEY_PATH}" \
    25          '.admin_server.key_path = $ADMIN_KEY_PATH' config.json > config.json.tmp && \
    26          mv config.json.tmp config.json
    27  fi
    28  
    29  # set config for phish_server
    30  if [ -n "${PHISH_LISTEN_URL+set}" ] ; then
    31      jq -r \
    32          --arg PHISH_LISTEN_URL "${PHISH_LISTEN_URL}" \
    33          '.phish_server.listen_url = $PHISH_LISTEN_URL' config.json > config.json.tmp && \
    34          mv config.json.tmp config.json
    35  fi
    36  if [ -n "${PHISH_USE_TLS+set}" ] ; then
    37      jq -r \
    38          --argjson PHISH_USE_TLS "${PHISH_USE_TLS}" \
    39          '.phish_server.use_tls = $PHISH_USE_TLS' config.json > config.json.tmp && \
    40          mv config.json.tmp config.json
    41  fi
    42  if [ -n "${PHISH_CERT_PATH+set}" ] ; then
    43      jq -r \
    44          --arg PHISH_CERT_PATH "${PHISH_CERT_PATH}" \
    45          '.phish_server.cert_path = $PHISH_CERT_PATH' config.json > config.json.tmp && \
    46          mv config.json.tmp config.json
    47  fi
    48  if [ -n "${PHISH_KEY_PATH+set}" ] ; then
    49      jq -r \
    50          --arg PHISH_KEY_PATH "${PHISH_KEY_PATH}" \
    51          '.phish_server.key_path = $PHISH_KEY_PATH' config.json > config.json.tmp && \
    52          mv config.json.tmp config.json
    53  fi
    54  
    55  # set contact_address
    56  if [ -n "${CONTACT_ADDRESS+set}" ] ; then
    57      jq -r \
    58          --arg CONTACT_ADDRESS "${CONTACT_ADDRESS}" \
    59          '.contact_address = $CONTACT_ADDRESS' config.json > config.json.tmp && \
    60          mv config.json.tmp config.json
    61  fi
    62  
    63  cat config.json
    64  
    65  # start gophish
    66  ./gophish