1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pyinventory_ynh.git synced 2024-09-03 20:16:09 +02:00

Merge pull request #124 from YunoHost-Apps/dev

Dev
This commit is contained in:
Jens Diemer 2023-11-26 12:58:26 +01:00 committed by GitHub
commit e42c56a185
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 19 additions and 60 deletions

View file

@ -24,10 +24,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
[PyInventory](https://github.com/jedie/PyInventory) is a libre web-based management to catalog things including state and location etc. using [Python](https://www.python.org/)/[Django](https://www.djangoproject.com/).
[![Integration level](https://dash.yunohost.org/integration/pyinventory_ynh.svg)](https://dash.yunohost.org/appci/app/pyinventory_ynh) ![](https://ci-apps.yunohost.org/ci/badges/pyinventory_ynh.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pyinventory_ynh.maintain.svg)
[![Install pyinventory_ynh with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pyinventory_ynh)
Pull requests welcome ;)
This package for YunoHost used [django-yunohost-integration](https://github.com/YunoHost-Apps/django_yunohost_integration)
@ -44,27 +40,8 @@ More screenshots are here: jedie.github.io/tree/master/screenshots/PyInventory
![Screenshot of PyInventory](./doc/screenshots/pyinventory_v020_screenshot_1.png)
![Screenshot of PyInventory](./doc/screenshots/pyinventory_v0110_screenshot_memo_1.png)
## Disclaimers / important information
## Settings and upgrades
Almost everything related to PyInventory's configuration is handled in a `"../conf/settings.py"` file.
You can edit the file `/home/yunohost.app/django_example/local_settings.py` to enable or disable features.
Test sending emails, e.g.:
```bash
ssh admin@yourdomain.tld
root@yunohost:~# /home/yunohost.app/pyinventory/manage.py sendtestemail --admins
```
How to debug a django YunoHost app, take a look into:
* https://github.com/YunoHost-Apps/django_example_ynh#developer-info
## Documentation and resources
* Official app website: <https://github.com/YunoHost-Apps/pyinventory_ynh>
* Official user documentation: <https://github.com/jedie/PyInventory>
* Official admin documentation: <https://github.com/YunoHost-Apps/pyinventory_ynh>
* Upstream app code repository: <https://github.com/YunoHost-Apps/pyinventory_ynh>

View file

@ -24,10 +24,6 @@ Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
[PyInventory](https://github.com/jedie/PyInventory) is a libre web-based management to catalog things including state and location etc. using [Python](https://www.python.org/)/[Django](https://www.djangoproject.com/).
[![Integration level](https://dash.yunohost.org/integration/pyinventory_ynh.svg)](https://dash.yunohost.org/appci/app/pyinventory_ynh) ![](https://ci-apps.yunohost.org/ci/badges/pyinventory_ynh.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pyinventory_ynh.maintain.svg)
[![Install pyinventory_ynh with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pyinventory_ynh)
Pull requests welcome ;)
This package for YunoHost used [django-yunohost-integration](https://github.com/YunoHost-Apps/django_yunohost_integration)
@ -44,27 +40,8 @@ More screenshots are here: jedie.github.io/tree/master/screenshots/PyInventory
![Capture décran de PyInventory](./doc/screenshots/pyinventory_v020_screenshot_1.png)
![Capture décran de PyInventory](./doc/screenshots/pyinventory_v0110_screenshot_memo_1.png)
## Avertissements / informations importantes
## Settings and upgrades
Almost everything related to PyInventory's configuration is handled in a `"../conf/settings.py"` file.
You can edit the file `/home/yunohost.app/django_example/local_settings.py` to enable or disable features.
Test sending emails, e.g.:
```bash
ssh admin@yourdomain.tld
root@yunohost:~# /home/yunohost.app/pyinventory/manage.py sendtestemail --admins
```
How to debug a django YunoHost app, take a look into:
* https://github.com/YunoHost-Apps/django_example_ynh#developer-info
## Documentations et ressources
* Site officiel de lapp : <https://github.com/YunoHost-Apps/pyinventory_ynh>
* Documentation officielle utilisateur : <https://github.com/jedie/PyInventory>
* Documentation officielle de ladmin : <https://github.com/YunoHost-Apps/pyinventory_ynh>
* Dépôt de code officiel de lapp : <https://github.com/YunoHost-Apps/pyinventory_ynh>

View file

@ -40,7 +40,7 @@ YNH_CURRENT_HOST = '__YNH_CURRENT_HOST__' # YunoHost main domain from: /etc/yun
# config_panel.toml settings:
DEBUG_ENABLED = '__DEBUG_ENABLED__'
DEBUG = DEBUG_ENABLED == 'YES'
DEBUG = DEBUG_ENABLED == '1'
LOG_LEVEL = '__LOG_LEVEL__'
ADMIN_EMAIL = '__ADMIN_EMAIL__'

View file

@ -6,10 +6,6 @@
[PyInventory](https://github.com/jedie/PyInventory) is a libre web-based management to catalog things including state and location etc. using [Python](https://www.python.org/)/[Django](https://www.djangoproject.com/).
[![Integration level](https://dash.yunohost.org/integration/pyinventory_ynh.svg)](https://dash.yunohost.org/appci/app/pyinventory_ynh) ![](https://ci-apps.yunohost.org/ci/badges/pyinventory_ynh.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pyinventory_ynh.maintain.svg)
[![Install pyinventory_ynh with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pyinventory_ynh)
Pull requests welcome ;)
This package for YunoHost used [django-yunohost-integration](https://github.com/YunoHost-Apps/django_yunohost_integration)

View file

@ -13,12 +13,12 @@ maintainers = ["Jens Diemer"]
[upstream]
# https://yunohost.org/en/packaging_manifest#upstream-section
license = "GPL-3.0-or-later"
website = "https://github.com/YunoHost-Apps/pyinventory_ynh"
admindoc = "https://github.com/YunoHost-Apps/pyinventory_ynh"
userdoc = "https://github.com/jedie/PyInventory"
code = "https://github.com/YunoHost-Apps/pyinventory_ynh"
[integration]
# https://yunohost.org/en/packaging_manifest#integration-section
yunohost = ">=11"
@ -31,7 +31,10 @@ ram.build = "50M" # **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ..
ram.runtime = "50M" # **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
[install]
# https://yunohost.org/en/packaging_manifest#install-questions
[install.domain]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "domain"
@ -61,11 +64,9 @@ ram.runtime = "50M" # **estimate** minimum ram requirement. e.g. 50M, 400M, 1G,
type = "email"
example = "admin@example.com"
[install.debug_enabled] # __DEBUG_ENABLED__
[install.debug_enabled] # __DEBUG_ENABLED__ will be set to "0" or "1" string
ask.en = "Should be never enabled in production!"
type = "select"
choices = ["YES", "NO"]
default = "NO"
type = "boolean"
[install.log_level] # __LOG_LEVEL__
ask.en = "Logging level"

View file

@ -336,7 +336,12 @@ def diffsettings():
},
)
app_path = destination / 'opt_yunohost'
verbose_check_call(sys.executable, app_path / 'manage.py', 'diffsettings', cwd=app_path)
verbose_check_call(
sys.executable,
app_path / 'manage.py',
'diffsettings',
cwd=app_path,
)
cli.add_command(diffsettings)

View file

@ -213,4 +213,7 @@ applied_migrations = [
"877e2ec", # 2023-08-17T20:54:24+02:00
"be3f649", # 2023-08-22T19:36:57+02:00
"c1a9d97", # 2023-11-01T19:59:17+01:00
"0a5d693", # 2023-11-25T15:06:21+01:00
"6b89813", # 2023-11-25T15:23:07+01:00
"4abd4c0", # 2023-11-25T15:59:31+01:00
]

View file

@ -13,7 +13,7 @@ __YNH_CURRENT_HOST__=${ynh_current_host}
#=================================================
# 'debug_enabled' -> '__DEBUG_ENABLED__' -> settings.DEBUG
debug_enabled="NO" # "YES" or "NO" string
debug_enabled="0" # "1" or "0" string
# 'log_level' -> '__LOG_LEVEL__' -> settings.LOG_LEVEL
log_level="WARNING"

View file

@ -26,7 +26,7 @@ def pytest_configure():
destination=BASE_PATH / 'local_test',
runserver=False,
extra_replacements={
'__DEBUG_ENABLED__': 'NO', # "YES" or "NO" string
'__DEBUG_ENABLED__': '0', # "1" or "0" string
'__LOG_LEVEL__': 'INFO',
'__ADMIN_EMAIL__': 'foo-bar@test.tld',
'__DEFAULT_FROM_EMAIL__': 'django_app@test.tld',

View file

@ -36,7 +36,7 @@ class DjangoYnhTestCase(HtmlAssertionMixin, TestCase):
def test_config_panel_settings(self):
# config_panel.toml settings, set via tests.conftest.pytest_configure():
assert settings.DEBUG_ENABLED == 'NO' and settings.DEBUG is False
assert settings.DEBUG_ENABLED == '0' and settings.DEBUG is False
assert settings.LOG_LEVEL == 'INFO'
assert settings.ADMIN_EMAIL == 'foo-bar@test.tld'
assert settings.DEFAULT_FROM_EMAIL == 'django_app@test.tld'