mirror of
				https://github.com/YunoHost-Apps/send_ynh.git
				synced 2025-11-04 07:45:30 +01:00 
			
		
		
		
	add config panel
This commit is contained in:
		@@ -156,7 +156,7 @@ const conf = convict({
 | 
				
			|||||||
  max_file_size: {
 | 
					  max_file_size: {
 | 
				
			||||||
    format: Number,
 | 
					    format: Number,
 | 
				
			||||||
    default: 1024 * 1024 * 1024 * 2.5,
 | 
					    default: 1024 * 1024 * 1024 * 2.5,
 | 
				
			||||||
    env: 'MAX_FILE_SIZE'
 | 
					    env: '__MAX_FILE_SIZE__'
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  l10n_dev: {
 | 
					  l10n_dev: {
 | 
				
			||||||
    format: Boolean,
 | 
					    format: Boolean,
 | 
				
			||||||
@@ -171,12 +171,12 @@ const conf = convict({
 | 
				
			|||||||
  custom_title: {
 | 
					  custom_title: {
 | 
				
			||||||
    format: String,
 | 
					    format: String,
 | 
				
			||||||
    default: 'Send',
 | 
					    default: 'Send',
 | 
				
			||||||
    env: 'CUSTOM_TITLE'
 | 
					    env: '__CUSTOM_TITLE__'
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  custom_description: {
 | 
					  custom_description: {
 | 
				
			||||||
    format: String,
 | 
					    format: String,
 | 
				
			||||||
    default: 'Encrypt and send files with a link that automatically expires to ensure your important documents don’t stay online forever.',
 | 
					    default: 'Encrypt and send files with a link that automatically expires to ensure your important documents don’t stay online forever.',
 | 
				
			||||||
    env: 'CUSTOM_DESCRIPTION'
 | 
					    env: '__CUSTOM_DESCRIPTION__'
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  detect_base_url: {
 | 
					  detect_base_url: {
 | 
				
			||||||
    format: Boolean,
 | 
					    format: Boolean,
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										42
									
								
								config_panel.toml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								config_panel.toml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
				
			|||||||
 | 
					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 = "2684354560"
 | 
				
			||||||
 | 
					        help.en = "Define the maximum file size limit"
 | 
				
			||||||
 | 
					        help.fr = "Définir la limite de taille maximale du fichier"
 | 
				
			||||||
 | 
					        bind = ":__INSTALL_DIR__/server/config.js"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [main.config.max_download]
 | 
				
			||||||
 | 
					        ask.en = "Max download"
 | 
				
			||||||
 | 
					        ask.fr = "Téléchargement 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 = ":__INSTALL_DIR__/server/config.js"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [main.config.custom_title]
 | 
				
			||||||
 | 
					        ask.en = "Custom Title"
 | 
				
			||||||
 | 
					        ask.fr = "Titre personnalisé"
 | 
				
			||||||
 | 
					        type = "string"
 | 
				
			||||||
 | 
					        help = "Add a custom title for Send"
 | 
				
			||||||
 | 
					        bind = ":__INSTALL_DIR__/server/config.js"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [main.config.custom_description]
 | 
				
			||||||
 | 
					        ask.en = "Custom Description"
 | 
				
			||||||
 | 
					        ask.fr = "Description personnalisée"
 | 
				
			||||||
 | 
					        type = "string"
 | 
				
			||||||
 | 
					        help = "Add a custom description for Send"
 | 
				
			||||||
 | 
					        bind = ":__INSTALL_DIR__/server/config.js"
 | 
				
			||||||
@@ -3,6 +3,22 @@
 | 
				
			|||||||
source _common.sh
 | 
					source _common.sh
 | 
				
			||||||
source /usr/share/yunohost/helpers
 | 
					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 to ensure your important documents don’t stay online forever."
 | 
				
			||||||
 | 
					ynh_app_setting_set --key=custom_description --value="$custom_description"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					max_file_size="2684354560"
 | 
				
			||||||
 | 
					ynh_app_setting_set --key=cmax_file_size --value="$max_file_size"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					max_download="100"
 | 
				
			||||||
 | 
					ynh_app_setting_set --key=max_download --value="$max_download"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#=================================================
 | 
					#=================================================
 | 
				
			||||||
# INSTALL DEPENDENCIES
 | 
					# INSTALL DEPENDENCIES
 | 
				
			||||||
#=================================================
 | 
					#=================================================
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,31 @@
 | 
				
			|||||||
source _common.sh
 | 
					source _common.sh
 | 
				
			||||||
source /usr/share/yunohost/helpers
 | 
					source /usr/share/yunohost/helpers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#=================================================
 | 
				
			||||||
 | 
					# ENSURE DOWNWARD COMPATIBILITY
 | 
				
			||||||
 | 
					#=================================================
 | 
				
			||||||
 | 
					ynh_script_progression "Ensuring downward compatibility..."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -z ${custom_title:-} ]; then
 | 
				
			||||||
 | 
						custom_title=Send
 | 
				
			||||||
 | 
					    ynh_app_setting_set --key=custom_title --value="$custom_title"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -z ${custom_description:-} ]; then
 | 
				
			||||||
 | 
						custom_description="Encrypt and send files with a link that automatically expires to ensure your important documents don’t stay online forever."
 | 
				
			||||||
 | 
					    ynh_app_setting_set --key=custom_description --value="$custom_description"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -z ${max_file_size:-} ]; then
 | 
				
			||||||
 | 
						max_file_size="2684354560"
 | 
				
			||||||
 | 
						ynh_app_setting_set --key=cmax_file_size --value="$max_file_size"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -z ${max_download:-} ]; then
 | 
				
			||||||
 | 
						max_download="100"
 | 
				
			||||||
 | 
						ynh_app_setting_set --key=max_download --value="$max_download"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#=================================================
 | 
					#=================================================
 | 
				
			||||||
# STOP SYSTEMD SERVICE
 | 
					# STOP SYSTEMD SERVICE
 | 
				
			||||||
#=================================================
 | 
					#=================================================
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user