Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unable to create first user on brand new local Docker installation #1158

Open
3 tasks done
dsaltares opened this issue Sep 4, 2024 · 22 comments
Open
3 tasks done
Assignees
Labels
bug Something isn't working up-for-grabs

Comments

@dsaltares
Copy link

dsaltares commented Sep 4, 2024

Issue Description

I am not presented with a first-time setup to create an admin user when I first open the app on a local Docker installation. This is similar to #973, but I am on 2.2.0 (have also tried main).

Expected Behavior

Judging from comments (#1080 (comment)). I am meant to see a user registration screen the first time I use the app.

Current Behavior

I am presented with a login screen that reads Welcome back!, but there are not registered users.

Steps to reproduce

Follow the instructions to self-host from https://docs.opensignlabs.com/docs/self-host/docker/run-locally

export HOST_URL=https://opensign.yourdomain.com && curl --remote-name-all https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/docker-compose.yml https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/Caddyfile https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/.env.local_dev && mv .env.local_dev .env.prod && docker compose up --force-recreate`

I also tried tagging a specific version (2.2.0):

export HOST_URL=https://opensign.saltares.dev && curl --remote-name-all https://raw.githubusercontent.com/OpenSignLabs/OpenSign/v2.2.0/docker-compose.yml https://raw.githubusercontent.com/OpenSignLabs/OpenSign/v2.2.0/Caddyfile https://raw.githubusercontent.com/OpenSignLabs/OpenSign/v2.2.0/.env.local_dev && mv .env.local_dev .env.prod && docker compose up --force-recreate

Screenshots of the issue(optional)

image

Operating System [e.g. MacOS Sonoma 14.1, Windows 11]

MacOS Ventura 13.6.7

What browsers are you seeing the problem on?

Chrome

What version of OpenSign™ are you seeing this issue on? [e.g. 1.0.6]

2.2.0
I used the Docker main and docker_beta versions.

What environment are you seeing the problem on?

Hosted (app.yourdomain.com)

Please check the boxes that apply to this issue report.

  • I have searched the existing issues & discussions to make sure that this is not a duplicate.

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I have searched the existing issues & discussions to make sure that this is not a duplicate.
@rick-hmc
Copy link

rick-hmc commented Sep 4, 2024

Same for me - I have been through every document on the website and it seems like the initialisation is something that is normal process but not happening in the latest build.

@dsaltares
Copy link
Author

I initially thought a user would be automatically created and it wasn't documented, so I opened Mongo Compass and inspected the db. However, the _Users collection had no documents at all.

@useahawk
Copy link

useahawk commented Sep 5, 2024

I have the same Problem and it seems to be a duplicate of #1115 .
Couldn't find anything in the docs ether.

@dsaltares
Copy link
Author

@useahawk that's right, my bad for not finding that one although it doesn't say how it was fixed.

@useahawk
Copy link

useahawk commented Sep 5, 2024

I got it solved for my env.
Testing localhost:3000 showed welcome page
Testing localhost:3001 showed not available
Testing localhost:443 showed register page

Looing at the Caddyfile it makes sense, so i tweaked my ports in live env as needed (cant use any of the 3000, 3001, 8080, 80 or 443 ports) and fixed my own reverse proxy with the rules from the Caddyfile.

Finally it's working!

@dsaltares
Copy link
Author

With a fresh installation of opensign this is what I get.

localhost:3000
image

localhost:3001
image

https://localhost:443
image

What modifications did you make exactly?

@useahawk
Copy link

useahawk commented Sep 6, 2024

just try https://localhost

In live I changed all docker ports as needed and used apache reverse proxy

# Reverse Proxy for the client-side (front-end)
    ProxyPass "/" "http://client:3000/"
    ProxyPassReverse "/" "http://client:3000/"

    # Handle specific path /app/*
    <Location /app/>
        # URL Rewrite to ensure /app is passed correctly to the backend
        RewriteEngine On
        RewriteRule ^/app/(.*)$ /app/$1 [PT]

        # Reverse Proxy for the server-side (back-end)
        ProxyPass "http://server:8080/app/"
        ProxyPassReverse "http://server:8080/app/"
    </Location>

    # Required for reverse proxy functionality
    ProxyPreserveHost On

Had also problems with minio s3 storage and smtp mail, so for now i'm switching to another solution.

@dsaltares
Copy link
Author

@useahawk https://localhost shows me the protocol error message.

@prafull-opensignlabs
Copy link
Collaborator

prafull-opensignlabs commented Sep 11, 2024

hey @dsaltares , please checkout this updated documentation and let us know if you still encounter any issues.

@davisk4rpi
Copy link

hey @dsaltares , please checkout this updated documentation and let us know if you still encounter any issues.

I just came across this issue setting up a fresh project. I followed the linked docs, but https://localhost:3001 still showed the "welcome back" page instead of allowing me to register.

Turns out, theres an easy mistake in the .env files for MOGODB_URI

https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/.env.local_dev
https://raw.githubusercontent.com/OpenSignLabs/OpenSign/docker_beta/.env.local_dev

The value provided by the copied envs is mongodb://mongo-container:27017/OpenSignDB, but it should be mongodb://mongo:27017/OpenSignDB

Docker uses the service name for the in-network host, not the container name.

@andrew-opensignlabs
Copy link
Collaborator

hey @dsaltares , please checkout this updated documentation and let us know if you still encounter any issues.

I just came across this issue setting up a fresh project. I followed the linked docs, but https://localhost:3001 still showed the "welcome back" page instead of allowing me to register.

Turns out, theres an easy mistake in the .env files for MOGODB_URI


https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/.env.local_dev

https://raw.githubusercontent.com/OpenSignLabs/OpenSign/docker_beta/.env.local_dev

The value provided by the copied envs is mongodb://mongo-container:27017/OpenSignDB, but it should be mongodb://mongo:27017/OpenSignDB

Docker uses the service name for the in-network host, not the container name.

What OS are you using? For most of us container name works instead of service name.

@davisk4rpi
Copy link

macOS

As far as I am aware service name works on all systems on the latest docker

@davisk4rpi
Copy link

@andrew-opensignlabs
If using the service name is problematic, maybe network alias's would work to straighten this out?

https://docs.docker.com/reference/compose-file/services/#aliases

@reddexx
Copy link

reddexx commented Sep 13, 2024

The problem also concerns me, I wanted to try opensign, but unfortunately I can't because I get directly to the login form

My Compose:

services:
  server:
    image: opensign/opensignserver:main  # Überprüfe die Nutzung stabiler Tags
    container_name: OpenSignServer-container
    ports:
      - "8991:8080"
    depends_on:
      - mongo
    env_file: .env.prod  # Stelle sicher, dass diese Datei existiert
    environment:
      - NODE_ENV=production
      - SERVER_URL=${HOST_URL-https://localhost:3001/app}  # Standard war hier direkt
    networks:
      - opensign-network

  mongo:
    image: mongo:latest
    container_name: mongo-container
    volumes:
      - /Container/opensign/db:/data/db
    ports:
      - "27018:27017"
    networks:
      - opensign-network

  client:
    image: opensign/opensign:main  # Überprüfe auch hier die Nutzung stabiler Tags
    container_name: OpenSign-container
    depends_on:
      - server
    env_file: .env.prod  # Überprüfe auch diese Datei
    ports:
      - "3000:3001"
    networks:
      - opensign-network


networks:
  opensign-network:
    driver: bridge

@santosh2494
Copy link

Same issue with my installation as well.

@D3Dgroupe
Copy link

Hello, I have the same problem, do you know which container it could come from ? This is a new installation.

@parasiteoflife
Copy link

@andrew-opensignlabs please allow setup on the PUBLIC_URL, with headless servers we can't access localhost, much less localhost:3001 which opensign needs

@parasiteoflife
Copy link

parasiteoflife commented Sep 24, 2024

I just noticed the issue is that (at least in my case) I get:

POST
https://localhost:3001/app/functions/getlogobydomain
[HTTP/2 403  5ms]

err in getlogo  Error: unauthorized

In the console, because of this OpenSign returns that there is an admin already (trying accessing /addadmin)

} catch (err) {
console.log("err in getlogo ", err);
return { logo: appInfo.applogo, user: "exist" };

The 403 is not coming from mongo since I've tested stopping the mongo container and upon reloading I get the same 403 error.

I think it needs to use the master key?

Yes, it needs the master key, using curl I get:

curl -k -X POST https://localhost:3001/app/functions/getlogobydomain -H "X-Parse-Application-Id: opensign" -H "X-Parse-Master-Key: JtkN64wecdjS"
{"result":{"logo":"","user":"not_exist"}}

@bobvandevijver
Copy link

For me this was caused by not using opensign as the APP_ID.

@parasiteoflife
Copy link

For me this was caused by not using opensign as the APP_ID.

thank you, that was it! But why?

@bobvandevijver
Copy link

thank you, that was it! But why?

See #1256, that would be my guess

@D3Dgroupe
Copy link

D3Dgroupe commented Oct 2, 2024

Hello, after a lot of modification of the docker-compose file and the environment file I managed to deploy the server on Portainer and it is accessible from the internet.
I think my problem came from the fact that I had forgotten in the docker-compose the lines "volumes":

  server:
    image: opensign/opensignserver:main
    container_name: OpenSignServer-container
    volumes:
      - opensign-files:/usr/src/app/files

and its declaration in the volumes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working up-for-grabs
Projects
None yet
Development

No branches or pull requests