dsmrreader / dsmr-reader

DSMR-telegram reader & data visualizer for hobbyists. Free for non-commercial use.
https://dsmr-reader.readthedocs.io
Other
463 stars 95 forks source link

FreeBSD compatibility #1175

Closed Wieter closed 3 years ago

Wieter commented 3 years ago

First of all, thanks for all your work on this neat piece of software!

To increase interoperability over various systems, may I suggest to implement a different shebang for all .sh scripts?

For example, while installing on FreeBSD I had to edit the file: https://github.com/dsmrreader/dsmr-reader/blob/0ee58370f43c6ebe32564660b47f212b518c227f/tools/generate-secret-key.sh#L1 and replace#!/bin/bash with #!/usr/bin/env bash

Note: at FreeBSD, bash is not installed by default! use pkg install bash

Additionally, in https://github.com/dsmrreader/dsmr-reader/blob/0ee58370f43c6ebe32564660b47f212b518c227f/dsmrreader/config/production.py#L6 the STATIC_ROOT is statically defined as '/var/www/dsmrreader/static'. As different systems (and users) have different default and preferred locations for www data, it might be a good idea to be able to set/mention this as override parameter (DJANGO_STATIC_ROOT) in the .env(.local) file. In my case I had to set it to /usr/local/www/dsmr/dsmr-reader/static

Now, whenever there is an update, I first have to git reset --hard, then pull, and then re-incorporate above changes.

For the setup configuration in FreeBSD, I think people can manage. It deviates a bit from the documentation and example configs (mostly due to different paths), and I myself prefer to use uwsgi in emperor mode.

Wieter commented 3 years ago

Coming back to the STATIC_ROOT, it might be better to set in https://github.com/dsmrreader/dsmr-reader/blob/0ee58370f43c6ebe32564660b47f212b518c227f/dsmrreader/config/production.py#L6 to something universal like os.path.join(BASE_DIR, 'static')

dennissiemensma commented 3 years ago

Thanks for reporting! I've updated the shebangs and added an env var (DJANGO_STATIC_ROOT) for overriding STATIC_ROOT. These will be available in v4.6.

dennissiemensma commented 3 years ago

Uitgebracht in v4.6