Merge branch 'main' into dev
This commit is contained in:
commit
4874994543
|
|
@ -24,6 +24,4 @@ jobs:
|
|||
sudo apt update -y
|
||||
sudo apt install make -y
|
||||
cd danix
|
||||
sudo make install
|
||||
sudo make aliases
|
||||
sudo danix
|
||||
|
||||
|
|
|
|||
47
README.md
47
README.md
|
|
@ -3,13 +3,13 @@
|
|||
</html>
|
||||
|
||||
* Author: Vinicius F. da Silva
|
||||
* Version 0.1
|
||||
* Version 0.1.4
|
||||
* Released: 2023
|
||||
|
||||
A very simple subsystem builder!
|
||||
|
||||
The Danixfs is a root filesystem management! Build a Alpine subsystem and pre install
|
||||
essentials packages and compiers from languanges choice by user:
|
||||
essentials packages and compilers from languages choice by user:
|
||||
# Image:
|
||||
|
||||
#### Building a clike environment
|
||||
|
|
@ -31,13 +31,19 @@ essentials packages and compiers from languanges choice by user:
|
|||
* tar 1.34 or higher
|
||||
* python3 or higher
|
||||
* pip3 or higher
|
||||
# Run Danix
|
||||
* python-is-python3
|
||||
# Install Danix
|
||||
|
||||
```shell
|
||||
$ sudo make config
|
||||
$ cd danixfs
|
||||
```
|
||||
|
||||
To clean configuracion run:
|
||||
|
||||
```shell
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
To clean configuration run:
|
||||
|
||||
```shell
|
||||
$ sudo make clean
|
||||
|
|
@ -49,12 +55,17 @@ $ danix -h
|
|||
|
||||

|
||||
|
||||
# Remove Danix
|
||||
|
||||
To remove danix run:
|
||||
```shell
|
||||
$ sudo danixclean
|
||||
```
|
||||
# Common erros
|
||||
|
||||

|
||||
|
||||
To fix this erro open file *registry.py* located in /usr/local/lib/python3.10/dist-packages/django/apps/
|
||||
To fix this problem open file *registry.py*
|
||||
|
||||
Search for
|
||||
|
||||
|
|
@ -62,10 +73,30 @@ Search for
|
|||
raise RuntimeError("populate() isn't reentrant")"
|
||||
```
|
||||
|
||||
line. And replace for following code:
|
||||
line. And replace by following code:
|
||||
|
||||
```python
|
||||
self.app_configs = {}
|
||||
```
|
||||
|
||||
Save file and try again
|
||||
Save file and run
|
||||
|
||||
|
||||
```shell
|
||||
$ sudo make clean
|
||||
```
|
||||
|
||||
|
||||
```shell
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
```shell
|
||||
$ sudo make aliases
|
||||
```
|
||||
|
||||
Close terminal, open again and run
|
||||
|
||||
```shell
|
||||
$ danix --help
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import os, settings, app
|
||||
from sh import du
|
||||
from settings import MAIN_REPO
|
||||
from utils import download_checksum, validate_checksum
|
||||
from utils import get_message, check_equal_sentence as equals, generate_checksum, remove_checksum_files
|
||||
class Danix():
|
||||
|
||||
@staticmethod
|
||||
|
|
@ -69,6 +71,18 @@ class Danix():
|
|||
|
||||
os.system(f"mkdir /tmp/{filesystem}")
|
||||
os.system(f"curl --silent -LO --output-dir /tmp/{filesystem} {settings.REPO_NAME}/{settings.ROOT_FS}")
|
||||
|
||||
resp_downloaded_checksum = download_checksum()
|
||||
resp_generateed_checksum = generate_checksum(f"/tmp/{filesystem}/{settings.ROOT_FS}")
|
||||
|
||||
is_downloaded_and_generate = equals(resp_downloaded_checksum, 0) and equals(resp_generateed_checksum, 0)
|
||||
|
||||
is_valid_checksum = validate_checksum(filesystem)
|
||||
|
||||
remove_checksum_files()
|
||||
|
||||
if is_downloaded_and_generate and is_valid_checksum:
|
||||
|
||||
os.system(f"tar -xf /tmp/{filesystem}/{settings.ROOT_FS} -C /tmp/{filesystem}")
|
||||
os.system(f"rm /tmp/{filesystem}/{settings.ROOT_FS}")
|
||||
os.system(f"mv /tmp/{filesystem} {MAIN_REPO}")
|
||||
|
|
@ -95,3 +109,5 @@ class Danix():
|
|||
print("0 erros reported!")
|
||||
|
||||
Danix.navigate(filesystem)
|
||||
else:
|
||||
get_message("🔴 Failed integrity base image verification!", True, 1)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ else
|
|||
|
||||
@$(PYTHON) $(DANIX_PATH)/manage.py migrate
|
||||
|
||||
@echo "Installation successfully!!! Please 'make aliases without sudo'"
|
||||
@echo "Installation successfully!!! Please 'make aliases without' sudo"
|
||||
|
||||
endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,33 @@
|
|||
import os
|
||||
from settings import MAIN_REPO, MAIN_DIR, BASE_DIR
|
||||
import sh
|
||||
from settings import MAIN_REPO, MAIN_DIR, BASE_DIR, REPO_NAME
|
||||
|
||||
|
||||
def download_checksum():
|
||||
|
||||
return os.system(f"curl --silent -LO --output-dir /tmp/ {REPO_NAME}danixfs.checksum")
|
||||
|
||||
|
||||
def generate_checksum(package_path):
|
||||
os.system("touch /tmp/local_danixfs.checksum")
|
||||
return os.system(f"sha256sum {package_path} >> /tmp/local_danixfs.checksum")
|
||||
|
||||
|
||||
def remove_checksum_files():
|
||||
os.system("rm /tmp/danixfs.checksum >/dev/null 2>&1")
|
||||
os.system("rm /tmp/local_danixfs.checksum >/dev/null 2>&1")
|
||||
|
||||
def read_line(file_path):
|
||||
file = open(file_path, 'r')
|
||||
checksum = file.readlines()
|
||||
return checksum
|
||||
|
||||
def validate_checksum(filesystem):
|
||||
|
||||
remote_checksum = ''.join(read_line(f"/tmp/danixfs.checksum")).replace(f"/tmp/{filesystem}/", "")
|
||||
local_checksum = ''.join(read_line(f"/tmp/local_danixfs.checksum")).replace(f"/tmp/{filesystem}/", "")
|
||||
|
||||
return True if local_checksum == remote_checksum else False
|
||||
|
||||
def separate(path):
|
||||
list_path = path.split(" ")
|
||||
|
|
@ -91,6 +119,7 @@ def print_environment_list_header():
|
|||
|
||||
@staticmethod
|
||||
def check_equal_sentence(left_expression, right_expression):
|
||||
|
||||
return left_expression == right_expression
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
BIN
danixfs.tar.gz
BIN
danixfs.tar.gz
Binary file not shown.
Loading…
Reference in New Issue