Small updates

This commit is contained in:
Antoine Nguyen
2026-01-13 17:41:31 +01:00
committed by Christophe Chauvet
parent 88ff877ad3
commit a0c4bc8241
5 changed files with 96 additions and 133 deletions
+69 -59
View File
@@ -5,81 +5,91 @@ export default defineConfig({
// Use Canonical URL, but only the path and with no trailing /
// End result is like: `/en/latest`
// https://docs.readthedocs.com/platform/stable/intro/vitepress.html#using-the-proper-base-path
base: process.env.READTHEDOCS_CANONICAL_URL ? new URL(process.env.READTHEDOCS_CANONICAL_URL).pathname.replace(/\/$/, "") : "",
title: "Modoboa Documentation ",
base: process.env.READTHEDOCS_CANONICAL_URL
? new URL(process.env.READTHEDOCS_CANONICAL_URL).pathname.replace(/\/$/, '')
: '',
title: 'Modoboa Documentation ',
titleTemplate: ':title',
description: "Modoboa documentation",
description: 'Modoboa documentation',
srcExclude: ['public/**/*.md'],
ignoreDeadLinks: [
/^https?:\/\/localhost:*/,
],
ignoreDeadLinks: [/^https?:\/\/localhost:*/],
metaChunk: true,
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Installation', items: [
{ text: 'Requirements', link: '/installation/requirements'},
{ text: 'Manual Installation', link: '/installation/manual'},
{ text: 'Modoboa Installer', link: '/installation/installer' },
{ text: 'Upgrade Instance', link: '/installation/upgrade' },
{ text: 'Configuration', link: '/configuration' },
]},
{ text: 'Contributing', items: [
{ text: 'Getting Start', link: '/contributing/getting_start'},
{ text: 'Write Plugin', link: '/contributing/plugin_api'},
{ text: 'Translate', link: '/contributing/translation'},
{ text: 'Contributor', link: '/contributors'},
]}
{
text: 'Installation',
items: [
{ text: 'Requirements', link: '/installation/requirements' },
{ text: 'Manual Installation', link: '/installation/manual' },
{ text: 'Modoboa Installer', link: '/installation/installer' },
{ text: 'Upgrade Instance', link: '/installation/upgrade' },
{ text: 'Configuration', link: '/configuration' },
],
},
{
text: 'Contributing',
items: [
{ text: 'Getting Started', link: '/contributing/getting_start' },
{ text: 'Write a Plugin', link: '/contributing/plugin_api' },
{ text: 'Translate', link: '/contributing/translation' },
{ text: 'Contributors', link: '/contributors' },
],
},
],
sidebar: {
"/installation/": [{
text: 'Manual',
items: [
{ text: 'Modoboa', link: '/installation/modoboa' },
{ text: 'WebServer', link: '/installation/webserver' },
{ text: 'Dovecot', link: '/installation/dovecot' },
{ text: 'Postfix', link: '/installation/postfix' },
{ text: 'OpenDKIM', link: '/installation/opendkim' },
{ text: 'Radicale', link: '/installation/radicale' },
{ text: 'Amavis', link: '/installation/amavis' },
]
},
{
text: 'Automatic',
items: [
{ text: 'Modoboa Installer', link: '/installation/installer' },
]
}],
"/contributing/": [
{ text: 'Getting Start', link: '/contributing/getting_start'},
{ text: 'Write Plugin', link: '/contributing/plugin_api'},
{ text: 'Translate', link: '/contributing/translate'},
]
} ,
'/installation/': [
{
text: 'Manual',
items: [
{ text: 'Modoboa', link: '/installation/modoboa' },
{ text: 'WebServer', link: '/installation/webserver' },
{ text: 'Dovecot', link: '/installation/dovecot' },
{ text: 'Postfix', link: '/installation/postfix' },
{ text: 'OpenDKIM', link: '/installation/opendkim' },
{ text: 'Radicale', link: '/installation/radicale' },
{ text: 'Amavis', link: '/installation/amavis' },
],
},
{
text: 'Automatic',
items: [
{ text: 'Modoboa Installer', link: '/installation/installer' },
],
},
],
'/contributing/': [
{ text: 'Getting Started', link: '/contributing/getting_start' },
{ text: 'Write a Plugin', link: '/contributing/plugin_api' },
{ text: 'Translate', link: '/contributing/translate' },
],
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/modoboa/modoboa' },
{ icon: 'discord', link: 'https://discord.gg/WuQ3v3PXGR'},
{ icon: 'twitter', link: 'https://modoboa.org/'},
{ icon: {
svg: `<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
{ icon: 'discord', link: 'https://discord.gg/WuQ3v3PXGR' },
{
icon: {
svg: `<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<title>Transifex</title>
<path d="m20.073 12.851-2.758-2.757 3.722-3.659a.33.33 0 0 1 .467.003l2.27 2.309a.33.33 0 0 1-.004.468zm0 0h-.001zm-9.04-6.433 12.87 12.869c.129.13.129.34 0 .469l-2.289 2.289a.331.331 0 0 1-.468 0l-5.168-5.168-2.863 2.815c-.604.593-1.244 1.159-1.975 1.591a7.037 7.037 0 0 1-2.248.83c-2.191.42-4.557-.047-6.303-1.468A7.065 7.065 0 0 1 0 15.207V2.069a.33.33 0 0 1 .331-.33h3.237a.33.33 0 0 1 .331.33v4.125H6.65c.178 0 .323.145.323.323v3.617a.323.323 0 0 1-.323.323H3.899v4.75c0 1.272.808 2.429 1.988 2.893.753.295 1.617.321 2.397.131.852-.206 1.484-.717 2.097-1.319l2.839-2.792-4.945-4.945a.331.331 0 0 1 0-.468l2.289-2.289a.333.333 0 0 1 .469 0"/>
</svg>`
}, link: 'https://app.transifex.com/tonio/modoboa/dashboard/' },
{ icon: 'linkedin', link: 'https://www.linkedin.com/company/102575109'},
</svg>`,
},
link: 'https://app.transifex.com/tonio/modoboa/dashboard/',
},
{ icon: 'linkedin', link: 'https://www.linkedin.com/company/102575109' },
],
footer: {
message: 'Build with Vitepress',
copyright: `Copyright © 2010-${new Date().getUTCFullYear()} Antoine Nguyen`
copyright: `Copyright © 2010-${new Date().getUTCFullYear()} Antoine Nguyen`,
},
outline: {
label: "Summmary"
label: 'Summmary',
},
docFooter: {
prev: false,
next: false
next: false,
},
search: {
provider: 'local',
@@ -88,18 +98,18 @@ export default defineConfig({
text: 'Update at',
formatOptions: {
dateStyle: 'full',
timeStyle: 'short'
}
}
timeStyle: 'short',
},
},
},
sitemap: {
hostname: 'https://modoboa.readthedocs.io/en/latest'
hostname: 'https://modoboa.readthedocs.io/en/latest',
},
markdown: {
lineNumbers: true,
image: {
lazyLoading: true
}
lazyLoading: true,
},
},
cleanUrls: true,
outDir: './dist',
+8 -67
View File
@@ -2,7 +2,7 @@
## Introduction
Modoboa offers a plugin API to expand its capabilities.
Modoboa offers a plugin API to expand its capabilities.
The current implementation provides the following possibilities:
@@ -12,7 +12,7 @@ The current implementation provides the following possibilities:
::: tip
Plugins are nothing more than Django applications with an extra piece of
code that integrates them into Modoboa.
code that integrates them into Modoboa.
:::
The `modo_extension.py` file will contain a complete description of the plugin:
@@ -20,7 +20,7 @@ The `modo_extension.py` file will contain a complete description of the plugin:
- Admin and user parameters
- Custom menu entries
The communication between both applications is provided by
The communication between both applications is provided by
[Django signals](https://docs.djangoproject.com/en/5.2/topics/signals/).
The following subsections describe the plugin architecture and explain
@@ -56,7 +56,7 @@ class MyExtension(ModoExtension):
"""This method is called when Modoboa loads available and activated plugins.
Declare parameters and register events here.
"""
"""
pass
def load_initial_data(self):
@@ -66,8 +66,8 @@ class MyExtension(ModoExtension):
exts_pool.register_extension(MyExtension)
```
Once done, simply add your extension's module name to the `MODOBOA_APPS`
variable located inside `settings.py`.
Once done, simply add your extension's module name to the `MODOBOA_APPS`
variable located inside `settings.py`.
Finally, run the following commands:
@@ -88,7 +88,7 @@ A plugin can declare its own parameters. There are two levels available:
#### Playing with parameters
Parameters are defined using [Django forms](https://docs.djangoproject.com/en/1.9/topics/forms/)
Parameters are defined using [Django forms](https://docs.djangoproject.com/en/1.9/topics/forms/)
and Modoboa adds two special forms you can inherit depending on the level of parameter(s) you want to add:
* `modoboa.parameters.forms.AdminParametersForm`: for general parameters
@@ -106,7 +106,7 @@ Replace:
### Custom role permissions
Modoboa uses Django's internal permission system.
Modoboa uses Django's internal permission system.
Administrative roles are nothing more than groups (`Group` instances).
@@ -132,62 +132,3 @@ def extra_role_permissions(sender, role, **kwargs):
"""Add permissions to the Resellers group."""
return constants.PERMISSIONS.get(role, [])
```
### Extending admin forms
The forms used to edit objects (account, domain, etc.) through the admin panel are composed of tabs.
You can extend them (ie. add new tabs) in a pretty easy way thanks to custom signals.
#### Account
To add a new tab to the account edition form, define new listeners
(handlers) for the following signals:
* `modoboa.admin.signals.extra_account_forms`
* `modoboa.admin.signals.get_account_form_instances`
* `modoboa.admin.signals.check_extra_account_form` (optional)
Example:
``` python
from django.dispatch import receiver
from modoboa.admin import signals as admin_signals
@receiver(admin_signals.extra_account_forms)
def extra_account_form(sender, user, account, **kwargs):
return [
{"id": "tabid", "title": "Title", "cls": MyFormClass}
]
@receiver(admin_signals.get_account_form_instances)
def fill_my_tab(sender, user, account, **kwargs):
return {"id": my_instance}
```
#### Domain
To add a new tab to the domain edition form, define new listeners
(handlers) for the following signals:
* `modoboa.admin.signals.extra_domain_forms`
* `modoboa.admin.signals.get_domain_form_instances`
Example:
``` python
from django.dispatch import receiver
from modoboa.admin import signals as admin_signals
@receiver(admin_signals.extra_domain_forms)
def extra_account_form(sender, user, domain, **kwargs):
return [
{"id": "tabid", "title": "Title", "cls": MyFormClass}
]
@receiver(admin_signals.get_domain_form_instances)
def fill_my_tab(sender, user, domain, **kwargs):
return {"id": my_instance}
```
+13 -2
View File
@@ -7,6 +7,17 @@ The project is using Transifex. To start with translation, you will need
to create an account and join [modoboa\'s
team](https://app.transifex.com/tonio/modoboa/dashboard/)
## API
Modoboa API code relies on Django's translation system.
To update translation files after a change to the code, execute the following commands:
```shell
$ cd modoboa
$ django-admin makemessages -a
```
## Frontend
When editing the frontend, you may need to update localization files for
@@ -16,5 +27,5 @@ To do so, after finishing editing, go to the frontend directory and run
the following command:
```shell
$ make makemessages
```
$ yarn gettext:extract
```
+1
View File
@@ -1,5 +1,6 @@
# Contributors
- [6clones](https://www.6clones.fr/)
- [Antidot](http://antidot.com)
- [Bearstech](http://bearstech.com)
- [CAP-REL](https://cap-rel.fr/)
+5 -5
View File
@@ -2,11 +2,11 @@
You will need a Server to perform well with at least:
- CPU: 2
- RAM: 2GB
- CPU: 4
- RAM: 4GB
- Disk: 10GB
- Python 3.8+
- Postgres 12+ or MariaDB 10.4+ or MySQL 8+ or sqlite3 or LDAP
- Python 3.10+
- Postgres 14+ or MariaDB 10.5+ or MySQL 8.0.11+ or sqlite3
::: warning
@@ -23,4 +23,4 @@ RAM.
You have 2 possibilities to install Modoboa
* [Manual Installation](manual)
* [Automatic Install](installer)
* [Automatic Install](installer)