diff --git a/README.md b/README.md index ae07d489..be10d434 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,14 @@ Ansible config and a bunch of Docker containers. * A Docker host with Portainer for image and container management * An automatic dynamic DNS updater if you use Cloudflare to host your domain DNS * A Personal finance manager +* eBook management with calibre-web * A dual panel local file manager ### Docker Containers Used * [Airsonic](https://airsonic.github.io/) - catalog and stream music * [Bitwarden_rs](https://github.com/dani-garcia/bitwarden_rs) - Self-Hosting port of password manager +* [Calibre](https://hub.docker.com/r/linuxserver/calibre-web) - eBook Library * [Cloud Commander](https://cloudcmd.io/) - A dual panel file manager with integrated web console and text editor * [Cloudflare DDNS](https://hub.docker.com/r/joshuaavalon/cloudflare-ddns/) - automatically update Cloudflare with your IP address * [CouchPotato](https://couchpota.to/) - for downloading and managing movies @@ -43,6 +45,7 @@ Ansible config and a bunch of Docker containers. * [Grafana](https://github.com/grafana/grafana) - Dashboarding tool * [Guacamole](https://guacamole.apache.org/) - Web based remote desktop gateway, supports VNC, RDP and SSH * [Heimdall](https://heimdall.site/) - Home server dashboard +* [Home Assistant](https://www.home-assistant.io) - Open source home automation * [InfluxDB](https://github.com/influxdata/influxdb) - Time series database used for stats collection * [Jackett](https://github.com/Jackett/Jackett) - API Support for your favorite torrent trackers * [MiniDlna](https://sourceforge.net/projects/minidlna/) - simple media server which is fully compliant with DLNA/UPnP-AV clients diff --git a/docs/applications/calibre.md b/docs/applications/calibre.md new file mode 100644 index 00000000..07968bac --- /dev/null +++ b/docs/applications/calibre.md @@ -0,0 +1,26 @@ +# Calibre(-web) eBook Library + +Homepage: [https://github.com/janeczku/calibre-web](https://github.com/linuxserver/docker-calibre-web) + + +Calibre-Web is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. + +## Usage + +Set `calibre_enabled: true` in your `group_vars/all.yml` file. + +## Specific Configuration + +### Admin login + +**Default admin login:** Username: admin Password: admin123 + +### eBook Conversion + +If you do not need eBook conversion you can disable it to save resources by setting the `calibre_ebook_conversion` variable in `group_vars/all.yml` file to be empty. + + - Conversion enabled: `calibre_ebook_conversion: "linuxserver/calibre-web:calibre"` + + - Conversion disabled: `calibre_ebook_conversion: ""` + +You can target just Calibre by appending `-t calibre` to your `ansible-playbook` command. diff --git a/docs/applications/homeassistant.md b/docs/applications/homeassistant.md new file mode 100644 index 00000000..29983c2e --- /dev/null +++ b/docs/applications/homeassistant.md @@ -0,0 +1,12 @@ +# Home Assistant + +Homepage: [https://www.home-assistant.io/](https://www.home-assistant.io/) + + +## Usage + +Set `homeassistant_enabled: true` in your `group_vars/all.yml` file. + +If you want to access Home Assistant externally, don't forget to set `homeassistant_available_externally: "true"` in your `group_vars/all.yml` file. + +The Home Assistant web interface can be found at http://ansible_nas_host_or_ip:8123. diff --git a/docs/configuration/application_ports.md b/docs/configuration/application_ports.md index ca40c89e..842a0bd9 100644 --- a/docs/configuration/application_ports.md +++ b/docs/configuration/application_ports.md @@ -8,6 +8,7 @@ By default, applications can be found on the ports listed below. | Couchpotato | 5050 | | | Bitwarden "hub" | 3012 | Web Not. | | Bitwarden | 19080 | HTTP | +| Calibre | 8084 | HTTP | | Duplicati | 8200 | | | Emby | 8096 | HTTP | | Emby | 8920 | HTTPS | @@ -19,6 +20,7 @@ By default, applications can be found on the ports listed below. | Grafana | 3000 | | | Guacamole | 8090 | | | Heimdall | 10080 | | +| Home Assistant | 8123 | | | Jackett | 9117 | | | MiniDLNA | 8201 | | | Miniflux | 8070 | | diff --git a/group_vars/all.yml.dist b/group_vars/all.yml.dist index 3f8e5bd3..b2f784f5 100644 --- a/group_vars/all.yml.dist +++ b/group_vars/all.yml.dist @@ -76,9 +76,13 @@ firefly_enabled: false # Wallabag wallabag_enabled: false -# MQTT +# Home Automation +homeassistant_enabled: false mosquitto_enabled: false +# Calibre +calibre_enabled: false + ### ### General ### @@ -139,6 +143,9 @@ music_root: "{{ samba_shares_root }}/music" # Where podcasts are stored podcasts_root: "{{ samba_shares_root }}/podcasts" +# Where your books are stored +books_root: "{{ samba_shares_root }}/books" + # The description that'll appear next to your Ansible-NAS box when browsing your network samba_server_string: Ansible NAS @@ -208,6 +215,14 @@ samba_shares: browsable: yes path: "{{ samba_shares_root }}/photos" + - name: books + comment: 'Books' + guest_ok: yes + public: yes + writable: yes + browsable: yes + path: "{{ samba_shares_root }}/books" + ### ### NFS ### @@ -276,7 +291,7 @@ samba_netbios_name: "{{ ansible_nas_hostname }}" ### ### Traefik ### -traefik_docker_image: traefik:latest +traefik_docker_image: traefik:v1.7 traefik_data_directory: "{{ docker_home }}/traefik" traefik_debug: "false" @@ -582,7 +597,23 @@ nzbget_group_id: 0 wallabag_available_externally: "false" wallabag_data_directory: "{{ docker_home }}/wallabag" +### ### Mosquitto ### mosquitto_available_externally: "false" mosquitto_data_directory: "{{ docker_home }}/mosquitto" + +### +### Calibre +### +calibre_available_externally: "false" +calibre_data_directory: "{{ docker_home }}/calibre" +calibre_user_id: "0" +calibre_group_id: "0" +# To disable ebook conversion set calibre_ebook_conversion to "". To enable it set it to "linuxserver/calibre-web:calibre" +calibre_ebook_conversion: "linuxserver/calibre-web:calibre" + +### Home Assistant +### +homeassistant_available_externally: "false" +homeassistant_data_directory: "{{ docker_home }}/homeassistant" diff --git a/nas.yml b/nas.yml index 10074162..a9f06c62 100644 --- a/nas.yml +++ b/nas.yml @@ -175,3 +175,11 @@ - import_tasks: tasks/cloudcmd.yml when: (cloudcmd_enabled | default(False)) tags: cloudcmd + + - import_tasks: tasks/calibre.yml + when: (calibre_enabled | default(False)) + tags: calibre + + - import_tasks: tasks/homeassistant.yml + when: (homeassistant_enabled | default(False)) + tags: homeassistant \ No newline at end of file diff --git a/tasks/calibre.yml b/tasks/calibre.yml new file mode 100755 index 00000000..f42e0dc1 --- /dev/null +++ b/tasks/calibre.yml @@ -0,0 +1,29 @@ +- name: Create Calibre Directories + file: + path: "{{ item }}" + state: directory + with_items: + - "{{ calibre_data_directory }}/config" + +- name: Calibre Docker Container + docker_container: + name: calibre + image: linuxserver/calibre-web:latest + pull: true + volumes: + - "{{ calibre_data_directory }}/config:/config" + - "{{ books_root }}:/books" + env: + TZ: "{{ ansible_nas_timezone }}" + PUID: "{{ calibre_user_id }}" + PGID: "{{ calibre_group_id }}" + DOCKER_MODS: "{{ calibre_ebook_conversion }}" + ports: + - "8084:8083" + restart_policy: unless-stopped + labels: + traefik.backend: "calibre" + traefik.frontend.rule: "Host:calibre.{{ ansible_nas_domain }}" + traefik.enable: "{{ calibre_available_externally }}" + traefik.port: "8083" + memory: 1g \ No newline at end of file diff --git a/tasks/general.yml b/tasks/general.yml index 7affee87..7ad21cef 100644 --- a/tasks/general.yml +++ b/tasks/general.yml @@ -47,6 +47,7 @@ - name: "Permission share directories" file: path: "{{ item.path }}" + state: directory owner: ansible-nas group: ansible-nas mode: "u=rwX,g=rwX,o=rX" diff --git a/tasks/homeassistant.yml b/tasks/homeassistant.yml new file mode 100644 index 00000000..3b615e3d --- /dev/null +++ b/tasks/homeassistant.yml @@ -0,0 +1,26 @@ +- name: Create Home Assistant Directories + file: + path: "{{ item }}" + state: directory + with_items: + - "{{ homeassistant_data_directory }}/config" + +- name: Home Assistant Docker Container + docker_container: + name: homeassistant + image: homeassistant/home-assistant + pull: true + volumes: + - "{{ homeassistant_data_directory }}/config:/config:rw" + ports: + - "8123:8123" + restart_policy: unless-stopped + env: + TZ: "{{ ansible_nas_timezone }}" + labels: + traefik.backend: "homeassistant" + traefik.frontend.rule: "Host:homeassistant.{{ ansible_nas_domain }}" + traefik.enable: "{{ homeassistant_available_externally }}" + traefik.port: "8123" + traefik.frontend.headers.SSLRedirect: "true" + memory: 1g diff --git a/tasks/traefik.yml b/tasks/traefik.yml index f4a66c91..dfcb8ec2 100644 --- a/tasks/traefik.yml +++ b/tasks/traefik.yml @@ -9,7 +9,7 @@ name: letsencrypt-nginx-proxy-companion state: absent -- name: Create Trafik Directories +- name: Create Traefik Directories file: path: "{{ item }}" state: directory @@ -26,10 +26,7 @@ name: traefik image: "{{ traefik_docker_image }}" pull: true - ports: - - "80:80" - - "443:443" - - "8083:8083" + network_mode: host volumes: - "{{ traefik_data_directory }}/traefik.toml:/etc/traefik/traefik.toml:ro" - "/var/run/docker.sock:/var/run/docker.sock:ro" diff --git a/templates/traefik/traefik.toml b/templates/traefik/traefik.toml index 419f5eeb..cc046d35 100644 --- a/templates/traefik/traefik.toml +++ b/templates/traefik/traefik.toml @@ -181,6 +181,7 @@ onDemand = false # create certificate when container is created # we request a certificate for everything, because why not. sans = ["airsonic.{{ ansible_nas_domain }}", "bitwarden.{{ ansible_nas_domain }}", + "calibre.{{ ansible_nas_domain }}", "cloudcmd.{{ ansible_nas_domain }}", "couchpotato.{{ ansible_nas_domain }}", "duplicati.{{ ansible_nas_domain }}", @@ -191,6 +192,7 @@ onDemand = false # create certificate when container is created "grafana.{{ ansible_nas_domain }}", "guacamole.{{ ansible_nas_domain }}", "heimdall.{{ ansible_nas_domain }}", + "homeassistant.{{ ansible_nas_domain }}", "jackett.{{ ansible_nas_domain }}", "miniflux.{{ ansible_nas_domain }}", "netdata.{{ ansible_nas_domain }}",