2019-06-10 20:59:46 +02:00
|
|
|
# network_inventory
|
|
|
|
|
2020-01-07 18:16:29 +01:00
|
|
|
[![Build Status](https://travis-ci.com/Nebucatnetzer/network_inventory.svg?branch=master)](https://travis-ci.com/Nebucatnetzer/network_inventory)
|
|
|
|
|
2019-06-10 20:59:46 +02:00
|
|
|
I started this project in order to have solution for keeping an
|
|
|
|
inventory over my various servers and other network equipment.
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
1. Clone the repository
|
2019-07-13 15:25:32 +02:00
|
|
|
2. Now decide if you want to develop fully locally or inside the docker
|
|
|
|
container. Locally you'll use SQlite for the database and inside the Docker
|
|
|
|
container you'll use Postgres for the database. For the moment there aren't
|
|
|
|
any features implemented which require Postgres. However this might change
|
|
|
|
in the future and SQlite is not supported for production.
|
2020-02-15 15:25:54 +01:00
|
|
|
3. Copy the `.env-example` file to `.env` and change the `POSTGRES_PASSWORD`
|
|
|
|
and `DJANGO_SECRET_KEY` variables to something secure.
|
2019-07-13 15:25:32 +02:00
|
|
|
|
|
|
|
### Local Setup
|
2020-02-15 15:25:54 +01:00
|
|
|
4. Run `make local` to create the virtual environment for development.
|
2019-08-28 21:32:16 +02:00
|
|
|
You're now all set to start developing.
|
2019-06-10 20:59:46 +02:00
|
|
|
|
2019-07-13 15:25:32 +02:00
|
|
|
### Docker Setup
|
2020-02-15 15:25:54 +01:00
|
|
|
4. Run `make` to start the development server. You can access it
|
2019-07-13 15:25:32 +02:00
|
|
|
at http://localhost:8000 . You're now all set to start developing. \
|
|
|
|
If you need to run migrations you can simply restart the Docker container.
|
2019-06-10 20:59:46 +02:00
|
|
|
|
2019-08-28 21:32:16 +02:00
|
|
|
#### 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`.
|
|
|
|
|
2019-06-10 20:59:46 +02:00
|
|
|
## Todos
|
2019-08-30 23:21:13 +02:00
|
|
|
- [ ] Create an Nginx configuration
|
2019-06-10 20:59:46 +02:00
|
|
|
- [ ] extend the CSS
|
|
|
|
- A more centered layout would be nice
|
|
|
|
- Maybe some colours
|
|
|
|
- [ ] include a RAID calculator
|
|
|
|
- <https://thoughtworksnc.com/2017/08/30/writing-a-raid-calculator-in-python/>
|
|
|
|
I would like to use this to show the usable space in a RAID system.
|
|
|
|
- [ ] calculate the used space on a host
|
|
|
|
Means calculate the size all the VMs would use if they were thick.
|