OpenSignLabs / OpenSign

🔥 The free & Open Source DocuSign alternative
https://www.opensignlabs.com
GNU Affero General Public License v3.0
3.08k stars 233 forks source link

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

Open dsaltares opened 2 weeks ago

dsaltares commented 2 weeks ago

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 https://github.com/OpenSignLabs/OpenSign/issues/973, but I am on 2.2.0 (have also tried main).

Expected Behavior

Judging from comments (https://github.com/OpenSignLabs/OpenSign/issues/1080#issue-2476655525). 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.

Code of Conduct

rick-hmc commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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

dsaltares commented 2 weeks ago

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

useahawk commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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

prafull-opensignlabs commented 1 week ago

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

davisk4rpi commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

macOS

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

davisk4rpi commented 1 week ago

@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 commented 1 week ago

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 commented 5 days ago

Same issue with my installation as well.