Score:0

How to make Titra docker image answer https?

gp flag

I've got a test installation of Titra on a local system, and I've got it answering http on port 80 with this docker-compose file:

version: "2.0"
services:
  titra:
    image: kromit/titra
    container_name: titra
    depends_on:
      - mongodb
    environment:
      - ROOT_URL=http://timesheet
      - MONGO_URL=mongodb://mongodb/titra
      - PORT=3000
    ports:
      - "80:3000"
    restart: always
  mongodb:
    image: mongo:4.4
    container_name: mongodb
    restart: always
    volumes:
      - /root/titradb:/data/db

That works, but I'd kind of like the thing to answer https instead, but I'm not that familiar with Titra itself, nor Meteor (the framework it's written in), and my poking around the available documentation hasn't turned up anything about https for self-hosted Titra instances.

Score:1
vn flag

You could add a nginx reverse proxy to your docker-compose file:

reverse:
  container_name: reverse
  hostname: reverse
  image: nginx:latest
  ports:
    - 80:80
    - 443:443
  restart: always
  volumes:
    - ./nginx/conf/:/etc/nginx/conf.d/:ro
titra:
  image: kromit/titra
  container_name: titra
  hostname: titra
  depends_on:
    - mongodb
  environment:
    - ROOT_URL=https://timesheet
    - MONGO_URL=mongodb://mongodb/titra
    - PORT=3000
  ports:
    - "3000:3000"
  restart: always

mongodb:
  image: mongo:4.4
  container_name: mongodb
  hostname: mongodb
  restart: always
  volumes:
   - /srv/mongodb/:/data/db

Your nginx should be configured with a *.conf like containing something like this: upstream titra { server titra:3000; }

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name timesheet;

    ssl_certificate /etc/nginx/ssl/live/timesheet/fullchain.pem;
    ssl_certificate_key /etc/nginx/ssl/live/timesheet/privkey.pem;
    

    location / {
      proxy_pass  http://titra;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header X-Forwarded-For $remote_addr;
      proxy_set_header Host $host;
    }
}

I have a similar setup and it works fine. It's based loosely on

https://www.freecodecamp.org/news/docker-nginx-letsencrypt-easy-secure-reverse-proxy-40165ba3aee2/

gp flag
Unfortunately, I'm unable to test this idea - Titra turned out to not work for us for other reasons.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.