parent
e1cda8d205
commit
8e72f40aaa
@ -1,16 +0,0 @@
|
||||
{
|
||||
"bridge": {
|
||||
"name": "Homebridge",
|
||||
"username": "{{ homebridge.username }}",
|
||||
"port": 51826,
|
||||
"pin": "{{ homebridge.pin }}"
|
||||
},
|
||||
"platforms": [
|
||||
{
|
||||
"platform": "SmartThings Cloud",
|
||||
"name": "SmartThings Cloud",
|
||||
"port": 3000,
|
||||
"publicKey": "{{ homebridge.smartthings_public_key | b64encode }}"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
# Defaults / Configuration options for homebridge
|
||||
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
|
||||
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
|
||||
|
||||
# If you uncomment the following line, homebridge will log more
|
||||
# You can display this via systemd's journalctl: journalctl -f -u homebridge
|
||||
# DEBUG=*
|
@ -1,17 +0,0 @@
|
||||
[Unit]
|
||||
Description=Node.js HomeKit Server
|
||||
After=syslog.target network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=homebridge
|
||||
EnvironmentFile=/etc/default/homebridge
|
||||
# Adapt this to your specific setup (could be /usr/bin/homebridge)
|
||||
# See comments below for more information
|
||||
ExecStart=/usr/local/bin/homebridge $HOMEBRIDGE_OPTS
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
KillMode=process
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,83 +0,0 @@
|
||||
# https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi#install-avahi-and-other-dependencies
|
||||
|
||||
- hosts: pi
|
||||
vars_files:
|
||||
- vars.yml.private
|
||||
become: yes
|
||||
tasks:
|
||||
|
||||
- name: update apt to get a modern version of node
|
||||
block:
|
||||
- apt_key:
|
||||
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
|
||||
- copy:
|
||||
src: nodesource.list
|
||||
dest: /etc/apt/sources.list.d/nodesource.list
|
||||
|
||||
- name: update apt
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: install dependencies
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- libavahi-compat-libdnssd-dev
|
||||
- nodejs
|
||||
|
||||
- name: install homebridge
|
||||
npm:
|
||||
name: "{{ item }}"
|
||||
global: yes
|
||||
with_items:
|
||||
- homebridge
|
||||
- homebridge-smartthings-cloud
|
||||
|
||||
- name: copy systemd config
|
||||
copy:
|
||||
src: homebridge/{{ item.key }}
|
||||
dest: "{{ item.value }}"
|
||||
with_dict:
|
||||
homebridge: /etc/default
|
||||
homebridge.service: /etc/systemd/system
|
||||
notify:
|
||||
- reload systemd daemon
|
||||
- enable and restart homebridge service
|
||||
|
||||
- name: create homebridge user
|
||||
user:
|
||||
name: homebridge
|
||||
password: !
|
||||
|
||||
- name: create homebridge dir
|
||||
file:
|
||||
path: /var/lib/homebridge
|
||||
state: directory
|
||||
owner: homebridge
|
||||
|
||||
- name: copy homebridge config
|
||||
template:
|
||||
src: homebridge/config.json
|
||||
dest: /var/lib/homebridge
|
||||
owner: homebridge
|
||||
notify: enable and restart homebridge service
|
||||
|
||||
- name: allow access to homebridge
|
||||
ufw:
|
||||
rule: allow
|
||||
proto: tcp
|
||||
port: 51826
|
||||
state: reloaded
|
||||
|
||||
handlers:
|
||||
|
||||
- name: reload systemd daemon
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
|
||||
- name: enable and restart homebridge service
|
||||
service:
|
||||
name: homebridge
|
||||
enabled: yes
|
||||
state: restarted
|
@ -1,2 +0,0 @@
|
||||
deb https://deb.nodesource.com/node_12.x stretch main
|
||||
deb-src https://deb.nodesource.com/node_12.x stretch main
|
@ -1,69 +0,0 @@
|
||||
# https://discourse.pi-hole.net/t/enabling-https-for-your-pi-hole-web-interface/5771
|
||||
|
||||
- hosts: attitude-adjuster
|
||||
vars_files:
|
||||
- vars.yml.private
|
||||
become: yes
|
||||
tasks:
|
||||
|
||||
- name: install certbot
|
||||
package:
|
||||
name: certbot
|
||||
state: present
|
||||
|
||||
- name: obtain ssl certificates
|
||||
command: >-
|
||||
certbot certonly
|
||||
--webroot --webroot-path /var/www/html
|
||||
-d {{ item.fqdn }}
|
||||
-m alpha+lets.encrypt@kejadlen.dev
|
||||
--agree-tos
|
||||
--non-interactive
|
||||
args:
|
||||
creates: /etc/letsencrypt/live/{{ item.fqdn }}
|
||||
with_items:
|
||||
- "{{ home }}"
|
||||
- "{{ home_assistant }}"
|
||||
- "{{ homebridge }}"
|
||||
- "{{ pihole }}"
|
||||
|
||||
- name: create combined pemfile
|
||||
shell: >-
|
||||
cat /etc/letsencrypt/live/{{ item.fqdn }}/privkey.pem
|
||||
/etc/letsencrypt/live/{{ item.fqdn }}/cert.pem >
|
||||
/etc/letsencrypt/live/{{ item.fqdn }}/combined.pem
|
||||
args:
|
||||
creates: /etc/letsencrypt/live/{{ item.fqdn }}/combined.pem
|
||||
with_items:
|
||||
- "{{ home }}"
|
||||
- "{{ home_assistant }}"
|
||||
- "{{ homebridge }}"
|
||||
- "{{ pihole }}"
|
||||
|
||||
- name: let lighttpd read the pemfile
|
||||
file:
|
||||
path: /etc/letsencrypt/live/{{ item.fqdn }}
|
||||
state: directory
|
||||
recurse: yes
|
||||
owner: www-data
|
||||
with_items:
|
||||
- "{{ home }}"
|
||||
- "{{ home_assistant }}"
|
||||
- "{{ homebridge }}"
|
||||
- "{{ pihole }}"
|
||||
|
||||
- name: enable mod_proxy
|
||||
command: lighttpd-enable-mod proxy
|
||||
ignore_errors: yes
|
||||
|
||||
- name: update lighttpd configuration
|
||||
template:
|
||||
src: external.conf.private
|
||||
dest: /etc/lighttpd/external.conf
|
||||
notify: restart lighttpd
|
||||
|
||||
handlers:
|
||||
- name: restart lighttpd
|
||||
service:
|
||||
name: lighttpd
|
||||
state: restarted
|
@ -1,72 +0,0 @@
|
||||
- hosts: attitude-adjuster
|
||||
vars_files:
|
||||
- vars.yml.private
|
||||
become: yes
|
||||
tasks:
|
||||
|
||||
- name: install dependencies
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- certbot
|
||||
- nginx
|
||||
- python3-certbot-nginx
|
||||
|
||||
- name: allow for long domain names
|
||||
lineinfile:
|
||||
path: /etc/nginx/nginx.conf
|
||||
regexp: '^(\s*)# server_names_hash_bucket_size 64;$'
|
||||
line: '\1server_names_hash_bucket_size 64;'
|
||||
backrefs: yes
|
||||
|
||||
- name: obtain ssl certs
|
||||
command: >-
|
||||
certbot certonly --nginx
|
||||
-d {{ item }}
|
||||
-m alpha+lets.encrypt@kejadlen.dev
|
||||
--agree-tos
|
||||
--non-interactive
|
||||
args:
|
||||
creates: /etc/letsencrypt/live/{{ item }}
|
||||
with_items:
|
||||
- "{{ home.fqdn }}"
|
||||
- "{{ home_assistant.fqdn }}"
|
||||
- "{{ pihole.fqdn }}"
|
||||
|
||||
- name: configure nginx
|
||||
copy:
|
||||
content: |
|
||||
server {
|
||||
|
||||
server_name {{ fqdn }};
|
||||
|
||||
# Redirect non-https traffic to https
|
||||
if ($scheme != "https") {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://{{ proxy }}/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For nginx;
|
||||
}
|
||||
|
||||
listen 80;
|
||||
|
||||
listen 443 ssl;
|
||||
ssl_certificate /etc/letsencrypt/live/{{ fqdn }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ fqdn }}/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
}
|
||||
dest: /etc/nginx/conf.d/{{ fqdn }}.conf
|
||||
vars:
|
||||
fqdn: "{{ item.fqdn }}"
|
||||
proxy: "{{ item.nginx.proxy }}"
|
||||
with_items:
|
||||
- "{{ home }}"
|
||||
- "{{ home_assistant }}"
|
||||
- "{{ pihole }}"
|
Loading…
Reference in new issue