Removed mklink for git
This commit is contained in:
@ -1,150 +1,17 @@
|
||||
---
|
||||
type: "topic"
|
||||
created: "2024-01-06T01:25:36.065Z"
|
||||
updated: "2024-01-06T01:25:36.065Z"
|
||||
assigned: ''
|
||||
created: 2024-01-06T01:25:36.065Z
|
||||
progress: 0
|
||||
tags:
|
||||
- Duck
|
||||
type: note
|
||||
updated: 2024-11-05T00:05:31.000Z
|
||||
---
|
||||
|
||||
# Home Assistant
|
||||
|
||||
```bash
|
||||
wsl --export Ubuntu "Ubuntu\Ubuntu-Home-Assistant-001.tar"
|
||||
wsl --unregister Ubuntu
|
||||
wsl --import Ubuntu-Home-Assistant Ubuntu-Home-Assistant "Ubuntu\Ubuntu-Home-Assistant-001.tar"
|
||||
wsl --export Ubuntu-Home-Assistant "Ubuntu\Ubuntu-Home-Assistant-002.tar"
|
||||
del "Ubuntu\Ubuntu-Home-Assistant-002.tar"
|
||||
```
|
||||
|
||||
```yaml
|
||||
Name: Ubuntu-Home-Assistant
|
||||
Command Line: wsl.exe -d Ubuntu-Home-Assistant
|
||||
Tab Title: Ubuntu-Home-Assistant
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo -i
|
||||
apt-get update
|
||||
ip a
|
||||
lsb_release -a
|
||||
apt-get install links unzip nginx git nano ncdu -y
|
||||
ncdu
|
||||
timedatectl set-timezone America/Phoenix
|
||||
timedatectl
|
||||
nano /etc/hosts
|
||||
nano /etc/nginx/sites-available/default
|
||||
echo >/etc/nginx/sites-available/default && nano /etc/nginx/sites-available/default
|
||||
```
|
||||
|
||||
```conf
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
root /var/www/html;
|
||||
index index.html index.htm index.nginx-debian.html;
|
||||
server_name _;
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
server {
|
||||
ssl_certificate 'laundry.phares.myftp.org.crt';
|
||||
ssl_certificate_key 'laundry.phares.myftp.org.key';
|
||||
listen 443 ssl http2;
|
||||
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name laundry.phares.myftp.org;
|
||||
location / {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://localhost:80/;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
}
|
||||
}
|
||||
server {
|
||||
ssl_certificate 'laundry.phares.myftp.org.crt';
|
||||
ssl_certificate_key 'laundry.phares.myftp.org.key';
|
||||
listen 443 ssl http2;
|
||||
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name home-assistant.laundry.phares.myftp.org;
|
||||
location / {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://localhost:9400/;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```bash
|
||||
nano /home/mike/laundry.phares.myftp.org.conf
|
||||
echo >/home/mike/laundry.phares.myftp.org.conf && nano /home/mike/laundry.phares.myftp.org.conf
|
||||
```
|
||||
|
||||
```conf
|
||||
[req]
|
||||
default_bits = 2048
|
||||
default_keyfile = laundry.phares.myftp.org.key
|
||||
distinguished_name = req_distinguished_name
|
||||
req_extensions = req_ext
|
||||
x509_extensions = v3_ca
|
||||
|
||||
[req_distinguished_name]
|
||||
countryName = Country Name (2 letter code)
|
||||
countryName_default = US
|
||||
stateOrProvinceName = State or Province Name (full name)
|
||||
stateOrProvinceName_default = Arizona
|
||||
localityName = Locality Name (eg, city)
|
||||
localityName_default = Anthem
|
||||
organizationName = Organization Name (eg, company)
|
||||
organizationName_default = Phares
|
||||
organizationalUnitName = organizationalunit
|
||||
organizationalUnitName_default = Development
|
||||
commonName = Common Name (e.g. server FQDN or YOUR name)
|
||||
commonName_default = laundry.phares.myftp.org
|
||||
commonName_max = 64
|
||||
|
||||
[req_ext]
|
||||
subjectAltName = @alt_names
|
||||
|
||||
[v3_ca]
|
||||
subjectAltName = @alt_names
|
||||
|
||||
[alt_names]
|
||||
DNS.1 = laundry.phares.myftp.org
|
||||
DNS.2 = dashkiosk.laundry.phares.myftp.org
|
||||
DNS.3 = gogs.laundry.phares.myftp.org
|
||||
DNS.4 = nextcloud.laundry.phares.myftp.org
|
||||
DNS.5 = photoprism.laundry.phares.myftp.org
|
||||
DNS.6 = pi-hole.laundry.phares.myftp.org
|
||||
DNS.7 = syncthing.laundry.phares.myftp.org
|
||||
DNS.8 = mike.desktop
|
||||
DNS.9 = desktop-h6jg91b
|
||||
DNS.10 = localhost
|
||||
DNS.11 = 127.0.0.1
|
||||
```
|
||||
|
||||
```bash
|
||||
ls /etc/nginx
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/laundry.phares.myftp.org.key -out /etc/nginx/laundry.phares.myftp.org.crt -config /home/mike/laundry.phares.myftp.org.conf
|
||||
ls /etc/nginx
|
||||
nginx -t
|
||||
systemctl restart nginx
|
||||
nginx -s reload
|
||||
exit
|
||||
exit
|
||||
```
|
||||
|
||||
```bash
|
||||
wsl --export Ubuntu-Home-Assistant "Ubuntu\Ubuntu-Home-Assistant-002.tar"
|
||||
wsl --unregister Ubuntu-Home-Assistant
|
||||
wsl --import Ubuntu-Home-Assistant Ubuntu-Home-Assistant "Ubuntu\Ubuntu-Home-Assistant-002.tar"
|
||||
```
|
||||
- [hassio-addons](https://github.com/hassio-addons/repository/blob/master/example/config.yaml)
|
||||
- [haos_generic-x86-64-12.4.img.xz](https://www.home-assistant.io/installation/generic-x86-64/)
|
||||
|
||||
```bash
|
||||
sudo -i
|
||||
@ -163,14 +30,11 @@ update-alternatives --config python3
|
||||
python3 --version
|
||||
apt install libpython3.12-dev -y
|
||||
apt-cache rdepends python3.12
|
||||
# apt-get install -y libtiff6
|
||||
# apt install python3.10-venv
|
||||
# apt-add-repository universe
|
||||
# apt-get update
|
||||
# apt-get install virtualenv
|
||||
# apt install python3.11-venv
|
||||
|
||||
|
||||
apt install python3.12-venv -y
|
||||
# apt install python3.13-venv
|
||||
|
||||
|
||||
apt-get install libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev -y
|
||||
apt install pkg-config -y
|
||||
useradd -rm homeassistant
|
||||
@ -213,15 +77,140 @@ sudo -u homeassistant -H -s
|
||||
cd /srv/homeassistant
|
||||
python3 -m venv .
|
||||
source bin/activate
|
||||
hass
|
||||
# You can now reach your installation via the web interface on http://homeassistant.local:8123.
|
||||
```
|
||||
|
||||
- [your-http-integration-is-not-set-up-for-reverse-proxies](https://community.home-assistant.io/t/your-http-integration-is-not-set-up-for-reverse-proxies/553939)
|
||||
|
||||
```bash
|
||||
systemctl status homeassistant
|
||||
nano /root/.homeassistant/configuration.yaml
|
||||
systemctl restart homeassistant
|
||||
```
|
||||
|
||||
```bash Sun Jul 28 2024 08:44:18 GMT-0700 (Mountain Standard Time)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
wget -O - https://get.hacs.xyz | bash -
|
||||
```
|
||||
|
||||
## Sub-tasks
|
||||
|
||||
- [x] Code Server
|
||||
- [x] DuckDNS
|
||||
- [x] ADGuard
|
||||
- [ ] Traccar
|
||||
|
||||
## Manage add-on repositories
|
||||
|
||||
- [integrations](https://www.home-assistant.io/integrations/)
|
||||
- [HA Add-ons by alexbelgium](https://github.com/alexbelgium/hassio-addons)
|
||||
|
||||
## Addons
|
||||
|
||||
```conf
|
||||
192.168.0.11 adguard.phares.duckdns.org # 3002
|
||||
192.168.0.11 baikal.phares.duckdns.org # 8013
|
||||
192.168.0.11 free.file.sync.root # 22
|
||||
192.168.0.11 gitea.phares.duckdns.org # 3000
|
||||
192.168.0.11 immich.phares.duckdns.org # 8181
|
||||
192.168.0.11 quartz.phares.duckdns.org # /
|
||||
192.168.0.11 slideshow.phares.duckdns.org # /
|
||||
192.168.0.11 vaultwarden.phares.duckdns.org # 3000
|
||||
192.168.0.21 free.file.sync.k0308 # 22
|
||||
192.168.0.31 adguard.affirm.duckdns.org # 3002
|
||||
192.168.0.31 chat.affirm.duckdns.org # 5001
|
||||
192.168.0.31 cockpit.affirm.duckdns.org # 9090
|
||||
192.168.0.31 diskstation.affirm.duckdns.org # 5001
|
||||
192.168.0.31 drive.affirm.duckdns.org # 5001
|
||||
192.168.0.31 free.file.sync.media # 22
|
||||
192.168.0.31 free.file.sync.media # 22
|
||||
192.168.0.31 kuma.affirm.duckdns.org # 3001
|
||||
192.168.0.31 phots.affirm.duckdns.org # 5001
|
||||
192.168.0.31 pve.affirm.duckdns.org # 8006
|
||||
192.168.0.31 quartz.affirm.duckdns.org # /
|
||||
192.168.0.42 free.file.sync.room # 22
|
||||
192.168.43.21 adguard.bchs.duckdns.org # 45158
|
||||
192.168.43.21 baikal.bchs.duckdns.org # 8013
|
||||
192.168.43.21 filebrowser.bchs.duckdns.org
|
||||
192.168.43.21 firefly.bchs.duckdns.org
|
||||
192.168.43.21 free.file.sync.loft # 22
|
||||
192.168.43.21 glances.bchs.duckdns.org # 8086
|
||||
192.168.43.21 grocy.bchs.duckdns.org
|
||||
192.168.43.21 ha.bchs.duckdns.org # 8124
|
||||
192.168.43.21 immich.bchs.duckdns.org # 8181
|
||||
192.168.43.21 kuma.bchs.duckdns.org # 3001
|
||||
192.168.43.21 nextcloud.bchs.duckdns.org
|
||||
192.168.43.21 nginx.bchs.duckdns.org # 81
|
||||
192.168.43.21 papermerge.bchs.duckdns.org # 8000
|
||||
192.168.43.21 photoprism.bchs.duckdns.org # 2342
|
||||
192.168.43.21 piwigo.bchs.duckdns.org
|
||||
192.168.43.21 plex.bchs.duckdns.org
|
||||
192.168.43.21 postgres.bchs.duckdns.org # 5432
|
||||
192.168.43.21 traccar.bchs.duckdns.org # 8082
|
||||
```
|
||||
|
||||
```bash Sun Nov 03 2024 20:51:53 GMT-0700 (Mountain Standard Time)
|
||||
cd /etc/
|
||||
mkdir /etc/duckdns
|
||||
cd /etc/duckdns
|
||||
nano duck.sh
|
||||
```
|
||||
|
||||
```conf Sun Nov 03 2024 20:51:53 GMT-0700 (Mountain Standard Time)
|
||||
echo url="https://www.duckdns.org/update?domains=bchs&token=1d3fc707-7052-4459-a624-fb01250f00b9&verbose=true&ip=" | curl -k -o /etc/duckdns/duck.log -K -
|
||||
```
|
||||
|
||||
```bash Sun Nov 03 2024 20:51:53 GMT-0700 (Mountain Standard Time)
|
||||
chmod 700 duck.sh
|
||||
./duck.sh
|
||||
cat duck.log
|
||||
```
|
||||
|
||||
```bash Sun Nov 03 2024 20:51:53 GMT-0700 (Mountain Standard Time)
|
||||
apk add openssl
|
||||
apk add socat
|
||||
# https://www.snbforums.com/threads/duckdns-with-letsencrypt.86114/
|
||||
curl https://get.acme.sh | sh -s email=mikepharesjr@msn.com
|
||||
cd /root/.acme.sh
|
||||
export DuckDNS_Token=1d3fc707-7052-4459-a624-fb01250f00b9
|
||||
echo $DuckDNS_Token
|
||||
./acme.sh --register-account -m mikepharesjr@msn.com
|
||||
./acme.sh --set-default-ca --server letsencrypt
|
||||
# ./acme.sh --issue --dns dns_duckdns -d '*.phares.duckdns.org' --dnssleep 120 --days 90 --ecc --server https://acme-v02.api.letsencrypt.org/directory
|
||||
./acme.sh --issue --dns dns_duckdns -d bchs.duckdns.org --debug --home /root/.acme.sh --dnssleep 120 --days 90 --ecc --server https://acme-v02.api.letsencrypt.org/directory
|
||||
./acme.sh --issue --dns dns_duckdns -d '*.bchs.duckdns.org' --debug --home /root/.acme.sh --dnssleep 120 --days 90 --ecc --server https://acme-v02.api.letsencrypt.org/directory
|
||||
host -t txt bchs.duckdns.org
|
||||
dig bchs.duckdns.org TXT
|
||||
```
|
||||
|
||||
```bash Sun Nov 03 2024 20:51:53 GMT-0700 (Mountain Standard Time)
|
||||
crontab -e
|
||||
```
|
||||
|
||||
```conf Sun Nov 03 2024 20:51:53 GMT-0700 (Mountain Standard Time)
|
||||
11 13 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null
|
||||
```
|
||||
|
||||
```bash
|
||||
# https://www.youtube.com/watch?v=O7pC1oI86gg
|
||||
# https://tasmota.github.io/docs/About/
|
||||
# https://www.youtube.com/watch?v=fgeZ1O6J4jc
|
||||
# https://www.youtube.com/watch?v=CYvTLw_Wn6I
|
||||
# https://python-kasa.readthedocs.io/en/latest/smartdevice.html
|
||||
# https://zigbee.blakadder.com/plugs.html
|
||||
echo url="https://www.duckdns.org/update?domains=bchs&token=1d3fc707-7052-4459-a624-fb01250f00b9&txt={YOURVALUE}[&verbose=true][&clear=true]" | curl -k -o /etc/duckdns/duck.log -K -
|
||||
mkdir -p /var/www/certbot/.well-known/acme-challenge/smwqgmeNx04tA3HC05I8_gtpqLTkjRAotHdfp0E5LnM
|
||||
curl --slient --dump-header /root/.acme.sh/http.header -L --trace-ascii /tmp/tmp.iFkIEL -g
|
||||
```
|
||||
|
||||
```bash
|
||||
cd /tmp
|
||||
git clone https://github.com/acmesh-official/acme.sh.git
|
||||
cd /tmp/acme.sh
|
||||
./acme.sh --install -m mikepharesjr@msn.com
|
||||
export DuckDNS_Token=1d3fc707-7052-4459-a624-fb01250f00b9
|
||||
echo $DuckDNS_Token
|
||||
./acme.sh --register-account -m mikepharesjr@msn.com
|
||||
./acme.sh --set-default-ca --server letsencrypt
|
||||
./acme.sh --issue --dns dns_duckdns -d '*.bchs.duckdns.org' --debug --home /root/.acme.sh --dnssleep 120 --days 90 --ecc --server https://acme-v02.api.letsencrypt.org/directory
|
||||
# https://intodns.com/
|
||||
```
|
||||
|
Reference in New Issue
Block a user