Skip to content

Commit

Permalink
[requested-changes] Added ping in celery container
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed Jun 21, 2022
1 parent 64d8316 commit 43e389e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion images/common/init_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ elif [ "$MODULE_NAME" = 'wireguard' ]; then
exit
fi
wait_nginx_services
sudo -u openwisp -E bash -c "source utils.sh; wireguard_setup"
wireguard_setup

elif [ "$MODULE_NAME" = 'wireguard_updater' ]; then
start_uwsgi
Expand Down
2 changes: 1 addition & 1 deletion images/openwisp_celery/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY --chown=openwisp:root ./openwisp_dashboard/module_settings.py \

USER root:root
RUN apt install --yes --no-install-recommends \
iproute2 iptables sudo
iproute2 iptables sudo iputils-ping
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

CMD ["bash", "init_command.sh"]
Expand Down
3 changes: 2 additions & 1 deletion images/openwisp_wireguard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ COPY --chown=openwisp:root ./openwisp_wireguard/update_wireguard.sh \
./common/utils.sh \
./common/services.py /opt/openwisp/

CMD ["bash", "init_command.sh"]
USER openwisp:root
ENTRYPOINT ["bash", "init_command.sh"]

EXPOSE 51820

Expand Down
2 changes: 1 addition & 1 deletion images/openwisp_wireguard/update_wireguard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ watch_configuration_change() {
_REDIS_CMD="$_REDIS_CMD -p $REDIS_PORT"
fi
if [[ "$REDIS_PASS" ]]; then
_REDIS_CMD="$_REDIS_CMD -a $REDIS_PASS"
_REDIS_CMD="$_REDIS_CMD -a $REDIS_PASS --no-auth-warning"
fi
while true; do
if [ -f "$_TIMESTAMP_FILE" ]; then
Expand Down
4 changes: 4 additions & 0 deletions tests/runtests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re
import subprocess
import time
import unittest
Expand Down Expand Up @@ -449,6 +450,9 @@ def test_containers_down(self):
cwd=self.root_location,
)
output, error = map(str, cmd.communicate())
# Remove wireguard container from output because it exits when it fails
# to download configuration from the dashboard
output = re.sub('docker-openwisp_wireguard_1(.*)Exit(.*)\\n', '', output)
if 'Exit' in output:
self.fail(
f'One of the containers are down!\nOutput:\n{output}\nError:\n{error}'
Expand Down

0 comments on commit 43e389e

Please sign in to comment.