planka icon indicating copy to clipboard operation
planka copied to clipboard

Planka SSL & API

Open nematollahian opened this issue 5 years ago • 6 comments

Hello dears I installed planka in my server but i cannot make it https and working just with http. I do not want to use nginx config to include my certificate and want to use docker compose instead. Would you please help me do this? And second question is that i want to talk planka with api to update new changes in my help desk application through it. Does planka have any documents for this? Thank you very much

nematollahian avatar Oct 02 '20 16:10 nematollahian

Hi! Currently, there is no simple config for SSL without a load balancer. It can be achieved with some code modifications and rebuild a docker file. You should change two files for that: provide an SSL option here server/config/env/production.js using this documentation (certificate/key files should be added to the project before docker build command), change to HTTPS here client/src/constants/Config.js. Then docker build -t planka . in the root folder. Now you can change the image in docker-compose.yml from meltyshev/planka:latest to planka.

API documentation will be done after we make a new role system. Didn't have time for that :(

meltyshev avatar Oct 05 '20 08:10 meltyshev

Currently, there is no simple config for SSL without a load balancer.

Is it planned to change anytime soon? Sails.js documentaion says:

Don't worry about configuring Sails to use an SSL certificate. SSL will almost always be resolved at your load balancer/proxy server or by your PaaS provider.

Why isn't Plank compliant with that? What's the gap?

ghost avatar Oct 19 '20 20:10 ghost

@eran- you can add an Nginx container to the docker-compose, attach the volume there with config and certs. They correctly said that this is more a task of the proxy server. Also, every PaaS provider already working under a proxy server. We will add some information about how to achieve that locally in the documentation after release.

meltyshev avatar Dec 26 '20 20:12 meltyshev

This is NOT required by planka. You can easily use SSL via nginx-proxy-companion. After setting that up you can install planka via the docker-compose below after pointing a subdomain/domain that you point to your server. This will result in planka app running on https://planka.domain.tld

version: "2"
services:
  planka:
    image: meltyshev/planka:latest
    command: >
      bash -c
        "for i in `seq 1 30`; do
          ./start.sh &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 seconds...\";
          sleep 5;
        done; (exit $$s)"
    restart: always
    container_name: planka
    volumes:
      - /docker/data/planka/user-avatars:/app/public/user-avatars
      - /docker/data/planka/project-background-images:/app/public/project-background-images
      - /docker/data/planka/attachments:/app/public/attachments
    environment:
      - VIRTUAL_HOST=planka.domain.tld
      - VIRTUAL_PORT=1337
      - LETSENCRYPT_HOST=planka.domain.tld
      - [email protected]
      - BASE_URL=https://planka.domain.tld
      - DATABASE_URL=postgresql://postgres:RANDOMPWD@postgres/planka
      - SECRET_KEY=SOMESECRET
    depends_on:
      - postgres

  postgres:
    image: postgres:alpine
    restart: always
    container_name: postgres
    volumes:
      - /docker/data/planka/postgres:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=planka
      - POSTGRES_HOST_AUTH_METHOD=trust  
      - POSTGRES_PASSWORD=RANDOMPWD

networks:
  default:
    external:
      name: nginx-proxy

wayneconnolly avatar Jan 05 '21 07:01 wayneconnolly

how do I rebuild this docker to add ssl?

TOWUK avatar Aug 01 '21 11:08 TOWUK

how do I rebuild this docker to add ssl?

You don't. The docker image is pre-built.

wayneconnolly avatar Sep 25 '21 23:09 wayneconnolly