Add Cloudron packaging for Maubot
This commit is contained in:
6
maubot-src/maubot/cli/res/config.yaml
Normal file
6
maubot-src/maubot/cli/res/config.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
example_1: Example value 1
|
||||
example_2:
|
||||
list:
|
||||
- foo
|
||||
- bar
|
||||
value: asd
|
||||
42
maubot-src/maubot/cli/res/maubot.yaml.j2
Normal file
42
maubot-src/maubot/cli/res/maubot.yaml.j2
Normal file
@@ -0,0 +1,42 @@
|
||||
# The unique ID for the plugin. Java package naming style. (i.e. use your own domain, not xyz.maubot)
|
||||
id: {{ id }}
|
||||
|
||||
# A PEP 440 compliant version string.
|
||||
version: {{ version }}
|
||||
|
||||
# The SPDX license identifier for the plugin. https://spdx.org/licenses/
|
||||
# Optional, assumes all rights reserved if omitted.
|
||||
{% if license %}
|
||||
license: {{ license }}
|
||||
{% else %}
|
||||
#license: null
|
||||
{% endif %}
|
||||
|
||||
# The list of modules to load from the plugin archive.
|
||||
# Modules can be directories with an __init__.py file or simply python files.
|
||||
# Submodules that are imported by modules listed here don't need to be listed separately.
|
||||
# However, top-level modules must always be listed even if they're imported by other modules.
|
||||
modules:
|
||||
- {{ name }}
|
||||
|
||||
# The main class of the plugin. Format: module/Class
|
||||
# If `module` is omitted, will default to last module specified in the module list.
|
||||
# Even if `module` is not omitted here, it must be included in the modules list.
|
||||
# The main class must extend maubot.Plugin
|
||||
main_class: {{ main_class }}
|
||||
|
||||
# Extra files that the upcoming build tool should include in the mbp file.
|
||||
{% if config %}
|
||||
extra_files:
|
||||
- base-config.yaml
|
||||
{% else %}
|
||||
#extra_files:
|
||||
#- base-config.yaml
|
||||
{% endif %}
|
||||
|
||||
# List of dependencies
|
||||
#dependencies:
|
||||
#- foo
|
||||
|
||||
#soft_dependencies:
|
||||
#- bar>=0.1
|
||||
27
maubot-src/maubot/cli/res/plugin.py.j2
Normal file
27
maubot-src/maubot/cli/res/plugin.py.j2
Normal file
@@ -0,0 +1,27 @@
|
||||
from typing import Type
|
||||
{% if config %}
|
||||
from mautrix.util.config import BaseProxyConfig, ConfigUpdateHelper
|
||||
{% endif %}
|
||||
from maubot import Plugin
|
||||
{% if config %}
|
||||
|
||||
class Config(BaseProxyConfig):
|
||||
def do_update(self, helper: ConfigUpdateHelper) -> None:
|
||||
helper.copy("example_1")
|
||||
helper.copy("example_2.list")
|
||||
helper.copy("example_2.value")
|
||||
{% endif %}
|
||||
|
||||
class {{ name }}(Plugin):
|
||||
async def start(self) -> None:{% if config %}
|
||||
self.config.load_and_update()
|
||||
self.log.debug("Loaded %s from config example 2", self.config["example_2.value"]){% else %}
|
||||
pass{% endif %}
|
||||
|
||||
async def stop(self) -> None:
|
||||
pass
|
||||
{% if config %}
|
||||
@classmethod
|
||||
def get_config_class(cls) -> Type[BaseProxyConfig]:
|
||||
return Config
|
||||
{% endif %}
|
||||
BIN
maubot-src/maubot/cli/res/spdx.json.zip
Normal file
BIN
maubot-src/maubot/cli/res/spdx.json.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user