Compare commits

...

496 commits

Author SHA1 Message Date
Alexandre Aubin
8de98670e9
Merge pull request #358 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2024-08-20 16:28:26 +02:00
xabirequejo
068d6d369a Translated using Weblate (Basque)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2024-08-16 17:54:48 +02:00
Ivan Davydov
3c7f55c610 Translated using Weblate (Russian)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ru/
2024-08-05 12:13:55 +02:00
cjdw
531c972bed Translated using Weblate (Indonesian)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/id/
2024-07-16 11:03:01 +02:00
Ivan Davydov
7c378210fa Translated using Weblate (Russian)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ru/
2024-07-04 20:54:46 +02:00
OniriCorpe
497ea8a4af chores: update changelog for 11.2.1 & add make_changelog script 2024-05-20 00:33:05 +02:00
Alexandre Aubin
65d694280c
Merge pull request #357 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2024-05-19 23:38:56 +02:00
xabirequejo
dc1ce5a9ab Translated using Weblate (Basque)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2024-05-10 17:59:06 +02:00
rosbeef andino
663d80666a Translated using Weblate (Spanish)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/es/
2024-05-10 17:59:06 +02:00
José M
36c20d5582 Translated using Weblate (Galician)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/gl/
2024-05-08 12:13:00 +02:00
OniriCorpe
95503ca2e6
Merge pull request #356 from YunoHost/actions/black 2024-05-08 01:53:22 +02:00
OniriCorpe
96539ce5c7 🎨 Format Python code with Black 2024-05-07 23:52:31 +00:00
OniriCorpe
578fb497e9
i18n: accept U+202F as an okay char 2024-05-08 01:52:11 +02:00
OniriCorpe
954d608a61
Merge pull request #354 from yunohost-bot/weblate-yunohost-moulinette 2024-05-08 01:31:46 +02:00
OniriCorpe
ac447a1f9d Translated using Weblate (French)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2024-05-08 01:11:39 +02:00
Tagada
c63634f86f
Merge pull request #353 from YunoHost/actions/i18nreformat
Reformat locale files
2024-03-24 16:58:12 +01:00
OniriCorpe
14bbff41ad 🤖 Reformat locale files 2024-03-23 19:09:18 +00:00
OniriCorpe
291ed50843
Merge pull request #352 from yunohost-bot/weblate-yunohost-moulinette 2024-03-23 20:09:07 +01:00
OniriCorpe
5cb073bb75 Translated using Weblate (Japanese)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ja/
2024-03-23 20:04:43 +01:00
OniriCorpe
8eb3ce3377 Translated using Weblate (Indonesian)
Currently translated at 93.3% (42 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/id/
2024-03-23 20:04:42 +01:00
OniriCorpe
d1a7445773 Translated using Weblate (Persian)
Currently translated at 95.5% (43 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fa/
2024-03-23 20:04:42 +01:00
OniriCorpe
41e170a214 Translated using Weblate (Ukrainian)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/uk/
2024-03-23 20:04:42 +01:00
OniriCorpe
dbcadf0c87 Translated using Weblate (Swedish)
Currently translated at 84.4% (38 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/sv/
2024-03-23 20:04:42 +01:00
OniriCorpe
7f2563e65a Translated using Weblate (Polish)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/pl/
2024-03-23 20:04:42 +01:00
OniriCorpe
e8b46f8c9b Translated using Weblate (Turkish)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/tr/
2024-03-23 20:04:42 +01:00
OniriCorpe
e196ed34c4 Translated using Weblate (Russian)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ru/
2024-03-23 20:04:41 +01:00
OniriCorpe
750aab64da Translated using Weblate (Dutch)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/nl/
2024-03-23 20:04:41 +01:00
OniriCorpe
1cac05b9fc Translated using Weblate (Italian)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/it/
2024-03-23 20:04:41 +01:00
OniriCorpe
f4712d9300 Translated using Weblate (French)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2024-03-23 20:04:41 +01:00
OniriCorpe
e96c380d29 Translated using Weblate (Esperanto)
Currently translated at 95.5% (43 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eo/
2024-03-23 20:04:41 +01:00
OniriCorpe
d81b4578e9 Translated using Weblate (German)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/de/
2024-03-23 20:04:41 +01:00
OniriCorpe
0ffda1a0db Translated using Weblate (Chinese (Simplified))
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/zh_Hans/
2024-03-23 20:04:40 +01:00
OniriCorpe
b2b912e7b9 Translated using Weblate (Arabic)
Currently translated at 95.5% (43 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ar/
2024-03-23 20:04:40 +01:00
OniriCorpe
4a52f20417 Translated using Weblate (English)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/en/
2024-03-23 20:04:40 +01:00
OniriCorpe
cdd5ee6134 Translated using Weblate (Japanese)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ja/
2024-03-23 19:01:36 +01:00
OniriCorpe
efc7d23738 Translated using Weblate (Indonesian)
Currently translated at 93.3% (42 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/id/
2024-03-23 19:01:35 +01:00
OniriCorpe
2a2bb468fc Translated using Weblate (Persian)
Currently translated at 95.5% (43 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fa/
2024-03-23 19:01:35 +01:00
OniriCorpe
f7a9678b59 Translated using Weblate (Ukrainian)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/uk/
2024-03-23 19:01:35 +01:00
OniriCorpe
50ce4c9b03 Translated using Weblate (Czech)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/cs/
2024-03-23 19:01:35 +01:00
OniriCorpe
3bed227f6d Translated using Weblate (Nepali)
Currently translated at 13.3% (6 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ne/
2024-03-23 19:01:35 +01:00
OniriCorpe
45b1a92743 Translated using Weblate (Polish)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/pl/
2024-03-23 19:01:34 +01:00
OniriCorpe
257e7095e5 Translated using Weblate (Turkish)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/tr/
2024-03-23 19:01:34 +01:00
OniriCorpe
4dfa2ee710 Translated using Weblate (Russian)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ru/
2024-03-23 19:01:34 +01:00
OniriCorpe
080d244f44 Translated using Weblate (Portuguese)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/pt/
2024-03-23 19:01:34 +01:00
OniriCorpe
39113a8ed5 Translated using Weblate (Dutch)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/nl/
2024-03-23 19:01:34 +01:00
OniriCorpe
fe607a2ef1 Translated using Weblate (Italian)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/it/
2024-03-23 19:01:34 +01:00
OniriCorpe
d59f142019 Translated using Weblate (French)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2024-03-23 19:01:33 +01:00
OniriCorpe
c59b869286 Translated using Weblate (Spanish)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/es/
2024-03-23 19:01:33 +01:00
OniriCorpe
8c38478d02 Translated using Weblate (Esperanto)
Currently translated at 93.3% (42 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eo/
2024-03-23 19:01:33 +01:00
OniriCorpe
e8e206b482 Translated using Weblate (German)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/de/
2024-03-23 19:01:33 +01:00
OniriCorpe
21ecfbcd69 Translated using Weblate (Chinese (Simplified))
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/zh_Hans/
2024-03-23 19:01:33 +01:00
José M
8bde8eee14 Translated using Weblate (Galician)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/gl/
2024-03-23 14:39:29 +01:00
ppr
0ee77f922e Translated using Weblate (French)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2024-03-23 14:39:29 +01:00
xabirequejo
97a24dbbce Translated using Weblate (Basque)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2024-03-23 14:39:29 +01:00
xaloc33
6e5429ce00 Translated using Weblate (Catalan)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ca/
2024-03-23 14:39:29 +01:00
OniriCorpe
0ad9eac48c Translated using Weblate (French)
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2024-03-23 06:05:24 +01:00
OniriCorpe
e00be08bee Translated using Weblate (English)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/en/
2024-03-23 06:05:24 +01:00
Alexandre Aubin
9316db6054
Merge pull request #351 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2024-03-20 18:41:11 +01:00
Alexandre Aubin
6e434cddc6
Update locales/fr.json 2024-03-20 18:41:00 +01:00
OniriCorpe
c698807f12 Translated using Weblate (French)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2024-03-09 05:14:55 +01:00
OniriCorpe
95f7e6804a Translated using Weblate (Norwegian Bokmål)
Currently translated at 37.7% (17 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/nb_NO/
2024-03-07 23:09:11 +01:00
OniriCorpe
c8193819c7 Translated using Weblate (Hindi)
Currently translated at 57.7% (26 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/hi/
2024-03-07 23:09:11 +01:00
Psycojoker
cadb449528 🎨 Format Python code with Black 2024-03-07 02:37:34 +01:00
Laurent Peuch
518e5ebb85 ci(autoblacks): add step to check if black reformatted some code 2024-03-07 02:36:05 +01:00
Laurent Peuch
d09e1a2fab ci(autoblack): Input 'black_args' has been deprecated with message: Input is deprecated. Use and instead. 2024-03-07 01:51:23 +01:00
Laurent Peuch
f1010fb8a3 fix: port doc/ldif2dot-0.1.py to python3 for black 2024-03-07 01:45:38 +01:00
OniriCorpe
7a46e1499d ci(autoblack): use the now available official psf/black github action 2024-03-07 01:39:48 +01:00
OniriCorpe
1b28bca0c0 chores: update actions to nodejs 20
Also replaces rickstaa/action-black by psf/black
2024-03-07 01:39:48 +01:00
OniriCorpe
d0089dbdf9 revert x___x 2024-02-25 07:18:12 +01:00
OniriCorpe
ecdc43a09a chores: update actions to nodejs 20 2024-02-25 07:13:47 +01:00
Alexandre Aubin
38d83520b5
Merge pull request #344 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2024-02-02 22:02:20 +01:00
Francescc
1d3908c9a5 Translated using Weblate (Catalan)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ca/
2024-01-29 03:35:41 +01:00
Weblate
a69b276188 Added translation using Weblate (Korean) 2024-01-25 13:39:25 +01:00
Alexandre Aubin
04a688a141
Merge pull request #343 from methbkts/dev
chore: update actions version to use node 16 version
2023-10-31 12:59:45 +01:00
Metin Bektas
ed0cd88da9 chore: update actions version to use node 16 version 2023-10-31 10:51:49 +01:00
Alexandre Aubin
b4e79bd278 Update changelog for 11.2 2023-07-17 16:33:14 +02:00
Alexandre Aubin
5ec28b19c0
Merge pull request #335 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2023-07-17 15:53:09 +02:00
motcha
64a39cc595 Translated using Weblate (Japanese)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ja/
2023-07-12 01:35:12 +02:00
Alexandre Aubin
e5fa7ab734 Update changelog for 11.1.5 2023-07-10 21:34:12 +02:00
Alexandre Aubin
d66fd94f68
Merge pull request #334 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2023-07-10 21:32:02 +02:00
motcha
145fd9a91a Translated using Weblate (Japanese)
Currently translated at 4.4% (2 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ja/
2023-07-10 21:29:06 +02:00
Weblate
0c71095db3 Added translation using Weblate (Japanese) 2023-07-10 21:29:06 +02:00
Alexandre Aubin
c06e1a91c9 auth: prevent stupid issue where outdated cookie usage would trigger error 500 intead of 401, resulting in a ~bug after Yunohost self-upgrade and the webadmin is confused about the API not being up again 2023-07-10 21:28:54 +02:00
Alexandre Aubin
d4769ec0a5
Merge pull request #332 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2023-05-08 15:47:02 +02:00
Neko Nekowazarashi
9078c881ea Translated using Weblate (Indonesian)
Currently translated at 95.5% (43 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/id/
2023-04-25 12:11:42 +02:00
Neko Nekowazarashi
f6234577c4 Translated using Weblate (Indonesian)
Currently translated at 95.5% (43 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/id/
2023-03-27 03:04:42 +02:00
Neko Nekowazarashi
6ec06b4ce3 Translated using Weblate (Indonesian)
Currently translated at 88.8% (40 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/id/
2023-03-27 02:29:51 +02:00
liimee
d1e10e23d4 Translated using Weblate (Indonesian)
Currently translated at 88.8% (40 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/id/
2023-03-07 23:31:01 +01:00
Neko Nekowazarashi
c5aeb1acad Translated using Weblate (Indonesian)
Currently translated at 88.8% (40 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/id/
2023-02-27 19:14:59 +01:00
Alexandre Aubin
2373a7fa5e
setup.py: fix version specifier in python_requires, python tooling not happy with * i guess 2023-02-06 21:05:57 +01:00
Alexandre Aubin
d1827d1a41
Merge pull request #331 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2023-02-06 21:05:01 +01:00
Poesty Li
f1e7984fc9 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/zh_Hans/
2023-02-06 20:30:26 +01:00
Alexandre Aubin
1fb77feec3
Merge pull request #330 from YunoHost/actions/black
Format Python code with Black
2023-02-01 20:33:26 +01:00
alexAubin
52bbab7df1 🎨 Format Python code with Black 2023-02-01 19:30:09 +00:00
Alexandre Aubin
aaf7f764e3 Update changelog for 11.1.4 2023-02-01 20:29:27 +01:00
Alexandre Aubin
4d2694ef8d Update changelog for 11.1.2.1 2023-01-30 16:34:59 +01:00
Alexandre Aubin
2539ea9c70
Merge pull request #329 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2023-01-30 15:49:45 +01:00
Weblate
d7162b209a Added translation using Weblate (Lithuanian) 2023-01-14 15:42:32 +01:00
ButterflyOfFire
cabe9a728b Translated using Weblate (Arabic)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ar/
2023-01-11 20:17:03 +01:00
Alexandre Aubin
4c03e16de9 Handle calling 'yunohost' with no args more gracefully 2023-01-06 17:33:31 +01:00
Alexandre Aubin
9fc33eec1a Update changelog for 11.1.2 2023-01-06 00:38:59 +01:00
Alexandre Aubin
95695e94d7
Merge pull request #325 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2023-01-05 19:19:12 +01:00
xabirequejo
bc9b4a2ce2 Translated using Weblate (Basque)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2023-01-05 19:18:49 +01:00
André Koot
55a09c57ac Translated using Weblate (Dutch)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/nl/
2023-01-05 19:18:49 +01:00
ButterflyOfFire
bbd2468e35 Translated using Weblate (Arabic)
Currently translated at 91.1% (41 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ar/
2023-01-05 19:18:49 +01:00
xabirequejo
12c5482d6c Translated using Weblate (Basque)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2023-01-05 19:18:49 +01:00
Weblate
ea90c056b7 Added translation using Weblate (Portuguese (Brazil)) 2023-01-05 19:18:49 +01:00
Weblate
c99439740f Added translation using Weblate (Hebrew) 2023-01-05 19:18:49 +01:00
Alexandre Aubin
2195ed6f90
Merge pull request #328 from YunoHost/actions/black
Format Python code with Black
2023-01-05 19:18:38 +01:00
alexAubin
2d2eab4c30 🎨 Format Python code with Black 2023-01-05 18:15:55 +00:00
Alexandre Aubin
9bc187d404
Merge pull request #327 from YunoHost/dont-take-lock-for-read-operations
Dont take lock for read/GET operations
2023-01-05 19:15:20 +01:00
Alexandre Aubin
d0e65fdb46
Merge branch 'dev' into dont-take-lock-for-read-operations 2023-01-05 19:15:14 +01:00
Alexandre Aubin
01a4dc0942
Fix flake8 config syntax making the test crash 2023-01-05 19:14:42 +01:00
Alexandre Aubin
baa00c0812 Fix flake8 2022-12-24 19:28:26 +01:00
Alexandre Aubin
1e79e99cc8 Don't take lock for read/GET operations : also cover cases when there's a list of routes 2022-12-24 00:57:17 +01:00
Alexandre Aubin
ac0ac24996 Merge branch 'dev' into dont-take-lock-for-read-operations 2022-12-24 00:52:08 +01:00
Alexandre Aubin
7f4e8b394c Remove old test about old callback mechanism 2022-12-24 00:07:14 +01:00
Alexandre Aubin
aa06187284
Merge pull request #326 from YunoHost/actions/black
Format Python code with Black
2022-12-24 00:03:07 +01:00
Alexandre Aubin
676a19dc28 Don't take lock for read/GET operations 2022-12-24 00:02:24 +01:00
alexAubin
161c5d5c2b 🎨 Format Python code with Black 2022-12-23 23:01:46 +00:00
Alexandre Aubin
80873777c6 Code simplification/explicitation 2022-12-23 22:34:49 +01:00
Alexandre Aubin
50b19a95c6 Remove the 'global argument' mechanism ... we only use it for --version and it's just batshit overly complicated for what this achieves... 2022-12-23 20:31:58 +01:00
Alexandre Aubin
5258f22985 Update changelog for 11.1.0 2022-10-26 16:16:01 +02:00
Alexandre Aubin
d54dd286be
Merge pull request #323 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2022-09-30 15:05:13 +02:00
Sedat Albayrak
ceba5273f2 Translated using Weblate (Turkish)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/tr/
2022-09-12 06:42:11 +02:00
ButterflyOfFire
6bdd6dcecb Translated using Weblate (Arabic)
Currently translated at 88.8% (40 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ar/
2022-08-07 21:32:10 +00:00
Alexandre Aubin
fcd84e3e34 Update changelog for 11.0.9 2022-08-07 23:31:40 +02:00
Alexandre Aubin
9dd1a8a63e Update changelog for 11.0.8 2022-08-07 11:56:27 +02:00
Alexandre Aubin
4239f466f8 Fix random_ascii behavior : it was in fact returning a string with 2*length ... 2022-08-05 10:55:04 +02:00
Alexandre Aubin
b20b1af116
Merge pull request #322 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2022-08-03 22:19:03 +02:00
Alexandre Aubin
eadf40c552
Donnnnt translate placeholders heauarg 2022-08-03 22:18:25 +02:00
Gregor
b27f2351ca Translated using Weblate (German)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/de/
2022-07-22 02:15:09 +00:00
Radek Raczkowski
0d2fbb3ad0 Translated using Weblate (Polish)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/pl/
2022-07-10 13:50:39 +00:00
Jose Riha
f0632f0927 Translated using Weblate (Slovak)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/sk/
2022-06-22 09:36:26 +00:00
Jose Riha
f9d899ca52 Translated using Weblate (Slovak)
Currently translated at 60.0% (27 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/sk/
2022-06-22 05:38:24 +00:00
Weblate
fc13528570 Added translation using Weblate (Telugu) 2022-06-06 21:18:51 +00:00
Jose Riha
5f6d5ac4de Translated using Weblate (Slovak)
Currently translated at 6.6% (3 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/sk/
2022-05-25 08:39:38 +00:00
Weblate
4a13653f3b Added translation using Weblate (Slovak) 2022-05-23 20:08:38 +00:00
tituspijean
e6ca65923c
Update changelog for 11.0.7 2022-05-18 00:03:04 +02:00
Alexandre Aubin
70e41495a4
Merge pull request #321 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2022-04-27 21:54:56 +02:00
Jimmy Angel Pérez Díaz
6f9b0f4ea4 Translated using Weblate (Spanish)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/es/
2022-04-05 15:35:02 +00:00
Kay0u
e654b67180
Merge branch 'dev' of github.com:YunoHost/moulinette into dev 2022-03-29 14:25:16 +02:00
Kay0u
641335ea7c
Update changelog for 11.0.6 2022-03-29 14:24:34 +02:00
Kayou
e4aba32128
Merge pull request #320 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2022-03-29 14:23:35 +02:00
3ole
d96d2b9c15 Translated using Weblate (German)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/de/
2022-03-27 22:17:24 +00:00
Yifei Ding
b19f1f6f80 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/zh_Hans/
2022-03-27 22:17:24 +00:00
Selyan Slimane Amiri
5c0f025e46 Translated using Weblate (Kabyle)
Currently translated at 13.3% (6 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/kab/
2022-03-24 14:38:04 +00:00
Weblate
e1e98263cd Added translation using Weblate (Kabyle) 2022-03-14 07:43:35 +00:00
Alexandre Aubin
2e117e8d63
Merge pull request #318 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2022-03-08 13:21:05 +01:00
José M
4fa7568c84 Translated using Weblate (Galician)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/gl/
2022-02-18 16:01:17 +00:00
Mico Hauataluoma
9700d8e293 Translated using Weblate (Finnish)
Currently translated at 4.4% (2 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fi/
2022-02-08 13:46:53 +00:00
Weblate
bcf41f6ccc Added translation using Weblate (Danish) 2022-02-08 13:46:53 +00:00
Alexandre Aubin
74f2c26da6
Merge pull request #319 from YunoHost/actions/black
Format Python code with Black
2022-02-08 14:46:49 +01:00
alexAubin
b0b440e4cc 🎨 Format Python code with Black 2022-02-08 13:45:42 +00:00
Alexandre Aubin
cb9ecb468d cli: Add possibility to hide commands in --help 2022-02-08 14:45:02 +01:00
Alexandre Aubin
7e2da7a897
Merge pull request #317 from YunoHost/actions/black
Format Python code with Black
2022-01-19 23:17:54 +01:00
alexAubin
45dbcd98f4 🎨 Format Python code with Black 2022-01-19 22:14:17 +00:00
Alexandre Aubin
23d6107861 Update changelog for 11.0.2 2022-01-19 21:18:06 +01:00
Alexandre Aubin
d8cb39d809 Merge branch 'dev' into bullseye 2022-01-19 21:15:34 +01:00
Alexandre Aubin
0ff3f45d92 Update changelog for 4.4.0 2022-01-19 21:13:34 +01:00
Alexandre Aubin
5434a8994c Update changelog for 4.3.3.1 2022-01-19 21:12:31 +01:00
Alexandre Aubin
5192c66f95
Merge pull request #316 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2022-01-19 20:04:11 +01:00
Gregor
88bf138501 Translated using Weblate (German)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/de/
2022-01-17 13:41:59 +00:00
Mico Hauataluoma
496e387900 Translated using Weblate (Finnish)
Currently translated at 2.2% (1 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fi/
2022-01-15 13:20:47 +00:00
Alexandre Aubin
e8c0ffac53
Merge pull request #315 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2022-01-14 00:49:41 +01:00
Boudewijn
8473743fea Translated using Weblate (Dutch)
Currently translated at 93.3% (42 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/nl/
2022-01-13 21:22:08 +00:00
Alexandre Aubin
5440053d5f
Merge pull request #311 from YunoHost/moar_session_management_changes
api: Move cookie session management logic to the authenticator for more flexibility
2022-01-11 12:58:28 +01:00
Alexandre Aubin
9ccc914ca1
Merge branch 'bullseye' into moar_session_management_changes 2022-01-11 12:56:24 +01:00
Alexandre Aubin
35351696ac Merge branch 'dev' into bullseye 2021-12-31 15:21:57 +01:00
Alexandre Aubin
c04aac6d98
Merge pull request #314 from YunoHost/add-lgtm
Add lgtm
2021-12-30 18:59:28 +01:00
Kay0u
be0006fdb9
fix some warnings 2021-12-30 14:39:38 +01:00
Kay0u
29d0d0cfc1
add lgtm badge 2021-12-30 14:39:30 +01:00
Alexandre Aubin
8b05fcf2fd Update changelog fro 4.3.3 2021-12-29 01:09:02 +01:00
Alexandre Aubin
0afface3f2
Merge pull request #313 from YunoHost/actions/black
Format Python code with Black
2021-12-29 00:47:28 +01:00
alexAubin
ea6eaa6b1e 🎨 Format Python code with Black 2021-12-28 23:46:17 +00:00
Alexandre Aubin
ccc005fb84
Merge pull request #312 from YunoHost/pyupgrade
Pyupgrade
2021-12-29 00:45:49 +01:00
Alexandre Aubin
37d43d1bdf
Fix weird format syntax 2021-12-29 00:40:01 +01:00
Alexandre Aubin
d10879faa2
Merge pull request #310 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-12-27 15:25:59 +01:00
Alexandre Aubin
83a95fd8c9 Unused import 2021-12-26 18:13:48 +01:00
Alexandre Aubin
ce8322bbf4 Fix tests 2021-12-26 18:12:54 +01:00
Alexandre Aubin
ef08a8be53 actionsmap: add global flag to disable cache and lock 2021-12-25 15:41:09 +01:00
Laurent Peuch
9855b6d7f5 [mod] stop using old style class 2021-12-24 01:18:11 +01:00
Laurent Peuch
8127e7cd1a [mod] run pyupgrade on source code 2021-12-24 01:18:03 +01:00
Alexandre Aubin
964483b23b Fix issues in previous commits regarding authentication mecanism 2021-12-23 16:57:43 +01:00
Alexandre Aubin
ee1e63c7a1 Propagate changes on tests 2021-12-22 19:27:56 +01:00
Alexandre Aubin
2fc9611b53 api: Move cookie session management logic to the authenticator for more flexibility 2021-12-22 19:06:33 +01:00
Valentin von Guttenberg
265753aef7 Translated using Weblate (German)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/de/
2021-11-29 18:44:42 +00:00
maique madeira
a53dd3d175 Translated using Weblate (Portuguese)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/pt/
2021-11-20 10:48:00 +00:00
Radek S
5b506a5f70 Translated using Weblate (Czech)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/cs/
2021-11-19 22:07:05 +00:00
Christian Wehrli
27bbd81f49 Translated using Weblate (German)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/de/
2021-11-19 13:48:06 +00:00
Alexandre Aubin
9fcc9630bd Rework actionsmap and m18n init, drop multiple actionsmap support 2021-11-17 19:24:26 +01:00
Alexandre Aubin
b2c67369a8 Merge branch 'dev' into bullseye 2021-11-15 19:14:40 +01:00
Alexandre Aubin
845399dba0 Update changelog for 4.3.2.2 2021-11-15 18:54:02 +01:00
Alexandre Aubin
96b7cb237e Update changelog for 4.3.2.1 2021-11-15 18:44:58 +01:00
Alexandre Aubin
be3b9f7a53
Merge pull request #309 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-11-15 18:43:29 +01:00
Alexandre Aubin
b7c05f1daa
fix i18n string format 2021-11-15 18:43:18 +01:00
Flavio Cristoforetti
cb6e0464ad Translated using Weblate (Italian)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/it/
2021-11-15 17:32:34 +00:00
dagangtie
166fd7e824 Translated using Weblate (Chinese (Simplified))
Currently translated at 97.7% (44 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/zh_Hans/
2021-11-15 17:32:34 +00:00
Alexandre Aubin
c5700f1ba3 Fix issue with accented chars in form .. decode() is not needed anymore? 2021-11-15 18:31:56 +01:00
Alexandre Aubin
c5f577c04f Fix 'Missing credentials parameter' bug : request.POST is buggy when value contains special chars ... request.params appears to be more reliable 2021-11-15 18:07:46 +01:00
Alexandre Aubin
fc4b31bdea Update changelog for 4.3.2 2021-11-05 02:38:24 +01:00
Alexandre Aubin
40ca5a8ad6 Update changelog for 4.3.2 2021-11-05 02:36:25 +01:00
Alexandre Aubin
56ce07d114 Update changelog for 4.3.1.2 2021-11-03 18:43:20 +01:00
Alexandre Aubin
1c412bf8ea
Merge pull request #308 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-11-03 18:29:47 +01:00
punkrockgirl
a745c93a58 Translated using Weblate (Basque)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2021-10-31 14:11:21 +00:00
punkrockgirl
891216dec4 Translated using Weblate (Basque)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2021-10-30 01:40:59 +00:00
Page Asgardius
7694024c58 Translated using Weblate (Spanish)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/es/
2021-10-23 18:16:35 +00:00
punkrockgirl
07b6779eac Translated using Weblate (Basque)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2021-10-21 10:29:06 +00:00
punkrockgirl
d997e5f912 Translated using Weblate (Basque)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2021-10-20 23:40:28 +00:00
punkrockgirl
551ad28ed2 Translated using Weblate (Basque)
Currently translated at 93.3% (42 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2021-10-20 20:32:29 +00:00
Alexandre Aubin
c44e025210 cli prompt: fix bottom toolbar displayed even if message is empty 2021-10-20 18:31:29 +02:00
Alexandre Aubin
5d61b74fde ci: unused imports 2021-10-20 18:25:25 +02:00
Alexandre Aubin
12218bcbae setup.py: bump prompt-toolkit version requirement 2021-10-20 11:38:47 +02:00
Alexandre Aubin
d901d28add
Adapt prompt_toolkit call because now using the v3.x of the lib 2021-10-19 20:18:20 +02:00
punkrockgirl
9130574191 Translated using Weblate (Basque)
Currently translated at 93.3% (42 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2021-10-19 08:20:07 +00:00
punkrockgirl
aaeeb0a02e Translated using Weblate (Basque)
Currently translated at 15.5% (7 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eu/
2021-10-18 15:26:27 +00:00
Semen Turchikhin
f2ffcd09b2 Translated using Weblate (Russian)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ru/
2021-10-18 10:39:40 +00:00
Alexandre Aubin
824a9ed42e Merge branch 'dev' into bullseye 2021-10-13 14:59:30 +02:00
Weblate
b3d950ca4b Added translation using Weblate (Slovenian) 2021-10-12 22:39:21 +00:00
Quentí
84ccb993ab Translated using Weblate (Occitan)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/oc/
2021-10-09 01:02:16 +00:00
Alexandre Aubin
63defa3926 Update changelog for 4.3.1.1 2021-10-04 01:29:30 +02:00
Alexandre Aubin
8ef882b4f5 Merge branch 'dev' into bullseye 2021-10-02 19:59:09 +02:00
Alexandre Aubin
14e37366df Add cp helper 2021-10-01 20:18:46 +02:00
Alexandre Aubin
f25d202fee
swag: Add version badge 2021-10-01 17:50:25 +02:00
Alexandre Aubin
e01fd04c7a Update changelog for 4.3.1 2021-09-29 22:38:25 +02:00
Alexandre Aubin
7ab1999ffd
Merge pull request #307 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-09-29 22:17:54 +02:00
Éric Gaspar
8b4a29b8ce Translated using Weblate (Turkish)
Currently translated at 91.1% (41 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/tr/
2021-09-28 01:04:02 +00:00
Éric Gaspar
6fa32f548d Translated using Weblate (Russian)
Currently translated at 95.5% (43 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/ru/
2021-09-28 01:04:01 +00:00
liimee
4f3ba338ed Translated using Weblate (Indonesian)
Currently translated at 37.7% (17 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/id/
2021-09-24 14:49:14 +00:00
Alexandre Aubin
02d925e712
Merge pull request #306 from YunoHost/actions/i18nreformat
Reformat locale files
2021-09-23 21:54:49 +02:00
Alexandre Aubin
bbf498321f
Merge pull request #304 from YunoHost/actions/i18nreformat
Reformat locale files
2021-09-23 21:54:12 +02:00
alexAubin
2e3fe5b4af 🤖 Reformat locale files 2021-09-23 19:54:12 +00:00
Alexandre Aubin
d2ed30c172
Merge pull request #305 from YunoHost/actions/black
Format Python code with Black
2021-09-23 21:53:56 +02:00
alexAubin
b224dd356a 🎨 Format Python code with Black 2021-09-23 19:48:10 +00:00
alexAubin
c1029d9787 🤖 Reformat locale files 2021-09-23 19:47:51 +00:00
Alexandre Aubin
974f15d7d0
Merge pull request #301 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-09-23 21:47:36 +02:00
Alexandre Aubin
ce3ec1025c
Merge pull request #303 from YunoHost/rework-prompt-again
Rework cli prompt() again
2021-09-23 21:47:23 +02:00
Alexandre Aubin
433f84323f debian: Depend on python3-pygments also, because it's only a recommend of python3-prompt-toolkit 2021-09-23 21:41:19 +02:00
Alexandre Aubin
3c21a5cfbf Stale i18n string 2021-09-23 21:25:45 +02:00
Alexandre Aubin
2ce920e2ff Attempt to fix tests 2021-09-23 21:23:39 +02:00
Alexandre Aubin
2f59023eee read_file: support for custom file mode 2021-09-23 20:55:35 +02:00
Alexandre Aubin
2b62f3d2e6 Also depend on pygments 2021-09-23 01:01:01 +02:00
Alexandre Aubin
088ef05e07 Force version for prompt-toolkit in setup.py 2021-09-23 00:57:22 +02:00
Alexandre Aubin
c4b559cf6b Fix test + missing dependency to prompt-toolkit in setup.py 2021-09-23 00:47:11 +02:00
Alexandre Aubin
1f7bb1d54c Rework cli prompt() again 2021-09-21 20:13:39 +02:00
liimee
681517bc86 Translated using Weblate (Indonesian)
Currently translated at 15.2% (7 of 46 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/id/
2021-09-20 22:18:16 +00:00
Alexandre Aubin
8e3a52446a
Merge pull request #302 from YunoHost/actions/black
Format Python code with Black
2021-09-21 00:18:10 +02:00
alexAubin
b0a2b0efeb 🎨 Format Python code with Black 2021-09-20 22:14:58 +00:00
Alexandre Aubin
2339377763 Fix version in setup.py 2021-09-21 00:14:17 +02:00
Alexandre Aubin
86b29b14b2 Update changelog for 4.3.0 2021-09-19 23:38:55 +02:00
Alexandre Aubin
7782fee557
Merge pull request #300 from YunoHost/actions/i18nreformat
Reformat locale files
2021-09-19 21:28:53 +02:00
alexAubin
097bf909a8 🤖 Reformat locale files 2021-09-19 19:25:24 +00:00
Alexandre Aubin
ffbd7e3e50
Merge pull request #295 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-09-19 21:25:06 +02:00
Alexandre Aubin
69818bd850 tests: Moar mypy 2021-09-19 00:35:15 +02:00
Alexandre Aubin
6a2ae5630b
Merge pull request #299 from YunoHost/mypy
tests: add mypy + misc fixes to make test pass
2021-09-17 16:26:11 +02:00
Kay0u
973c99c616
Add mock as a test dependency 2021-09-17 16:23:01 +02:00
Alexandre Aubin
965e9db70e tests: add mypy + misc fixes to make test pass 2021-09-17 16:17:53 +02:00
Kay0u
3741101d70
Fix a potential bug in call_async_output, update tests 2021-09-17 16:17:16 +02:00
Kayou
4eb60dac12
open pipeReader as a binary file 2021-09-17 15:00:13 +02:00
Kayou
b3b74530da
Merge pull request #298 from YunoHost/actions/black
Format Python code with Black
2021-09-17 13:54:29 +02:00
kay0u
19df292c73 🎨 Format Python code with Black 2021-09-17 11:53:30 +00:00
Kay0u
fdc61c915c
add a missing decode in LogPipe class 2021-09-17 13:52:53 +02:00
Weblate
006c2b5b21 Added translation using Weblate (Macedonian) 2021-09-16 15:40:39 +00:00
Weblate
2e5cf64db8 Merge branch 'dev' of https://github.com/YunoHost/moulinette into dev 2021-09-15 16:04:57 +00:00
ljf
08f7866f77 [fix] Prefill input with long color question 2021-09-15 14:40:42 +02:00
Alexandre Aubin
f414a1656a
Merge pull request #296 from YunoHost/actions/black
Format Python code with Black
2021-09-12 23:57:44 +02:00
zamentur
2543e5c8ab 🎨 Format Python code with Black 2021-09-12 21:56:17 +00:00
ljf
6e714314f0 [enh] Support bytes in write_to_file 2021-09-12 23:55:40 +02:00
Weblate
3aef837cb5 Added translation using Weblate (Indonesian) 2021-09-10 01:05:47 +00:00
José M
c78ffe434d Translated using Weblate (Galician)
Currently translated at 100.0% (46 of 46 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/gl/
2021-09-07 12:04:25 +00:00
Tymofii-Lytvynenko
8765c8c6bf Translated using Weblate (Ukrainian)
Currently translated at 100.0% (46 of 46 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/uk/
2021-09-07 00:31:41 +00:00
Weblate
cb3b0c0170 Merge branch 'dev' of https://github.com/YunoHost/moulinette into dev 2021-09-06 11:13:56 +00:00
Alexandre Aubin
d0687b204b
Merge pull request #292 from YunoHost/actions/black
Format Python code with Black
2021-09-03 16:44:21 +02:00
alexAubin
fcf0f66655 🎨 Format Python code with Black 2021-09-03 14:43:55 +00:00
Éric Gaspar
78e221a8c3 Translated using Weblate (French)
Currently translated at 100.0% (46 of 46 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2021-09-03 14:43:32 +00:00
Alexandre Aubin
a2c51426cc
Merge pull request #293 from YunoHost/actions/i18n
Reformat locale files
2021-09-03 16:43:29 +02:00
Alexandre Aubin
9728fceb66 ci: fix names and PR body for i18n.yml 2021-09-03 16:42:52 +02:00
alexAubin
d5be65cbb7 🤖 Reformat locale files 2021-09-03 14:40:11 +00:00
Alexandre Aubin
298908d15a ci: Try to fix i18n.yml x_x 2021-09-03 16:39:51 +02:00
Alexandre Aubin
2226c0f25f
ci: fix indent in i18n.yml 2021-09-03 16:37:08 +02:00
Alexandre Aubin
f1b7e3005f ci: add actions to autoreformat locale files 2021-09-03 16:35:13 +02:00
Alexandre Aubin
10cb1ebefe
Merge pull request #289 from YunoHost/actions/black
Format Python code with Black
2021-09-03 15:56:37 +02:00
Alexandre Aubin
18439e368c
Merge pull request #291 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-09-03 15:56:15 +02:00
alexAubin
58fa26a5d5 🎨 Format Python code with Black 2021-09-03 13:53:54 +00:00
Éric Gaspar
e8a92a9c67 Translated using Weblate (French)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2021-09-03 13:53:31 +00:00
Parviz Homayun
563bbb785b Translated using Weblate (Persian)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fa/
2021-09-03 13:53:31 +00:00
Alexandre Aubin
f417c84cb5
Merge pull request #290 from YunoHost/enh-prompt-multiline
[enh] Add prefill and multiline in prompt
2021-09-03 15:53:26 +02:00
Alexandre Aubin
8909577b91 cli prompt: misc code improvements 2021-09-03 15:49:36 +02:00
Alexandre Aubin
e08d0139f6
cli promt: improve coe for yes/no parsing 2021-09-03 15:30:35 +02:00
ljf
bd557468d3 [enh] read_yaml support stream 2021-09-02 02:28:51 +02:00
Kayou
8218c2061a
moulinette is now compatible with python 3.9 \o/ 2021-09-01 17:46:39 +02:00
Kayou
3cb81a54fc
adding py39 to tox 2021-09-01 17:23:27 +02:00
Kay0u
4cacaefbfe
Run tests on branch bullseye too 2021-09-01 17:01:37 +02:00
Kay0u
bdec23b533
Run tests on python 3.9 2021-09-01 17:00:29 +02:00
Kay0u
4774e2a0a9
Merge branch 'dev' into bullseye 2021-09-01 16:58:54 +02:00
Alexandre Aubin
33c3753e1c
README: update description, translation and dev doc stuff 2021-09-01 16:04:17 +02:00
Alexandre Aubin
ed608e0f89
Fix workflow display name 2021-09-01 15:43:27 +02:00
Alexandre Aubin
4e9ad0f42e
swag: Add cool badge for test status 2021-09-01 15:42:46 +02:00
Alexandre Aubin
1335d4841d
Merge pull request #285 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-09-01 11:25:19 +02:00
Parviz Homayun
494fb936fe Translated using Weblate (Persian)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fa/
2021-08-31 01:22:49 +00:00
Parviz Homayun
59aa369367 Translated using Weblate (Persian)
Currently translated at 33.3% (15 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fa/
2021-08-30 19:21:14 +00:00
Weblate
e50dc56b68 Added translation using Weblate (Kurdish (Central)) 2021-08-30 14:14:37 +00:00
ljf
882caf4786 [enh] Add prefill and multiline in prompt 2021-08-30 14:43:14 +02:00
Weblate
f50a64ddf9 Added translation using Weblate (Persian) 2021-08-28 21:46:57 +00:00
Tymofii-Lytvynenko
04633619c6 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (45 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/uk/
2021-08-28 10:35:41 +00:00
Tymofii-Lytvynenko
ea78a3b671 Translated using Weblate (Ukrainian)
Currently translated at 4.4% (2 of 45 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/uk/
2021-08-28 10:35:41 +00:00
Tymofii-Lytvynenko
fd2380df01 Translated using Weblate (Ukrainian)
Currently translated at 1.8% (1 of 53 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/uk/
2021-08-28 10:35:41 +00:00
José M
ff19f78f5c Translated using Weblate (Galician)
Currently translated at 100.0% (53 of 53 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/gl/
2021-08-28 10:35:41 +00:00
ppr
f25113fe70 Translated using Weblate (French)
Currently translated at 100.0% (53 of 53 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2021-08-28 10:35:41 +00:00
Alexandre Aubin
e3ef1ced95
Merge pull request #288 from YunoHost/actions/black
Format Python code with Black
2021-08-28 12:35:37 +02:00
Alexandre Aubin
9b4b6d7009
Unused var 2021-08-28 12:35:28 +02:00
alexAubin
52c9e2a813 🎨 Format Python code with Black 2021-08-27 22:56:45 +00:00
Alexandre Aubin
6e1e034e10 More cookie/auth code cleanup 2021-08-28 00:56:08 +02:00
Alexandre Aubin
9c13472703 Actually delete cookie when logging out 2021-08-27 23:10:58 +02:00
Alexandre Aubin
8562c05d3b Add httponly to API cookies 2021-08-27 22:46:15 +02:00
Alexandre Aubin
3cc511db3a
Merge pull request #287 from YunoHost/actions/black
Format Python code with Black
2021-08-27 22:17:26 +02:00
alexAubin
fe84eba4ab 🎨 Format Python code with Black 2021-08-27 20:14:09 +00:00
Alexandre Aubin
55774ef8fc github actions: only check invalidcode, linting is to be auto-handled by black 2021-08-27 22:13:31 +02:00
Alexandre Aubin
7674efe97f Typo 2021-08-27 22:10:06 +02:00
Alexandre Aubin
37b995424f Remove old globals.py 2021-08-27 22:06:29 +02:00
Alexandre Aubin
0eaccab3b8 python3-argcomplete seems unused in practice... 2021-08-27 22:05:23 +02:00
Alexandre Aubin
ac94de6afd Attempt to simplify the moulinette_env mess 2021-08-27 22:03:17 +02:00
Alexandre Aubin
a263039958 Code cleanup / reorganize 2021-08-27 21:17:39 +02:00
Alexandre Aubin
5631719836 Zblgmfhpf remove cache tests :| 2021-08-27 20:54:56 +02:00
Alexandre Aubin
8d1025e32b Simplify overly complex code about cache management 2021-08-27 20:46:36 +02:00
Alexandre Aubin
2bb9b9a2eb Moaaar linter/test fixes zbgrbl 2021-08-27 19:48:04 +02:00
Alexandre Aubin
b0fd78657e Moaaaar lint/test fixes 2021-08-27 19:45:07 +02:00
Alexandre Aubin
3c4520a6d8 Moar fikses 2021-08-27 19:14:23 +02:00
Alexandre Aubin
b54f35dc32 Unused i18n keys 2021-08-27 19:02:16 +02:00
Alexandre Aubin
049523f2b6 Fix unused import / vars 2021-08-27 18:58:18 +02:00
Alexandre Aubin
5c982db4b6
Merge pull request #286 from YunoHost/actions/black
Format Python code with Black
2021-08-27 18:47:01 +02:00
alexAubin
c848185709 🎨 Format Python code with Black 2021-08-27 16:44:39 +00:00
Alexandre Aubin
5d0a23e827
Merge pull request #270 from YunoHost/rework-authenticator-system
Rework and externalize the authenticator system
2021-08-27 18:44:13 +02:00
Alexandre Aubin
e68de91a82 Merge branch 'dev' into rework-authenticator-system 2021-08-27 18:43:57 +02:00
Alexandre Aubin
e1f9fe1fcb
Merge pull request #284 from YunoHost/actions/black
Format Python code with Black
2021-08-25 21:04:49 +02:00
alexAubin
274a534beb 🎨 Format Python code with Black 2021-08-23 13:25:51 +00:00
Alexandre Aubin
4332860e39
Merge pull request #258 from YunoHost/enh-file-args
[enh] Allow file type in actionmaps
2021-08-23 15:25:22 +02:00
Alexandre Aubin
4574ea5fdb Merge branch 'dev' into enh-file-args 2021-08-23 15:22:00 +02:00
Alexandre Aubin
8d8299c5fe
Add autoblack github action (#283)
* Add autoblack github action

* autoblack: Uuuuh PR creation isnt triggered if black returns an error code ?

* autoblack: Only run autoblack when pushing on dev
2021-08-23 15:01:15 +02:00
Alexandre Aubin
6ff033d2dc Attempt to fix tests for CLI auth 2021-08-23 10:44:28 +02:00
Alexandre Aubin
fa509e6c2e Merge branch 'dev' into rework-authenticator-system 2021-08-22 22:33:33 +02:00
Alexandre Aubin
d7cb9cdcbb
Merge pull request #282 from YunoHost/i-can-haz-github-actions
I can haz github action?
2021-08-22 11:30:57 +02:00
Alexandre Aubin
941122ffbe Try to prevent duplicate jobs when working on a PR 2021-08-22 11:28:13 +02:00
Alexandre Aubin
32aea592e1 Forgot to mark some tests as skipped 2021-08-22 11:24:21 +02:00
Alexandre Aubin
fc96e2665a tests: Separate tests from linter 2021-08-22 11:18:24 +02:00
Alexandre Aubin
3e256f8e88 test: Make flake8 happy 2021-08-22 11:17:01 +02:00
Alexandre Aubin
2e2a41c59d Skip ldap tests because not working, dunno why but they are to be dropped or moved to Yunohost soon anyway 2021-08-22 10:55:27 +02:00
Alexandre Aubin
f3a52fada4 Drop python 3.9 tests because meh 2021-08-22 10:54:54 +02:00
Alexandre Aubin
27e7cd294a tests: improve/fix i18n tests 2021-08-20 14:18:54 +02:00
Alexandre Aubin
75e8914f10 test: Need moar ldap apt deps 2021-08-20 13:56:31 +02:00
Alexandre Aubin
fe8bc38ed2 tests: Try to fix tox-gh-action? 2021-08-20 13:49:50 +02:00
Alexandre Aubin
7932b8b71c tests: apt install needs sudo 2021-08-20 13:39:00 +02:00
Alexandre Aubin
f5b8115bbc .github/workflows with an 's' 2021-08-20 13:31:28 +02:00
Alexandre Aubin
bdc918ed72 Yolotry to replace travis tests with github action 2021-08-20 10:38:15 +02:00
Alexandre Aubin
9b8f18b116 Add test for i18n format consistency + fix strings 2021-08-20 10:29:51 +02:00
Alexandre Aubin
6ab93cfc86 Add a test for i18n keys 2021-08-20 10:24:46 +02:00
Alexandre Aubin
3585ba697a Remove the damn :s} in locale strings 2021-08-20 10:24:23 +02:00
Alexandre Aubin
b68e046ad0 Fix weird/misleading invalid_url message 2021-08-20 10:19:32 +02:00
Alexandre Aubin
3c0542ef24 Merge branch 'dev' into rework-authenticator-system 2021-08-20 10:13:02 +02:00
Alexandre Aubin
00123f900c Update changelog for 4.2.4 2021-08-19 19:26:43 +02:00
Alexandre Aubin
2a89a82660 Add warning when trying to feed non-string values to Popen env 2021-08-19 18:15:30 +02:00
Alexandre Aubin
4a57cac9c0
Merge pull request #279 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-08-17 18:41:59 +02:00
mifegui
e6a303a4cb Translated using Weblate (Portuguese)
Currently translated at 100.0% (56 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/pt/
2021-08-17 16:39:11 +00:00
Weblate
ca3295f1d6 Added translation using Weblate (Ukrainian) 2021-08-17 16:39:11 +00:00
Christian Wehrli
66e21e7ac9 Translated using Weblate (German)
Currently translated at 100.0% (56 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/de/
2021-08-17 16:39:11 +00:00
amirale qt
27673790b7 Translated using Weblate (Esperanto)
Currently translated at 100.0% (56 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/eo/
2021-08-17 16:39:11 +00:00
Éric Gaspar
e9f3ec2a3d Translated using Weblate (French)
Currently translated at 100.0% (56 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2021-08-17 16:39:11 +00:00
Alexandre Aubin
970643efb9
Merge pull request #281 from YunoHost/fix-warning-yaml
[fix] Avoid warning and use safeloader
2021-08-17 18:39:02 +02:00
ljf
9af308dd93 [fix] Avoid warning and use safeloader 2021-08-17 17:23:27 +02:00
ljf
29292583fa [fix] 500 error 2021-07-30 18:35:19 +02:00
ljf
36cac914d6 [enh] tox recommendation 2021-07-30 17:56:39 +02:00
ljf
a84ccb44cc [enh] Allow file type in actionmaps 2021-07-30 17:56:39 +02:00
Alexandre Aubin
8c8c1d4829 Missing default arg values for prompt/display 2021-07-09 21:55:15 +02:00
Alexandre Aubin
67d9c9cdd1 Get rid of msettings, replace with a convenient singleton class that also wraps prompt and display 2021-07-09 21:39:07 +02:00
Alexandre Aubin
ebdb1e22ee Further attempt to simplify authentication management code + get rid of msignals madness 2021-07-09 20:42:26 +02:00
Alexandre Aubin
6310ef5b6e [wip] Try to simplify authentication code more, properly differentiate credentials authentication vs. session authentication, trash the 'msignals' mess 2021-06-19 17:16:22 +02:00
Alexandre Aubin
f792166581 Naive rewrite of the Authenticator methods to avoid the mystic __call__ stuff, improve semantic 2021-06-15 17:58:12 +02:00
Alexandre Aubin
4345081e6f Rename 'password' into 'credentials' in authenticator stuff for semantic, because we could also need a login or other stuff 2021-06-14 17:23:41 +02:00
Alexandre Aubin
f985507761 Fix f-strings and linter 2021-06-13 19:09:24 +02:00
Alexandre Aubin
a012369164 Remove stale strings + add test for string inconsistencies 2021-06-13 19:05:30 +02:00
Alexandre Aubin
d0c569eead More cleaning up, test fixing 2021-06-13 18:51:13 +02:00
Alexandre Aubin
9b3bb1362c Clean old ldap stuff, naive attempt to fix tests 2021-06-13 16:20:34 +02:00
Alexandre Aubin
e2cb8cdfab Merge branch 'dev' into rework-authenticator-system 2021-06-13 15:34:22 +02:00
Alexandre Aubin
47673ea728 Update changelog for 4.2.3.3 2021-06-03 18:40:42 +02:00
ljf
2c9ec9f638 [fix] Damn array args bug 2021-06-03 18:01:43 +02:00
Alexandre Aubin
fcc9bfd4d1 Update changelog for 4.2.3.2 2021-06-02 20:24:20 +02:00
Alexandre Aubin
5aee9a224b
Merge pull request #278 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-06-02 20:20:42 +02:00
Alexandre Aubin
7c89e44404 Bullseye: idk what i'm doing but let's try to bump compat to 13 2021-05-28 01:06:18 +02:00
Alexandre Aubin
c1c517d5b2 Update changelog for 11.0 2021-05-28 01:06:18 +02:00
yahoo~~
037a170853 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (56 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/zh_Hans/
2021-05-27 14:47:38 +00:00
Alexandre Aubin
5e1ed4c331
Merge pull request #275 from YunoHost/free-the-cpu
wait 1s for message in call_async_output
2021-05-27 16:47:34 +02:00
Alexandre Aubin
b512c56b18 Update changelog for 4.2.3.1 2021-05-25 18:59:51 +02:00
Alexandre Aubin
9e907a5743
Merge pull request #277 from YunoHost/fix-request-params-not-decoded
[fix] Request params not decoded
2021-05-25 18:58:36 +02:00
ljf (zamentur)
f91fad08da
[fix] Request params not decoded 2021-05-25 13:35:04 +02:00
Alexandre Aubin
923aa7d963 Update changelog for 4.2.3 2021-05-24 17:35:27 +02:00
Alexandre Aubin
1cd9f889e3
Merge pull request #274 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-05-24 17:01:44 +02:00
yahoo~~
a0c86188d0 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (56 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/zh_Hans/
2021-05-23 22:07:47 +00:00
José M
60be338585 Translated using Weblate (Galician)
Currently translated at 100.0% (56 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/gl/
2021-05-23 22:07:47 +00:00
José M
4437ea3d31 Translated using Weblate (Galician)
Currently translated at 64.2% (36 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/gl/
2021-05-23 22:07:47 +00:00
José M
26c8f282d3 Translated using Weblate (Galician)
Currently translated at 37.5% (21 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/gl/
2021-05-23 22:07:47 +00:00
Weblate
a1b5a7a6db Added translation using Weblate (Galician) 2021-05-23 22:07:47 +00:00
Weblate
ad0786e6ea Added translation using Weblate (Finnish) 2021-05-23 22:07:47 +00:00
Alexandre Aubin
5b5d62f856
Merge pull request #276 from YunoHost/fix-damned-password-unicode
[fix] Unicode password doesn't log in
2021-05-24 00:07:42 +02:00
ljf (zamentur)
d9789364b4
[fix] Unicode password doesn't log in 2021-05-17 12:18:51 +02:00
Kayou
04b7f7bc6f
wait 1s for message in call_async_output 2021-05-13 23:28:52 +02:00
Alexandre Aubin
55e555aff5 Update changelog for 4.2.2 2021-05-08 15:12:31 +02:00
Alexandre Aubin
b5784c6d08
Remove requirement section in the README, the requirements are in debian/control ... 2021-05-08 14:51:11 +02:00
Alexandre Aubin
29fa7160fa
Merge pull request #273 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-04-26 16:25:58 +02:00
Éric Gaspar
3b7043e973 Translated using Weblate (French)
Currently translated at 100.0% (56 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2021-04-17 03:00:07 +00:00
Dominik Blahó
fe4fc35bcc Translated using Weblate (Hungarian)
Currently translated at 30.3% (17 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/hu/
2021-04-17 03:00:07 +00:00
Alexandre Aubin
e364e03fb9 Update changelog for 4.2.1 2021-04-17 04:59:37 +02:00
Alexandre Aubin
135fae95a8 For some reason yunohost-api don't want to start due to recent changes in actionamp, apply this trick for subcategories just like we do for categories 2021-04-16 00:06:42 +02:00
Alexandre Aubin
ebb2bda235
Update changelog for 4.2 (#272)
* Update changelog for 4.2

* changelog: Improving error semantic
2021-03-25 01:09:19 +01:00
Alexandre Aubin
a91cd096c5
Merge pull request #267 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-03-23 04:00:08 +01:00
Krzysztof Nowakowski
facf3fc3e5 Translated using Weblate (Polish)
Currently translated at 100.0% (56 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/pl/
2021-03-22 23:33:52 +00:00
Radek S
aee0224572 Translated using Weblate (Czech)
Currently translated at 100.0% (56 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/cs/
2021-03-22 23:33:52 +00:00
Achal Agrawal
a6547b0a03 Translated using Weblate (Hindi)
Currently translated at 60.7% (34 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/hi/
2021-03-22 23:33:52 +00:00
Miloš Kroulík
d2d008c1fb Translated using Weblate (Czech)
Currently translated at 3.5% (2 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/cs/
2021-03-22 23:33:52 +00:00
Alexandre Aubin
6b0737c63e
Merge pull request #271 from YunoHost/improve-error-semantic
Improve error semantic
2021-03-23 00:33:47 +01:00
Alexandre Aubin
e22aac9af0 Black 2021-03-23 00:24:33 +01:00
Alexandre Aubin
b17a6fa627 Attempt to fix test: handle argparse errors as validation errors 2021-03-23 00:12:15 +01:00
Alexandre Aubin
bc1bdbb247 Introduce validation errors, authentication errors, corresponding http codes 2021-03-12 03:55:52 +01:00
Alexandre Aubin
d6f82c91b8 These doc generators havent been updated in 6 years and most likely ain't used / relevant anymore ... 2021-03-12 03:18:36 +01:00
Alexandre Aubin
f790bde101 We don't need these wrapper classes, just call HTTPResponse directly 2021-03-12 03:14:34 +01:00
Alexandre Aubin
af0957c028 Rework and externalize the authenticator system 2021-03-09 05:43:09 +01:00
Kay0u
f7199f7a64
fix tests, I mean, really fixed this time 2021-03-01 10:52:24 +01:00
Kay0u
affb54f84d
fix tests 2021-03-01 10:45:50 +01:00
Alexandre Aubin
cafe68f30e Move LogPipe directly into process.py, we don't need to split that stuff on different files 2021-02-28 21:20:42 +01:00
Alexandre Aubin
e85b9f71d5 Handle the actual logging from the parent process, otherwise we run into a shitload of complex issues to interact with the websocket 2021-02-28 21:18:25 +01:00
Alexandre Aubin
cb5b8c74ec
Merge pull request #263 from YunoHost/unify-loggers
[fix] Logging
2021-02-28 17:33:24 +01:00
Alexandre Aubin
9670357f98 No need to display this message 2021-02-28 16:58:50 +01:00
Alexandre Aubin
16c43a67f7 Only report missing/failed translation as a warning, no need to report as exception... 2021-02-28 16:54:54 +01:00
Alexandre Aubin
cde45de0ba Add m18n helper to check that a key exist 2021-02-28 16:54:19 +01:00
Alexandre Aubin
bdd048197d Misc logging fixes 2021-01-31 16:14:06 +01:00
Alexandre Aubin
e7a01c68f5 Revert "[mod] unify all subloggers under moulinette.core"
This reverts commit c88f127b8c691c6121229402be4375fdc62ed6bf.
2021-01-31 16:14:06 +01:00
Laurent Peuch
9a35d77a08 [mod] better error message 2021-01-31 16:14:06 +01:00
Laurent Peuch
10576f7138 [mod] unify all subloggers under moulinette.core 2021-01-31 16:14:06 +01:00
Alexandre Aubin
cf98095303
Merge pull request #269 from YunoHost/fix-argparse
Fix argparse
2021-01-31 14:41:11 +01:00
Kayou
90f894b541
Do not encode strings for plain output 2021-01-30 11:13:53 +01:00
Kay0u
5cd0cb752b
Remove copy pasta 2021-01-26 21:38:09 +01:00
Kay0u
53cbca2c1e
Add test without action 2021-01-26 21:19:26 +01:00
Kay0u
1a95e6e779
Merge branch 'dev' into fix-argparse 2021-01-26 21:04:39 +01:00
Kayou
93977542b3
Merge pull request #268 from YunoHost/fixing-tests
Fixing tests
2021-01-26 18:05:32 +01:00
Kay0u
63ae3b677f
remove stdinfo 2021-01-26 16:38:36 +01:00
Kay0u
84d250c1c2
monkey patch _get_action_name 2021-01-26 12:05:25 +01:00
Kay0u
9077569c22
in python3 OrderedDict and array are not the same 2021-01-26 12:05:05 +01:00
Kay0u
6c61b9cceb
fix travis 2021-01-26 11:37:25 +01:00
Kay0u
d56f9ade4f
fix doc 2021-01-26 10:40:38 +01:00
Kay0u
c0e76df229
fix a warning during tests 2021-01-26 10:39:44 +01:00
Kayou
48d14f34d2
remove unused exception var 2021-01-25 23:24:24 +01:00
Kay0u
b1d576d615
fix process tests 2021-01-25 18:53:42 +01:00
Kay0u
ce3971093d
call_async_output: we can't use stdinfo in kwargs, close stdout, stderr and stdinfo if subprocess.Popen raise an exception 2021-01-25 18:53:33 +01:00
Kay0u
b0063c4293
fix ldap tests 2021-01-25 18:51:59 +01:00
Kay0u
dd6a419528
fix auth tests 2021-01-25 18:51:51 +01:00
Kay0u
53dd9fe973
fix actionsmap tests 2021-01-25 18:51:40 +01:00
Kay0u
771368a85c
remove old_slapdtest (only for python2) 2021-01-25 18:51:06 +01:00
Kay0u
c1c34c11e2
format code 2021-01-25 18:50:05 +01:00
Kay0u
4f5d957106
remove allow_failures for python3 2021-01-25 18:48:47 +01:00
Alexandre Aubin
ae4087d522
Merge pull request #257 from YunoHost/return-additional-error-data-to-api
Support more complex errors (be able to return additional data in a json structure)
2021-01-23 16:05:45 +01:00
Alexandre Aubin
3758b81137 Build doc with python3 ? 2021-01-20 06:07:47 +01:00
Alexandre Aubin
0de154678c Black again, with the right version this time.. 2021-01-20 05:59:24 +01:00
Alexandre Aubin
677efcf6d6 Black? 2021-01-20 05:46:05 +01:00
Alexandre Aubin
570e53234a Drop support for python2 2021-01-20 05:35:35 +01:00
Alexandre Aubin
19a40b6e9a Placeholder / bump version to 4.2 for unstable deb builds / CI stuff 2021-01-20 05:21:05 +01:00
Alexandre Aubin
8e70561f9c
Trash test in python 2.7, only keep 3.x 2021-01-20 00:31:51 +01:00
Alexandre Aubin
e4b70e3861
Merge pull request #228 from kay0u/enh-python3
Minimal change to support python3
2021-01-19 23:05:21 +01:00
Alexandre Aubin
8105718705
Merge branch 'dev' into enh-python3 2021-01-19 23:04:25 +01:00
Kay0u
1dac904e31
Update changelog for 4.1.4 2021-01-14 21:50:33 +01:00
Alexandre Aubin
755a475e5d We don't really care that there's 'nothing to update in ldap' 2021-01-13 02:30:39 +01:00
Alexandre Aubin
7333b6a342 Update changelog for 4.1.3 2021-01-08 03:15:32 +01:00
Alexandre Aubin
04890c4a61 Update changelog for 4.1.2 2021-01-07 00:29:00 +01:00
Alexandre Aubin
4dd1f4baf2
Merge pull request #260 from yunohost-bot/weblate-yunohost-moulinette
Translations update from Weblate
2021-01-06 18:29:47 +01:00
ppr
bc6287d330 Translated using Weblate (French)
Currently translated at 100.0% (56 of 56 strings)

Translation: YunoHost/moulinette
Translate-URL: https://translate.yunohost.org/projects/yunohost/moulinette/fr/
2021-01-06 00:34:08 +00:00
Alexandre Aubin
4bd33a64d9
Merge pull request #266 from YunoHost/fix-argparse
Fix https://github.com/YunoHost/yunohost/pull/1075#discussion_r551045491
2021-01-06 01:33:44 +01:00
Kay0u
9236727561
Fix https://github.com/YunoHost/yunohost/pull/1075#discussion_r551045491 2021-01-06 01:29:33 +01:00
Alexandre Aubin
793eddd1e3 I have no idea what i'm doing² 2021-01-02 18:26:09 +01:00
Alexandre Aubin
faeda4908d I have no idea what i'm doing 2021-01-02 17:46:49 +01:00
Alexandre Aubin
201b033606
Merge pull request #264 from YunoHost/kill_error_see_log
[mod] trash this UX madness that is error_see_logs and improve error messages
2021-01-01 16:21:15 +01:00
Laurent Peuch
f9454da5e7 [mod] trash this UX madness that is error_see_logs and improve error messages 2021-01-01 15:24:49 +01:00
Alexandre Aubin
c1213760f1 debian: don't build --with python2, and turns out X-Python-Version is obsolete in control 2021-01-01 05:16:18 +01:00
Alexandre Aubin
84f17f7830 Rework / simplify the whole story of call_async_output that was a complete mess and broken by Python 3 for some reason. New code should be much more simple and fix the synchronization between debug, info, warnings, and probably also more performant overall ? 2021-01-01 04:00:57 +01:00
Alexandre Aubin
d0b43f0e4a Merge branch 'dev' into enh-python3 2020-12-31 23:46:05 +01:00
Alexandre Aubin
0d58eff6a2 Misc encoding fixes 2020-12-31 23:45:48 +01:00
Laurent Peuch
2caf1234e8 [fix] no catchall exception 2020-12-31 23:44:23 +01:00
Alexandre Aubin
d3c7d12457 Update setup.py, tox.ini to python3 only 2020-12-31 19:42:12 +01:00
Alexandre Aubin
3ced2abcb7 python -> python3 in debian/control 2020-12-31 19:38:33 +01:00
Laurent Peuch
8566eaaa1f [mod] don't use catchall exceptions episode 2 2020-12-31 13:25:05 +01:00
Laurent Peuch
82bc0e829a [mod] don't use catchall exceptions 2020-12-31 12:30:57 +01:00
Alexandre Aubin
c7ba45596c
Merge pull request #259 from YunoHost/format-code
format
2020-12-30 22:27:31 +01:00
Kay0u
b06a117c18
Remove unused exception 2020-12-04 22:21:08 +01:00
Kay0u
1d73dac969
fix tests 2020-12-04 22:16:32 +01:00
Kay0u
bd27799283
Merge remote-tracking branch 'origin/dev' into enh-python3 2020-12-04 22:15:36 +01:00
Kay0u
b31e2b026e
format 2020-12-04 16:38:12 +01:00
Alexandre Aubin
dfb88418f1 Support more complex errors (be able to return additional data in a json structure) 2020-11-22 02:18:22 +01:00
Alexandre Aubin
6e5b389e71
Merge branch 'stretch-unstable' into enh-python3 2020-04-01 19:41:11 +02:00
Kay0u
641126e344
Minimal change to support python3 2019-12-20 16:09:57 +08:00
128 changed files with 2986 additions and 9381 deletions

35
.github/workflows/autoblack.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: Check / auto apply Black
on:
push:
branches:
- dev
jobs:
black:
name: Check / auto apply black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check files using the black formatter
uses: psf/black@stable
id: black
with:
options: "."
continue-on-error: true
- shell: pwsh
id: check_files_changed
run: |
# Diff HEAD with the previous commit
$diff = git diff
$HasDiff = $diff.Length -gt 0
Write-Host "::set-output name=files_changed::$HasDiff"
- name: Create Pull Request
if: steps.check_files_changed.outputs.files_changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Format Python code with Black"
commit-message: ":art: Format Python code with Black"
body: |
This pull request uses the [psf/black](https://github.com/psf/black) formatter.
base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch
branch: actions/black

29
.github/workflows/i18n.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: Autoreformat locale files
on:
push:
branches:
- dev
jobs:
i18n:
name: Autoreformat locale files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Apply reformating scripts
id: action_reformat
run: |
python3 test/remove_stale_i18n_strings.py
python3 test/autofix_locale_format.py
python3 test/reformat_locales.py
git diff -w --exit-code
- name: Create Pull Request
if: ${{ failure() }}
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Reformat locale files"
commit-message: ":robot: Reformat locale files"
body: |
Automatic pull request using the scripts in `test/`
base: ${{ github.head_ref }}
branch: actions/i18nreformat

49
.github/workflows/tox.yml vendored Normal file
View file

@ -0,0 +1,49 @@
name: Tests
on:
push:
branches:
- dev
- bullseye
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install apt dependencies
run: sudo apt install ldap-utils slapd libsasl2-dev libldap2-dev libssl-dev
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox -e py39-pytest
invalidcode:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Linter
run: tox -e py39-invalidcode
- name: Mypy
run: tox -e py39-mypy

View file

@ -1,31 +0,0 @@
language: python
addons:
apt:
packages:
- ldap-utils
- slapd
matrix:
allow_failures:
- env: TOXENV=py37-pytest
- env: TOXENV=py37-lint
include:
- python: 2.7
env: TOXENV=py27-pytest
- python: 2.7
env: TOXENV=py27-lint
- python: 3.7
env: TOXENV=py37-pytest
- python: 3.7
env: TOXENV=py37-lint
- python: 3.7
env: TOXENV=format-check
- python: 2.7
env: TOXENV=docs
install:
- pip install tox
script:
- tox

View file

@ -1,15 +1,18 @@
[![Build Status](https://travis-ci.org/YunoHost/moulinette.svg?branch=stretch-unstable)](https://travis-ci.org/YunoHost/moulinette)
[![GitHub license](https://img.shields.io/github/license/YunoHost/moulinette)](https://github.com/YunoHost/moulinette/blob/stretch-unstable/LICENSE)
<h1 align="center">Moulinette</h1>
Moulinette
==========
<div align="center">
![Version](https://img.shields.io/github/v/tag/yunohost/moulinette?label=version&sort=semver)
[![Tests status](https://github.com/YunoHost/moulinette/actions/workflows/tox.yml/badge.svg)](https://github.com/YunoHost/moulinette/actions/workflows/tox.yml)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/YunoHost/moulinette.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/YunoHost/moulinette/context:python)
[![GitHub license](https://img.shields.io/github/license/YunoHost/moulinette)](https://github.com/YunoHost/moulinette/blob/dev/LICENSE)
The *moulinette* is a Python package that allows to quickly and easily
prototype interfaces for your application.
Moulinette is a small Python framework meant to easily create programs with unified CLI and API.
<a href="https://translate.yunohost.org/engage/yunohost/?utm_source=widget">
<img src="https://translate.yunohost.org/widgets/yunohost/-/287x66-white.png" alt="Translation status" />
</a>
In particular, it is used as a base framework for the YunoHost project.
</div>
Issues
------
@ -19,42 +22,23 @@ Issues
Overview
--------
Initially, the moulinette was an application made for the
[YunoHost](https://yunohost.org/) project in order to regroup all its
related operations into a single program called *moulinette*. Those
operations were available from a command-line interface and a Web server
providing an API. Moreover, the usage of these operations (e.g.
required/optional arguments) was defined into a simple yaml file -
called *actionsmap*. This file was parsed in order to construct an
*ArgumentParser* object and to parse the command arguments to process
the proper operation.
Moulinette allows to create a YAML "actionmaps" that describes what commands are available. Moulinette will automatically make these commands available through the CLI and Web API, and will be mapped to a python function. Moulinette also provide some general helpers, for example for logging, i18n, authentication, or common file system operations.
During a long refactoring with the goal of unify both interfaces, the
idea to separate the core of the YunoHost operations has emerged.
The core kept the same name *moulinette* and try to follow the same
initial principle. An [Actions Map](#actions-map) - which defines
available operations and their usage - is parsed and it's used to
process an operation from several unified [Interfaces](#interfaces). It
also supports a configuration mechanism - which allows to restrict an
operation on an interface for example (see
[Authenticators](#authenticators)).
<div align="center"><img src="doc/actionsmap.png" width="700" /></div>
Translation
-----------
Dev Documentation
-----------------
You can help translate Moulinette on our [translation platform](https://translate.yunohost.org/engage/yunohost/?utm_source=widget)
https://moulinette.readthedocs.org
<div align="center"><img src="https://translate.yunohost.org/widgets/yunohost/-/moulinette/horizontal-auto.svg" alt="Translation status" /></div>
Requirements
------------
Developpers
-----------
* Python 2.7
* python-bottle (>= 0.10)
* python-ldap (>= 2.4)
* PyYAML
Testing
-------
- You can learn how to get started with developing on YunoHost by reading [this piece of documentation](https://yunohost.org/dev).
- Specific doc for moulinette: https://moulinette.readthedocs.org
- Run tests with:
```
$ pip install tox

279
debian/changelog vendored
View file

@ -1,3 +1,282 @@
moulinette (11.2.1) stable; urgency=low
- repo chores: various black enhancements
- [i18n] Translations updated for Arabic, Basque, Catalan, Chinese (Simplified), Czech, Dutch, English, Esperanto, French, Galician, German, Hindi, Indonesian, Italian, Japanese, Nepali, Norwegian Bokmål, Persian, Polish, Portuguese, Russian, Spanish, Swedish, Turkish, Ukrainian
Thanks to all contributors <3 ! (Alexandre Aubin, Francescc, José M, Metin Bektas, ppr, Psycojoker, rosbeef andino, Tagada, xabirequejo, xaloc33)
-- OniriCorpe <oniricorpe@yunohost.org> Sun, 19 May 2024 23:49:00 +0200
moulinette (11.2) stable; urgency=low
- [i18n] Translations updated for Japanese
Thanks to all contributors <3 ! (motcha)
-- Alexandre Aubin <alex.aubin@mailoo.org> Mon, 17 Jul 2023 16:32:34 +0200
moulinette (11.1.5) stable; urgency=low
- setup.py: fix version specifier in python_requires, python tooling not happy with * i guess (2373a7fa)
- auth: prevent stupid issue where outdated cookie usage would trigger error 500 intead of 401, resulting in a ~bug after Yunohost self-upgrade and the webadmin is confused about the API not being up again (c06e1a91)
- i18n: Translations updated for Chinese (Simplified), Indonesian, Japanese
Thanks to all contributors <3 ! (liimee, motcha, Neko Nekowazarashi, Poesty Li)
-- Alexandre Aubin <alex.aubin@mailoo.org> Mon, 10 Jul 2023 21:32:20 +0200
moulinette (11.1.4) stable; urgency=low
- Releasing as stable
-- Alexandre Aubin <alex.aubin@mailoo.org> Wed, 01 Feb 2023 20:28:56 +0100
moulinette (11.1.2.1) testing; urgency=low
- Handle calling 'yunohost' with no args more gracefully (4c03e16d)
- [i18n] Translations updated for Arabic
Thanks to all contributors <3 ! (ButterflyOfFire)
-- Alexandre Aubin <alex.aubin@mailoo.org> Mon, 30 Jan 2023 16:34:23 +0100
moulinette (11.1.2) testing; urgency=low
- legacy: Remove the 'global argument' mechanism ... we only use it for --version and it's just batshit overly complicated for what this achieves... (50b19a95, 80873777, 7f4e8b39)
- Dont take lock for read/GET operations ([#327](https://github.com/yunohost/moulinette/pull/327))
- [i18n] Translations updated for Arabic, Basque, Dutch
Thanks to all contributors <3 ! (André Koot, ButterflyOfFire, xabirequejo)
-- Alexandre Aubin <alex.aubin@mailoo.org> Fri, 06 Jan 2023 00:37:23 +0100
moulinette (11.1.0) testing; urgency=low
- Bump version for testing release
-- Alexandre Aubin <alex.aubin@mailoo.org> Wed, 26 Oct 2022 16:15:37 +0200
moulinette (11.0.9) stable; urgency=low
- Bump version for stable release
-- Alexandre Aubin <alex.aubin@mailoo.org> Sun, 07 Aug 2022 23:30:35 +0200
moulinette (11.0.8) testing; urgency=low
- [fix] random_ascii helper was generating inconsistent string length (4239f466)
- [i18n] Translations updated for German, Polish, Slovak
Thanks to all contributors <3 ! (Gregor, Jose Riha, Radek Raczkowski)
-- Alexandre Aubin <alex.aubin@mailoo.org> Sun, 07 Aug 2022 11:55:06 +0200
moulinette (11.0.7) testing; urgency=low
- [i18n] Translations updated for Spanish
Thanks to all contributors <3 ! (JimScope, Alexandre Aubin)
-- tituspijean <titus+yunohost@pijean.ovh> Wed, 18 May 2022 00:02:25 +0200
moulinette (11.0.6) testing; urgency=low
- [enh] cli: Add possibility to hide commands in --help (cb9ecb46)
- [i18n] Translations updated for Finnish, Galician
Thanks to all contributors <3 ! (Alexandre Aubin, alexAubin, José M, Mico Hauataluoma, Weblate)
-- Kay0u <pierre@kayou.io> Tue, 29 Mar 2022 14:23:40 +0200
moulinette (11.0.2) testing; urgency=low
- [fix] Various tweaks for Python 3.9
- [fix] cli: Adapt prompt_toolkit call because now using the v3.x of the lib (d901d28a, 12218bcb, c44e0252)
- [mod] refactor: Rework actionsmap and m18n init, drop multiple actionsmap support (9fcc9630)
- [mod] api: Move cookie session management logic to the authenticator for more flexibility ([#311](https://github.com/YunoHost/moulinette/pull/311))
Thanks to all contributors <3 ! (Kay0u)
-- Alexandre Aubin <alex.aubin@mailoo.org> Wed, 19 Jan 2022 21:15:58 +0100
moulinette (4.4.0) testing; urgency=low
- Bump version for 4.4 release
-- Alexandre Aubin <alex.aubin@mailoo.org> Wed, 19 Jan 2022 21:10:44 +0100
moulinette (4.3.3.1) stable; urgency=low
- [i18n] Translations updated for Dutch, Finnish, German
Thanks to all contributors <3 ! (Boudewijn, Gregor, Kay0u, Mico Hauataluoma)
-- Alexandre Aubin <alex.aubin@mailoo.org> Wed, 19 Jan 2022 21:10:44 +0100
moulinette (4.3.3) stable; urgency=low
- [enh] quality: Apply pyupgrade ([#312](https://github.com/YunoHost/moulinette/pull/312))
- [i18n] Translations updated for Czech, German, Portuguese
Thanks to all contributors <3 ! (Bram, Christian Wehrli, maique madeira, Radek S, Valentin von Guttenberg)
-- Alexandre Aubin <alex.aubin@mailoo.org> Wed, 29 Dec 2021 01:08:10 +0100
moulinette (4.3.2.2) stable; urgency=low
Aaaaaand typoed 'testing' instead of 'stable' in previous changelog
-- Alexandre Aubin <alex.aubin@mailoo.org> Mon, 15 Nov 2021 18:44:09 +0100
moulinette (4.3.2.1) testing; urgency=low
- [fix] api: 'Missing credentials parameter' bug : request.POST is buggy when value contains special chars ... request.params appears to be more reliable (c5f577c0)
- [fix] api: issue with accented chars in form .. decode() is not needed anymore? (c5700f1b)
- [i18n] Translations updated for Chinese (Simplified), Italian
Thanks to all contributors <3 ! (dagangtie, Flavio Cristoforetti)
-- Alexandre Aubin <alex.aubin@mailoo.org> Mon, 15 Nov 2021 18:44:09 +0100
moulinette (4.3.2) stable; urgency=low
- Bump version for stable release
-- Alexandre Aubin <alex.aubin@mailoo.org> Fri, 05 Nov 2021 02:35:56 +0100
moulinette (4.3.1.2) testing; urgency=low
- [i18n] Translations updated for Basque, Occitan, Russian, Spanish
Thanks to all contributors <3 ! (Page Asgardius, punkrockgirl, Quentí, Semen Turchikhin)
-- Alexandre Aubin <alex.aubin@mailoo.org> Wed, 03 Nov 2021 18:42:44 +0100
moulinette (4.3.1.1) testing; urgency=low
- [enh] Add cp helper (14e37366)
-- Alexandre Aubin <alex.aubin@mailoo.org> Mon, 04 Oct 2021 01:24:34 +0200
moulinette (4.3.1) testing; urgency=low
- [mod] Rework cli prompt mecanisc ([#303](https://github.com/YunoHost/moulinette/pull/303))
- [i18n] Translations updated for Indonesian, Russian, Turkish
Thanks to all contributors <3 ! (Éric Gaspar, liimee)
-- Alexandre Aubin <alex.aubin@mailoo.org> Wed, 29 Sep 2021 22:37:28 +0200
moulinette (4.3.0) testing; urgency=low
- [enh] Allow file type in actionmaps ([#258](https://github.com/YunoHost/moulinette/pull/258))
- [refactor] Rework and externalize the authenticator system ([#270](https://github.com/YunoHost/moulinette/pull/270))
- [security] Add httponly to API cookies (8562c05d)
- [enh] Add prefill and multiline in prompt ([#290](https://github.com/YunoHost/moulinette/pull/290), 08f7866f)
- [enh] Support bytes/stream in write_to_file (6e714314)
- [fix] Various technical bugs in utils/process.py (fdc61c91, 4eb60dac, 3741101d)
- [i18n] Translations updated for French, Galician, Persian, Ukrainian
Thanks to all contributors <3 ! (Éric Gaspar, José M, Kay0u, ljf, Parviz Homayun, ppr, Tymofii-Lytvynenko)
-- Alexandre Aubin <alex.aubin@mailoo.org> Sun, 19 Sep 2021 21:19:43 +0200
moulinette (4.2.4) stable; urgency=low
- [fix] Avoid warning and use safeloader ([#281](https://github.com/YunoHost/moulinette/pull/281))
- [fix] Add warning when trying to feed non-string values to Popen env (2a89a82)
- [i18n] Translations updated for Esperanto, French, German, Portuguese
Thanks to all contributors <3 ! (amirale qt, Christian Wehrli, Éric Gaspar, ljf, mifegui)
-- Alexandre Aubin <alex.aubin@mailoo.org> Thu, 19 Aug 2021 19:25:30 +0200
moulinette (4.2.3.3) stable; urgency=low
- [fix] Damn array args bug (2c9ec9f6)
Thanks to all contributors <3 ! (ljf)
-- Alexandre Aubin <alex.aubin@mailoo.org> Thu, 03 Jun 2021 18:40:18 +0200
moulinette (4.2.3.2) stable; urgency=low
- [fix] wait 1s for message in call_async_output, prevent CPU overload ([#275](https://github.com/YunoHost/moulinette/pull/275))
- [i18n] Translations updated for Chinese (Simplified)
Thanks to all contributors <3 ! (Kayou, yahoo)
-- Alexandre Aubin <alex.aubin@mailoo.org> Wed, 02 Jun 2021 20:23:31 +0200
moulinette (4.2.3.1) stable; urgency=low
- [fix] Request params not decoded ([#277](https://github.com/YunoHost/moulinette/pull/277))
Thanks to all contributors <3 ! (ljf)
-- Alexandre Aubin <alex.aubin@mailoo.org> Tue, 25 May 2021 18:59:01 +0200
moulinette (4.2.3) stable; urgency=low
- [fix] Unicode password doesn't log in ([#276](https://github.com/YunoHost/moulinette/pull/276))
- [i18n] Translations updated for Chinese (Simplified), Galician
Thanks to all contributors <3 ! (José M, ljf, yahoo)
-- Alexandre Aubin <alex.aubin@mailoo.org> Mon, 24 May 2021 17:34:19 +0200
moulinette (4.2.2) stable; urgency=low
- [i18n] Translations updated for French, Hungarian
- Release as stable
Thanks to all contributors <3 ! (Dominik Blahó, Éric Gaspar)
-- Alexandre Aubin <alex.aubin@mailoo.org> Sat, 08 May 2021 15:10:01 +0200
moulinette (4.2.1) testing; urgency=low
- Fix weird technical thing in actionmap sucategories loading, related to recent changes in Yunohost actionmap (135fae95)
-- Alexandre Aubin <alex.aubin@mailoo.org> Sat, 17 Apr 2021 04:58:10 +0200
moulinette (4.2.0) testing; urgency=low
- [mod] Python2 -> python3 ([#228](https://github.com/YunoHost/moulinette/pull/228), 8e70561f, 570e5323, 3758b811, 90f894b5, [#269](https://github.com/YunoHost/moulinette/pull/269), e85b9f71, cafe68f3)
- [mod] Code formatting, test fixing, cleanup (677efcf6, 0de15467, [#268](https://github.com/YunoHost/moulinette/pull/268), affb54f8, f7199f7a, d6f82c91)
- [enh] Improve error semantic such that the webadmin shall be able to redirect to the proper log view ([#257](https://github.com/YunoHost/moulinette/pull/257), [#271](https://github.com/YunoHost/moulinette/pull/271))
- [fix] Simpler and more consistent logging initialization ([#263](https://github.com/YunoHost/moulinette/pull/263))
Thanks to all contributors <3 ! (Kay0u, Laurent Peuch)
-- Alexandre Aubin <alex.aubin@mailoo.org> Fri, 19 Mar 2021 18:39:42 +0100
moulinette (4.1.4) stable; urgency=low
- [enh] Remove useless warning
- Stable release
Thanks to all contributors <3 ! (Aleks)
-- Kayou <pierre@kayou.io> Thu, 14 Jan 2021 21:49:37 +0100
moulinette (4.1.3) stable; urgency=low
- Stable release
-- Alexandre Aubin <alex.aubin@mailoo.org> Fri, 08 Jan 2021 03:15:05 +0100
moulinette (4.1.2) testing; urgency=low
- [mod] Misc code cleanup ([#259](https://github.com/YunoHost/moulinette/pull/259), 82bc0e82, 8566eaaa, 2caf1234)
- [mod] Improve error messages ([#264](https://github.com/YunoHost/moulinette/pull/264))
- [fix] Minor issue about 'comment' in actionmaps ([#266](https://github.com/YunoHost/moulinette/pull/266))
- [i18n] Improve translation for French
Thanks to all contributors <3 ! (Kay0u, Bram, ppr)
-- Alexandre Aubin <alex.aubin@mailoo.org> Thu, 07 Jan 2021 00:23:44 +0100
moulinette (4.1.1) testing; urgency=low
- [enh] Add options to write_to_json ([#261](https://github.com/YunoHost/moulinette/pull/261))

1
debian/compat vendored
View file

@ -1 +0,0 @@
9

21
debian/control vendored
View file

@ -2,22 +2,21 @@ Source: moulinette
Section: python
Priority: optional
Maintainer: YunoHost Contributors <contrib@yunohost.org>
Build-Depends: debhelper (>= 9), python (>= 2.7), dh-python, python-setuptools, python-psutil, python-all (>= 2.7)
Build-Depends: debhelper (>= 9), debhelper-compat (= 13), python3 (>= 3.7), dh-python, python3-setuptools, python3-psutil, python3-all (>= 3.7)
Standards-Version: 3.9.6
X-Python-Version: >= 2.7
Homepage: https://github.com/YunoHost/moulinette
Package: moulinette
Architecture: all
Depends: ${misc:Depends}, ${python:Depends},
python-ldap,
python-yaml,
python-bottle (>= 0.12),
python-gevent-websocket,
python-argcomplete,
python-toml,
python-psutil,
python-tz
Depends: ${misc:Depends}, ${python3:Depends},
python3-yaml,
python3-bottle (>= 0.12),
python3-gevent-websocket,
python3-toml,
python3-psutil,
python3-tz,
python3-prompt-toolkit,
python3-pygments
Breaks: yunohost (<< 4.1)
Description: prototype interfaces with ease in Python
Quickly and easily prototype interfaces for your application.

4
debian/rules vendored
View file

@ -1,4 +1,6 @@
#!/usr/bin/make -f
export PYBUILD_NAME=moulinette
%:
dh $@ --with python2 --buildsystem=python_distutils
dh $@ --with python3 --buildsystem=pybuild

View file

@ -18,18 +18,21 @@
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))
import sys
from mock import Mock as MagicMock
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()
return MagicMock()
MOCK_MODULES = ['ldap', 'ldap.modlist', 'ldap.sasl']
MOCK_MODULES = ["ldap", "ldap.modlist", "ldap.sasl"]
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
@ -42,36 +45,38 @@ sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.viewcode']
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"
# The master toctree document.
master_doc = 'index'
master_doc = "index"
# General information about the project.
project = u'Moulinette'
copyright = u'2017, YunoHost Collective'
author = u'YunoHost Collective'
project = "Moulinette"
copyright = "2017, YunoHost Collective"
author = "YunoHost Collective"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'2.6.1'
version = "2.6.1"
# The full version, including alpha/beta/rc tags.
release = u'2.6.1'
release = "2.6.1"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -83,10 +88,10 @@ language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
@ -97,7 +102,7 @@ todo_include_todos = True
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'classic'
html_theme = "classic"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@ -108,7 +113,7 @@ html_theme = 'classic'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
@ -116,11 +121,11 @@ html_static_path = ['_static']
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
"**": [
# 'about.html',
# 'navigation.html',
# 'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
"searchbox.html",
# 'donate.html',
]
}
@ -129,7 +134,7 @@ html_sidebars = {
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'Moulinettedoc'
htmlhelp_basename = "Moulinettedoc"
# -- Options for LaTeX output ---------------------------------------------
@ -138,15 +143,12 @@ latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
@ -156,8 +158,13 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Moulinette.tex', u'Moulinette Documentation',
u'YunoHost Collective', 'manual'),
(
master_doc,
"Moulinette.tex",
"Moulinette Documentation",
"YunoHost Collective",
"manual",
),
]
@ -165,10 +172,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'moulinette', u'Moulinette Documentation',
[author], 1)
]
man_pages = [(master_doc, "moulinette", "Moulinette Documentation", [author], 1)]
# -- Options for Texinfo output -------------------------------------------
@ -177,13 +181,17 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Moulinette', u'Moulinette Documentation',
author, 'Moulinette', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"Moulinette",
"Moulinette Documentation",
author,
"Moulinette",
"One line description of project.",
"Miscellaneous",
),
]
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {"https://docs.python.org/": None}

View file

@ -22,7 +22,6 @@ a reference.
utils/filesystem
utils/network
utils/process
utils/stream
utils/text
Indices and tables

View file

@ -434,7 +434,7 @@ Here is how it's used (I don't understand why a path is not provided):
And here is its docstring:
.. automethod:: moulinette.authenticators.ldap.Authenticator.update
.. automethod:: moulinette.authenticators.ldap.Authenticator.validate_uniqueness
Get conflict
============

View file

@ -34,7 +34,7 @@ ldapsearch -x -b 'dc=nodomain' | \\
import sys
class Element(object):
class Element:
"""Represents an LDIF entry."""
def __init__(self):
@ -43,7 +43,7 @@ class Element(object):
def __repr__(self):
"""Returns a basic state dump."""
return 'Element' + str(self.index) + str(self.attributes)
return "Element" + str(self.index) + str(self.attributes)
def add(self, line):
"""Adds a line of input to the object.
@ -57,10 +57,10 @@ class Element(object):
"""
def _valid(line):
return line and not line.startswith('#')
return line and not line.startswith("#")
def _interesting(line):
return line != 'objectClass: top'
return line != "objectClass: top"
if self.is_valid() and not _valid(line):
return True
@ -70,11 +70,11 @@ class Element(object):
def is_valid(self):
"""Indicates whether a valid entry has been read."""
return len(self.attributes) != 0 and self.attributes[0].startswith('dn: ')
return len(self.attributes) != 0 and self.attributes[0].startswith("dn: ")
def dn(self):
"""Returns the DN for this entry."""
if self.attributes[0].startswith('dn: '):
if self.attributes[0].startswith("dn: "):
return self.attributes[0][4:]
else:
return None
@ -86,12 +86,12 @@ class Element(object):
Element objects) and returns a string which declares a DOT edge, or an
empty string, if no parent was found.
"""
dn_components = self.dn().split(',')
dn_components = self.dn().split(",")
for i in range(1, len(dn_components) + 1):
parent = ','.join(dn_components[i:])
parent = ",".join(dn_components[i:])
if parent in dnmap:
return ' n%d->n%d\n' % (dnmap[parent].index, self.index)
return ''
return " n%d->n%d\n" % (dnmap[parent].index, self.index)
return ""
def dot(self, dnmap):
"""Returns a text representation of the node and perhaps its parent edge.
@ -99,6 +99,7 @@ class Element(object):
Args:
- dnmap: dictionary mapping dn names to Element objects
"""
def _format(attributes):
result = [TITLE_ENTRY_TEMPALTE % attributes[0]]
@ -107,9 +108,14 @@ class Element(object):
return result
return TABLE_TEMPLATE % (self.index, '\n '.join(_format(self.attributes)), self.edge(dnmap))
return TABLE_TEMPLATE % (
self.index,
"\n ".join(_format(self.attributes)),
self.edge(dnmap),
)
class Converter(object):
class Converter:
"""An LDIF to DOT converter."""
def __init__(self):
@ -144,7 +150,11 @@ class Converter(object):
e = Element()
if e.is_valid():
self._append(e)
return (BASE_TEMPLATE % (name, ''.join([e.dot(self.dnmap) for e in self.elements])))
return BASE_TEMPLATE % (
name,
"".join([e.dot(self.dnmap) for e in self.elements]),
)
BASE_TEMPLATE = """\
strict digraph "%s" {
@ -191,13 +201,13 @@ ENTRY_TEMPALTE = """\
"""
if __name__ == '__main__':
if __name__ == "__main__":
if len(sys.argv) > 2:
raise 'Expected at most one argument.'
raise "Expected at most one argument."
elif len(sys.argv) == 2:
name = sys.argv[1]
file = open(sys.argv[1], 'r')
file = open(sys.argv[1], "r")
else:
name = '<stdin>'
name = "<stdin>"
file = sys.stdin
print Converter().parse(file, name)
print(Converter().parse(file, name))

View file

@ -4,3 +4,4 @@ Process operation utils
.. autofunction:: moulinette.utils.process.check_output
.. autofunction:: moulinette.utils.process.call_async_output
.. autofunction:: moulinette.utils.process.run_commands
.. autofunction:: moulinette.utils.process.LogPipe

View file

@ -1,4 +0,0 @@
Stream operation utils
======================
.. autofunction:: moulinette.utils.stream.async_file_reading

View file

@ -1,181 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" License
Copyright (C) 2013 YunoHost
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, see http://www.gnu.org/licenses
"""
"""
Generate JSON specification files API
"""
import os
import sys
import yaml
import json
import requests
from yunohost import str_to_func, __version__
def main():
"""
"""
with open('action_map.yml') as f:
action_map = yaml.load(f)
try:
with open('/etc/yunohost/current_host', 'r') as f:
domain = f.readline().rstrip()
except IOError:
domain = requests.get('http://ip.yunohost.org').text
with open('action_map.yml') as f:
action_map = yaml.load(f)
resource_list = {
'apiVersion': __version__,
'swaggerVersion': '1.1',
'basePath': 'http://'+ domain + ':6767',
'apis': []
}
resources = {}
del action_map['general_arguments']
for category, category_params in action_map.items():
if 'category_help' not in category_params: category_params['category_help'] = ''
resource_path = '/api/'+ category
resource_list['apis'].append({
'path': resource_path,
'description': category_params['category_help']
})
resources[category] = {
'apiVersion': __version__,
'swaggerVersion': '1.1',
'basePath': 'http://'+ domain + ':6767',
'apis': []
}
resources[category]['resourcePath'] = resource_path
registered_paths = {}
for action, action_params in category_params['actions'].items():
if 'action_help' not in action_params:
action_params['action_help'] = ''
if 'api' not in action_params:
action_params['api'] = 'GET /'+ category +'/'+ action
method, path = action_params['api'].split(' ')
key_param = ''
if '{' in path:
key_param = path[path.find("{")+1:path.find("}")]
notes = ''
if str_to_func('yunohost_'+ category +'.'+ category +'_'+ action) is None:
notes = 'Not yet implemented'
operation = {
'httpMethod': method,
'nickname': category +'_'+ action,
'summary': action_params['action_help'],
'notes': notes,
'errorResponses': []
}
if 'arguments' in action_params:
operation['parameters'] = []
for arg_name, arg_params in action_params['arguments'].items():
if 'help' not in arg_params:
arg_params['help'] = ''
param_type = 'query'
allow_multiple = False
required = True
allowable_values = None
name = arg_name.replace('-', '_')
if name[0] == '_':
required = False
if 'full' in arg_params:
name = arg_params['full'][2:]
else:
name = name[2:]
name = name.replace('-', '_')
if 'nargs' in arg_params:
if arg_params['nargs'] == '*':
allow_multiple = True
required = False
if arg_params['nargs'] == '+':
allow_multiple = True
required = True
else:
allow_multiple = False
if 'choices' in arg_params:
allowable_values = {
'valueType': 'LIST',
'values': arg_params['choices']
}
if 'action' in arg_params and arg_params['action'] == 'store_true':
allowable_values = {
'valueType': 'LIST',
'values': ['true', 'false']
}
if name == key_param:
param_type = 'path'
required = True
allow_multiple = False
parameters = {
'paramType': param_type,
'name': name,
'description': arg_params['help'],
'dataType': 'string',
'required': required,
'allowMultiple': allow_multiple
}
if allowable_values is not None:
parameters['allowableValues'] = allowable_values
operation['parameters'].append(parameters)
if path in registered_paths:
resources[category]['apis'][registered_paths[path]]['operations'].append(operation)
resources[category]['apis'][registered_paths[path]]['description'] = ''
else:
registered_paths[path] = len(resources[category]['apis'])
resources[category]['apis'].append({
'path': path,
'description': action_params['action_help'],
'operations': [operation]
})
try: os.listdir(os.getcwd() +'/doc')
except OSError: os.makedirs(os.getcwd() +'/doc')
for category, api_dict in resources.items():
with open(os.getcwd() +'/doc/'+ category +'.json', 'w') as f:
json.dump(api_dict, f)
with open(os.getcwd() +'/doc/resources.json', 'w') as f:
json.dump(resource_list, f)
if __name__ == '__main__':
sys.exit(main())

View file

@ -1,114 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" License
Copyright (C) 2013 YunoHost
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, see http://www.gnu.org/licenses
"""
"""
Generate function header documentation
"""
import os
import sys
import yaml
import re
def main():
"""
"""
with open('action_map.yml') as f:
action_map = yaml.load(f)
resources = {}
del action_map['general_arguments']
for category, category_params in action_map.items():
if 'category_help' not in category_params: category_params['category_help'] = ''
with open('yunohost_'+ category +'.py', 'r') as f:
lines = f.readlines()
with open('yunohost_'+ category +'.py', 'w') as f:
in_block = False
for line in lines:
if in_block:
if re.search(r'^"""', line):
in_block = False
f.write('\n')
f.write(' '+ category_params['category_help'] +'\n')
f.write('"""\n')
else:
f.write(line)
if re.search(r'^""" yunohost_'+ category, line):
in_block = True
for action, action_params in category_params['actions'].items():
if 'action_help' not in action_params:
action_params['action_help'] = ''
help_lines = [
' """',
' '+ action_params['action_help'],
''
]
if 'arguments' in action_params:
help_lines.append(' Keyword argument:')
for arg_name, arg_params in action_params['arguments'].items():
if 'help' in arg_params:
help = ' -- '+ arg_params['help']
else:
help = ''
name = arg_name.replace('-', '_')
if name[0] == '_':
required = False
if 'full' in arg_params:
name = arg_params['full'][2:]
else:
name = name[2:]
name = name.replace('-', '_')
help_lines.append(' '+ name + help)
help_lines.append('')
help_lines.append(' """')
with open('yunohost_'+ category +'.py', 'r') as f:
lines = f.readlines()
with open('yunohost_'+ category +'.py', 'w') as f:
in_block = False
first_quotes = True
for line in lines:
if in_block:
if re.search(r'^ """', line):
if first_quotes:
first_quotes = False
else:
in_block = False
for help_line in help_lines:
f.write(help_line +'\n')
else:
f.write(line)
if re.search(r'^def '+ category +'_'+ action +'\(', line):
in_block = True
if __name__ == '__main__':
sys.exit(main())

View file

@ -1,60 +1,47 @@
{
"argument_required": "المُعامِل '{argument}' مطلوب",
"authentication_profile_required": "المصادقة مع الملف الشخصي '{profile}' مطلوبة",
"authentication_required": "المصادقة مطلوبة",
"authentication_required_long": "المصادقة مطلوبة قبل القيام بهذا الإجراء",
"colon": "{}: ",
"confirm": "تأكيد {prompt}",
"deprecated_command": "'{prog} {command}' تم التخلي عنه و سوف تتم إزالته مستقبلا",
"deprecated_command_alias": "'{prog} {old}' تم التخلي عنه و سوف يتم إزالته مستقبلا، إستخدم '{prog} {new}' بدلا من ذلك",
"error": "خطأ :",
"error_see_log": "طرأ هناك خطأ. يرجى الإطلاع على السجلات للمزيد مِن التفاصيل على المسار /var/log/yunohost/.",
"file_exists": "إنّ الملف موجود من قبل : '{path}'",
"file_not_exist": "الملف غير موجود : '{path}'",
"folder_exists": "إنّ المجلد موجود من قبل : '{path}'",
"folder_not_exist": "المجلد غير موجود",
"instance_already_running": "هناك بالفعل عملية YunoHost جارية. الرجاء الانتظار حتى ينتهي الأمر قبل تشغيل آخر.",
"invalid_argument": "المُعامِل غير صالح '{argument}': {error}",
"invalid_password": "كلمة السر خاطئة",
"invalid_usage": "إستعمال غير صالح، إستخدم --help لعرض المساعدة",
"ldap_attribute_already_exists": "الخاصية '{attribute}' موجودة مسبقا و تحمل القيمة '{value}'",
"ldap_server_down": "لا يمكن الإتصال بخادم LDAP",
"logged_in": "مُتّصل",
"logged_out": "تم تسجيل خروجك",
"not_logged_in": "لم تقم بعدُ بتسجيل دخولك",
"operation_interrupted": "تم توقيف العملية",
"password": "كلمة السر",
"pattern_not_match": "لا يتطابق مع النموذج",
"permission_denied": "رُفض التصريح",
"root_required": "يتوجب عليك أن تكون مدير الجذر root للقيام بهذا الإجراء",
"server_already_running": "هناك خادم يشتغل على ذاك المنفذ",
"success": "تم بنجاح !",
"unable_authenticate": "تعذرت المصادقة",
"unable_retrieve_session": "تعذرت مواصلة الجلسة بسبب '{exception}'",
"unknown_group": "الفريق '{group}' مجهول",
"unknown_user": "المستخدم '{user}' مجهول",
"values_mismatch": "القيمتين غير متطابقتين",
"warning": "تحذير :",
"websocket_request_expected": "كان ينتظر طلبًا عبر الويب سوكت WebSocket",
"cannot_open_file": "ليس بالإمكان فتح الملف {file:s} (السبب : {error:s})",
"cannot_write_file": "لا يمكن الكتابة في الملف {file:s} (السبب : {error:s})",
"unknown_error_reading_file": "طرأ هناك خطأ ما أثناء عملية قراءة الملف {file:s} (السبب: {error:s})",
"corrupted_json": "قراءة json مُشوّهة مِن {ressource:s} (السبب : {error:s})",
"error_writing_file": "طرأ هناك خطأ أثناء الكتابة في الملف {file:s}: {error:s}",
"error_removing": "خطأ أثناء عملية حذف {path:s}: {error:s}",
"error_changing_file_permissions": "خطأ أثناء عملية تعديل التصريحات لـ {path:s}: {error:s}",
"invalid_url": "خطأ في عنوان الرابط {url:s} (هل هذا الموقع موجود حقًا ؟)",
"download_ssl_error": "خطأ في الاتصال الآمن عبر الـ SSL أثناء محاولة الربط بـ {url:s}",
"download_timeout": "{url:s} استغرق مدة طويلة جدا للإستجابة، فتوقّف.",
"download_unknown_error": "خطأ أثناء عملية تنزيل البيانات مِن {url:s} : {error:s}",
"download_bad_status_code": "{url:s} أعاد رمز الحالة {code:s}",
"command_unknown": "الأمر '{command:s}' مجهول؟",
"corrupted_yaml": "قراءة مُشوّهة لنسق yaml مِن {ressource:s} (السبب : {error:s})",
"cannot_open_file": "ليس بالإمكان فتح الملف {file} (السبب : {error})",
"cannot_write_file": "لا يمكن الكتابة في الملف {file} (السبب : {error})",
"unknown_error_reading_file": "طرأ هناك خطأ ما أثناء عملية قراءة الملف {file} (السبب: {error})",
"corrupted_json": "قراءة ملف JSON مُشوّهة مِن {ressource} (السبب : {error})",
"error_writing_file": "طرأ هناك خطأ أثناء الكتابة في الملف {file}: {error}",
"error_removing": "خطأ أثناء عملية حذف {path}: {error}",
"error_changing_file_permissions": "خطأ أثناء عملية تعديل التصريحات لـ {path}: {error}",
"invalid_url": "فشل الاتصال بـ {url}… ربما تكون الخدمة معطلة ، أو أنك غير متصل بشكل صحيح بالإنترنت في IPv4 / IPv6.",
"download_ssl_error": "خطأ في الاتصال الآمن عبر الـ SSL أثناء محاولة الربط بـ {url}",
"download_timeout": "{url} استغرق مدة طويلة جدا للإستجابة، فتوقّف.",
"download_unknown_error": "خطأ أثناء عملية تنزيل البيانات مِن {url} : {error}",
"download_bad_status_code": "{url} أعاد رمز الحالة {code}",
"corrupted_yaml": "قراءة مُشوّهة لملف YAML مِن {ressource} (السبب : {error})",
"info": "معلومة:",
"warn_the_user_about_waiting_lock_again": "جارٍ الانتظار…",
"warn_the_user_that_lock_is_acquired": "لقد انتهى تنفيذ ذاك الأمر للتوّ ، جارٍ تنفيذ هذا الأمر",
"warn_the_user_about_waiting_lock": "هناك أمر لـ YunoHost قيد التشغيل حاليا. في انتظار انتهاء تنفيذه قبل تشغيل التالي",
"ldap_server_is_down_restart_it": "إنّ خدمة LDAP غير مشغّلة ، نحن بصدد محاولة إعادة تشغيلها…",
"session_expired": "لقد انتهت مدة صلاحية الجلسة. رجاءً أعد الإستيثاق.",
"invalid_token": "إنّ الرمز المميز غير صالح - يرجى الإستيثاق"
}
"edit_text_question": "{}. تعديل هذا النص؟ [yN]: ",
"corrupted_toml": "قراءة مُشوّهة لملف TOML مِن {ressource} (السبب : {error})"
}

View file

@ -1,4 +1,4 @@
{
"logged_out": "প্রস্থান",
"password": "পাসওয়ার্ড"
}
}

View file

@ -1 +1 @@
{}
{}

View file

@ -1,61 +1,47 @@
{
"argument_required": "Es requereix l'argument {argument}",
"authentication_profile_required": "Autenticació requerida al perfil {profile}",
"argument_required": "Es requereix l'argument «{argument}»",
"authentication_required": "Es requereix autenticació",
"authentication_required_long": "Es requereix autenticació per realitzar aquesta tasca",
"colon": "{}: ",
"confirm": "Confirmar{prompt}",
"confirm": "Confirmar {prompt}",
"deprecated_command": "{prog}{command}és obsolet i es desinstal·larà en el futur",
"deprecated_command_alias": "{prog}{old}és obsolet i es desinstal·larà en el futur, utilitzeu {prog}{new}en el seu lloc",
"error": "Error:",
"error_see_log": "Hi ha hagut un error. Si us plau verifiqueu el registre per a més informació, són a /var/log/yunohost/.",
"file_exists": "El fitxer ja existeix: '{path}'",
"file_not_exist": "El fitxer no existeix: '{path}'",
"folder_exists": "La carpeta ja existeix: '{path}'",
"folder_not_exist": "La carpeta no existeix",
"instance_already_running": "Ja hi ha una operació de YunoHost en curs. Espereu a que s'acabi abans d'executar-ne una altra.",
"invalid_argument": "Argument invàlid '{argument}': {error}",
"invalid_password": "Contrasenya invàlida",
"invalid_usage": "Utilització invàlida, utilitzeu --help per veure l'ajuda",
"ldap_attribute_already_exists": "L'atribut '{attribute}' ja existeix amb el valor '{value}'",
"ldap_server_down": "No s'ha pogut connectar amb el servidor LDAP",
"logged_in": "Sessió iniciada",
"logged_out": "Sessió tancada",
"not_logged_in": "No ha iniciat sessió",
"operation_interrupted": "Operació interrompuda",
"password": "Contrasenya",
"pattern_not_match": "No coincideix amb el patró",
"permission_denied": "Permís denegat",
"root_required": "Ha de ser root per realitzar aquesta acció",
"server_already_running": "Ja s'està executant un servidor en aquest port",
"success": "Èxit!",
"unable_authenticate": "No s'ha pogut autenticar",
"unable_retrieve_session": "No s'ha pogut recuperar la sessió a causa de «{exception}»",
"unknown_group": "Grup '{group}' desconegut",
"unknown_user": "Usuari '{user}' desconegut",
"values_mismatch": "Els valors no coincideixen",
"warning": "Atenció:",
"websocket_request_expected": "S'esperava una petició WebSocket",
"cannot_open_file": "No s'ha pogut obrir el fitxer {file:s} (motiu: {error:s})",
"cannot_write_file": "No s'ha pogut escriure el fitxer {file:s} (motiu: {error:s})",
"unknown_error_reading_file": "Error desconegut al intentar llegir el fitxer {file:s} (motiu: {error:s})",
"corrupted_json": "JSON corrupte llegit des de {ressource:s} (motiu: {error:s})",
"corrupted_yaml": "YAML corrupte llegit des de {ressource:s} (motiu: {error:s})",
"error_writing_file": "Error al escriure el fitxer {file:s}: {error:s}",
"error_removing": "Error al eliminar {path:s}: {error:s}",
"error_changing_file_permissions": "Error al canviar els permisos per {path:s}: {error:s}",
"invalid_url": "URL invàlid {url:s} (el lloc web existeix?)",
"download_ssl_error": "Error SSL al connectar amb {url:s}",
"download_timeout": "{url:s} ha tardat massa en respondre, s'ha deixat d'esperar.",
"download_unknown_error": "Error al baixar dades des de {url:s}: {error:s}",
"download_bad_status_code": "{url:s} ha retornat el codi d'estat {code:s}",
"command_unknown": "Ordre '{command:s}' desconegut?",
"cannot_open_file": "No s'ha pogut obrir el fitxer {file} (motiu: {error})",
"cannot_write_file": "No s'ha pogut escriure el fitxer {file} (motiu: {error})",
"unknown_error_reading_file": "Error desconegut al intentar llegir el fitxer {file} (motiu: {error})",
"corrupted_json": "JSON corrupte llegit des de {ressource} (motiu: {error})",
"corrupted_yaml": "YAML corrupte llegit des de {ressource} (motiu: {error})",
"error_writing_file": "Error al escriure el fitxer {file}: {error}",
"error_removing": "Error al eliminar {path}: {error}",
"error_changing_file_permissions": "Error al canviar els permisos per {path}: {error}",
"invalid_url": "No s'ha pogut connectar a {url}… pot ser que el servei estigui caigut, o que no hi hagi connexió a Internet amb IPv4/IPv6.",
"download_ssl_error": "Error SSL al connectar amb {url}",
"download_timeout": "{url} ha tardat massa en respondre, s'ha deixat d'esperar.",
"download_unknown_error": "Error al baixar dades des de {url}: {error}",
"download_bad_status_code": "{url} ha retornat el codi d'estat {code}",
"info": "Info:",
"corrupted_toml": "El fitxer TOML ha estat corromput en la lectura des de {ressource:s} (motiu: {error:s})",
"corrupted_toml": "El fitxer TOML ha estat corromput en la lectura des de {ressource} (motiu: {error})",
"warn_the_user_about_waiting_lock": "Hi ha una altra ordre de YunoHost en execució, s'executarà aquesta ordre un cop l'anterior hagi acabat",
"warn_the_user_about_waiting_lock_again": "Encara en espera…",
"warn_the_user_that_lock_is_acquired": "L'altra ordre tot just ha acabat, ara s'executarà aquesta ordre",
"invalid_token": "Testimoni no vàlid - torneu-vos a autenticar",
"ldap_server_is_down_restart_it": "El servei LDAP està caigut, s'està intentant tornar-lo a engegar…",
"session_expired": "La sessió a expirat. Torneu-vos a autenticar."
}
"edit_text_question": "{}. Edita aquest text ? [yN]: "
}

1
locales/ckb.json Normal file
View file

@ -0,0 +1 @@
{}

View file

@ -1,25 +1,16 @@
{
"argument_required": "参数“{argument}”是必须的",
"authentication_profile_required": "必须验证配置文件{profile}",
"authentication_required": "需要验证",
"authentication_required_long": "此操作需要验证",
"colon": "{} ",
"confirm": "确认{prompt}",
"confirm": "确认 {prompt}",
"deprecated_command": "{prog}{command}已经放弃使用,将来会删除",
"deprecated_command_alias": "{prog}{old}已经放弃使用,将来会删除,请使用{prog}{new}代替",
"error": "错误:",
"error_see_log": "发生错误。请参看日志文件获取错误详情,日志文件位于 /var/log/yunohost/。",
"file_exists": "文件已存在:{path}",
"file_not_exist": "文件不存在:{path}",
"folder_exists": "目录已存在:{path}",
"folder_not_exist": "目录不存在",
"error": "错误:",
"file_not_exist": "文件不存在: '{path}'",
"folder_exists": "目录已存在: '{path}'",
"info": "信息:",
"instance_already_running": "已经有一个YunoHost操作正在运行。 请等待它完成再运行另一个。",
"invalid_argument": "参数错误{argument}{error}",
"invalid_password": "密码错误",
"invalid_usage": "用法错误,输入 --help 查看帮助信息",
"ldap_attribute_already_exists": "参数{attribute}已赋值{value}",
"ldap_server_down": "无法连接LDAP服务器",
"logged_in": "登录",
"logged_out": "登出",
"not_logged_in": "您未登录",
@ -30,31 +21,27 @@
"server_already_running": "服务已运行在指定端口",
"success": "成功!",
"unable_authenticate": "认证失败",
"unable_retrieve_session": "由于“ {exception}”,无法检索会话",
"unknown_group": "未知组{group}",
"unknown_user": "未知用户{user}",
"values_mismatch": "值不匹配",
"warning": "警告:",
"websocket_request_expected": "期望一个WebSocket请求",
"cannot_open_file": "不能打开文件{file:s}(原因:{error:s}",
"cannot_write_file": "写入文件{file:s}失败(原因:{error:s}",
"unknown_error_reading_file": "尝试读取文件{files}时发生未知错误(原因:{errors}",
"corrupted_json": "从{ressource:s}读取的JSON损坏原因{error:s}",
"corrupted_yaml": "从{ressource:s}读取的YMAL损坏原因{error:s}",
"error_writing_file": "写入文件{file:s}失败:{error:s}",
"error_removing": "删除路径{path:s}失败:{error:s}",
"error_changing_file_permissions": "目录{path:s}权限修改失败:{error:s}",
"invalid_url": "URL{url:s}无效site是否存在",
"download_ssl_error": "连接{url:s}时发生SSL错误",
"download_timeout": "{url:s}响应超时,放弃。",
"download_unknown_error": "下载{url:s}失败:{error:s}",
"download_bad_status_code": "{url:s}返回状态码:{code:s}",
"command_unknown": "命令'{command:s}'未知?",
"cannot_open_file": "不能打开文件{file}(原因:{error}",
"cannot_write_file": "写入文件{file}失败(原因:{error}",
"unknown_error_reading_file": "尝试读取文件{file}时发生未知错误(原因:{error}",
"corrupted_json": "从{ressource}读取的JSON损坏原因{error}",
"corrupted_yaml": "从{ressource}读取的YMAL损坏原因{error}",
"error_writing_file": "写入文件{file}失败:{error}",
"error_removing": "删除路径{path}失败:{error}",
"error_changing_file_permissions": "目录{path}权限修改失败:{error}",
"invalid_url": "{url} 连接失败… 可能是服务中断了或者你没有正确连接到IPv4/IPv6的互联网。",
"download_ssl_error": "连接{url}时发生SSL错误",
"download_timeout": "{url}响应超时,放弃。",
"download_unknown_error": "下载{url}失败:{error}",
"download_bad_status_code": "{url}返回状态码:{code}",
"warn_the_user_that_lock_is_acquired": "另一个命令刚刚完成,现在启动此命令",
"warn_the_user_about_waiting_lock_again": "还在等...",
"warn_the_user_about_waiting_lock_again": "仍在等待…",
"warn_the_user_about_waiting_lock": "目前正在运行另一个YunoHost命令我们在运行此命令之前等待它完成",
"corrupted_toml": "从{ressources}读取的TOML损坏原因{errors}",
"invalid_token": "令牌无效-请进行身份验证",
"ldap_server_is_down_restart_it": "LDAP服务已下线正在尝试重启服务……",
"session_expired": "会话已过期。请重新进行身份验证。"
}
"corrupted_toml": "从{ressource}读取的TOML已损坏原因{error}",
"edit_text_question": "{}.编辑此文本?[yN]: "
}

View file

@ -1,3 +1,47 @@
{
"password": "Heslo"
}
"password": "Heslo",
"logged_out": "Jste odhlášen/a",
"warn_the_user_that_lock_is_acquired": "Předchozí operace dokončena, nyní spouštíme tuto",
"warn_the_user_about_waiting_lock_again": "Stále čekáme…",
"warn_the_user_about_waiting_lock": "Jiná YunoHost operace právě probíhá, před spuštěním této čekáme na její dokončení",
"download_bad_status_code": "{url} vrátil stavový kód {code}",
"download_unknown_error": "Chyba při stahování dat z {url}: {error}",
"download_timeout": "{url} příliš dlouho neodpovídá, akce přerušena.",
"download_ssl_error": "SSL chyba při spojení s {url}",
"invalid_url": "Špatný odkaz {url} (je vůbec dostupný?).",
"error_changing_file_permissions": "Chyba při nastavování oprávnění pro {path}: {error}",
"error_removing": "Chyba při přesunu {path}: {error}",
"error_writing_file": "Chyba při zápisu souboru/ů {file}: {error}",
"corrupted_toml": "Nepodařilo se načíst TOML z {ressource} (reason: {error})",
"corrupted_yaml": "Nepodařilo se načíst YAML z {ressource} (reason: {error})",
"corrupted_json": "Nepodařilo se načíst JSON {ressource} (reason: {error})",
"unknown_error_reading_file": "Vyskytla se neznámá chyba při čtení souboru/ů {file} (reason: {error})",
"cannot_write_file": "Nelze zapsat soubor/y {file} (reason: {error})",
"cannot_open_file": "Nelze otevřít soubor/y {file} (reason: {error})",
"websocket_request_expected": "Očekáván WebSocket požadavek",
"warning": "Varování:",
"values_mismatch": "Hodnoty nesouhlasí",
"unknown_user": "Neznámý '{user}' uživatel",
"unknown_group": "Neznámá '{group}' skupina",
"unable_authenticate": "Není možné ověřit",
"success": "Zadařilo se!",
"server_already_running": "Na tomto portu je server již provozován",
"root_required": "Pro provedení této akce musíte být root",
"pattern_not_match": "Neodpovídá výrazu",
"operation_interrupted": "Operace přerušena",
"not_logged_in": "Nejste přihlášen",
"logged_in": "Přihlášení",
"invalid_usage": "Nesprávné použití, pass --help pro zobrazení nápovědy",
"invalid_argument": "Nesprávný argument '{argument}': {error}",
"instance_already_running": "Právě probíhá jiná YunoHost operace. Před spuštěním další operace vyčkejte na její dokončení.",
"info": "Info:",
"folder_exists": "Adresář již existuje: '{path}'",
"file_not_exist": "Soubor neexistuje: '{path}'",
"error": "Chyba:",
"deprecated_command_alias": "'{prog} {old}' je zastaralý a bude odebrán v budoucích verzích, použijte '{prog} {new}'",
"deprecated_command": "'{prog} {command}' je zastaralý a bude odebrán v budoucích verzích",
"confirm": "Potvrdit {prompt}",
"authentication_required": "Vyžadováno ověření",
"argument_required": "Je vyžadován argument '{argument}'",
"edit_text_question": "{}. Upravit tento text? [yN]: "
}

1
locales/da.json Normal file
View file

@ -0,0 +1 @@
{}

View file

@ -1,61 +1,47 @@
{
"argument_required": "Der Parameter {argument} ist erforderlich",
"authentication_profile_required": "Anmeldung als Nutzer '{profile}' wird benötigt",
"authentication_required": "Anmeldung erforderlich",
"authentication_required_long": "Bitte erst anmelden um diese Aktion auszuführen",
"colon": "{}: ",
"confirm": "Bestätige {prompt}",
"confirm": "Bestätigen Sie {prompt}",
"error": "Fehler:",
"error_see_log": "Ein Fehler ist aufgetreten. Für Details bitte im Log nachsehen.",
"file_exists": "Datei existiert bereits: '{path}'",
"file_not_exist": "Datei ist nicht vorhanden: '{path}'",
"file_not_exist": "Datei ist nicht vorhanden: '{path}'",
"folder_exists": "Ordner existiert bereits: '{path}'",
"folder_not_exist": "Ordner existiert nicht",
"instance_already_running": "Es läuft bereits eine YunoHost-Operation. Bitte warte, bis sie fertig ist, bevor du eine weitere startest.",
"invalid_argument": "Argument ungültig '{argument}': {error}",
"invalid_password": "Passwort falsch",
"invalid_usage": "Falscher Aufruf, verwende --help für den Hilfstext",
"ldap_attribute_already_exists": "Attribute existieren bereits: '{attribute}={value}'",
"ldap_server_down": "LDAP-Server nicht erreichbar",
"logged_in": "Angemeldet",
"logged_out": "Abgemeldet",
"not_logged_in": "Du bist nicht angemeldet",
"operation_interrupted": "Vorgang unterbrochen",
"password": "Passwort",
"pattern_not_match": "Entspricht nicht dem Muster",
"permission_denied": "Zugriff verweigert",
"root_required": "Nur der Nutzer root kann diesen Vorgang ausführen",
"server_already_running": "Einen anderer Dienst arbeitet bereits auf diesem Port",
"success": "Erfolg!",
"unable_authenticate": "Anmelden fehlgeschlagen",
"unable_retrieve_session": "Sitzung konnte nicht abgerufen werden. Grund: '{exception}'",
"values_mismatch": "Die Werte passen nicht",
"values_mismatch": "Die Werte passen nicht zusammen",
"warning": "Warnung:",
"websocket_request_expected": "Eine WebSocket Anfrage wurde erwartet",
"websocket_request_expected": "Eine WebSocket-Anfrage wurde erwartet",
"deprecated_command": "'{prog} {command}' ist veraltet und wird bald entfernt werden",
"deprecated_command_alias": "'{prog} {old}' ist veraltet und wird bald entfernt werden, benutze '{prog} {new}' stattdessen",
"unknown_group": "Gruppe '{group}' ist unbekannt",
"unknown_user": "Benutzer '{user}' ist unbekannt",
"unknown_user": "Konto '{user}' ist unbekannt",
"info": "Info:",
"invalid_token": "Ungültiger Token - bitte authentifizieren",
"corrupted_json": "Beschädigtes JSON gelesen von {ressource:s} (reason: {error:s})",
"unknown_error_reading_file": "Unbekannter Fehler beim Lesen der Datei {file:s} (reason: {error:s})",
"cannot_write_file": "Kann Datei {file:s} nicht schreiben (reason: {error:s})",
"cannot_open_file": "Kann Datei {file:s} nicht öffnen (reason: {error:s})",
"corrupted_yaml": "Beschädigtes YAML gelesen von {ressource:s} (reason: {error:s})",
"corrupted_json": "Beschädigtes JSON gelesen von {ressource} (reason: {error})",
"unknown_error_reading_file": "Unbekannter Fehler beim Lesen der Datei {file} (reason: {error})",
"cannot_write_file": "Kann Datei {file} nicht schreiben (reason: {error})",
"cannot_open_file": "Datei {file} konnte nicht geöffnet werden (Ursache: {error})",
"corrupted_yaml": "Beschädigtes YAML gelesen von {ressource} (reason: {error})",
"warn_the_user_that_lock_is_acquired": "Der andere Befehl wurde gerade abgeschlossen, starte jetzt diesen Befehl",
"warn_the_user_about_waiting_lock_again": "Immer noch wartend...",
"warn_the_user_about_waiting_lock_again": "Immer noch wartend",
"warn_the_user_about_waiting_lock": "Ein anderer YunoHost Befehl läuft gerade, wir warten bis er fertig ist, bevor dieser laufen kann",
"command_unknown": "Befehl '{command:s}' unbekannt?",
"download_bad_status_code": "{url:s} lieferte folgende(n) Status Code(s) {code:s}",
"download_unknown_error": "Fehler beim Herunterladen von Daten von {url:s}: {error:s}",
"download_timeout": "{url:s} brauchte zu lange zum Antworten, hab aufgegeben.",
"download_ssl_error": "SSL Fehler beim Verbinden zu {url:s}",
"invalid_url": "Ungültige URL {url:s} (existiert diese Seite?)",
"error_changing_file_permissions": "Fehler beim Ändern der Berechtigungen für {path:s}: {error:s}",
"error_removing": "Fehler beim Entfernen {path:s}: {error:s}",
"error_writing_file": "Fehler beim Schreiben von Datei {file:s}: {error:s}",
"corrupted_toml": "Beschädigtes TOML gelesen von {ressource:s} (reason: {error:s})",
"ldap_server_is_down_restart_it": "Der LDAP-Dienst wurde angehalten. Es wird versucht, ihn erneut zu starten...",
"session_expired": "Die Sitzung ist abgelaufen. Bitte neuauthentifizieren."
}
"download_bad_status_code": "{url} lieferte folgende(n) Status Code(s) {code}",
"download_unknown_error": "Fehler beim Herunterladen von Daten von {url}: {error}",
"download_timeout": "{url} brauchte zu lange zum Antworten, hab aufgegeben.",
"download_ssl_error": "SSL Fehler beim Verbinden zu {url}",
"invalid_url": "Konnte keine Verbindung zu {url} herstellen… vielleicht ist der Dienst ausgefallen, oder Sie sind nicht richtig mit dem Internet in IPv4/IPv6 verbunden.",
"error_changing_file_permissions": "Fehler beim Ändern der Berechtigungen für {path}: {error}",
"error_removing": "Fehler beim Entfernen {path}: {error}",
"error_writing_file": "Fehler beim Schreiben von Datei {file}: {error}",
"corrupted_toml": "Beschädigtes TOML gelesen von {ressource} (reason: {error})",
"edit_text_question": "{}. Diesen Text bearbeiten? [yN]: "
}

View file

@ -1,4 +1,4 @@
{
"logged_out": "Αποσυνδέθηκα",
"password": "Κωδικός πρόσβασης"
}
}

View file

@ -1,25 +1,17 @@
{
"argument_required": "Argument '{argument}' is required",
"authentication_required": "Authentication required",
"authentication_required_long": "Authentication is required to perform this action",
"colon": "{}: ",
"confirm": "Confirm {prompt}",
"deprecated_command": "'{prog} {command}' is deprecated and will be removed in the future",
"deprecated_command_alias": "'{prog} {old}' is deprecated and will be removed in the future, use '{prog} {new}' instead",
"edit_text_question": "{}. Edit this text ? [yN]: ",
"error": "Error:",
"error_see_log": "An error occurred. Please see the logs for details, they are located in /var/log/yunohost/.",
"file_exists": "File already exists: '{path}'",
"file_not_exist": "File does not exist: '{path}'",
"folder_exists": "Folder already exists: '{path}'",
"folder_not_exist": "Folder does not exist",
"info": "Info:",
"instance_already_running": "There is already a YunoHost operation running. Please wait for it to finish before running another one.",
"invalid_argument": "Invalid argument '{argument}': {error}",
"invalid_password": "Invalid password",
"invalid_token": "Invalid token - please authenticate",
"invalid_usage": "Invalid usage, pass --help to see help",
"ldap_attribute_already_exists": "Attribute '{attribute}' already exists with value '{value}'",
"ldap_server_down": "Unable to reach LDAP server",
"logged_in": "Logged in",
"logged_out": "Logged out",
"not_logged_in": "You are not logged in",
@ -30,31 +22,26 @@
"server_already_running": "A server is already running on that port",
"success": "Success!",
"unable_authenticate": "Unable to authenticate",
"unable_retrieve_session": "Unable to retrieve the session because '{exception}'",
"session_expired": "The session expired. Please re-authenticate.",
"unknown_group": "Unknown '{group}' group",
"unknown_user": "Unknown '{user}' user",
"values_mismatch": "Values don't match",
"info": "Info:",
"warning": "Warning:",
"websocket_request_expected": "Expected a WebSocket request",
"cannot_open_file": "Could not open file {file:s} (reason: {error:s})",
"cannot_write_file": "Could not write file {file:s} (reason: {error:s})",
"unknown_error_reading_file": "Unknown error while trying to read file {file:s} (reason: {error:s})",
"corrupted_json": "Corrupted JSON read from {ressource:s} (reason: {error:s})",
"corrupted_yaml": "Corrupted YAML read from {ressource:s} (reason: {error:s})",
"corrupted_toml": "Corrupted TOML read from {ressource:s} (reason: {error:s})",
"error_writing_file": "Error when writing file {file:s}: {error:s}",
"error_removing": "Error when removing {path:s}: {error:s}",
"error_changing_file_permissions": "Error when changing permissions for {path:s}: {error:s}",
"invalid_url": "Invalid URL {url:s} (does this site exists?)",
"download_ssl_error": "SSL error when connecting to {url:s}",
"download_timeout": "{url:s} took too long to answer, gave up.",
"download_unknown_error": "Error when downloading data from {url:s}: {error:s}",
"download_bad_status_code": "{url:s} returned status code {code:s}",
"command_unknown": "Command '{command:s}' unknown?",
"cannot_open_file": "Could not open file {file} (reason: {error})",
"cannot_write_file": "Could not write file {file} (reason: {error})",
"unknown_error_reading_file": "Unknown error while trying to read file {file} (reason: {error})",
"corrupted_json": "Corrupted JSON read from {ressource} (reason: {error})",
"corrupted_yaml": "Corrupted YAML read from {ressource} (reason: {error})",
"corrupted_toml": "Corrupted TOML read from {ressource} (reason: {error})",
"error_writing_file": "Error when writing file {file}: {error}",
"error_removing": "Error when removing {path}: {error}",
"error_changing_file_permissions": "Error when changing permissions for {path}: {error}",
"invalid_url": "Failed to connect to {url}... maybe the service is down, or you are not properly connected to the Internet in IPv4/IPv6.",
"download_ssl_error": "SSL error when connecting to {url}",
"download_timeout": "{url} took too long to answer, gave up.",
"download_unknown_error": "Error when downloading data from {url}: {error}",
"download_bad_status_code": "{url} returned status code {code}",
"warn_the_user_about_waiting_lock": "Another YunoHost command is running right now, we are waiting for it to finish before running this one",
"warn_the_user_about_waiting_lock_again": "Still waiting...",
"warn_the_user_that_lock_is_acquired": "The other command just completed, now starting this command",
"ldap_server_is_down_restart_it": "The LDAP service is down, attempt to restart it..."
"warn_the_user_that_lock_is_acquired": "The other command just completed, now starting this command"
}

View file

@ -1,30 +1,27 @@
{
"password": "Pasvorto",
"colon": "{}: ",
"warn_the_user_that_lock_is_acquired": "la alia komando ĵus kompletigis, nun komencante ĉi tiun komandon",
"warn_the_user_about_waiting_lock_again": "Ankoraŭ atendanta...",
"warn_the_user_that_lock_is_acquired": "La alia komando ĵus kompletigis, nun komencante ĉi tiun komandon",
"warn_the_user_about_waiting_lock_again": "Ankoraŭ atendanta…",
"warn_the_user_about_waiting_lock": "Alia komando de YunoHost funkcias ĝuste nun, ni atendas, ke ĝi finiĝos antaŭ ol funkcii ĉi tiu",
"command_unknown": "Komando '{command:s}' nekonata?",
"download_bad_status_code": "{url:s} redonita statuskodo {code:s}",
"download_unknown_error": "Eraro dum elŝutado de datumoj de {url:s}: {error:s}",
"download_timeout": "{url:s} prenis tro da tempo por respondi, rezignis.",
"download_ssl_error": "SSL-eraro dum konekto al {url:s}",
"invalid_url": "Nevalida url {url:s} (ĉu ĉi tiu retejo ekzistas?)",
"error_changing_file_permissions": "Eraro dum ŝanĝo de permesoj por {path:s}: {error:s}",
"error_removing": "Eraro dum la forigo de {path:s}: {error:s}",
"error_writing_file": "Eraro skribinte dosieron {file:s}: {error:s}",
"corrupted_toml": "Korupta toml legita el {ressource:s} (kialo: {error:s})",
"corrupted_yaml": "Korupta yaml legita de {ressource:s} (kialo: {error:s})",
"corrupted_json": "Koruptita json legita de {ressource:s} (kialo: {error:s})",
"unknown_error_reading_file": "Nekonata eraro dum provi legi dosieron {file:s} (kialo: {error:s})",
"cannot_write_file": "Ne povis skribi dosieron {file:s} (kialo: {error:s})",
"cannot_open_file": "Ne povis malfermi dosieron {file: s} (kialo: {error: s})",
"download_bad_status_code": "{url} redonita statuskodo {code}",
"download_unknown_error": "Eraro dum elŝutado de datumoj de {url}: {error}",
"download_timeout": "{url} prenis tro da tempo por respondi, rezignis.",
"download_ssl_error": "SSL-eraro dum konekto al {url}",
"invalid_url": "Nevalida URL{url} (ĉu ĉi tiu retejo ekzistas?)",
"error_changing_file_permissions": "Eraro dum ŝanĝo de permesoj por {path}: {error}",
"error_removing": "Eraro dum la forigo de {path}: {error}",
"error_writing_file": "Eraro skribinte dosieron {file}: {error}",
"corrupted_toml": "Korupta TOML legita el {ressource} (kialo: {error})",
"corrupted_yaml": "Korupta YAML legita de {ressource} (kialo: {error})",
"corrupted_json": "Koruptita JSON legis de {ressource} (Kialo: {error})",
"unknown_error_reading_file": "Nekonata eraro dum provi legi dosieron {file} (kialo: {error})",
"cannot_write_file": "Ne povis skribi dosieron {file} (kialo: {error})",
"cannot_open_file": "Ne povis malfermi dosieron {file} (kialo: {error})",
"websocket_request_expected": "Atendis ret-peto",
"warning": "Averto:",
"values_mismatch": "Valoroj ne kongruas",
"unknown_user": "Nekonata uzanto '{user}'",
"unknown_group": "Nekonata grupo \"{group}\"",
"unable_retrieve_session": "Ne eblas retrovi la sesion ĉar '{exception}'",
"unable_authenticate": "Ne eblas aŭtentiĝi",
"success": "Sukceson!",
"server_already_running": "Servilo jam funkcias sur tiu haveno",
@ -33,26 +30,17 @@
"operation_interrupted": "Operacio interrompita",
"not_logged_in": "Vi ne estas ensalutinta",
"logged_in": "Ensalutinta",
"ldap_server_down": "Ne eblas atingi la servilon LDAP",
"ldap_attribute_already_exists": "Atributo '{attribute}' jam ekzistas kun valoro '{value}'",
"invalid_usage": "Nevalida uzado, preterpase '--help' por vidi helpon",
"invalid_password": "Nevalida pasvorto",
"invalid_argument": "Nevalida argumento '{argument}': {error}",
"instance_already_running": "Jam funkcias YunoHost-operacio. Bonvolu atendi, ke ĝi finiĝos antaŭ ol funkcii alia.",
"info": "informoj:",
"folder_not_exist": "Dosierujo ne ekzistas",
"folder_exists": "Dosierujo jam ekzistas: '{path}'",
"file_not_exist": "Dosiero ne ekzistas: '{path}'",
"file_exists": "Dosiero jam ekzistas: '{path}'",
"error_see_log": "Eraro okazis. Bonvolu vidi la protokolojn por detaloj, ili troviĝas en /var/log/yunohost/.",
"error": "Eraro:",
"deprecated_command_alias": "'{prog} {old}' malakceptas kaj estos forigita estonte, uzu anstataŭe '{prog} {new}'",
"deprecated_command": "'{prog} {command}' malakceptas kaj estos forigita estonte",
"confirm": "Konfirmu {prompt}",
"authentication_required_long": "Aŭtentigo necesas por plenumi ĉi tiun agon",
"authentication_required": "Aŭtentigo bezonata",
"authentication_profile_required": "Aŭtentigo al la profilo '{profile}' bezonata",
"argument_required": "Argumento '{argument}' estas bezonata",
"logged_out": "Ensalutinta",
"invalid_token": "Nevalida tokeno - bonvolu autentiki"
}
"logged_out": "Ensalutinta"
}

View file

@ -1,61 +1,47 @@
{
"argument_required": "Se requiere el argumento «{argument}»",
"authentication_profile_required": "Autentificación requerida para el perfil «{profile}»",
"authentication_required": "Se requiere autentificación",
"authentication_required_long": "Debe autentificarse para realizar esta acción",
"colon": "{}: ",
"confirm": "Confirmar {prompt}",
"deprecated_command": "«{prog} {command}» está obsoleto y será eliminado en el futuro",
"deprecated_command_alias": "«{prog} {old}» está obsoleto y se eliminará en el futuro, use «{prog} {new}» en su lugar",
"error": "Error:",
"error_see_log": "Ha ocurrido un error. Consulte el registro para obtener más información, localizado en /var/log/yunohost/.",
"file_exists": "El archivo ya existe: «{path}»",
"file_not_exist": "El archivo no existe: «{path}»",
"folder_exists": "El directorio ya existe: «{path}»",
"folder_not_exist": "La carpeta no existe",
"instance_already_running": "Ya se está ejecutando una instancia de YunoHost. Espere a que termine antes de ejecutar otra.",
"invalid_argument": "Argumento no válido «{argument}»: {error}",
"invalid_password": "Contraseña no válida",
"invalid_usage": "Uso no válido, utilice --help para ver la ayuda",
"ldap_attribute_already_exists": "El atributo «{attribute}» ya existe con el valor «{value}»",
"ldap_server_down": "No se pudo conectar con el servidor LDAP",
"logged_in": "Sesión iniciada",
"logged_out": "Sesión cerrada",
"not_logged_in": "No ha iniciado sesión",
"operation_interrupted": "Operación interrumpida",
"password": "Contraseña",
"pattern_not_match": "No coincide con el patrón",
"permission_denied": "Permiso denegado",
"root_required": "Solo root puede realizar esta acción",
"server_already_running": "Ya se está ejecutando un servidor en ese puerto",
"success": "¡Éxito!",
"unable_authenticate": "No se puede autentificar",
"unable_retrieve_session": "No se puede recuperar la sesión por «{exception}»",
"unknown_group": "Grupo «{group}» desconocido",
"unknown_user": "Usuario «{user}» desconocido",
"values_mismatch": "Los valores no coinciden",
"warning": "Advertencia:",
"websocket_request_expected": "Se esperaba una petición WebSocket",
"cannot_open_file": "No se pudo abrir el archivo {file:s} (motivo: {error:s})",
"cannot_write_file": "No se pudo escribir el archivo {file:s} (motivo: {error:s})",
"unknown_error_reading_file": "Error desconocido al intentar leer el archivo {file:s} (motivo: {error:s})",
"corrupted_json": "Lectura corrupta de JSON desde {ressource:s} (motivo: {error:s})",
"error_writing_file": "Error al escribir el archivo {file:s}: {error:s}",
"error_removing": "Error al eliminar {path:s}: {error:s}",
"error_changing_file_permissions": "Error al cambiar los permisos para {path:s}: {error:s}",
"invalid_url": "URL inválida {url:s} (¿Existe este sitio?)",
"download_ssl_error": "Error SSL al conectar con {url:s}",
"download_timeout": "{url:s} tardó demasiado en responder, abandono.",
"download_unknown_error": "Error al descargar datos desde {url:s} : {error:s}",
"download_bad_status_code": "{url:s} devolvió el código de estado {code:s}",
"command_unknown": "¿Orden «{command:s}» desconocida?",
"corrupted_yaml": "Lectura corrupta de YAML desde {ressource:s} (motivo: {error:s})",
"cannot_open_file": "No se pudo abrir el archivo {file} (motivo: {error})",
"cannot_write_file": "No se pudo escribir el archivo {file} (motivo: {error})",
"unknown_error_reading_file": "Error desconocido al intentar leer el archivo {file} (motivo: {error})",
"corrupted_json": "Lectura corrupta de JSON desde {ressource} (motivo: {error})",
"error_writing_file": "Error al escribir el archivo {file}: {error}",
"error_removing": "Error al eliminar {path}: {error}",
"error_changing_file_permissions": "Error al cambiar los permisos para {path}: {error}",
"invalid_url": "Imposible de conectarse a {url} (¿ la URL esta correcta, existe este sitio, o internet esta accesible?).",
"download_ssl_error": "Error SSL al conectar con {url}",
"download_timeout": "{url} tardó demasiado en responder, abandono.",
"download_unknown_error": "Error al descargar datos desde {url} : {error}",
"download_bad_status_code": "{url} devolvió el código de estado {code}",
"corrupted_yaml": "Lectura corrupta de YAML desde {ressource} (motivo: {error})",
"info": "Información:",
"corrupted_toml": "Lectura corrupta de TOML desde {ressource:s} (motivo: {error:s})",
"corrupted_toml": "Lectura corrupta de TOML desde {ressource} (motivo: {error})",
"warn_the_user_that_lock_is_acquired": "La otra orden recién terminó, iniciando esta orden ahora",
"warn_the_user_about_waiting_lock_again": "Aún esperando...",
"warn_the_user_about_waiting_lock_again": "Aún esperando",
"warn_the_user_about_waiting_lock": "Otra orden de YunoHost se está ejecutando ahora, estamos esperando a que termine antes de ejecutar esta",
"invalid_token": "Token invalido - vuelva a autenticarte",
"ldap_server_is_down_restart_it": "El servicio LDAP está caído, intentando reiniciarlo...",
"session_expired": "La sesión expiró. Por favor autenticarse de nuevo."
"edit_text_question": "{}. Editar este texto ? [sN]: "
}

View file

@ -1,6 +1,47 @@
{
"argument_required": "'{argument}' argumentua beharrezkoa da",
"logged_out": "Saioa amaitu",
"argument_required": "'{argument}' argumentua ezinbestekoa da",
"logged_out": "Saioa amaituta",
"password": "Pasahitza",
"colon": "{}: "
"authentication_required": "Autentifikazioa behar da",
"confirm": "{prompt} baieztatu",
"edit_text_question": "{}. Testua editatu nahi al duzu? [yN]: ",
"deprecated_command": "'{prog} {command}' zaharkitua dago eta etorkizunean kenduko da",
"deprecated_command_alias": "'{prog} {old} zaharkitua dago eta etorkizunean kenduko da, erabili '{prog} {new}' haren ordez",
"error": "Errorea:",
"file_not_exist": "Fitxategia ez da existitzen: '{path}'",
"error_changing_file_permissions": "Errorea {path}-i eragiten dioten baimenak aldatzean: {error}",
"invalid_argument": "'{argument}' argumentua ez da egokia: {error}",
"success": "Arrakasta!",
"info": "Informazioa:",
"logged_in": "Saioa hasita",
"not_logged_in": "Ez duzu saiorik hasi",
"operation_interrupted": "Eragiketa geldiarazi da",
"unknown_group": "'{group}' taldea ezezaguna da",
"unknown_user": "'{user}' erabiltzailea ezezaguna da",
"cannot_write_file": "Ezinezkoa izan da {file} fitxategia idaztea (zergatia: {error})",
"download_ssl_error": "SSL errorea {url}-(e)ra konektatzean",
"corrupted_toml": "{ressource}-eko/go TOMLa kaltetuta dago (zergatia: {error})",
"warn_the_user_about_waiting_lock": "YunoHosten beste komando bat ari da exekutatzen, horrek amaitu arte gaude zain",
"warn_the_user_about_waiting_lock_again": "Zain...",
"folder_exists": "Direktorioa existitzen da dagoeneko: '{path}'",
"instance_already_running": "YunoHosten eragiketa bat exekutatzen ari da dagoeneko. Itxaron amaitu arte beste eragiketa bat abiarazi baino lehen.",
"invalid_usage": "Erabilera okerra, idatzi --help aukerak ikusteko",
"pattern_not_match": "Ez dator ereduarekin bat",
"root_required": "Ezinbestekoa da 'root' izatea eragiketa hau exekutatzeko",
"server_already_running": "Zerbitzari bat martxan dago dagoeneko ataka horretan",
"unable_authenticate": "Ezin da autentifikatu",
"values_mismatch": "Balioak ez datoz bat",
"warning": "Adi:",
"cannot_open_file": "Ezinezkoa izan da {file} fitxategia irekitzea (zergatia: {error})",
"corrupted_json": "{ressource}-eko/go JSONa kaltetuta dago (zergatia: {error})",
"corrupted_yaml": "{ressource}-eko/go YAMLa kaltetuta dago (zergatia: {error})",
"websocket_request_expected": "WebSocket eskaera bat espero zen",
"unknown_error_reading_file": "Errore ezezaguna {file} fitxategia irakurtzen saiatzerakoan (zergatia: {error})",
"download_unknown_error": "Errorea {url}(e)tik deskargatzerakoan: {error}",
"warn_the_user_that_lock_is_acquired": "Aurreko komandoa amaitu berri, orain komando hau abiarazten",
"error_writing_file": "Errorea {file} fitxategia idazterakoan: {error}",
"error_removing": "Errorea {path} ezabatzerakoan: {error}",
"download_bad_status_code": "{url} helbideak {code} egoera kodea agertu du",
"invalid_url": "{url}-(e)ra konektatzeak huts egin du... agian zerbitzua ez dago martxan, edo ez zaude IPv4/IPv6 bidez ondo konektatuta internetera.",
"download_timeout": "{url}(e)k denbora gehiegi behar izan du erantzuteko, bertan behera utzi du zerbitzariak."
}

46
locales/fa.json Normal file
View file

@ -0,0 +1,46 @@
{
"logged_in": "وارد شده",
"invalid_usage": "استفاده نامعتبر ، برای مشاهده راهنما --help را ارسال کنید",
"invalid_argument": "استدلال نامعتبر '{argument}': {error}",
"instance_already_running": "در حال حاضر یک عملیات YunoHost در حال اجرا است. لطفاً قبل از اجرای یکی دیگر ، منتظر بمانید تا آن به پایان برسد.",
"info": "اطلاعات:",
"folder_exists": "پوشه موجود است: '{path}'",
"file_not_exist": "فایل وجود ندارد: '{path}'",
"error": "ایراد:",
"deprecated_command_alias": "'{prog} {old}' منسوخ شده است و در آینده حذف خواهد شد ، بجای آن از '{prog} {new}' استفاده کنید",
"deprecated_command": "'{prog} {command}' منسوخ شده است و در آینده حذف خواهد شد",
"confirm": "تایید کردن {prompt}",
"authentication_required": "احراز هویّت الزامی است",
"argument_required": "استدلال '{argument}' ضروری است",
"password": "کلمه عبور",
"warn_the_user_that_lock_is_acquired": "فرمان دیگر به تازگی تکمیل شده است ، اکنون این دستور را شروع کنید",
"warn_the_user_about_waiting_lock_again": "هنوز در انتظار…",
"warn_the_user_about_waiting_lock": "یکی دیگر از دستورات YunoHost در حال اجرا است ، ما منتظر هستیم تا قبل از اجرای این دستور به پایان برسد",
"download_bad_status_code": "{url} کد وضعیّت بازگشتی {code}",
"download_unknown_error": "خطا هنگام بارگیری داده ها از {url}: {error}",
"download_timeout": "پاسخ {url} خیلی طول کشید ، منصرف شو.",
"download_ssl_error": "خطای SSL هنگام اتصال به {url}",
"invalid_url": "اتصال به {url} انجام نشد … شاید سرویس خاموش باشد یا در IPv4/IPv6 به درستی به اینترنت متصل نشده باشید.",
"error_changing_file_permissions": "خطا هنگام تغییر مجوزهای {path}: {error}",
"error_removing": "خطا هنگام حذف {path}: {error}",
"error_writing_file": "خطا هنگام نوشتن فایل {file}: {error}",
"corrupted_toml": "TOML خراب از {ressource} (دلیل: {error})",
"corrupted_yaml": "YAML خراب از {ressource} (دلیل: {error})",
"corrupted_json": "جی سان خراب شده از {ressource} میخواند (دلیل: {error})",
"unknown_error_reading_file": "خطای ناشناخته هنگام تلاش برای خواندن فایل {file} (دلیل: {error})",
"cannot_write_file": "نمی توان فایل {file} را نوشت (دلیل: {error})",
"cannot_open_file": "فایل {file} باز نشد (دلیل: {error})",
"websocket_request_expected": "در انتظار درخواست وب سوکت",
"warning": "هشدار:",
"values_mismatch": "مقدار ها مطابقت ندارند",
"unknown_user": "کاربر'{user}' ناشناخته",
"unknown_group": "گروه '{group}' ناشناخته",
"unable_authenticate": "احراز هویّت امکان پذیر نیست",
"success": "موفقیّت!",
"server_already_running": "در حال حاضر یک سرور روی آن پورت کار می کند",
"root_required": "برای انجام این عمل باید کاربر ریشه باشید",
"pattern_not_match": "با الگو مطابقت ندارد",
"operation_interrupted": "عملیات قطع شده است",
"not_logged_in": "‌شما وارد نشده اید",
"logged_out": "خارج شده"
}

4
locales/fi.json Normal file
View file

@ -0,0 +1,4 @@
{
"password": "Salasana",
"logged_out": "Kirjauduttu ulos"
}

View file

@ -1,61 +1,47 @@
{
"argument_required": "Largument '{argument}' est requis",
"authentication_profile_required": "Lauthentification au profil '{profile}' est requise",
"argument_required": "L'argument '{argument}' est requis",
"authentication_required": "Authentification requise",
"authentication_required_long": "Lauthentification est requise pour exécuter cette action",
"colon": "{} : ",
"confirm": "Confirmez : {prompt}",
"confirm": "Confirmez {prompt}",
"deprecated_command": "'{prog} {command}' est déprécié et sera bientôt supprimé",
"deprecated_command_alias": "'{prog} {old}' est déprécié et sera bientôt supprimé, utilisez '{prog} {new}' à la place",
"error": "Erreur :",
"error_see_log": "Une erreur est survenue. Veuillez consulter les journaux pour plus de détails, ils sont situés dans /var/log/yunohost/.",
"file_exists": "Le fichier existe déjà : '{path}'",
"file_not_exist": "Le fichier '{path}' nexiste pas",
"folder_exists": "Le dossier existe déjà : '{path}'",
"folder_not_exist": "Le dossier nexiste pas",
"instance_already_running": "Une instance est déjà en cours dexécution, merci d'attendre sa fin avant d'en lancer une autre.",
"invalid_argument": "Argument '{argument}' incorrect : {error}",
"invalid_password": "Mot de passe incorrect",
"invalid_usage": "Utilisation erronée, utilisez --help pour accéder à laide",
"ldap_attribute_already_exists": "Lattribut '{attribute}' existe déjà avec la valeur suivante : '{value}'",
"ldap_server_down": "Impossible datteindre le serveur LDAP",
"error": "Erreur:",
"file_not_exist": "Le fichier '{path}' n'existe pas",
"folder_exists": "Le dossier existe déjà: '{path}'",
"instance_already_running": "Une instance est déjà en cours d'exécution, merci d'attendre sa fin avant d'en lancer une autre.",
"invalid_argument": "Argument '{argument}' incorrect: {error}",
"invalid_usage": "Utilisation erronée, utilisez --help pour accéder à l'aide",
"logged_in": "Connecté",
"logged_out": "Déconnecté",
"not_logged_in": "Vous nêtes pas connecté",
"not_logged_in": "Vous n'êtes pas connecté",
"operation_interrupted": "Opération interrompue",
"password": "Mot de passe",
"pattern_not_match": "Ne correspond pas au motif",
"permission_denied": "Permission refusée",
"root_required": "Vous devez être super-utilisateur pour exécuter cette action",
"server_already_running": "Un serveur est déjà en cours dexécution sur ce port",
"success": "Succès !",
"root_required": "Vous devez avoir les droits d'administration pour exécuter cette action",
"server_already_running": "Un serveur est déjà en cours d'exécution sur ce port",
"success": "Succès!",
"unable_authenticate": "Impossible de vous authentifier",
"unable_retrieve_session": "Impossible de récupérer la session à cause de '{exception}'",
"unknown_group": "Le groupe « '{group}' » est inconnu",
"unknown_user": "L'utilisateur « {user} » est inconnu",
"unknown_group": "Le groupe '{group}' est inconnu",
"unknown_user": "Le compte '{user}' est inconnu",
"values_mismatch": "Les valeurs ne correspondent pas",
"warning": "Attention :",
"warning": "Attention:",
"websocket_request_expected": "Une requête WebSocket est attendue",
"cannot_open_file": "Impossible douvrir le fichier {file:s} (raison : {error:s})",
"cannot_write_file": "Ne peut pas écrire le fichier {file:s} (raison : {error:s})",
"unknown_error_reading_file": "Erreur inconnue en essayant de lire le fichier {file:s} (cause:{error:s})",
"corrupted_json": "Fichier JSON corrompu en lecture depuis {ressource:s} (raison : {error:s})",
"error_writing_file": "Erreur en écrivant le fichier {file:s} : {error:s}",
"error_removing": "Erreur lors de la suppression {path:s} : {error:s}",
"error_changing_file_permissions": "Erreur lors de la modification des autorisations pour {path:s} : {error:s}",
"invalid_url": "URL {url:s} invalide : ce site existe-t-il ?",
"download_ssl_error": "Erreur SSL lors de la connexion à {url:s}",
"download_timeout": "{url:s} a pris trop de temps pour répondre : abandon.",
"download_unknown_error": "Erreur lors du téléchargement des données à partir de {url:s} : {error:s}",
"download_bad_status_code": "{url:s} renvoie le code d'état {code:s}",
"command_unknown": "Commande '{command:s}' inconnue ?",
"corrupted_yaml": "Fichier YAML corrompu en lecture depuis {ressource:s} (raison : {error:s})",
"info": "Info :",
"corrupted_toml": "Fichier TOML corrompu en lecture depuis {ressource:s} (cause : {error:s})",
"cannot_open_file": "Impossible d'ouvrir le fichier {file} (raison: {error})",
"cannot_write_file": "Ne peut pas écrire le fichier {file} (raison: {error})",
"unknown_error_reading_file": "Erreur inconnue en essayant de lire le fichier {file} (raison:{error})",
"corrupted_json": "Fichier JSON corrompu en lecture depuis {ressource} (raison: {error})",
"error_writing_file": "Erreur en écrivant le fichier {file}: {error}",
"error_removing": "Erreur lors de la suppression {path}: {error}",
"error_changing_file_permissions": "Erreur lors de la modification des autorisations pour {path}: {error}",
"invalid_url": "Impossible de se connecter à {url}... peut-être que le service est en panne ou que vous n'êtes pas correctement connecté à Internet en IPv4/IPv6.",
"download_ssl_error": "Erreur SSL lors de la connexion à {url}",
"download_timeout": "{url} a pris trop de temps pour répondre: abandon.",
"download_unknown_error": "Erreur lors du téléchargement des données à partir de {url}: {error}",
"download_bad_status_code": "{url} renvoie le code d'état {code}",
"corrupted_yaml": "Fichier YAML corrompu en lecture depuis {ressource} (raison: {error})",
"info": "Info:",
"corrupted_toml": "Fichier TOML corrompu en lecture depuis {ressource} (raison: {error})",
"warn_the_user_about_waiting_lock": "Une autre commande YunoHost est actuellement en cours, nous attendons qu'elle se termine avant de démarrer celle là",
"warn_the_user_about_waiting_lock_again": "Toujours en attente...",
"warn_the_user_that_lock_is_acquired": "La commande précédente vient de se terminer, lancement de cette nouvelle commande",
"invalid_token": "Jeton non valide - veuillez vous authentifier",
"ldap_server_is_down_restart_it": "Le service LDAP est arrêté, nous tentons de le redémarrer...",
"session_expired": "La session a expiré. Merci de vous ré-authentifier."
"edit_text_question": "{}. Modifier ce texte? [yN]: "
}

47
locales/gl.json Normal file
View file

@ -0,0 +1,47 @@
{
"invalid_usage": "Uso non válido, pass --help para ver a axuda",
"invalid_argument": "Argumento non válido '{argument}': {error}",
"instance_already_running": "Hai unha operación de YunoHost en execución. Por favor agarda a que remate antes de realizar unha nova.",
"info": "Info:",
"folder_exists": "Xa existe o cartafol: '{path}'",
"file_not_exist": "Non existe o ficheiro: '{path}'",
"error": "Erro:",
"deprecated_command_alias": "'{prog} {old}' xa non se utiliza e será eliminado no futuro, usa '{prog} {new}' no seu lugar",
"deprecated_command": "'{prog} {command}' xa non se utiliza e xa non se usará no futuro",
"confirm": "Confirma {prompt}",
"authentication_required": "Autenticación requerida",
"argument_required": "O argumento '{argument}' é requerido",
"logged_out": "Sesión pechada",
"password": "Contrasinal",
"warning": "Aviso:",
"values_mismatch": "Non concordan os valores",
"unknown_user": "Usuaria '{user}' descoñecida",
"unknown_group": "Grupo '{group}' descoñecido",
"unable_authenticate": "Non se puido autenticar",
"success": "Ben feito!",
"server_already_running": "Xa hai un servidor a funcionar nese porto",
"root_required": "Tes que ser root para facer esta acción",
"pattern_not_match": "Non concorda co patrón",
"operation_interrupted": "Interrumpeuse a operación",
"not_logged_in": "Non iniciaches sesión",
"logged_in": "Sesión iniciada",
"warn_the_user_that_lock_is_acquired": "O outro comando rematou, agora executarase este",
"warn_the_user_about_waiting_lock_again": "Agardando…",
"warn_the_user_about_waiting_lock": "Estase executando outro comando de YunoHost neste intre, estamos agardando a que remate para executar este",
"download_bad_status_code": "{url} devolveu o código de estado {code}",
"download_unknown_error": "Erro ao descargar os datos desde {url}: {error}",
"download_timeout": "{url} está tardando en responder, deixámolo.",
"download_ssl_error": "Erro SSL ao conectar con {url}",
"invalid_url": "Fallou a conexión con {url}... pode que o servizo estea caído, ou que non teñas conexión a Internet con IPv4/IPv6.",
"error_changing_file_permissions": "Erro ao cambiar os permisos de {path}: {error}",
"error_removing": "Erro ao eliminar {path}: {error}",
"error_writing_file": "Erro ao escribir o ficheiro {file}: {error}",
"corrupted_toml": "Lectura corrupta de datos TOML de {ressource} (razón: {error})",
"corrupted_yaml": "Lectura corrupta dos datos YAML de {ressource} (razón: {error})",
"corrupted_json": "Lectura corrupta dos datos JSON de {ressource} (razón: {error})",
"unknown_error_reading_file": "Erro descoñecido ao intentar ler o ficheiro {file} (razón: {error})",
"cannot_write_file": "Non se puido escribir o ficheiro {file} (razón: {error})",
"cannot_open_file": "Non se puido abrir o ficheiro {file} (razón: {error})",
"websocket_request_expected": "Agardábase unha solicitude WebSocket",
"edit_text_question": "{}. Editar este texto ? [yN]: "
}

1
locales/he.json Normal file
View file

@ -0,0 +1 @@
{}

View file

@ -1,39 +1,29 @@
{
"argument_required": "तर्क '{argument}' आवश्यक है",
"authentication_profile_required": "{profile} प्रोफ़ाइल के लिए प्रमाणीकरण की आवश्यकता है",
"authentication_required": "प्रमाणीकरण आवश्यक",
"authentication_required_long": "इस कार्य को करने के लिए प्रमाणीकरण आवश्यक है",
"colon": "{}: ",
"confirm": "पुष्टि करें {prompt}",
"deprecated_command": "'{prog}' '{command}' का प्रयोग न करे, भविष्य में इसे हटा दिया जाएगा",
"deprecated_command_alias": "'{prog} {old}' का प्रयोग न करे ,भविष्य में इसे हटा दिया जाएगा।इस की जगह '{prog} {new}' का प्रोयोग करे।",
"deprecated_command_alias": "'{prog} {old}' अब पुराना हो गया है और इसे भविष्य में हटा दिया जाएगा, इस की जगह '{prog} {new}' का प्रयोग करें",
"error": "गलती:",
"error_see_log": "एक त्रुटि पाई गई। कृपया विवरण के लिए लॉग देखें।",
"file_exists": "फ़ाइल पहले से ही मौजूद है:'{path}'",
"file_not_exist": "फ़ाइल मौजूद नहीं है: '{path}'",
"folder_exists": "फ़ोल्डर में पहले से ही मौजूद है: '{path}'",
"folder_not_exist": "फ़ोल्डर मौजूद नहीं है।",
"instance_already_running": "आवृत्ति पहले से चल रही है।",
"instance_already_running": "यूनोहोस्ट का एक कार्य पहले से चल रहा है। कृपया इस कार्य के समाप्त होने का इंतज़ार करें।",
"invalid_argument": "अवैध तर्क '{argument}':'{error}'",
"invalid_password": "अवैध पासवर्ड",
"invalid_usage": "अवैध उपयोग, सहायता देखने के लिए --help साथ लिखे।",
"ldap_attribute_already_exists": "'{attribute}' तर्क पहले इस वैल्यू '{value}' से मौजूद है।",
"ldap_server_down": "LDAP सर्वर तक पहुंचने में असमर्थ।",
"logged_in": "लोग्ड इन",
"logged_out": "लॉग आउट",
"not_logged_in": "आप लोग्ड इन नहीं हैं।",
"operation_interrupted": "कार्य बाधित",
"password": "पासवर्ड",
"pattern_not_match": "पैटर्न मेल नहीं खता है।",
"permission_denied": "अनुमति से इनकार।",
"root_required": "इस कार्य को करने के लिए ,आप का root होना आवक्षक है।",
"server_already_running": "कोई सर्वर पहले से ही इस पोर्ट पर चल रहा है।",
"success": "सफलता!",
"unable_authenticate": "प्रमाणित करने में असमर्थ।",
"unable_retrieve_session": "सेशन को प्राप्त करने में असमर्थ।",
"unknown_group": "अज्ञात ग्रुप: '{group}'",
"unknown_user": "अज्ञात उपयोगकर्ता: '{user}'",
"values_mismatch": "वैल्यूज मेल नहीं खाती।",
"warning": "चेतावनी:",
"websocket_request_expected": "एक WebSocket अनुरोध की उम्मीद।"
}
"websocket_request_expected": "एक WebSocket अनुरोध की उम्मीद।",
"info": "सूचना:"
}

View file

@ -1,4 +1,17 @@
{
"logged_out": "Kilépett",
"password": "Jelszó"
}
"password": "Jelszó",
"download_timeout": "{url} régóta nem válaszol, folyamat megszakítva.",
"invalid_url": "Helytelen URL: {url} (biztos létezik az oldal?)",
"cannot_open_file": "{file} megnyitása sikertelen (Oka: {error})",
"unknown_user": "Ismeretlen felhasználó: '{user}'",
"unknown_group": "Ismeretlen csoport: '{group}'",
"server_already_running": "Egy szerver már fut ezen a porton",
"logged_in": "Bejelentkezve",
"success": "Siker!",
"values_mismatch": "Eltérő értékek",
"warning": "Figyelem:",
"info": "Információ:",
"file_not_exist": "A fájl nem létezik: '{path}'",
"error": "Hiba:"
}

47
locales/id.json Normal file
View file

@ -0,0 +1,47 @@
{
"argument_required": "Argumen '{argument}' dibutuhkan",
"authentication_required": "Autentikasi dibutuhkan",
"deprecated_command": "'{prog} {command}' sudah usang dan akan dihapus nanti",
"logged_out": "Berhasil keluar",
"password": "Kata sandi",
"deprecated_command_alias": "'{prog} {old}' sudah usang dan akan dihapus nanti, gunakan '{prog} {new}'",
"info": "Informasi:",
"instance_already_running": "Sudah ada tindakan YunoHost yang sedang berjalan. Tunggu itu selesai sebelum menjalankan yang lain.",
"logged_in": "Berhasil masuk",
"warning": "Peringatan:",
"cannot_open_file": "Tidak dapat membuka berkas {file} (alasan: {error})",
"error_removing": "Terjadi galat ketika menghapus {path}: {error}",
"success": "Berhasil!",
"warn_the_user_about_waiting_lock": "Perintah YunoHost lain sedang berjalan saat ini, kami sedang menunggu itu selesai sebelum menjalankan yang ini",
"warn_the_user_about_waiting_lock_again": "Masih menunggu...",
"unable_authenticate": "Tidak dapat mengautentikasi",
"warn_the_user_that_lock_is_acquired": "Perintah yang tadi baru saja selesai, akan memulai perintah ini",
"server_already_running": "Sebuah peladen telah berjalan di porta tersebut",
"unknown_group": "Kelompok '{group}' tidak diketahui",
"unknown_user": "Pengguna '{user}' tidak diketahui",
"values_mismatch": "Nnilai berbeda",
"cannot_write_file": "Tidak dapat menyimpan berkas {file} (alasan: {error})",
"unknown_error_reading_file": "Galat yang tidak diketahui ketika membaca berkas {file} (alasan: {error})",
"invalid_url": "Gagal terhubung dengan {url}... mungkin layanan tersebut sedang turun, atau Anda tidak terhubung dengan benar ke internet di IPv4/IPv6.",
"download_timeout": "{url} memakan waktu yang lama untuk menjawab, menyerah.",
"download_unknown_error": "Galat ketika mengunduh data dari {url}: {error}",
"download_bad_status_code": "{url} menjawab dengan kode status {code}",
"confirm": "Konfirmasi {prompt}",
"edit_text_question": "{}. Sunting teks ini ? [yN]: ",
"error": "Galat:",
"file_not_exist": "Berkas tidak ada: '{path}'",
"folder_exists": "Berkas sudah ada: '{path}'",
"invalid_argument": "Argumen tidak valid '{argument}': {error}",
"invalid_usage": "Tidak valid, ikutkan --help untuk melihat bantuan",
"not_logged_in": "Anda belum masuk",
"operation_interrupted": "Tindakan terganggu",
"error_writing_file": "Galat ketika menyimpan berkas {file}: {error}",
"error_changing_file_permissions": "Galat ketika mengubah izin untuk {path}: {error}",
"download_ssl_error": "Galat SSL ketika menghubungi {url}",
"pattern_not_match": "Tidak cocok dengan pola",
"root_required": "Anda harus berada di root untuk melakukan tindakan ini",
"corrupted_yaml": "Pembacaan rusak untuk YAML {ressource} (alasan: {error})",
"corrupted_toml": "Pembacaan rusak untuk TOML {ressource} (alasan: {error})",
"corrupted_json": "Pembacaan rusak untuk JSON {ressource} (alasan: {error})",
"websocket_request_expected": "Mengharapkan permintaan WebSocket"
}

View file

@ -2,60 +2,46 @@
"logged_out": "Disconnesso",
"password": "Password",
"argument_required": "L'argomento '{argument}' è richiesto",
"authentication_profile_required": "Autenticazione al profilo '{profile}' richiesta",
"authentication_required": "Autenticazione richiesta",
"authentication_required_long": "Autenticazione richiesta per eseguire questa azione",
"colon": "{}: ",
"confirm": "Confermare {prompt}",
"deprecated_command": "'{prog} {command}' è deprecato e sarà rimosso in futuro",
"deprecated_command_alias": "'{prog} {old}' è deprecato e sarà rimosso in futuro, usa invece '{prog} {new}'",
"error": "Errore:",
"error_see_log": "Si è verificato un errore. Per favore controlla i registri per i dettagli, sono salvati in /var/log/yunohost/.",
"file_exists": "Il file esiste già: '{path}'",
"file_not_exist": "Il file non esiste: '{path}'",
"folder_exists": "La cartella esiste già: '{path}'",
"folder_not_exist": "La cartella non esiste",
"instance_already_running": "Esiste già un'operazione YunoHost in esecuzione. Attendi il completamento prima di eseguirne un altro.",
"invalid_argument": "Argomento non valido '{argument}': {error}",
"invalid_password": "Password non valida",
"invalid_usage": "Utilizzo non valido, usa --help per vedere l'aiuto",
"ldap_attribute_already_exists": "L'attributo '{attribute}' esiste già con valore '{value}'",
"ldap_server_down": "Impossibile raggiungere il server LDAP",
"logged_in": "Connesso",
"not_logged_in": "Non hai effettuato l'accesso",
"operation_interrupted": "Operazione interrotta",
"pattern_not_match": "Non corrisponde al modello",
"permission_denied": "Permesso negato",
"root_required": "Devi essere root per eseguire questa azione",
"server_already_running": "Un server è già in esecuzione su quella porta",
"success": "Riuscito!",
"unable_authenticate": "Autenticazione fallita",
"unable_retrieve_session": "Impossibile recuperare la sessione perché \"{exception}\"",
"unknown_group": "Gruppo '{group}' sconosciuto",
"unknown_user": "Utente '{user}' sconosciuto",
"values_mismatch": "I valori non corrispondono",
"warning": "Attenzione:",
"websocket_request_expected": "Richiesta WebSocket attesa",
"cannot_open_file": "Impossibile aprire il file {file:s} (motivo: {error:s})",
"cannot_write_file": "Impossibile scrivere il file {file:s} (motivo: {error:s})",
"unknown_error_reading_file": "Errore sconosciuto durante il tentativo di leggere il file {file:s} (motivo: {errore:s})",
"corrupted_json": "Lettura JSON corrotta da {resource:s} (motivo: {error:s})",
"corrupted_yaml": "Lettura YAML corrotta da {resource:s} (motivo: {error:s})",
"error_writing_file": "Errore durante la scrittura del file {file:s}: {error:s}",
"error_removing": "Errore durante la rimozione {path:s}: {error:s}",
"error_changing_file_permissions": "Errore durante il cambio di permessi per {path:s}: {error:s}",
"invalid_url": "URL non valido {url:s} (il sito esiste?)",
"download_ssl_error": "Errore SSL durante la connessione a {url:s}",
"download_timeout": "{url:s} ci ha messo troppo a rispondere, abbandonato.",
"download_unknown_error": "Errore durante il download di dati da {url:s} : {error:s}",
"download_bad_status_code": "{url:s} ha restituito il codice di stato {code:s}",
"command_unknown": "Comando '{command:s}' sconosciuto?",
"cannot_open_file": "Impossibile aprire il file {file} (motivo: {error})",
"cannot_write_file": "Impossibile scrivere il file {file} (motivo: {error})",
"unknown_error_reading_file": "Errore sconosciuto durante il tentativo di leggere il file {file} (motivo: {error})",
"corrupted_json": "Lettura JSON corrotta da {ressource} (motivo: {error})",
"corrupted_yaml": "Lettura YAML corrotta da {ressource} (motivo: {error})",
"error_writing_file": "Errore durante la scrittura del file {file}: {error}",
"error_removing": "Errore durante la rimozione {path}: {error}",
"error_changing_file_permissions": "Errore durante il cambio di permessi per {path}: {error}",
"invalid_url": "Fallita connessione a {url}… magari il servizio è down, o non sei connesso correttamente ad internet con IPv4/IPv6.",
"download_ssl_error": "Errore SSL durante la connessione a {url}",
"download_timeout": "{url} ci ha messo troppo a rispondere, abbandonato.",
"download_unknown_error": "Errore durante il download di dati da {url} : {error}",
"download_bad_status_code": "{url} ha restituito il codice di stato {code}",
"info": "Info:",
"warn_the_user_that_lock_is_acquired": "L'altro comando è appena completato, ora avvio questo comando",
"warn_the_user_about_waiting_lock_again": "Sto ancora aspettando ...",
"warn_the_user_about_waiting_lock_again": "Sto ancora aspettando",
"warn_the_user_about_waiting_lock": "Un altro comando YunoHost è in esecuzione in questo momento, stiamo aspettando che finisca prima di eseguire questo",
"corrupted_toml": "TOML corrotto da {ressource:s} (motivo: {errore:s})",
"invalid_token": "Token non valido: autenticare",
"session_expired": "La sessione è terminata. Sei pregato di autenticarti nuovamente.",
"ldap_server_is_down_restart_it": "Il servizio LDAP è terminato, provo a riavviarlo..."
}
"corrupted_toml": "TOML corrotto da {ressource} (motivo: {error})",
"edit_text_question": "{}. Modificare il testo? [yN]: "
}

47
locales/ja.json Normal file
View file

@ -0,0 +1,47 @@
{
"logged_out": "ログアウトしました",
"password": "パスワード",
"argument_required": "引数 '{argument}' が必要です",
"authentication_required": "認証が必要",
"confirm": "{prompt}の確認",
"deprecated_command": "'{prog} {command}' は非推奨であり、将来削除される予定です",
"deprecated_command_alias": "'{prog} {old}' は非推奨であり、今後削除される予定です。代わりに '{prog} {new}' を使用してください",
"edit_text_question": "{}.このテキストを編集しますか?[yN]: ",
"error": "エラー:",
"info": "インフォメーション:",
"download_unknown_error": "{url}からデータをダウンロードする際のエラー:{error}",
"download_bad_status_code": "{url}は状態コード {code} を返しました",
"warn_the_user_about_waiting_lock": "別のYunoHostコマンドが現在実行されているため、完了するのを待っています",
"warn_the_user_about_waiting_lock_again": "まだ待っています…",
"warn_the_user_that_lock_is_acquired": "他のコマンドが完了しました。このコマンドが開始されました",
"file_not_exist": "ファイルが存在しません: '{path}'",
"folder_exists": "フォルダは既に存在します: '{path}'",
"instance_already_running": "YunoHost 操作が既に実行されています。他の操作が完了するのを待ってください。",
"invalid_argument": "無効な引数 '{argument}': {error}",
"invalid_usage": "無効な使用法です。--help を渡してヘルプを表示します",
"logged_in": "ログイン済み",
"not_logged_in": "ログインしていません",
"operation_interrupted": "操作が中断されました",
"pattern_not_match": "パターンと一致しない",
"root_required": "このアクションを実行するには、rootである必要があります",
"server_already_running": "サーバーはそのポートで既に実行されています",
"success": "成功!",
"unable_authenticate": "認証できません",
"unknown_group": "不明な '{group}' グループ",
"unknown_user": "不明な '{user}' ユーザー",
"values_mismatch": "値が一致しない",
"warning": "警告:",
"websocket_request_expected": "WebSocket 要求が必要です",
"cannot_open_file": "ファイル{file}を開けませんでした(理由:{error})",
"cannot_write_file": "ファイル {file}を書き込めませんでした (理由: {error})",
"unknown_error_reading_file": "ファイル{file}を読み取ろうとしているときに不明なエラーが発生しました(理由:{error})",
"corrupted_json": "{ressource}から読み取られたJSONは破損していました(理由:{error})",
"corrupted_yaml": "破損した YAML が{ressource}から読み取られました (理由: {error})",
"corrupted_toml": "破損した TOML が{ressource}から読み取られました (理由: {error})",
"error_writing_file": "ファイル{file}書き込み時のエラー:{error}",
"error_removing": "{path}を削除するときのエラー:{error}",
"error_changing_file_permissions": "{path}のアクセス許可変更時のエラー: {error}",
"invalid_url": "{url}に接続できませんでした…サービスがダウンしているか、IPv4 / IPv6でインターネットに正しく接続されていない可能性があります。",
"download_ssl_error": "{url}への接続時のSSLエラー",
"download_timeout": "{url}は応答に時間がかかりすぎたため、あきらめました。"
}

8
locales/kab.json Normal file
View file

@ -0,0 +1,8 @@
{
"error": "Erreur :",
"success": "Akka d rrbeḥ !",
"password": "Awal n uɛeddi",
"logged_in": "Taqqneḍ",
"logged_out": "Yeffeɣ",
"authentication_required": "Tlaq tuqqna"
}

1
locales/ko.json Normal file
View file

@ -0,0 +1 @@
{}

1
locales/lt.json Normal file
View file

@ -0,0 +1 @@
{}

1
locales/mk.json Normal file
View file

@ -0,0 +1 @@
{}

View file

@ -4,19 +4,16 @@
"websocket_request_expected": "Forventet en WebSocket-forespørsel",
"warning": "Advarsel:",
"values_mismatch": "Verdiene samsvarer ikke",
"unknown_user": "Ukjent '{group}' bruker",
"unknown_user": "Ukjent '{user}' bruker",
"unknown_group": "Ukjent '{group}' gruppe",
"unable_authenticate": "Kunne ikke identitetsbekrefte",
"success": "Vellykket.",
"success": "Vellykket!",
"operation_interrupted": "Operasjon forstyrret",
"not_logged_in": "Du er ikke innlogget",
"logged_in": "Innlogget",
"invalid_password": "Ugyldig passord",
"info": "Info:",
"file_exists": "Filen finnes allerede: '{path}'",
"error": "Feil:",
"confirm": "Bekreft {prompt}",
"colon": "{}: ",
"logged_out": "Utlogget",
"password": "Passord"
}
}

View file

@ -4,8 +4,6 @@
"deprecated_command_alias": "'{prog} {old}' अस्वीकृत गरिएको छ र भविष्यमा हटाइनेछ, यसको सट्टा '{prog} {new}' प्रयोग गर्नुहोस्।",
"deprecated_command": "'{prog} {command}' अस्वीकृत गरिएको छ र भविष्यमा हटाइनेछ",
"confirm": "कन्फर्म {prompt}",
"colon": "{}: ",
"authentication_required_long": "यस कार्य गर्नको लागि प्रमाणीकरण आवाश्यक हुन्छ",
"authentication_required": "प्रमाणीकरण आवाश्यक छ",
"argument_required": "तर्क '{argument}' आवश्यक छ"
}
}

View file

@ -1,34 +1,23 @@
{
"argument_required": "Argument {argument} is vereist",
"authentication_profile_required": "Authenticatie tot profiel '{profile}' is vereist",
"authentication_required": "Aanmelding vereist",
"authentication_required_long": "Aanmelding is vereist om deze actie uit te voeren",
"colon": "{}: ",
"confirm": "Bevestig {prompt}",
"error": "Fout:",
"error_see_log": "Er is een fout opgetreden, zie logboek voor meer informatie. Je kan deze vinden in /var/log/yunohost/.",
"file_exists": "Kan '{path}' niet aanmaken: bestand bestaat al",
"file_not_exist": "Bestand bestaat niet: '{path}'",
"folder_exists": "Deze map bestaat al: '{path}'",
"folder_not_exist": "Map bestaat niet",
"instance_already_running": "Er is al een instantie actief, bedankt om te wachten tot deze afgesloten is alvorens een andere te starten.",
"instance_already_running": "Er is al een bewerking bezig. Even geduld tot deze afgesloten is, alvorens een andere te starten.",
"invalid_argument": "Ongeldig argument '{argument}': {error}",
"invalid_password": "Ongeldig wachtwoord",
"invalid_usage": "Ongeldig gebruik, doe --help om de hulptekst te lezen",
"ldap_attribute_already_exists": "Attribuut '{attribute}' bestaat al met waarde '{value}'",
"ldap_server_down": "Kan LDAP server niet bereiken",
"logged_in": "Ingelogd",
"logged_out": "Uitgelogd",
"not_logged_in": "U bent niet ingelogd",
"operation_interrupted": "Operatie onderbroken",
"password": "Wachtwoord",
"pattern_not_match": "Past niet in het patroon",
"permission_denied": "Toegang geweigerd",
"root_required": "Je moet root zijn om deze actie uit te voeren",
"server_already_running": "Er is al een server actief op die poort",
"success": "Succes!",
"unable_authenticate": "Aanmelding niet mogelijk",
"unable_retrieve_session": "Het is onmogelijk op de sessie op te halen omwille van '{exception}'",
"values_mismatch": "Waarden zijn niet gelijk",
"warning": "Waarschuwing:",
"websocket_request_expected": "Verwachtte een WebSocket request",
@ -36,24 +25,23 @@
"deprecated_command_alias": "'{prog} {old}' is verouderd en wordt binnenkort verwijderd, gebruik in de plaats '{prog} {new}'",
"unknown_group": "Groep '{group}' is onbekend",
"unknown_user": "Gebruiker '{user}' is onbekend",
"cannot_open_file": "Niet mogelijk om bestand {file:s} te openen (reden: {error:s})",
"cannot_write_file": "Niet gelukt om bestand {file:s} te schrijven (reden: {error:s})",
"unknown_error_reading_file": "Ongekende fout tijdens het lezen van bestand {file:s} (cause:{error:s})",
"corrupted_json": "Corrupte json gelezen van {ressource:s} (reden: {error:s})",
"error_writing_file": "Fout tijdens het schrijven van bestand {file:s}: {error:s}",
"error_removing": "Fout tijdens het verwijderen van {path:s}: {error:s}",
"error_changing_file_permissions": "Fout tijdens het veranderen van machtiging voor {path:s}: {error:s}",
"invalid_url": "Ongeldige URL {url:s} (bestaat deze website?)",
"download_ssl_error": "SSL fout gedurende verbinding met {url:s}",
"download_timeout": "{url:s} neemt te veel tijd om te antwoorden, we geven het op.",
"download_unknown_error": "Fout tijdens het downloaden van data van {url:s}: {error:s}",
"download_bad_status_code": "{url:s} stuurt status code {code:s}",
"command_unknown": "Opdracht '{command:s}' ongekend ?",
"warn_the_user_that_lock_is_acquired": "de andere opdracht is zojuist voltooid en start nu deze opdracht",
"warn_the_user_about_waiting_lock_again": "Nog steeds aan het wachten...",
"cannot_open_file": "Niet mogelijk om bestand {file} te openen (reden: {error})",
"cannot_write_file": "Niet gelukt om bestand {file} te schrijven (reden: {error})",
"unknown_error_reading_file": "Ongekende fout tijdens het lezen van bestand {file} (cause:{error})",
"corrupted_json": "Corrupte JSON gelezen van {ressource} (reden: {error})",
"error_writing_file": "Fout tijdens het schrijven van bestand {file}: {error}",
"error_removing": "Fout tijdens het verwijderen van {path}: {error}",
"error_changing_file_permissions": "Fout tijdens het veranderen van machtiging voor {path}: {error}",
"invalid_url": "Kon niet verbinden met {url}… misschien is de dienst uit de lucht, of ben je niet goed verbonden via IPv4 of IPv6.",
"download_ssl_error": "SSL fout gedurende verbinding met {url}",
"download_timeout": "{url} neemt te veel tijd om te antwoorden, we geven het op.",
"download_unknown_error": "Fout tijdens het downloaden van data van {url}: {error}",
"download_bad_status_code": "{url} stuurt status code {code}",
"warn_the_user_that_lock_is_acquired": "De andere opdracht is zojuist voltooid; nu wordt nu deze opdracht gestart",
"warn_the_user_about_waiting_lock_again": "Nog steeds aan het wachten…",
"warn_the_user_about_waiting_lock": "Een ander YunoHost commando wordt uitgevoerd, we wachten tot het gedaan is alovrens dit te starten",
"corrupted_toml": "Ongeldige TOML werd gelezen op {ressource:s} (reason: {error:s})",
"corrupted_yaml": "Ongeldig YAML bestand op {ressource:s} (reason: {error:s})",
"invalid_token": "Ongeldig token - gelieve in te loggen",
"info": "Ter info:"
}
"corrupted_toml": "Ongeldige TOML werd gelezen van {ressource} (reason: {error})",
"corrupted_yaml": "Ongeldig YAML bestand op {ressource} (reden: {error})",
"info": "Ter info:",
"edit_text_question": "{}. Deze tekst bewerken ? [yN]: "
}

View file

@ -1,61 +1,47 @@
{
"argument_required": "Largument {argument} es requesit",
"authentication_profile_required": "Lidentificacion del perfil {profile} es requesida",
"authentication_required": "Autentificacion requesida",
"authentication_required_long": "Una autentificacion es requesida per acomplir aquesta accion",
"logged_in": "Connectat",
"logged_out": "Desconnectat",
"password": "Senhal",
"colon": "{}: ",
"confirm": "Confirmatz: {prompt}",
"deprecated_command": "« {prog} {command} » es despreciat e serà lèu suprimit",
"deprecated_command_alias": "« {prog} {old} » es despreciat e serà lèu suprimit, utilizatz « {prog} {new} » allòc",
"error": "Error:",
"error_see_log": "Una error ses producha. Mercés de consultar los jornals per mai detalhs, son plaçats dins /var/log/yunohost/.",
"file_exists": "Lo fichièr existís ja: « {path} »",
"file_not_exist": "Lo fichièr « {path} » existís pas",
"folder_exists": "Lo repertòri existís ja: « {path} »",
"folder_not_exist": "Lo repertòri existís pas",
"instance_already_running": "I a ja una operacion de YunoHost en cors. Mercés desperar que sacabe abans de ne lançar una mai.",
"invalid_argument": "Argument « {argument} » incorrècte: {error}",
"invalid_password": "Senhal incorrècte",
"ldap_server_down": "Impossible daténher lo servidor LDAP",
"not_logged_in": "Cap de session començada",
"pattern_not_match": "Correspond pas al patron",
"permission_denied": "Permission refusada",
"root_required": "Cal èsser root per realizar aquesta accion",
"unable_retrieve_session": "Recuperacion impossibla de la session a causa de « {exception} »",
"unknown_group": "Grop « {group} » desconegut",
"unknown_user": "Utilizaire « {user} » desconegut",
"values_mismatch": "Las valors correspondon pas",
"warning": "Atencion:",
"invalid_usage": "Usatge invalid, utilizatz --help per accedir a lajuda",
"ldap_attribute_already_exists": "Latribut « {attribute} » existís ja amb la valor: {value}",
"operation_interrupted": "Operacion interrompuda",
"server_already_running": "Un servidor es ja en execucion sus aqueste pòrt",
"success": "Capitada!",
"unable_authenticate": "Impossible de vos autentificar",
"websocket_request_expected": "Una requèsta WebSocket èra esperada",
"cannot_open_file": "Impossible de dobrir lo fichièr {file:s} (rason: {error:s})",
"cannot_write_file": "Escritura impossibla del fichièr {file:s} (rason: {error:s})",
"unknown_error_reading_file": "Error desconeguda en ensajar de legir lo fichièr {file:s} (rason: {error:s})",
"error_writing_file": "Error en escriure lo fichièr {file:s}: {error:s}",
"error_removing": "Error en suprimir {path:s}: {error:s}",
"error_changing_file_permissions": "Error en modificar las permissions per {path:s}: {error:s}",
"invalid_url": "Url invalida {url:s} (existís aqueste site?)",
"download_ssl_error": "Error SSL en se connectant a {url:s}",
"download_timeout": "{url:s} a trigat per respondre, avèm quitat desperar.",
"download_unknown_error": "Error en telecargar de donadas de {url:s}: {error:s}",
"download_bad_status_code": "{url:s} tòrna lo còdi destat {code:s}",
"command_unknown": "Comanda « {command:s} » desconeguda?",
"corrupted_json": "Fichièr Json corromput legit de {ressource:s} (rason: {error:s})",
"corrupted_yaml": "Fichièr YAML corromput legit de {ressource:s} (rason: {error:s})",
"cannot_open_file": "Impossible de dobrir lo fichièr {file} (rason: {error})",
"cannot_write_file": "Escritura impossibla del fichièr {file} (rason: {error})",
"unknown_error_reading_file": "Error desconeguda en ensajar de legir lo fichièr {file} (rason: {error})",
"error_writing_file": "Error en escriure lo fichièr {file}: {error}",
"error_removing": "Error en suprimir {path}: {error}",
"error_changing_file_permissions": "Error en modificar las permissions per {path}: {error}",
"invalid_url": "Url invalida {url} (existís aqueste site?)",
"download_ssl_error": "Error SSL en se connectant a {url}",
"download_timeout": "{url} a trigat per respondre, avèm quitat desperar.",
"download_unknown_error": "Error en telecargar de donadas de {url}: {error}",
"download_bad_status_code": "{url} tòrna lo còdi destat {code}",
"corrupted_json": "Fichièr Json corromput legit de {ressource} (rason: {error})",
"corrupted_yaml": "Fichièr YAML corromput legit de {ressource} (rason: {error})",
"info": "Info:",
"corrupted_toml": "Fichièr TOML corromput en lectura de {ressource:s} estant (rason: {error:s})",
"corrupted_toml": "Fichièr TOML corromput en lectura de {ressource} estant (rason: {error})",
"warn_the_user_about_waiting_lock": "Una autra comanda YunoHost es en execucion, sèm a esperar quacabe abans daviar aquesta daquí",
"warn_the_user_about_waiting_lock_again": "Encara en espèra…",
"warn_the_user_that_lock_is_acquired": "lautra comanda ven dacabar, ara lançament daquesta comanda",
"invalid_token": "Geton invalid - volgatz vos autentificar",
"ldap_server_is_down_restart_it": "Lo servici LDAP ses atudat, ensajam de lo reaviar…",
"session_expired": "La session a expirat. Tornatz vos autentificar."
}
"edit_text_question": "{}. Modificar aqueste tèxte? [yN]: "
}

View file

@ -1,30 +1,28 @@
{
"logged_out": "Wylogowano",
"password": "Hasło",
"warn_the_user_that_lock_is_acquired": "drugie polecenie właśnie się zakończyło, teraz uruchamiając to polecenie",
"warn_the_user_about_waiting_lock_again": "Wciąż czekam...",
"warn_the_user_about_waiting_lock": "Kolejne polecenie YunoHost jest teraz uruchomione, czekamy na jego zakończenie przed uruchomieniem tego",
"command_unknown": "Polecenie „{command:s}” jest nieznane?",
"download_bad_status_code": "{url:s} zwrócił kod stanu {code:s}",
"download_unknown_error": "Błąd podczas pobierania danych z {url:s}: {error:s}",
"download_timeout": "{url:s} odpowiedział zbyt długo, poddał się.",
"download_ssl_error": "Błąd SSL podczas łączenia z {url:s}",
"invalid_url": "Nieprawidłowy adres URL {url:s} (czy ta strona istnieje?)",
"error_changing_file_permissions": "Błąd podczas zmiany uprawnień dla {path:s}: {error:s}",
"error_removing": "Błąd podczas usuwania {path:s}: {error:s}",
"error_writing_file": "Błąd podczas zapisywania pliku {file:s}: {error:s}",
"corrupted_toml": "Uszkodzony toml z {ressource: s} (powód: {error:s})",
"corrupted_yaml": "Uszkodzony yaml odczytany z {ressource:s} (powód: {error:s})",
"corrupted_json": "Uszkodzony json odczytany z {ressource:s} (powód: {error:s})",
"unknown_error_reading_file": "Nieznany błąd podczas próby odczytania pliku {file:s} (przyczyna: {error:s})",
"cannot_write_file": "Nie można zapisać pliku {file:s} (przyczyna: {error:s})",
"cannot_open_file": "Nie można otworzyć pliku {file:s} (przyczyna: {error:s})",
"warn_the_user_that_lock_is_acquired": "Inne polecenie właśnie się zakończyło, teraz uruchamiam to polecenie",
"warn_the_user_about_waiting_lock_again": "Wciąż czekam…",
"warn_the_user_about_waiting_lock": "Kolejne polecenie YunoHost jest obecnie uruchomione, czekamy na jego zakończenie przed uruchomieniem tego",
"download_bad_status_code": "{url} zwrócił kod stanu {code}",
"download_unknown_error": "Błąd podczas pobierania danych z {url}: {error}",
"download_timeout": "{url} potrzebował zbyt dużo czasu na odpowiedź, rezygnacja.",
"download_ssl_error": "Błąd SSL podczas łączenia z {url}",
"invalid_url": "Nie udało się połączyć z {url}… być może strona nie jest dostępna, lub nie jesteś prawidłowo połączony z Internetem po IPv4/IPv6.",
"error_changing_file_permissions": "Błąd podczas zmiany uprawnień dla {path}: {error}",
"error_removing": "Błąd podczas usuwania {path}: {error}",
"error_writing_file": "Błąd podczas zapisywania pliku {file}: {error}",
"corrupted_toml": "Uszkodzony TOML odczytany z {ressource} (reason: {error})",
"corrupted_yaml": "Uszkodzony YAML odczytany z {ressource} (reason: {error})",
"corrupted_json": "Uszkodzony JSON odczytany z {ressource} (reason: {error})",
"unknown_error_reading_file": "Nieznany błąd podczas próby odczytania pliku {file} (przyczyna: {error})",
"cannot_write_file": "Nie można zapisać pliku {file} (przyczyna: {error})",
"cannot_open_file": "Nie można otworzyć pliku {file} (przyczyna: {error})",
"websocket_request_expected": "Oczekiwano żądania WebSocket",
"warning": "Ostrzeżenie:",
"values_mismatch": "Wartości nie pasują",
"unknown_user": "Nieznany użytkownik „{user}”",
"unknown_group": "Nieznana grupa „{group}”",
"unable_retrieve_session": "Nie można pobrać sesji, ponieważ „{exception}”",
"unknown_user": "Nieznany użytkownik '{user}'",
"unknown_group": "Nieznana grupa '{group}'",
"unable_authenticate": "Nie można uwierzytelnić",
"success": "Sukces!",
"server_already_running": "Serwer już działa na tym porcie",
@ -33,25 +31,17 @@
"operation_interrupted": "Operacja przerwana",
"not_logged_in": "Nie jesteś zalogowany",
"logged_in": "Zalogowany",
"ldap_server_down": "Nie można połączyć się z serwerem LDAP",
"ldap_attribute_already_exists": "Atrybut „{attribute}” już istnieje z wartością „{value}”",
"invalid_usage": "Nieprawidłowe użycie. Przejdź --help, aby wyświetlić pomoc",
"invalid_token": "Nieprawidłowy token - proszę uwierzytelnić",
"invalid_password": "Nieprawidłowe hasło",
"invalid_usage": "Nieprawidłowe użycie, wprowadź --help, aby wyświetlić pomoc",
"invalid_argument": "Nieprawidłowy argument „{argument}”: {error}",
"instance_already_running": "Trwa już operacja YunoHost. Zaczekaj na zakończenie, zanim uruchomisz kolejny.",
"info": "Informacje:",
"folder_not_exist": "Folder nie istnieje",
"instance_already_running": "Trwa już operacja YunoHost. Zaczekaj na jej zakończenie, zanim uruchomisz kolejną.",
"info": "Info:",
"folder_exists": "Folder już istnieje: „{path}”",
"file_not_exist": "Plik nie istnieje: „{path}”",
"file_exists": "Plik już istnieje: „{path}”",
"error_see_log": "Wystąpił błąd. Szczegółowe informacje można znaleźć w dziennikach, znajdują się one w katalogu /var/log/yunohost/.",
"error": "Błąd:",
"deprecated_command_alias": "„{prog} {old}” jest przestarzałe i zostanie usunięte w przyszłości, zamiast tego użyj „{prog} {new}”",
"deprecated_command": "„{prog} {command}” jest przestarzałe i zostanie usunięte w przyszłości",
"confirm": "Potwierdź {prompt}",
"colon": "{}: ",
"authentication_required_long": "Do wykonania tej czynności wymagane jest uwierzytelnienie",
"authentication_required": "Wymagane uwierzytelnienie",
"argument_required": "Argument „{argument}” jest wymagany"
}
"argument_required": "Argument „{argument}” jest wymagany",
"edit_text_question": "{}. Zedytować ten tekst? [tN]: "
}

View file

@ -1,61 +1,47 @@
{
"argument_required": "O argumento {argument} é obrigatório",
"authentication_profile_required": "Autenticação requerida para o perfil '{profile}'",
"argument_required": "O argumento '{argument}' é obrigatório",
"authentication_required": "Autenticação obrigatória",
"authentication_required_long": "É preciso autenticar-se para realizar esta ação",
"colon": "{}: ",
"confirm": "Confirmar {prompt}",
"error": "Erro:",
"file_exists": "A pasta já existe: '{path}'",
"file_not_exist": "O ficheiro não existe: '{path}'",
"folder_exists": "A pasta já existe: '{path}'",
"folder_not_exist": "A pasta não existe",
"instance_already_running": "Já existe uma operação YunoHost em execução. Aguarde o término antes de executar outro.",
"invalid_argument": "Argumento inválido '{argument}': {error}",
"invalid_password": "Senha incorreta",
"invalid_usage": "Uso invalido, utilizar --help para ver a ajuda",
"ldap_attribute_already_exists": "O atributo '{attribute}' já existe com valor '{value}'",
"ldap_server_down": "Não foi possível comunicar com o servidor LDAP",
"logged_in": "Sessão iniciada",
"logged_out": "Sessão terminada",
"not_logged_in": "Não tem sessão iniciada",
"operation_interrupted": "Operação cancelada",
"password": "Senha",
"pattern_not_match": "Não corresponde ao motivo",
"permission_denied": "Permissão revogada",
"root_required": "Deve ser root (administrador) para realizar esta ação",
"server_already_running": "Existe um servidor ativo nessa porta",
"success": "Sucesso!",
"unable_authenticate": "Não foi possível autenticar",
"unable_retrieve_session": "Não foi possível recuperar a sessão porque '{exception}'",
"values_mismatch": "Os valores não coincidem",
"warning": "Aviso:",
"websocket_request_expected": "Esperado um pedido a WebSocket",
"deprecated_command": "'{prog} {command}' está obsoleto e será removido no futuro",
"deprecated_command_alias": "'{prog} {old}' está obsoleto e será removido no futuro, em vez disso, usa '{prog} {new}'",
"error_see_log": "Ocorreu um erro . Por favor, veja os logs para maiores detalhes, eles estão localizados em /var/log/yunohost/.",
"unknown_group": "Grupo '{group}' desconhecido",
"unknown_user": "Nome de utilizador '{user}' desconhecido",
"cannot_open_file": "Não foi possível abrir o arquivo {file:s} (reason: {error:s})",
"cannot_write_file": "Não foi possível abrir o arquivo {file:s} (reason: {error:s})",
"unknown_error_reading_file": "Erro desconhecido ao tentar ler o arquivo {file:s} (motivo: {error:s})",
"error_writing_file": "Erro ao gravar arquivo {file:s}: {error:s}",
"error_removing": "Erro ao remover {path:s}: {error:s}",
"error_changing_file_permissions": "Erro ao alterar as permissões para {path:s}: {error:s}",
"invalid_url": "URL inválida {url:s} (Esse site existe ?)",
"download_ssl_error": "Erro de SSL ao conectar-se a {url:s}",
"download_timeout": "{url:s} demorou muito para responder, desistiu.",
"download_unknown_error": "Erro quando baixando os dados de {url:s} : {error:s}",
"download_bad_status_code": "{url:s} retornou o código de status {code:s}",
"command_unknown": "Comando '{command:s}' desconhecido ?",
"corrupted_json": "JSON corrompido lido do {ressource:s} (motivo: {error:s})",
"corrupted_yaml": "YAML corrompido lido do {ressource:s} (motivo: {error:s})",
"cannot_open_file": "Não foi possível abrir o arquivo {file} (reason: {error})",
"cannot_write_file": "Não foi possível abrir o arquivo {file} (reason: {error})",
"unknown_error_reading_file": "Erro desconhecido ao tentar ler o arquivo {file} (motivo: {error})",
"error_writing_file": "Erro ao gravar arquivo {file}: {error}",
"error_removing": "Erro ao remover {path}: {error}",
"error_changing_file_permissions": "Erro ao alterar as permissões para {path}: {error}",
"invalid_url": "URL inválida {url} (Esse site existe ?)",
"download_ssl_error": "Erro de SSL ao conectar-se a {url}",
"download_timeout": "{url} demorou muito para responder, desistiu.",
"download_unknown_error": "Erro quando baixando os dados de {url} : {error}",
"download_bad_status_code": "{url} retornou o código de status {code}",
"corrupted_json": "JSON corrompido lido do {ressource} (motivo: {error})",
"corrupted_yaml": "YAML corrompido lido do {ressource} (motivo: {error})",
"warn_the_user_that_lock_is_acquired": "O outro comando acabou de concluir, agora iniciando este comando",
"warn_the_user_about_waiting_lock_again": "Ainda esperando...",
"warn_the_user_about_waiting_lock_again": "Ainda esperando",
"warn_the_user_about_waiting_lock": "Outro comando YunoHost está sendo executado agora, estamos aguardando o término antes de executar este",
"corrupted_toml": "TOML corrompido lido em {ressource:s} (motivo: {error:s})",
"invalid_token": "Token inválido - autentique",
"corrupted_toml": "TOML corrompido lido em {ressource} (motivo: {error})",
"info": "Informações:",
"ldap_server_is_down_restart_it": "O serviço LDAP esta caído, tentando reiniciá-lo...",
"session_expired": "A sessão expirou. Se autentique de novo por favor."
}
"edit_text_question": "{}. Editar este texto ? [yN]: "
}

1
locales/pt_BR.json Normal file
View file

@ -0,0 +1 @@
{}

View file

@ -1,24 +1,16 @@
{
"argument_required": "Требуется'{argument}' аргумент",
"authentication_profile_required": "Для доступа к '{profile}' требуется аутентификация",
"argument_required": "Требуется аргумент «{argument}»",
"authentication_required": "Требуется аутентификация",
"authentication_required_long": "Для этого действия требуется аутентификация",
"colon": "{}: ",
"confirm": "Подтвердить {prompt}",
"deprecated_command": "'{prog} {command}' устарела и будет удалена",
"deprecated_command_alias": "'{prog} {old}' устарела и будет удалена, вместо неё используйте '{prog} {new}'",
"error": "Ошибка:",
"error_see_log": "Произошла ошибка. Пожалуйста, смотри подробности в логах, находящихся /var/log/yunohost/.",
"file_exists": "Файл уже существует: '{path}'",
"file_not_exist": "Файл не существует: '{path}'",
"folder_exists": "Каталог уже существует: '{path}'",
"folder_not_exist": "Каталог не существует",
"invalid_argument": "Неправильный аргумент '{argument}': {error}",
"invalid_password": "Неправильный пароль",
"ldap_attribute_already_exists": "Атрибут '{attribute}' уже существует со значением '{value}'",
"logged_in": "Вы вошли",
"logged_out": "Вы вышли из системы",
"not_logged_in": "Вы не залогинились",
"not_logged_in": "Вы не вошли в систему",
"operation_interrupted": "Действие прервано",
"password": "Пароль",
"pattern_not_match": "Не соответствует образцу",
@ -30,29 +22,26 @@
"values_mismatch": "Неверные значения",
"warning": "Внимание :",
"websocket_request_expected": "Ожидается запрос WebSocket",
"cannot_open_file": "Не могу открыть файл {file:s} (причина: {error:s})",
"cannot_write_file": "Не могу записать файл {file:s} (причина: {error:s})",
"unknown_error_reading_file": "Неизвестная ошибка при попытке прочитать файл {file:s} (причина: {error:s})",
"corrupted_yaml": "Повреждённой yaml получен от {ressource:s} (причина: {error:s})",
"error_writing_file": "Ошибка при записи файла {file:s}: {error:s}",
"error_removing": "Ошибка при удалении {path:s}: {error:s}",
"invalid_url": "Неправильный url {url:s} (этот сайт существует ?)",
"download_ssl_error": "Ошибка SSL при соединении с {url:s}",
"download_timeout": "Превышено время ожидания ответа от {url:s}.",
"download_unknown_error": "Ошибка при загрузке данных с {url:s} : {error:s}",
"cannot_open_file": "Не могу открыть файл {file} (причина: {error})",
"cannot_write_file": "Не могу записать файл {file} (причина: {error})",
"unknown_error_reading_file": "Неизвестная ошибка при попытке прочитать файл {file} (причина: {error})",
"corrupted_yaml": "Повреждённой YAML получен от {ressource} (причина: {error})",
"error_writing_file": "Ошибка при записи файла {file}: {error}",
"error_removing": "Ошибка при удалении {path}: {error}",
"invalid_url": "Не удалось подключиться к {url}... возможно этот сервис недоступен или вы не подключены к Интернету через IPv4/IPv6.",
"download_ssl_error": "Ошибка SSL при соединении с {url}",
"download_timeout": "Превышено время ожидания ответа от {url}.",
"download_unknown_error": "Ошибка при загрузке данных с {url} : {error}",
"instance_already_running": "Операция YunoHost уже запущена. Пожалуйста, подождите, пока он закончится, прежде чем запускать другой.",
"root_required": "Чтобы выполнить это действие, вы должны иметь права root",
"corrupted_json": "Повреждённый json получен от {ressource:s} (причина: {error:s})",
"command_unknown": "Команда '{command:s}' неизвестна ?",
"warn_the_user_that_lock_is_acquired": "другая команда только что завершилась, теперь запускает эту команду",
"corrupted_json": "Повреждённый json получен от {ressource} (причина: {error})",
"warn_the_user_that_lock_is_acquired": "Другая команда только что завершилась, теперь запускается эта команда",
"warn_the_user_about_waiting_lock_again": "Все еще жду...",
"warn_the_user_about_waiting_lock": "Сейчас запускается еще одна команда YunoHost, мы ждем ее завершения, прежде чем запустить эту",
"download_bad_status_code": "{url:s} вернул код состояния {code:s}",
"error_changing_file_permissions": "Ошибка при изменении разрешений для {path:s}: {error:s}",
"corrupted_toml": "Поврежденный том, прочитанный из {ressource:s} (причина: {error:s})",
"unable_retrieve_session": "Невозможно получить сеанс, так как '{exception}'",
"ldap_server_down": "Невозможно связаться с сервером LDAP",
"download_bad_status_code": "{url} вернул код состояния {code}",
"error_changing_file_permissions": "Ошибка при изменении разрешений для {path}: {error}",
"corrupted_toml": "Поврежденный TOML, прочитанный из {ressource} (причина: {error})",
"invalid_usage": "Неправильное использование, передайте --help, чтобы увидеть помощь",
"invalid_token": "Неверный токен - пожалуйста, авторизуйтесь",
"info": "Информация:"
"info": "Информация:",
"edit_text_question": "{}. Изменить этот текст? [yN]: "
}

47
locales/sk.json Normal file
View file

@ -0,0 +1,47 @@
{
"authentication_required": "Vyžadované overenie",
"confirm": "Potvrdiť {prompt}",
"password": "Heslo",
"argument_required": "Je vyžadovaný argument '{argument}'",
"deprecated_command": "'{prog} {command}' je zastaraný a v ďalších verziách bude odstránený",
"deprecated_command_alias": "'{prog} {old}' je zastaraný a v ďalších verziách bude odstránený, použite miesto neho '{prog} {new}'",
"edit_text_question": "{}. Upraviť tento text? [yN]: ",
"error": "Chyba:",
"file_not_exist": "Súbor neexistuje: '{path}'",
"folder_exists": "Adresár už existuje: '{path}'",
"info": "Informácie:",
"instance_already_running": "Práve prebieha iná YunoHost operácia. Pred spustením ďalšej operácie počkajte na jej dokončenie.",
"invalid_argument": "Nesprávny argument '{argument}': {error}",
"invalid_usage": "Nesprávne použitie, pridajte --help pre zobrazenie pomocníka",
"logged_in": "Prihlásený",
"logged_out": "Boli ste odhlásený",
"not_logged_in": "Nie ste prihlásený",
"operation_interrupted": "Operácia bola prerušená",
"pattern_not_match": "Nezodpovedá výrazu",
"root_required": "Pre vykonanie tejto akcie musíte byť root",
"server_already_running": "Na tomto porte už server beží",
"success": "Podarilo sa!",
"unable_authenticate": "Nie je možné overiť",
"unknown_group": "Neznáma skupina '{group}'",
"unknown_user": "Neznámy používateľ '{user}'",
"values_mismatch": "Hodnoty nesúhlasia",
"warning": "Varovanie:",
"websocket_request_expected": "Očakávaná WebSocket požiadavka",
"cannot_open_file": "Nedá sa otvoriť súbor {file} (príčina: {error})",
"cannot_write_file": "Nedá sa zapísať do súboru {file} (príčina: {error})",
"unknown_error_reading_file": "Vyskytla sa neznáma chyba pri čítaní súboru {file} (príčina: {error})",
"corrupted_json": "Nepodarilo sa načítať JSON {ressource} (príčina: {error})",
"corrupted_yaml": "Nepodarilo sa načítať YAML z {ressource} (príčina: {error})",
"corrupted_toml": "Nepodarilo sa načítať TOML z {ressource} (príčina: {error})",
"error_writing_file": "Chyba pri zápise do súboru {file}: {error}",
"error_removing": "Chyba pri odstraňovaní {path}: {error}",
"error_changing_file_permissions": "Chyba pri nastavovaní oprávnení pre {path}: {error}",
"invalid_url": "Nepodarilo sa pripojiť k {url}… možno je služba vypnutá alebo nemáte fungujúce pripojenie k internetu prostredníctvom IPv4/IPv6.",
"download_ssl_error": "SSL chyba počas spojenia s {url}",
"download_timeout": "{url} príliš dlho neodpovedá, vzdávam to.",
"download_unknown_error": "Chyba pri sťahovaní dát z {url}: {error}",
"download_bad_status_code": "{url} vrátil stavový kód {code}",
"warn_the_user_about_waiting_lock": "Práve prebieha iná operácia YunoHost, pred spustením čakáme na jej dokončenie",
"warn_the_user_about_waiting_lock_again": "Stále čakáme…",
"warn_the_user_that_lock_is_acquired": "Predchádzajúca operácia bola dokončená, teraz spúšťame túto"
}

1
locales/sl.json Normal file
View file

@ -0,0 +1 @@
{}

View file

@ -1,10 +1,10 @@
{
"warn_the_user_about_waiting_lock_again": "Väntar fortfarande …",
"download_bad_status_code": "{url:s} svarade med statuskod {code:s}",
"download_timeout": "Gav upp eftersom {url:s} tog för lång tid på sig att svara.",
"download_ssl_error": "Ett SSL-fel påträffades vid anslutning till {url:s}",
"cannot_write_file": "Kunde inte skriva till filen {file:s} (orsak: {error:s})",
"cannot_open_file": "Kunde inte öppna filen {file:s} (orsak: {error:s})",
"warn_the_user_about_waiting_lock_again": "Väntar fortfarande…",
"download_bad_status_code": "{url} svarade med statuskod {code}",
"download_timeout": "Gav upp eftersom {url} tog för lång tid på sig att svara.",
"download_ssl_error": "Ett SSL-fel påträffades vid anslutning till {url}",
"cannot_write_file": "Kunde inte skriva till filen {file} (orsak: {error})",
"cannot_open_file": "Kunde inte öppna filen {file} (orsak: {error})",
"websocket_request_expected": "Förväntade en WebSocket-förfrågan",
"warning": "Varning:",
"values_mismatch": "Värdena stämmer inte överens",
@ -17,41 +17,30 @@
"operation_interrupted": "Behandling avbruten",
"not_logged_in": "Du är inte inloggad",
"logged_in": "Inloggad",
"ldap_attribute_already_exists": "Attributet '{attribute}' finns redan med värdet '{value}'",
"invalid_password": "Ogiltigt lösenord",
"invalid_argument": "Ogiltig parameter '{argument}': {error}",
"logged_out": "Utloggad",
"info": "Info:",
"folder_not_exist": "Katalogen finns inte",
"folder_exists": "Katalogen finns redan: '{path}'",
"file_not_exist": "Filen finns inte: '{path}'",
"file_exists": "Filen finns redan: '{path}'",
"error_see_log": "Ett fel har inträffat. Kolla gärna i loggfilerna för mer information, de finns i /var/log/yunohost/.",
"error": "Fel:",
"deprecated_command_alias": "'{prog} {old}' rekommenderas inte längre och kommer tas bort i framtiden, använd '{prog} {new}' istället",
"deprecated_command": "'{prog} {command}' rekommenderas inte längre och kommer tas bort i framtiden",
"confirm": "Bekräfta {prompt}",
"colon": "{}: ",
"argument_required": "Parametern '{argument}' krävs",
"password": "Lösenord",
"warn_the_user_that_lock_is_acquired": "det andra kommandot har bara slutförts, nu startar du det här kommandot",
"warn_the_user_about_waiting_lock": "Ett annat YunoHost-kommando körs just nu, vi väntar på att det ska slutföras innan det här körs",
"command_unknown": "Kommando '{command:s}' okänd?",
"download_unknown_error": "Fel vid nedladdning av data från {url:s}: {error:s}",
"invalid_url": "Ogiltig url {url:s} (finns den här webbplatsen?)",
"error_changing_file_permissions": "Fel vid ändring av behörigheter för {path:s}: {error:s}",
"error_removing": "Fel vid borttagning av {path:s}: {error:s}",
"error_writing_file": "Fel vid skrivning av fil {file:s}: {error:s}",
"corrupted_toml": "Korrupt toml läst från {ressource:s} (anledning: {error:s})",
"corrupted_yaml": "Skadad yaml läst från {ressource:s} (anledning: {error:s})",
"corrupted_json": "Skadad json läst från {ressource:s} (anledning: {error:s})",
"unknown_error_reading_file": "Okänt fel vid försök att läsa filen {file:s} (anledning: {error:s})",
"unable_retrieve_session": "Det gick inte att hämta sessionen eftersom '{exception}'",
"download_unknown_error": "Fel vid nedladdning av data från {url}: {error}",
"invalid_url": "Ogiltig url {url} (finns den här webbplatsen?)",
"error_changing_file_permissions": "Fel vid ändring av behörigheter för {path}: {error}",
"error_removing": "Fel vid borttagning av {path}: {error}",
"error_writing_file": "Fel vid skrivning av fil {file}: {error}",
"corrupted_toml": "Korrupt toml läst från {ressource} (anledning: {error})",
"corrupted_yaml": "Skadad yaml läst från {ressource} (anledning: {error})",
"corrupted_json": "Skadad json läst från {ressource} (anledning: {error})",
"unknown_error_reading_file": "Okänt fel vid försök att läsa filen {file} (anledning: {error})",
"unable_authenticate": "Det går inte att verifiera",
"ldap_server_down": "Det går inte att nå LDAP-servern",
"invalid_usage": "Ogiltig användning, pass --help för att se hjälp",
"invalid_token": "Ogiltigt token - verifiera",
"instance_already_running": "Det finns redan en YunoHost-operation. Vänta tills den är klar innan du kör en annan.",
"authentication_required_long": "Autentisering krävs för att utföra denna åtgärd",
"authentication_required": "Autentisering krävs"
}
}

1
locales/te.json Normal file
View file

@ -0,0 +1 @@
{}

View file

@ -1,59 +1,47 @@
{
"argument_required": "{argument} argümanı gerekli",
"authentication_profile_required": "'{profile}' profili için yetkilendirme gerekli",
"authentication_required": "Yetklendirme gerekli",
"authentication_required_long": "Bu işlemi yapmak içi yetkilendirme gerekli",
"colon": "{}: ",
"confirm": "{prompt}'i doğrulayın",
"error": "Hata:",
"error_see_log": "Bir hata oluştu. Ayrıntılar için lütfen günlüklere bakın, bunlar /var/log/yunohost/ dizinindedir.",
"instance_already_running": "Halihazırda bir YunoHost operasyonu var. Lütfen başka bir tane çalıştırmadan önce bitmesini bekleyin.",
"invalid_argument": "Geçersiz argüman '{argument}': {error}",
"invalid_password": "Geçersiz parola",
"ldap_attribute_already_exists": "'{attribute}={value}' özelliği zaten mevcut",
"ldap_server_down": "LDAP sunucusuna erişilemiyor",
"logged_in": "Giriş yapıldı",
"logged_out": ıkış yapıldı",
"not_logged_in": "Giriş yapmadınız",
"operation_interrupted": "İşlem yarıda kesildi",
"password": "Parola",
"pattern_not_match": "İstenen biçimle uyuşmuyor",
"permission_denied": "Erişim reddedildi",
"root_required": "Bu işlemi yapmak için root olmalısınız",
"server_already_running": "Bu portta zaten çalışan bir sunucu var",
"success": "İşlem Başarılı!",
"unable_authenticate": "Yetkilendirme başarısız",
"unable_retrieve_session": "'{exception}' nedeniyle oturum alınamadı",
"values_mismatch": "Değerler uyuşmuyor",
"warning": "Uyarı:",
"websocket_request_expected": "WebSocket isteği gerekli",
"warn_the_user_that_lock_is_acquired": "diğer komut şimdi tamamlandı, şimdi bu komutu başlatıyor",
"warn_the_user_about_waiting_lock_again": "Hala bekliyor...",
"warn_the_user_that_lock_is_acquired": "Diğer komut şimdi tamamlandı, şimdi bu komutu başlatıyor",
"warn_the_user_about_waiting_lock_again": "Hala bekliyor",
"warn_the_user_about_waiting_lock": "Başka bir YunoHost komutu şu anda çalışıyor, bunu çalıştırmadan önce bitmesini bekliyoruz",
"command_unknown": "'{Command:s}' komutu bilinmiyor mu?",
"download_bad_status_code": "{url:s} döndürülen durum kodu {code:s}",
"download_unknown_error": "{url:s} adresinden veri indirilirken hata oluştu: {error:s}",
"download_timeout": "{url:s} yanıtlaması çok uzun sürdü, pes etti.",
"download_ssl_error": "{url:s} ağına bağlanırken SSL hatası",
"invalid_url": "Geçersiz url {url:s} (bu site var mı?)",
"error_changing_file_permissions": "{Path:s} için izinler değiştirilirken hata oluştu: {error:s}",
"error_removing": "{Path:s} kaldırılırken hata oluştu: {error:s}",
"error_writing_file": "{File:s} dosyası yazılırken hata oluştu: {error:s}",
"corrupted_toml": "{Ressource:s} kaynağından okunan bozuk toml (nedeni: {hata:s})",
"corrupted_yaml": "{Ressource:s} kaynağından bozuk yaml okunuyor (nedeni: {error:s})",
"corrupted_json": "{Ressource:s} adresinden okunan bozuk json (nedeni: {error:s})",
"unknown_error_reading_file": "{File:s} dosyasını okumaya çalışırken bilinmeyen hata (nedeni: {error:s})",
"cannot_write_file": "{File:s} dosyası yazılamadı (nedeni: {error:s})",
"cannot_open_file": "{File:s} dosyasıılamadı (nedeni: {error:s})",
"download_bad_status_code": "{url} döndürülen durum kodu {code}",
"download_unknown_error": "{url} adresinden veri indirilirken hata oluştu: {error}",
"download_timeout": "{url} yanıtlaması çok uzun sürdü, pes etti.",
"download_ssl_error": "{url} ağına bağlanırken SSL hatası",
"invalid_url": "{url} bağlanılamadı… URL çalışmıyor olabilir veya IPv4/IPv6 internete düzgün bir şekilde bağlı değilsiniz.",
"error_changing_file_permissions": "{path} için izinler değiştirilirken hata oluştu: {error}",
"error_removing": "{path} kaldırılırken hata oluştu: {error}",
"error_writing_file": "{file} dosyası yazılırken hata oluştu: {error}",
"corrupted_toml": "{ressource} kaynağından okunan bozuk TOML(nedeni: {error})",
"corrupted_yaml": "{ressource} kaynağından bozuk YAML okunuyor (neden: {error})",
"corrupted_json": "{ressource} adresinden okunan bozuk json (neden: {error})",
"unknown_error_reading_file": "{file} dosyasını okumaya çalışırken bilinmeyen hata (nedeni: {error})",
"cannot_write_file": "{file} dosyası yazılamadı (nedeni: {error})",
"cannot_open_file": "{file} dosyasıılamadı (nedeni: {error})",
"unknown_user": "Bilinmeyen '{user}' kullanıcı",
"unknown_group": "Bilinmeyen '{group}' grubu",
"invalid_usage": "Geçersiz kullanım, yardım görmek için --help iletin",
"invalid_token": "Geçersiz simge - lütfen kimlik doğrulaması yapın",
"info": "Bilgi:",
"folder_not_exist": "Klasör mevcut değil",
"folder_exists": "Klasör zaten var: '{path}'",
"file_not_exist": "Dosya mevcut değil: '{path}'",
"file_exists": "Dosya zaten var: '{path}'",
"deprecated_command_alias": "'{prog} {old}' kullanımdan kaldırıldı ve gelecekte kaldırılacak, bunun yerine '{prog} {new}' kullanın",
"deprecated_command": "'{prog} {command}' kullanımdan kaldırıldı ve gelecekte kaldırılacak"
}
"deprecated_command": "'{prog} {command}' kullanımdan kaldırıldı ve gelecekte kaldırılacak",
"edit_text_question": "{}. Bu metni düzenle ? [yN]: "
}

47
locales/uk.json Normal file
View file

@ -0,0 +1,47 @@
{
"password": "Пароль",
"logged_out": "Ви вийшли з системи",
"invalid_url": "Помилка з'єднання із {url}… можливо, служба не працює, або ви неправильно під'єднані до Інтернету в IPv4/IPv6.",
"warn_the_user_that_lock_is_acquired": "Інша команда щойно завершилася, тепер запускаємо цю команду",
"warn_the_user_about_waiting_lock_again": "Досі очікуємо…",
"warn_the_user_about_waiting_lock": "Зараз запускається ще одна команда YunoHost, ми чекаємо її завершення, перш ніж запустити цю",
"download_bad_status_code": "{url} повернув код стану {code}",
"download_unknown_error": "Помилка під час завантаження даних з {url}: {error}",
"download_timeout": "Перевищено час очікування відповіді від {url}.",
"download_ssl_error": "Помилка SSL під час з'єднання з {url}",
"error_changing_file_permissions": "Помилка під час зміни дозволів для {path}: {error}",
"error_removing": "Помилка під час видалення {path}: {error}",
"error_writing_file": "Помилка під час запису файлу {file}: {error}",
"corrupted_toml": "Пошкоджений TOML, зчитаний з {ressource} (причина: {error})",
"corrupted_yaml": "Пошкоджений YAML, зчитаний з {ressource} (причина: {error})",
"corrupted_json": "Пошкоджений JSON, зчитаний з {ressource} (причина: {error})",
"unknown_error_reading_file": "Невідома помилка під час спроби прочитати файл {file} (причина: {error})",
"cannot_write_file": "Не можу записати файл {file} (причина: {error})",
"cannot_open_file": "Не можу відкрити файл {file} (причина: {error})",
"websocket_request_expected": "Очікується запит WebSocket",
"warning": "Попередження:",
"values_mismatch": "Неприпустимі значення",
"unknown_user": "Невідомий користувач '{user}'",
"unknown_group": "Невідома група '{group}'",
"unable_authenticate": "Автентифікація неможлива",
"success": "Успішно!",
"server_already_running": "Сервер вже запущений на цьому порті",
"root_required": "Щоб виконати цю дію, ви повинні мати кореневі права (root)",
"pattern_not_match": "Не відповідає зразку",
"operation_interrupted": "Операцію перервано",
"not_logged_in": "Ви не увійшли в систему",
"logged_in": "Ви увійшли в систему",
"invalid_usage": "Неправильне використання, передайте --help для перегляду довідки",
"invalid_argument": "Неправильний аргумент '{argument}': {error}",
"instance_already_running": "Операція YunoHost вже запущена. Будь ласка, зачекайте, поки вона закінчиться, перш ніж запускати іншу.",
"info": "Відомості:",
"folder_exists": "Каталог вже існує: '{path}'",
"file_not_exist": "Файл не існує: '{path}'",
"error": "Помилка:",
"deprecated_command_alias": "'{prog} {old}' застаріла і буде видалена, замість неї використовуйте '{prog} {new}'",
"deprecated_command": "'{prog} {command}' застаріла і буде видалена",
"confirm": "Підтвердити {prompt}",
"authentication_required": "Потрібна автентифікація",
"argument_required": "Потрібен аргумент '{argument}'",
"edit_text_question": "{}. Редагувати цей текст? [yN]: "
}

View file

@ -0,0 +1,37 @@
VERSION="11.2.1"
RELEASE="stable"
REPO=$(basename $(git rev-parse --show-toplevel))
REPO_URL=$(git remote get-url origin)
ME=$(git config --get user.name)
EMAIL=$(git config --get user.email)
LAST_RELEASE=$(git tag --list 'debian/11.*' --sort="v:refname" | tail -n 1)
echo "$REPO ($VERSION) $RELEASE; urgency=low"
echo ""
git log $LAST_RELEASE.. -n 10000 --first-parent --pretty=tformat:' - %b%s (%h)' \
| sed -E "s&Merge .*#([0-9]+).*\$& \([#\1]\(http://github.com/YunoHost/$REPO/pull/\1\)\)&g" \
| sed -E "/Co-authored-by: .* <.*>/d" \
| grep -v "Translations update from Weblate" \
| tac
TRANSLATIONS=$(git log $LAST_RELEASE... -n 10000 --pretty=format:"%s" \
| grep "Translated using Weblate" \
| sed -E "s/Translated using Weblate \((.*)\)/\1/g" \
| sort | uniq | tr '\n' ', ' | sed -e 's/,$//g' -e 's/,/, /g')
[[ -z "$TRANSLATIONS" ]] || echo " - [i18n] Translations updated for $TRANSLATIONS"
echo ""
CONTRIBUTORS=$(git log -n10 --pretty=format:'%Cred%h%Creset %C(bold blue)(%an) %Creset%Cgreen(%cr)%Creset - %s %C(yellow)%d%Creset' --abbrev-commit $LAST_RELEASE... -n 10000 --pretty=format:"%an" \
| sort | uniq | grep -v "$ME" | grep -v 'yunohost-bot' | grep -vi 'weblate' \
| tr '\n' ', ' | sed -e 's/,$//g' -e 's/,/, /g')
[[ -z "$CONTRIBUTORS" ]] || echo " Thanks to all contributors <3 ! ($CONTRIBUTORS)"
echo ""
echo " -- $ME <$EMAIL> $(date -R)"
echo ""
# PR links can be converted to regular texts using : sed -E 's@\[(#[0-9]*)\]\([^ )]*\)@\1@g'
# Or readded with sed -E 's@#([0-9]*)@[YunoHost#\1](https://github.com/yunohost/yunohost/pull/\1)@g' | sed -E 's@\((\w+)\)@([YunoHost/\1](https://github.com/yunohost/yunohost/commit/\1))@g'

View file

@ -2,10 +2,8 @@
from moulinette.core import (
MoulinetteError,
MoulinetteSignals,
Moulinette18n,
)
from moulinette.globals import init_moulinette_env
__title__ = "moulinette"
__author__ = ["Yunohost Contributors"]
@ -26,52 +24,36 @@ __credits__ = """
You should have received a copy of the GNU Affero General Public License
along with this program; if not, see http://www.gnu.org/licenses
"""
__all__ = [
"init",
"api",
"cli",
"m18n",
"msignals",
"env",
"init_interface",
"MoulinetteError",
]
__all__ = ["init", "api", "cli", "m18n", "MoulinetteError", "Moulinette"]
msignals = MoulinetteSignals()
msettings = dict()
m18n = Moulinette18n()
# Package functions
class classproperty:
def __init__(self, f):
self.f = f
def __get__(self, obj, owner):
return self.f(owner)
def init(logging_config=None, **kwargs):
"""Package initialization
class Moulinette:
_interface = None
Initialize directories and global variables. It must be called
before any of package method is used - even the easy access
functions.
def prompt(*args, **kwargs):
return Moulinette.interface.prompt(*args, **kwargs)
Keyword arguments:
- logging_config -- A dict containing logging configuration to load
- **kwargs -- See core.Package
def display(*args, **kwargs):
return Moulinette.interface.display(*args, **kwargs)
At the end, the global variable 'pkg' will contain a Package
instance. See core.Package for available methods and variables.
"""
import sys
from moulinette.utils.log import configure_logging
configure_logging(logging_config)
# Add library directory to python path
sys.path.insert(0, init_moulinette_env()["LIB_DIR"])
@classproperty
def interface(cls):
return cls._interface
# Easy access to interfaces
def api(host="localhost", port=80, routes={}):
def api(host="localhost", port=80, routes={}, actionsmap=None, locales_dir=None):
"""Web server (API) interface
Run a HTTP server with the moulinette for an API usage.
@ -85,21 +67,28 @@ def api(host="localhost", port=80, routes={}):
"""
from moulinette.interfaces.api import Interface as Api
m18n.set_locales_dir(locales_dir)
try:
Api(routes=routes).run(host, port)
Api(
routes=routes,
actionsmap=actionsmap,
).run(host, port)
except MoulinetteError as e:
import logging
logging.getLogger(logging.main_logger).error(e.strerror)
logging.getLogger("moulinette").error(e.strerror)
return 1
except KeyboardInterrupt:
import logging
logging.getLogger(logging.main_logger).info(m18n.g("operation_interrupted"))
logging.getLogger("moulinette").info(m18n.g("operation_interrupted"))
return 0
def cli(args, top_parser, output_as=None, timeout=None):
def cli(
args, top_parser, output_as=None, timeout=None, actionsmap=None, locales_dir=None
):
"""Command line interface
Execute an action with the moulinette from the CLI and print its
@ -114,18 +103,18 @@ def cli(args, top_parser, output_as=None, timeout=None):
"""
from moulinette.interfaces.cli import Interface as Cli
m18n.set_locales_dir(locales_dir)
try:
load_only_category = args[0] if args and not args[0].startswith("-") else None
Cli(top_parser=top_parser, load_only_category=load_only_category).run(
args, output_as=output_as, timeout=timeout
)
Cli(
top_parser=top_parser,
load_only_category=load_only_category,
actionsmap=actionsmap,
).run(args, output_as=output_as, timeout=timeout)
except MoulinetteError as e:
import logging
logging.getLogger(logging.main_logger).error(e.strerror)
logging.getLogger("moulinette").error(e.strerror)
return 1
return 0
def env():
"""Initialise moulinette specific configuration."""
return init_moulinette_env()

View file

@ -3,19 +3,24 @@
import os
import re
import logging
import yaml
import glob
import cPickle as pickle
import pickle as pickle
from typing import List, Optional
from time import time
from collections import OrderedDict
from importlib import import_module
from functools import cache
from moulinette import m18n, msignals
from moulinette.cache import open_cachefile
from moulinette.globals import init_moulinette_env
from moulinette.core import MoulinetteError, MoulinetteLock
from moulinette.interfaces import BaseActionsMapParser, GLOBAL_SECTION, TO_RETURN_PROP
from moulinette import m18n, Moulinette
from moulinette.core import (
MoulinetteError,
MoulinetteLock,
MoulinetteValidationError,
)
from moulinette.interfaces import BaseActionsMapParser
from moulinette.utils.log import start_action_logging
from moulinette.utils.filesystem import read_yaml
logger = logging.getLogger("moulinette.actionsmap")
@ -25,8 +30,7 @@ logger = logging.getLogger("moulinette.actionsmap")
# Extra parameters definition
class _ExtraParameter(object):
class _ExtraParameter:
"""
Argument parser for an extra parameter.
@ -35,22 +39,14 @@ class _ExtraParameter(object):
"""
name: Optional[str] = None
"""A list of interface for which the parameter doesn't apply to"""
skipped_iface: List[str] = []
def __init__(self, iface):
# TODO: Add conn argument which contains authentification object
self.iface = iface
# Required variables
# Each extra parameters classes must overwrite these variables.
"""The extra parameter name"""
name = None
# Optional variables
# Each extra parameters classes can overwrite these variables.
"""A list of interface for which the parameter doesn't apply"""
skipped_iface = []
# Virtual methods
# Each extra parameters classes can implement these methods.
@ -90,9 +86,9 @@ class CommentParameter(_ExtraParameter):
skipped_iface = ["api"]
def __call__(self, message, arg_name, arg_value):
if arg_value:
if arg_value is None:
return
return msignals.display(m18n.n(message))
return Moulinette.display(m18n.n(message))
@classmethod
def validate(klass, value, arg_name):
@ -111,7 +107,6 @@ class CommentParameter(_ExtraParameter):
class AskParameter(_ExtraParameter):
"""
Ask for the argument value if possible and needed.
@ -129,7 +124,7 @@ class AskParameter(_ExtraParameter):
try:
# Ask for the argument value
return msignals.prompt(m18n.n(message))
return Moulinette.prompt(m18n.n(message))
except NotImplementedError:
return arg_value
@ -150,7 +145,6 @@ class AskParameter(_ExtraParameter):
class PasswordParameter(AskParameter):
"""
Ask for the password argument value if possible and needed.
@ -167,13 +161,12 @@ class PasswordParameter(AskParameter):
try:
# Ask for the password
return msignals.prompt(m18n.n(message), True, True)
return Moulinette.prompt(m18n.n(message), True, True)
except NotImplementedError:
return arg_value
class PatternParameter(_ExtraParameter):
"""
Check if the argument value match a pattern.
@ -189,8 +182,8 @@ class PatternParameter(_ExtraParameter):
# Use temporarly utf-8 encoded value
try:
v = unicode(arg_value, "utf-8")
except:
v = str(arg_value, "utf-8")
except Exception:
v = arg_value
if v and not re.match(pattern, v or "", re.UNICODE):
@ -206,7 +199,9 @@ class PatternParameter(_ExtraParameter):
if msg == message:
msg = m18n.g(message)
raise MoulinetteError("invalid_argument", argument=arg_name, error=msg)
raise MoulinetteValidationError(
"invalid_argument", argument=arg_name, error=msg
)
return arg_value
@staticmethod
@ -217,14 +212,13 @@ class PatternParameter(_ExtraParameter):
"expecting a list as extra parameter 'pattern' of " "argument '%s'",
arg_name,
)
value = [value, "pattern_not_match"]
value = [value, "pattern_not_match"] # i18n: pattern_not_match
elif not isinstance(value, list) or len(value) != 2:
raise TypeError("parameter value must be a list, got %r" % value)
return value
class RequiredParameter(_ExtraParameter):
"""
Check if a required argument is defined or not.
@ -237,7 +231,7 @@ class RequiredParameter(_ExtraParameter):
def __call__(self, required, arg_name, arg_value):
if required and (arg_value is None or arg_value == ""):
logger.warning("argument '%s' is required", arg_name)
raise MoulinetteError("argument_required", argument=arg_name)
raise MoulinetteValidationError("argument_required", argument=arg_name)
return arg_value
@staticmethod
@ -263,8 +257,7 @@ extraparameters_list = [
# Extra parameters argument Parser
class ExtraArgumentParser(object):
class ExtraArgumentParser:
"""
Argument validator and parser for the extra parameters.
@ -276,7 +269,7 @@ class ExtraArgumentParser(object):
def __init__(self, iface):
self.iface = iface
self.extra = OrderedDict()
self._extra_params = {GLOBAL_SECTION: {}}
self._extra_params = {"_global": {}}
# Append available extra parameters for the current interface
for klass in extraparameters_list:
@ -294,7 +287,7 @@ class ExtraArgumentParser(object):
"""
# Iterate over parameters to validate
for p, v in parameters.items():
for p in list(parameters):
klass = self.extra.get(p, None)
if not klass:
# Remove unknown parameters
@ -302,16 +295,14 @@ class ExtraArgumentParser(object):
else:
try:
# Validate parameter value
parameters[p] = klass.validate(v, arg_name)
parameters[p] = klass.validate(parameters[p], arg_name)
except Exception as e:
logger.error(
"unable to validate extra parameter '%s' "
"for argument '%s': %s",
p,
arg_name,
e,
error_message = (
"unable to validate extra parameter '%s' for argument '%s': %s"
% (p, arg_name, e)
)
raise MoulinetteError("error_see_log")
logger.error(error_message)
raise MoulinetteError(error_message, raw_msg=True)
return parameters
@ -320,7 +311,7 @@ class ExtraArgumentParser(object):
Add extra parameters to apply on an action argument
Keyword arguments:
- tid -- The tuple identifier of the action or GLOBAL_SECTION
- tid -- The tuple identifier of the action or _global
for global extra parameters
- arg_name -- The argument name
- parameters -- A dict of extra parameters with their values
@ -343,7 +334,7 @@ class ExtraArgumentParser(object):
- args -- A dict of argument name associated to their value
"""
extra_args = OrderedDict(self._extra_params.get(GLOBAL_SECTION, {}))
extra_args = OrderedDict(self._extra_params.get("_global", {}))
extra_args.update(self._extra_params.get(tid, {}))
# Iterate over action arguments with extra parameters
@ -377,19 +368,7 @@ class ExtraArgumentParser(object):
# Main class ----------------------------------------------------------
def ordered_yaml_load(stream):
class OrderedLoader(yaml.Loader):
pass
OrderedLoader.add_constructor(
yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
lambda loader, node: OrderedDict(loader.construct_pairs(node)),
)
return yaml.load(stream, OrderedLoader)
class ActionsMap(object):
class ActionsMap:
"""Validate and process actions defined into an actions map
The actions map defines the features - and their usage - of an
@ -397,9 +376,6 @@ class ActionsMap(object):
It is composed by categories which contain one or more action(s).
Moreover, the action can have specific argument(s).
This class allows to manipulate one or several actions maps
associated to a namespace.
Keyword arguments:
- top_parser -- A BaseActionsMapParser-derived instance to use for
parsing the actions map
@ -409,94 +385,103 @@ class ActionsMap(object):
purposes...
"""
def __init__(self, top_parser, load_only_category=None):
def __init__(self, actionsmap_yml, top_parser, load_only_category=None):
assert isinstance(top_parser, BaseActionsMapParser), (
"Invalid parser class '%s'" % top_parser.__class__.__name__
)
moulinette_env = init_moulinette_env()
DATA_DIR = moulinette_env["DATA_DIR"]
CACHE_DIR = moulinette_env["CACHE_DIR"]
actionsmaps = OrderedDict()
self.from_cache = False
# Iterate over actions map namespaces
for n in self.get_namespaces():
logger.debug("loading actions map namespace '%s'", n)
actionsmap_yml = "%s/actionsmap/%s.yml" % (DATA_DIR, n)
actionsmap_yml_stat = os.stat(actionsmap_yml)
actionsmap_pkl = "%s/actionsmap/%s-%d-%d.pkl" % (
CACHE_DIR,
n,
actionsmap_yml_stat.st_size,
actionsmap_yml_stat.st_mtime,
)
logger.debug("loading actions map")
if os.path.exists(actionsmap_pkl):
try:
# Attempt to load cache
with open(actionsmap_pkl) as f:
actionsmaps[n] = pickle.load(f)
actionsmap_yml_dir = os.path.dirname(actionsmap_yml)
actionsmap_yml_file = os.path.basename(actionsmap_yml)
actionsmap_yml_stat = os.stat(actionsmap_yml)
self.from_cache = True
# TODO: Switch to python3 and catch proper exception
except (IOError, EOFError):
actionsmaps[n] = self.generate_cache(n)
else: # cache file doesn't exists
actionsmaps[n] = self.generate_cache(n)
actionsmap_pkl = f"{actionsmap_yml_dir}/.{actionsmap_yml_file}.{actionsmap_yml_stat.st_size}-{actionsmap_yml_stat.st_mtime}.pkl"
# If load_only_category is set, and *if* the target category
# is in the actionsmap, we'll load only that one.
# If we filter it even if it doesn't exist, we'll end up with a
# weird help message when we do a typo in the category name..
if load_only_category and load_only_category in actionsmaps[n]:
actionsmaps[n] = {
k: v
for k, v in actionsmaps[n].items()
if k in [load_only_category, "_global"]
}
def generate_cache():
logger.debug("generating cache for actions map")
# Load translations
m18n.load_namespace(n)
# Read actions map from yaml file
actionsmap = read_yaml(actionsmap_yml)
if not actionsmap["_global"].get("cache", True):
return actionsmap
# Delete old cache files
for old_cache in glob.glob(
f"{actionsmap_yml_dir}/.{actionsmap_yml_file}.*.pkl"
):
os.remove(old_cache)
# at installation, cachedir might not exists
dir_ = os.path.dirname(actionsmap_pkl)
if not os.path.isdir(dir_):
os.makedirs(dir_)
# Cache actions map into pickle file
with open(actionsmap_pkl, "wb") as f:
pickle.dump(actionsmap, f)
return actionsmap
if os.path.exists(actionsmap_pkl):
try:
# Attempt to load cache
with open(actionsmap_pkl, "rb") as f:
actionsmap = pickle.load(f)
self.from_cache = True
# TODO: Switch to python3 and catch proper exception
except (IOError, EOFError):
actionsmap = generate_cache()
else: # cache file doesn't exists
actionsmap = generate_cache()
# If load_only_category is set, and *if* the target category
# is in the actionsmap, we'll load only that one.
# If we filter it even if it doesn't exist, we'll end up with a
# weird help message when we do a typo in the category name..
if load_only_category and load_only_category in actionsmap:
actionsmap = {
k: v
for k, v in actionsmap.items()
if k in [load_only_category, "_global"]
}
# Generate parsers
self.extraparser = ExtraArgumentParser(top_parser.interface)
self.parser = self._construct_parser(actionsmaps, top_parser)
self.parser = self._construct_parser(actionsmap, top_parser)
def get_authenticator_for_profile(self, auth_profile):
# Fetch the configuration for the authenticator module as defined in the actionmap
try:
auth_conf = self.parser.global_conf["authenticator"][auth_profile]
except KeyError:
raise ValueError("Unknown authenticator profile '%s'" % auth_profile)
@cache
def get_authenticator(self, auth_method):
if auth_method == "default":
auth_method = self.default_authentication
# Load and initialize the authenticator module
auth_module = f"{self.namespace}.authenticators.{auth_method}"
logger.debug(f"Loading auth module {auth_module}")
try:
mod = import_module("moulinette.authenticators.%s" % auth_conf["vendor"])
except ImportError:
logger.exception(
"unable to load authenticator vendor '%s'", auth_conf["vendor"]
mod = import_module(auth_module)
except ImportError as e:
import traceback
traceback.print_exc()
raise MoulinetteError(
f"unable to load authenticator {auth_module} : {e}", raw_msg=True
)
raise MoulinetteError("error_see_log")
else:
return mod.Authenticator(**auth_conf)
return mod.Authenticator()
def check_authentication_if_required(self, args, **kwargs):
def check_authentication_if_required(self, *args, **kwargs):
auth_method = self.parser.auth_method(*args, **kwargs)
auth_profile = self.parser.auth_required(args, **kwargs)
if not auth_profile:
if auth_method is None:
return
authenticator = self.get_authenticator_for_profile(auth_profile)
auth = msignals.authenticate(authenticator)
if not auth.is_authenticated:
raise MoulinetteError("authentication_required_long")
authenticator = self.get_authenticator(auth_method)
Moulinette.interface.authenticate(authenticator)
def process(self, args, timeout=None, **kwargs):
"""
@ -520,19 +505,17 @@ class ActionsMap(object):
tid = arguments.pop("_tid")
arguments = self.extraparser.parse_args(tid, arguments)
# Return immediately if a value is defined
if TO_RETURN_PROP in arguments:
return arguments.get(TO_RETURN_PROP)
want_to_take_lock = self.parser.want_to_take_lock(args, **kwargs)
# Retrieve action information
if len(tid) == 4:
namespace, category, subcategory, action = tid
func_name = "%s_%s_%s" % (
func_name = "{}_{}_{}".format(
category,
subcategory.replace("-", "_"),
action.replace("-", "_"),
)
full_action_name = "%s.%s.%s.%s" % (
full_action_name = "{}.{}.{}.{}".format(
namespace,
category,
subcategory,
@ -542,46 +525,50 @@ class ActionsMap(object):
assert len(tid) == 3
namespace, category, action = tid
subcategory = None
func_name = "%s_%s" % (category, action.replace("-", "_"))
full_action_name = "%s.%s.%s" % (namespace, category, action)
func_name = "{}_{}".format(category, action.replace("-", "_"))
full_action_name = "{}.{}.{}".format(namespace, category, action)
# Lock the moulinette for the namespace
with MoulinetteLock(namespace, timeout):
with MoulinetteLock(namespace, timeout, self.enable_lock and want_to_take_lock):
start = time()
try:
mod = __import__(
"%s.%s" % (namespace, category),
"{}.{}".format(namespace, category),
globals=globals(),
level=0,
fromlist=[func_name],
)
logger.debug(
"loading python module %s took %.3fs",
"%s.%s" % (namespace, category),
"{}.{}".format(namespace, category),
time() - start,
)
func = getattr(mod, func_name)
except (AttributeError, ImportError):
except (AttributeError, ImportError) as e:
import traceback
traceback.print_exc()
logger.exception("unable to load function %s.%s", namespace, func_name)
raise MoulinetteError("error_see_log")
error_message = "unable to load function {}.{} because: {}".format(
namespace,
func_name,
e,
)
logger.exception(error_message)
raise MoulinetteError(error_message, raw_msg=True)
else:
log_id = start_action_logging()
if logger.isEnabledFor(logging.DEBUG):
# Log arguments in debug mode only for safety reasons
logger.info(
logger.debug(
"processing action [%s]: %s with args=%s",
log_id,
full_action_name,
arguments,
)
else:
logger.info("processing action [%s]: %s", log_id, full_action_name)
logger.debug("processing action [%s]: %s", log_id, full_action_name)
# Load translation and process the action
m18n.load_namespace(namespace)
start = time()
try:
return func(**arguments)
@ -589,81 +576,14 @@ class ActionsMap(object):
stop = time()
logger.debug("action [%s] executed in %.3fs", log_id, stop - start)
@staticmethod
def get_namespaces():
"""
Retrieve available actions map namespaces
Returns:
A list of available namespaces
"""
namespaces = []
moulinette_env = init_moulinette_env()
DATA_DIR = moulinette_env["DATA_DIR"]
# This var is ['*'] by default but could be set for example to
# ['yunohost', 'yml_*']
NAMESPACE_PATTERNS = moulinette_env["NAMESPACES"]
# Look for all files that match the given patterns in the actionsmap dir
for namespace_pattern in NAMESPACE_PATTERNS:
namespaces.extend(
glob.glob("%s/actionsmap/%s.yml" % (DATA_DIR, namespace_pattern))
)
# Keep only the filenames with extension
namespaces = [os.path.basename(n)[:-4] for n in namespaces]
return namespaces
@classmethod
def generate_cache(klass, namespace):
"""
Generate cache for the actions map's file(s)
Keyword arguments:
- namespace -- The namespace to generate cache for
Returns:
The action map for the namespace
"""
moulinette_env = init_moulinette_env()
CACHE_DIR = moulinette_env["CACHE_DIR"]
DATA_DIR = moulinette_env["DATA_DIR"]
# Iterate over actions map namespaces
logger.debug("generating cache for actions map namespace '%s'", namespace)
# Read actions map from yaml file
am_file = "%s/actionsmap/%s.yml" % (DATA_DIR, namespace)
with open(am_file, "r") as f:
actionsmap = ordered_yaml_load(f)
# at installation, cachedir might not exists
for old_cache in glob.glob("%s/actionsmap/%s-*.pkl" % (CACHE_DIR, namespace)):
os.remove(old_cache)
# Cache actions map into pickle file
am_file_stat = os.stat(am_file)
pkl = "%s-%d-%d.pkl" % (namespace, am_file_stat.st_size, am_file_stat.st_mtime)
with open_cachefile(pkl, "w", subdir="actionsmap") as f:
pickle.dump(actionsmap, f)
return actionsmap
# Private methods
def _construct_parser(self, actionsmaps, top_parser):
def _construct_parser(self, actionsmap, top_parser):
"""
Construct the parser with the actions map
Keyword arguments:
- actionsmaps -- A dict of multi-level dictionnary of
categories/actions/arguments list for each namespaces
- actionsmap -- A dictionnary of categories/actions/arguments list
- top_parser -- A BaseActionsMapParser-derived instance to use for
parsing the actions map
@ -675,6 +595,8 @@ class ActionsMap(object):
logger.debug("building parser...")
start = time()
interface_type = top_parser.interface
# If loading from cache, extra were already checked when cache was
# loaded ? Not sure about this ... old code is a bit mysterious...
validate_extra = not self.from_cache
@ -684,45 +606,86 @@ class ActionsMap(object):
# * namespace define the top "name", for us it will always be
# "yunohost" and there well be only this one
# * actionsmap is the actual actionsmap that we care about
for namespace, actionsmap in actionsmaps.items():
# Retrieve global parameters
_global = actionsmap.pop("_global", {})
# Set the global configuration to use for the parser.
top_parser.set_global_conf(_global["configuration"])
# Retrieve global parameters
_global = actionsmap.pop("_global", {})
if top_parser.has_global_parser():
top_parser.add_global_arguments(_global["arguments"])
self.namespace = _global["namespace"]
self.enable_lock = _global.get("lock", True)
self.default_authentication = _global["authentication"][interface_type]
# category_name is stuff like "user", "domain", "hooks"...
# category_values is the values of this category (like actions)
for category_name, category_values in actionsmap.items():
# category_name is stuff like "user", "domain", "hooks"...
# category_values is the values of this category (like actions)
for category_name, category_values in actionsmap.items():
actions = category_values.pop("actions", {})
subcategories = category_values.pop("subcategories", {})
if "actions" in category_values:
actions = category_values.pop("actions")
else:
actions = {}
# Get category parser
category_parser = top_parser.add_category_parser(
category_name, **category_values
)
if "subcategories" in category_values:
subcategories = category_values.pop("subcategories")
else:
subcategories = {}
# action_name is like "list" of "domain list"
# action_options are the values
for action_name, action_options in actions.items():
arguments = action_options.pop("arguments", {})
authentication = action_options.pop("authentication", {})
tid = (self.namespace, category_name, action_name)
# Get category parser
category_parser = top_parser.add_category_parser(
category_name, **category_values
# Get action parser
action_parser = category_parser.add_action_parser(
action_name, tid, **action_options
)
# action_name is like "list" of "domain list"
if action_parser is None: # No parser for the action
continue
# Store action identifier and add arguments
action_parser.set_defaults(_tid=tid)
action_parser.add_arguments(
arguments,
extraparser=self.extraparser,
format_arg_names=top_parser.format_arg_names,
validate_extra=validate_extra,
)
action_parser.authentication = self.default_authentication
if interface_type in authentication:
action_parser.authentication = authentication[interface_type]
# Disable the locking mechanism for all actions that are 'GET' actions on the api
routes = action_options.get("api")
routes = [routes] if isinstance(routes, str) else routes
if routes and all(route.startswith("GET ") for route in routes):
action_parser.want_to_take_lock = False
else:
action_parser.want_to_take_lock = True
# subcategory_name is like "cert" in "domain cert status"
# subcategory_values is the values of this subcategory (like actions)
for subcategory_name, subcategory_values in subcategories.items():
actions = subcategory_values.pop("actions")
# Get subcategory parser
subcategory_parser = category_parser.add_subcategory_parser(
subcategory_name, **subcategory_values
)
# action_name is like "status" of "domain cert status"
# action_options are the values
for action_name, action_options in actions.items():
arguments = action_options.pop("arguments", {})
tid = (namespace, category_name, action_name)
authentication = action_options.pop("authentication", {})
tid = (self.namespace, category_name, subcategory_name, action_name)
# Get action parser
action_parser = category_parser.add_action_parser(
action_name, tid, **action_options
)
try:
# Get action parser
action_parser = subcategory_parser.add_action_parser(
action_name, tid, **action_options
)
except AttributeError:
# No parser for the action
continue
if action_parser is None: # No parser for the action
continue
@ -736,48 +699,17 @@ class ActionsMap(object):
validate_extra=validate_extra,
)
if "configuration" in action_options:
category_parser.set_conf(tid, action_options["configuration"])
action_parser.authentication = self.default_authentication
if interface_type in authentication:
action_parser.authentication = authentication[interface_type]
# subcategory_name is like "cert" in "domain cert status"
# subcategory_values is the values of this subcategory (like actions)
for subcategory_name, subcategory_values in subcategories.items():
actions = subcategory_values.pop("actions")
# Get subcategory parser
subcategory_parser = category_parser.add_subcategory_parser(
subcategory_name, **subcategory_values
)
# action_name is like "status" of "domain cert status"
# action_options are the values
for action_name, action_options in actions.items():
arguments = action_options.pop("arguments", {})
tid = (namespace, category_name, subcategory_name, action_name)
try:
# Get action parser
action_parser = subcategory_parser.add_action_parser(
action_name, tid, **action_options
)
except AttributeError:
# No parser for the action
continue
# Store action identifier and add arguments
action_parser.set_defaults(_tid=tid)
action_parser.add_arguments(
arguments,
extraparser=self.extraparser,
format_arg_names=top_parser.format_arg_names,
validate_extra=validate_extra,
)
if "configuration" in action_options:
category_parser.set_conf(
tid, action_options["configuration"]
)
# Disable the locking mechanism for all actions that are 'GET' actions on the api
routes = action_options.get("api")
routes = [routes] if isinstance(routes, str) else routes
if routes and all(route.startswith("GET ") for route in routes):
action_parser.want_to_take_lock = False
else:
action_parser.want_to_take_lock = True
logger.debug("building parser took %.3fs", time() - start)
return top_parser

View file

@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
import logging
from moulinette.core import MoulinetteError, MoulinetteAuthenticationError
logger = logging.getLogger("moulinette.authenticator")
# Base Class -----------------------------------------------------------
class BaseAuthenticator:
"""Authenticator base representation
Each authenticators must implement an Authenticator class derived
from this class which must overrides virtual properties and methods.
It is used to authenticate and manage session. It implements base
methods to authenticate with credentials or a session token.
Authenticators configurations are identified by a profile name which
must be given on instantiation - with the corresponding vendor
configuration of the authenticator.
"""
# Virtual methods
# Each authenticator classes must implement these methods.
def authenticate_credentials(self, credentials):
try:
# Attempt to authenticate
auth_info = self._authenticate_credentials(credentials) or {}
except MoulinetteError:
raise
except Exception as e:
logger.exception(f"authentication {self.name} failed because '{e}'")
raise MoulinetteAuthenticationError("unable_authenticate")
return auth_info

View file

@ -1,226 +0,0 @@
# -*- coding: utf-8 -*-
import os
import logging
import hashlib
import hmac
from moulinette.cache import open_cachefile, get_cachedir, cachefile_exists
from moulinette.core import MoulinetteError
logger = logging.getLogger("moulinette.authenticator")
# Base Class -----------------------------------------------------------
class BaseAuthenticator(object):
"""Authenticator base representation
Each authenticators must implement an Authenticator class derived
from this class which must overrides virtual properties and methods.
It is used to authenticate and manage session. It implements base
methods to authenticate with a password or a session token.
Authenticators configurations are identified by a profile name which
must be given on instantiation - with the corresponding vendor
configuration of the authenticator.
Keyword arguments:
- name -- The authenticator profile name
"""
def __init__(self, name, vendor, parameters, extra):
self._name = name
self.vendor = vendor
self.is_authenticated = False
self.extra = extra
@property
def name(self):
"""Return the name of the authenticator instance"""
return self._name
# Virtual properties
# Each authenticator classes must implement these properties.
"""The vendor name of the authenticator"""
vendor = None
# Virtual methods
# Each authenticator classes must implement these methods.
def authenticate(self, password=None):
"""Attempt to authenticate
Attempt to authenticate with given password. It should raise an
AuthenticationError exception if authentication fails.
Keyword arguments:
- password -- A clear text password
"""
raise NotImplementedError(
"derived class '%s' must override this method" % self.__class__.__name__
)
# Authentication methods
def __call__(self, password=None, token=None):
"""Attempt to authenticate
Attempt to authenticate either with password or with session
token if 'password' is None. If the authentication succeed, the
instance is returned and the session is registered for the token
if 'token' and 'password' are given.
The token is composed by the session identifier and a session
hash (the "true token") - to use for encryption - as a 2-tuple.
Keyword arguments:
- password -- A clear text password
- token -- The session token in the form of (id, hash)
Returns:
The authenticated instance
"""
if self.is_authenticated:
return self
#
# Authenticate using the password
#
if password:
try:
# Attempt to authenticate
self.authenticate(password)
except MoulinetteError:
raise
except Exception as e:
logger.exception(
"authentication (name: '%s', vendor: '%s') fails because '%s'",
self.name,
self.vendor,
e,
)
raise MoulinetteError("unable_authenticate")
self.is_authenticated = True
# Store session for later using the provided (new) token if any
if token:
try:
s_id, s_token = token
self._store_session(s_id, s_token)
except Exception as e:
import traceback
traceback.print_exc()
logger.exception("unable to store session because %s", e)
else:
logger.debug("session has been stored")
#
# Authenticate using the token provided
#
elif token:
try:
s_id, s_token = token
# Attempt to authenticate
self._authenticate_session(s_id, s_token)
except MoulinetteError as e:
raise
except Exception as e:
logger.exception(
"authentication (name: '%s', vendor: '%s') fails because '%s'",
self.name,
self.vendor,
e,
)
raise MoulinetteError("unable_authenticate")
else:
self.is_authenticated = True
#
# No credentials given, can't authenticate
#
else:
raise MoulinetteError("unable_authenticate")
return self
# Private methods
def _open_sessionfile(self, session_id, mode="r"):
"""Open a session file for this instance in given mode"""
return open_cachefile(
"%s.asc" % session_id, mode, subdir="session/%s" % self.name
)
def _session_exists(self, session_id):
"""Check a session exists"""
return cachefile_exists("%s.asc" % session_id, subdir="session/%s" % self.name)
def _store_session(self, session_id, session_token):
"""Store a session to be able to use it later to reauthenticate"""
# We store a hash of the session_id and the session_token (the token is assumed to be secret)
to_hash = "{id}:{token}".format(id=session_id, token=session_token)
hash_ = hashlib.sha256(to_hash).hexdigest()
with self._open_sessionfile(session_id, "w") as f:
f.write(hash_)
def _authenticate_session(self, session_id, session_token):
"""Checks session and token against the stored session token"""
if not self._session_exists(session_id):
raise MoulinetteError("session_expired")
try:
# FIXME : shouldn't we also add a check that this session file
# is not too old ? e.g. not older than 24 hours ? idk...
with self._open_sessionfile(session_id, "r") as f:
stored_hash = f.read()
except IOError as e:
logger.debug("unable to retrieve session", exc_info=1)
raise MoulinetteError("unable_retrieve_session", exception=e)
else:
#
# session_id (or just id) : This is unique id for the current session from the user. Not too important
# if this info gets stolen somehow. It is stored in the client's side (browser) using regular cookies.
#
# session_token (or just token) : This is a secret info, like some sort of ephemeral password,
# used to authenticate the session without the user having to retype the password all the time...
# - It is generated on our side during the initial auth of the user (which happens with the actual admin password)
# - It is stored on the client's side (browser) using (signed) cookies.
# - We also store it on our side in the form of a hash of {id}:{token} (c.f. _store_session).
# We could simply store the raw token, but hashing it is an additonal low-cost security layer
# in case this info gets exposed for some reason (e.g. bad file perms for reasons...)
#
# When the user comes back, we fetch the session_id and session_token from its cookies. Then we
# re-hash the {id}:{token} and compare it to the previously stored hash for this session_id ...
# It it matches, then the user is authenticated. Otherwise, the token is invalid.
#
to_hash = "{id}:{token}".format(id=session_id, token=session_token)
hash_ = hashlib.sha256(to_hash).hexdigest()
if not hmac.compare_digest(hash_, stored_hash):
raise MoulinetteError("invalid_token")
else:
return
def _clean_session(self, session_id):
"""Clean a session cache
Remove cache for the session 'session_id' and for this authenticator profile
Keyword arguments:
- session_id -- The session id to clean
"""
sessiondir = get_cachedir("session")
try:
os.remove(os.path.join(sessiondir, self.name, "%s.asc" % session_id))
except OSError:
pass

View file

@ -1,29 +0,0 @@
# -*- coding: utf-8 -*-
import logging
from moulinette.core import MoulinetteError
from moulinette.authenticators import BaseAuthenticator
logger = logging.getLogger("moulinette.authenticator.dummy")
# Dummy authenticator implementation
class Authenticator(BaseAuthenticator):
"""Dummy authenticator used for tests
"""
vendor = "dummy"
def __init__(self, name, vendor, parameters, extra):
logger.debug("initialize authenticator dummy")
super(Authenticator, self).__init__(name, vendor, parameters, extra)
def authenticate(self, password=None):
if not password == self.name:
raise MoulinetteError("invalid_password")
return self

View file

@ -1,285 +0,0 @@
# -*- coding: utf-8 -*-
# TODO: Use Python3 to remove this fix!
from __future__ import absolute_import
import os
import logging
import ldap
import ldap.sasl
import time
import ldap.modlist as modlist
from moulinette import m18n
from moulinette.core import MoulinetteError, MoulinetteLdapIsDownError
from moulinette.authenticators import BaseAuthenticator
logger = logging.getLogger("moulinette.authenticator.ldap")
# LDAP Class Implementation --------------------------------------------
class Authenticator(BaseAuthenticator):
"""LDAP Authenticator
Initialize a LDAP connexion for the given arguments. It attempts to
authenticate a user if 'user_rdn' is given - by associating user_rdn
and base_dn - and provides extra methods to manage opened connexion.
Keyword arguments:
- uri -- The LDAP server URI
- base_dn -- The base dn
- user_rdn -- The user rdn to authenticate
"""
def __init__(self, name, vendor, parameters, extra):
self.uri = parameters["uri"]
self.basedn = parameters["base_dn"]
self.userdn = parameters["user_rdn"]
self.extra = extra
self.sasldn = "cn=external,cn=auth"
self.adminuser = "admin"
self.admindn = "cn=%s,dc=yunohost,dc=org" % self.adminuser
logger.debug(
"initialize authenticator '%s' with: uri='%s', "
"base_dn='%s', user_rdn='%s'",
name,
self._get_uri(),
self.basedn,
self.userdn,
)
super(Authenticator, self).__init__(name, vendor, parameters, extra)
if self.userdn and self.sasldn in self.userdn:
self.authenticate(None)
else:
self.con = None
def __del__(self):
"""Disconnect and free ressources"""
if self.con:
self.con.unbind_s()
# Implement virtual properties
vendor = "ldap"
# Implement virtual methods
def authenticate(self, password=None):
def _reconnect():
con = ldap.ldapobject.ReconnectLDAPObject(
self._get_uri(), retry_max=10, retry_delay=0.5
)
if self.userdn:
if self.sasldn in self.userdn:
con.sasl_non_interactive_bind_s("EXTERNAL")
else:
con.simple_bind_s(self.userdn, password)
else:
con.simple_bind_s()
return con
try:
con = _reconnect()
except ldap.INVALID_CREDENTIALS:
raise MoulinetteError("invalid_password")
except ldap.SERVER_DOWN:
# ldap is down, attempt to restart it before really failing
logger.warning(m18n.g("ldap_server_is_down_restart_it"))
os.system("systemctl restart slapd")
time.sleep(10) # waits 10 secondes so we are sure that slapd has restarted
try:
con = _reconnect()
except ldap.SERVER_DOWN:
raise MoulinetteLdapIsDownError("ldap_server_down")
# Check that we are indeed logged in with the right identity
try:
# whoami_s return dn:..., then delete these 3 characters
who = con.whoami_s()[3:]
except Exception as e:
logger.warning("Error during ldap authentication process: %s", e)
raise
else:
# FIXME: During SASL bind whoami from the test server return the admindn while userdn is returned normally :
if not (who == self.admindn or who == self.userdn):
raise MoulinetteError("Not logged in with the expected userdn ?!")
else:
self.con = con
# Additional LDAP methods
# TODO: Review these methods
def search(self, base=None, filter="(objectClass=*)", attrs=["dn"]):
"""Search in LDAP base
Perform an LDAP search operation with given arguments and return
results as a list.
Keyword arguments:
- base -- The dn to search into
- filter -- A string representation of the filter to apply
- attrs -- A list of attributes to fetch
Returns:
A list of all results
"""
if not base:
base = self.basedn
try:
result = self.con.search_s(base, ldap.SCOPE_SUBTREE, filter, attrs)
except Exception as e:
raise MoulinetteError(
"error during LDAP search operation with: base='%s', "
"filter='%s', attrs=%s and exception %s" % (base, filter, attrs, e),
raw_msg=True,
)
result_list = []
if not attrs or "dn" not in attrs:
result_list = [entry for dn, entry in result]
else:
for dn, entry in result:
entry["dn"] = [dn]
result_list.append(entry)
return result_list
def add(self, rdn, attr_dict):
"""
Add LDAP entry
Keyword arguments:
rdn -- DN without domain
attr_dict -- Dictionnary of attributes/values to add
Returns:
Boolean | MoulinetteError
"""
dn = rdn + "," + self.basedn
ldif = modlist.addModlist(attr_dict)
try:
self.con.add_s(dn, ldif)
except Exception as e:
raise MoulinetteError(
"error during LDAP add operation with: rdn='%s', "
"attr_dict=%s and exception %s" % (rdn, attr_dict, e),
raw_msg=True,
)
else:
return True
def remove(self, rdn):
"""
Remove LDAP entry
Keyword arguments:
rdn -- DN without domain
Returns:
Boolean | MoulinetteError
"""
dn = rdn + "," + self.basedn
try:
self.con.delete_s(dn)
except Exception as e:
raise MoulinetteError(
"error during LDAP delete operation with: rdn='%s' and exception %s"
% (rdn, e),
raw_msg=True,
)
else:
return True
def update(self, rdn, attr_dict, new_rdn=False):
"""
Modify LDAP entry
Keyword arguments:
rdn -- DN without domain
attr_dict -- Dictionnary of attributes/values to add
new_rdn -- New RDN for modification
Returns:
Boolean | MoulinetteError
"""
dn = rdn + "," + self.basedn
actual_entry = self.search(base=dn, attrs=None)
ldif = modlist.modifyModlist(actual_entry[0], attr_dict, ignore_oldexistent=1)
if ldif == []:
logger.warning("Nothing to update in LDAP")
return True
try:
if new_rdn:
self.con.rename_s(dn, new_rdn)
new_base = dn.split(",", 1)[1]
dn = new_rdn + "," + new_base
self.con.modify_ext_s(dn, ldif)
except Exception as e:
raise MoulinetteError(
"error during LDAP update operation with: rdn='%s', "
"attr_dict=%s, new_rdn=%s and exception: %s"
% (rdn, attr_dict, new_rdn, e),
raw_msg=True,
)
else:
return True
def validate_uniqueness(self, value_dict):
"""
Check uniqueness of values
Keyword arguments:
value_dict -- Dictionnary of attributes/values to check
Returns:
Boolean | MoulinetteError
"""
attr_found = self.get_conflict(value_dict)
if attr_found:
logger.info(
"attribute '%s' with value '%s' is not unique",
attr_found[0],
attr_found[1],
)
raise MoulinetteError(
"ldap_attribute_already_exists",
attribute=attr_found[0],
value=attr_found[1],
)
return True
def get_conflict(self, value_dict, base_dn=None):
"""
Check uniqueness of values
Keyword arguments:
value_dict -- Dictionnary of attributes/values to check
Returns:
None | tuple with Fist conflict attribute name and value
"""
for attr, value in value_dict.items():
if not self.search(base=base_dn, filter=attr + "=" + value):
continue
else:
return (attr, value)
return None
def _get_uri(self):
return self.uri

View file

@ -1,51 +0,0 @@
# -*- coding: utf-8 -*-
import os
from moulinette.globals import init_moulinette_env
def get_cachedir(subdir="", make_dir=True):
"""Get the path to a cache directory
Return the path to the cache directory from an optional
subdirectory and create it if needed.
Keyword arguments:
- subdir -- A cache subdirectory
- make_dir -- False to not make directory if it not exists
"""
CACHE_DIR = init_moulinette_env()["CACHE_DIR"]
path = os.path.join(CACHE_DIR, subdir)
if make_dir and not os.path.isdir(path):
os.makedirs(path)
return path
def open_cachefile(filename, mode="r", subdir=""):
"""Open a cache file and return a stream
Attempt to open in 'mode' the cache file 'filename' from the
default cache directory and in the subdirectory 'subdir' if
given. Directories are created if needed and a stream is
returned if the file can be written.
Keyword arguments:
- filename -- The cache filename
- mode -- The mode in which the file is opened
- **kwargs -- Optional arguments for get_cachedir
"""
cache_dir = get_cachedir(subdir, make_dir=True if mode[0] == "w" else False)
file_path = os.path.join(cache_dir, filename)
return open(file_path, mode)
def cachefile_exists(filename, subdir=""):
cache_dir = get_cachedir(subdir, make_dir=False)
file_path = os.path.join(cache_dir, filename)
return os.path.exists(file_path)

View file

@ -6,8 +6,6 @@ import json
import logging
import moulinette
from moulinette.globals import init_moulinette_env
logger = logging.getLogger("moulinette.core")
@ -19,8 +17,7 @@ def during_unittests_run():
# Internationalization -------------------------------------------------
class Translator(object):
class Translator:
"""Internationalization class
Provide an internationalization mechanism based on JSON files to
@ -40,7 +37,7 @@ class Translator(object):
# Attempt to load default translations
if not self._load_translations(default_locale):
logger.error(
"unable to load locale '%s' from '%s'", default_locale, locale_dir
f"unable to load locale '{default_locale}' from '{locale_dir}'. Does the file '{locale_dir}/{default_locale}.json' exists?",
)
self.default_locale = default_locale
@ -83,6 +80,9 @@ class Translator(object):
self.locale = locale
return True
def key_exists(self, key):
return key in self._translations[self.default_locale]
def translate(self, key, *args, **kwargs):
"""Retrieve proper translation for a key
@ -96,22 +96,16 @@ class Translator(object):
failed_to_format = False
if key in self._translations.get(self.locale, {}):
try:
return (
self._translations[self.locale][key]
.encode("utf-8")
.format(*args, **kwargs)
)
except KeyError as e:
unformatted_string = self._translations[self.locale][key].encode(
"utf-8"
)
return self._translations[self.locale][key].format(*args, **kwargs)
except Exception as e:
unformatted_string = self._translations[self.locale][key]
error_message = (
"Failed to format translated string '%s': '%s' with arguments '%s' and '%s, raising error: %s(%s) (don't panic this is just a warning)"
% (key, unformatted_string, args, kwargs, e.__class__.__name__, e)
)
if not during_unittests_run():
logger.exception(error_message)
logger.warning(error_message)
else:
raise Exception(error_message)
@ -121,28 +115,22 @@ class Translator(object):
self.default_locale != self.locale
and key in self._translations.get(self.default_locale, {})
):
logger.info("untranslated key '%s' for locale '%s'", key, self.locale)
try:
return (
self._translations[self.default_locale][key]
.encode("utf-8")
.format(*args, **kwargs)
return self._translations[self.default_locale][key].format(
*args, **kwargs
)
except KeyError as e:
unformatted_string = self._translations[self.default_locale][
key
].encode("utf-8")
except Exception as e:
unformatted_string = self._translations[self.default_locale][key]
error_message = (
"Failed to format translatable string '%s': '%s' with arguments '%s' and '%s', raising error: %s(%s) (don't panic this is just a warning)"
% (key, unformatted_string, args, kwargs, e.__class__.__name__, e)
)
if not during_unittests_run():
logger.exception(error_message)
logger.warning(error_message)
else:
raise Exception(error_message)
return self._translations[self.default_locale][key].encode("utf-8")
return self._translations[self.default_locale][key]
error_message = (
"unable to retrieve string to translate with key '%s' for default locale 'locales/%s.json' file (don't panic this is just a warning)"
@ -150,7 +138,7 @@ class Translator(object):
)
if not during_unittests_run():
logger.exception(error_message)
logger.warning(error_message)
else:
raise Exception(error_message)
@ -174,8 +162,8 @@ class Translator(object):
return True
try:
with open("%s/%s.json" % (self.locale_dir, locale), "r") as f:
j = json.load(f, "utf-8")
with open(f"{self.locale_dir}/{locale}.json", "r", encoding="utf-8") as f:
j = json.load(f)
except IOError:
return False
else:
@ -183,8 +171,7 @@ class Translator(object):
return True
class Moulinette18n(object):
class Moulinette18n:
"""Internationalization service for the moulinette
Manage internationalization and access to the proper keys translation
@ -200,47 +187,24 @@ class Moulinette18n(object):
self.default_locale = default_locale
self.locale = default_locale
moulinette_env = init_moulinette_env()
self.locales_dir = moulinette_env["LOCALES_DIR"]
# Init global translator
self._global = Translator(self.locales_dir, default_locale)
global_locale_dir = "/usr/share/moulinette/locales"
if during_unittests_run():
global_locale_dir = os.path.dirname(__file__) + "/../locales"
# Define namespace related variables
self._namespaces = {}
self._current_namespace = None
self._global = Translator(global_locale_dir, default_locale)
def load_namespace(self, namespace):
"""Load the namespace to use
Load and set translations of a given namespace. Those translations
are accessible with Moulinette18n.n().
Keyword arguments:
- namespace -- The namespace to load
"""
if namespace not in self._namespaces:
# Create new Translator object
lib_dir = init_moulinette_env()["LIB_DIR"]
translator = Translator(
"%s/%s/locales" % (lib_dir, namespace), self.default_locale
)
translator.set_locale(self.locale)
self._namespaces[namespace] = translator
# Set current namespace
self._current_namespace = namespace
def set_locales_dir(self, locales_dir):
self.translator = Translator(locales_dir, self.default_locale)
def set_locale(self, locale):
"""Set the locale to use"""
self.locale = locale
self._global.set_locale(locale)
for n in self._namespaces.values():
n.set_locale(locale)
self.translator.set_locale(locale)
def g(self, key, *args, **kwargs):
def g(self, key: str, *args, **kwargs) -> str:
"""Retrieve proper translation for a moulinette key
Attempt to retrieve value for a key from moulinette translations
@ -252,7 +216,7 @@ class Moulinette18n(object):
"""
return self._global.translate(key, *args, **kwargs)
def n(self, key, *args, **kwargs):
def n(self, key: str, *args, **kwargs) -> str:
"""Retrieve proper translation for a moulinette key
Attempt to retrieve value for a key from current loaded namespace
@ -263,120 +227,23 @@ class Moulinette18n(object):
- key -- The key to translate
"""
return self._namespaces[self._current_namespace].translate(key, *args, **kwargs)
return self.translator.translate(key, *args, **kwargs)
class MoulinetteSignals(object):
"""Signals connector for the moulinette
Allow to easily connect signals from the moulinette to handlers. A
signal is emitted by calling the relevant method which call the
handler.
For the moment, a return value can be requested by a signal to its
connected handler - make them not real-signals.
Keyword arguments:
- kwargs -- A dict of {signal: handler} to connect
"""
def __init__(self, **kwargs):
# Initialize handlers
for s in self.signals:
self.clear_handler(s)
# Iterate over signals to connect
for s, h in kwargs.items():
self.set_handler(s, h)
def set_handler(self, signal, handler):
"""Set the handler for a signal"""
if signal not in self.signals:
logger.error("unknown signal '%s'", signal)
return
setattr(self, "_%s" % signal, handler)
def clear_handler(self, signal):
"""Clear the handler of a signal"""
if signal not in self.signals:
logger.error("unknown signal '%s'", signal)
return
setattr(self, "_%s" % signal, self._notimplemented)
# Signals definitions
"""The list of available signals"""
signals = {"authenticate", "prompt", "display"}
def authenticate(self, authenticator):
"""Process the authentication
Attempt to authenticate to the given authenticator and return
it.
It is called when authentication is needed (e.g. to process an
action).
def key_exists(self, key: str) -> bool:
"""Check if a key exists in the translation files
Keyword arguments:
- authenticator -- The authenticator object to use
Returns:
The authenticator object
- key -- The key to translate
"""
if authenticator.is_authenticated:
return authenticator
return self._authenticate(authenticator)
def prompt(self, message, is_password=False, confirm=False, color="blue"):
"""Prompt for a value
Prompt the interface for a parameter value which is a password
if 'is_password' and must be confirmed if 'confirm'.
Is is called when a parameter value is needed and when the
current interface should allow user interaction (e.g. to parse
extra parameter 'ask' in the cli).
Keyword arguments:
- message -- The message to display
- is_password -- True if the parameter is a password
- confirm -- True if the value must be confirmed
- color -- Color to use for the prompt ...
Returns:
The collected value
"""
return self._prompt(message, is_password, confirm, color=color)
def display(self, message, style="info"):
"""Display a message
Display a message with a given style to the user.
It is called when a message should be printed to the user if the
current interface allows user interaction (e.g. print a success
message to the user).
Keyword arguments:
- message -- The message to display
- style -- The type of the message. Possible values are:
info, success, warning
"""
try:
self._display(message, style)
except NotImplementedError:
pass
@staticmethod
def _notimplemented(*args, **kwargs):
raise NotImplementedError("this signal is not handled")
return self.translator.key_exists(key)
# Moulinette core classes ----------------------------------------------
class MoulinetteError(Exception):
http_code = 500
"""Moulinette base exception"""
@ -388,13 +255,19 @@ class MoulinetteError(Exception):
super(MoulinetteError, self).__init__(msg)
self.strerror = msg
class MoulinetteLdapIsDownError(MoulinetteError):
"""Used when ldap is down"""
def content(self) -> str:
return self.strerror
class MoulinetteLock(object):
class MoulinetteValidationError(MoulinetteError):
http_code = 400
class MoulinetteAuthenticationError(MoulinetteError):
http_code = 401
class MoulinetteLock:
"""Locker for a moulinette instance
It provides a lock mechanism for a given moulinette instance. It can
@ -411,10 +284,11 @@ class MoulinetteLock(object):
base_lockfile = "/var/run/moulinette_%s.lock"
def __init__(self, namespace, timeout=None, interval=0.5):
def __init__(self, namespace, timeout=None, enable_lock=True, interval=0.5):
self.namespace = namespace
self.timeout = timeout
self.interval = interval
self.enable_lock = enable_lock
self._lockfile = self.base_lockfile % namespace
self._stale_checked = False
@ -440,7 +314,6 @@ class MoulinetteLock(object):
logger.debug("acquiring lock...")
while True:
lock_pids = self._lock_PIDs()
if self._is_son_of(lock_pids):
@ -508,7 +381,6 @@ class MoulinetteLock(object):
raise MoulinetteError("root_required")
def _lock_PIDs(self):
if not os.path.isfile(self._lockfile):
return []
@ -541,7 +413,7 @@ class MoulinetteLock(object):
return False
def __enter__(self):
if not self._locked:
if self.enable_lock and not self._locked:
self.acquire()
return self

View file

@ -1,17 +0,0 @@
"""Moulinette global configuration core."""
from os import environ
def init_moulinette_env():
return {
"DATA_DIR": environ.get("MOULINETTE_DATA_DIR", "/usr/share/moulinette"),
"LIB_DIR": environ.get("MOULINETTE_LIB_DIR", "/usr/lib/moulinette"),
"LOCALES_DIR": environ.get(
"MOULINETTE_LOCALES_DIR", "/usr/share/moulinette/locale"
),
"CACHE_DIR": environ.get("MOULINETTE_CACHE_DIR", "/var/cache/moulinette"),
"NAMESPACES": environ.get(
"MOULINETTE_NAMESPACES", "*"
).split(), # By default we'll load every namespace we find
}

View file

@ -4,23 +4,20 @@ import re
import logging
import argparse
import copy
from collections import deque, OrderedDict
import datetime
from collections import OrderedDict
from json.encoder import JSONEncoder
from typing import Optional
from moulinette import msettings, m18n
from moulinette.core import MoulinetteError
from moulinette import m18n
logger = logging.getLogger("moulinette.interface")
GLOBAL_SECTION = "_global"
TO_RETURN_PROP = "_to_return"
CALLBACKS_PROP = "_callbacks"
# Base Class -----------------------------------------------------------
class BaseActionsMapParser(object):
class BaseActionsMapParser:
"""Actions map's base Parser
Each interfaces must implement an ActionsMapParser class derived
@ -35,21 +32,14 @@ class BaseActionsMapParser(object):
"""
def __init__(self, parent=None, **kwargs):
if parent:
self._o = parent
else:
if not parent:
logger.debug("initializing base actions map parser for %s", self.interface)
msettings["interface"] = self.interface
self._o = self
self._global_conf = {}
self._conf = {}
# Virtual properties
# Each parser classes must implement these properties.
"""The name of the interface for which it is the parser"""
interface = None
interface: Optional[str] = None
# Virtual methods
# Each parser classes must implement these methods.
@ -121,7 +111,7 @@ class BaseActionsMapParser(object):
"derived class '%s' must override this method" % self.__class__.__name__
)
def auth_required(self, args, **kwargs):
def auth_method(self, *args, **kwargs):
"""Check if authentication is required to run the requested action
Keyword arguments:
@ -152,241 +142,11 @@ class BaseActionsMapParser(object):
"derived class '%s' must override this method" % self.__class__.__name__
)
# Arguments helpers
@staticmethod
def prepare_action_namespace(tid, namespace=None):
"""Prepare the namespace for a given action"""
# Validate tid and namespace
if not isinstance(tid, tuple) and (
namespace is None or not hasattr(namespace, TO_RETURN_PROP)
):
raise MoulinetteError("invalid_usage")
elif not tid:
tid = GLOBAL_SECTION
# Prepare namespace
if namespace is None:
namespace = argparse.Namespace()
namespace._tid = tid
return namespace
# Configuration access
@property
def global_conf(self):
"""Return the global configuration of the parser"""
return self._o._global_conf
def set_global_conf(self, configuration):
"""Set global configuration
Set the global configuration to use for the parser.
Keyword arguments:
- configuration -- The global configuration
"""
self._o._global_conf.update(self._validate_conf(configuration, True))
def get_conf(self, action, name):
"""Get the value of an action configuration
Return the formated value of configuration 'name' for the action
identified by 'action'. If the configuration for the action is
not set, the default one is returned.
Keyword arguments:
- action -- An action identifier
- name -- The configuration name
"""
try:
return self._o._conf[action][name]
except KeyError:
return self.global_conf[name]
def set_conf(self, action, configuration):
"""Set configuration for an action
Set the configuration to use for a given action identified by
'action' which is specific to the parser.
Keyword arguments:
- action -- The action identifier
- configuration -- The configuration for the action
"""
self._o._conf[action] = self._validate_conf(configuration)
def _validate_conf(self, configuration, is_global=False):
"""Validate configuration for the parser
Return the validated configuration for the interface's actions
map parser.
Keyword arguments:
- configuration -- The configuration to pre-format
"""
# TODO: Create a class with a validator method for each configuration
conf = {}
# -- 'authenficate'
try:
ifaces = configuration["authenticate"]
except KeyError:
pass
else:
if ifaces == "all":
conf["authenticate"] = ifaces
elif ifaces is False:
conf["authenticate"] = False
elif isinstance(ifaces, list):
if "all" in ifaces:
conf["authenticate"] = "all"
else:
# Store only if authentication is needed
conf["authenticate"] = True if self.interface in ifaces else False
else:
logger.error(
"expecting 'all', 'False' or a list for "
"configuration 'authenticate', got %r",
ifaces,
)
raise MoulinetteError("error_see_log")
# -- 'authenticator'
auth = configuration.get("authenticator", "default")
if not is_global and isinstance(auth, str):
# Store needed authenticator profile
if auth not in self.global_conf["authenticator"]:
logger.error(
"requesting profile '%s' which is undefined in "
"global configuration of 'authenticator'",
auth,
)
raise MoulinetteError("error_see_log")
else:
conf["authenticator"] = auth
elif is_global and isinstance(auth, dict):
if len(auth) == 0:
logger.warning(
"no profile defined in global configuration " "for 'authenticator'"
)
else:
auths = {}
for auth_name, auth_conf in auth.items():
auths[auth_name] = {
"name": auth_name,
"vendor": auth_conf.get("vendor"),
"parameters": auth_conf.get("parameters", {}),
"extra": {"help": auth_conf.get("help", None)},
}
conf["authenticator"] = auths
else:
logger.error(
"expecting a dict of profile(s) or a profile name "
"for configuration 'authenticator', got %r",
auth,
)
raise MoulinetteError("error_see_log")
return conf
class BaseInterface(object):
"""Moulinette's base Interface
Each interfaces must implement an Interface class derived from this
class which must overrides virtual properties and methods.
It is used to provide a user interface for an actions map.
Keyword arguments:
- actionsmap -- The ActionsMap instance to connect to
"""
# TODO: Add common interface methods and try to standardize default ones
def __init__(self, actionsmap):
raise NotImplementedError(
"derived class '%s' must override this method" % self.__class__.__name__
)
# Argument parser ------------------------------------------------------
class _CallbackAction(argparse.Action):
def __init__(
self,
option_strings,
dest,
nargs=0,
callback={},
default=argparse.SUPPRESS,
help=None,
):
if not callback or "method" not in callback:
raise ValueError("callback must be provided with at least " "a method key")
super(_CallbackAction, self).__init__(
option_strings=option_strings,
dest=dest,
nargs=nargs,
default=default,
help=help,
)
self.callback_method = callback.get("method")
self.callback_kwargs = callback.get("kwargs", {})
self.callback_return = callback.get("return", False)
@property
def callback(self):
if not hasattr(self, "_callback"):
self._retrieve_callback()
return self._callback
def _retrieve_callback(self):
# Attempt to retrieve callback method
mod_name, func_name = (self.callback_method).rsplit(".", 1)
try:
mod = __import__(mod_name, globals=globals(), level=0, fromlist=[func_name])
func = getattr(mod, func_name)
except (AttributeError, ImportError):
import traceback
traceback.print_exc()
raise ValueError("unable to import method {0}".format(self.callback_method))
self._callback = func
def __call__(self, parser, namespace, values, option_string=None):
parser.enqueue_callback(namespace, self, values)
if self.callback_return:
setattr(namespace, TO_RETURN_PROP, {})
def execute(self, namespace, values):
try:
# Execute callback and get returned value
value = self.callback(namespace, values, **self.callback_kwargs)
except:
logger.exception(
"cannot get value from callback method "
"'{0}'".format(self.callback_method)
)
raise MoulinetteError("error_see_log")
else:
if value:
if self.callback_return:
setattr(namespace, TO_RETURN_PROP, value)
else:
setattr(namespace, self.dest, value)
class _ExtendedSubParsersAction(argparse._SubParsersAction):
"""Subparsers with extended properties for argparse
It provides the following additional properties at initialization,
@ -408,11 +168,14 @@ class _ExtendedSubParsersAction(argparse._SubParsersAction):
self._deprecated_command_map = {}
def add_parser(self, name, type_=None, **kwargs):
hide_in_help = kwargs.pop("hide_in_help", False)
deprecated = kwargs.pop("deprecated", False)
deprecated_alias = kwargs.pop("deprecated_alias", [])
if deprecated:
self._deprecated_command_map[name] = None
if deprecated or hide_in_help:
if "help" in kwargs:
del kwargs["help"]
@ -464,35 +227,8 @@ class ExtendedArgumentParser(argparse.ArgumentParser):
)
# Register additional actions
self.register("action", "callback", _CallbackAction)
self.register("action", "parsers", _ExtendedSubParsersAction)
def enqueue_callback(self, namespace, callback, values):
queue = self._get_callbacks_queue(namespace)
queue.append((callback, values))
def dequeue_callbacks(self, namespace):
queue = self._get_callbacks_queue(namespace, False)
for _i in xrange(len(queue)):
c, v = queue.popleft()
# FIXME: break dequeue if callback returns
c.execute(namespace, v)
try:
delattr(namespace, CALLBACKS_PROP)
except:
pass
def _get_callbacks_queue(self, namespace, create=True):
try:
queue = getattr(namespace, CALLBACKS_PROP)
except AttributeError:
if create:
queue = deque()
setattr(namespace, CALLBACKS_PROP, queue)
else:
queue = list()
return queue
def add_arguments(
self, arguments, extraparser, format_arg_names=None, validate_extra=True
):
@ -545,11 +281,9 @@ class ExtendedArgumentParser(argparse.ArgumentParser):
# positionals, optionals and user-defined groups
for action_group in self._action_groups:
# Dirty hack to separate 'subcommands'
# into 'actions' and 'subcategories'
if action_group.title == "subcommands":
# Make a copy of the "action group actions"...
choice_actions = action_group._group_actions[0]._choices_actions
actions_subparser = copy.copy(action_group._group_actions[0])
@ -582,12 +316,12 @@ class ExtendedArgumentParser(argparse.ArgumentParser):
]
# Display each section (actions and subcategories)
if actions_choices != []:
if actions_choices:
formatter.start_section("actions")
formatter.add_arguments([actions_subparser])
formatter.end_section()
if subcategories_choices != []:
if subcategories_choices:
formatter.start_section("subcategories")
formatter.add_arguments([subcategories_subparser])
formatter.end_section()
@ -649,7 +383,6 @@ class PositionalsFirstHelpFormatter(argparse.HelpFormatter):
# wrap the usage parts if it's too long
text_width = self._width - self._current_indent
if len(prefix) + len(usage) > text_width:
# break usage into wrappable parts
part_regexp = r"\(.*?\)+|\[.*?\]+|\S+"
opt_usage = format(optionals, groups)
@ -709,4 +442,39 @@ class PositionalsFirstHelpFormatter(argparse.HelpFormatter):
usage = "\n".join(lines)
# prefix with 'usage:'
return "%s%s\n\n" % (prefix, usage)
return "{}{}\n\n".format(prefix, usage)
class JSONExtendedEncoder(JSONEncoder):
"""Extended JSON encoder
Extend default JSON encoder to recognize more types and classes. It will
never raise an exception if the object can't be encoded and return its repr
instead.
The following objects and types are supported:
- set: converted into list
"""
def default(self, o):
import pytz # Lazy loading, this takes like 3+ sec on a RPi2 ?!
"""Return a serializable object"""
# Convert compatible containers into list
if isinstance(o, set) or (hasattr(o, "__iter__") and hasattr(o, "next")):
return list(o)
# Display the date in its iso format ISO-8601 Internet Profile (RFC 3339)
if isinstance(o, datetime.date):
if o.tzinfo is None:
o = o.replace(tzinfo=pytz.utc)
return o.isoformat()
# Return the repr for object that json can't encode
logger.warning(
"cannot properly encode in JSON the object %s, " "returned repr is: %r",
type(o),
o,
)
return repr(o)

View file

@ -4,35 +4,40 @@ import re
import errno
import logging
import argparse
from json import dumps as json_encode
from tempfile import mkdtemp
from shutil import rmtree
from gevent import sleep
from gevent.queue import Queue
from geventwebsocket import WebSocketError
from bottle import request, response, Bottle, HTTPResponse
from bottle import request, response, Bottle, HTTPResponse, FileUpload
from bottle import abort
from moulinette import msignals, m18n, env
from moulinette import m18n, Moulinette
from moulinette.actionsmap import ActionsMap
from moulinette.core import MoulinetteError
from moulinette.core import (
MoulinetteError,
MoulinetteValidationError,
MoulinetteAuthenticationError,
)
from moulinette.interfaces import (
BaseActionsMapParser,
BaseInterface,
ExtendedArgumentParser,
JSONExtendedEncoder,
)
from moulinette.utils import log
from moulinette.utils.serialize import JSONExtendedEncoder
from moulinette.utils.text import random_ascii
logger = log.getLogger("moulinette.interface.api")
# API helpers ----------------------------------------------------------
# We define a global variable to manage in a dirty way the upload...
UPLOAD_DIR = None
CSRF_TYPES = set(
["text/plain", "application/x-www-form-urlencoded", "multipart/form-data"]
)
CSRF_TYPES = {"text/plain", "application/x-www-form-urlencoded", "multipart/form-data"}
def is_csrf():
@ -61,14 +66,12 @@ def filter_csrf(callback):
class LogQueues(dict):
"""Map of session id to queue."""
"""Map of session ids to queue."""
pass
class APIQueueHandler(logging.Handler):
"""
A handler class which store logging records into a queue, to be used
and retrieved from the API.
@ -77,11 +80,21 @@ class APIQueueHandler(logging.Handler):
def __init__(self):
logging.Handler.__init__(self)
self.queues = LogQueues()
# actionsmap is actually set during the interface's init ...
self.actionsmap = None
def emit(self, record):
sid = request.get_cookie("session.id")
# Prevent triggering this function while moulinette
# is being initialized with --debug
if not self.actionsmap or len(request.cookies) == 0:
return
profile = request.params.get("profile", self.actionsmap.default_authentication)
authenticator = self.actionsmap.get_authenticator(profile)
s_id = authenticator.get_session_cookie(raise_if_no_session_exists=False)["id"]
try:
queue = self.queues[sid]
queue = self.queues[s_id]
except KeyError:
# Session is not initialized, abandon.
return
@ -93,8 +106,7 @@ class APIQueueHandler(logging.Handler):
sleep(0)
class _HTTPArgumentParser(object):
class _HTTPArgumentParser:
"""Argument parser for HTTP requests
Object for parsing HTTP requests into Python objects. It is based
@ -111,6 +123,7 @@ class _HTTPArgumentParser(object):
self._positional = [] # list(arg_name)
self._optional = {} # dict({arg_name: option_strings})
self._upload_dir = None
def set_defaults(self, **kwargs):
return self._parser.set_defaults(**kwargs)
@ -145,9 +158,9 @@ class _HTTPArgumentParser(object):
# Append newly created action
if len(action.option_strings) == 0:
self._positional.append(action.dest)
self._positional.append(action)
else:
self._optional[action.dest] = action.option_strings
self._optional[action.dest] = action
return action
@ -155,11 +168,26 @@ class _HTTPArgumentParser(object):
arg_strings = []
# Append an argument to the current one
def append(arg_strings, value, option_string=None):
if isinstance(value, bool):
def append(arg_strings, value, action):
option_string = None
if len(action.option_strings) > 0:
option_string = action.option_strings[0]
if isinstance(value, bool) or isinstance(action.const, bool):
# Append the option string only
if option_string is not None and value != 0:
arg_strings.append(option_string)
elif isinstance(value, FileUpload) and (
isinstance(action.type, argparse.FileType) or action.type == open
):
# Upload the file in a temp directory
global UPLOAD_DIR
if UPLOAD_DIR is None:
UPLOAD_DIR = mkdtemp(prefix="moulinette_upload_")
value.save(UPLOAD_DIR)
if option_string is not None:
arg_strings.append(option_string)
arg_strings.append(UPLOAD_DIR + "/" + value.filename)
elif isinstance(value, str):
if option_string is not None:
arg_strings.append(option_string)
@ -192,27 +220,22 @@ class _HTTPArgumentParser(object):
return arg_strings
# Iterate over positional arguments
for dest in self._positional:
if dest in args:
arg_strings = append(arg_strings, args[dest])
for action in self._positional:
if action.dest in args:
arg_strings = append(arg_strings, args[action.dest], action)
# Iterate over optional arguments
for dest, opt in self._optional.items():
for dest, action in self._optional.items():
if dest in args:
arg_strings = append(arg_strings, args[dest], opt[0])
arg_strings = append(arg_strings, args[dest], action)
return self._parser.parse_args(arg_strings, namespace)
def dequeue_callbacks(self, *args, **kwargs):
return self._parser.dequeue_callbacks(*args, **kwargs)
def _error(self, message):
# TODO: Raise a proper exception
raise MoulinetteError(message)
raise MoulinetteValidationError(message, raw_msg=True)
class _ActionsMapPlugin(object):
class _ActionsMapPlugin:
"""Actions map Bottle Plugin
Process relevant action for the request using the actions map and
@ -227,14 +250,8 @@ class _ActionsMapPlugin(object):
api = 2
def __init__(self, actionsmap, log_queues={}):
# Connect signals to handlers
msignals.set_handler("authenticate", self._do_authenticate)
msignals.set_handler("display", self._do_display)
self.actionsmap = actionsmap
self.log_queues = log_queues
# TODO: Save and load secrets?
self.secrets = {}
def setup(self, app):
"""Setup plugin on the application
@ -245,28 +262,6 @@ class _ActionsMapPlugin(object):
- app -- The application instance
"""
# Login wrapper
def _login(callback):
def wrapper():
kwargs = {}
try:
kwargs["password"] = request.POST["password"]
except KeyError:
raise HTTPBadRequestResponse("Missing password parameter")
kwargs["profile"] = request.POST.get("profile", "default")
return callback(**kwargs)
return wrapper
# Logout wrapper
def _logout(callback):
def wrapper():
kwargs = {}
kwargs["profile"] = request.POST.get("profile", "default")
return callback(**kwargs)
return wrapper
# Append authentication routes
app.route(
@ -275,7 +270,6 @@ class _ActionsMapPlugin(object):
method="POST",
callback=self.login,
skip=["actionsmap"],
apply=_login,
)
app.route(
"/logout",
@ -283,16 +277,18 @@ class _ActionsMapPlugin(object):
method="GET",
callback=self.logout,
skip=["actionsmap"],
apply=_logout,
)
# Append messages route
app.route(
"/messages", name="messages", callback=self.messages, skip=["actionsmap"],
"/messages",
name="messages",
callback=self.messages,
skip=["actionsmap"],
)
# Append routes from the actions map
for (m, p) in self.actionsmap.parser.routes:
for m, p in self.actionsmap.parser.routes:
app.route(p, method=m, callback=self.process)
def apply(self, callback, context):
@ -317,8 +313,12 @@ class _ActionsMapPlugin(object):
# Format boolean params
for a in args:
params[a] = True
# Append other request params
for k, v in request.params.dict.items():
req_params = list(request.params.dict.items())
# TODO test special chars in filename
req_params += list(request.files.dict.items())
for k, v in req_params:
v = _format(v)
if k not in params.keys():
params[k] = v
@ -341,101 +341,68 @@ class _ActionsMapPlugin(object):
# Routes callbacks
def login(self, password, profile):
"""Log in to an authenticator profile
def login(self):
"""Log in to an authenticator
Attempt to authenticate to a given authenticator profile and
Attempt to authenticate to the default authenticator and
register it with the current session - a new one will be created
if needed.
Keyword arguments:
- password -- A clear text password
- profile -- The authenticator profile name to log in
"""
# Retrieve session values
try:
s_id = request.get_cookie("session.id") or random_ascii()
except:
# Super rare case where there are super weird cookie / cache issue
# Previous line throws a CookieError that creates a 500 error ...
# So let's catch it and just use a fresh ID then...
s_id = random_ascii()
if "credentials" not in request.params:
raise HTTPResponse("Missing credentials parameter", 400)
credentials = request.params["credentials"]
profile = request.params.get("profile", self.actionsmap.default_authentication)
authenticator = self.actionsmap.get_authenticator(profile)
try:
s_secret = self.secrets[s_id]
except KeyError:
s_tokens = {}
else:
try:
s_tokens = request.get_cookie("session.tokens", secret=s_secret) or {}
except:
# Same as for session.id a few lines before
s_tokens = {}
s_new_token = random_ascii()
try:
# Attempt to authenticate
authenticator = self.actionsmap.get_authenticator_for_profile(profile)
authenticator(password, token=(s_id, s_new_token))
auth_infos = authenticator.authenticate_credentials(credentials)
except MoulinetteError as e:
if len(s_tokens) > 0:
try:
self.logout(profile)
except:
pass
raise HTTPUnauthorizedResponse(e.strerror)
try:
self.logout()
except Exception:
pass
raise HTTPResponse(e.strerror, 401)
else:
# Update dicts with new values
s_tokens[profile] = s_new_token
self.secrets[s_id] = s_secret = random_ascii()
response.set_cookie("session.id", s_id, secure=True)
response.set_cookie(
"session.tokens", s_tokens, secure=True, secret=s_secret
)
authenticator.set_session_cookie(auth_infos)
return m18n.g("logged_in")
def logout(self, profile):
"""Log out from an authenticator profile
Attempt to unregister a given profile - or all by default - from
the current session.
Keyword arguments:
- profile -- The authenticator profile name to log out
"""
s_id = request.get_cookie("session.id")
# We check that there's a (signed) session.hash available
# for additional security ?
# (An attacker could not craft such signed hashed ? (FIXME : need to make sure of this))
# This is called before each time a route is going to be processed
def authenticate(self, authenticator):
try:
s_secret = self.secrets[s_id]
except KeyError:
s_secret = {}
if profile not in request.get_cookie(
"session.tokens", secret=s_secret, default={}
):
raise HTTPUnauthorizedResponse(m18n.g("not_logged_in"))
session_infos = authenticator.get_session_cookie()
except Exception:
msg = m18n.g("authentication_required")
raise HTTPResponse(msg, 401)
return session_infos
def logout(self):
profile = request.params.get("profile", self.actionsmap.default_authentication)
authenticator = self.actionsmap.get_authenticator(profile)
try:
authenticator.get_session_cookie()
except Exception:
raise HTTPResponse(m18n.g("not_logged_in"), 401)
else:
del self.secrets[s_id]
authenticator = self.actionsmap.get_authenticator_for_profile(profile)
authenticator._clean_session(s_id)
# TODO: Clean the session for profile only
# Delete cookie and clean the session
response.set_cookie("session.tokens", "", max_age=-1)
return m18n.g("logged_out")
authenticator.delete_session_cookie()
return m18n.g("logged_out")
def messages(self):
"""Listen to the messages WebSocket stream
Retrieve the WebSocket stream and send to it each messages displayed by
the core.MoulinetteSignals.display signal. They are JSON encoded as a
dict { style: message }.
the display method. They are JSON encoded as a dict { style: message }.
"""
s_id = request.get_cookie("session.id")
profile = request.params.get("profile", self.actionsmap.default_authentication)
authenticator = self.actionsmap.get_authenticator(profile)
s_id = authenticator.get_session_cookie()["id"]
try:
queue = self.log_queues[s_id]
except KeyError:
@ -445,7 +412,7 @@ class _ActionsMapPlugin(object):
wsock = request.environ.get("wsgi.websocket")
if not wsock:
raise HTTPErrorResponse(m18n.g("websocket_request_expected"))
raise HTTPResponse(m18n.g("websocket_request_expected"), 500)
while True:
item = queue.get()
@ -478,10 +445,11 @@ class _ActionsMapPlugin(object):
- arguments -- A dict of arguments for the route
"""
try:
ret = self.actionsmap.process(arguments, timeout=30, route=_route)
except MoulinetteError as e:
raise HTTPBadRequestResponse(e.strerror)
raise moulinette_error_to_http_response(e)
except Exception as e:
if isinstance(e, HTTPResponse):
raise e
@ -489,45 +457,37 @@ class _ActionsMapPlugin(object):
tb = traceback.format_exc()
logs = {"route": _route, "arguments": arguments, "traceback": tb}
return HTTPErrorResponse(json_encode(logs))
return HTTPResponse(json_encode(logs), 500)
else:
return format_for_response(ret)
finally:
# Clean upload directory
# FIXME do that in a better way
global UPLOAD_DIR
if UPLOAD_DIR is not None:
rmtree(UPLOAD_DIR, True)
UPLOAD_DIR = None
# Close opened WebSocket by putting StopIteration in the queue
profile = request.params.get(
"profile", self.actionsmap.default_authentication
)
authenticator = self.actionsmap.get_authenticator(profile)
try:
queue = self.log_queues[request.get_cookie("session.id")]
s_id = authenticator.get_session_cookie()["id"]
queue = self.log_queues[s_id]
except MoulinetteAuthenticationError:
pass
except KeyError:
pass
else:
queue.put(StopIteration)
# Signals handlers
def display(self, message, style="info"):
profile = request.params.get("profile", self.actionsmap.default_authentication)
authenticator = self.actionsmap.get_authenticator(profile)
s_id = authenticator.get_session_cookie(raise_if_no_session_exists=False)["id"]
def _do_authenticate(self, authenticator):
"""Process the authentication
Handle the core.MoulinetteSignals.authenticate signal.
"""
s_id = request.get_cookie("session.id")
try:
s_secret = self.secrets[s_id]
s_token = request.get_cookie("session.tokens", secret=s_secret, default={})[
authenticator.name
]
except KeyError:
msg = m18n.g("authentication_required")
raise HTTPUnauthorizedResponse(msg)
else:
return authenticator(token=(s_id, s_token))
def _do_display(self, message, style):
"""Display a message
Handle the core.MoulinetteSignals.display signal.
"""
s_id = request.get_cookie("session.id")
try:
queue = self.log_queues[s_id]
except KeyError:
@ -540,28 +500,23 @@ class _ActionsMapPlugin(object):
# populate the new message in the queue
sleep(0)
def prompt(self, *args, **kwargs):
raise NotImplementedError("Prompt is not implemented for this interface")
# HTTP Responses -------------------------------------------------------
class HTTPOKResponse(HTTPResponse):
def __init__(self, output=""):
super(HTTPOKResponse, self).__init__(output, 200)
class HTTPBadRequestResponse(HTTPResponse):
def __init__(self, output=""):
super(HTTPBadRequestResponse, self).__init__(output, 400)
class HTTPUnauthorizedResponse(HTTPResponse):
def __init__(self, output=""):
super(HTTPUnauthorizedResponse, self).__init__(output, 401)
class HTTPErrorResponse(HTTPResponse):
def __init__(self, output=""):
super(HTTPErrorResponse, self).__init__(output, 500)
def moulinette_error_to_http_response(error):
content = error.content()
if isinstance(content, dict):
return HTTPResponse(
json_encode(content),
error.http_code,
headers={"Content-type": "application/json"},
)
else:
return HTTPResponse(content, error.http_code)
def format_for_response(content):
@ -589,7 +544,6 @@ def format_for_response(content):
class ActionsMapParser(BaseActionsMapParser):
"""Actions map's Parser for the API
Provide actions map parsing methods for a CLI usage. The parser for
@ -668,46 +622,45 @@ class ActionsMapParser(BaseActionsMapParser):
# Return the created parser
return parser
def auth_required(self, args, **kwargs):
def auth_method(self, _, route):
try:
# Retrieve the tid for the route
tid, _ = self._parsers[kwargs.get("route")]
except KeyError:
logger.error("no argument parser found for route '%s'", kwargs.get("route"))
raise MoulinetteError("error_see_log")
_, parser = self._parsers[route]
except KeyError as e:
error_message = "no argument parser found for route '{}': {}".format(
route, e
)
logger.error(error_message)
raise MoulinetteValidationError(error_message, raw_msg=True)
if self.get_conf(tid, "authenticate"):
authenticator = self.get_conf(tid, "authenticator")
return parser.authentication
# If several authenticator, use the default one
if isinstance(authenticator, dict):
if "default" in authenticator:
authenticator = "default"
else:
# TODO which one should we use?
pass
return authenticator
else:
return False
def want_to_take_lock(self, _, route):
_, parser = self._parsers[route]
def parse_args(self, args, route, **kwargs):
return getattr(parser, "want_to_take_lock", True)
def parse_args(self, args, **kwargs):
"""Parse arguments
Keyword arguments:
- route -- The action route as a 2-tuple (method, path)
"""
route = kwargs["route"]
try:
# Retrieve the parser for the route
_, parser = self._parsers[route]
except KeyError:
logger.error("no argument parser found for route '%s'", route)
raise MoulinetteError("error_see_log")
except KeyError as e:
error_message = "no argument parser found for route '{}': {}".format(
route, e
)
logger.error(error_message)
raise MoulinetteValidationError(error_message, raw_msg=True)
ret = argparse.Namespace()
# TODO: Catch errors?
ret = parser.parse_args(args, ret)
parser.dequeue_callbacks(ret)
return ret
# Private methods
@ -733,8 +686,7 @@ class ActionsMapParser(BaseActionsMapParser):
return key
class Interface(BaseInterface):
class Interface:
"""Application Programming Interface for the moulinette
Initialize a HTTP server which serves the API connected to a given
@ -748,15 +700,16 @@ class Interface(BaseInterface):
"""
def __init__(self, routes={}, log_queues=None):
type = "api"
actionsmap = ActionsMap(ActionsMapParser())
def __init__(self, routes={}, actionsmap=None):
actionsmap = ActionsMap(actionsmap, ActionsMapParser())
# Attempt to retrieve log queues from an APIQueueHandler
if log_queues is None:
handler = log.getHandlersByClass(APIQueueHandler, limit=1)
if handler:
log_queues = handler.queues
handler = log.getHandlersByClass(APIQueueHandler, limit=1)
if handler:
log_queues = handler.queues
handler.actionsmap = actionsmap
# TODO: Return OK to 'OPTIONS' xhr requests (l173)
app = Bottle(autojson=True)
@ -785,11 +738,12 @@ class Interface(BaseInterface):
app.install(filter_csrf)
app.install(apiheader)
app.install(api18n)
app.install(_ActionsMapPlugin(actionsmap, log_queues))
actionsmapplugin = _ActionsMapPlugin(actionsmap, log_queues)
app.install(actionsmapplugin)
# Append default routes
# app.route(['/api', '/api/<category:re:[a-z]+>'], method='GET',
# callback=self.doc, skip=['actionsmap'])
self.authenticate = actionsmapplugin.authenticate
self.display = actionsmapplugin.display
self.prompt = actionsmapplugin.prompt
# Append additional routes
# TODO: Add optional authentication to those routes?
@ -798,6 +752,8 @@ class Interface(BaseInterface):
self._app = app
Moulinette._interface = self
def run(self, host="localhost", port=80):
"""Run the moulinette
@ -809,8 +765,11 @@ class Interface(BaseInterface):
- port -- Server port to bind to
"""
logger.debug(
"starting the server instance in %s:%d", host, port,
"starting the server instance in %s:%d",
host,
port,
)
try:
@ -820,29 +779,12 @@ class Interface(BaseInterface):
server = WSGIServer((host, port), self._app, handler_class=WebSocketHandler)
server.serve_forever()
except IOError as e:
logger.exception("unable to start the server instance on %s:%d", host, port)
error_message = "unable to start the server instance on %s:%d: %s" % (
host,
port,
e,
)
logger.exception(error_message)
if e.args[0] == errno.EADDRINUSE:
raise MoulinetteError("server_already_running")
raise MoulinetteError("error_see_log")
# Routes handlers
def doc(self, category=None):
"""
Get API documentation for a category (all by default)
Keyword argument:
category -- Name of the category
"""
DATA_DIR = env()["DATA_DIR"]
if category is None:
with open("%s/../doc/resources.json" % DATA_DIR) as f:
return f.read()
try:
with open("%s/../doc/%s.json" % (DATA_DIR, category)) as f:
return f.read()
except IOError:
return None
raise MoulinetteError(error_message)

View file

@ -2,25 +2,53 @@
import os
import sys
import getpass
import locale
import logging
from argparse import SUPPRESS
import argparse
import tempfile
from collections import OrderedDict
from datetime import date, datetime
from subprocess import call
import argcomplete
from moulinette import msignals, m18n
from moulinette import m18n, Moulinette
from moulinette.actionsmap import ActionsMap
from moulinette.core import MoulinetteError
from moulinette.core import MoulinetteError, MoulinetteValidationError
from moulinette.interfaces import (
BaseActionsMapParser,
BaseInterface,
ExtendedArgumentParser,
JSONExtendedEncoder,
)
from moulinette.utils import log
# Monkeypatch _get_action_name function because there is an annoying bug
# Explained here: https://bugs.python.org/issue29298
# Fixed by: https://github.com/python/cpython/pull/3680
# To reproduce the bug, just launch a command line without action
# For example:
# yunohost firewall
# It should display:
# usage: yunohost firewall {list,reload,allow,disallow,upnp,stop} ... [-h]
# yunohost firewall: error: the following arguments are required: {list,reload,allow,disallow,upnp,stop}
# But it display instead:
# Error: unable to parse arguments 'firewall' because: sequence item 0: expected str instance, NoneType found
def monkey_get_action_name(argument):
if argument is None:
return None
elif argument.option_strings:
return "/".join(argument.option_strings)
elif argument.metavar not in (None, argparse.SUPPRESS):
return argument.metavar
elif argument.dest not in (None, argparse.SUPPRESS):
return argument.dest
elif argument.choices:
return "{" + ",".join(argument.choices) + "}"
else:
return None
argparse._get_action_name = monkey_get_action_name
logger = log.getLogger("moulinette.cli")
@ -92,8 +120,6 @@ def plain_print_dict(d, depth=0):
print("{}{}".format("#" * (depth + 1), k))
plain_print_dict(v, depth + 1)
else:
if isinstance(d, unicode):
d = d.encode("utf-8")
print(d)
@ -156,15 +182,11 @@ def pretty_print_dict(d, depth=0):
elif isinstance(value, dict):
pretty_print_dict({key: value}, depth + 1)
else:
if isinstance(value, unicode):
value = value.encode("utf-8")
elif isinstance(v, date):
if isinstance(v, date):
v = pretty_date(v)
print("{:s}- {}".format(" " * (depth + 1), value))
else:
if isinstance(v, unicode):
v = v.encode("utf-8")
elif isinstance(v, date):
if isinstance(v, date):
v = pretty_date(v)
print("{:s}{}: {}".format(" " * depth, k, v))
@ -186,7 +208,6 @@ def get_locale():
class TTYHandler(logging.StreamHandler):
"""TTY log handler
A handler class which prints logging records for a tty. The record is
@ -229,7 +250,7 @@ class TTYHandler(logging.StreamHandler):
# add translated level name before message
level = "%s " % m18n.g(record.levelname.lower())
color = self.LEVELS_COLOR.get(record.levelno, "white")
msg = "{0}{1}{2}{3}".format(colors_codes[color], level, END_CLI_COLOR, msg)
msg = "{}{}{}{}".format(colors_codes[color], level, END_CLI_COLOR, msg)
if self.formatter:
# use user-defined formatter
record.__dict__[self.message_key] = msg
@ -252,7 +273,6 @@ class TTYHandler(logging.StreamHandler):
class ActionsMapParser(BaseActionsMapParser):
"""Actions map's Parser for the CLI
Provide actions map parsing methods for a CLI usage. The parser for
@ -267,13 +287,12 @@ class ActionsMapParser(BaseActionsMapParser):
"""
def __init__(
self, parent=None, parser=None, subparser_kwargs=None, top_parser=None, **kwargs
self, parent=None, parser=None, subparser_kwargs=None, top_parser=None
):
super(ActionsMapParser, self).__init__(parent)
if subparser_kwargs is None:
subparser_kwargs = {"title": "categories", "required": False}
self._parser = parser or ExtendedArgumentParser()
self._subparsers = self._parser.add_subparsers(**subparser_kwargs)
self.global_parser = parent.global_parser if parent else None
@ -283,7 +302,7 @@ class ActionsMapParser(BaseActionsMapParser):
# Append each top parser action to the global group
for action in top_parser._actions:
action.dest = SUPPRESS
action.dest = argparse.SUPPRESS
self.global_parser._add_action(action)
# Implement virtual properties
@ -314,7 +333,11 @@ class ActionsMapParser(BaseActionsMapParser):
parser = self._subparsers.add_parser(
name, description=category_help, help=category_help, **kwargs
)
return self.__class__(self, parser, {"title": "subcommands", "required": True})
return self.__class__(
parent=self,
parser=parser,
subparser_kwargs={"title": "subcommands", "required": True},
)
def add_subcategory_parser(self, name, subcategory_help=None, **kwargs):
"""Add a parser for a subcategory
@ -331,9 +354,13 @@ class ActionsMapParser(BaseActionsMapParser):
type_="subcategory",
description=subcategory_help,
help=subcategory_help,
**kwargs
**kwargs,
)
return self.__class__(
parent=self,
parser=parser,
subparser_kwargs={"title": "actions", "required": True},
)
return self.__class__(self, parser, {"title": "actions", "required": True})
def add_action_parser(
self,
@ -342,7 +369,8 @@ class ActionsMapParser(BaseActionsMapParser):
action_help=None,
deprecated=False,
deprecated_alias=[],
**kwargs
hide_in_help=False,
**kwargs,
):
"""Add a parser for an action
@ -362,59 +390,60 @@ class ActionsMapParser(BaseActionsMapParser):
description=action_help,
deprecated=deprecated,
deprecated_alias=deprecated_alias,
hide_in_help=hide_in_help,
)
def add_global_arguments(self, arguments):
for argument_name, argument_options in arguments.items():
# will adapt arguments name for cli or api context
names = self.format_arg_names(
str(argument_name), argument_options.pop("full", None)
)
def auth_method(self, args):
ret = self.parse_args(args)
tid = getattr(ret, "_tid", [])
self.global_parser.add_argument(*names, **argument_options)
# We go down in the subparser tree until we find the leaf
# corresponding to the tid with a defined authentication
# (yeah it's a mess because the datastructure is a mess..)
_p = self._subparsers
for word in tid[1:]:
_p = _p.choices[word]
if hasattr(_p, "authentication"):
return _p.authentication
else:
_p = _p._actions[1]
def auth_required(self, args, **kwargs):
# FIXME? idk .. this try/except is duplicated from parse_args below
# Just to be able to obtain the tid
try:
ret = self._parser.parse_args(args)
except SystemExit:
raise
except:
logger.exception("unable to parse arguments '%s'", " ".join(args))
raise MoulinetteError("error_see_log")
if tid == []:
return None
tid = getattr(ret, "_tid", None)
if self.get_conf(tid, "authenticate"):
authenticator = self.get_conf(tid, "authenticator")
# If several authenticator, use the default one
if isinstance(authenticator, dict):
if "default" in authenticator:
authenticator = "default"
else:
# TODO which one should we use?
pass
return authenticator
else:
return False
raise MoulinetteError(f"Authentication undefined for {tid} ?", raw_msg=True)
def parse_args(self, args, **kwargs):
try:
ret = self._parser.parse_args(args)
return self._parser.parse_args(args)
except SystemExit:
raise
except:
logger.exception("unable to parse arguments '%s'", " ".join(args))
raise MoulinetteError("error_see_log")
else:
self.prepare_action_namespace(getattr(ret, "_tid", None), ret)
self._parser.dequeue_callbacks(ret)
return ret
except Exception as e:
error_message = "unable to parse arguments '{}' because: {}".format(
" ".join(args),
e,
)
logger.exception(error_message)
raise MoulinetteValidationError(error_message, raw_msg=True)
def want_to_take_lock(self, args):
ret = self.parse_args(args)
tid = getattr(ret, "_tid", [])
if len(tid) == 3:
_p = self._subparsers.choices[tid[1]]._actions[1].choices[tid[2]]
elif len(tid) == 4:
_p = (
self._subparsers.choices[tid[1]]
._actions[1]
.choices[tid[2]]
._actions[1]
.choices[tid[3]]
)
return getattr(_p, "want_to_take_lock", True)
class Interface(BaseInterface):
class Interface:
"""Command-line Interface for the moulinette
Initialize an interface connected to the standard input/output
@ -425,22 +454,26 @@ class Interface(BaseInterface):
"""
def __init__(self, top_parser=None, load_only_category=None):
type = "cli"
def __init__(
self,
top_parser=None,
load_only_category=None,
actionsmap=None,
locales_dir=None,
):
# Set user locale
m18n.set_locale(get_locale())
# Connect signals to handlers
msignals.set_handler("display", self._do_display)
if os.isatty(1):
msignals.set_handler("authenticate", self._do_authenticate)
msignals.set_handler("prompt", self._do_prompt)
self.actionsmap = ActionsMap(
actionsmap,
ActionsMapParser(top_parser=top_parser),
load_only_category=load_only_category,
)
Moulinette._interface = self
def run(self, args, output_as=None, timeout=None):
"""Run the moulinette
@ -456,14 +489,12 @@ class Interface(BaseInterface):
- timeout -- Number of seconds before this command will timeout because it can't acquire the lock (meaning that another command is currently running), by default there is no timeout and the command will wait until it can get the lock
"""
if output_as and output_as not in ["json", "plain", "none"]:
raise MoulinetteError("invalid_usage")
raise MoulinetteValidationError("invalid_usage")
# auto-complete
argcomplete.autocomplete(self.actionsmap.parser._parser)
# Set handler for authentication
msignals.set_handler("authenticate", self._do_authenticate)
if not args:
raise MoulinetteValidationError("invalid_usage")
try:
ret = self.actionsmap.process(args, timeout=timeout)
@ -477,7 +508,6 @@ class Interface(BaseInterface):
if output_as:
if output_as == "json":
import json
from moulinette.utils.serialize import JSONExtendedEncoder
print(json.dumps(ret, cls=JSONExtendedEncoder))
else:
@ -487,53 +517,107 @@ class Interface(BaseInterface):
else:
print(ret)
# Signals handlers
def _do_authenticate(self, authenticator):
"""Process the authentication
Handle the core.MoulinetteSignals.authenticate signal.
"""
def authenticate(self, authenticator):
# Hmpf we have no-use case in yunohost anymore where we need to auth
# because everything is run as root ...
# I guess we could imagine some yunohost-independant use-case where
# moulinette is used to create a CLI for non-root user that needs to
# auth somehow but hmpf -.-
help = authenticator.extra.get("help")
msg = m18n.n(help) if help else m18n.g("password")
return authenticator(password=self._do_prompt(msg, True, False, color="yellow"))
msg = m18n.g("password")
credentials = self.prompt(msg, True, False, color="yellow")
return authenticator.authenticate_credentials(credentials=credentials)
def _do_prompt(self, message, is_password, confirm, color="blue"):
def prompt(
self,
message,
is_password=False,
confirm=False,
color="blue",
prefill="",
is_multiline=False,
autocomplete=[],
help=None,
):
"""Prompt for a value
Handle the core.MoulinetteSignals.prompt signal.
Keyword arguments:
- color -- The color to use for prompting message
"""
if is_password:
prompt = lambda m: getpass.getpass(colorize(m18n.g("colon", m), color))
else:
prompt = lambda m: raw_input(colorize(m18n.g("colon", m), color))
value = prompt(message)
if not os.isatty(1):
raise MoulinetteError(
"Not a tty, can't do interactive prompts", raw_msg=True
)
def _prompt(message):
if not is_multiline:
import prompt_toolkit
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.styles import Style
autocomplete_ = WordCompleter(autocomplete)
style = Style.from_dict(
{
"": "",
"message": f"#ansi{color} bold",
}
)
if help:
def bottom_toolbar():
return [("class:", help)]
else:
bottom_toolbar = None
colored_message = [
("class:message", message),
("class:", ": "),
]
return prompt_toolkit.prompt(
colored_message,
bottom_toolbar=bottom_toolbar,
style=style,
default=prefill,
completer=autocomplete_,
complete_while_typing=True,
is_password=is_password,
)
else:
while True:
value = input(
colorize(m18n.g("edit_text_question", message), color)
)
value = value.lower().strip()
if value in ["", "n", "no"]:
return prefill
elif value in ["y", "yes"]:
break
initial_message = prefill.encode("utf-8")
with tempfile.NamedTemporaryFile(suffix=".tmp") as tf:
tf.write(initial_message)
tf.flush()
call(["editor", tf.name])
tf.seek(0)
edited_message = tf.read()
return edited_message.decode("utf-8")
value = _prompt(message)
if confirm:
m = message[0].lower() + message[1:]
if prompt(m18n.g("confirm", prompt=m)) != value:
raise MoulinetteError("values_mismatch")
if _prompt(m18n.g("confirm", prompt=m)) != value:
raise MoulinetteValidationError("values_mismatch")
return value
def _do_display(self, message, style):
"""Display a message
Handle the core.MoulinetteSignals.display signal.
"""
if isinstance(message, unicode):
message = message.encode("utf-8")
def display(self, message, style="info"): # i18n: info
"""Display a message"""
if style == "success":
print("{} {}".format(colorize(m18n.g("success"), "green"), message))
elif style == "warning":

View file

@ -15,16 +15,18 @@ from moulinette.core import MoulinetteError
# Files & directories --------------------------------------------------
def read_file(file_path):
def read_file(file_path, file_mode="r"):
"""
Read a regular text file
Keyword argument:
file_path -- Path to the text file
"""
assert isinstance(file_path, basestring), (
"Error: file_path '%s' should be a string but is of type '%s' instead"
% (file_path, type(file_path))
assert isinstance(
file_path, str
), "Error: file_path '{}' should be a string but is of type '{}' instead".format(
file_path,
type(file_path),
)
# Check file exists
@ -33,7 +35,7 @@ def read_file(file_path):
# Open file and read content
try:
with open(file_path, "r") as f:
with open(file_path, file_mode) as f:
file_content = f.read()
except IOError as e:
raise MoulinetteError("cannot_open_file", file=file_path, error=str(e))
@ -65,16 +67,17 @@ def read_json(file_path):
return loaded_json
def read_yaml(file_path):
def read_yaml(file_):
"""
Safely read a yaml file
Keyword argument:
file_path -- Path to the yaml file
file -- Path or stream to the yaml file
"""
# Read file
file_content = read_file(file_path)
file_path = file_ if isinstance(file_, str) else file_.name
file_content = read_file(file_) if isinstance(file_, str) else file_
# Try to load yaml to check if it's syntaxically correct
try:
@ -105,41 +108,6 @@ def read_toml(file_path):
return loaded_toml
def read_ldif(file_path, filtred_entries=[]):
"""
Safely read a LDIF file and create struct in the same style than
what return the auth objet with the seach method
The main difference with the auth object is that this function return a 2-tuples
with the "dn" and the LDAP entry.
Keyword argument:
file_path -- Path to the ldif file
filtred_entries -- The entries to don't include in the result
"""
from ldif import LDIFRecordList
class LDIFPar(LDIFRecordList):
def handle(self, dn, entry):
for e in filtred_entries:
if e in entry:
entry.pop(e)
self.all_records.append((dn, entry))
# Open file and read content
try:
with open(file_path, "r") as f:
parser = LDIFPar(f)
parser.parse()
except IOError as e:
raise MoulinetteError("cannot_open_file", file=file_path, error=str(e))
except Exception as e:
raise MoulinetteError(
"unknown_error_reading_file", file=file_path, error=str(e)
)
return parser.all_records
def write_to_file(file_path, data, file_mode="w"):
"""
Write a single string or a list of string to a text file.
@ -151,24 +119,30 @@ def write_to_file(file_path, data, file_mode="w"):
file_mode -- Mode used when writing the file. Option meant to be used
by append_to_file to avoid duplicating the code of this function.
"""
assert isinstance(data, basestring) or isinstance(data, list), (
"Error: data '%s' should be either a string or a list but is of type '%s'"
% (data, type(data))
assert (
isinstance(data, str) or isinstance(data, bytes) or isinstance(data, list)
), "Error: data '{}' should be either a string or a list but is of type '{}'".format(
data,
type(data),
)
assert not os.path.isdir(file_path), (
"Error: file_path '%s' point to a dir, it should be a file" % file_path
)
assert os.path.isdir(os.path.dirname(file_path)), (
"Error: the path ('%s') base dir ('%s') is not a dir"
% (file_path, os.path.dirname(file_path))
assert os.path.isdir(
os.path.dirname(file_path)
), "Error: the path ('{}') base dir ('{}') is not a dir".format(
file_path,
os.path.dirname(file_path),
)
# If data is a list, check elements are strings and build a single string
if not isinstance(data, basestring):
if isinstance(data, list):
for element in data:
assert isinstance(element, basestring), (
"Error: element '%s' should be a string but is of type '%s' instead"
% (element, type(element))
assert isinstance(
element, str
), "Error: element '{}' should be a string but is of type '{}' instead".format(
element,
type(element),
)
data = "\n".join(data)
@ -203,20 +177,26 @@ def write_to_json(file_path, data, sort_keys=False, indent=None):
"""
# Assumptions
assert isinstance(file_path, basestring), (
"Error: file_path '%s' should be a string but is of type '%s' instead"
% (file_path, type(file_path))
assert isinstance(
file_path, str
), "Error: file_path '{}' should be a string but is of type '{}' instead".format(
file_path,
type(file_path),
)
assert isinstance(data, dict) or isinstance(data, list), (
"Error: data '%s' should be a dict or a list but is of type '%s' instead"
% (data, type(data))
assert isinstance(data, dict) or isinstance(
data, list
), "Error: data '{}' should be a dict or a list but is of type '{}' instead".format(
data,
type(data),
)
assert not os.path.isdir(file_path), (
"Error: file_path '%s' point to a dir, it should be a file" % file_path
)
assert os.path.isdir(os.path.dirname(file_path)), (
"Error: the path ('%s') base dir ('%s') is not a dir"
% (file_path, os.path.dirname(file_path))
assert os.path.isdir(
os.path.dirname(file_path)
), "Error: the path ('{}') base dir ('{}') is not a dir".format(
file_path,
os.path.dirname(file_path),
)
# Write dict to file
@ -238,7 +218,7 @@ def write_to_yaml(file_path, data):
data -- The data to write (must be a dict or a list)
"""
# Assumptions
assert isinstance(file_path, basestring)
assert isinstance(file_path, str)
assert isinstance(data, dict) or isinstance(data, list)
assert not os.path.isdir(file_path)
assert os.path.isdir(os.path.dirname(file_path))
@ -313,14 +293,14 @@ def chown(path, uid=None, gid=None, recursive=False):
raise ValueError("either uid or gid argument is required")
# Retrieve uid/gid
if isinstance(uid, basestring):
if isinstance(uid, str):
try:
uid = getpwnam(uid).pw_uid
except KeyError:
raise MoulinetteError("unknown_user", user=uid)
elif uid is None:
uid = -1
if isinstance(gid, basestring):
if isinstance(gid, str):
try:
gid = grp.getgrnam(gid).gr_gid
except KeyError:
@ -385,3 +365,10 @@ def rm(path, recursive=False, force=False):
except OSError as e:
if not force:
raise MoulinetteError("error_removing", path=path, error=str(e))
def cp(source, dest, recursive=False, **kwargs):
if recursive and os.path.isdir(source):
return shutil.copytree(source, dest, symlinks=True, **kwargs)
else:
return shutil.copy2(source, dest, follow_symlinks=False, **kwargs)

View file

@ -1,5 +1,4 @@
import os
import logging
# import all constants because other modules try to import them from this
# module because SUCCESS is defined in this module
@ -65,14 +64,16 @@ def configure_logging(logging_config=None):
# load configuration from dict
dictConfig(DEFAULT_LOGGING)
if logging_config:
logging.main_logger = logging_config.get("main_logger")
dictConfig(logging_config)
def getHandlersByClass(classinfo, limit=0):
"""Retrieve registered handlers of a given class."""
from logging import _handlers
handlers = []
for ref in logging._handlers.itervaluerefs():
for ref in _handlers.itervaluerefs():
o = ref()
if o is not None and isinstance(o, classinfo):
if limit == 1:
@ -84,7 +85,6 @@ def getHandlersByClass(classinfo, limit=0):
class MoulinetteLogger(Logger):
"""Custom logger class
Extend base Logger class to provide the SUCCESS custom log level with
@ -101,16 +101,19 @@ class MoulinetteLogger(Logger):
if self.isEnabledFor(SUCCESS):
self._log(SUCCESS, msg, args, **kwargs)
def findCaller(self):
def findCaller(self, *args):
"""Override findCaller method to consider this source file."""
f = logging.currentframe()
from logging import currentframe, _srcfile
f = currentframe()
if f is not None:
f = f.f_back
rv = "(unknown file)", 0, "(unknown function)"
while hasattr(f, "f_code"):
co = f.f_code
filename = os.path.normcase(co.co_filename)
if filename == logging._srcfile or filename == __file__:
if filename == _srcfile or filename == __file__:
f = f.f_back
continue
rv = (co.co_filename, f.f_lineno, co.co_name)
@ -125,7 +128,7 @@ class MoulinetteLogger(Logger):
# FIXME: Get real action_id instead of logger/current one
extra["action_id"] = _get_action_id()
kwargs["extra"] = extra
return Logger._log(self, *args, **kwargs)
return super()._log(*args, **kwargs)
# Action logging -------------------------------------------------------
@ -168,8 +171,7 @@ def getActionLogger(name=None, logger=None, action_id=None):
return logger
class ActionFilter(object):
class ActionFilter:
"""Extend log record for an optionnal action
Filter a given record and look for an `action_id` key. If it is not found

View file

@ -59,6 +59,6 @@ def download_json(url, timeout=30, expected_status_code=200):
try:
loaded_json = json.loads(text)
except ValueError as e:
raise MoulinetteError("corrupted_json", ressource=url, error=e)
raise MoulinetteError("corrupted_json", ressource=url, error=str(e))
return loaded_json

View file

@ -1,22 +1,19 @@
import time
import subprocess
import os
import threading
import queue
import logging
# This import is unused in this file. It will be deleted in future (W0611 PEP8),
# but for the momment we keep it due to yunohost moulinette script that used
# process.quote syntax to access this module !
try:
from pipes import quote # Python2 & Python3 <= 3.2
except ImportError:
from shlex import quote # Python3 >= 3.3
from .stream import async_file_reading
from shlex import quote
quote # This line is here to avoid W0611 PEP8 error (see comments above)
# Prevent to import subprocess only for common classes
CalledProcessError = subprocess.CalledProcessError
logger = logging.getLogger("moulinette.utils.process")
# Alternative subprocess methods ---------------------------------------
@ -28,7 +25,11 @@ def check_output(args, stderr=subprocess.STDOUT, shell=True, **kwargs):
and use shell by default before calling subprocess.check_output.
"""
return subprocess.check_output(args, stderr=stderr, shell=shell, **kwargs).strip()
return (
subprocess.check_output(args, stderr=stderr, shell=shell, **kwargs)
.decode("utf-8")
.strip()
)
# Call with stream access ----------------------------------------------
@ -59,85 +60,82 @@ def call_async_output(args, callback, **kwargs):
if a in kwargs:
raise ValueError("%s argument not allowed, " "it will be overridden." % a)
if "stdinfo" in kwargs and kwargs["stdinfo"] is not None:
assert len(callback) == 3
stdinfo = kwargs.pop("stdinfo")
os.mkfifo(stdinfo, 0o600)
# Open stdinfo for reading (in a nonblocking way, i.e. even
# if command does not write in the stdinfo pipe...)
stdinfo_f = os.open(stdinfo, os.O_RDONLY | os.O_NONBLOCK)
else:
if "stdinfo" in kwargs:
kwargs.pop("stdinfo")
stdinfo = None
# Validate callback argument
if isinstance(callback, tuple):
if len(callback) < 2:
raise ValueError("callback argument should be a 2-tuple")
kwargs["stdout"] = kwargs["stderr"] = subprocess.PIPE
separate_stderr = True
elif callable(callback):
kwargs["stdout"] = subprocess.PIPE
kwargs["stderr"] = subprocess.STDOUT
separate_stderr = False
callback = (callback,)
else:
raise ValueError("callback argument must be callable or a 2-tuple")
# Run the command
p = subprocess.Popen(args, **kwargs)
# Wrap and get command outputs
stdout_reader, stdout_consum = async_file_reading(p.stdout, callback[0])
if separate_stderr:
stderr_reader, stderr_consum = async_file_reading(p.stderr, callback[1])
if stdinfo:
stdinfo_reader, stdinfo_consum = async_file_reading(stdinfo_f, callback[2])
while not stdout_reader.eof() and not stderr_reader.eof():
while not stdout_consum.empty() or not stderr_consum.empty():
# alternate between the 2 consumers to avoid desynchronisation
# this way is not 100% perfect but should do it
stdout_consum.process_next_line()
stderr_consum.process_next_line()
if stdinfo:
stdinfo_consum.process_next_line()
time.sleep(0.1)
stderr_reader.join()
# clear the queues
stdout_consum.process_current_queue()
stderr_consum.process_current_queue()
if stdinfo:
stdinfo_consum.process_current_queue()
else:
while not stdout_reader.eof():
stdout_consum.process_current_queue()
time.sleep(0.1)
stdout_reader.join()
# clear the queue
stdout_consum.process_current_queue()
log_queue = queue.Queue()
kwargs["stdout"] = LogPipe(callback[0], log_queue)
kwargs["stderr"] = LogPipe(callback[1], log_queue)
stdinfo = LogPipe(callback[2], log_queue) if len(callback) >= 3 else None
if stdinfo:
# Remove the stdinfo pipe
os.remove(stdinfo)
os.rmdir(os.path.dirname(stdinfo))
stdinfo_reader.join()
stdinfo_consum.process_current_queue()
kwargs["pass_fds"] = [stdinfo.fdWrite]
if "env" not in kwargs:
kwargs["env"] = os.environ
kwargs["env"]["YNH_STDINFO"] = str(stdinfo.fdWrite)
# on slow hardware, in very edgy situations it is possible that the process
# isn't finished just after having closed stdout and stderr, so we wait a
# bit to give hime the time to finish (while having a timeout)
# Note : p.poll() returns None is the process hasn't finished yet
start = time.time()
while time.time() - start < 10:
if p.poll() is not None:
return p.poll()
time.sleep(0.1)
if "env" in kwargs and not all(isinstance(v, str) for v in kwargs["env"].values()):
logger.warning(
"While trying to call call_async_output: env contained non-string values, probably gonna cause issue in Popen(...)"
)
try:
p = subprocess.Popen(args, **kwargs)
while p.poll() is None:
while True:
try:
callback, message = log_queue.get(True, 1)
except queue.Empty:
break
callback(message)
while True:
try:
callback, message = log_queue.get_nowait()
except queue.Empty:
break
callback(message)
finally:
kwargs["stdout"].close()
kwargs["stderr"].close()
if stdinfo:
stdinfo.close()
return p.poll()
class LogPipe(threading.Thread):
# Adapted from https://codereview.stackexchange.com/a/17959
def __init__(self, log_callback, queue):
"""Setup the object with a logger and a loglevel
and start the thread
"""
threading.Thread.__init__(self)
self.daemon = False
self.log_callback = log_callback
self.fdRead, self.fdWrite = os.pipe()
self.pipeReader = os.fdopen(self.fdRead, "rb")
self.queue = queue
self.start()
def fileno(self):
"""Return the write file descriptor of the pipe"""
return self.fdWrite
def run(self):
"""Run the thread, logging everything."""
for line in iter(self.pipeReader.readline, b""):
self.queue.put((self.log_callback, line.decode("utf-8").strip("\n")))
self.pipeReader.close()
def close(self):
"""Close the write end of the pipe."""
os.close(self.fdWrite)
# Call multiple commands -----------------------------------------------
@ -202,7 +200,6 @@ def run_commands(cmds, callback=None, separate_stderr=False, shell=True, **kwarg
# Iterate over commands
error = 0
for cmd in cmds:
process = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=_stderr, shell=shell, **kwargs
)

View file

@ -1,45 +0,0 @@
import logging
from json.encoder import JSONEncoder
import datetime
logger = logging.getLogger("moulinette.utils.serialize")
# JSON utilities -------------------------------------------------------
class JSONExtendedEncoder(JSONEncoder):
"""Extended JSON encoder
Extend default JSON encoder to recognize more types and classes. It will
never raise an exception if the object can't be encoded and return its repr
instead.
The following objects and types are supported:
- set: converted into list
"""
def default(self, o):
import pytz # Lazy loading, this takes like 3+ sec on a RPi2 ?!
"""Return a serializable object"""
# Convert compatible containers into list
if isinstance(o, set) or (hasattr(o, "__iter__") and hasattr(o, "next")):
return list(o)
# Display the date in its iso format ISO-8601 Internet Profile (RFC 3339)
if isinstance(o, datetime.date):
if o.tzinfo is None:
o = o.replace(tzinfo=pytz.utc)
return o.isoformat()
# Return the repr for object that json can't encode
logger.warning(
"cannot properly encode in JSON the object %s, " "returned repr is: %r",
type(o),
o,
)
return repr(o)

View file

@ -1,116 +0,0 @@
import os
import time
from multiprocessing.process import Process
from multiprocessing.queues import SimpleQueue
# Read from a stream ---------------------------------------------------
class AsynchronousFileReader(Process):
"""
Helper class to implement asynchronous reading of a file
in a separate thread. Pushes read lines on a queue to
be consumed in another thread.
Based on:
http://stefaanlippens.net/python-asynchronous-subprocess-pipe-reading
"""
def __init__(self, fd, queue):
assert hasattr(queue, "put")
assert hasattr(queue, "empty")
assert isinstance(fd, int) or callable(fd.readline)
Process.__init__(self)
self._fd = fd
self._queue = queue
def run(self):
"""The body of the tread: read lines and put them on the queue."""
# If self._fd is a file opened with open()...
# Typically that's for stdout/stderr pipes
# We can read the stuff easily with 'readline'
if not isinstance(self._fd, int):
for line in iter(self._fd.readline, ""):
self._queue.put(line)
# Else, it got opened with os.open() and we have to read it
# wit low level crap...
else:
data = ""
while True:
try:
# Try to read (non-blockingly) a few bytes, append them to
# the buffer
data += os.read(self._fd, 50)
except Exception as e:
print(
"from moulinette.utils.stream: could not read file descriptor : %s"
% str(e)
)
continue
# If nobody's writing in there anymore, get out
if not data and os.fstat(self._fd).st_nlink == 0:
return
# If we have data, extract a line (ending with \n) and feed
# it to the consumer
if data and "\n" in data:
lines = data.split("\n")
self._queue.put(lines[0])
data = "\n".join(lines[1:])
else:
time.sleep(0.05)
def eof(self):
"""Check whether there is no more content to expect."""
return not self.is_alive() and self._queue.empty()
def join(self, timeout=None, close=True):
"""Close the file and join the thread."""
if close:
self._queue.put(StopIteration)
if isinstance(self._fd, int):
os.close(self._fd)
else:
self._fd.close()
Process.join(self, timeout)
class Consummer(object):
def __init__(self, queue, callback):
self.queue = queue
self.callback = callback
def empty(self):
return self.queue.empty()
def process_next_line(self):
if not self.empty():
line = self.queue.get()
if line:
if line == StopIteration:
return
self.callback(line)
def process_current_queue(self):
while not self.empty():
line = self.queue.get()
if line:
if line == StopIteration:
break
self.callback(line)
def async_file_reading(fd, callback):
"""Helper which instantiate and run an AsynchronousFileReader."""
queue = SimpleQueue()
reader = AsynchronousFileReader(fd, queue)
reader.start()
consummer = Consummer(queue, callback)
return (reader, consummer)

View file

@ -3,7 +3,6 @@ import re
import mmap
import binascii
# Pattern searching ----------------------------------------------------
@ -47,9 +46,9 @@ def searchf(pattern, path, count=0, flags=re.MULTILINE):
content by using the search function.
"""
with open(path, "r+") as f:
with open(path, "rb+") as f:
data = mmap.mmap(f.fileno(), 0)
match = search(pattern, data, count, flags)
match = search(pattern, data.read().decode(), count, flags)
data.close()
return match
@ -60,12 +59,12 @@ def searchf(pattern, path, count=0, flags=re.MULTILINE):
def prependlines(text, prepend):
"""Prepend a string to each line of a text"""
lines = text.splitlines(True)
return "%s%s" % (prepend, prepend.join(lines))
return "{}{}".format(prepend, prepend.join(lines))
# Randomize ------------------------------------------------------------
def random_ascii(length=20):
def random_ascii(length=40):
"""Return a random ascii string"""
return binascii.hexlify(os.urandom(length)).decode("ascii")
return binascii.hexlify(os.urandom(length)).decode("ascii")[:length]

View file

@ -3,5 +3,4 @@ addopts = --cov=moulinette -s -v --no-cov-on-fail
norecursedirs = dist doc build .tox .eggs
testpaths = test/
env =
MOULINETTE_LOCALES_DIR = {PWD}/locales
TESTS_RUN = True

View file

@ -4,5 +4,7 @@ ignore =
E128,
E731,
E722,
W503 # Black formatter conflict
E203 # Black formatter conflict
# Black formatter conflict
W503,
# Black formatter conflict
E203

View file

@ -2,49 +2,66 @@
import os
import sys
import subprocess
from setuptools import setup, find_packages
from moulinette.globals import init_moulinette_env
LOCALES_DIR = init_moulinette_env()['LOCALES_DIR']
version = (
subprocess.check_output(
"head debian/changelog -n1 | awk '{print $2}' | tr -d '()'", shell=True
)
.decode()
.strip()
)
# Extend installation
locale_files = []
if "install" in sys.argv:
# Evaluate locale files
for f in os.listdir('locales'):
if f.endswith('.json'):
locale_files.append('locales/%s' % f)
for f in os.listdir("locales"):
if f.endswith(".json"):
locale_files.append("locales/%s" % f)
install_deps = [
"psutil",
"pytz",
"pyyaml",
"toml",
"gevent-websocket",
"bottle",
"prompt-toolkit>=3.0",
"pygments",
]
setup(name='Moulinette',
version='2.0.0',
description='Prototype interfaces quickly and easily',
author='Yunohost Team',
author_email='yunohost@yunohost.org',
url='http://yunohost.org',
license='AGPL',
packages=find_packages(exclude=['test']),
data_files=[(LOCALES_DIR, locale_files)],
python_requires='>=2.7.*',
install_requires=[
'argcomplete',
'psutil',
'pytz',
'pyyaml',
'toml',
'python-ldap',
'gevent-websocket',
'bottle',
],
tests_require=[
'pytest',
'pytest-cov',
'pytest-env',
'pytest-mock',
'requests',
'requests-mock',
'webtest'
],
)
test_deps = [
"pytest",
"pytest-cov",
"pytest-env",
"pytest-mock",
"mock",
"requests",
"requests-mock",
"webtest",
]
extras = {
"install": install_deps,
"tests": test_deps,
}
setup(
name="Moulinette",
version=version,
description="Prototype interfaces quickly and easily",
author="Yunohost Team",
author_email="yunohost@yunohost.org",
url="https://yunohost.org",
license="AGPL",
packages=find_packages(exclude=["test"]),
data_files=[("/usr/share/moulinette/locales", locale_files)],
python_requires=">=3.7.0,<3.10",
install_requires=install_deps,
tests_require=test_deps,
extras_require=extras,
)

View file

@ -3,38 +3,10 @@
# Global parameters #
#############################
_global:
configuration:
authenticate:
- all
authenticator:
default:
vendor: dummy
help: Dummy Password
yoloswag:
vendor: dummy
help: Dummy Yoloswag Password
ldap:
vendor: ldap
help: admin_password
parameters:
uri: ldap://localhost:8080
base_dn: dc=yunohost,dc=org
user_rdn: cn=admin,dc=yunohost,dc=org
arguments:
-v:
full: --version
help: Display Yoloswag versions
action: callback
callback:
method: test.src.testauth.yoloswag_version
return: true
-w:
full: --wersion
help: Not existing function
action: callback
callback:
method: test.src.testauth.not_existing_function
return: true
namespace: moulitest
authentication:
api: dummy
cli: dummy
#############################
# Test Actions #
@ -43,37 +15,30 @@ testauth:
actions:
none:
api: GET /test-auth/none
configuration:
authenticate: false
authentication:
api: null
cli: null
default:
api: GET /test-auth/default
only-api:
api: GET /test-auth/only-api
configuration:
authenticate:
- api
authentication:
api: dummy
cli: null
only-cli:
api: GET /test-auth/only-cli
configuration:
authenticate:
- cli
authentication:
api: null
cli: dummy
other-profile:
api: GET /test-auth/other-profile
configuration:
authenticate:
- all
authenticator: yoloswag
ldap:
api: GET /test-auth/ldap
configuration:
authenticate:
- all
authenticator: ldap
authentication:
api: yoloswag
cli: yoloswag
with_arg:
api: GET /test-auth/with_arg/<super_arg>
@ -103,21 +68,21 @@ testauth:
actions:
none:
api: GET /test-auth/subcat/none
configuration:
authenticate: false
authentication:
api: null
cli: null
default:
api: GET /test-auth/subcat/default
post:
api: POST /test-auth/subcat/post
configuration:
authenticate:
- all
authenticator: default
authentication:
api: dummy
cli: dummy
other-profile:
api: GET /test-auth/subcat/other-profile
configuration:
authenticator: yoloswag
authentication:
api: yoloswag
cli: yoloswag

View file

@ -0,0 +1,51 @@
import re
import json
import glob
# List all locale files (except en.json being the ref)
locale_folder = "locales/"
locale_files = glob.glob(locale_folder + "*.json")
locale_files = [filename.split("/")[-1] for filename in locale_files]
locale_files.remove("en.json")
reference = json.loads(open(locale_folder + "en.json").read())
def fix_locale(locale_file):
this_locale = json.loads(open(locale_folder + locale_file).read())
fixed_stuff = False
# We iterate over all keys/string in en.json
for key, string in reference.items():
# Ignore check if there's no translation yet for this key
if key not in this_locale:
continue
# Then we check that every "{stuff}" (for python's .format())
# should also be in the translated string, otherwise the .format
# will trigger an exception!
subkeys_in_ref = [k[0] for k in re.findall(r"{(\w+)(:\w)?}", string)]
subkeys_in_this_locale = [
k[0] for k in re.findall(r"{(\w+)(:\w)?}", this_locale[key])
]
if set(subkeys_in_ref) != set(subkeys_in_this_locale) and (
len(subkeys_in_ref) == len(subkeys_in_this_locale)
):
for i, subkey in enumerate(subkeys_in_ref):
this_locale[key] = this_locale[key].replace(
"{%s}" % subkeys_in_this_locale[i], "{%s}" % subkey
)
fixed_stuff = True
if fixed_stuff:
json.dump(
this_locale,
open(locale_folder + locale_file, "w"),
indent=4,
ensure_ascii=False,
)
for locale_file in locale_files:
fix_locale(locale_file)

View file

@ -1,25 +1,14 @@
"""Pytest fixtures for testing."""
import sys
import toml
import yaml
import json
import os
import shutil
import pytest
from .src.ldap_server import LDAPServer
def patch_init(moulinette):
"""Configure moulinette to use the YunoHost namespace."""
old_init = moulinette.core.Moulinette18n.__init__
def monkey_path_i18n_init(self, package, default_locale="en"):
old_init(self, package, default_locale)
self.load_namespace("moulinette")
moulinette.core.Moulinette18n.__init__ = monkey_path_i18n_init
def patch_translate(moulinette):
"""Configure translator to raise errors when there are missing keys."""
@ -27,7 +16,7 @@ def patch_translate(moulinette):
def new_translate(self, key, *args, **kwargs):
if key not in self._translations[self.default_locale].keys():
message = "Unable to retrieve key %s for default locale!" % key
message = "Unable to retrieve key '%s' for default locale!" % key
raise KeyError(message)
return old_translate(self, key, *args, **kwargs)
@ -40,9 +29,9 @@ def patch_translate(moulinette):
moulinette.core.Moulinette18n.g = new_m18nn
def patch_logging(moulinette):
def logging_configuration(moulinette):
"""Configure logging to use the custom logger."""
handlers = set(["tty", "api"])
handlers = {"tty", "api"}
root_handlers = set(handlers)
level = "INFO"
@ -88,33 +77,32 @@ def patch_lock(moulinette):
@pytest.fixture(scope="session", autouse=True)
def moulinette(tmp_path_factory):
import moulinette
import moulinette.core
from moulinette.utils.log import configure_logging
# Can't call the namespace just 'test' because
# that would lead to some "import test" not importing the right stuff
namespace = "moulitest"
tmp_cache = str(tmp_path_factory.mktemp("cache"))
tmp_data = str(tmp_path_factory.mktemp("data"))
tmp_lib = str(tmp_path_factory.mktemp("lib"))
os.environ["MOULINETTE_CACHE_DIR"] = tmp_cache
os.environ["MOULINETTE_DATA_DIR"] = tmp_data
os.environ["MOULINETTE_LIB_DIR"] = tmp_lib
shutil.copytree("./test/actionsmap", "%s/actionsmap" % tmp_data)
shutil.copytree("./test/src", "%s/%s" % (tmp_lib, namespace))
shutil.copytree("./test/locales", "%s/%s/locales" % (tmp_lib, namespace))
tmp_dir = str(tmp_path_factory.mktemp(namespace))
shutil.copy("./test/actionsmap/moulitest.yml", f"{tmp_dir}/moulitest.yml")
shutil.copytree("./test/src", f"{tmp_dir}/lib/{namespace}/")
shutil.copytree("./test/locales", f"{tmp_dir}/locales")
sys.path.insert(0, f"{tmp_dir}/lib")
patch_init(moulinette)
patch_translate(moulinette)
patch_lock(moulinette)
logging = patch_logging(moulinette)
moulinette.init(logging_config=logging, _from_source=False)
configure_logging(logging_configuration(moulinette))
moulinette.m18n.set_locales_dir(f"{tmp_dir}/locales")
# Dirty hack to pass this path to Api() and Cli() init later
moulinette._actionsmap_path = f"{tmp_dir}/moulitest.yml"
return moulinette
@pytest.fixture
def moulinette_webapi(moulinette):
from webtest import TestApp
from webtest.app import CookiePolicy
@ -127,13 +115,11 @@ def moulinette_webapi(moulinette):
from moulinette.interfaces.api import Interface as Api
return TestApp(Api(routes={})._app)
return TestApp(Api(routes={}, actionsmap=moulinette._actionsmap_path)._app)
@pytest.fixture
def moulinette_cli(moulinette, mocker):
# Dirty hack needed, otherwise cookies ain't reused between request .. not
# sure why :|
import argparse
parser = argparse.ArgumentParser(add_help=False)
@ -146,7 +132,7 @@ def moulinette_cli(moulinette, mocker):
mocker.patch("os.isatty", return_value=True)
from moulinette.interfaces.cli import Interface as Cli
cli = Cli(top_parser=parser)
cli = Cli(top_parser=parser, actionsmap=moulinette._actionsmap_path)
mocker.stopall()
return cli
@ -156,7 +142,7 @@ def moulinette_cli(moulinette, mocker):
def test_file(tmp_path):
test_text = "foo\nbar\n"
test_file = tmp_path / "test.txt"
test_file.write_bytes(test_text)
test_file.write_bytes(test_text.encode())
return test_file
@ -164,7 +150,7 @@ def test_file(tmp_path):
def test_json(tmp_path):
test_json = json.dumps({"foo": "bar"})
test_file = tmp_path / "test.json"
test_file.write_bytes(test_json)
test_file.write_bytes(test_json.encode())
return test_file
@ -172,7 +158,7 @@ def test_json(tmp_path):
def test_yaml(tmp_path):
test_yaml = yaml.dump({"foo": "bar"})
test_file = tmp_path / "test.txt"
test_file.write_bytes(test_yaml)
test_file.write_bytes(test_yaml.encode())
return test_file
@ -180,26 +166,7 @@ def test_yaml(tmp_path):
def test_toml(tmp_path):
test_toml = toml.dumps({"foo": "bar"})
test_file = tmp_path / "test.txt"
test_file.write_bytes(str(test_toml))
return test_file
@pytest.fixture
def test_ldif(tmp_path):
test_file = tmp_path / "test.txt"
from ldif import LDIFWriter
writer = LDIFWriter(open(str(test_file), "wb"))
writer.unparse(
"mail=alice@example.com",
{
"cn": ["Alice Alison"],
"mail": ["alice@example.com"],
"objectclass": ["top", "person"],
},
)
test_file.write_bytes(test_toml.encode())
return test_file
@ -211,11 +178,3 @@ def user():
@pytest.fixture
def test_url():
return "https://some.test.url/yolo.txt"
@pytest.fixture
def ldap_server():
server = LDAPServer()
server.start()
yield server
server.stop()

View file

@ -1,84 +0,0 @@
parents:
ou=users:
ou: users
objectClass:
- organizationalUnit
- top
ou=domains:
ou: domains
objectClass:
- organizationalUnit
- top
ou=apps:
ou: apps
objectClass:
- organizationalUnit
- top
ou=permission:
ou: permission
objectClass:
- organizationalUnit
- top
ou=groups:
ou: groups
objectClass:
- organizationalUnit
- top
ou=sudo:
ou: sudo
objectClass:
- organizationalUnit
- top
children:
cn=admin,ou=sudo:
cn: admin
sudoUser: admin
sudoHost: ALL
sudoCommand: ALL
sudoOption: "!authenticate"
objectClass:
- sudoRole
- top
cn=admins,ou=groups:
cn: admins
gidNumber: "4001"
memberUid: admin
objectClass:
- posixGroup
- top
cn=all_users,ou=groups:
cn: all_users
gidNumber: "4002"
objectClass:
- posixGroup
- groupOfNamesYnh
cn=visitors,ou=groups:
cn: visitors
gidNumber: "4003"
objectClass:
- posixGroup
- groupOfNamesYnh
depends_children:
cn=mail.main,ou=permission:
cn: mail.main
gidNumber: "5001"
objectClass:
- posixGroup
- permissionYnh
groupPermission:
- "cn=all_users,ou=groups,dc=yunohost,dc=org"
cn=xmpp.main,ou=permission:
cn: xmpp.main
gidNumber: "5002"
objectClass:
- posixGroup
- permissionYnh
groupPermission:
- "cn=all_users,ou=groups,dc=yunohost,dc=org"

View file

@ -1,610 +0,0 @@
# OpenLDAP Core schema
# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
## Copyright 1998-2019 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
## Public License.
##
## A copy of this license is available in the file LICENSE in the
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.
#
## Portions Copyright (C) The Internet Society (1997-2006).
## All Rights Reserved.
##
## This document and translations of it may be copied and furnished to
## others, and derivative works that comment on or otherwise explain it
## or assist in its implementation may be prepared, copied, published
## and distributed, in whole or in part, without restriction of any
## kind, provided that the above copyright notice and this paragraph are
## included on all such copies and derivative works. However, this
## document itself may not be modified in any way, such as by removing
## the copyright notice or references to the Internet Society or other
## Internet organizations, except as needed for the purpose of
## developing Internet standards in which case the procedures for
## copyrights defined in the Internet Standards process must be
## followed, or as required to translate it into languages other than
## English.
##
## The limited permissions granted above are perpetual and will not be
## revoked by the Internet Society or its successors or assigns.
##
## This document and the information contained herein is provided on an
## "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
## TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
## BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
## HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
## MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
#
# Includes LDAPv3 schema items from:
# RFC 2252/2256 (LDAPv3)
#
# Select standard track schema items:
# RFC 1274 (uid/dc)
# RFC 2079 (URI)
# RFC 2247 (dc/dcObject)
# RFC 2587 (PKI)
# RFC 2589 (Dynamic Directory Services)
# RFC 4524 (associatedDomain)
#
# Select informational schema items:
# RFC 2377 (uidObject)
#
# Standard attribute types from RFC 2256
#
# system schema
#attributetype ( 2.5.4.0 NAME 'objectClass'
# DESC 'RFC2256: object classes of the entity'
# EQUALITY objectIdentifierMatch
# SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )
# system schema
#attributetype ( 2.5.4.1 NAME ( 'aliasedObjectName' 'aliasedEntryName' )
# DESC 'RFC2256: name of aliased object'
# EQUALITY distinguishedNameMatch
# SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
attributetype ( 2.5.4.2 NAME 'knowledgeInformation'
DESC 'RFC2256: knowledge information'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
# system schema
#attributetype ( 2.5.4.3 NAME ( 'cn' 'commonName' )
# DESC 'RFC2256: common name(s) for which the entity is known by'
# SUP name )
attributetype ( 2.5.4.4 NAME ( 'sn' 'surname' )
DESC 'RFC2256: last (family) name(s) for which the entity is known by'
SUP name )
attributetype ( 2.5.4.5 NAME 'serialNumber'
DESC 'RFC2256: serial number of the entity'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{64} )
# RFC 4519 definition ('countryName' in X.500 and RFC2256)
attributetype ( 2.5.4.6 NAME ( 'c' 'countryName' )
DESC 'RFC4519: two-letter ISO-3166 country code'
SUP name
SYNTAX 1.3.6.1.4.1.1466.115.121.1.11
SINGLE-VALUE )
#attributetype ( 2.5.4.6 NAME ( 'c' 'countryName' )
# DESC 'RFC2256: ISO-3166 country 2-letter code'
# SUP name SINGLE-VALUE )
attributetype ( 2.5.4.7 NAME ( 'l' 'localityName' )
DESC 'RFC2256: locality which this object resides in'
SUP name )
attributetype ( 2.5.4.8 NAME ( 'st' 'stateOrProvinceName' )
DESC 'RFC2256: state or province which this object resides in'
SUP name )
attributetype ( 2.5.4.9 NAME ( 'street' 'streetAddress' )
DESC 'RFC2256: street address of this object'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
attributetype ( 2.5.4.10 NAME ( 'o' 'organizationName' )
DESC 'RFC2256: organization this object belongs to'
SUP name )
attributetype ( 2.5.4.11 NAME ( 'ou' 'organizationalUnitName' )
DESC 'RFC2256: organizational unit this object belongs to'
SUP name )
attributetype ( 2.5.4.12 NAME 'title'
DESC 'RFC2256: title associated with the entity'
SUP name )
# system schema
#attributetype ( 2.5.4.13 NAME 'description'
# DESC 'RFC2256: descriptive information'
# EQUALITY caseIgnoreMatch
# SUBSTR caseIgnoreSubstringsMatch
# SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
# Deprecated by enhancedSearchGuide
attributetype ( 2.5.4.14 NAME 'searchGuide'
DESC 'RFC2256: search guide, deprecated by enhancedSearchGuide'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.25 )
attributetype ( 2.5.4.15 NAME 'businessCategory'
DESC 'RFC2256: business category'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
attributetype ( 2.5.4.16 NAME 'postalAddress'
DESC 'RFC2256: postal address'
EQUALITY caseIgnoreListMatch
SUBSTR caseIgnoreListSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )
attributetype ( 2.5.4.17 NAME 'postalCode'
DESC 'RFC2256: postal code'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} )
attributetype ( 2.5.4.18 NAME 'postOfficeBox'
DESC 'RFC2256: Post Office Box'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} )
attributetype ( 2.5.4.19 NAME 'physicalDeliveryOfficeName'
DESC 'RFC2256: Physical Delivery Office Name'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
attributetype ( 2.5.4.20 NAME 'telephoneNumber'
DESC 'RFC2256: Telephone Number'
EQUALITY telephoneNumberMatch
SUBSTR telephoneNumberSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{32} )
attributetype ( 2.5.4.21 NAME 'telexNumber'
DESC 'RFC2256: Telex Number'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.52 )
attributetype ( 2.5.4.22 NAME 'teletexTerminalIdentifier'
DESC 'RFC2256: Teletex Terminal Identifier'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.51 )
attributetype ( 2.5.4.23 NAME ( 'facsimileTelephoneNumber' 'fax' )
DESC 'RFC2256: Facsimile (Fax) Telephone Number'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.22 )
attributetype ( 2.5.4.24 NAME 'x121Address'
DESC 'RFC2256: X.121 Address'
EQUALITY numericStringMatch
SUBSTR numericStringSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{15} )
attributetype ( 2.5.4.25 NAME 'internationaliSDNNumber'
DESC 'RFC2256: international ISDN number'
EQUALITY numericStringMatch
SUBSTR numericStringSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{16} )
attributetype ( 2.5.4.26 NAME 'registeredAddress'
DESC 'RFC2256: registered postal address'
SUP postalAddress
SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )
attributetype ( 2.5.4.27 NAME 'destinationIndicator'
DESC 'RFC2256: destination indicator'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{128} )
attributetype ( 2.5.4.28 NAME 'preferredDeliveryMethod'
DESC 'RFC2256: preferred delivery method'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.14
SINGLE-VALUE )
attributetype ( 2.5.4.29 NAME 'presentationAddress'
DESC 'RFC2256: presentation address'
EQUALITY presentationAddressMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.43
SINGLE-VALUE )
attributetype ( 2.5.4.30 NAME 'supportedApplicationContext'
DESC 'RFC2256: supported application context'
EQUALITY objectIdentifierMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )
attributetype ( 2.5.4.31 NAME 'member'
DESC 'RFC2256: member of a group'
SUP distinguishedName )
attributetype ( 2.5.4.32 NAME 'owner'
DESC 'RFC2256: owner (of the object)'
SUP distinguishedName )
attributetype ( 2.5.4.33 NAME 'roleOccupant'
DESC 'RFC2256: occupant of role'
SUP distinguishedName )
# system schema
#attributetype ( 2.5.4.34 NAME 'seeAlso'
# DESC 'RFC2256: DN of related object'
# SUP distinguishedName )
# system schema
#attributetype ( 2.5.4.35 NAME 'userPassword'
# DESC 'RFC2256/2307: password of user'
# EQUALITY octetStringMatch
# SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{128} )
# Must be transferred using ;binary
# with certificateExactMatch rule (per X.509)
attributetype ( 2.5.4.36 NAME 'userCertificate'
DESC 'RFC2256: X.509 user certificate, use ;binary'
EQUALITY certificateExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.8 )
# Must be transferred using ;binary
# with certificateExactMatch rule (per X.509)
attributetype ( 2.5.4.37 NAME 'cACertificate'
DESC 'RFC2256: X.509 CA certificate, use ;binary'
EQUALITY certificateExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.8 )
# Must be transferred using ;binary
attributetype ( 2.5.4.38 NAME 'authorityRevocationList'
DESC 'RFC2256: X.509 authority revocation list, use ;binary'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )
# Must be transferred using ;binary
attributetype ( 2.5.4.39 NAME 'certificateRevocationList'
DESC 'RFC2256: X.509 certificate revocation list, use ;binary'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )
# Must be stored and requested in the binary form
attributetype ( 2.5.4.40 NAME 'crossCertificatePair'
DESC 'RFC2256: X.509 cross certificate pair, use ;binary'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.10 )
# system schema
#attributetype ( 2.5.4.41 NAME 'name'
# EQUALITY caseIgnoreMatch
# SUBSTR caseIgnoreSubstringsMatch
# SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
attributetype ( 2.5.4.42 NAME ( 'givenName' 'gn' )
DESC 'RFC2256: first name(s) for which the entity is known by'
SUP name )
attributetype ( 2.5.4.43 NAME 'initials'
DESC 'RFC2256: initials of some or all of names, but not the surname(s).'
SUP name )
attributetype ( 2.5.4.44 NAME 'generationQualifier'
DESC 'RFC2256: name qualifier indicating a generation'
SUP name )
attributetype ( 2.5.4.45 NAME 'x500UniqueIdentifier'
DESC 'RFC2256: X.500 unique identifier'
EQUALITY bitStringMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 )
attributetype ( 2.5.4.46 NAME 'dnQualifier'
DESC 'RFC2256: DN qualifier'
EQUALITY caseIgnoreMatch
ORDERING caseIgnoreOrderingMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.44 )
attributetype ( 2.5.4.47 NAME 'enhancedSearchGuide'
DESC 'RFC2256: enhanced search guide'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.21 )
attributetype ( 2.5.4.48 NAME 'protocolInformation'
DESC 'RFC2256: protocol information'
EQUALITY protocolInformationMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.42 )
# system schema
#attributetype ( 2.5.4.49 NAME 'distinguishedName'
# EQUALITY distinguishedNameMatch
# SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
attributetype ( 2.5.4.50 NAME 'uniqueMember'
DESC 'RFC2256: unique member of a group'
EQUALITY uniqueMemberMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.34 )
attributetype ( 2.5.4.51 NAME 'houseIdentifier'
DESC 'RFC2256: house identifier'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
# Must be transferred using ;binary
attributetype ( 2.5.4.52 NAME 'supportedAlgorithms'
DESC 'RFC2256: supported algorithms'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.49 )
# Must be transferred using ;binary
attributetype ( 2.5.4.53 NAME 'deltaRevocationList'
DESC 'RFC2256: delta revocation list; use ;binary'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )
attributetype ( 2.5.4.54 NAME 'dmdName'
DESC 'RFC2256: name of DMD'
SUP name )
attributetype ( 2.5.4.65 NAME 'pseudonym'
DESC 'X.520(4th): pseudonym for the object'
SUP name )
# Standard object classes from RFC2256
# system schema
#objectclass ( 2.5.6.0 NAME 'top'
# DESC 'RFC2256: top of the superclass chain'
# ABSTRACT
# MUST objectClass )
# system schema
#objectclass ( 2.5.6.1 NAME 'alias'
# DESC 'RFC2256: an alias'
# SUP top STRUCTURAL
# MUST aliasedObjectName )
objectclass ( 2.5.6.2 NAME 'country'
DESC 'RFC2256: a country'
SUP top STRUCTURAL
MUST c
MAY ( searchGuide $ description ) )
objectclass ( 2.5.6.3 NAME 'locality'
DESC 'RFC2256: a locality'
SUP top STRUCTURAL
MAY ( street $ seeAlso $ searchGuide $ st $ l $ description ) )
objectclass ( 2.5.6.4 NAME 'organization'
DESC 'RFC2256: an organization'
SUP top STRUCTURAL
MUST o
MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $
x121Address $ registeredAddress $ destinationIndicator $
preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
telephoneNumber $ internationaliSDNNumber $
facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $
postalAddress $ physicalDeliveryOfficeName $ st $ l $ description ) )
objectclass ( 2.5.6.5 NAME 'organizationalUnit'
DESC 'RFC2256: an organizational unit'
SUP top STRUCTURAL
MUST ou
MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $
x121Address $ registeredAddress $ destinationIndicator $
preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
telephoneNumber $ internationaliSDNNumber $
facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $
postalAddress $ physicalDeliveryOfficeName $ st $ l $ description ) )
objectclass ( 2.5.6.6 NAME 'person'
DESC 'RFC2256: a person'
SUP top STRUCTURAL
MUST ( sn $ cn )
MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) )
objectclass ( 2.5.6.7 NAME 'organizationalPerson'
DESC 'RFC2256: an organizational person'
SUP person STRUCTURAL
MAY ( title $ x121Address $ registeredAddress $ destinationIndicator $
preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
telephoneNumber $ internationaliSDNNumber $
facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $
postalAddress $ physicalDeliveryOfficeName $ ou $ st $ l ) )
objectclass ( 2.5.6.8 NAME 'organizationalRole'
DESC 'RFC2256: an organizational role'
SUP top STRUCTURAL
MUST cn
MAY ( x121Address $ registeredAddress $ destinationIndicator $
preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $
seeAlso $ roleOccupant $ preferredDeliveryMethod $ street $
postOfficeBox $ postalCode $ postalAddress $
physicalDeliveryOfficeName $ ou $ st $ l $ description ) )
objectclass ( 2.5.6.9 NAME 'groupOfNames'
DESC 'RFC2256: a group of names (DNs)'
SUP top STRUCTURAL
MUST ( member $ cn )
MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ description ) )
objectclass ( 2.5.6.10 NAME 'residentialPerson'
DESC 'RFC2256: an residential person'
SUP person STRUCTURAL
MUST l
MAY ( businessCategory $ x121Address $ registeredAddress $
destinationIndicator $ preferredDeliveryMethod $ telexNumber $
teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $
facsimileTelephoneNumber $ preferredDeliveryMethod $ street $
postOfficeBox $ postalCode $ postalAddress $
physicalDeliveryOfficeName $ st $ l ) )
objectclass ( 2.5.6.11 NAME 'applicationProcess'
DESC 'RFC2256: an application process'
SUP top STRUCTURAL
MUST cn
MAY ( seeAlso $ ou $ l $ description ) )
objectclass ( 2.5.6.12 NAME 'applicationEntity'
DESC 'RFC2256: an application entity'
SUP top STRUCTURAL
MUST ( presentationAddress $ cn )
MAY ( supportedApplicationContext $ seeAlso $ ou $ o $ l $
description ) )
objectclass ( 2.5.6.13 NAME 'dSA'
DESC 'RFC2256: a directory system agent (a server)'
SUP applicationEntity STRUCTURAL
MAY knowledgeInformation )
objectclass ( 2.5.6.14 NAME 'device'
DESC 'RFC2256: a device'
SUP top STRUCTURAL
MUST cn
MAY ( serialNumber $ seeAlso $ owner $ ou $ o $ l $ description ) )
objectclass ( 2.5.6.15 NAME 'strongAuthenticationUser'
DESC 'RFC2256: a strong authentication user'
SUP top AUXILIARY
MUST userCertificate )
objectclass ( 2.5.6.16 NAME 'certificationAuthority'
DESC 'RFC2256: a certificate authority'
SUP top AUXILIARY
MUST ( authorityRevocationList $ certificateRevocationList $
cACertificate ) MAY crossCertificatePair )
objectclass ( 2.5.6.17 NAME 'groupOfUniqueNames'
DESC 'RFC2256: a group of unique names (DN and Unique Identifier)'
SUP top STRUCTURAL
MUST ( uniqueMember $ cn )
MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ description ) )
objectclass ( 2.5.6.18 NAME 'userSecurityInformation'
DESC 'RFC2256: a user security information'
SUP top AUXILIARY
MAY ( supportedAlgorithms ) )
objectclass ( 2.5.6.16.2 NAME 'certificationAuthority-V2'
SUP certificationAuthority
AUXILIARY MAY ( deltaRevocationList ) )
objectclass ( 2.5.6.19 NAME 'cRLDistributionPoint'
SUP top STRUCTURAL
MUST ( cn )
MAY ( certificateRevocationList $ authorityRevocationList $
deltaRevocationList ) )
objectclass ( 2.5.6.20 NAME 'dmd'
SUP top STRUCTURAL
MUST ( dmdName )
MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $
x121Address $ registeredAddress $ destinationIndicator $
preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $
street $ postOfficeBox $ postalCode $ postalAddress $
physicalDeliveryOfficeName $ st $ l $ description ) )
#
# Object Classes from RFC 2587
#
objectclass ( 2.5.6.21 NAME 'pkiUser'
DESC 'RFC2587: a PKI user'
SUP top AUXILIARY
MAY userCertificate )
objectclass ( 2.5.6.22 NAME 'pkiCA'
DESC 'RFC2587: PKI certificate authority'
SUP top AUXILIARY
MAY ( authorityRevocationList $ certificateRevocationList $
cACertificate $ crossCertificatePair ) )
objectclass ( 2.5.6.23 NAME 'deltaCRL'
DESC 'RFC2587: PKI user'
SUP top AUXILIARY
MAY deltaRevocationList )
#
# Standard Track URI label schema from RFC 2079
# system schema
#attributetype ( 1.3.6.1.4.1.250.1.57 NAME 'labeledURI'
# DESC 'RFC2079: Uniform Resource Identifier with optional label'
# EQUALITY caseExactMatch
# SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
objectclass ( 1.3.6.1.4.1.250.3.15 NAME 'labeledURIObject'
DESC 'RFC2079: object that contains the URI attribute type'
SUP top AUXILIARY
MAY ( labeledURI ) )
#
# Derived from RFC 1274, but with new "short names"
#
#attributetype ( 0.9.2342.19200300.100.1.1
# NAME ( 'uid' 'userid' )
# DESC 'RFC1274: user identifier'
# EQUALITY caseIgnoreMatch
# SUBSTR caseIgnoreSubstringsMatch
# SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
attributetype ( 0.9.2342.19200300.100.1.3
NAME ( 'mail' 'rfc822Mailbox' )
DESC 'RFC1274: RFC822 Mailbox'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
objectclass ( 0.9.2342.19200300.100.4.19 NAME 'simpleSecurityObject'
DESC 'RFC1274: simple security object'
SUP top AUXILIARY
MUST userPassword )
# RFC 1274 + RFC 2247
attributetype ( 0.9.2342.19200300.100.1.25
NAME ( 'dc' 'domainComponent' )
DESC 'RFC1274/2247: domain component'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
# RFC 2247
objectclass ( 1.3.6.1.4.1.1466.344 NAME 'dcObject'
DESC 'RFC2247: domain component object'
SUP top AUXILIARY MUST dc )
# RFC 2377
objectclass ( 1.3.6.1.1.3.1 NAME 'uidObject'
DESC 'RFC2377: uid object'
SUP top AUXILIARY MUST uid )
# RFC 4524
# The 'associatedDomain' attribute specifies DNS [RFC1034][RFC2181]
# host names [RFC1123] that are associated with an object. That is,
# values of this attribute should conform to the following ABNF:
#
# domain = root / label *( DOT label )
# root = SPACE
# label = LETDIG [ *61( LETDIG / HYPHEN ) LETDIG ]
# LETDIG = %x30-39 / %x41-5A / %x61-7A ; "0" - "9" / "A"-"Z" / "a"-"z"
# SPACE = %x20 ; space (" ")
# HYPHEN = %x2D ; hyphen ("-")
# DOT = %x2E ; period (".")
attributetype ( 0.9.2342.19200300.100.1.37
NAME 'associatedDomain'
DESC 'RFC1274: domain associated with object'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# RFC 2459 -- deprecated in favor of 'mail' (in cosine.schema)
attributetype ( 1.2.840.113549.1.9.1
NAME ( 'email' 'emailAddress' 'pkcs9email' )
DESC 'RFC3280: legacy attribute for email addresses in DNs'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} )

File diff suppressed because it is too large Load diff

View file

@ -1,155 +0,0 @@
# inetorgperson.schema -- InetOrgPerson (RFC2798)
# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
## Copyright 1998-2019 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
## Public License.
##
## A copy of this license is available in the file LICENSE in the
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.
#
# InetOrgPerson (RFC2798)
#
# Depends upon
# Definition of an X.500 Attribute Type and an Object Class to Hold
# Uniform Resource Identifiers (URIs) [RFC2079]
# (core.schema)
#
# A Summary of the X.500(96) User Schema for use with LDAPv3 [RFC2256]
# (core.schema)
#
# The COSINE and Internet X.500 Schema [RFC1274] (cosine.schema)
# carLicense
# This multivalued field is used to record the values of the license or
# registration plate associated with an individual.
attributetype ( 2.16.840.1.113730.3.1.1
NAME 'carLicense'
DESC 'RFC2798: vehicle license or registration plate'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
# departmentNumber
# Code for department to which a person belongs. This can also be
# strictly numeric (e.g., 1234) or alphanumeric (e.g., ABC/123).
attributetype ( 2.16.840.1.113730.3.1.2
NAME 'departmentNumber'
DESC 'RFC2798: identifies a department within an organization'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
# displayName
# When displaying an entry, especially within a one-line summary list, it
# is useful to be able to identify a name to be used. Since other attri-
# bute types such as 'cn' are multivalued, an additional attribute type is
# needed. Display name is defined for this purpose.
attributetype ( 2.16.840.1.113730.3.1.241
NAME 'displayName'
DESC 'RFC2798: preferred name to be used when displaying entries'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )
# employeeNumber
# Numeric or alphanumeric identifier assigned to a person, typically based
# on order of hire or association with an organization. Single valued.
attributetype ( 2.16.840.1.113730.3.1.3
NAME 'employeeNumber'
DESC 'RFC2798: numerically identifies an employee within an organization'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )
# employeeType
# Used to identify the employer to employee relationship. Typical values
# used will be "Contractor", "Employee", "Intern", "Temp", "External", and
# "Unknown" but any value may be used.
attributetype ( 2.16.840.1.113730.3.1.4
NAME 'employeeType'
DESC 'RFC2798: type of employment for a person'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
# jpegPhoto
# Used to store one or more images of a person using the JPEG File
# Interchange Format [JFIF].
# Note that the jpegPhoto attribute type was defined for use in the
# Internet X.500 pilots but no referencable definition for it could be
# located.
attributetype ( 0.9.2342.19200300.100.1.60
NAME 'jpegPhoto'
DESC 'RFC2798: a JPEG image'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.28 )
# preferredLanguage
# Used to indicate an individual's preferred written or spoken
# language. This is useful for international correspondence or human-
# computer interaction. Values for this attribute type MUST conform to
# the definition of the Accept-Language header field defined in
# [RFC2068] with one exception: the sequence "Accept-Language" ":"
# should be omitted. This is a single valued attribute type.
attributetype ( 2.16.840.1.113730.3.1.39
NAME 'preferredLanguage'
DESC 'RFC2798: preferred written or spoken language for a person'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )
# userSMIMECertificate
# A PKCS#7 [RFC2315] SignedData, where the content that is signed is
# ignored by consumers of userSMIMECertificate values. It is
# recommended that values have a `contentType' of data with an absent
# `content' field. Values of this attribute contain a person's entire
# certificate chain and an smimeCapabilities field [RFC2633] that at a
# minimum describes their SMIME algorithm capabilities. Values for
# this attribute are to be stored and requested in binary form, as
# 'userSMIMECertificate;binary'. If available, this attribute is
# preferred over the userCertificate attribute for S/MIME applications.
## OpenLDAP note: ";binary" transfer should NOT be used as syntax is binary
attributetype ( 2.16.840.1.113730.3.1.40
NAME 'userSMIMECertificate'
DESC 'RFC2798: PKCS#7 SignedData used to support S/MIME'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 )
# userPKCS12
# PKCS #12 [PKCS12] provides a format for exchange of personal identity
# information. When such information is stored in a directory service,
# the userPKCS12 attribute should be used. This attribute is to be stored
# and requested in binary form, as 'userPKCS12;binary'. The attribute
# values are PFX PDUs stored as binary data.
## OpenLDAP note: ";binary" transfer should NOT be used as syntax is binary
attributetype ( 2.16.840.1.113730.3.1.216
NAME 'userPKCS12'
DESC 'RFC2798: personal identity information, a PKCS #12 PFX'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 )
# inetOrgPerson
# The inetOrgPerson represents people who are associated with an
# organization in some way. It is a structural class and is derived
# from the organizationalPerson which is defined in X.521 [X521].
objectclass ( 2.16.840.1.113730.3.2.2
NAME 'inetOrgPerson'
DESC 'RFC2798: Internet Organizational Person'
SUP organizationalPerson
STRUCTURAL
MAY (
audio $ businessCategory $ carLicense $ departmentNumber $
displayName $ employeeNumber $ employeeType $ givenName $
homePhone $ homePostalAddress $ initials $ jpegPhoto $
labeledURI $ mail $ manager $ mobile $ o $ pager $
photo $ roomNumber $ secretary $ uid $ userCertificate $
x500uniqueIdentifier $ preferredLanguage $
userSMIMECertificate $ userPKCS12 )
)

View file

@ -1,88 +0,0 @@
## LDAP Schema Yunohost EMAIL
## Version 0.1
## Adrien Beudin
# Attributes
attributetype ( 1.3.6.1.4.1.40328.1.20.2.1
NAME 'maildrop'
DESC 'Mail addresses where mails are forwarded -- ie forwards'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{512})
attributetype ( 1.3.6.1.4.1.40328.1.20.2.2
NAME 'mailalias'
DESC 'Mail addresses accepted by this account -- ie aliases'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{512})
attributetype ( 1.3.6.1.4.1.40328.1.20.2.3
NAME 'mailenable'
DESC 'Mail Account validity'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{8})
attributetype ( 1.3.6.1.4.1.40328.1.20.2.4
NAME 'mailbox'
DESC 'Mailbox path where mails are delivered'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{512})
attributetype ( 1.3.6.1.4.1.40328.1.20.2.5
NAME 'virtualdomain'
DESC 'A mail domain name'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{512})
attributetype ( 1.3.6.1.4.1.40328.1.20.2.6
NAME 'virtualdomaindescription'
DESC 'Virtual domain description'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{512})
attributetype ( 1.3.6.1.4.1.40328.1.20.2.7
NAME 'mailuserquota'
DESC 'Mailbox quota for a user'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{16} SINGLE-VALUE )
# Mail Account Objectclass
objectclass ( 1.3.6.1.4.1.40328.1.1.2.1
NAME 'mailAccount'
DESC 'Mail Account'
SUP top
AUXILIARY
MUST (
mail
)
MAY (
mailalias $ maildrop $ mailenable $ mailbox $ mailuserquota
)
)
# Mail Domain Objectclass
objectclass ( 1.3.6.1.4.1.40328.1.1.2.2
NAME 'mailDomain'
DESC 'Domain mail entry'
SUP top
STRUCTURAL
MUST (
virtualdomain
)
MAY (
virtualdomaindescription $ mailuserquota
)
)
# Mail Group Objectclass
objectclass ( 1.3.6.1.4.1.40328.1.1.2.3
NAME 'mailGroup' SUP top AUXILIARY
DESC 'Mail Group'
MUST ( mail )
)

View file

@ -1,237 +0,0 @@
# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
## Copyright 1998-2019 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
## Public License.
##
## A copy of this license is available in the file LICENSE in the
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.
# Definitions from RFC2307 (Experimental)
# An Approach for Using LDAP as a Network Information Service
# Depends upon core.schema and cosine.schema
# Note: The definitions in RFC2307 are given in syntaxes closely related
# to those in RFC2252, however, some liberties are taken that are not
# supported by RFC2252. This file has been written following RFC2252
# strictly.
# OID Base is iso(1) org(3) dod(6) internet(1) directory(1) nisSchema(1).
# i.e. nisSchema in RFC2307 is 1.3.6.1.1.1
#
# Syntaxes are under 1.3.6.1.1.1.0 (two new syntaxes are defined)
# validaters for these syntaxes are incomplete, they only
# implement printable string validation (which is good as the
# common use of these syntaxes violates the specification).
# Attribute types are under 1.3.6.1.1.1.1
# Object classes are under 1.3.6.1.1.1.2
# Attribute Type Definitions
# builtin
#attributetype ( 1.3.6.1.1.1.1.0 NAME 'uidNumber'
# DESC 'An integer uniquely identifying a user in an administrative domain'
# EQUALITY integerMatch
# SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
# builtin
#attributetype ( 1.3.6.1.1.1.1.1 NAME 'gidNumber'
# DESC 'An integer uniquely identifying a group in an administrative domain'
# EQUALITY integerMatch
# SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.2 NAME 'gecos'
DESC 'The GECOS field; the common name'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.3 NAME 'homeDirectory'
DESC 'The absolute path to the home directory'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.4 NAME 'loginShell'
DESC 'The path to the login shell'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.5 NAME 'shadowLastChange'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.6 NAME 'shadowMin'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.7 NAME 'shadowMax'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.8 NAME 'shadowWarning'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.9 NAME 'shadowInactive'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.10 NAME 'shadowExpire'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.11 NAME 'shadowFlag'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.12 NAME 'memberUid'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.1.1.1.13 NAME 'memberNisNetgroup'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.1.1.1.14 NAME 'nisNetgroupTriple'
DESC 'Netgroup triple'
SYNTAX 1.3.6.1.1.1.0.0 )
attributetype ( 1.3.6.1.1.1.1.15 NAME 'ipServicePort'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.16 NAME 'ipServiceProtocol'
SUP name )
attributetype ( 1.3.6.1.1.1.1.17 NAME 'ipProtocolNumber'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.18 NAME 'oncRpcNumber'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.19 NAME 'ipHostNumber'
DESC 'IP address'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} )
attributetype ( 1.3.6.1.1.1.1.20 NAME 'ipNetworkNumber'
DESC 'IP network'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.21 NAME 'ipNetmaskNumber'
DESC 'IP netmask'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} SINGLE-VALUE )
attributetype ( 1.3.6.1.1.1.1.22 NAME 'macAddress'
DESC 'MAC address'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} )
attributetype ( 1.3.6.1.1.1.1.23 NAME 'bootParameter'
DESC 'rpc.bootparamd parameter'
SYNTAX 1.3.6.1.1.1.0.1 )
attributetype ( 1.3.6.1.1.1.1.24 NAME 'bootFile'
DESC 'Boot image name'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.1.1.1.26 NAME 'nisMapName'
SUP name )
attributetype ( 1.3.6.1.1.1.1.27 NAME 'nisMapEntry'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{1024} SINGLE-VALUE )
# Object Class Definitions
objectclass ( 1.3.6.1.1.1.2.0 NAME 'posixAccount'
DESC 'Abstraction of an account with POSIX attributes'
SUP top AUXILIARY
MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory )
MAY ( userPassword $ loginShell $ gecos $ description ) )
objectclass ( 1.3.6.1.1.1.2.1 NAME 'shadowAccount'
DESC 'Additional attributes for shadow passwords'
SUP top AUXILIARY
MUST uid
MAY ( userPassword $ shadowLastChange $ shadowMin $
shadowMax $ shadowWarning $ shadowInactive $
shadowExpire $ shadowFlag $ description ) )
objectclass ( 1.3.6.1.1.1.2.2 NAME 'posixGroup'
DESC 'Abstraction of a group of accounts'
SUP top STRUCTURAL
MUST ( cn $ gidNumber )
MAY ( userPassword $ memberUid $ description ) )
objectclass ( 1.3.6.1.1.1.2.3 NAME 'ipService'
DESC 'Abstraction an Internet Protocol service'
SUP top STRUCTURAL
MUST ( cn $ ipServicePort $ ipServiceProtocol )
MAY ( description ) )
objectclass ( 1.3.6.1.1.1.2.4 NAME 'ipProtocol'
DESC 'Abstraction of an IP protocol'
SUP top STRUCTURAL
MUST ( cn $ ipProtocolNumber $ description )
MAY description )
objectclass ( 1.3.6.1.1.1.2.5 NAME 'oncRpc'
DESC 'Abstraction of an ONC/RPC binding'
SUP top STRUCTURAL
MUST ( cn $ oncRpcNumber $ description )
MAY description )
objectclass ( 1.3.6.1.1.1.2.6 NAME 'ipHost'
DESC 'Abstraction of a host, an IP device'
SUP top AUXILIARY
MUST ( cn $ ipHostNumber )
MAY ( l $ description $ manager ) )
objectclass ( 1.3.6.1.1.1.2.7 NAME 'ipNetwork'
DESC 'Abstraction of an IP network'
SUP top STRUCTURAL
MUST ( cn $ ipNetworkNumber )
MAY ( ipNetmaskNumber $ l $ description $ manager ) )
objectclass ( 1.3.6.1.1.1.2.8 NAME 'nisNetgroup'
DESC 'Abstraction of a netgroup'
SUP top STRUCTURAL
MUST cn
MAY ( nisNetgroupTriple $ memberNisNetgroup $ description ) )
objectclass ( 1.3.6.1.1.1.2.9 NAME 'nisMap'
DESC 'A generic abstraction of a NIS map'
SUP top STRUCTURAL
MUST nisMapName
MAY description )
objectclass ( 1.3.6.1.1.1.2.10 NAME 'nisObject'
DESC 'An entry in a NIS map'
SUP top STRUCTURAL
MUST ( cn $ nisMapEntry $ nisMapName )
MAY description )
objectclass ( 1.3.6.1.1.1.2.11 NAME 'ieee802Device'
DESC 'A device with a MAC address'
SUP top AUXILIARY
MAY macAddress )
objectclass ( 1.3.6.1.1.1.2.12 NAME 'bootableDevice'
DESC 'A device with boot parameters'
SUP top AUXILIARY
MAY ( bootFile $ bootParameter ) )

View file

@ -1,76 +0,0 @@
#
# OpenLDAP schema file for Sudo
# Save as /etc/openldap/schema/sudo.schema
#
attributetype ( 1.3.6.1.4.1.15953.9.1.1
NAME 'sudoUser'
DESC 'User(s) who may run sudo'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.15953.9.1.2
NAME 'sudoHost'
DESC 'Host(s) who may run sudo'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.15953.9.1.3
NAME 'sudoCommand'
DESC 'Command(s) to be executed by sudo'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.15953.9.1.4
NAME 'sudoRunAs'
DESC 'User(s) impersonated by sudo (deprecated)'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.15953.9.1.5
NAME 'sudoOption'
DESC 'Options(s) followed by sudo'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.15953.9.1.6
NAME 'sudoRunAsUser'
DESC 'User(s) impersonated by sudo'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.15953.9.1.7
NAME 'sudoRunAsGroup'
DESC 'Group(s) impersonated by sudo'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.15953.9.1.8
NAME 'sudoNotBefore'
DESC 'Start of time interval for which the entry is valid'
EQUALITY generalizedTimeMatch
ORDERING generalizedTimeOrderingMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )
attributetype ( 1.3.6.1.4.1.15953.9.1.9
NAME 'sudoNotAfter'
DESC 'End of time interval for which the entry is valid'
EQUALITY generalizedTimeMatch
ORDERING generalizedTimeOrderingMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )
attributeTypes ( 1.3.6.1.4.1.15953.9.1.10
NAME 'sudoOrder'
DESC 'an integer to order the sudoRole entries'
EQUALITY integerMatch
ORDERING integerOrderingMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
objectclass ( 1.3.6.1.4.1.15953.9.2.1 NAME 'sudoRole' SUP top STRUCTURAL
DESC 'Sudoer Entries'
MUST ( cn )
MAY ( sudoUser $ sudoHost $ sudoCommand $ sudoRunAs $ sudoRunAsUser $ sudoRunAsGroup $ sudoOption $ sudoOrder $ sudoNotBefore $ sudoNotAfter $
description )
)

View file

@ -1,33 +0,0 @@
#dn: cn=yunohost,cn=schema,cn=config
#objectClass: olcSchemaConfig
#cn: yunohost
# ATTRIBUTES
# For Permission
attributetype ( 1.3.6.1.4.1.17953.9.1.1 NAME 'permission'
DESC 'Yunohost permission on user and group side'
SUP distinguishedName )
attributetype ( 1.3.6.1.4.1.17953.9.1.2 NAME 'groupPermission'
DESC 'Yunohost permission for a group on permission side'
SUP distinguishedName )
attributetype ( 1.3.6.1.4.1.17953.9.1.3 NAME 'inheritPermission'
DESC 'Yunohost permission for user on permission side'
SUP distinguishedName )
attributetype ( 1.3.6.1.4.1.17953.9.1.4 NAME 'URL'
DESC 'Yunohost application URL'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
# OBJECTCLASS
# For Applications
objectclass ( 1.3.6.1.4.1.17953.9.2.1 NAME 'groupOfNamesYnh'
DESC 'Yunohost user group'
SUP top AUXILIARY
MAY ( member $ businessCategory $ seeAlso $ owner $ ou $ o $ permission ) )
objectclass ( 1.3.6.1.4.1.17953.9.2.2 NAME 'permissionYnh'
DESC 'a Yunohost application'
SUP top AUXILIARY
MUST cn
MAY ( groupPermission $ inheritPermission $ URL ) )
# For User
objectclass ( 1.3.6.1.4.1.17953.9.2.3 NAME 'userPermissionYnh'
DESC 'a Yunohost application'
SUP top AUXILIARY
MAY ( permission ) )

View file

@ -1,94 +0,0 @@
serverID %(serverid)s
moduleload back_%(database)s
moduleload memberof
%(include_directives)s
loglevel %(loglevel)s
#allow bind_v2
database %(database)s
directory "%(directory)s"
suffix "%(suffix)s"
rootdn "%(rootdn)s"
rootpw "%(rootpw)s"
TLSCACertificateFile "%(cafile)s"
TLSCertificateFile "%(servercert)s"
TLSCertificateKeyFile "%(serverkey)s"
authz-regexp
"gidnumber=%(root_gid)s\\+uidnumber=%(root_uid)s,cn=peercred,cn=external,cn=auth"
"%(rootdn)s"
index objectClass eq
index uid,sudoUser eq,sub
index entryCSN,entryUUID eq
index cn,mail eq
index gidNumber,uidNumber eq
index member,memberUid,uniqueMember eq
index virtualdomain eq
# The userPassword by default can be changed
# by the entry owning it if they are authenticated.
# Others should not be able to see it, except the
# admin entry below
# These access lines apply to database #1 only
access to attrs=userPassword,shadowLastChange
by dn="cn=admin,dc=yunohost,dc=org" write
by dn.exact="gidNumber=%(root_gid)s+uidnumber=%(root_uid)s,cn=peercred,cn=external,cn=auth" write
by anonymous auth
by self write
by * none
# Personnal information can be changed by the entry
# owning it if they are authenticated.
# Others should be able to see it.
access to attrs=cn,gecos,givenName,mail,maildrop,displayName,sn
by dn="cn=admin,dc=yunohost,dc=org" write
by dn.exact="gidNumber=%(root_gid)s+uidnumber=%(root_uid)s,cn=peercred,cn=external,cn=auth" write
by self write
by * read
# Ensure read access to the base for things like
# supportedSASLMechanisms. Without this you may
# have problems with SASL not knowing what
# mechanisms are available and the like.
# Note that this is covered by the 'access to *'
# ACL below too but if you change that as people
# are wont to do you'll still need this if you
# want SASL (and possible ldap_files things) to work
# happily.
access to dn.base="" by * read
# The admin dn has full write access, everyone else
# can read everything.
access to *
by dn="cn=admin,dc=yunohost,dc=org" write
by dn.exact="gidNumber=%(root_gid)s+uidnumber=%(root_uid)s,cn=peercred,cn=external,cn=auth" write
by group/groupOfNames/Member="cn=admin,ou=groups,dc=yunohost,dc=org" write
by * read
# Configure Memberof Overlay (used for Yunohost permission)
# Link user <-> group
#dn: olcOverlay={0}memberof,olcDatabase={1}mdb,cn=config
overlay memberof
memberof-group-oc groupOfNamesYnh
memberof-member-ad member
memberof-memberof-ad memberOf
memberof-dangling error
memberof-refint TRUE
# Link permission <-> groupes
#dn: olcOverlay={1}memberof,olcDatabase={1}mdb,cn=config
overlay memberof
memberof-group-oc permissionYnh
memberof-member-ad groupPermission
memberof-memberof-ad permission
memberof-dangling error
memberof-refint TRUE
# Link permission <-> user
#dn: olcOverlay={2}memberof,olcDatabase={1}mdb,cn=config
overlay memberof
memberof-group-oc permissionYnh
memberof-member-ad inheritPermission
memberof-memberof-ad permission
memberof-dangling error
memberof-refint TRUE

View file

@ -1,205 +0,0 @@
dn: dc=yunohost,dc=org
dc: yunohost
o: yunohost.org
objectclass: top
objectclass: dcObject
objectclass: organization
dn: cn=admin,dc=yunohost,dc=org
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
userPassword: yunohost
#dn: ou=people,dc=yunohost,dc=org
#objectClass: organizationalUnit
#ou: people
#
#dn: ou=moregroups,dc=yunohost,dc=org
#objectClass: organizationalUnit
#ou: moregroups
#
#dn: ou=mirror_groups,dc=yunohost,dc=org
#objectClass: organizationalUnit
#ou: mirror_groups
#
#
#dn: uid=alice,ou=people,dc=yunohost,dc=org
#objectClass: person
#objectClass: organizationalPerson
#objectClass: inetOrgPerson
#objectClass: posixAccount
#cn: alice
#uid: alice
#userPassword: password
#uidNumber: 1000
#gidNumber: 1000
#givenName: Alice
#sn: Adams
#homeDirectory: /home/alice
#
#dn: uid=bob,ou=people,dc=yunohost,dc=org
#objectClass: person
#objectClass: organizationalPerson
#objectClass: inetOrgPerson
#objectClass: posixAccount
#cn: bob
#uid: bob
#userPassword: password
#uidNumber: 1001
#gidNumber: 50
#givenName: Robert
#sn: Barker
#homeDirectory: /home/bob
#
#dn: uid=dreßler,ou=people,dc=yunohost,dc=org
#objectClass: person
#objectClass: organizationalPerson
#objectClass: inetOrgPerson
#objectClass: posixAccount
#cn: dreßler
#uid: dreßler
#userPassword: password
#uidNumber: 1002
#gidNumber: 50
#givenName: Wolfgang
#sn: Dreßler
#homeDirectory: /home/dressler
#
#dn: uid=nobody,ou=people,dc=yunohost,dc=org
#objectClass: person
#objectClass: organizationalPerson
#objectClass: inetOrgPerson
#objectClass: posixAccount
#cn: nobody
#uid: nobody
#userPassword: password
#uidNumber: 1003
#gidNumber: 50
#sn: nobody
#homeDirectory: /home/nobody
#
#dn: uid=nonposix,ou=people,dc=yunohost,dc=org
#objectClass: person
#objectClass: organizationalPerson
#objectClass: inetOrgPerson
#cn: nonposix
#uid: nonposix
#userPassword: password
#sn: nonposix
#
#
## posixGroup objects
#dn: cn=active_px,ou=moregroups,dc=yunohost,dc=org
#objectClass: posixGroup
#cn: active_px
#gidNumber: 1000
#memberUid: nonposix
#
#dn: cn=staff_px,ou=moregroups,dc=yunohost,dc=org
#objectClass: posixGroup
#cn: staff_px
#gidNumber: 1001
#memberUid: alice
#memberUid: nonposix
#
#dn: cn=superuser_px,ou=moregroups,dc=yunohost,dc=org
#objectClass: posixGroup
#cn: superuser_px
#gidNumber: 1002
#memberUid: alice
#memberUid: nonposix
#
#
## groupOfNames groups
#dn: cn=empty_gon,ou=moregroups,dc=yunohost,dc=org
#cn: empty_gon
#objectClass: groupOfNames
#member:
#
#dn: cn=active_gon,ou=moregroups,dc=yunohost,dc=org
#cn: active_gon
#objectClass: groupOfNames
#member: uid=alice,ou=people,dc=yunohost,dc=org
#
#dn: cn=staff_gon,ou=moregroups,dc=yunohost,dc=org
#cn: staff_gon
#objectClass: groupOfNames
#member: uid=alice,ou=people,dc=yunohost,dc=org
#
#dn: cn=superuser_gon,ou=moregroups,dc=yunohost,dc=org
#cn: superuser_gon
#objectClass: groupOfNames
#member: uid=alice,ou=people,dc=yunohost,dc=org
#
#dn: cn=other_gon,ou=moregroups,dc=yunohost,dc=org
#cn: other_gon
#objectClass: groupOfNames
#member: uid=bob,ou=people,dc=yunohost,dc=org
#
#
## groupOfNames objects for LDAPGroupQuery testing
#dn: ou=query_groups,dc=yunohost,dc=org
#objectClass: organizationalUnit
#ou: query_groups
#
#dn: cn=alice_gon,ou=query_groups,dc=yunohost,dc=org
#cn: alice_gon
#objectClass: groupOfNames
#member: uid=alice,ou=people,dc=yunohost,dc=org
#
#dn: cn=mutual_gon,ou=query_groups,dc=yunohost,dc=org
#cn: mutual_gon
#objectClass: groupOfNames
#member: uid=alice,ou=people,dc=yunohost,dc=org
#member: uid=bob,ou=people,dc=yunohost,dc=org
#
#dn: cn=bob_gon,ou=query_groups,dc=yunohost,dc=org
#cn: bob_gon
#objectClass: groupOfNames
#member: uid=bob,ou=people,dc=yunohost,dc=org
#
#dn: cn=dreßler_gon,ou=query_groups,dc=yunohost,dc=org
#cn: dreßler_gon
#objectClass: groupOfNames
#member: uid=dreßler,ou=people,dc=yunohost,dc=org
#
#
## groupOfNames objects for selective group mirroring.
#dn: cn=mirror1,ou=mirror_groups,dc=yunohost,dc=org
#cn: mirror1
#objectClass: groupOfNames
#member: uid=alice,ou=people,dc=yunohost,dc=org
#
#dn: cn=mirror2,ou=mirror_groups,dc=yunohost,dc=org
#cn: mirror2
#objectClass: groupOfNames
#member:
#
#dn: cn=mirror3,ou=mirror_groups,dc=yunohost,dc=org
#cn: mirror3
#objectClass: groupOfNames
#member: uid=alice,ou=people,dc=yunohost,dc=org
#
#dn: cn=mirror4,ou=mirror_groups,dc=yunohost,dc=org
#cn: mirror4
#objectClass: groupOfNames
#member:
#
#
## Nested groups with a circular reference
#dn: cn=parent_gon,ou=moregroups,dc=yunohost,dc=org
#cn: parent_gon
#objectClass: groupOfNames
#member: cn=nested_gon,ou=moregroups,dc=yunohost,dc=org
#
#dn: CN=nested_gon,ou=moregroups,dc=yunohost,dc=org
#cn: nested_gon
#objectClass: groupOfNames
#member: uid=alice,ou=people,dc=yunohost,dc=org
#member: cn=circular_gon,ou=moregroups,dc=yunohost,dc=org
#
#dn: cn=circular_gon,ou=moregroups,dc=yunohost,dc=org
#cn: circular_gon
#objectClass: groupOfNames
#member: cn=parent_gon,ou=moregroups,dc=yunohost,dc=org

59
test/reformat_locales.py Normal file
View file

@ -0,0 +1,59 @@
import re
def reformat(lang, transformations):
locale = open(f"locales/{lang}.json").read()
for pattern, replace in transformations.items():
locale = re.compile(pattern).sub(replace, locale)
open(f"locales/{lang}.json", "w").write(locale)
######################################################
godamn_spaces_of_hell = [
"\u00a0",
"\u2000",
"\u2001",
"\u2002",
"\u2003",
"\u2004",
"\u2005",
"\u2006",
"\u2007",
"\u2008",
"\u2009",
"\u200A",
# "\u202f",
# "\u202F",
"\u3000",
]
transformations = {s: " " for s in godamn_spaces_of_hell}
transformations.update(
{
"": "...",
}
)
reformat("en", transformations)
######################################################
transformations.update(
{
"courriel": "email",
"e-mail": "email",
"Courriel": "Email",
"E-mail": "Email",
"« ": "'",
"«": "'",
" »": "'",
"»": "'",
"": "'",
# r"$(\w{1,2})'|( \w{1,2})'": r"\1\2",
}
)
reformat("fr", transformations)

View file

@ -0,0 +1,24 @@
import json
import glob
from collections import OrderedDict
locale_folder = "locales/"
locale_files = glob.glob(locale_folder + "*.json")
locale_files = [filename.split("/")[-1] for filename in locale_files]
locale_files.remove("en.json")
reference = json.loads(open(locale_folder + "en.json").read())
for locale_file in locale_files:
print(locale_file)
this_locale = json.loads(
open(locale_folder + locale_file).read(), object_pairs_hook=OrderedDict
)
this_locale_fixed = {k: v for k, v in this_locale.items() if k in reference}
json.dump(
this_locale_fixed,
open(locale_folder + locale_file, "w"),
indent=4,
ensure_ascii=False,
)

View file

@ -0,0 +1,70 @@
# -*- coding: utf-8 -*-
import logging
from moulinette.utils.text import random_ascii
from moulinette.core import MoulinetteError, MoulinetteAuthenticationError
from moulinette.authentication import BaseAuthenticator
logger = logging.getLogger("moulinette.authenticator.yoloswag")
# Dummy authenticator implementation
session_secret = random_ascii()
class Authenticator(BaseAuthenticator):
"""Dummy authenticator used for tests"""
name = "dummy"
def __init__(self, *args, **kwargs):
pass
def _authenticate_credentials(self, credentials=None):
if not credentials == self.name:
raise MoulinetteError("invalid_password", raw_msg=True)
return
def set_session_cookie(self, infos):
from bottle import response
assert isinstance(infos, dict)
# This allows to generate a new session id or keep the existing one
current_infos = self.get_session_cookie(raise_if_no_session_exists=False)
new_infos = {"id": current_infos["id"]}
new_infos.update(infos)
response.set_cookie(
"moulitest",
new_infos,
secure=True,
secret=session_secret,
httponly=True,
# samesite="strict", # Bottle 0.12 doesn't support samesite, to be added in next versions
)
def get_session_cookie(self, raise_if_no_session_exists=True):
from bottle import request
try:
infos = request.get_cookie("moulitest", secret=session_secret, default={})
except Exception:
if not raise_if_no_session_exists:
return {"id": random_ascii()}
raise MoulinetteAuthenticationError("unable_authenticate")
if not infos and raise_if_no_session_exists:
raise MoulinetteAuthenticationError("unable_authenticate")
if "id" not in infos:
infos["id"] = random_ascii()
return infos
def delete_session_cookie(self):
from bottle import response
response.set_cookie("moulitest", "", max_age=-1)
response.delete_cookie("moulitest")

View file

@ -0,0 +1,70 @@
# -*- coding: utf-8 -*-
import logging
from moulinette.utils.text import random_ascii
from moulinette.core import MoulinetteError, MoulinetteAuthenticationError
from moulinette.authentication import BaseAuthenticator
logger = logging.getLogger("moulinette.authenticator.yoloswag")
# Dummy authenticator implementation
session_secret = random_ascii()
class Authenticator(BaseAuthenticator):
"""Dummy authenticator used for tests"""
name = "yoloswag"
def __init__(self, *args, **kwargs):
pass
def _authenticate_credentials(self, credentials=None):
if not credentials == self.name:
raise MoulinetteError("invalid_password", raw_msg=True)
return
def set_session_cookie(self, infos):
from bottle import response
assert isinstance(infos, dict)
# This allows to generate a new session id or keep the existing one
current_infos = self.get_session_cookie(raise_if_no_session_exists=False)
new_infos = {"id": current_infos["id"]}
new_infos.update(infos)
response.set_cookie(
"moulitest",
new_infos,
secure=True,
secret=session_secret,
httponly=True,
# samesite="strict", # Bottle 0.12 doesn't support samesite, to be added in next versions
)
def get_session_cookie(self, raise_if_no_session_exists=True):
from bottle import request
try:
infos = request.get_cookie("moulitest", secret=session_secret, default={})
except Exception:
if not raise_if_no_session_exists:
return {"id": random_ascii()}
raise MoulinetteAuthenticationError("unable_authenticate")
if not infos and raise_if_no_session_exists:
raise MoulinetteAuthenticationError("unable_authenticate")
if "id" not in infos:
infos["id"] = random_ascii()
return infos
def delete_session_cookie(self):
from bottle import response
response.set_cookie("moulitest", "", max_age=-1)
response.delete_cookie("moulitest")

Some files were not shown because too many files have changed in this diff Show more