mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge branch 'stretch-unstable' into enh-add-reload-and-restart-service
This commit is contained in:
commit
c1dcf4c6ac
15 changed files with 163 additions and 117 deletions
|
@ -1,8 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Fetch ips
|
||||
ip=$(hostname --all-ip-address)
|
||||
|
||||
# Fetch SSH fingerprints
|
||||
i=0
|
||||
for key in $(ls /etc/ssh/ssh_host_{ed25519,rsa,ecdsa}_key.pub 2> /dev/null) ; do
|
||||
|
@ -32,11 +29,17 @@ EOF
|
|||
# Build the actual message
|
||||
#
|
||||
|
||||
sleep 5
|
||||
# Get local IP
|
||||
# (we do this after the sleep 5 to have
|
||||
# better chances that the network is up)
|
||||
local_ip=$(hostname --all-ip-address | awk '{print $1}')
|
||||
|
||||
LOGO_AND_FINGERPRINTS=$(cat << EOF
|
||||
|
||||
$LOGO
|
||||
|
||||
IP: ${ip}
|
||||
IP: ${local_ip}
|
||||
SSH fingerprints:
|
||||
${fingerprint[0]}
|
||||
${fingerprint[1]}
|
||||
|
@ -51,17 +54,35 @@ if [[ -f /etc/yunohost/installed ]]
|
|||
then
|
||||
echo "$LOGO_AND_FINGERPRINTS" > /etc/issue
|
||||
else
|
||||
sleep 5
|
||||
chvt 2
|
||||
|
||||
# Formatting
|
||||
[[ -n "$local_ip" ]] && local_ip=$(echo -e "https://$local_ip/") || local_ip="(no ip detected?)"
|
||||
|
||||
echo "$LOGO_AND_FINGERPRINTS"
|
||||
echo -e "\e[m Post-installation \e[0m"
|
||||
echo "Congratulations! YunoHost has been successfully installed.\nTwo more steps are required to activate the services of your server."
|
||||
read -p "Proceed to post-installation? (y/n)\nAlternatively, you can proceed the post-installation on https://${ip}" -n 1
|
||||
cat << EOF
|
||||
===============================================================================
|
||||
You should now proceed with Yunohost post-installation. This is where you will
|
||||
be asked for :
|
||||
- the main domain of your server ;
|
||||
- the administration password.
|
||||
|
||||
You can perform this step :
|
||||
- from your web browser, by accessing : ${local_ip}
|
||||
- or in this terminal by answering 'yes' to the following question
|
||||
|
||||
If this is your first time with YunoHost, it is strongly recommended to take
|
||||
time to read the administator documentation and in particular the sections
|
||||
'Finalizing your setup' and 'Getting to know YunoHost'. It is available at
|
||||
the following URL : https://yunohost.org/admindoc
|
||||
===============================================================================
|
||||
EOF
|
||||
|
||||
read -p "Proceed with post-installation? (y/n) "
|
||||
RESULT=1
|
||||
while [ $RESULT -gt 0 ]; do
|
||||
if [[ $REPLY =~ ^[Nn]$ ]]; then
|
||||
chvt 1
|
||||
exit 0
|
||||
break
|
||||
fi
|
||||
echo -e "\n"
|
||||
/usr/bin/yunohost tools postinstall
|
||||
|
@ -71,4 +92,6 @@ else
|
|||
read -p "Retry? (y/n) " -n 1
|
||||
fi
|
||||
done
|
||||
chvt 1
|
||||
exit 0
|
||||
fi
|
||||
|
|
|
@ -606,14 +606,14 @@ app:
|
|||
full: --domain
|
||||
help: New app domain on which the application will be moved
|
||||
extra:
|
||||
ask: ask_main_domain
|
||||
ask: ask_new_domain
|
||||
pattern: *pattern_domain
|
||||
required: True
|
||||
-p:
|
||||
full: --path
|
||||
help: New path at which the application will be moved
|
||||
extra:
|
||||
ask: ask_path
|
||||
ask: ask_new_path
|
||||
required: True
|
||||
|
||||
### app_setting()
|
||||
|
|
|
@ -16,17 +16,11 @@ do_pre_regen() {
|
|||
# do not listen to IPv6 if unavailable
|
||||
[[ -f /proc/net/if_inet6 ]] && ipv6_enabled=true || ipv6_enabled=false
|
||||
|
||||
# Support legacy setting (this setting might be disabled by a user during a migration)
|
||||
ssh_keys=$(ls /etc/ssh/ssh_host_{ed25519,rsa,ecdsa}_key 2>/dev/null)
|
||||
if [[ "$(yunohost settings get 'service.ssh.allow_deprecated_dsa_hostkey')" == "True" ]]; then
|
||||
ssh_keys="$ssh_keys $(ls /etc/ssh/ssh_host_dsa_key 2>/dev/null)"
|
||||
fi
|
||||
|
||||
ssh_keys=$(ls /etc/ssh/ssh_host_{ed25519,rsa,ecdsa}_key 2>/dev/null)
|
||||
ssh_keys=$(ls /etc/ssh/ssh_host_{ed25519,rsa,ecdsa}_key 2>/dev/null || true)
|
||||
|
||||
# Support legacy setting (this setting might be disabled by a user during a migration)
|
||||
if [[ "$(yunohost settings get 'service.ssh.allow_deprecated_dsa_hostkey')" == "True" ]]; then
|
||||
ssh_keys="$ssh_keys $(ls /etc/ssh/ssh_host_dsa_key 2>/dev/null)"
|
||||
ssh_keys="$ssh_keys $(ls /etc/ssh/ssh_host_dsa_key 2>/dev/null || true)"
|
||||
fi
|
||||
|
||||
export ssh_keys
|
||||
|
|
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -24,6 +24,12 @@ yunohost (3.4.0) testing; urgency=low
|
|||
|
||||
-- Alexandre Aubin <alex.aubin@mailoo.org> Thu, 20 Dec 2018 22:13:00 +0000
|
||||
|
||||
yunohost (3.3.4) stable; urgency=low
|
||||
|
||||
* [fix] Use --force-confold and noninteractive debian frontend during core upgrade (#614)
|
||||
|
||||
-- Alexandre Aubin <alex.aubin@mailoo.org> Thu, 17 Jan 2019 02:00:00 +0000
|
||||
|
||||
yunohost (3.3.3) stable; urgency=low
|
||||
|
||||
* [fix] ynh_wait_dpkg_free displaying a warning despite everything being okay (#593)
|
||||
|
|
|
@ -30,20 +30,20 @@
|
|||
"app_not_properly_removed": "{app:s} has not been properly removed",
|
||||
"app_package_need_update": "The app {app} package needs to be updated to follow YunoHost changes",
|
||||
"app_removed": "{app:s} has been removed",
|
||||
"app_requirements_checking": "Checking required packages for {app}...",
|
||||
"app_requirements_checking": "Checking required packages for {app}…",
|
||||
"app_requirements_failed": "Unable to meet requirements for {app}: {error}",
|
||||
"app_requirements_unmeet": "Requirements are not met for {app}, the package {pkgname} ({version}) must be {spec}",
|
||||
"app_sources_fetch_failed": "Unable to fetch sources files",
|
||||
"app_unknown": "Unknown app",
|
||||
"app_unsupported_remote_type": "Unsupported remote type used for the app",
|
||||
"app_upgrade_app_name": "Upgrading app {app}...",
|
||||
"app_upgrade_app_name": "Upgrading app {app}…",
|
||||
"app_upgrade_failed": "Unable to upgrade {app:s}",
|
||||
"app_upgrade_some_app_failed": "Unable to upgrade some applications",
|
||||
"app_upgraded": "{app:s} has been upgraded",
|
||||
"appslist_corrupted_json": "Could not load the application lists. It looks like {filename:s} is corrupted.",
|
||||
"appslist_could_not_migrate": "Could not migrate app list {appslist:s} ! Unable to parse the url... The old cron job has been kept in {bkp_file:s}.",
|
||||
"appslist_could_not_migrate": "Could not migrate app list {appslist:s}! Unable to parse the url… The old cron job has been kept in {bkp_file:s}.",
|
||||
"appslist_fetched": "The application list {appslist:s} has been fetched",
|
||||
"appslist_migrating": "Migrating application list {appslist:s} ...",
|
||||
"appslist_migrating": "Migrating application list {appslist:s}…",
|
||||
"appslist_name_already_tracked": "There is already a registered application list with name {name:s}.",
|
||||
"appslist_removed": "The application list {appslist:s} has been removed",
|
||||
"appslist_retrieve_bad_format": "Retrieved file for application list {appslist:s} is not valid",
|
||||
|
@ -57,15 +57,17 @@
|
|||
"ask_list_to_remove": "List to remove",
|
||||
"ask_main_domain": "Main domain",
|
||||
"ask_new_admin_password": "New administration password",
|
||||
"ask_new_domain": "New domain",
|
||||
"ask_new_path": "New path",
|
||||
"ask_password": "Password",
|
||||
"ask_path": "Path",
|
||||
"backup_abstract_method": "This backup method hasn't yet been implemented",
|
||||
"backup_action_required": "You must specify something to save",
|
||||
"backup_app_failed": "Unable to back up the app '{app:s}'",
|
||||
"backup_applying_method_borg": "Sending all files to backup into borg-backup repository...",
|
||||
"backup_applying_method_copy": "Copying all files to backup...",
|
||||
"backup_applying_method_custom": "Calling the custom backup method '{method:s}'...",
|
||||
"backup_applying_method_tar": "Creating the backup tar archive...",
|
||||
"backup_applying_method_borg": "Sending all files to backup into borg-backup repository…",
|
||||
"backup_applying_method_copy": "Copying all files to backup…",
|
||||
"backup_applying_method_custom": "Calling the custom backup method '{method:s}'…",
|
||||
"backup_applying_method_tar": "Creating the backup tar archive…",
|
||||
"backup_archive_app_not_found": "App '{app:s}' not found in the backup archive",
|
||||
"backup_archive_broken_link": "Unable to access backup archive (broken link to {path:s})",
|
||||
"backup_archive_mount_failed": "Mounting the backup archive failed",
|
||||
|
@ -81,7 +83,7 @@
|
|||
"backup_copying_to_organize_the_archive": "Copying {size:s}MB to organize the archive",
|
||||
"backup_couldnt_bind": "Couldn't bind {src:s} to {dest:s}.",
|
||||
"backup_created": "Backup created",
|
||||
"backup_creating_archive": "Creating the backup archive...",
|
||||
"backup_creating_archive": "Creating the backup archive…",
|
||||
"backup_creation_failed": "Backup creation failed",
|
||||
"backup_csv_addition_failed": "Unable to add files to backup into the CSV file",
|
||||
"backup_csv_creation_failed": "Unable to create the CSV file needed for future restore operations",
|
||||
|
@ -90,7 +92,7 @@
|
|||
"backup_custom_need_mount_error": "Custom backup method failure on 'need_mount' step",
|
||||
"backup_delete_error": "Unable to delete '{path:s}'",
|
||||
"backup_deleted": "The backup has been deleted",
|
||||
"backup_extracting_archive": "Extracting the backup archive...",
|
||||
"backup_extracting_archive": "Extracting the backup archive…",
|
||||
"backup_hook_unknown": "Backup hook '{hook:s}' unknown",
|
||||
"backup_invalid_archive": "Invalid backup archive",
|
||||
"backup_method_borg_finished": "Backup into borg finished",
|
||||
|
@ -104,8 +106,8 @@
|
|||
"backup_output_directory_required": "You must provide an output directory for the backup",
|
||||
"backup_output_symlink_dir_broken": "You have a broken symlink instead of your archives directory '{path:s}'. You may have a specific setup to backup your data on an other filesystem, in this case you probably forgot to remount or plug your hard dirve or usb key.",
|
||||
"backup_php5_to_php7_migration_may_fail": "Could not convert your archive to support php7, your php apps may fail to restore (reason: {error:s})",
|
||||
"backup_running_app_script": "Running backup script of app '{app:s}'...",
|
||||
"backup_running_hooks": "Running backup hooks...",
|
||||
"backup_running_app_script": "Running backup script of app '{app:s}'…",
|
||||
"backup_running_hooks": "Running backup hooks…",
|
||||
"backup_system_part_failed": "Unable to backup the '{part:s}' system part",
|
||||
"backup_unable_to_organize_files": "Unable to organize files in the archive with the quick method",
|
||||
"backup_with_no_backup_script_for_app": "App {app:s} has no backup script. Ignoring.",
|
||||
|
@ -119,7 +121,7 @@
|
|||
"certmanager_cert_install_success_selfsigned": "Successfully installed a self-signed certificate for domain {domain:s}!",
|
||||
"certmanager_cert_renew_success": "Successfully renewed Let's Encrypt certificate for domain {domain:s}!",
|
||||
"certmanager_cert_signing_failed": "Signing the new certificate failed",
|
||||
"certmanager_certificate_fetching_or_enabling_failed": "Sounds like enabling the new certificate for {domain:s} failed somehow...",
|
||||
"certmanager_certificate_fetching_or_enabling_failed": "Sounds like enabling the new certificate for {domain:s} failed somehow…",
|
||||
"certmanager_conflicting_nginx_file": "Unable to prepare domain for ACME challenge: the nginx configuration file {filepath:s} is conflicting and should be removed first",
|
||||
"certmanager_couldnt_fetch_intermediate_cert": "Timed out when trying to fetch intermediate certificate from Let's Encrypt. Certificate installation/renewal aborted - please try again later.",
|
||||
"certmanager_domain_cert_not_selfsigned": "The certificate for domain {domain:s} is not self-signed. Are you sure you want to replace it? (Use --force)",
|
||||
|
@ -164,23 +166,23 @@
|
|||
"domain_zone_not_found": "DNS zone file not found for domain {:s}",
|
||||
"domains_available": "Available domains:",
|
||||
"done": "Done",
|
||||
"downloading": "Downloading...",
|
||||
"downloading": "Downloading…",
|
||||
"dyndns_could_not_check_provide": "Could not check if {provider:s} can provide {domain:s}.",
|
||||
"dyndns_cron_installed": "The DynDNS cron job has been installed",
|
||||
"dyndns_cron_remove_failed": "Unable to remove the DynDNS cron job",
|
||||
"dyndns_cron_removed": "The DynDNS cron job has been removed",
|
||||
"dyndns_ip_update_failed": "Unable to update IP address on DynDNS",
|
||||
"dyndns_ip_updated": "Your IP address has been updated on DynDNS",
|
||||
"dyndns_key_generating": "DNS key is being generated, it may take a while...",
|
||||
"dyndns_key_generating": "DNS key is being generated, it may take a while…",
|
||||
"dyndns_key_not_found": "DNS key not found for the domain",
|
||||
"dyndns_no_domain_registered": "No domain has been registered with DynDNS",
|
||||
"dyndns_registered": "The DynDNS domain has been registered",
|
||||
"dyndns_registration_failed": "Unable to register DynDNS domain: {error:s}",
|
||||
"dyndns_domain_not_provided": "Dyndns provider {provider:s} cannot provide domain {domain:s}.",
|
||||
"dyndns_unavailable": "Domain {domain:s} is not available.",
|
||||
"executing_command": "Executing command '{command:s}'...",
|
||||
"executing_script": "Executing script '{script:s}'...",
|
||||
"extracting": "Extracting...",
|
||||
"executing_command": "Executing command '{command:s}'…",
|
||||
"executing_script": "Executing script '{script:s}'…",
|
||||
"extracting": "Extracting…",
|
||||
"experimental_feature": "Warning: this feature is experimental and not consider stable, you shouldn't be using it except if you know what you are doing.",
|
||||
"field_invalid": "Invalid field '{:s}'",
|
||||
"firewall_reload_failed": "Unable to reload the firewall",
|
||||
|
@ -269,10 +271,10 @@
|
|||
"migrate_tsig_end": "Migration to hmac-sha512 finished",
|
||||
"migrate_tsig_failed": "Migrating the dyndns domain {domain} to hmac-sha512 failed, rolling back. Error: {error_code} - {error}",
|
||||
"migrate_tsig_start": "Not secure enough key algorithm detected for TSIG signature of domain '{domain}', initiating migration to the more secure one hmac-sha512",
|
||||
"migrate_tsig_wait": "Let's wait 3min for the dyndns server to take the new key into account...",
|
||||
"migrate_tsig_wait_2": "2min...",
|
||||
"migrate_tsig_wait_3": "1min...",
|
||||
"migrate_tsig_wait_4": "30 secondes...",
|
||||
"migrate_tsig_wait": "Let's wait 3min for the dyndns server to take the new key into account…",
|
||||
"migrate_tsig_wait_2": "2min…",
|
||||
"migrate_tsig_wait_3": "1min…",
|
||||
"migrate_tsig_wait_4": "30 secondes…",
|
||||
"migrate_tsig_not_needed": "You do not appear to use a dyndns domain, so no migration is needed!",
|
||||
"migration_description_0001_change_cert_group_to_sslcert": "Change certificates group permissions from 'metronome' to 'ssl-cert'",
|
||||
"migration_description_0002_migrate_to_tsig_sha256": "Improve security of dyndns TSIG by using SHA512 instead of MD5",
|
||||
|
@ -284,19 +286,19 @@
|
|||
"migration_description_0008_ssh_conf_managed_by_yunohost_step2": "Let the SSH configuration be managed by YunoHost (step 2, manual)",
|
||||
"migration_0003_backward_impossible": "The stretch migration cannot be reverted.",
|
||||
"migration_0003_start": "Starting migration to Stretch. The logs will be available in {logfile}.",
|
||||
"migration_0003_patching_sources_list": "Patching the sources.lists ...",
|
||||
"migration_0003_main_upgrade": "Starting main upgrade ...",
|
||||
"migration_0003_fail2ban_upgrade": "Starting the fail2ban upgrade ...",
|
||||
"migration_0003_restoring_origin_nginx_conf": "Your file /etc/nginx/nginx.conf was edited somehow. The migration is going to reset back to its original state first... The previous file will be available as {backup_dest}.",
|
||||
"migration_0003_yunohost_upgrade": "Starting the yunohost package upgrade ... The migration will end, but the actual upgrade will happen right after. After the operation is complete, you might have to re-log on the webadmin.",
|
||||
"migration_0003_patching_sources_list": "Patching the sources.lists…",
|
||||
"migration_0003_main_upgrade": "Starting main upgrade…",
|
||||
"migration_0003_fail2ban_upgrade": "Starting the fail2ban upgrade…",
|
||||
"migration_0003_restoring_origin_nginx_conf": "Your file /etc/nginx/nginx.conf was edited somehow. The migration is going to reset back to its original state first… The previous file will be available as {backup_dest}.",
|
||||
"migration_0003_yunohost_upgrade": "Starting the yunohost package upgrade… The migration will end, but the actual upgrade will happen right after. After the operation is complete, you might have to re-log on the webadmin.",
|
||||
"migration_0003_not_jessie": "The current debian distribution is not Jessie!",
|
||||
"migration_0003_system_not_fully_up_to_date": "Your system is not fully up to date. Please perform a regular upgrade before running the migration to stretch.",
|
||||
"migration_0003_still_on_jessie_after_main_upgrade": "Something wrong happened during the main upgrade : system is still on Jessie !? To investigate the issue, please look at {log} :s ...",
|
||||
"migration_0003_still_on_jessie_after_main_upgrade": "Something wrong happened during the main upgrade: system is still on Jessie!? To investigate the issue, please look at {log}:s…",
|
||||
"migration_0003_general_warning": "Please note that this migration is a delicate operation. While the YunoHost team did its best to review and test it, the migration might still break parts of the system or apps.\n\nTherefore, we recommend you to:\n - Perform a backup of any critical data or app. More infos on https://yunohost.org/backup;\n - Be patient after launching the migration: depending on your internet connection and hardware, it might take up to a few hours for everything to upgrade.\n\nAdditionally, the port for SMTP, used by external email clients (like Thunderbird or K9-Mail) was changed from 465 (SSL/TLS) to 587 (STARTTLS). The old port 465 will automatically be closed and the new port 587 will be opened in the firewall. You and your users *will* have to adapt the configuration of your email clients accordingly!",
|
||||
"migration_0003_problematic_apps_warning": "Please note that the following possibly problematic installed apps were detected. It looks like those were not installed from an applist or are not flagged as 'working'. Consequently, we cannot guarantee that they will still work after the upgrade: {problematic_apps}",
|
||||
"migration_0003_modified_files": "Please note that the following files were found to be manually modified and might be overwritten at the end of the upgrade: {manually_modified_files}",
|
||||
"migration_0005_postgresql_94_not_installed": "Postgresql was not installed on your system. Nothing to do!",
|
||||
"migration_0005_postgresql_96_not_installed": "Postgresql 9.4 has been found to be installed, but not postgresql 9.6 !? Something weird might have happened on your system :( ...",
|
||||
"migration_0005_postgresql_96_not_installed": "Postgresql 9.4 has been found to be installed, but not postgresql 9.6!? Something weird might have happened on your system:(…",
|
||||
"migration_0005_not_enough_space": "Not enough space is available in {path} to run the migration right now:(.",
|
||||
"migration_0006_disclaimer": "Yunohost now expects admin and root passwords to be synchronized. By running this migration, your root password is going to be replaced by the admin password.",
|
||||
"migration_0007_cancelled": "YunoHost has failed to improve the way your SSH conf is managed.",
|
||||
|
@ -314,12 +316,12 @@
|
|||
"migrations_error_failed_to_load_migration": "ERROR: failed to load migration {number} {name}",
|
||||
"migrations_forward": "Migrating forward",
|
||||
"migrations_list_conflict_pending_done": "You cannot use both --previous and --done at the same time.",
|
||||
"migrations_loading_migration": "Loading migration {number} {name}...",
|
||||
"migrations_loading_migration": "Loading migration {number} {name}…",
|
||||
"migrations_migration_has_failed": "Migration {number} {name} has failed with exception {exception}, aborting",
|
||||
"migrations_no_migrations_to_run": "No migrations to run",
|
||||
"migrations_show_currently_running_migration": "Running migration {number} {name}...",
|
||||
"migrations_show_currently_running_migration": "Running migration {number} {name}…",
|
||||
"migrations_show_last_migration": "Last ran migration is {}",
|
||||
"migrations_skip_migration": "Skipping migration {number} {name}...",
|
||||
"migrations_skip_migration": "Skipping migration {number} {name}…",
|
||||
"migrations_success": "Successfully ran migration {number} {name}!",
|
||||
"migrations_to_be_ran_manually": "Migration {number} {name} has to be ran manually. Please go to Tools > Migrations on the webadmin, or run `yunohost tools migrations migrate`.",
|
||||
"migrations_need_to_accept_disclaimer": "To run the migration {number} {name}, your must accept the following disclaimer:\n---\n{disclaimer}\n---\nIf you accept to run the migration, please re-run the command with the option --accept-disclaimer.",
|
||||
|
@ -379,7 +381,7 @@
|
|||
"restore_cleaning_failed": "Unable to clean-up the temporary restoration directory",
|
||||
"restore_complete": "Restore complete",
|
||||
"restore_confirm_yunohost_installed": "Do you really want to restore an already installed system? [{answers:s}]",
|
||||
"restore_extracting": "Extracting needed files from the archive...",
|
||||
"restore_extracting": "Extracting needed files from the archive…",
|
||||
"restore_failed": "Unable to restore the system",
|
||||
"restore_hook_unavailable": "Restoration script for '{part:s}' not available on your system and not in the archive either",
|
||||
"restore_may_be_not_enough_disk_space": "Your system seems not to have enough disk space (freespace: {free_space:d} B, needed space: {needed_space:d} B, security margin: {margin:d} B)",
|
||||
|
@ -387,8 +389,8 @@
|
|||
"restore_not_enough_disk_space": "Not enough disk space (freespace: {free_space:d} B, needed space: {needed_space:d} B, security margin: {margin:d} B)",
|
||||
"restore_nothings_done": "Nothing has been restored",
|
||||
"restore_removing_tmp_dir_failed": "Unable to remove an old temporary directory",
|
||||
"restore_running_app_script": "Running restore script of app '{app:s}'...",
|
||||
"restore_running_hooks": "Running restoration hooks...",
|
||||
"restore_running_app_script": "Running restore script of app '{app:s}'…",
|
||||
"restore_running_hooks": "Running restoration hooks…",
|
||||
"restore_system_part_failed": "Unable to restore the '{part:s}' system part",
|
||||
"root_password_desynchronized": "The admin password has been changed, but YunoHost was unable to propagate this on the root password!",
|
||||
"root_password_replaced_by_admin_password": "Your root password have been replaced by your admin password.",
|
||||
|
@ -436,9 +438,9 @@
|
|||
"service_enable_failed": "Unable to enable service '{service:s}'\n\nRecent service logs:{logs:s}",
|
||||
"service_enabled": "The service '{service:s}' has been enabled",
|
||||
"service_no_log": "No log to display for service '{service:s}'",
|
||||
"service_regenconf_dry_pending_applying": "Checking pending configuration which would have been applied for service '{service}'...",
|
||||
"service_regenconf_dry_pending_applying": "Checking pending configuration which would have been applied for service '{service}'…",
|
||||
"service_regenconf_failed": "Unable to regenerate the configuration for service(s): {services}",
|
||||
"service_regenconf_pending_applying": "Applying pending configuration for service '{service}'...",
|
||||
"service_regenconf_pending_applying": "Applying pending configuration for service '{service}'…",
|
||||
"service_remove_failed": "Unable to remove service '{service:s}'",
|
||||
"service_removed": "The service '{service:s}' has been removed",
|
||||
"service_reload_failed": "Unable to reload service '{service:s}'\n\nRecent service logs:{logs:s}",
|
||||
|
@ -460,14 +462,14 @@
|
|||
"system_upgraded": "The system has been upgraded",
|
||||
"system_username_exists": "Username already exists in the system users",
|
||||
"unbackup_app": "App '{app:s}' will not be saved",
|
||||
"unexpected_error": "An unexpected error occured",
|
||||
"unexpected_error": "An unexpected error occured: {error}",
|
||||
"unit_unknown": "Unknown unit '{unit:s}'",
|
||||
"unlimit": "No quota",
|
||||
"unrestore_app": "App '{app:s}' will not be restored",
|
||||
"update_cache_failed": "Unable to update APT cache",
|
||||
"updating_apt_cache": "Updating the list of available packages...",
|
||||
"updating_apt_cache": "Updating the list of available packages…",
|
||||
"upgrade_complete": "Upgrade complete",
|
||||
"upgrading_packages": "Upgrading packages...",
|
||||
"upgrading_packages": "Upgrading packages…",
|
||||
"upnp_dev_not_found": "No UPnP device found",
|
||||
"upnp_disabled": "UPnP has been disabled",
|
||||
"upnp_enabled": "UPnP has been enabled",
|
||||
|
@ -486,6 +488,6 @@
|
|||
"yunohost_ca_creation_failed": "Unable to create certificate authority",
|
||||
"yunohost_ca_creation_success": "The local certification authority has been created.",
|
||||
"yunohost_configured": "YunoHost has been configured",
|
||||
"yunohost_installing": "Installing YunoHost...",
|
||||
"yunohost_installing": "Installing YunoHost…",
|
||||
"yunohost_not_installed": "YunoHost is not or not correctly installed. Please execute 'yunohost tools postinstall'"
|
||||
}
|
||||
|
|
|
@ -445,6 +445,7 @@ def app_change_url(operation_logger, auth, app, domain, path):
|
|||
|
||||
"""
|
||||
from yunohost.hook import hook_exec, hook_callback
|
||||
from yunohost.domain import _normalize_domain_path, _get_conflicting_apps
|
||||
|
||||
installed = _is_installed(app)
|
||||
if not installed:
|
||||
|
@ -457,18 +458,24 @@ def app_change_url(operation_logger, auth, app, domain, path):
|
|||
old_path = app_setting(app, "path")
|
||||
|
||||
# Normalize path and domain format
|
||||
domain = domain.strip().lower()
|
||||
|
||||
old_path = normalize_url_path(old_path)
|
||||
path = normalize_url_path(path)
|
||||
old_domain, old_path = _normalize_domain_path(old_domain, old_path)
|
||||
domain, path = _normalize_domain_path(domain, path)
|
||||
|
||||
if (domain, path) == (old_domain, old_path):
|
||||
raise YunohostError("app_change_url_identical_domains", domain=domain, path=path)
|
||||
|
||||
# WARNING / FIXME : checkurl will modify the settings
|
||||
# (this is a non intuitive behavior that should be changed)
|
||||
# (or checkurl renamed in reserve_url)
|
||||
app_checkurl(auth, '%s%s' % (domain, path), app)
|
||||
# Check the url is available
|
||||
conflicts = _get_conflicting_apps(auth, domain, path)
|
||||
if conflicts:
|
||||
apps = []
|
||||
for path, app_id, app_label in conflicts:
|
||||
apps.append(" * {domain:s}{path:s} → {app_label:s} ({app_id:s})".format(
|
||||
domain=domain,
|
||||
path=path,
|
||||
app_id=app_id,
|
||||
app_label=app_label,
|
||||
))
|
||||
raise YunohostError('app_location_unavailable', apps="\n".join(apps))
|
||||
|
||||
manifest = json.load(open(os.path.join(APPS_SETTING_PATH, app, "manifest.json")))
|
||||
|
||||
|
@ -486,9 +493,9 @@ def app_change_url(operation_logger, auth, app, domain, path):
|
|||
env_dict["YNH_APP_INSTANCE_NUMBER"] = str(app_instance_nb)
|
||||
|
||||
env_dict["YNH_APP_OLD_DOMAIN"] = old_domain
|
||||
env_dict["YNH_APP_OLD_PATH"] = old_path.rstrip("/")
|
||||
env_dict["YNH_APP_OLD_PATH"] = old_path
|
||||
env_dict["YNH_APP_NEW_DOMAIN"] = domain
|
||||
env_dict["YNH_APP_NEW_PATH"] = path.rstrip("/")
|
||||
env_dict["YNH_APP_NEW_PATH"] = path
|
||||
|
||||
if domain != old_domain:
|
||||
operation_logger.related_to.append(('domain', old_domain))
|
||||
|
@ -830,11 +837,12 @@ def app_install(operation_logger, auth, app, label=None, args=None, no_remove_on
|
|||
)
|
||||
except (KeyboardInterrupt, EOFError):
|
||||
install_retcode = -1
|
||||
except:
|
||||
logger.exception(m18n.n('unexpected_error'))
|
||||
except Exception:
|
||||
import traceback
|
||||
logger.exception(m18n.n('unexpected_error', error=u"\n" + traceback.format_exc()))
|
||||
finally:
|
||||
if install_retcode != 0:
|
||||
error_msg = operation_logger.error(m18n.n('unexpected_error'))
|
||||
error_msg = operation_logger.error(m18n.n('unexpected_error', error='shell command return code: %s' % install_retcode))
|
||||
if not no_remove_on_failure:
|
||||
# Setup environment for remove script
|
||||
env_dict_remove = {}
|
||||
|
@ -1251,7 +1259,6 @@ def app_register_url(auth, app, domain, path):
|
|||
|
||||
# We cannot change the url of an app already installed simply by changing
|
||||
# the settings...
|
||||
# FIXME should look into change_url once it's merged
|
||||
|
||||
installed = app in app_list(installed=True, raw=True).keys()
|
||||
if installed:
|
||||
|
@ -1289,7 +1296,7 @@ def app_checkurl(auth, url, app=None):
|
|||
|
||||
logger.error("Packagers /!\\ : 'app checkurl' is deprecated ! Please use the helper 'ynh_webpath_register' instead !")
|
||||
|
||||
from yunohost.domain import domain_list
|
||||
from yunohost.domain import domain_list, _normalize_domain_path
|
||||
|
||||
if "https://" == url[:8]:
|
||||
url = url[8:]
|
||||
|
@ -1303,8 +1310,7 @@ def app_checkurl(auth, url, app=None):
|
|||
path = url[url.index('/'):]
|
||||
installed = False
|
||||
|
||||
if path[-1:] != '/':
|
||||
path = path + '/'
|
||||
domain, path = _normalize_domain_path(domain, path)
|
||||
|
||||
apps_map = app_map(raw=True)
|
||||
|
||||
|
@ -2529,13 +2535,6 @@ def random_password(length=8):
|
|||
return ''.join([random.SystemRandom().choice(char_set) for x in range(length)])
|
||||
|
||||
|
||||
def normalize_url_path(url_path):
|
||||
if url_path.strip("/").strip():
|
||||
return '/' + url_path.strip("/").strip() + '/'
|
||||
|
||||
return "/"
|
||||
|
||||
|
||||
def unstable_apps():
|
||||
|
||||
raw_app_installed = app_list(installed=True, raw=True)
|
||||
|
|
|
@ -1746,8 +1746,8 @@ class CopyBackupMethod(BackupMethod):
|
|||
return
|
||||
else:
|
||||
logger.warning(m18n.n("bind_mouting_disable"))
|
||||
subprocess.call(["mountpoint", "-q", dest,
|
||||
"&&", "umount", "-R", dest])
|
||||
subprocess.call(["mountpoint", "-q", self.work_dir,
|
||||
"&&", "umount", "-R", self.work_dir])
|
||||
raise YunohostError('backup_cant_mount_uncompress_archive')
|
||||
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ def _certificate_install_letsencrypt(auth, domain_list, force=False, no_checks=F
|
|||
|
||||
_configure_for_acme_challenge(auth, domain)
|
||||
_fetch_and_enable_new_certificate(domain, staging, no_checks=no_checks)
|
||||
_install_cron()
|
||||
_install_cron(no_checks=no_checks)
|
||||
|
||||
logger.success(
|
||||
m18n.n("certmanager_cert_install_success", domain=domain))
|
||||
|
@ -407,12 +407,27 @@ def certificate_renew(auth, domain_list, force=False, no_checks=False, email=Fal
|
|||
#
|
||||
|
||||
|
||||
def _install_cron():
|
||||
def _install_cron(no_checks=False):
|
||||
cron_job_file = "/etc/cron.daily/yunohost-certificate-renew"
|
||||
|
||||
# we need to check if "--no-checks" isn't already put inside the existing
|
||||
# crontab, if it's the case it's probably because another domain needed it
|
||||
# at some point so we keep it
|
||||
if not no_checks and os.path.exists(cron_job_file):
|
||||
with open(cron_job_file, "r") as f:
|
||||
# no the best test in the world but except if we uses a shell
|
||||
# script parser I'm not expected a much more better way to do that
|
||||
no_checks = "--no-checks" in f.read()
|
||||
|
||||
command = "yunohost domain cert-renew --email\n"
|
||||
|
||||
if no_checks:
|
||||
# handle trailing "\n with ":-1"
|
||||
command = command[:-1] + " --no-checks\n"
|
||||
|
||||
with open(cron_job_file, "w") as f:
|
||||
f.write("#!/bin/bash\n")
|
||||
f.write("yunohost domain cert-renew --email\n")
|
||||
f.write(command)
|
||||
|
||||
_set_permissions(cron_job_file, "root", "root", 0o755)
|
||||
|
||||
|
|
|
@ -298,7 +298,7 @@ def _normalize_domain_path(domain, path):
|
|||
domain = domain[len("http://"):]
|
||||
|
||||
# Remove trailing slashes
|
||||
domain = domain.rstrip("/")
|
||||
domain = domain.rstrip("/").lower()
|
||||
path = "/" + path.strip("/")
|
||||
|
||||
return domain, path
|
||||
|
|
|
@ -342,8 +342,7 @@ def firewall_upnp(action='status', no_refresh=False):
|
|||
# Refresh port mapping using UPnP
|
||||
if not no_refresh:
|
||||
upnpc = miniupnpc.UPnP()
|
||||
upnpc.discoverdelay = 62000
|
||||
upnpc.localport = 1900
|
||||
upnpc.discoverdelay = 3000
|
||||
|
||||
# Discover UPnP device(s)
|
||||
logger.debug('discovering UPnP devices...')
|
||||
|
|
|
@ -51,18 +51,18 @@ def test_urlavailable():
|
|||
def test_registerurl():
|
||||
|
||||
app_install(auth, "./tests/apps/register_url_app_ynh",
|
||||
args="domain=%s&path=%s" % (maindomain, "/urlregisterapp"))
|
||||
args="domain=%s&path=%s" % (maindomain, "/urlregisterapp"), force=True)
|
||||
|
||||
assert not domain_url_available(auth, maindomain, "/urlregisterapp")
|
||||
|
||||
# Try installing at same location
|
||||
with pytest.raises(YunohostError):
|
||||
app_install(auth, "./tests/apps/register_url_app_ynh",
|
||||
args="domain=%s&path=%s" % (maindomain, "/urlregisterapp"))
|
||||
args="domain=%s&path=%s" % (maindomain, "/urlregisterapp"), force=True)
|
||||
|
||||
|
||||
def test_registerurl_baddomain():
|
||||
|
||||
with pytest.raises(YunohostError):
|
||||
app_install(auth, "./tests/apps/register_url_app_ynh",
|
||||
args="domain=%s&path=%s" % ("yolo.swag", "/urlregisterapp"))
|
||||
args="domain=%s&path=%s" % ("yolo.swag", "/urlregisterapp"), force=True)
|
||||
|
|
|
@ -171,7 +171,7 @@ def install_app(app, path, additionnal_args=""):
|
|||
|
||||
app_install(auth, "./tests/apps/%s" % app,
|
||||
args="domain=%s&path=%s%s" % (maindomain, path,
|
||||
additionnal_args))
|
||||
additionnal_args), force=True)
|
||||
|
||||
|
||||
def add_archive_wordpress_from_2p4():
|
||||
|
|
|
@ -28,15 +28,15 @@ def teardown_function(function):
|
|||
|
||||
def install_changeurl_app(path):
|
||||
app_install(auth, "./tests/apps/change_url_app_ynh",
|
||||
args="domain=%s&path=%s" % (maindomain, path))
|
||||
args="domain=%s&path=%s" % (maindomain, path), force=True)
|
||||
|
||||
|
||||
def check_changeurl_app(path):
|
||||
appmap = app_map(raw=True)
|
||||
|
||||
assert path + "/" in appmap[maindomain].keys()
|
||||
assert path in appmap[maindomain].keys()
|
||||
|
||||
assert appmap[maindomain][path + "/"]["id"] == "change_url_app"
|
||||
assert appmap[maindomain][path]["id"] == "change_url_app"
|
||||
|
||||
r = requests.get("https://127.0.0.1%s/" % path, headers={"domain": maindomain}, verify=False)
|
||||
assert r.status_code == 200
|
||||
|
|
|
@ -530,6 +530,11 @@ def tools_upgrade(operation_logger, auth, ignore_apps=False, ignore_packages=Fal
|
|||
is_api = True if msettings.get('interface') == 'api' else False
|
||||
|
||||
if not ignore_packages:
|
||||
|
||||
apt.apt_pkg.init()
|
||||
apt.apt_pkg.config.set("DPkg::Options::", "--force-confdef")
|
||||
apt.apt_pkg.config.set("DPkg::Options::", "--force-confold")
|
||||
|
||||
cache = apt.Cache()
|
||||
cache.open(None)
|
||||
cache.upgrade(True)
|
||||
|
@ -558,6 +563,7 @@ def tools_upgrade(operation_logger, auth, ignore_apps=False, ignore_packages=Fal
|
|||
|
||||
operation_logger.start()
|
||||
try:
|
||||
os.environ["DEBIAN_FRONTEND"] = "noninteractive"
|
||||
# Apply APT changes
|
||||
# TODO: Logs output for the API
|
||||
cache.commit(apt.progress.text.AcquireProgress(),
|
||||
|
@ -570,6 +576,8 @@ def tools_upgrade(operation_logger, auth, ignore_apps=False, ignore_packages=Fal
|
|||
else:
|
||||
logger.info(m18n.n('done'))
|
||||
operation_logger.success()
|
||||
finally:
|
||||
del os.environ["DEBIAN_FRONTEND"]
|
||||
else:
|
||||
logger.info(m18n.n('packages_no_upgrade'))
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ class YunohostError(MoulinetteError):
|
|||
are translated via m18n.n (namespace) instead of m18n.g (global?)
|
||||
"""
|
||||
|
||||
def __init__(self, key, __raw_msg__=False, *args, **kwargs):
|
||||
if __raw_msg__:
|
||||
def __init__(self, key, raw_msg=False, *args, **kwargs):
|
||||
if raw_msg:
|
||||
msg = key
|
||||
else:
|
||||
msg = m18n.n(key, *args, **kwargs)
|
||||
super(YunohostError, self).__init__(msg, __raw_msg__=True)
|
||||
super(YunohostError, self).__init__(msg, raw_msg=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue