Git Product home page Git Product logo

docker-homelab-manager's Introduction

docker homelab manager

Poetry Code style: black Imports: isort CI

A simple web app to manage homelab docker services. I wrote this as portainer, Which i was using for managing my services on my homelab, Didn't have docker volume management i.e backup and restore and all the other docker volume backup and restore tools were too complicated for my needs.

Right now only supports volume backup and restore but I plan to add docker compose support and other features in the future.

dev setup

requirements

setup

setup the project with poetry

# install dependencies
poetry install

create a .env file in the root of the project with the following content

# local directory to store backups
BACKUP_DIR=/path/to/repo/backup
# local directory to store the databases
DB_DIR=/path/to/repo/db
# the sqlalchemy url for the main database file
DATABASE_URL=sqlite:////path/to/repo//db/database.db
# the sqlalchemy url for the apschedule job store
APSCHEDULE_JOBSTORE_URL=sqlite:////path/to/repo/db/schedule.db

running the app locally

(Recommended way) This will start the app in a docker container with hot reloading and run a database migration on startup

# run the app
poe dev

you can also run it locally without docker, Which will run the same commands

# run the app
poe local-dev

Note: If you try to run the app locally with docker then using the same files for the database and backup directories as the container will cause permission issues. You will need to change the permissions of the files to allow the container to access them.

running tests

# run tests
poe test

formatting and linting

To run black and isort on codebase:

# format the code
poe format

To run linting:

# lint the code
poe lint

database migrations

To make it easy there is some poe tasks to run the migrations:

Run migrationthe

# run the migrations
poe migrate

Create a new migration revision

# create a new migration revision
poe revision "<revision message here>"

Rollback the last migration

# rollback the last migration
poe downgrade

To find out all options for tasks run poe --help

running the app in production

there is a example docker-compose file in the root of the project that you can use to run the app in production

database structure

See database.md for a diagram and explanation of the database structure

License

Copyright © 2023, Bob Bruce

This project is licensed under the GNU GPL v3+.

In short, this means you can do anything with it (distribute, modify, sell) but if you were to publish your changes, you must make the source code and build instructions readily available.

If you are a company using this project and want an exception, email me at [email protected] and we can discuss.

docker-homelab-manager's People

Contributors

mrllama123 avatar dependabot[bot] avatar

Watchers

 avatar  avatar

docker-homelab-manager's Issues

fix cyclic foreign key refrences

when trying to do a new migration revision got this error:
image

looking at the tables they are probably overkill anyways i.e if we want to get all backup volume names we could just use GROUP BY sql statement

intergation tests

The main flows would be:

  • create backup
  • create schedule backup
  • create restore
  • list & get backups

link celery task ids to backup item in db

link a backup volume celery task with the backup item in db. Maybe as a separate table with the Foreign key
being the task id?

also would be worth to see if we can link the celery state to the database as celery does have a sqlalchemy plugin library. Then it would make it easy to link tasks with backups

ci refinement

  • add some ci to publish a docker image on release
  • ???

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.