Commit 4d59ec33 authored by Nick Busey's avatar Nick Busey

Adding MkDocs and Traefik settings

parent 0cd13aec
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1894/badge)](https://bestpractices.coreinfrastructure.org/projects/1894)
# HomelabOS
An easy way to take control of your data.
Your very own offline-first open-source data-center!
## Summary
A set of Ansible scripts to set up a Docker based Homelab server with all sorts of goodies.
A set of Ansible scripts to configure a Docker based Homelab server with all sorts of goodies.
## Goals
Make it easy for anyone to own all their data in an easy and secure way, without the need of cloud providers.
To make it easy for anyone to own all their data in an easy and secure way, without the need of cloud providers.
## Features
* One command depyloment
* Automated HTTPS endpoints (Coming Soon)
* Automated Backups (Coming Soon)
* Easy Restore (Coming Soon)
* Dynamic DNS Support (Coming Soon)
## Included
## Included Software
* [Home Assistant](https://www.home-assistant.io/) - Home Automation
* [Emby](https://emby.media/) - Media Player
* [Grafana](https://grafana.com/) - Pretty Graphs
* [Chronograf](https://www.influxdata.com/time-series-platform/chronograf/) - More pretty graphs. Easy data exploration.
* [InfluxDB](https://www.influxdata.com/time-series-platform/influxdb/) - Time Series Data Storage
* [Telegraf](https://www.influxdata.com/time-series-platform/telegraf/) - Server Statistics Reporting
* Documentation - Offline, searchable documentation via [MkDocs](https://www.mkdocs.org/).
### Coming Soon
* Emby - Media Player
* Home Assistant - Home Automation
* Grafana - Pretty Graphs
* InfluxDB - Data Storage
* Telegraf - Server Statistics Reporting
* Gogs - Git Hosting
* NextCloud - Private Cloud Storage, Calendar, Contacts, LDAP, etc.
* uTorrent - Torrent Downloader
* BulletNotes - Note taking knowledgebase with kanban and calendar functionality.
## Requirements
A server running Ubuntu 18.04 accessible via ssh with a user that has sudo.
A domain configured with a `A` type DNS record of `*.yourdomain.com` pointed at your server's IP address.
Ports 80 and 443 punched through any firewalls and port forwarded at your server in question.
Ansible version 2.5+ installed on your computer (not the server).
## Installation
Install Ubuntu 18.04
From your computer (not the server) run `ansible-playbook -i hosts homelabos.yml`.
## Contributing
Please do!
Create a user with passwordless sudo access and ssh key based access.
### Working locally on the documentation
Run `ansible-playbook -i hosts homelabos.yml`
Follow the [MkDocs Material Theme setup directions](https://squidfunk.github.io/mkdocs-material/getting-started/).
Then run `mkdocs serve`
\ No newline at end of file
# HomelabOS
Welcome to HomelabOS! Your very own offline-first open-source data-center!
## Getting Started
HomelabOS is a collection of various separate services. You can find links to them below. Several have their own native mobile apps available for integration. Simply point them at the URLs below and they will work.
### [Home Assistant](http://homeassistant.{{ domain }}/)
You can use Home Assistant to automate your home.
[Home Assistant Documentation](https://www.home-assistant.io/docs/)
### [Emby](http://emby.{{ domain }}/)
Emby is a personal media server. Connect it to a NAS and let it serve all your movies, tv, and music in a Netflix style interface.
### [Grafana](http://grafana.{{ domain }}/)
### [Chronograf](http://chronograf.{{ domain }}/)
\ No newline at end of file
main_user_name: myuser
# Set your variables here
ansible_ssh_user: myuser
# Default user name to create as admin with services
main_user_name: (required)
# User name used to connect via ssh. Must have passwordless sudo.
ansible_ssh_user: (required)
# Timezone of the server
common_timezone: 'Etc/UTC'
domain: my.domain.com
\ No newline at end of file
# Domain that will be used to point at the server
# Must have a DNS A record of `*.yourserver.com` pointing at your server's IP.
domain: yourserver.com
\ No newline at end of file
......@@ -5,6 +5,8 @@
state: directory
loop:
- docker
- docs
- docs/docs
- emby
- grafana
- homeassistant
......@@ -14,6 +16,26 @@
- telegraf
- traefik
- name: Configure Telegraf.
template: src=telegraf.conf dest=/var/homelabos/telegraf/telegraf.conf
- name: Configure Traefik.
template: src=traefik.toml dest=/var/homelabos/traefik/traefik.toml
- name: Configure HomelabOS Documentation
template: src=mkdocs.yml dest=/var/homelabos/docs/mkdocs.yml
- name: Configure HomelabOS Documentation
template:
src: '{{ item.src }}'
dest: /var/homelabos/docs/docs/{{ item.path }}
force: yes
with_filetree: docs/
when: item.state == 'file'
- name: Configure HomelabOS systemd service.
template: src=homelabos.service dest=/etc/systemd/system/homelabos.service
- name: Copy HomelabOS docker-compose.yml file into place.
template:
src: docker-compose.yml
......@@ -22,18 +44,12 @@
- name: Pull latest HomelabOS service docker images.
command: docker-compose -f /var/homelabos/docker/docker-compose.yml pull
- name: Configure Telegraf.
copy: src=telegraf.conf dest=/var/homelabos/telegraf/telegraf.conf
- name: Configure Traefik.
copy: src=traefik.toml dest=/var/homelabos/traefik/traefik.toml
- name: Configure HomelabOS systemd service.
template: src=homelabos.service dest=/etc/systemd/system/homelabos.service
- name: Restart HomelabOS service.
systemd:
name: homelabos
enabled: yes
daemon-reload: yes
state: restarted
- debug:
msg: "HomelabOS Installed successfully! Go to http://docs.{{ domain }}/ to get started."
\ No newline at end of file
......@@ -15,10 +15,9 @@ services:
links:
- influxdb
labels:
# - "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.admin.frontend.rule=Host:home.home.busey.me"
- "traefik.admin.protocol=https"
- "traefik.admin.frontend.rule=Host:homeassistant.{{ domain }}"
- "traefik.admin.protocol=http"
- "traefik.admin.port=8123"
emby:
......@@ -27,6 +26,13 @@ services:
restart: always
volumes:
- /var/homelabos/emby:/config
ports:
- 8096:8096
labels:
- "traefik.enable=true"
- "traefik.admin.frontend.rule=Host:emby.{{ domain }}"
- "traefik.admin.protocol=http"
- "traefik.admin.port=8096"
influxdb:
image: influxdb
......@@ -44,7 +50,10 @@ services:
ports:
- 8888:8888
labels:
- "traefik.frontend.rule=PathPrefixStrip:/chronograf"
- "traefik.enable=true"
- "traefik.admin.frontend.rule=Host:chronograf.{{ domain }}"
- "traefik.admin.protocol=http"
- "traefik.admin.port=8888"
grafana:
image: grafana/grafana
......@@ -57,6 +66,11 @@ services:
- /var/homelabos/grafana:/var/lib/grafana
environment:
- GF_INSTALL_PLUGINS=grafana-clock-panel,natel-discrete-panel,petrslavotinek-carpetplot-panel,vonage-status-panel
labels:
- "traefik.enable=true"
- "traefik.admin.frontend.rule=Host:grafana.{{ domain }}"
- "traefik.admin.protocol=http"
- "traefik.admin.port=3000"
telegraf:
image: telegraf
......@@ -73,7 +87,10 @@ services:
command: --api --docker # Enables the web UI and tells Træfik to listen to docker
ports:
- "80:80" # The HTTP port
- "443:443" # HTTPS
- "8080:8080" # The Web UI (enabled by --api)
labels:
- "traefik.frontend.rule=Host:{{ domain }}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/homelabos/traefik/traefik.toml:/etc/traefik/traefik.toml
......@@ -85,3 +102,15 @@ services:
labels:
- "traefik.frontend.rule=Host:whoami.docker.localhost"
- "traefik.frontend.rule=PathPrefixStrip:/test"
docs:
image: squidfunk/mkdocs-material
volumes:
- /var/homelabos/docs:/docs
ports:
- 8000:8000
labels:
- "traefik.enable=true"
- "traefik.admin.frontend.rule=Host:docs.{{ domain }}"
- "traefik.admin.protocol=http"
- "traefik.admin.port=8000"
\ No newline at end of file
......@@ -73,7 +73,7 @@
logfile = ""
## Override default hostname, if empty use os.Hostname()
hostname = ""
hostname = "{{ domain }}"
## If set to true, do no set the "host" tag in the telegraf agent.
omit_hostname = false
......@@ -297,10 +297,8 @@ urls = ["http://influxdb:8086"]
# # %d - day of month (e.g., 01)
# # %H - hour (00..23)
# # %V - week of the year (ISO week) (01..53)
# ## Additionally, you can specify a tag name using the notation {{tag_name}}
# ## which will be used as part of the index name. If the tag does not exist,
# ## the default tag value will be used.
# # index_name = "telegraf-{{host}}-%Y.%m.%d"
# # default_tag_value = "none"
# index_name = "telegraf-%Y.%m.%d" # required.
#
......
debug = false
logLevel = "ERROR"
defaultEntryPoints = ["https","http"]
defaultEntryPoints = ["http"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
# [entryPoints.http.redirect]
# entryPoint = "https"
# [entryPoints.https]
# address = ":443"
# [entryPoints.https.tls]
[retry]
......@@ -20,10 +20,10 @@ domain = "{{domain}}"
watch = true
exposedByDefault = false
[acme]
email = "nickabusey@gmail.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"
\ No newline at end of file
# [acme]
# email = "nickabusey@gmail.com"
# storage = "acme.json"
# entryPoint = "https"
# onHostRule = true
# [acme.httpChallenge]
# entryPoint = "http"
\ No newline at end of file
site_name: HomelabOS
theme:
name: 'material'
pages:
- Home: index.md
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment