bacchus
Advanced tools
| import configparser | ||
| from .base import HomeServerApp | ||
| class LazyLibrarian(HomeServerApp): | ||
| @property | ||
| def config_file(self): | ||
| return self.path / 'config.ini' | ||
| def setup_nginx(self): | ||
| self.container.stop() | ||
| config = configparser.ConfigParser() | ||
| config.read(str(self.config_file)) | ||
| config.set('General', 'HTTP_ROOT', '/books') | ||
| with open(self.config_file, 'w') as fileo: | ||
| config.write(fileo) | ||
| self.compose.start() | ||
| def setup(self): | ||
| self.setup_nginx() | ||
| config = configparser.ConfigParser() | ||
| config.read(str(self.config_file)) | ||
| config.set('General', 'http_root', '/books') | ||
| config.set('General', 'ebook_dir', '/books') | ||
| config.set('General', 'download_dir', '/downloads') | ||
| with open(self.config_file, 'w') as fileo: | ||
| config.write(fileo) |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: bacchus | ||
| Version: 0.1.37 | ||
| Version: 1.0.0 | ||
| Summary: Home Server solution based on docker | ||
@@ -5,0 +5,0 @@ License: MIT |
+1
-1
| [tool.poetry] | ||
| name = "bacchus" | ||
| version = "0.1.37" | ||
| version = "1.0.0" | ||
| description = "Home Server solution based on docker" | ||
@@ -5,0 +5,0 @@ authors = ["David Francos <opensource@davidfrancos.net>"] |
+1
-1
@@ -25,3 +25,3 @@ # -*- coding: utf-8 -*- | ||
| 'name': 'bacchus', | ||
| 'version': '0.1.37', | ||
| 'version': '1.0.0', | ||
| 'description': 'Home Server solution based on docker', | ||
@@ -28,0 +28,0 @@ 'long_description': None, |
@@ -5,2 +5,3 @@ import docker | ||
| from bacchus.transmission import Transmission | ||
| from bacchus.lazylibrarian import LazyLibrarian | ||
| from bacchus.lidarr import Lidarr | ||
@@ -14,2 +15,3 @@ from bacchus.radarr import Radarr | ||
| from bacchus.jellyfin import Jellyfin | ||
| from bacchus.lazylibrarian import LazyLibrarian | ||
| from bacchus.certificates import CertManager | ||
@@ -19,3 +21,3 @@ | ||
| CertManager, Nginx, OpenVPN, NextCloud, Transmission, Jackett, Lidarr, | ||
| Radarr, Medusa, Jellyfin | ||
| LazyLibrarian, Radarr, Medusa, Jellyfin | ||
| ] | ||
@@ -22,0 +24,0 @@ |
+11
-10
@@ -7,22 +7,23 @@ from cleo import Command | ||
| class MainCommand(Command): | ||
| """Installs bacchus. | ||
| class GreetCommand(Command): | ||
| """ | ||
| Installs bacchus | ||
| install | ||
| {dns-domain? : Domain (FQDN) for virtualhosts} | ||
| {domain? : Domain (FQDN) for virtualhosts} | ||
| {username? : Nextcloud first user's username} | ||
| {password? : Nextcloud first user's password} | ||
| {dns-key? : DNS Provider (ghandi) API key} | ||
| {iface? : (Optional) Main network interface name} | ||
| {service? : (Optional) Set up only one service} | ||
| {dns? : DNS Provider (ghandi) API key} | ||
| {iface? : (Optional) Main interface name} | ||
| {provider? : (Optional) Set up only one service} | ||
| """ | ||
| def handle(self): | ||
| """Handle command""" | ||
| setup = HomeServerSetup(domain=self.argument('dns-domain'), | ||
| setup = HomeServerSetup(domain=self.argument('domain'), | ||
| nextcloud_username=self.argument('username'), | ||
| nextcloud_password=self.argument('password'), | ||
| iface=self.argument('iface'), | ||
| dns_api_key=self.argument('dns-key')) | ||
| dns_api_key=self.argument('dns')) | ||
| setup.configure(self.argument('service')) | ||
| setup.configure(self.argument('provider')) | ||
@@ -32,3 +33,3 @@ | ||
| application = Application() | ||
| application.add(MainCommand()) | ||
| application.add(GreetCommand()) | ||
| application.run() |
@@ -16,3 +16,3 @@ from pathlib import Path | ||
| def env(self): | ||
| return {**os.environ, 'COMPOSE_PROJECT_NAME': self.meta['project_name']} | ||
| return {'COMPOSE_PROJECT_NAME': self.meta['project_name']} | ||
@@ -19,0 +19,0 @@ def create_env_files(self): |
@@ -12,3 +12,2 @@ import netifaces as ni | ||
| self.setup_dns() | ||
| self.fix_dns_config_pihole() | ||
| try: | ||
@@ -30,6 +29,11 @@ self.logger.debug( | ||
| self.meta['nextcloud_username']) | ||
| Path('vpn_client.config').write_bytes(response) | ||
| (self.path / '..' / 'openvpn_client.conf').write_bytes(response) | ||
| except Exception as err: | ||
| self.logger.exception('could not create openvpn config') | ||
| try: | ||
| self.fix_dns_config_pihole() | ||
| except Exception as err: | ||
| self.logger.exception('cant_dns_pihole') | ||
| def fix_dns_config_pihole(self): | ||
@@ -40,4 +44,3 @@ server_config = [ | ||
| ] + ['push "dhcp-option DNS 127.0.0.1"'] | ||
| # TODO: Fix permissions issues | ||
| # (self.path / 'openvpn.conf').write_text('\n'.join(server_config)) | ||
| (self.path / 'openvpn.conf').write_text('\n'.join(server_config)) | ||
@@ -59,3 +62,3 @@ def run(self, *cmd): | ||
| default_iface = next(a for a in ni.interfaces() if any( | ||
| a.startswith(b) for b in ('eth', 'en'))) | ||
| a.startswith(b) for b in ('eth', 'enp'))) | ||
| iface = self.meta.get('iface') or default_iface | ||
@@ -62,0 +65,0 @@ private_ip = ni.ifaddresses(iface)[ni.AF_INET][0]['addr'] |
@@ -13,2 +13,4 @@ version: '3' | ||
| - 8096:8096 | ||
| devices: | ||
| - /dev/dri:/dev/dri | ||
| networks: | ||
@@ -142,2 +144,11 @@ - common | ||
| - onlyoffice-document-server | ||
| - pihole | ||
| - transmission | ||
| - lidarr | ||
| - jellyfin | ||
| - radarr | ||
| - nextcloud | ||
| - medusa | ||
| - lazylibrarian | ||
| - jackett | ||
| image: nginx | ||
@@ -190,2 +201,4 @@ restart: always | ||
| - NET_ADMIN | ||
| networks: | ||
| - common | ||
| restart: unless-stopped | ||
@@ -192,0 +205,0 @@ |
Sorry, the diff of this file is not supported yet
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
56230
2.29%34
3.03%1110
2.59%