#Session Authentication Docker

49 messages · Page 1 of 1 (latest)

frail grove
#

So i'm creating an application that will start a Docker container with WhatsApp running, when i get successfully authenticated i zip the session folder and save it remotely.

Whenever the docker restarts i download the session, unzip it and start the initialization.

But for some reason it gives me an QR code instead of using the session files.

keen kindle
#

Show your code and docker configs

frail grove
#

@keen kindle

keen kindle
#

man, did you create a docker volume?

#

because you need a docker volume to persist a docker container data

keen kindle
frail grove
#

then i extract it

#

but for some reason the client is like nahh lemme send u qr code instead of using the files

keen kindle
#

so.. when you run a docker build command, its creates a new docker container. If you not pass a volume flag every time you restart your docker container, all of your data will be lost.

frail grove
#

but thats not the issue

#

let me explain it better.

i scan the QR code -> gets uploaded to the server

check if i have a session -> download session

init

keen kindle
#

when you run your code without docker, does it works fine?

frail grove
#

yeah

#

i think wait let me try again

#

have not run it without docker in a bit

keen kindle
#

hmm. ok i'll wait

frail grove
#

hm i got some weird error

#

ok let me try to fix the issues ill get back at you okay

#

well i'm currently on my job so ill prob fix it monday and see if i can get it working

#

in the meantime you got some tips/ideas?

#

--

#

ive authenticated on my windows host, then made new docker image so with the existing session

#

and it just authenticates on the docker

#

so mabybe something with unzipping or permissions is making it not do s

keen kindle
#

hmm

#

do you use a windows ?

#

if yes, maybe the problem is the zip location. In Linux/Ubuntu the file location is different from windows

#

when you create a docker image, you will be creating an image based on ubuntu

#

try to use a node path package instead of hardcoded paths

#

example:

#
const example = path.resolve(
  __dirname, // current dir location
  "..", // back folder
  "..", // back another folder
  "public", // enter in public folder
  "files" // enter in files folder (the auth folder)
);
frail grove
#

ok will try on monday

keen kindle
#

ok

frail grove
frail grove
#

So i noticed

#

When i scan the QR code and it uploads the zip to the server when i drag in the folder to the docker location/workfolder for the code

#

It also gives me a new QR code

#

So maybe there is something with permissions that is messing it up?

keen kindle
keen kindle
frail grove
#

yeah the path is correct

keen kindle
#

do you use the path.resolve instead of './'?

frail grove
#

yeah

#

and its a full path now

keen kindle
#

Hmm, the issue seems to be within your code now