Skip to content

Commit

Permalink
Merge branch 'davestephens:main' into netdata
Browse files Browse the repository at this point in the history
  • Loading branch information
khartahk authored Feb 10, 2024
2 parents b3ac8d7 + 49e292e commit 56e7ac1
Show file tree
Hide file tree
Showing 131 changed files with 8,250 additions and 14,705 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If this is your first PR against Ansible-NAS, please read our contributor guidelines - https://github.com/davestephens/ansible-nas/blob/master/CONTRIBUTING.md.
1. If this is your first PR against Ansible-NAS, please read our contributor guidelines - https://github.com/davestephens/ansible-nas/blob/main/CONTRIBUTING.md.
2. Ensure you have tested new functionality using tests/test-vagrant.sh.
3. If the PR is unfinished, add `WIP:` at the beginning of the title or use the Github Draft PR feature.
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -18,10 +18,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python 3
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.x"

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ name: Deploy to GitHub Pages
on:
push:
branches:
- master
- main

jobs:
lint:
name: Lint Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Lint docs
uses: articulate/actions-markdownlint@v1
with:
Expand All @@ -24,9 +24,9 @@ jobs:
run:
working-directory: website
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ name: Test Website Deployment
on:
pull_request:
branches:
- master
- main

jobs:
lint:
name: Lint Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Lint docs
uses: articulate/actions-markdownlint@v1
with:
Expand All @@ -24,8 +24,8 @@ jobs:
run:
working-directory: website
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Generate Test Matrix
id: set-matrix
shell: bash
Expand All @@ -29,7 +29,7 @@ jobs:
matrix:
role: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Molecule Test
uses: gofrolist/molecule-action@dfbfd1af6a77523c8a937a1532f92808065a00a4
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ inventories
roles/bertvv.samba
roles/geerlingguy.docker
roles/geerlingguy.nfs
website/.docusaurus
website/node_modules

# Vim
[._]sw[a-p]
Expand Down
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"recommendations": [
"redhat.ansible",
"redhat.vscode-yaml",
"ybaumes.highlight-trailing-white-spaces",
"bungcip.better-toml"
"tamasfe.even-better-toml",
"ybaumes.highlight-trailing-white-spaces"
]
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributing to Ansible-NAS is easy! Add your functionality, then raise a pull r

## Development Environment

* Development of Ansible-NAS is carried out in [Visual Studio Code](https://code.visualstudio.com/) on Linux - you'll get some nice recommended extensions and task setups if you do the same.
* Development of Ansible-NAS is carried out in [JetBrains PyCharm](https://www.jetbrains.com/?from=Ansible-NAS) on Linux - you'll get some nice recommended extensions and task setups if you do the same.
* You'll need a working Python 3 environment, Docker (to run tests) and [pre-commit](https://pre-commit.com) installed - `pip install -r requirements-dev.txt`.

## General Stuff
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2022 David Stephens
Copyright (c) 2017-2023 David Stephens

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![CI](https://github.com/davestephens/ansible-nas/workflows/CI/badge.svg)](https://github.com/davestephens/ansible-nas/actions?query=workflow%3ACI)
[![Integration](https://github.com/davestephens/ansible-nas/workflows/Integration/badge.svg)](https://github.com/davestephens/ansible-nas/actions?query=workflow%3AIntegration)
[![Gitter chat](https://img.shields.io/gitter/room/ansible-nas/chat.svg?logo=gitter&style=flat-square)](https://gitter.im/Ansible-NAS/Chat)
[![license](https://img.shields.io/github/license/DAVFoundation/api_doc.svg?style=flat-square)](https://github.com/davestephens/ansible-nas/blob/master/LICENSE)
[![license](https://img.shields.io/github/license/DAVFoundation/api_doc.svg?style=flat-square)](https://github.com/davestephens/ansible-nas/blob/main/LICENSE)
[![Ko-fi](https://img.shields.io/static/v1.svg?label=ko-fi&message=Buy%20Me%20A%20Coffee&color=orange&style=flat-square&logo=buy-me-a-coffee)](https://ko-fi.com/davestephens)

After getting burned by broken FreeNAS updates one too many times, I figured I could do a much better job myself using just a stock Ubuntu install, some clever Ansible config and a bunch of Docker containers.
Expand Down Expand Up @@ -96,6 +96,7 @@ If you have a spare domain name you can configure applications to be accessible
* [Syncthing](https://syncthing.net/) - sync directories with another device
* [Tautulli](http://tautulli.com/) - Monitor Your Plex Media Server
* [The Lounge](https://thelounge.chat) - Web based always-on IRC client
* [Threadfin](https://github.com/Threadfin/Threadfin) - M3U Proxy for Plex DVR and Emby/Jellyfin Live TV. Based on xTeVe.
* [TiddlyWiki](https://tiddlywiki.com) - A unique non-linear notebook/wiki for capturing, organizing, and sharing complex information
* [TimeMachine](https://github.com/awlx/samba-timemachine) - Samba-based mac backup server
* [Traefik](https://traefik.io/) - Web proxy and SSL certificate manager
Expand Down
5 changes: 4 additions & 1 deletion group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ documents_root: "{{ samba_shares_root }}/documents"
# Where personal repos and code are stored
code_root: "{{ samba_shares_root }}/code"

# Where roms are stored
roms_root: "{{ samba_shares_root }}/roms"

# The description that'll appear next to your Ansible-NAS box when browsing your network
samba_server_string: Ansible NAS

Expand Down Expand Up @@ -198,7 +201,7 @@ nfs_exports:
# Seems to break browsing of the \\server-name shares root when enabled
samba_mitigate_cve_2017_7494: false

# Enable apple exentensions for compatibility with apple clients
# Enable apple extensions for compatibility with apple clients
samba_apple_extensions: yes

# The account used when Samba shares are accessed. Shouldn't need to change this unless you want to
Expand Down
2 changes: 1 addition & 1 deletion inventories/sample/group_vars/nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ ansible_nas_hostname: ansible-nas
ansible_nas_timezone: Etc/UTC

## Enable some applications
heimdall_enabled: true
dashy_enabled: true
portainer_enabled: true
32 changes: 0 additions & 32 deletions mkdocs.yml

This file was deleted.

4 changes: 4 additions & 0 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@
tags:
- thelounge

- role: threadfin
tags:
- threadfin

- role: tiddlywiki
tags:
- tiddlywiki
Expand Down
2 changes: 0 additions & 2 deletions roles/ansible-nas-general/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
register: result
until: result is succeeded

# - name: Configure smartmontools

- name: "Set hostname to {{ ansible_nas_hostname }}"
ansible.builtin.hostname:
name: "{{ ansible_nas_hostname }}"
Expand Down
5 changes: 4 additions & 1 deletion roles/dashy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
dashy_enabled: false
dashy_available_externally: false

# directories
dashy_data_directory: "{{ docker_home }}/dashy"

# network
dashy_port: "8082"
dashy_hostname: "dashy"

# specs
dashy_memory: 2g
dashy_memory: 1g

# docker
dashy_container_name: dashy
46 changes: 46 additions & 0 deletions roles/dashy/files/conf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# Page meta info, like heading, footer text and nav links
pageInfo:
title: Dashy
description: Welcome to your new Ansible-NAS dashboard!
navLinks:
- title: Ansible-NAS
path: https://ansible-nas.io
- title: Documentation
path: https://dashy.to/docs

# Optional app settings and configuration
appConfig:
theme: colorful

# Main content - An array of sections, each containing an array of items
sections:
- name: Getting Started
icon: fas fa-rocket
items:
- title: Dashy Live
description: Development a project management links for Dashy
icon: https://i.ibb.co/qWWpD0v/astro-dab-128.png
url: https://live.dashy.to/
target: newtab
- title: GitHub
description: Source Code, Issues and Pull Requests
url: https://github.com/lissy93/dashy
icon: favicon
- title: Docs
description: Configuring & Usage Documentation
provider: Dashy.to
icon: far fa-book
url: https://dashy.to/docs
- title: Showcase
description: See how others are using Dashy
url: https://github.com/Lissy93/dashy/blob/master/docs/showcase.md
icon: far fa-grin-hearts
- title: Config Guide
description: See full list of configuration options
url: https://github.com/Lissy93/dashy/blob/master/docs/configuring.md
icon: fas fa-wrench
- title: Support
description: Get help with Dashy, raise a bug, or get in contact
url: https://github.com/Lissy93/dashy/blob/master/.github/SUPPORT.md
icon: far fa-hands-helping
15 changes: 15 additions & 0 deletions roles/dashy/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
---
- name: Start Dashy
block:
- name: Create Dashy Directory
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ dashy_data_directory }}"

- name: Copy base config
ansible.builtin.copy:
src: conf.yml
dest: "{{ dashy_data_directory }}/conf.yml"
force: no

- name: Dashy Docker Container
community.docker.docker_container:
name: "{{ dashy_container_name }}"
Expand All @@ -10,6 +23,8 @@
- "{{ dashy_port }}:80"
restart_policy: unless-stopped
memory: "{{ dashy_memory }}"
volumes:
- "{{ dashy_data_directory }}/conf.yml:/app/public/conf.yml:rw"
labels:
traefik.enable: "{{ dashy_available_externally | string }}"
traefik.http.routers.dashy.rule: "Host(`{{ dashy_hostname }}.{{ ansible_nas_domain }}`)"
Expand Down
2 changes: 1 addition & 1 deletion roles/deluge/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
pull: true
volumes:
- "{{ deluge_config_directory }}:/config:rw"
- "{{ deluge_download_directory }}:/root/Downloads:rw"
- "{{ deluge_download_directory }}:/downloads:rw"
ports:
- "{{ deluge_port }}:8112"
env:
Expand Down
16 changes: 4 additions & 12 deletions roles/gitea/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,11 @@
- "{{ gitea_data_directory }}/gitea"
- "{{ gitea_data_directory }}/mysql"

- name: Create gitea network
community.docker.docker_network:
name: "{{ gitea_network_name }}"

- name: Create MySQL container for Gitea
community.docker.docker_container:
name: "{{ gitea_mysql_container_name }}"
image: "{{ gitea_mysql_image_name }}:{{ gitea_mysql_image_version }}"
pull: true
networks:
- name: "{{ gitea_network_name }}"
network_mode: "{{ gitea_network_name }}"
volumes:
- "{{ gitea_data_directory }}/mysql:/var/lib/mysql:rw"
env:
Expand All @@ -37,23 +30,22 @@
name: "{{ gitea_container_name }}"
image: "{{ gitea_image_name }}:{{ gitea_image_version }}"
pull: true
networks:
- name: "{{ gitea_network_name }}"
network_mode: "{{ gitea_network_name }}"
volumes:
- "{{ gitea_data_directory }}/gitea:/data:rw"
ports:
- "{{ gitea_port_http }}:3000"
- "{{ gitea_port_ssh }}:22"
links:
- gitea-mysql:db
env:
DB_TYPE: "mysql"
DB_HOST: "{{ gitea_mysql_container_name }}:3306"
DB_HOST: "db:3306"
DB_NAME: "gitea"
DB_USER: "gitea"
DB_PASSWD: "gitea"
RUN_MODE: "prod"
SSH_DOMAIN: "{{ ansible_nas_hostname }}"
SSH_PORT: "{{ gitea_port_ssh }}"
SSH_PORT: "22"
ROOT_URL: "http://{{ gitea_hostname }}:{{ gitea_port_http }}/"
USER_UID: "1000"
USER_GID: "1000"
Expand Down
Loading

0 comments on commit 56e7ac1

Please sign in to comment.