16 Commits

Author SHA1 Message Date
e83989d6ed Update upgrade 2025-01-21 13:22:42 +01:00
c82c493a87 Merge branch 'testing' into add-config-panel 2025-01-21 13:19:19 +01:00
eb4fc9d257 Update config_panel.toml 2024-11-07 16:23:53 +01:00
ccf54b8f29 Update config_panel.toml 2024-11-07 16:21:30 +01:00
d9b3b279f6 Update config.js 2024-11-07 16:14:02 +01:00
d3834d4bb3 cleaning 2024-11-07 16:11:14 +01:00
2e131bc450 Update install 2024-11-07 10:28:58 +01:00
6d56f6dc9b Update change_url 2024-11-07 10:28:11 +01:00
c34600aa99 cleaning 2024-11-07 10:26:55 +01:00
b50f750c6d Update _common.sh 2024-11-07 10:02:18 +01:00
815a6f96bb Update _common.sh 2024-11-07 09:59:01 +01:00
711762d89a Update manifest.toml 2024-11-07 09:58:49 +01:00
1dcb43a607 cleaning 2024-11-07 09:58:09 +01:00
362200ef97 fix 2024-11-07 09:36:26 +01:00
0cdd8be81b Update config_panel.toml 2024-11-07 09:31:16 +01:00
e50cf3a545 add config panel 2024-11-07 09:26:42 +01:00
7 changed files with 75 additions and 10 deletions

View File

@ -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 dont stay online forever.',
default: '__CUSTOM_DESCRIPTION__',
env: 'CUSTOM_DESCRIPTION'
},
detect_base_url: {

44
config_panel.toml Normal file
View 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"

View File

@ -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.

View File

@ -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.

View File

@ -25,7 +25,6 @@ multi_instance = true
ldap = false
sso = false
disk = "50M"
ram.build = "1G"
ram.runtime = "50M"

View File

@ -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

View File

@ -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
#=================================================