zeratax / matrix-registration

a token based matrix registration api
https://zeratax.github.io/matrix-registration/
MIT License
227 stars 41 forks source link

Can't access registration page on port 5000 #94

Closed kavemang closed 1 year ago

kavemang commented 2 years ago

How did you install matrix-registration?

docker

What python version are you running?

No response

What version of matrix-registration are you running?

latest

Your config.yml

server_location: 'http://localhost:8008'
server_name: 'matrix.kaveman.tech'
registration_shared_secret: 'redacted' # see your synapse's homeserver.yaml
admin_api_shared_secret: 'redacted' # to generate tokens via the web api
base_url: '/register' # e.g. '/element' for https://example.tld/element/register
#client_redirect: 'https://app.element.io/#/login'
client_logo: 'static/images/element-logo.png' # use '{cwd}' for current working directory
db: 'sqlite:///{cwd}db.sqlite3'
host: 'localhost'
port: 5000

rate_limit: ["10 per day", "10 per minute"]

allow_cors: false
ip_logging: false

Your error log

Try 'matrix-registration -h' for help.

Error: Missing command.
Usage: matrix-registration [OPTIONS] COMMAND
                           [ARGS]...
Try 'matrix-registration -h' for help.

Error: Missing command.
Usage: matrix-registration [OPTIONS] COMMAND
                           [ARGS]...
Try 'matrix-registration -h' for help.

Error: Missing command.
Usage: matrix-registration [OPTIONS] COMMAND
                           [ARGS]...
Try 'matrix-registration -h' for help.

Error: Missing command.
Usage: matrix-registration [OPTIONS] COMMAND
                           [ARGS]...
Try 'matrix-registration -h' for help.

Error: Missing command.

Area of your issue?

installation

What happened

unable to shell into the container to do the setup instructions described

Steps to reproduce

setup config.yaml in data directory, spin up image with targeted data volume

xelantro commented 2 years ago

What Image are you using? Did you selfbuild with the sourcecode? Did you download this one: docker pull zeratax/matrix-registration or a different one? Where did you edit/put you config file?

kavemang commented 2 years ago

sorry, I did use the image you listed above yes and the config file is in a volume mapped to /data on the container

ps: within /data its just config.yaml and is not in a subfolder

kavemang commented 2 years ago

@xelantro after running the container with the correct command I'm now getting the "serving on localhost:5000" message in the log but I can't access a page at that port, just get ERR_CONNECTION_REFUSED

illspirit commented 2 years ago

I'm getting this error too - also having issues with nginx config nginx: [emerg] "proxy_set_header" directive is not allowed here in /etc/nginx/sites-enabled/matrix.conf:27

xelantro commented 2 years ago

Hi @illspirit You error is probably not related to this issue (this here is probably jst wrong docker configuration). Your issue is related to nginx and apparently putting proxy_set_header inside of an if clause like it sais in our wiki is not allowed, please open a seperate issue where you post your hole nginx config and so on

alexdatur commented 2 years ago

same shit. cant execute to console of container. in logs - 2022-09-01 08:13:02,279 - waitress - INFO - Serving on http://0.0.0.0:5000

But in web interface - Not Found The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

Takalele commented 1 year ago

@kavemang @ALEXSANPEDRO

you need to run the serve command at startup, i also recommend to use a other user then root. if you use traefik you shoud put a redirect middleware in place yaml:

    matrix-register-redirectregex:
      redirectRegex:
        regex: "^https:\\/\\/([^\\/]+)\\/?$$"
        replacement: "https://${1}/register"

or as label in the docker compose:

 labels:
  - "traefik.enable=true"
  - "traefik.http.routers.matrix_registration.entrypoints=https"
  - "traefik.http.routers.matrix_registration.rule=Host(`register.yourdomain.tld`)"
  - "traefik.http.services.matrix_registration.loadbalancer.server.port=5000"
  - "traefik.http.routers.matrix_registration.tls=true"
  - "traefik.http.middlewares.matrix-register-redirectregex.redirectregex.regex=^https:\\/\\/([^\\/]+)\\/?$$"
  - "traefik.http.middlewares.matrix-register-redirectregex.redirectregex.replacement=https://${1}/register"
  - "traefik.http.routers.matrix_registration.middlewares=matrix-register-redirectregex"
  - "traefik.docker.network=proxy"  

docker-compose:

    matrix_registration:
    image: zeratax/matrix-registration:v1.0.0.dev7
    container_name: matrix_registration
    user: "1000"
    volumes:
      - /dps/matrix/matrix_registration/:/data/:rw
    ports:
      - 5000:5000
    networks:
      matrix:
    depends_on:
      - matrix_synapse
    command:
      - serve
     labels:
      - "traefik.enable=true"
      - "traefik.http.routers.matrix_registration.entrypoints=https"
      - "traefik.http.routers.matrix_registration.rule=Host(`register.yourdomain.tld`)"
      - "traefik.http.services.matrix_registration.loadbalancer.server.port=5000"
      - "traefik.http.routers.matrix_registration.tls=true"
      - "traefik.http.middlewares.matrix-register-redirectregex.redirectregex.regex=^https:\\/\\/([^\\/]+)\\/?$$"
      - "traefik.http.middlewares.matrix-register-redirectregex.redirectregex.replacement=https://${1}/register"
      - "traefik.http.routers.matrix_registration.middlewares=matrix-register-redirectregex"
      - "traefik.docker.network=proxy"  
    restart: unless-stopped

BR Takalele

xelantro commented 1 year ago

Closing due to lack of activity, if your issue is still relevant and Takalele's solution did not help you, feel free to reopen