View Single Post
Old 02-02-2019, 08:37 PM   #66
haertig
Wizard
haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.haertig ought to be getting tired of karma fortunes by now.
 
Posts: 1,739
Karma: 26006874
Join Date: Sep 2017
Device: PW3, Fire HD8 Gen7, Moto G7, Sansa Clip v2, Ruizu X26
I successfully run KindleForPC v1.17 on LinuxMint 18 (Sarah) under Wine 1.9.19. I use "PlayOnLinux" to easily manage Wine versions and make it easy to move between different Wine prefixes.

I was never able to get ADE to run correctly under Wine.

Regarding Docker, I do not use that to run K4PC, but I do use it to run "Calibre-Web" - an alternate web server interface for Calibre (as opposed to using the built-in Calibre server). Many people here also run Calibre, so I've included my Docker stuff related to Calibre below, in case it will be of benefit to anyone. Note that the "letsencrypt" container includes both NGINX webserver and the LETSENCRYPT free HTTPS certificate management.

Here is the docker-compose.yml file I created:

Code:
version: '3'

networks:

  frontend:
    driver: bridge

services:

  letsencrypt:
    image: linuxserver/letsencrypt
    container_name: letsencrypt
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/opt/docker/letsencrypt/config:/config
    environment:
      - EMAIL=myemailaddress@gmail.com
      - URL=my.domain_name.net
      - VALIDATION=http
      - TZ=America/Denver
      - PUID=65534
      - PGID=65534
    networks:
      - frontend
    depends_on:
      - calibre-web
    restart: always

  calibre-web:
    image: linuxserver/calibre-web
    container_name: calibre-web
    volumes:
      - /var/opt/docker/calibre-web/config:/config
      - /var/opt/calibre:/books:ro
    environment:
      - PUID=1002
      - PGID=1001
    networks:
      - frontend
    restart: unless-stopped
And here is the NGINX config file I created:

Code:
server {
	listen 80;
	server_name _;
	return 301 https://$host$request_uri;
}

server {
	listen 443 ssl default_server;
	root /config/www;
	index index.html index.htm index.php;
	server_name _;
	include /config/nginx/proxy-confs/*.subfolder.conf;
	include /config/nginx/ssl.conf;
	client_max_body_size 0;

	location / {
		try_files $uri $uri/ /index.html /index.php?$args =404;
	}

	location ~ \.php$ {
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		fastcgi_pass 127.0.0.1:9000;
		fastcgi_index index.php;
		include /etc/nginx/fastcgi_params;
	}

	location /calibre-web {
		auth_basic "Books";
		auth_basic_user_file /config/nginx/.htpasswd-books;
		proxy_pass              http://calibre-web:8083;
		proxy_set_header        Host            $http_host;
		proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header        X-Scheme        $scheme;
		proxy_set_header        X-Script-Name   /calibre-web;
	}
}
I simply type "docker-compose up -d" to bring the system up, and "docker-compose stop" to shut it down. If I want to update all the containers with newer images I'll use "docker-compose down" instead of "stop".

Users would access Calibre at:

Code:
https://my.domain_name.net/calibre-web
Note: I turned off authentication in calibre-web and replaced that with authentication done by NGINX. In real life I am moving away from basic .htpasswd authentication into HTTPS client certs, but I have not fully implemented that for all my servers yet.

Both my docker-compose.yml file and my nginx config file are quite a bit more complicated than I show above - because I also run airsonic, booksonic, nextcloud, plex, etc. - but I stripped out all that other config so you only see the stuff relevant to Calibre. Note that my Calibre library is located at /var/opt/calibre and that is bind-mounted read-only into the calibre-web container so that users accessing the web interface cannot corrupt any of my Calibre data.
haertig is offline   Reply With Quote