pratikdaigavane / blog.pratikdaigavane.me-comments

0 stars 0 forks source link

how-to-self-host-commento-using-nginx-and-docker/ #2

Open utterances-bot opened 4 years ago

utterances-bot commented 4 years ago

Pratik Daigavane | Blog - Pratik Daigavane | Blog

Full Stack Developer 🚀 | Cloud and DevOps Enthusiast 🌩ī¸ | Budding Competitive Programmer 👨‍đŸ’ģ

https://blog.pratikdaigavane.me/

AVC0706 commented 4 years ago

Noice ....Bro

Pathsis commented 2 years ago

Hi, when I run docker-compose up,

I have a result as follows:

root@ubuntu-commento:~# docker-compose up
Starting root_db_1 ... done
Starting root_server_1 ... done
Attaching to root_db_1, root_server_1
db_1      | 
db_1      | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1      | 
db_1      | 2021-11-16 18:07:54.320 UTC [1] LOG:  starting PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
db_1      | 2021-11-16 18:07:54.323 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1      | 2021-11-16 18:07:54.323 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1      | 2021-11-16 18:07:54.324 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1      | 2021-11-16 18:07:54.329 UTC [25] LOG:  database system was shut down at 2021-11-16 18:06:47 UTC
db_1      | 2021-11-16 18:07:54.333 UTC [1] LOG:  database system is ready to accept connections
server_1  | 2021/11/16 18:07:55 [INFO] version.go:13 versionPrint(): starting Commento 
server_1  | 2021/11/16 18:07:55 [INFO] database_connect.go:20 dbConnect(): opening connection to postgres: postgres://postgres:redacted@db:5432/commento?sslmode=disable
server_1  | 2021/11/16 18:07:55 [ERROR] database_connect.go:31 dbConnect(): cannot talk to postgres, retrying in 10 seconds (4 attempts left): pq: unknown authentication response: 10
server_1  | 2021/11/16 18:08:05 [INFO] database_connect.go:20 dbConnect(): opening connection to postgres: postgres://postgres:redacted@db:5432/commento?sslmode=disable
server_1  | 2021/11/16 18:08:05 [ERROR] database_connect.go:31 dbConnect(): cannot talk to postgres, retrying in 10 seconds (3 attempts left): pq: unknown authentication response: 10
^CGracefully stopping... (press Ctrl+C again to force)
Stopping root_server_1 ... done
Stopping root_db_1     ... done
pratikdaigavane commented 2 years ago

@mkyos Please try this docker compose file

version: '3'

services:
  server:
    image: registry.gitlab.com/commento/commento
    ports:
      - 8080:8080
    environment:
      COMMENTO_ORIGIN: https://commento.example.me
      COMMENTO_PORT: 8080
      COMMENTO_POSTGRES: postgres://postgres:postgres@db:5432/commento?sslmode=disable      

    depends_on:
      - db
  db:
    image: postgres:12
    environment:
      POSTGRES_DB: commento
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    volumes:
      - commento_data_volume:/var/lib/postgresql/data

volumes:
  commento_data_volume:
Pathsis commented 2 years ago

Success! Thank you very much! But now I have a question. It seems that anyone can equally sign up for Commento on this server. How can I prevent others from signing up without permission?

Pathsis commented 2 years ago

I went through documentation, and I couldn't solve this problem.

  1. I use Docker Compose to run Commento. But when I run docker-compose up I get an error saying that "true" is not a allowed value when I make a configure COMMENTO_FORBID_NEW_OWNERS: true in cker-comemess. yml.

  2. I also tried to create the commento.env file and introduced it by COMMENTO_CONFIG_FILE: ./commento.env in the docker-comemess. yml, but running docker-compose up, I get a warning: fatal error, cannot open commento.env, there is no file or directory.

Thanks a million!