toolshed/README.md

90 lines
1.8 KiB
Markdown
Raw Normal View History

2023-03-08 08:25:51 +00:00
# toolshed
2023-10-23 15:08:26 +00:00
## Development
2023-03-08 08:25:51 +00:00
``` bash
git clone https://github.com/gr4yj3d1/toolshed.git
2023-06-11 08:46:11 +00:00
```
2023-10-23 13:37:20 +00:00
2023-06-11 08:46:11 +00:00
or
2023-10-23 13:37:20 +00:00
2023-06-11 08:46:11 +00:00
``` bash
git clone https://git.neulandlabor.de/j3d1/toolshed.git
```
2023-10-23 15:08:26 +00:00
all following development mode commands support auto-reloading and hot-reloading where applicable, they do not need to bw
restarted after changes.
### Backend only
2023-06-11 08:46:11 +00:00
``` bash
2023-03-08 08:25:51 +00:00
cd toolshed/backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
2023-06-11 08:46:11 +00:00
python configure.py
2023-06-22 02:08:52 +00:00
python manage.py runserver 0.0.0.0:8000 --insecure
2023-06-11 08:46:11 +00:00
```
2023-10-23 13:37:20 +00:00
to run this in properly in production, you need to configure a webserver to serve the static files and proxy the
requests to the backend, then run the backend with just `python manage.py runserver` without the `--insecure` flag.
2023-06-11 08:46:11 +00:00
2023-10-23 15:08:26 +00:00
### Frontend only
2023-06-11 08:46:11 +00:00
``` bash
cd toolshed/frontend
npm install
npm run dev
```
2023-10-23 15:08:26 +00:00
### Docs only
2023-06-11 08:46:11 +00:00
``` bash
cd toolshed/docs
mkdocs serve
2023-03-08 08:25:51 +00:00
```
2023-06-11 08:46:11 +00:00
2023-10-23 15:08:26 +00:00
### Full stack
``` bash
cd toolshed
docker-compose -f deploy/docker-compose.override.yml up --build
```
## Deployment
### Requirements
- python3
- python3-pip
- python3-venv
- wget
- unzip
- nginx
- uwsgi
### Installation
* Get the latest release from
`https://git.neulandlabor.de/j3d1/toolshed/releases/download/<version>/toolshed.zip` or
`https://github.com/gr4yj3d1/toolshed/archive/refs/tags/<version>.zip`.
* Unpack it to `/var/www` or wherever you want to install toolshed.
* Create a virtual environment and install the requirements.
* Then run the configuration script.
* Configure your webserver to serve the static files and proxy the requests to the backend.
* Configure your webserver to run the backend with uwsgi.
for detailed instructions see [docs](/docs/deployment.md).
2023-06-11 08:46:11 +00:00
## CLI Client
### Requirements
- python3
- python3-nacl
### Usage Example
``` bash
cli-client/toolshed-client.py --key <hex private key> --user name@example.com --host 1.2.3.4:8000 getinventory
```