Remove unused package |
3 months ago | |
---|---|---|
.github | 3 months ago | |
.vscode | 1 year ago | |
docs | 12 months ago | |
nginx | 3 years ago | |
src | 3 months ago | |
.coveragerc | 3 years ago | |
.dir-locals.el | 4 months ago | |
.env-example | 1 year ago | |
.envrc | 1 year ago | |
.flake8 | 4 months ago | |
.gitignore | 3 months ago | |
.gitlab-ci.yml | 3 years ago | |
LICENSE | 5 years ago | |
README.md | 3 months ago | |
dev.sh | 3 months ago | |
docker-compose-development.yml | 1 year ago | |
docker-compose.yml | 3 months ago | |
flake.lock | 4 months ago | |
flake.nix | 3 months ago | |
poetry.lock | 3 months ago | |
poetry.toml | 4 months ago | |
pyproject.toml | 3 months ago | |
pytest.ini | 12 months ago |
README.md
network_inventory
I started this project in order to have solution for keeping an inventory over my various servers and other network equipment.
Production Setup
- Clone the repository
- Copy the
.env-example
file to.env
and change thePOSTGRES_PASSWORD
andDJANGO_SECRET_KEY
variables to something secure. - Run
docker-compose up
and connect to http://localhost
Development Setup
There are two ways to work on this project.
For the first one you will need to install the Nix package manager1.
Afterwards you can enter the development environment with nix develop
.
For the other way you have to install poetry2 and then run poetry shell
to
enter the virtual environment.
Please note that I will only use and test the first method.
After you've entered the development environment with either method you can
start the server. With the nix version you can start it with dev run
. With
poetry ./dev.sh run
. This will start a PostgreSQL database running inside a
docker container and start the Django development server. You can then access
it in the browser under the FQDN of your computer. E.g. mypc.domain.local
.
Run the dev
command without an argument to see all options.
Environment Variables
To customise the application in the Docker container you can use environment variables in the docker-compose.yml file. Currently the following variables are supported.
- DJANGO_SECRET_KEY the secret key is mandatory, otherwise the application doesn't run. Make sure that it is some long random string.
- DJANGO_DEBUG settings this variable to any value enables the Django debug mode. Make sure that you don't set it on a production server.
- DJANGO_SETTINGS_MODULE the path to the settings file to use in the
container. This requires a dotet syntax. The default is
network_inventory.settings.docker
.
Documentation
Currently there isn't a lot of documentation present. I try to document my thoughts and other related information in the Notes file.