wy580477 / Leech-AIO-APP-EX

All Downloaders with Rclone auto-upload & Telegram notification on Docker | Docker 全能下载 APP + Rclone 自动上传 + 电报任务完成通知
187 stars 186 forks source link

sorry me again. ttyd is not available when runing it on vps( how can i enable it?) #90

Closed BeastAnimation361 closed 1 year ago

BeastAnimation361 commented 1 year ago

sorry me again. ttyd is not available when runing it on vps how can i enable it?

wy580477 commented 1 year ago

I didn't include ttyd in docker deployment.

Logging into terminal via ssh is more secure than ttyd.

BeastAnimation361 commented 1 year ago

fwk i need that.... any way to add it?

BeastAnimation361 commented 1 year ago

bro if any way please do tell. i really wanted ttyd thats why i deplyed the leech bot.

wy580477 commented 1 year ago

fwk i need that.... any way to add it?

You can install ttyd on your vps directly.

https://github.com/tsl0922/ttyd#install-on-linux

BeastAnimation361 commented 1 year ago

do i have to buy a domain and then connect it to it. just for ttyd?

BeastAnimation361 commented 1 year ago

is there any way i can edit the repo code and add ttyd in it?

wy580477 commented 1 year ago

do i have to buy a domain and then connect it to it. just for ttyd?

Not necessary. But i suggest you get a domain and enable https for ttyd.

Guarding terminal access is very important for security.

wy580477 commented 1 year ago

is there any way i can edit the repo code and add ttyd in it?

You can. Not an easy task though.

Is there any reason that you can't access termial via normal SSH client? Using SSH client would be more secure than ttyd.

BeastAnimation361 commented 1 year ago

bro i don't give a f for security...and ssh is pain in ass when i am out like using from termix

BeastAnimation361 commented 1 year ago

Hi soo i kinda half way added the ttyd but it's not showing in dashboard and i think it has to do something with this run file from ttyd folder


#!/bin/sh

exec 2>&1

if [ ! -f "/mnt/data/config/bashrc" ]; then
    cp /workdir/bashrc /mnt/data/config/
fi

TELEGRAM_TITLE="$(grep ^telegram-notification-title "/mnt/data/config/script.conf" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")"

exec ttyd -i 127.0.0.1 -p 61808 -P 3 -t fontSize=17 -t titleFixed=${TELEGRAM_TITLE}_ttyd -t 'theme={"background": "black"}' bash --rcfile /mnt/data/config/bashrc

this line exec ttyd -i 127.0.0.1 -p 61808 -P 3 -t fontSize=17 -t titleFixed=${TELEGRAM_TITLE}_ttyd -t 'theme={"background": "black"}' bash --rcfile /mnt/data/config/bashrc

i changed it to exec ttyd -i "s|listenAddressSingleHTTPFrontend:.*|listenAddressSingleHTTPFrontend: 127.0.0.1:${TTYD_PORT}|g"-P 3 -t fontSize=17 -t titleFixed=${TELEGRAM_TITLE}_ttyd -t 'theme={"background": "black"}' bash --rcfile /mnt/data/config/bashrc but still now working any ideas? thankss

wy580477 commented 1 year ago

Hi soo i kinda half way added the ttyd but it's not showing in dashboard and i think it has to do something with this run file from ttyd folder


#!/bin/sh

exec 2>&1

if [ ! -f "/mnt/data/config/bashrc" ]; then
    cp /workdir/bashrc /mnt/data/config/
fi

TELEGRAM_TITLE="$(grep ^telegram-notification-title "/mnt/data/config/script.conf" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")"

exec ttyd -i 127.0.0.1 -p 61808 -P 3 -t fontSize=17 -t titleFixed=${TELEGRAM_TITLE}_ttyd -t 'theme={"background": "black"}' bash --rcfile /mnt/data/config/bashrc

this line exec ttyd -i 127.0.0.1 -p 61808 -P 3 -t fontSize=17 -t titleFixed=${TELEGRAM_TITLE}_ttyd -t 'theme={"background": "black"}' bash --rcfile /mnt/data/config/bashrc

i changed it to exec ttyd -i "s|listenAddressSingleHTTPFrontend:.*|listenAddressSingleHTTPFrontend: 127.0.0.1:${TTYD_PORT}|g"-P 3 -t fontSize=17 -t titleFixed=${TELEGRAM_TITLE}_ttyd -t 'theme={"background": "black"}' bash --rcfile /mnt/data/config/bashrc but still now working any ideas? thankss

I said it wouldn't be easy. You need to add ttyd reverse proxy in Caddyfile, and add ttyd entry in homer config file.

BeastAnimation361 commented 1 year ago

added homer config already image and also in caddy file image

wy580477 commented 1 year ago

added homer config already

press shift + f5 to force refresh.

Have you installed ttyd yet? You need to run "apk add ttyd".

BeastAnimation361 commented 1 year ago

still now showing up btw these are the files i edited image and these is what i added in each one image

image image image

BeastAnimation361 commented 1 year ago

added homer config already

press shift + f5 to force refresh.

Have you installed ttyd yet? You need to run "apk add ttyd".

i did add all these edits and stop docker and then used docker-compose up -d --force-recreate and still it's not showing even tried /ttyd at then end not loading

wy580477 commented 1 year ago

still now showing up btw these are the files i edited

You need to generate your own container image.

Run "docker build . -t allinone" at this folder, then you can use your own container image "allinone".

BeastAnimation361 commented 1 year ago

still now showing up btw these are the files i edited

You need to generate your own container image.

Run "docker build . -t allinone" at this folder, then you can use your own container image "allinone".

ok bro roger that.

BeastAnimation361 commented 1 year ago

sorry new to docker stuff

BeastAnimation361 commented 1 year ago

btw should i add this exec ttyd -i "s|listenAddressSingleHTTPFrontend:.*|listenAddressSingleHTTPFrontend: 127.0.0.1:${TTYD_PORT}|g"-P 3 -t fontSize=17 -t titleFixed=${TELEGRAM_TITLE}_ttyd -t 'theme={"background": "black"}' bash --rcfile /mnt/data/config/bashrc or just keep it to this line exec ttyd -i 127.0.0.1 -p 61808 -P 3 -t fontSize=17 -t titleFixed=${TELEGRAM_TITLE}_ttyd -t 'theme={"background": "black"}' bash --rcfile /mnt/data/config/bashrc

wy580477 commented 1 year ago

btw should i add this

exec ttyd -i 127.0.0.1 -p ${TTYD_PORT} -P 3 -t fontSize=17 -t titleFixed=${TELEGRAM_TITLE}_ttyd -t 'theme={"background": "black"}' bash --rcfile /mnt/data/config/bashrc

BeastAnimation361 commented 1 year ago

image still now working

wy580477 commented 1 year ago

image still now working

.... Did you change container_image in docker-compose.yaml file? Instead of asking me every steps,you should go to read docker docs first.

BeastAnimation361 commented 1 year ago

image there is no container_image so i used docker build . -t beastleechbot and then changed image and still not working and used docker-compose up -d beastleechbot

image

wy580477 commented 1 year ago

there is no container_image

....... change image: ......................................................

I'm kinda of speechless now. I beg you to read some docker docs, please !

BeastAnimation361 commented 1 year ago

container_image

yoooo come on now thats on you...container_image i though was a variable

BeastAnimation361 commented 1 year ago

yoooo ok soo now it's showing up image but image

BeastAnimation361 commented 1 year ago

bro i did missed something again? please reply.

wy580477 commented 1 year ago

bro i did missed something again? please reply.

go to log folder, look at ttyd log.

BeastAnimation361 commented 1 year ago
cp: can't stat '/workdir/bashrc': No such file or directory
[2023/04/29 20:11:12:0084] N: ttyd 1.7.2 (libwebsockets 4.3.2)
[2023/04/29 20:11:12:0085] N: tty configuration:
[2023/04/29 20:11:12:0085] N:   start command: bash --rcfile /mnt/data/config/bashrc
[2023/04/29 20:11:12:0085] N:   close signal: SIGHUP (1)
[2023/04/29 20:11:12:0085] N:   terminal type: xterm-256color
[2023/04/29 20:11:12:0097] N:    /usr/lib/libwebsockets-evlib_uv.so
[2023/04/29 20:11:12:0098] N: lws_create_context: LWS: 4.3.2, NET CLI SRV H1 H2 WS ConMon IPV6-off
[2023/04/29 20:11:12:0274] N: elops_init_pt_uv:  Using foreign event loop...
[2023/04/29 20:11:12:0275] N: __lws_lc_tag:  ++ [wsi|0|pipe] (1)
[2023/04/29 20:11:12:0276] N: __lws_lc_tag:  ++ [vh|0|netlink] (1)
[2023/04/29 20:11:12:0277] N: __lws_lc_tag:  ++ [vh|1|default|127.0.0.1|127.0.0.1|61808] (2)
[2023/04/29 20:11:12:0280] N: [vh|1|default|127.0.0.1|127.0.0.1|61808]: lws_socket_bind: source ads 127.0.0.1
[2023/04/29 20:11:12:0281] N: __lws_lc_tag:  ++ [wsi|1|listen|default|127.0.0.1|61808] (2)
[2023/04/29 20:11:12:0281] N:  Listening on port: 61808
wy580477 commented 1 year ago

cp: can't stat '/workdir/bashrc': No such file or directory

Add bashrc file to content folder or delete --rcfile /mnt/data/config/bashrc from exec ttyd command.

Then rebuild container image and recreate container.

BeastAnimation361 commented 1 year ago

--rcfile /mnt/data/config/bashrc

roger that

BeastAnimation361 commented 1 year ago

Then rebuild container image and recreate container.

same error but in diff log file cp: can't stat '/workdir/bashrc': No such file or directory [2023/04/29 20:11:12:0084] N: ttyd 1.7.2 (libwebsockets 4.3.2) [2023/04/29 20:11:12:0085] N: tty configuration: [2023/04/29 20:11:12:0085] N: start command: bash --rcfile /mnt/data/config/bashrc [2023/04/29 20:11:12:0085] N: close signal: SIGHUP (1) [2023/04/29 20:11:12:0085] N: terminal type: xterm-256color [2023/04/29 20:11:12:0097] N: /usr/lib/libwebsockets-evlib_uv.so [2023/04/29 20:11:12:0098] N: lws_create_context: LWS: 4.3.2, NET CLI SRV H1 H2 WS ConMon IPV6-off [2023/04/29 20:11:12:0274] N: elops_init_pt_uv: Using foreign event loop... [2023/04/29 20:11:12:0275] N: __lws_lc_tag: ++ [wsi|0|pipe] (1) [2023/04/29 20:11:12:0276] N: __lws_lc_tag: ++ [vh|0|netlink] (1) [2023/04/29 20:11:12:0277] N: __lws_lc_tag: ++ [vh|1|default|127.0.0.1|127.0.0.1|61808] (2) [2023/04/29 20:11:12:0280] N: [vh|1|default|127.0.0.1|127.0.0.1|61808]: lws_socket_bind: source ads 127.0.0.1 [2023/04/29 20:11:12:0281] N: __lws_lc_tag: ++ [wsi|1|listen|default|127.0.0.1|61808] (2) [2023/04/29 20:11:12:0281] N: Listening on port: 61808

wy580477 commented 1 year ago

Then rebuild container image and recreate container.

You need to rebuild image and recreate container.

Must use --force-recreate flag for "docker-compose up -d" command

BeastAnimation361 commented 1 year ago

Must use --force-recreate flag for "docker-compose up -d" command

same error i used docker build . -t beastleechbot docker-compose up -d --force-recreate flag

wy580477 commented 1 year ago

docker-compose up -d --force-recreate, not docker-compose up -d --force-recreate flag

If it still doesn't work, then I'm out of idea.

BeastAnimation361 commented 1 year ago

oh lol yea i did that without flag.

BeastAnimation361 commented 1 year ago

so used this cammand docker build --no-cache -t beastleechbot. and now go this

[2023/04/29 21:05:17:2989] N: ttyd 1.7.2 (libwebsockets 4.3.2)
[2023/04/29 21:05:17:2990] N: tty configuration:
[2023/04/29 21:05:17:2990] N:   start command: bash
[2023/04/29 21:05:17:2990] N:   close signal: SIGHUP (1)
[2023/04/29 21:05:17:2990] N:   terminal type: xterm-256color
[2023/04/29 21:05:17:3003] N:    /usr/lib/libwebsockets-evlib_uv.so
[2023/04/29 21:05:17:3004] N: lws_create_context: LWS: 4.3.2, NET CLI SRV H1 H2 WS ConMon IPV6-off
[2023/04/29 21:05:17:3165] N: elops_init_pt_uv:  Using foreign event loop...
[2023/04/29 21:05:17:3166] N: __lws_lc_tag:  ++ [wsi|0|pipe] (1)
[2023/04/29 21:05:17:3167] N: __lws_lc_tag:  ++ [vh|0|netlink] (1)
[2023/04/29 21:05:17:3168] N: __lws_lc_tag:  ++ [vh|1|default|127.0.0.1|127.0.0.1|61808] (2)
[2023/04/29 21:05:17:3171] N: [vh|1|default|127.0.0.1|127.0.0.1|61808]: lws_socket_bind: source ads 127.0.0.1
[2023/04/29 21:05:17:3172] N: __lws_lc_tag:  ++ [wsi|1|listen|default|127.0.0.1|61808] (2)
[2023/04/29 21:05:17:3172] N:  Listening on port: 61808
BeastAnimation361 commented 1 year ago

bro?

BeastAnimation361 commented 1 year ago
[2023/04/29 21:05:17:2989] N: ttyd 1.7.2 (libwebsockets 4.3.2)
[2023/04/29 21:05:17:2990] N: tty configuration:
[2023/04/29 21:05:17:2990] N:   start command: bash
[2023/04/29 21:05:17:2990] N:   close signal: SIGHUP (1)
[2023/04/29 21:05:17:2990] N:   terminal type: xterm-256color
[2023/04/29 21:05:17:3003] N:    /usr/lib/libwebsockets-evlib_uv.so
[2023/04/29 21:05:17:3004] N: lws_create_context: LWS: 4.3.2, NET CLI SRV H1 H2 WS ConMon IPV6-off
[2023/04/29 21:05:17:3165] N: elops_init_pt_uv:  Using foreign event loop...
[2023/04/29 21:05:17:3166] N: __lws_lc_tag:  ++ [wsi|0|pipe] (1)
[2023/04/29 21:05:17:3167] N: __lws_lc_tag:  ++ [vh|0|netlink] (1)
[2023/04/29 21:05:17:3168] N: __lws_lc_tag:  ++ [vh|1|default|127.0.0.1|127.0.0.1|61808] (2)
[2023/04/29 21:05:17:3171] N: [vh|1|default|127.0.0.1|127.0.0.1|61808]: lws_socket_bind: source ads 127.0.0.1
[2023/04/29 21:05:17:3172] N: __lws_lc_tag:  ++ [wsi|1|listen|default|127.0.0.1|61808] (2)
[2023/04/29 21:05:17:3172] N:  Listening on port: 61808

this is new error now.

wy580477 commented 1 year ago

This is no error.

Delete Caddyfile under config/caddy folder. Then run "docker exec your_container_name sv restart caddy"

BeastAnimation361 commented 1 year ago

This is no error.

Delete Caddyfile under config/caddy folder. Then run "docker exec your_container_name sv restart caddy"

working noww......yesss

BeastAnimation361 commented 1 year ago

okkkk so now if i have to deply this edited redp i need toooo upload to vps and then just docker-compose -f docker-compose_en.yml up -d ?

wy580477 commented 1 year ago

okkkk so now if i have to deply this edited redp i need toooo upload to vps and then just docker-compose -f docker-compose_en.yml up -d ?

You need to build your own container and change image in docker-compose file.

BeastAnimation361 commented 1 year ago

you mean use this cammand docker build . -t beastleechbot docker-compose up -d --force-recreate ofc with edits files uploaded

wy580477 commented 1 year ago

you mean use this cammand docker build . -t beastleechbot docker-compose up -d --force-recreate ofc with edits files uploaded

Please stop asking me about basic docker commands. You can learn by reading docker docs. I'm done with this thread.

BeastAnimation361 commented 1 year ago

ok g love u bro (no homo)