diff --git a/config_panel.toml b/config_panel.toml new file mode 100644 index 0000000..029b526 --- /dev/null +++ b/config_panel.toml @@ -0,0 +1,57 @@ +version="1.0" +[main] +name.en = "Configuration for $app" +name.id = "Konfigurasi untuk $app" +services = ["__APP__"] + [main.engine] + name.en = "Translation Engine" + name.id = "Mesin Penerjemahan" + [main.engine.google_enable] + ask.en = "Enable Google Translate?" + ask.id = "Aktifkan Google Translate?" + type = "boolean" + yes = true + no = false + + [main.engine.reverso_enable] + ask.en = "Enable Reverso?" + ask.id = "Aktifkan Reverso?" + type = "boolean" + yes = true + no = false + + [main.engine.iciba_enable] + ask.en = "Enable ICIBA?" + ask.id = "Aktifkan ICIBA?" + type = "boolean" + yes = true + no = false + + [main.engine.deepl_enable] + ask.en = "Enable DeepL?" + ask.id = "Aktifkan DeepL?" + type = "boolean" + yes = true + no = false + help.en = "Deepl Translate does not support async as of right now, it will block all other requests while it's processing a Deepl Requests, please enable this with caution!" + + [main.engine.libretranslate_enable] + ask.en = "Enable LibreTranslate?" + ask.id = "Aktifkan LibreTranslate?" + type = "boolean" + yes = true + no = false + + [main.engine.libretranslate_instance] + ask.en = "From which LibreTranslate instance?" + ask.id = "Dari LibreTranslate mana?" + type = "string" + help.en = "If you disable LibreTranslate, just leave this blank. Required if you enable LibreTranslate." + help.id = "Jika LibreTranslate tidak dipilih, biarkan ini kosong. Dibutuhkan jika LibreTranslate diaktifkan." + + [main.engine.libretranslate_api] + ask.en = "API key for LibreTranslate:" + ask.id = "Kunci API untuk LibreTranslate:" + type = "string" + help.en = "If you disable LibreTranslate or your instance didn't need API key, just leave this blank." + help.id = "Jika LibreTranslate tidak dipilih atau LibreTranslate pilihanmu tidak memerlukan ini, biarkan ini kosong." diff --git a/scripts/config b/scripts/config new file mode 100644 index 0000000..7fc3785 --- /dev/null +++ b/scripts/config @@ -0,0 +1,32 @@ +#!/bin/bash + +source /usr/share/yunohost/helpers + +ynh_abort_if_errors + +#================================================= +# RETRIEVE ARGUMENTS +#================================================= + +install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +port=$(ynh_app_setting_get -a $app -k port) + +#================================================= +# APPLYING CONFIG +#================================================= + +ynh_app_config_apply() { + _ynh_app_config_apply + + ynh_add_config --template="config.conf.template" --destination="$install_dir/simplytranslate/config.conf" + + chmod 400 "$install_dir/simplytranslate/config.conf" + chown $app:$app "$install_dir/simplytranslate/config.conf" +} + +#================================================= +# GENERIC FINALIZATION +#================================================= + +ynh_app_config_run $1 +