ibuetler / alpine-switch-ch-domains

Alpine Docker Search CH Domains
0 stars 0 forks source link

Not working (?) #1

Open shoeper opened 3 years ago

shoeper commented 3 years ago

It seems like this image isn't working. Not matter what I type in the results just show DISCONNECT.

The first issue occurs when not specifying the env variables. The defaults seem not to work. After setting them it still doesn't work. Currently, don't have time to debug, but the output of the container hints at other issues as well. Below the output without env vars and with env vars.

Apart from that nice idea and thanks for sharing!

# docker run --rm -it -p3000:3000 hackinglab/alpine-switch-ch-domains:latest
docker run --rm -it -p3000:80 hackinglab/alpine-switch-ch-domains:3.2
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 01-resolver-resolv: applying... 
[fix-attrs.d] 01-resolver-resolv: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing... 
=================================
Password Routine
=================================
$HL_USER_PASSWORD not set in environment variable
will create a random HL user password
$HL_ROOT_PASSWORD not set in environment variable
will create a random root password
=================================

=================================
$HL_USER_USERNAME not set in environment variable
will use default username hacker
chpasswd: password for 'hacker' changed
chpasswd: password for 'root' changed

-------------------------------------
GID/UID
-------------------------------------
User uid:    2000
User gid:    2000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 15-fix-s6-permissions: executing... 
[cont-init.d] 15-fix-s6-permissions: exited 0.
[cont-init.d] 20-config: executing... 
================== make /config ==========
copy /defaults/nginx.conf to /config/nginx/nginx.conf
total 28
drwxr-xr-x    3 root     root          4096 Jan 25 11:31 .
drwxr-xr-x    6 root     root          4096 Jan 25 11:31 ..
-rw-r--r--    1 root     root           658 Jan 25 11:31 nginx.conf
drwxr-xr-x    2 root     root          4096 Jan 25 11:31 site-confs
copy /defaults/default to /config/nginx/site-confs/default
total 20
drwxr-xr-x    2 root     root          4096 Jan 25 11:31 .
drwxr-xr-x    3 root     root          4096 Jan 25 11:31 ..
-rw-r--r--    1 root     root          2700 Jan 25 11:31 default
Usage:
    htpasswd [-cimBdpsDv] [-C cost] passwordfile username
    htpasswd -b[cmBdpsDv] [-C cost] passwordfile username password

    htpasswd -n[imBdps] [-C cost] username
    htpasswd -nb[mBdps] [-C cost] username password
 -c  Create a new file.
 -n  Don't update file; display results on stdout.
 -b  Use the password from the command line rather than prompting for it.
 -i  Read password from stdin without verification (for script usage).
 -m  Force MD5 encryption of the password (default).
 -B  Force bcrypt encryption of the password (very secure).
 -C  Set the computing time used for the bcrypt algorithm
     (higher is more secure but slower, default: 5, valid: 4 to 17).
 -d  Force CRYPT encryption of the password (8 chars max, insecure).
 -s  Force SHA encryption of the password (insecure).
 -p  Do not encrypt the password (plaintext, insecure).
 -D  Delete the specified user.
 -v  Verify password for the specified user.
On other systems than Windows and NetWare the '-p' flag will probably not work.
The SHA algorithm does not use a salt and is less secure than the MD5 algorithm.
[cont-init.d] 20-config: exited 2.
[cont-init.d] 30-resolver: executing... 
BusyBox v1.32.1 () multi-call binary.

Usage: dirname FILENAME

Strip non-directory suffix from FILENAME
BusyBox v1.32.1 () multi-call binary.

Usage: mkdir [OPTIONS] DIRECTORY...

Create DIRECTORY

    -m MODE Mode
    -p  No error if exists; make parent directories as needed
[cont-init.d] 30-resolver: exited 0.
[cont-init.d] 99-add-flag: executing... 
ls: /goldnugget/*.gn: No such file or directory
No dynamic flag in environment variable $GOLDNUGGET.
[cont-init.d] 99-add-flag: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
starting log websocketd
testing nginx config
starting log websocketd
starting ip address websocketd
starting deploy websocketd
starting destroy websocketd
starting destroy websocketd
starting ip address websocketd
=================================

=================================
starting deploy websocketd
crond[522]: crond (busybox 1.32.1) started, log level 5
nginx: the configuration file /config/nginx/nginx.conf syntax is ok
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/destroy 
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8081/
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/deploy 
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8080/
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/deploy-task 
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8084/
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/log 
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8082/
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/log-task 
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8086/
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/ipaddresses 
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8083/
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/destroy-task 
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8085/
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/ipaddresses-task 
Mon, 25 Jan 2021 11:31:23 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8087/
nginx: configuration file /config/nginx/nginx.conf test is successful
starting nginx

> websocketd-express@0.0.0 start /opt/nodejs
> node -r esm ./bin/www

crond[522]: USER root pid 587 cmd run-parts /etc/periodic/1min
run-parts: /etc/periodic/1min: No such file or directory
crond[522]: USER root pid 588 cmd run-parts /etc/periodic/1min
run-parts: /etc/periodic/1min: No such file or directory
crond[522]: USER root pid 589 cmd run-parts /etc/periodic/1min
run-parts: /etc/periodic/1min: No such file or directory
docker run --rm -p3000:3000 -e HL_USER_PASSWORD=pass -e HL_ROOT_PASSWORD=pass -e HL_USER_USERNAME=user --dns=1.1.1.1 hackinglab/alpine-switch-ch-domains:latest
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 01-resolver-resolv: applying... 
[fix-attrs.d] 01-resolver-resolv: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing... 
=================================
Password Routine
=================================
$HL_USER_PASSWORD is set in environment variable
will use given password from environment variable
$HL_ROOT_PASSWORD is set in environment variable
will use given root password from environment variable
=================================
user
=================================
$HL_USER_USERNAME is set in environment variable
$HL_USER_USERNAME is set and not root
chpasswd: password for 'root' changed
chpasswd: password for 'user' changed

-------------------------------------
GID/UID
-------------------------------------
User uid:    2000
User gid:    2000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 15-fix-s6-permissions: executing... 
[cont-init.d] 15-fix-s6-permissions: exited 0.
[cont-init.d] 20-config: executing... 
================== make /config ==========
copy /defaults/nginx.conf to /config/nginx/nginx.conf
total 28
drwxr-xr-x    3 root     root          4096 Jan 25 11:39 .
drwxr-xr-x    6 root     root          4096 Jan 25 11:39 ..
-rw-r--r--    1 root     root           658 Jan 25 11:39 nginx.conf
drwxr-xr-x    2 root     root          4096 Jan 25 11:39 site-confs
copy /defaults/default to /config/nginx/site-confs/default
total 20
drwxr-xr-x    2 root     root          4096 Jan 25 11:39 .
drwxr-xr-x    3 root     root          4096 Jan 25 11:39 ..
-rw-r--r--    1 root     root          2700 Jan 25 11:39 default
Adding password for user user
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-resolver: executing... 
BusyBox v1.32.1 () multi-call binary.

Usage: dirname FILENAME

Strip non-directory suffix from FILENAME
BusyBox v1.32.1 () multi-call binary.

Usage: mkdir [OPTIONS] DIRECTORY...

Create DIRECTORY

    -m MODE Mode
    -p  No error if exists; make parent directories as needed
[cont-init.d] 30-resolver: exited 0.
[cont-init.d] 99-add-flag: executing... 
ls: /goldnugget/*.gn: No such file or directory
No dynamic flag in environment variable $GOLDNUGGET.
[cont-init.d] 99-add-flag: exited 0.
[cont-init.d] done.
[services.d] starting services
starting log websocketd
[services.d] done.
=================================
user
=================================
starting log websocketd
starting ip address websocketd
starting ip address websocketd
starting destroy websocketd
starting deploy websocketd
starting deploy websocketd
testing nginx config
starting destroy websocketd
nginx: the configuration file /config/nginx/nginx.conf syntax is ok
nginx: configuration file /config/nginx/nginx.conf test is successful
starting nginx
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/log-task 
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/log 
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8082/
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/destroy-task 
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8085/
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/deploy 
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8080/
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/deploy-task 
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8084/
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/ipaddresses 
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8083/
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/destroy 
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8086/
Mon, 25 Jan 2021 11:39:19 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8081/
Mon, 25 Jan 2021 11:39:20 +0000 | INFO   | server     |  | Serving using application   : /opt/scripts/ipaddresses-task 
Mon, 25 Jan 2021 11:39:20 +0000 | INFO   | server     |  | Starting WebSocket server   : ws://127.0.0.1:8087/

> websocketd-express@0.0.0 start /opt/nodejs
> node -r esm ./bin/www
ibuetler commented 3 years ago

I have created and pushed the image again. In my test, it works like charm. But the websocketd needs 30 seconds to start.

please do not use the docker run command, instead use the docker-compose up

Furthermore, you can run the build.sh script and build the image locally

Let me know if it works, otherwise I can share a video

Ivan

ibuetler commented 3 years ago

Please note, the service is listening on port 80 and not 3000