Skip to main content

Core library for SVS (https://svs.kristn.co.uk/)

Project description

Self-Hosted Virtual Stack

SVS is an open-source python library for managing self-hosted services on a linux server.

PyPI version codecov pre-commit Release Please

CI:

Publish Python Package Test

Docs

For full docs, visit svs.kristn.co.uk

This readme contains a quick summary and development setup info.

Goals

The goal of this project is to simplify deploying and managing self-hosted applications on a linux server. Inspired by Portainer but aimed at begginer users. Under the hood, all applications are containerized using Docker. For ease of use, the library provides pre-configured service templates for popular self-hosted applications such as:

  • MySQL
  • PostgreSQL
  • Django
  • NGINX
  • ...

Technology overview

Every service will run a Docker container and all of users' services will be on the same Docker network, allowing them to communicate with each other easily without

  1. exposing them to other users on the same server
  2. having to use compose stacks and custom networks to allow cross-service communication.

Features

Currently, the library is in early development and has the following features:

  • User management
  • Docker network management
  • Service management
  • Service templates
  • CI/CD integration
  • DB/System sync issues + recovery
  • Remote SSH access

Running locally

Given this repository accesses system files, creates docker containers and manages services and is designed strictly for linux servers, it is recommended to run in a virtual environment.

The easiest way to achieve a reproducible environment is to use the included devcontainer configuration. Devcontainers allow you to run a containerized development environment with all dependencies installed. See the devcontainer documentation.

The local devcontainer config creates the following compose stack:

  1. A python devcontainer for the development environment.
  2. A postgres database container for storing service data.
  3. A caddy container to act as a HTTP proxy (needed only if testing domains locally)

This guide assumes you have chosen to use the devcontainer setup.

Starting the devcontainer

To start the devcontainer, open the repository in Visual Studio Code and select "Reopen in Container" from the command palette. This will build the container and start it.

After attaching to the devcontainer, the dependencies will be automatically installed. After that's done, you can launch a new terminal which will have the virtual environment activated automatically.

You also need to run the install-dev.sh script to configure your system for development. This script will create the required directories and configure permissions. It is a subset of the production install script.

After running the install script, switch to the svs-admins group by running

newgrp svs-admins

Linting + Formatting

The devcontainer includes pre-configured linting and formatting tools for Visual Studio Code and all files should be formatted on save. If you use a different editor, you can run the pre-commit hooks manually by running pre-commit run --all-files in the terminal to apply the formatting and linting rules.

Running the tests

To run the tests, you can use the pytest command in the terminal. This will run all tests in the tests directory. You can also run individual test files or functions by specifying their paths.

Tests are split into unit, integration and cli tests. They can be run separately by using the -m flag with pytest:

pytest -m unit
pytest -m integration
pytest -m cli

Running the docs

Python docstrings are used throughout the codebase to generate documentation. To generate the documentation, you can use the zensical command in the terminal. This will build the documentation and serve it locally. To run the documentation server, you can use the following command:

zensical serve

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

svs_core-0.14.3.tar.gz (65.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

svs_core-0.14.3-py3-none-any.whl (76.6 kB view details)

Uploaded Python 3

File details

Details for the file svs_core-0.14.3.tar.gz.

File metadata

  • Download URL: svs_core-0.14.3.tar.gz
  • Upload date:
  • Size: 65.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for svs_core-0.14.3.tar.gz
Algorithm Hash digest
SHA256 500d775fb2a108f9b04f8f49386a4b110010a904d277c81ac2fe495bcb711c2e
MD5 8880085a103fa287453be42f04ec53ab
BLAKE2b-256 c4aa1d0e378bb12f0b83a1137cdf82e8eab30d0b5595323bdf568b2a74689e64

See more details on using hashes here.

Provenance

The following attestation bundles were made for svs_core-0.14.3.tar.gz:

Publisher: publish.yml on kristiankunc/svs-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svs_core-0.14.3-py3-none-any.whl.

File metadata

  • Download URL: svs_core-0.14.3-py3-none-any.whl
  • Upload date:
  • Size: 76.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for svs_core-0.14.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a178325e36edfd2343e61b41a000b16b699ad61360d2b52484cf3076c2359bce
MD5 71e9b487c1407e1369b85bad44dc08ec
BLAKE2b-256 8de97b30ba540fae583d203f97f6b22fbbad6bb7c25284427c42ffb812989a7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for svs_core-0.14.3-py3-none-any.whl:

Publisher: publish.yml on kristiankunc/svs-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page