Go to file
buttle 825dc4bf45 removes hidden files from directory listing 2021-06-19 08:21:42 +02:00
objects adds example PLY model 2021-06-13 14:35:17 +02:00
static passes vue js data to component 2021-06-13 15:34:16 +02:00
utils removes hidden files from directory listing 2021-06-19 08:21:42 +02:00
views updates readme 2021-06-19 08:14:50 +02:00
.gitignore first commit 2021-06-05 18:59:19 +02:00
LICENSE first commit 2021-06-05 18:59:19 +02:00
README.md updates readme 2021-06-19 08:14:50 +02:00
app.py updates readme 2021-06-18 20:27:33 +02:00
run.sh first commit 2021-06-05 18:59:19 +02:00

README.md

3D tester

An utility to test 3D models

Install on your PC

First make sure you have python3 installed

Then..

git clone git@git.hangar.org:21036/arcHIVE-tech/3D-tester.git
cd 3D-tester
python3 -m venv ./venv
source ./venv/bin/activate
pip install bottle
chmod +x run.sh

Usage

cd 3D-tester
./run.sh

Now you can browse to http://localhost:8080

Adding 3D models

Add your 3D models to the ./objects folder. Create subdirectories as needed.

Install on a server

git clone https://git.hangar.org/arcHIVE-tech/3D-tester.git /opt/3Dtester
cd 3D-tester
python3 -m venv ./venv
source ./venv/bin/activate
pip install bottle
pip install gunicorn

Gunicorn

Gunicorn will server the python app

Create and edit the file ./3Dtester/gunicorn.py

pythonpath = '/opt/3Dtester'
command = './venv/bin/gunicorn'
bind = '127.0.0.1:8080'
workers = 3
user = 'www-data'

You can test the installation

gunicorn -c ./gunicorn.py app:app

Supervisor

We need something to keep Gunicorn going on system reboots, start, stop, etc.

Instead of systemd ...

apt-get install supervisor

Edit /etc/supervisor/conf.d/3Dtester.conf

[program:3Dtester]
command = /opt/3Dtester/venv/bin/gunicorn -c /opt/3Dtester/gunicorn.py app:app
directory = /opt/3Dtester
user = www-data

Restart supervisor

systemctl restart supervisor

Now you can do things like

supervisorctl status 3Dtester
supervisorctl stop 3Dtester
supervisorctl start 3Dtester
netstat -tunpla | grep 8080

apache2

<VirtualHost *:80>
    ServerName my.domain.com
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
</VirtualHost>

Updating

cd 3D-tester
git pull origin main

nextcloud

We upload the 3D models to our nextcloud server. That server is on the same machine as 3Dtester.

To make the uploaded files available we bind the directory with a mount point

mkdir /opt/3Dtester/objects/cloud

Edit /etc/fstab

/var/www/nextcloud/data/a_user/files/path/to/3D/samples /opt/3Dtester/objects/cloud/ none bind,ro,0 0

Now we can mount it

mount /opt/3Dtester/objects/cloud