mirror of
https://github.com/YunoHost-Apps/send_ynh.git
synced 2025-09-18 01:42:57 +02:00
Compare commits
16 Commits
master
...
add-config
Author | SHA1 | Date | |
---|---|---|---|
e83989d6ed | |||
c82c493a87 | |||
eb4fc9d257 | |||
ccf54b8f29 | |||
d9b3b279f6 | |||
d3834d4bb3 | |||
2e131bc450 | |||
6d56f6dc9b | |||
c34600aa99 | |||
b50f750c6d | |||
815a6f96bb | |||
711762d89a | |||
1dcb43a607 | |||
362200ef97 | |||
0cdd8be81b | |||
e50cf3a545 |
@ -74,7 +74,7 @@ const conf = convict({
|
||||
},
|
||||
max_downloads: {
|
||||
format: Number,
|
||||
default: 100,
|
||||
default: __MAX_DOWNLOADS__,
|
||||
env: 'MAX_DOWNLOADS'
|
||||
},
|
||||
max_files_per_archive: {
|
||||
@ -155,7 +155,7 @@ const conf = convict({
|
||||
},
|
||||
max_file_size: {
|
||||
format: Number,
|
||||
default: 1024 * 1024 * 1024 * 2.5,
|
||||
default: __MAX_FILE_SIZE__ * 1024 * 1024,
|
||||
env: 'MAX_FILE_SIZE'
|
||||
},
|
||||
l10n_dev: {
|
||||
@ -170,12 +170,12 @@ const conf = convict({
|
||||
},
|
||||
custom_title: {
|
||||
format: String,
|
||||
default: 'Send',
|
||||
default: '__CUSTOM_TITLE__',
|
||||
env: 'CUSTOM_TITLE'
|
||||
},
|
||||
custom_description: {
|
||||
format: String,
|
||||
default: 'Encrypt and send files with a link that automatically expires to ensure your important documents don’t stay online forever.',
|
||||
default: '__CUSTOM_DESCRIPTION__',
|
||||
env: 'CUSTOM_DESCRIPTION'
|
||||
},
|
||||
detect_base_url: {
|
||||
|
44
config_panel.toml
Normal file
44
config_panel.toml
Normal file
@ -0,0 +1,44 @@
|
||||
version = "1.0"
|
||||
|
||||
[main]
|
||||
name.en = "Send configuration"
|
||||
name.fr = "Configuration de Send"
|
||||
services = ["__APP__"]
|
||||
|
||||
[main.config]
|
||||
name.en = "Configuration Options"
|
||||
name.fr = "Options de configuration"
|
||||
|
||||
[main.config.max_file_size]
|
||||
ask.en = "Max File Size"
|
||||
ask.fr = "Taille maximale du fichier"
|
||||
type = "number"
|
||||
default = "100"
|
||||
help.en = "Choose the maximum file size allowed to send (in Mo)"
|
||||
help.fr = "Choisissez la taille maximale du fichier autorisé à envoyer (en Mo)"
|
||||
bind = "max_file_size:/var/www/__APP__/server/config.js"
|
||||
|
||||
[main.config.max_downloads]
|
||||
ask.en = "Max downloads"
|
||||
ask.fr = "Téléchargements maximal"
|
||||
type = "number"
|
||||
default = "100"
|
||||
help.en = "Define the maximum download limit"
|
||||
help.fr = "Définir la limite maximale du nombre de téléchargement"
|
||||
bind = "max_downloads:/var/www/__APP__/server/config.js"
|
||||
|
||||
[main.config.custom_title]
|
||||
ask.en = "Custom Title"
|
||||
ask.fr = "Titre personnalisé"
|
||||
type = "string"
|
||||
help.en = "Add a custom title for Send"
|
||||
help.fr = "Ajouter un titre personnalisé pour Send"
|
||||
bind = "custom_title:/var/www/__APP__/server/config.js"
|
||||
|
||||
[main.config.custom_description]
|
||||
ask.en = "Custom Description"
|
||||
ask.fr = "Description personnalisée"
|
||||
type = "string"
|
||||
help.en = "Add a custom description for Send"
|
||||
help.fr = "Ajouter une description personnalisée pour Send"
|
||||
bind = "custom_description:/var/www/__APP__/server/config.js"
|
@ -1,2 +0,0 @@
|
||||
The config file path is `__INSTALL_DIR__/server/config.js`.
|
||||
You can configure things such as the max file size, max downloads, or max file expire time.
|
@ -1,2 +0,0 @@
|
||||
Le chemin du fichier de configuration est `__INSTALL_DIR__/server/config.js`.
|
||||
Vous pouvez configurer des paramètres tels que les taille de fichier, nombre de téléchargements, ou temps d'expiration des fichiers maximums.
|
@ -25,7 +25,6 @@ multi_instance = true
|
||||
|
||||
ldap = false
|
||||
sso = false
|
||||
|
||||
disk = "50M"
|
||||
ram.build = "1G"
|
||||
ram.runtime = "50M"
|
||||
|
@ -3,6 +3,22 @@
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# INITIALIZE AND STORE SETTINGS
|
||||
#=================================================
|
||||
|
||||
custom_title="Send"
|
||||
ynh_app_setting_set --key=custom_title --value="$custom_title"
|
||||
|
||||
custom_description="Encrypt and send files with a link that automatically expires."
|
||||
ynh_app_setting_set --key=custom_description --value="$custom_description"
|
||||
|
||||
max_file_size=100
|
||||
ynh_app_setting_set --key=max_file_size --value="$max_file_size"
|
||||
|
||||
max_downloads=100
|
||||
ynh_app_setting_set --key=max_downloads --value="$max_downloads"
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
@ -48,7 +64,7 @@ ynh_config_add --template="config.js" --destination="$install_dir/server/config.
|
||||
#=================================================
|
||||
# BUILD APP
|
||||
#=================================================
|
||||
ynh_script_progression "Building app... (this will take some time and resources!)"
|
||||
ynh_script_progression "Building $app... (this will take some time and resources!)"
|
||||
|
||||
pushd "$install_dir"
|
||||
ynh_hide_warnings ynh_exec_as_app npm install
|
||||
|
@ -3,6 +3,16 @@
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression "Ensuring downward compatibility..."
|
||||
|
||||
ynh_app_setting_set_default --key=custom_title --value="send"
|
||||
ynh_app_setting_set_default --key=custom_description --value="Encrypt and send files with a link that automatically expires."
|
||||
ynh_app_setting_set_default --key=max_file_size --value=100
|
||||
ynh_app_setting_set_default --key=max_downloads --value=100
|
||||
|
||||
#=================================================
|
||||
# STOP SYSTEMD SERVICE
|
||||
#=================================================
|
||||
|
Reference in New Issue
Block a user