From d1579c1f9d389ee9c255470670d9bf7b27b6d776 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 14 Oct 2022 03:49:09 +0200 Subject: [PATCH] Upgrade to 2.0.7882~ynh1 --- .github/workflows/updater.sh | 156 +++++++++++++++ .github/workflows/updater.yml | 52 +++++ conf/jitsi-jicofo-config | 2 +- conf/jitsi-jicofo.src | 6 +- conf/jitsi-meet-config.js | 347 ++++++++++++++++++++++------------ conf/jitsi-meet-prosody.src | 4 +- conf/jitsi-meet-web.src | 4 +- conf/jitsi-sctp.src | 4 +- conf/jitsi-videobridge.src | 4 +- conf/usrsctp.src | 4 +- manifest.json | 6 +- scripts/_common.sh | 1 - scripts/backup | 2 +- scripts/install | 45 +++-- scripts/remove | 29 ++- scripts/restore | 37 ++-- scripts/upgrade | 48 +++-- scripts/ynh_apps | 110 ----------- 18 files changed, 534 insertions(+), 327 deletions(-) create mode 100644 .github/workflows/updater.sh create mode 100644 .github/workflows/updater.yml delete mode 100644 scripts/ynh_apps diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh new file mode 100644 index 0000000..90b5e7c --- /dev/null +++ b/.github/workflows/updater.sh @@ -0,0 +1,156 @@ +#!/bin/bash + +#================================================= +# PACKAGE UPDATING HELPER +#================================================= + +# This script is meant to be run by GitHub Actions +# The YunoHost-Apps organisation offers a template Action to run this script periodically +# Since each app is different, maintainers can adapt its contents so as to perform +# automatic actions when a new upstream release is detected. + +#================================================= +# FETCHING LATEST RELEASE AND ITS ASSETS +#================================================= + +# Fetching information +current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') +repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') +# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) +version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .name' | sort -V | tail -1) + +package_repository="https://download.jitsi.org/stable" + +tempdir="$(mktemp -d)" +curl -o $tempdir/Release "$package_repository/Packages" +dependencies=$(sed -n '/Version: '$version'*/,/Package:/p' $tempdir/Release | grep "^Pre-Depends:" | cut -d " " -f2-) +dependencies="$dependencies, $(sed -n '/Version: '$version'*/,/Package:/p' $tempdir/Release | grep "^Depends:" | cut -d " " -f2-)" +IFS=',' read -ra dependencies_array <<< "$dependencies" +assets=() +for onedependency in "${dependencies_array[@]}" +do + app=$(echo $onedependency | cut -d " " -f1) + appversion=$(echo $onedependency | grep -oP "(?<== ).*(?=\))") + assets+=("$package_repository/${app}_${appversion}_all.deb") +done +rm -rf $tempdir + +# Later down the script, we assume the version has only digits and dots +# Sometimes the release name starts with a "v", so let's filter it out. +# You may need more tweaks here if the upstream repository has different naming conventions. +if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then + version=${version:1} +fi + +# Setting up the environment variables +echo "Current version: $current_version" +echo "Latest release from upstream: $version" +echo "VERSION=$version" >> $GITHUB_ENV +echo "REPO=$repo" >> $GITHUB_ENV +# For the time being, let's assume the script will fail +echo "PROCEED=false" >> $GITHUB_ENV + +# Proceed only if the retrieved version is greater than the current one +if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then + echo "::warning ::No new version available" + exit 0 +# Proceed only if a PR for this new version does not already exist +elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then + echo "::warning ::A branch already exists for this update" + exit 0 +fi + +# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) +echo "${#assets[@]} available asset(s)" + +#================================================= +# UPDATE SOURCE FILES +#================================================= + +# Here we use the $assets variable to get the resources published in the upstream release. +# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. + +# Let's loop over the array of assets URLs +for asset_url in ${assets[@]}; do + + echo "Handling asset at $asset_url" + + # Assign the asset to a source file in conf/ directory + # Here we base the source file name upon a unique keyword in the assets url (admin vs. update) + # Leave $src empty to ignore the asset + case $asset_url in + *"jitsi-videobridge"*) + src="jitsi-videobridge" + ;; + *"jicofo"*) + src="jitsi-jicofo" + ;; + *"jitsi-meet-web_"*) + src="jitsi-meet-web" + ;; + *"jitsi-meet-prosody"*) + src="jitsi-meet-prosody" + ;; + *) + src="" + ;; + esac + + # If $src is not empty, let's process the asset + if [ ! -z "$src" ]; then + + # Create the temporary directory + tempdir="$(mktemp -d)" + + # Download sources and calculate checksum + filename=${asset_url##*/} + curl --silent -4 -L $asset_url -o "$tempdir/$filename" + checksum=$(sha256sum "$tempdir/$filename" | head -c 64) + + # Delete temporary directory + rm -rf $tempdir + + # Get extension + if [[ $filename == *.tar.gz ]]; then + extension=tar.gz + else + extension=${filename##*.} + fi + + # Rewrite source file + cat < conf/$src.src +SOURCE_URL=$asset_url +SOURCE_SUM=$checksum +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=deb +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=$src.deb +SOURCE_EXTRACT=false +EOT + echo "... conf/$src.src updated" + + else + echo "... asset ignored" + fi + +done + +#================================================= +# SPECIFIC UPDATE STEPS +#================================================= + +# Any action on the app's source code can be done. +# The GitHub Action workflow takes care of committing all changes after this script ends. + +#================================================= +# GENERIC FINALIZATION +#================================================= + +# Replace new version in manifest +echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json + +# No need to update the README, yunohost-bot takes care of it + +# The Action will proceed only if the PROCEED environment variable is set to true +echo "PROCEED=true" >> $GITHUB_ENV +exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml new file mode 100644 index 0000000..6f3c1b9 --- /dev/null +++ b/.github/workflows/updater.yml @@ -0,0 +1,52 @@ +# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. +# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. +# This file should be enough by itself, but feel free to tune it to your needs. +# It calls updater.sh, which is where you should put the app-specific update steps. +name: Check for new upstream releases +on: + # Allow to manually trigger the workflow + workflow_dispatch: + # Run it every day at 6:00 UTC + schedule: + - cron: '0 6 * * *' +jobs: + updater: + runs-on: ubuntu-latest + steps: + - name: Fetch the source code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run the updater script + id: run_updater + run: | + # Setting up Git user + git config --global user.name 'yunohost-bot' + git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Run the updater script + /bin/bash .github/workflows/updater.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request + id: cpr + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update to version ${{ env.VERSION }} + committer: 'yunohost-bot ' + author: 'yunohost-bot ' + signoff: false + base: testing + branch: ci-auto-update-v${{ env.VERSION }} + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + [See upstream release page](${{ env.RELEASE }}) + Provided description: + ${{ env.DESCRIPTION }} + draft: false diff --git a/conf/jitsi-jicofo-config b/conf/jitsi-jicofo-config index 36d1778..5ce48dd 100644 --- a/conf/jitsi-jicofo-config +++ b/conf/jitsi-jicofo-config @@ -21,4 +21,4 @@ JICOFO_OPTS="" JICOFO_MAX_MEMORY=__MAX_MEMORY__m # adds java system props that are passed to jicofo (default are for home and logging config file) -JAVA_SYS_PROPS="-Dconfig.file=/etc/__APP__/jicofo/jicofo.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/__APP__ -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=jicofo -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/__APP__ -Djava.util.logging.config.file=/etc/__APP__/jicofo/logging.properties" +JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/__APP__ -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=jicofo -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/__APP__ -Djava.util.logging.config.file=/etc/__APP__/jicofo/logging.properties -Dconfig.file=/etc/__APP__/jicofo/jicofo.conf" diff --git a/conf/jitsi-jicofo.src b/conf/jitsi-jicofo.src index 459c976..9922b5f 100644 --- a/conf/jitsi-jicofo.src +++ b/conf/jitsi-jicofo.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://download.jitsi.org/stable/jicofo_1.0-877-1_all.deb -SOURCE_SUM=a761d32a01240a8e665bea454ac6c082a78d0d3aeb60db707f38035ea1363f35 +SOURCE_URL=https://download.jitsi.org/stable/jicofo_1.0-940-1_all.deb +SOURCE_SUM=bf1eda5077cac46fad674b0cf1e5abd6d4ca7fffdb33174a5611392383f898ba SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=deb SOURCE_IN_SUBDIR=true SOURCE_FILENAME=jitsi-jicofo.deb -SOURCE_EXTRACT=false \ No newline at end of file +SOURCE_EXTRACT=false diff --git a/conf/jitsi-meet-config.js b/conf/jitsi-meet-config.js index 4bd9870..9c55c10 100644 --- a/conf/jitsi-meet-config.js +++ b/conf/jitsi-meet-config.js @@ -46,18 +46,18 @@ var config = { // enableThumbnailReordering: true, // Enables XMPP WebSocket (as opposed to BOSH) for the given amount of users. - // mobileXmppWsThreshold: 10 // enable XMPP WebSockets on mobile for 10% of the users + // mobileXmppWsThreshold: 10, // enable XMPP WebSockets on mobile for 10% of the users // P2P test mode disables automatic switching to P2P when there are 2 // participants in the conference. // p2pTestMode: false, // Enables the test specific features consumed by jitsi-meet-torture - // testMode: false + // testMode: false, // Disables the auto-play behavior of *all* newly created video element. // This is useful when the client runs on a host with limited resources. - // noAutoPlayVideo: false + // noAutoPlayVideo: false, // Enable / disable 500 Kbps bitrate cap on desktop tracks. When enabled, // simulcast is turned off for the desktop share. If presenter is turned @@ -66,17 +66,17 @@ var config = { // the probability for this to be enabled. This setting has been deprecated. // desktopSharingFrameRate.max now determines whether simulcast will be enabled // or disabled for the screenshare. - // capScreenshareBitrate: 1 // 0 to disable - deprecated. + // capScreenshareBitrate: 1, // 0 to disable - deprecated. // Whether to use fake constraints (height: 99999, width: 99999) when calling getDisplayMedia on // Chromium based browsers. This is intended as a workaround for // https://bugs.chromium.org/p/chromium/issues/detail?id=1056311 - // setScreenSharingResolutionConstraints: true + // setScreenSharingResolutionConstraints: true, // Enable callstats only for a percentage of users. // This takes a value between 0 and 100 which determines the probability for // the callstats to be enabled. - // callStatsThreshold: 5 // enable callstats for 5% of the users. + // callStatsThreshold: 5, // enable callstats for 5% of the users. }, // Feature Flags. @@ -86,7 +86,11 @@ var config = { // Enables sending multiple video streams, i.e., camera and desktop tracks can be shared in the conference // separately as two different streams instead of one composite stream. - // sendMultipleVideoStreams: false + // sendMultipleVideoStreams: false, + + // Signal that this client supports receiving multiple video streams. Without this flag jicofo will enable + // multi-stream backward compatibility. + // receiveMultipleVideoStreams: true, }, // Disables moderator indicators. @@ -115,7 +119,7 @@ var config = { // Can be either 'recording' - screensharing screenshots are taken // only when the recording is also on, // or 'always' - screensharing screenshots are always taken. - // mode: 'recording' + // mode: 'recording', // } // Disables ICE/UDP by filtering out local and remote UDP candidates in @@ -137,6 +141,7 @@ var config = { // Disable measuring of audio levels. // disableAudioLevels: false, + // audioLevelsInterval: 200, // Enabling this will run the lib-jitsi-meet no audio detection module which @@ -172,7 +177,7 @@ var config = { // Enabling it (with #params) will disable local audio output of remote // participants and to enable it back a reload is needed. - // startSilent: false + // startSilent: false, // Enables support for opus-red (redundancy for Opus). // enableOpusRed: false, @@ -181,7 +186,7 @@ var config = { // Beware, by doing so, you are disabling echo cancellation, noise suppression and AGC. // audioQuality: { // stereo: false, - // opusMaxAverageBitrate: null // Value to fit the 6000 to 510000 range. + // opusMaxAverageBitrate: null, // Value to fit the 6000 to 510000 range. // }, // Video @@ -200,7 +205,7 @@ var config = { // 'role', <- Moderators on top // 'name', <- Alphabetically by name // 'hasLeft', <- The ones that have left in the bottom - // ] <- the order of the array elements determines priority + // ], <- the order of the array elements determines priority // How many participants while in the tile view mode, before the receiving video quality is reduced from HD to SD. // Use -1 to disable. @@ -216,9 +221,9 @@ var config = { // height: { // ideal: 720, // max: 720, - // min: 240 - // } - // } + // min: 240, + // }, + // }, // }, // Enable / disable simulcast support. @@ -253,7 +258,7 @@ var config = { // Optional desktop sharing frame rate options. Default value: min:5, max:5. // desktopSharingFrameRate: { // min: 5, - // max: 5 + // max: 5, // }, // This option has been deprecated since it is no longer supported as per the w3c spec. @@ -265,52 +270,115 @@ var config = { // Recording - // Whether to enable file recording or not. + // DEPRECATED. Use recordingService.enabled instead. // fileRecordingsEnabled: false, + // Enable the dropbox integration. // dropbox: { - // appKey: '' // Specify your app key here. + // appKey: '', // Specify your app key here. // // A URL to redirect the user to, after authenticating // // by default uses: - // // 'https://__DOMAIN__/static/oauth.html' + // // 'https://jitsi-meet.example.com/static/oauth.html' // redirectURI: - // 'https://__DOMAIN__/subfolder/static/oauth.html' + // 'https://jitsi-meet.example.com/subfolder/static/oauth.html', // }, - // When integrations like dropbox are enabled only that will be shown, - // by enabling fileRecordingsServiceEnabled, we show both the integrations - // and the generic recording service (its configuration and storage type - // depends on jibri configuration) + + // recordingService: { + // // When integrations like dropbox are enabled only that will be shown, + // // by enabling fileRecordingsServiceEnabled, we show both the integrations + // // and the generic recording service (its configuration and storage type + // // depends on jibri configuration) + // enabled: false, + + // // Whether to show the possibility to share file recording with other people + // // (e.g. meeting participants), based on the actual implementation + // // on the backend. + // sharingEnabled: false, + + // // Hide the warning that says we only store the recording for 24 hours. + // hideStorageWarning: false, + // }, + + // DEPRECATED. Use recordingService.enabled instead. // fileRecordingsServiceEnabled: false, - // Whether to show the possibility to share file recording with other people - // (e.g. meeting participants), based on the actual implementation - // on the backend. + + // DEPRECATED. Use recordingService.sharingEnabled instead. // fileRecordingsServiceSharingEnabled: false, - // Whether to enable live streaming or not. + // Local recording configuration. + // localRecording: { + // // Whether to disable local recording or not. + // disable: false, + + // // Whether to notify all participants when a participant is recording locally. + // notifyAllParticipants: false, + + // // Whether to disable the self recording feature (only local participant streams). + // disableSelfRecording: false, + // }, + + // Customize the Live Streaming dialog. Can be modified for a non-YouTube provider. + // liveStreaming: { + // // Whether to enable live streaming or not. + // enabled: false, + // // Terms link + // termsLink: 'https://www.youtube.com/t/terms', + // // Data privacy link + // dataPrivacyLink: 'https://policies.google.com/privacy', + // // RegExp string that validates the stream key input field + // validatorRegExpString: '^(?:[a-zA-Z0-9]{4}(?:-(?!$)|$)){4}', + // // Documentation reference for the live streaming feature. + // helpLink: 'https://jitsi.org/live' + // }, + + // DEPRECATED. Use liveStreaming.enabled instead. // liveStreamingEnabled: false, - // Whether to enable local recording or not. - // enableLocalRecording: false, - - // Transcription (in interface_config, - // subtitles and buttons can be configured) + // DEPRECATED. Use transcription.enabled instead. // transcribingEnabled: false, - // If true transcriber will use the application language. - // The application language is either explicitly set by participants in their settings or automatically - // detected based on the environment, e.g. if the app is opened in a chrome instance which is using french as its - // default language then transcriptions for that participant will be in french. - // Defaults to true. + // DEPRECATED. Use transcription.useAppLanguage instead. // transcribeWithAppLanguage: true, - // Transcriber language. This settings will only work if "transcribeWithAppLanguage" is explicitly set to false. - // Available languages can be found in - // ./src/react/features/transcribing/transcriber-langs.json. + // DEPRECATED. Use transcription.preferredLanguage instead. // preferredTranscribeLanguage: 'en-US', - // Enables automatic turning on captions when recording is started + // DEPRECATED. Use transcription.autoCaptionOnRecord instead. // autoCaptionOnRecord: false, + // Transcription options. + // transcription: { + // // Whether the feature should be enabled or not. + // enabled: false, + + // // Translation languages. + // // Available languages can be found in + // // ./src/react/features/transcribing/translation-languages.json. + // translationLanguages: ['en', 'es', 'fr', 'ro'], + + // // Important languages to show on the top of the language list. + // translationLanguagesHead: ['en'], + + // // If true transcriber will use the application language. + // // The application language is either explicitly set by participants in their settings or automatically + // // detected based on the environment, e.g. if the app is opened in a chrome instance which + // // is using french as its default language then transcriptions for that participant will be in french. + // // Defaults to true. + // useAppLanguage: true, + + // // Transcriber language. This settings will only work if "useAppLanguage" + // // is explicitly set to false. + // // Available languages can be found in + // // ./src/react/features/transcribing/transcriber-langs.json. + // preferredLanguage: 'en-US', + + // // Disable start transcription for all participants. + // disableStartForAll: false, + + // // Enables automatic turning on captions when recording is started + // autoCaptionOnRecord: false, + // }, + // Misc // Default value for the channel "last N" attribute. -1 for unlimited. @@ -343,7 +411,7 @@ var config = { // 30: 15, // 50: 10, // 70: 5, - // 90: 2 + // 90: 2, // }, // Provides a way to translate the legacy bridge signaling messages, 'LastNChangedEvent', @@ -372,7 +440,7 @@ var config = { // // This will result in Safari not being able to decode video from endpoints sending VP9 video. // // When set to false, the conference falls back to VP8 whenever there is an endpoint that doesn't support the // // preferred codec and goes back to the preferred codec when that endpoint leaves. - // // enforcePreferredCodec: false, + // enforcePreferredCodec: false, // // // Provides a way to configure the maximum bitrates that will be enforced on the simulcast streams for // // video tracks. The keys in the object represent the type of the stream (LD, SD or HD) and the values @@ -383,18 +451,18 @@ var config = { // H264: { // low: 200000, // standard: 500000, - // high: 1500000 + // high: 1500000, // }, // VP8 : { // low: 200000, // standard: 500000, - // high: 1500000 + // high: 1500000, // }, // VP9: { // low: 100000, // standard: 300000, - // high: 1200000 - // } + // high: 1200000, + // }, // }, // // // The options can be used to override default thresholds of video thumbnail heights corresponding to @@ -409,19 +477,19 @@ var config = { // // the high quality. // minHeightForQualityLvl: { // 360: 'standard', - // 720: 'high' + // 720: 'high', // }, // // // Provides a way to resize the desktop track to 720p (if it is greater than 720p) before creating a canvas // // for the presenter mode (camera picture-in-picture mode with screenshare). - // resizeDesktopForPresenter: false + // resizeDesktopForPresenter: false, // }, // Notification timeouts // notificationTimeouts: { // short: 2500, // medium: 5000, - // long: 10000 + // long: 10000, // }, // // Options for the recording limit notification. @@ -436,7 +504,7 @@ var config = { // appName: 'Unlimited recordings APP', // // // The URL of the app with unlimited recordings. - // appURL: 'https://unlimited.recordings.app.com/' + // appURL: 'https://unlimited.recordings.app.com/', // }, // Disables or enables RTX (RFC 4588) (defaults to false). @@ -536,12 +604,9 @@ var config = { // Hides the email section under profile settings. // hideEmailInSettings: false, - // Whether or not some features are checked based on token. - // enableFeaturesBasedOnToken: false, - // When enabled the password used for locking a room is restricted to up to the number of digits specified - // roomPasswordNumberOfDigits: 10, // default: roomPasswordNumberOfDigits: false, + // roomPasswordNumberOfDigits: 10, // Message to show the users. Example: 'The service will be down for // maintenance at 01:00 AM GMT, @@ -561,11 +626,11 @@ var config = { // // either the jwt or the userInfo from the iframe api init object in order for this to have an effect. // hideDisplayName: false, // // List of buttons to hide from the extra join options dropdown. - // hideExtraJoinButtons: ['no-audio', 'by-phone'] + // hideExtraJoinButtons: ['no-audio', 'by-phone'], // }, // When 'true', the user cannot edit the display name. - // (Mainly useful when used in conjuction with the JWT so the JWT name becomes read only.) + // (Mainly useful when used in conjunction with the JWT so the JWT name becomes read only.) // readOnlyName: false, // If etherpad integration is enabled, setting this to true will @@ -596,7 +661,7 @@ var config = { // // Defaults to Gravatar. // baseUrl: 'https://www.gravatar.com/avatar/', // // True if Gravatar should be disabled. - // disabled: false + // disabled: false, // }, // App name to be displayed in the invitation email subject, as an alternative to @@ -619,7 +684,7 @@ var config = { // 'chat', // 'closedcaptions', // 'desktop', - // 'dock-iframe' + // 'dock-iframe', // 'download', // 'embedmeeting', // 'etherpad', @@ -633,6 +698,7 @@ var config = { // 'linktosalesforce', // 'livestreaming', // 'microphone', + // 'noisesuppression', // 'participants-pane', // 'profile', // 'raisehand', @@ -648,22 +714,21 @@ var config = { // 'toggle-camera', // 'undock-iframe', // 'videoquality', - // '__end' // ], // Holds values related to toolbar visibility control. // toolbarConfig: { // // Moved from interfaceConfig.INITIAL_TOOLBAR_TIMEOUT - // // The initial numer of miliseconds for the toolbar buttons to be visible on screen. + // // The initial number of milliseconds for the toolbar buttons to be visible on screen. // initialTimeout: 20000, // // Moved from interfaceConfig.TOOLBAR_TIMEOUT - // // Number of miliseconds for the toolbar buttons to be visible on screen. + // // Number of milliseconds for the toolbar buttons to be visible on screen. // timeout: 4000, // // Moved from interfaceConfig.TOOLBAR_ALWAYS_VISIBLE - // // Whether toolbar should be always visible or should hide after x miliseconds. + // // Whether toolbar should be always visible or should hide after x milliseconds. // alwaysVisible: false, // // Indicates whether the toolbar should still autohide when chat is open - // autoHideWhileChatIsOpen: false + // autoHideWhileChatIsOpen: false, // }, // Toolbar buttons which have their click/tap event exposed through the API on @@ -698,6 +763,7 @@ var config = { // 'microphone', // 'mute-everyone', // 'mute-video-everyone', + // 'noisesuppression', // 'participants-pane', // 'profile', // { @@ -719,8 +785,7 @@ var config = { // { // key: 'add-passcode', // preventExecution: false - // } - // '__end' + // }, // ], // List of pre meeting screens buttons to hide. The values must be one or more of the 5 allowed buttons: @@ -743,6 +808,7 @@ var config = { // Application ID and Secret. // callStatsID: '', // callStatsSecret: '', + // callStatsApplicationLogsDisabled: false, // The callstats initialize config params as described in the API: // https://docs.callstats.io/docs/javascript#callstatsinitialize-with-app-secret @@ -760,10 +826,10 @@ var config = { // pbxID: "PBX Identifier. Example, walmart.", // pbxExtensionID: "PBX Extension Identifier. Example, 5625.", // fqExtensionID: "Fully qualified Extension Identifier. Example, +71 (US) +5625.", - // sessionID: "Session Identifier. Example, session-12-34" + // sessionID: "Session Identifier. Example, session-12-34", // }, // collectLegacyStats: true, //enables the collection of legacy stats in chrome browser - // collectIP: true //enables the collection localIP address + // collectIP: true, //enables the collection localIP address // }, // Enables sending participants' display names to callstats @@ -782,14 +848,14 @@ var config = { // // Enables displaying face expressions in speaker stats // enableDisplayFaceExpressions: false, + // // Enable rtc stats for face landmarks + // enableRTCStats: false, + // // Minimum required face movement percentage threshold for sending new face centering coordinates data. // faceCenteringThreshold: 10, // // Milliseconds for processing a new image capture in order to detect face coordinates if they exist. // captureInterval: 1000, - - // // Maximum number of faces that can be detected from a video track. - // maxFacesDetected: 4 // }, // Controls the percentage of automatic feedback shown to participants when callstats is enabled. @@ -851,8 +917,8 @@ var config = { stunServers: [ // { urls: 'stun:__DOMAIN__:3478' }, - { urls: 'stun:meet-jit-si-turnrelay.jitsi.net:443' } - ] + { urls: 'stun:meet-jit-si-turnrelay.jitsi.net:443' }, + ], }, analytics: { @@ -860,14 +926,18 @@ var config = { // disabled: false, // The Google Analytics Tracking ID: - // googleAnalyticsTrackingId: 'your-tracking-id-UA-123456-1' + // googleAnalyticsTrackingId: 'your-tracking-id-UA-123456-1', // Matomo configuration: // matomoEndpoint: 'https://your-matomo-endpoint/', // matomoSiteID: '42', // The Amplitude APP Key: - // amplitudeAPPKey: '' + // amplitudeAPPKey: '', + + // Obfuscates room name sent to analytics (amplitude, rtcstats) + // Default value is false. + // obfuscateRoomName: false, // Configuration for the rtcstats server: // By enabling rtcstats server every time a conference is joined the rtcstats @@ -875,19 +945,24 @@ var config = { // PeerConnection states along with getStats metrics polled at the specified // interval. // rtcstatsEnabled: false, + // rtcstatsStoreLogs: false, // In order to enable rtcstats one needs to provide a endpoint url. // rtcstatsEndpoint: wss://rtcstats-server-pilot.jitsi.net/, - // The interval at which rtcstats will poll getStats, defaults to 1000ms. + // The interval at which rtcstats will poll getStats, defaults to 10000ms. // If the value is set to 0 getStats won't be polled and the rtcstats client // will only send data related to RTCPeerConnection events. - // rtcstatsPolIInterval: 1000, + // rtcstatsPollInterval: 10000, + + // This determines if rtcstats sends the SDP to the rtcstats server or replaces + // all SDPs with an empty string instead. + // rtcstatsSendSdp: false, // Array of script URLs to load as lib-jitsi-meet "analytics handlers". // scriptURLs: [ // "libs/analytics-ga.min.js", // google-analytics - // "https://example.com/my-custom-analytics.js" + // "https://example.com/my-custom-analytics.js", // ], }, @@ -896,11 +971,11 @@ var config = { // Information about the jitsi-meet instance we are connecting to, including // the user region as seen by the server. - deploymentInfo: { - // shard: "shard1", - // region: "europe", - // userRegion: "asia" - }, + // deploymentInfo: { + // shard: "shard1", + // region: "europe", + // userRegion: "asia", + // }, // Array of disabled sounds. // Possible values: @@ -943,19 +1018,25 @@ var config = { // chromeExtensionBanner: { // // The chrome extension to be installed address // url: 'https://chrome.google.com/webstore/detail/jitsi-meetings/kglhbbefdnlheedjiejgomgmfplipfeb', + // edgeUrl: 'https://microsoftedge.microsoft.com/addons/detail/jitsi-meetings/eeecajlpbgjppibfledfihobcabccihn', // // Extensions info which allows checking if they are installed or not // chromeExtensionsInfo: [ // { // id: 'kglhbbefdnlheedjiejgomgmfplipfeb', - // path: 'jitsi-logo-48x48.png' - // } + // path: 'jitsi-logo-48x48.png', + // }, + // // Edge extension info + // { + // id: 'eeecajlpbgjppibfledfihobcabccihn', + // path: 'jitsi-logo-48x48.png', + // }, // ] // }, // e2ee: { // labels, - // externallyManagedKey: false + // externallyManagedKey: false, // }, // Options related to end-to-end (participant to participant) ping. @@ -970,9 +1051,9 @@ var config = { // maxConferenceSize: 200, // // // The maximum number of e2e ping messages per second for the whole conference to aim for. - // // This is used to contol the pacing of messages in order to reduce the load on the backend. - // maxMessagesPerSecond: 250 - // }, + // // This is used to control the pacing of messages in order to reduce the load on the backend. + // maxMessagesPerSecond: 250, + // }, // If set, will attempt to use the provided video input device label when // triggering a screenshare, instead of proceeding through the normal flow @@ -1009,7 +1090,7 @@ var config = { // userDocumentationURL: 'https://docs.example.com/video-meetings.html', // // If specified a 'Download our apps' button will be displayed in the overflow menu with a link // // to the specified URL for an app download page. - // downloadAppsUrl: 'https://docs.example.com/our-apps.html' + // downloadAppsUrl: 'https://docs.example.com/our-apps.html', // }, // Options related to the remote participant menu. @@ -1021,7 +1102,7 @@ var config = { // // If set to true the 'Grant moderator' button will be disabled. // disableGrantModerator: true, // // If set to true the 'Send private message' button will be disabled. - // disablePrivateChat: true + // disablePrivateChat: true, // }, // Endpoint that enables support for salesforce integration with in-meeting resource linking @@ -1037,7 +1118,7 @@ var config = { // disableRemoteMute: true, // Enables support for lip-sync for this client (if the browser supports it). - // enableLipSync: false + // enableLipSync: false, /** External API url used to receive branding specific information. @@ -1066,7 +1147,7 @@ var config = { // For a list of all possible theme tokens and their current defaults, please check: // https://github.com/jitsi/jitsi-meet/tree/master/resources/custom-theme/custom-theme.json // For a short explanations on each of the tokens, please check: - // https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/ui/Tokens.js + // https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/ui/Tokens.ts // IMPORTANT!: This is work in progress so many of the various tokens are not yet applied in code // or they are partially applied. customTheme: { @@ -1080,15 +1161,15 @@ var config = { field02Hover: 'red', action01: 'green', action01Hover: 'lightgreen', - action02Disabled: 'beige', + disabled01: 'beige', success02: 'cadetblue', - action02Hover: 'aliceblue' + action02Hover: 'aliceblue', }, typography: { labelRegular: { fontSize: 25, lineHeight: 30, - fontWeight: 500 + fontWeight: 500, } } } @@ -1103,7 +1184,7 @@ var config = { // // Hides the more actions button. // hideMoreActionsButton: false, // // Hides the mute all button. - // hideMuteAllButton: false + // hideMuteAllButton: false, // }, // Options related to the breakout rooms feature. @@ -1113,7 +1194,7 @@ var config = { // // Hides the auto assign participants button. // hideAutoAssignButton: false, // // Hides the join breakout room button. - // hideJoinRoomButton: false + // hideJoinRoomButton: false, // }, // When true the user cannot add more images to be used as virtual background. @@ -1152,7 +1233,8 @@ var config = { // 'transcribing', // 'video-quality', // 'insecure-room', - // 'highlight-moment' + // 'highlight-moment', + // 'top-panel-toggle', // ] // }, @@ -1179,9 +1261,8 @@ var config = { // is not persisting the local storage inside the iframe. // useHostPageLocalStorage: true, - // etherpad ("shared document") integration. + // Etherpad ("shared document") integration. // - // If set, add a "Open shared document" link to the bottom right menu that // will open an etherpad document. // etherpad_base: 'https://your-etherpad-installati.on/p/', @@ -1192,11 +1273,6 @@ var config = { // {"countryCode":"US","tollFree":false,"formattedNumber":"+1 123-456-7890"} // dialInConfCodeUrl is the conference mapper converting a meeting id to a PIN used for dial-in // or the other way around (more info in resources/cloud-api.swagger) - // - // For JaaS customers the default values are: - // dialInNumbersUrl: 'https://conference-mapper.jitsi.net/v1/access/dids', - // dialInConfCodeUrl: 'https://conference-mapper.jitsi.net/v1/access', - // // List of undocumented settings used in jitsi-meet /** @@ -1297,6 +1373,7 @@ var config = { // 'notify.leftTwoMembers', // show when two participants left simultaneously // 'notify.leftThreePlusMembers', // show when more than 2 participants left simultaneously // 'notify.grantedTo', // shown when moderator rights were granted to a participant + // 'notify.hostAskedUnmute', // shown to participant when host asks them to unmute // 'notify.invitedOneMember', // shown when 1 participant has been invited // 'notify.invitedThreePlusMembers', // shown when 3+ participants have been invited // 'notify.invitedTwoMembers', // shown when 2 participants have been invited @@ -1317,7 +1394,7 @@ var config = { // 'notify.raisedHand', // shown when a partcipant used raise hand, // 'notify.startSilentTitle', // shown when user joined with no audio // 'notify.unmute', // shown to moderator when user raises hand during AV moderation - // 'notify.hostAskedUnmute', // shown to participant when host asks them to unmute + // 'notify.videoMutedRemotelyTitle', // shown when user's video is muted by a remote party, // 'prejoin.errorDialOut', // 'prejoin.errorDialOutDisconnected', // 'prejoin.errorDialOutFailed', @@ -1330,7 +1407,7 @@ var config = { // 'toolbar.noAudioSignalTitle', // shown when a broken mic is detected // 'toolbar.noisyAudioInputTitle', // shown when noise is detected for the current microphone // 'toolbar.talkWhileMutedPopup', // shown when user tries to speak while muted - // 'transcribing.failedToStart' // shown when transcribing fails to start + // 'transcribing.failedToStart', // shown when transcribing fails to start // ], // List of notifications to be disabled. Works in tandem with the above setting. @@ -1346,14 +1423,25 @@ var config = { // // Disables the stage filmstrip // // (displaying multiple participants on stage besides the vertical filmstrip) - // disableStageFilmstrip: false + // disableStageFilmstrip: false, + + // // Default number of participants that can be displayed on stage. + // // The user can change this in settings. Number must be between 1 and 6. + // stageFilmstripParticipants: 1, + + // // Disables the top panel (only shown when a user is sharing their screen). + // disableTopPanel: false, + + // // The minimum number of participants that must be in the call for + // // the top panel layout to be used. + // minParticipantCountForTopPanel: 50, // }, // Tile view related config options. // tileView: { // // The optimal number of tiles that are going to be shown in tile view. Depending on the screen size it may // // not be possible to show the exact number of participants specified here. - // numberOfVisibleTiles: 25 + // numberOfVisibleTiles: 25, // }, // Specifies whether the chat emoticons are disabled or not @@ -1370,15 +1458,42 @@ var config = { // // - chat: show the GIF as a message in chat // // - all: all of the above. This is the default option // displayMode: 'all', - // // How long the GIF should be displayed on the tile (in miliseconds). - // tileTime: 5000 + // // How long the GIF should be displayed on the tile (in milliseconds). + // tileTime: 5000, // }, - // Allow all above example options to include a trailing comma and - // prevent fear when commenting out the last value. - makeJsonParserHappy: 'even if last key had a trailing comma' + // Logging + // logging: { + // // Default log level for the app and lib-jitsi-meet. + // defaultLogLevel: 'trace', + // // Option to disable LogCollector (which stores the logs on CallStats). + // //disableLogCollector: true, + // // Individual loggers are customizable. + // loggers: { + // // The following are too verbose in their logging with the default level. + // 'modules/RTC/TraceablePeerConnection.js': 'info', + // 'modules/statistics/CallStats.js': 'info', + // 'modules/xmpp/strophe.util.js': 'log', + // }, - // no configuration value should follow this line. + // Application logo url + // defaultLogoUrl: 'images/watermark.svg', + + // Settings for the Excalidraw whiteboard integration. + // whiteboard: { + // // Whether the feature is enabled or not. + // enabled: true, + // // The server used to support whiteboard collaboration. + // // https://github.com/jitsi/excalidraw-backend + // collabServerBaseUrl: 'https://excalidraw-backend.example.com', + // }, }; +// Set the default values for JaaS customers +if (enableJaaS) { + config.dialInNumbersUrl = 'https://conference-mapper.jitsi.net/v1/access/dids'; + config.dialInConfCodeUrl = 'https://conference-mapper.jitsi.net/v1/access'; + config.roomPasswordNumberOfDigits = 10; // skip re-adding it (do not remove comment) +} + /* eslint-enable no-unused-vars, no-var */ diff --git a/conf/jitsi-meet-prosody.src b/conf/jitsi-meet-prosody.src index 840c658..44ef8df 100644 --- a/conf/jitsi-meet-prosody.src +++ b/conf/jitsi-meet-prosody.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://download.jitsi.org/stable/jitsi-meet-prosody_1.0.6155-1_all.deb -SOURCE_SUM=2503d45b9cb92d46c43c211ca3d9c3904fd9045062ac121237b0ed7695e5c727 +SOURCE_URL=https://download.jitsi.org/stable/jitsi-meet-prosody_1.0.6644-1_all.deb +SOURCE_SUM=e358e572c26970594d74120e01dcd3505df039400e4bdba917fbb115068650b7 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=deb SOURCE_IN_SUBDIR=true diff --git a/conf/jitsi-meet-web.src b/conf/jitsi-meet-web.src index 7e7b8a2..0356d85 100644 --- a/conf/jitsi-meet-web.src +++ b/conf/jitsi-meet-web.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://download.jitsi.org/stable/jitsi-meet-web_1.0.6155-1_all.deb -SOURCE_SUM=3ef7e8be35efc76db7bc4f577de136f48cae0900cf2646418909449d721fcace +SOURCE_URL=https://download.jitsi.org/stable/jitsi-meet-web_1.0.6644-1_all.deb +SOURCE_SUM=69e756970092b3e88336779e344aa6b888048e945103cc3acdca5e7b33c24a40 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=deb SOURCE_IN_SUBDIR=true diff --git a/conf/jitsi-sctp.src b/conf/jitsi-sctp.src index 034ec40..efc66c1 100644 --- a/conf/jitsi-sctp.src +++ b/conf/jitsi-sctp.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/jitsi/jitsi-sctp/archive/04269a7342fbd3bd66dd40ed892cfc80559d62d4.tar.gz -SOURCE_SUM=2aa4f596e96186d43f4beb3e9db9907d23b993d974e15dd051031f4d00423bf2 +SOURCE_URL=https://github.com/jitsi/jitsi-sctp/archive/45bf9f296167f79a52cdc1b0e93bbfa4dc8c4976.tar.gz +SOURCE_SUM=1eead17b10d059bafe8e1b06a8351936b608e7514b131588deac61d24b859397 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/jitsi-videobridge.src b/conf/jitsi-videobridge.src index b7a9152..26f7c87 100644 --- a/conf/jitsi-videobridge.src +++ b/conf/jitsi-videobridge.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://download.jitsi.org/stable/jitsi-videobridge2_2.1-681-g3544ed05-1_all.deb -SOURCE_SUM=f3a973b7d4a767a969a3bcfa3d0bd531945d349d3378350ff76c2b6e747415b1 +SOURCE_URL=https://download.jitsi.org/stable/jitsi-videobridge2_2.2-45-ge8b20f06-1_all.deb +SOURCE_SUM=7db4a98cb771f716cb769eefcc74d6f41fdc0dfdc36a1a70b88e0872a12aa5ab SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=deb SOURCE_IN_SUBDIR=true diff --git a/conf/usrsctp.src b/conf/usrsctp.src index aeb80da..2d232cd 100644 --- a/conf/usrsctp.src +++ b/conf/usrsctp.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/sctplab/usrsctp/archive/c138bc04bbb20b34fc10fd50e34c1723c40896c4.tar.gz -SOURCE_SUM=ff4808da7c4bbd886feeb03a74eee1cb235a7d4c9a20c16a37581fe10d55dd4b +SOURCE_URL=https://github.com/sctplab/usrsctp/archive/8e12cd9e01fc94d2e84ea1afa351c845966e116e.tar.gz +SOURCE_SUM=0574a31fecca543cf8e46c1bff441a3048ccf7d403da0543639db334e9a09b2f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 9bf596c..c6c6908 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Video conferencing web application", "fr": "Application web de conférence vidéo" }, - "version": "1.0.6155~ynh2", + "version": "2.0.7882~ynh1", "url": "https://jitsi.org/Projects/JitMeet", "upstream": { "license": "Apache-2.0", @@ -27,7 +27,7 @@ } ], "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0.8" }, "multi_instance": false, "services": [ @@ -41,4 +41,4 @@ } ] } -} \ No newline at end of file +} diff --git a/scripts/_common.sh b/scripts/_common.sh index b71ccbf..ebf5abd 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -67,7 +67,6 @@ ynh_jniwrapper_armhf () ynh_secure_remove --file="$tempdir" } - #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index ca1534e..392e32c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -23,7 +23,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_print_info --message="Loading settings..." app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/install b/scripts/install index 5436fea..d4d4759 100644 --- a/scripts/install +++ b/scripts/install @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_apps source /usr/share/yunohost/helpers #================================================= @@ -15,7 +14,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ynh_clean_check_starting + true } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -48,7 +47,7 @@ max_memory=200 #125 mib with no user +1,5*50 users=75 mib #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." +ynh_script_progression --message="Validating installation parameters..." --weight=1 final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -59,7 +58,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." +ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url @@ -76,7 +75,7 @@ ynh_app_setting_set --app=$app --key=turn_secret --value=$turn_secret #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." +ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port port=4443 @@ -97,7 +96,7 @@ ynh_app_setting_set --app=$app --key=port_component --value=$port_component #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." +ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_install_apps --apps="$ynh_app_dependencies" ynh_install_app_dependencies $pkg_dependencies @@ -111,7 +110,7 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." +ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user ynh_system_user_create --username=$app --home_dir="$final_path" @@ -121,7 +120,7 @@ gpasswd --add www-data $app #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." +ynh_script_progression --message="Setting up source files..." --weight=1 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src @@ -152,7 +151,7 @@ chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." +ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -162,7 +161,7 @@ ynh_add_nginx_config #================================================= # CONFIGURE PROSODY #================================================= -ynh_script_progression --message="Configuring prosody..." +ynh_script_progression --message="Configuring prosody..." --weight=1 ynh_add_config --template="../conf/prosody.cfg.lua" --destination="/etc/prosody/conf.avail/$domain.cfg.lua" chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" @@ -191,7 +190,7 @@ prosodyctl mod_roster_command subscribe $focus_user.$domain $focus_user@auth.$do #================================================= # CONFIGURE JITSI-VIDEOBRIDGE #================================================= -ynh_script_progression --message="Configuring Jitsi-Videobridge..." +ynh_script_progression --message="Configuring Jitsi-Videobridge..." --weight=1 public_ipv4="$(curl ip.yunohost.org)" || true private_ipv4="$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')" || true @@ -217,7 +216,7 @@ ynh_add_config --template="../conf/jitsi-videobridge.config" --destination="/etc if [ $YNH_ARCH == "armhf" ] then - ynh_script_progression --message="Configuring jniwrapper for armhf ..." + ynh_script_progression --message="Configuring jniwrapper for armhf ..." --weight=1 ynh_jniwrapper_armhf fi @@ -225,7 +224,7 @@ fi #================================================= # CONFIGURE JITSI-JICOFO #================================================= -ynh_script_progression --message="Configuring Jitsi-Jicofo..." +ynh_script_progression --message="Configuring Jitsi-Jicofo..." --weight=1 mkdir -p "/etc/$app/jicofo" @@ -238,7 +237,7 @@ ynh_add_config --template="../conf/jitsi-jicofo-logging.properties" --destinatio #================================================= # CONFIGURE JITSI-MEET #================================================= -ynh_script_progression --message="Configuring Jitsi-Meet..." +ynh_script_progression --message="Configuring Jitsi-Meet..." --weight=1 mkdir -p "/etc/$app/meet" @@ -248,7 +247,7 @@ chmod 644 "/etc/$app/meet/$domain-config.js" #================================================= # CREATE LOG DIR #================================================= -ynh_script_progression --message="Creating log dir..." +ynh_script_progression --message="Creating log dir..." --weight=1 mkdir -p "/var/log/$app" chown -R $app: /var/log/$app @@ -257,7 +256,7 @@ chmod -R 770 /var/log/$app #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_script_progression --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions to app files chown -R $app: /etc/$app @@ -265,7 +264,7 @@ chown -R $app: /etc/$app #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." +ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config --service=$app-videobridge --template="jitsi-videobridge.service" @@ -276,7 +275,7 @@ ynh_add_systemd_config --service=$app-jicofo --template="jitsi-jicofo.service" #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Configuring log rotation..." +ynh_script_progression --message="Configuring log rotation..." --weight=1 # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -284,7 +283,7 @@ ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app-videobridge --log "/var/log/$app/$app-videobridge.log" --needs_exposed_ports $port $port_videobridge yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" @@ -292,7 +291,7 @@ yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" @@ -301,7 +300,7 @@ ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path=" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public ynh_permission_update --permission="main" --add="visitors" @@ -309,7 +308,7 @@ ynh_permission_update --permission="main" --add="visitors" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -317,4 +316,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index 1385a61..ea7b87c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -7,13 +7,12 @@ #================================================= source _common.sh -source ynh_apps source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_script_progression --message="Loading settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -34,20 +33,20 @@ videobridge_user=$(ynh_app_setting_get --app=$app --key=videobridge_user) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app-videobridge >/dev/null then - ynh_script_progression --message="Removing $app-videobridge service..." + ynh_script_progression --message="Removing $app-videobridge service..." --weight=1 yunohost service remove $app-videobridge fi if ynh_exec_warn_less yunohost service status $app-jicofo >/dev/null then - ynh_script_progression --message="Removing $app-jicofo service..." + ynh_script_progression --message="Removing $app-jicofo service..." --weight=1 yunohost service remove $app-jicofo fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." +ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 # Remove the dedicated systemd config ynh_remove_systemd_config --service=$app-videobridge @@ -56,7 +55,7 @@ ynh_remove_systemd_config --service=$app-jicofo #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 # Remove the app-specific logrotate config ynh_remove_logrotate @@ -64,7 +63,7 @@ ynh_remove_logrotate #================================================= # RECONFIGURE PROSODY #================================================= -ynh_script_progression --message="Reconfiguring Prosody..." +ynh_script_progression --message="Reconfiguring Prosody..." --weight=1 prosodyctl deluser $focus_user@auth.$domain || true prosodyctl deluser $videobridge_user@auth.$domain || true @@ -91,7 +90,7 @@ ynh_systemd_action --service_name=prosody --action=restart #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." +ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -99,7 +98,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config @@ -107,7 +106,7 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." +ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -124,13 +123,13 @@ ynh_remove_apps if yunohost firewall list | grep -q "\- $port$" then - ynh_script_progression --message="Closing port $port..." + ynh_script_progression --message="Closing port $port..." --weight=1 ynh_exec_warn_less yunohost firewall disallow TCP $port fi if yunohost firewall list | grep -q "\- $port_videobridge$" then - ynh_script_progression --message="Closing port $port_videobridge..." + ynh_script_progression --message="Closing port $port_videobridge..." --weight=1 ynh_exec_warn_less yunohost firewall disallow UDP $port_videobridge fi @@ -139,7 +138,7 @@ fi #================================================= # REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing various files..." +ynh_script_progression --message="Removing various files..." --weight=1 # Remove a directory securely ynh_secure_remove --file="/etc/$app" @@ -152,7 +151,7 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 gpasswd --delete www-data $app # Delete a system user @@ -162,4 +161,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index 264c514..5aed508 100644 --- a/scripts/restore +++ b/scripts/restore @@ -8,7 +8,6 @@ # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh -source ../settings/scripts/ynh_apps source /usr/share/yunohost/helpers #================================================= @@ -16,7 +15,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ynh_clean_check_starting + true } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -24,7 +23,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_script_progression --message="Loading settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -46,7 +45,7 @@ port_component=$(ynh_app_setting_get --app=$app --key=port_component) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." +ynh_script_progression --message="Validating restoration parameters..." --weight=1 test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " @@ -56,7 +55,7 @@ test ! -d $final_path \ #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" @@ -65,7 +64,7 @@ gpasswd --add www-data $app #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_restore_file --origin_path="$final_path" @@ -78,7 +77,7 @@ chown -R $app:$app "$final_path" #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies ynh_install_apps --apps="$ynh_app_dependencies" @@ -86,7 +85,7 @@ ynh_install_app_dependencies $pkg_dependencies if [ $YNH_ARCH == "armhf" ] then - ynh_script_progression --message="Installing specific arm dependencies..." + ynh_script_progression --message="Installing specific arm dependencies..." --weight=1 ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" fi @@ -95,14 +94,14 @@ gpasswd --add prosody $app #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # CONFIGURE FIREWALL #================================================= -ynh_script_progression --message="Configuring firewall..." +ynh_script_progression --message="Configuring firewall..." --weight=1 # Open this port ynh_exec_warn_less yunohost firewall allow TCP $port @@ -111,7 +110,7 @@ ynh_exec_warn_less yunohost firewall allow UDP $port_videobridge #================================================= # CONFIGURE PROSODY #================================================= -ynh_script_progression --message="Configuring prosody..." +ynh_script_progression --message="Configuring prosody..." --weight=1 ynh_restore_file --origin_path="/etc/prosody/conf.avail/$domain.cfg.lua" chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" @@ -137,7 +136,7 @@ prosodyctl mod_roster_command subscribe $focus_user.$domain $focus_user@auth.$do #================================================= # RESTORE THE APP CONFIG #================================================= -ynh_script_progression --message="Restoring the app config..." +ynh_script_progression --message="Restoring the app config..." --weight=1 ynh_restore_file --origin_path="/etc/$app" @@ -146,7 +145,7 @@ chmod 644 "/etc/$app/meet/$domain-config.js" #================================================= # CREATE LOG DIR #================================================= -ynh_script_progression --message="Creating log dir..." +ynh_script_progression --message="Creating log dir..." --weight=1 mkdir -p "/var/log/$app" chown -R $app: /var/log/$app @@ -154,7 +153,7 @@ chown -R $app: /var/log/$app #================================================= # RESTORE SYSTEMD #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." +ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 ynh_restore_file --origin_path="/etc/systemd/system/$app-videobridge.service" systemctl enable $app-videobridge.service --quiet @@ -164,14 +163,14 @@ systemctl enable $app-jicofo.service --quiet #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." +ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app-videobridge --log "/var/log/$app/$app-videobridge.log" --needs_exposed_ports $port $port_videobridge yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" @@ -179,7 +178,7 @@ yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" @@ -189,7 +188,7 @@ ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path=" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -197,4 +196,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index 93c02cb..9b31041 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,13 +7,12 @@ #================================================= source _common.sh -source ynh_apps source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_script_progression --message="Loading settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -40,7 +39,7 @@ port_component=$(ynh_app_setting_get --app=$app --key=port_component) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." +ynh_script_progression --message="Checking version..." --weight=1 upgrade_type=$(ynh_check_app_version_changed) current_version=$(ynh_read_manifest --manifest="/etc/yunohost/apps/$app/manifest.json" --manifest_key="version" || echo 1.0) @@ -53,7 +52,6 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - ynh_clean_check_starting # Restore it if the upgrade fails ynh_restore_upgradebackup } @@ -65,7 +63,7 @@ ynh_abort_if_errors #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app-videobridge --action="stop" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="/var/log/$app/$app-jicofo.log" @@ -73,7 +71,7 @@ ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="/var/l #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If final_path doesn't exist, create it if [ -z "$final_path" ]; then @@ -90,7 +88,7 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" @@ -102,7 +100,7 @@ gpasswd --add www-data $app if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." + ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src declare -A packages @@ -134,14 +132,14 @@ chown -R $app:$app "$final_path" #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." +ynh_script_progression --message="Upgrading dependencies..." --weight=1 ynh_install_apps --apps="$ynh_app_dependencies" ynh_install_app_dependencies $pkg_dependencies if [ $YNH_ARCH == "armhf" ] then - ynh_script_progression --message="Installing specific arm dependencies..." + ynh_script_progression --message="Installing specific arm dependencies..." --weight=1 ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" fi @@ -150,7 +148,7 @@ gpasswd --add prosody $app #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -160,7 +158,7 @@ ynh_add_nginx_config #================================================= # CONFIGURE FIREWALL #================================================= -ynh_script_progression --message="Configuring firewall..." +ynh_script_progression --message="Configuring firewall..." --weight=1 # Open this port ynh_exec_warn_less yunohost firewall allow TCP $port @@ -169,7 +167,7 @@ ynh_exec_warn_less yunohost firewall allow UDP $port_videobridge #================================================= # CONFIGURE PROSODY #================================================= -ynh_script_progression --message="Configuring Prosody..." +ynh_script_progression --message="Configuring Prosody..." --weight=1 if [ "$upgrade_type" == "UPGRADE_APP" ] then @@ -180,7 +178,7 @@ fi #================================================= # CONFIGURE JITSI-VIDEOBRIDGE #================================================= -ynh_script_progression --message="Configuring Jitsi-Videobridge..." +ynh_script_progression --message="Configuring Jitsi-Videobridge..." --weight=1 if [ "$upgrade_type" == "UPGRADE_APP" ] then @@ -205,7 +203,7 @@ fi if [ $YNH_ARCH == "armhf" ] then - ynh_script_progression --message="Configuring jniwrapper for armhf ..." + ynh_script_progression --message="Configuring jniwrapper for armhf ..." --weight=1 ynh_jniwrapper_armhf fi @@ -213,7 +211,7 @@ fi #================================================= # CONFIGURE JITSI-JICOFO #================================================= -ynh_script_progression --message="configuring Jitsi-Jicofo..." +ynh_script_progression --message="configuring Jitsi-Jicofo..." --weight=1 if [ "$upgrade_type" == "UPGRADE_APP" ] then @@ -227,7 +225,7 @@ fi #================================================= # CONFIGURE JITSI-MEET #================================================= -ynh_script_progression --message="Configuring Jitsi-Meet..." +ynh_script_progression --message="Configuring Jitsi-Meet..." --weight=1 if [ "$upgrade_type" == "UPGRADE_APP" ] then @@ -238,7 +236,7 @@ fi #================================================= # CREATE LOG DIR #================================================= -ynh_script_progression --message="Creating log dir..." +ynh_script_progression --message="Creating log dir..." --weight=1 mkdir -p "/var/log/$app" chown -R $app: /var/log/$app @@ -247,7 +245,7 @@ chmod -R 770 /var/log/$app #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_script_progression --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions on app files chown -R $app: /etc/$app @@ -255,7 +253,7 @@ chown -R $app: /etc/$app #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." +ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config --service=$app-videobridge --template="jitsi-videobridge.service" @@ -266,7 +264,7 @@ ynh_add_systemd_config --service=$app-jicofo --template="jitsi-jicofo.service" #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." +ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append @@ -274,7 +272,7 @@ ynh_use_logrotate --non-append #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app-videobridge --log "/var/log/$app/$app-videobridge.log" --needs_exposed_ports $port $port_videobridge yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" @@ -282,7 +280,7 @@ yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" @@ -290,7 +288,7 @@ ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path=" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -298,4 +296,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" +ynh_script_progression --message="Upgrade of $app completed" --last diff --git a/scripts/ynh_apps b/scripts/ynh_apps deleted file mode 100644 index 0faad86..0000000 --- a/scripts/ynh_apps +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/bash - -# Install others YunoHost apps -# -# usage: ynh_install_apps --apps="appfoo?domain=domain.foo&path=/foo appbar?domain=domain.bar&path=/bar&admin=USER&language=fr&is_public=1&pass?word=pass&port=666" -# | arg: -a, --apps= - apps to install -# -# Requires YunoHost version *.*.* or higher. -ynh_install_apps() { - # Declare an array to define the options of this helper. - local legacy_args=a - local -A args_array=([a]=apps=) - local apps - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - # Split the list of apps in an array - local apps_list=($(echo $apps | tr " " "\n")) - local apps_dependencies="" - - # For each app - for one_app_and_its_args in "${apps_list[@]}" - do - # Retrieve the name of the app (part before ?) - local one_app=$(cut -d "?" -f1 <<< "$one_app_and_its_args") - [ -z "$one_app" ] && ynh_die --message="You didn't provided a YunoHost app to install" - - yunohost tools update apps - - # Installing or upgrading the app depending if it's installed or not - if ! yunohost app list --output-as json --quiet | jq -e --arg id $one_app '.apps[] | select(.id == $id)' >/dev/null - then - # Retrieve the arguments of the app (part after ?) - local one_argument=$(cut -d "?" -f2- <<< "$one_app_and_its_args") - [ ! -z "$one_argument" ] && one_argument="--args $one_argument" - - # Install the app with its arguments - yunohost app install $one_app $one_argument - else - # Upgrade the app - yunohost app upgrade $one_app - fi - - if [ ! -z "$apps_dependencies" ] - then - apps_dependencies="$apps_dependencies, $one_app" - else - apps_dependencies="$one_app" - fi - done - - ynh_app_setting_set --app=$app --key=apps_dependencies --value="$apps_dependencies" -} - -# Remove other YunoHost apps -# -# Other YunoHost apps will be removed only if no other apps need them. -# -# usage: ynh_remove_apps -# -# Requires YunoHost version *.*.* or higher. -ynh_remove_apps() { - # Retrieve the apps dependencies of the app - local apps_dependencies=$(ynh_app_setting_get --app=$app --key=apps_dependencies) - ynh_app_setting_delete --app=$app --key=apps_dependencies - - if [ ! -z "$apps_dependencies" ] - then - # Split the list of apps dependencies in an array - local apps_dependencies_list=($(echo $apps_dependencies | tr ", " "\n")) - - # For each apps dependencies - for one_app in "${apps_dependencies_list[@]}" - do - # Retrieve the list of installed apps - local installed_apps_list=$(yunohost app list --output-as json --quiet | jq -r .apps[].id) - local required_by="" - local installed_app_required_by="" - - # For each other installed app - for one_installed_app in $installed_apps_list - do - # Retrieve the other apps dependencies - one_installed_apps_dependencies=$(ynh_app_setting_get --app=$one_installed_app --key=apps_dependencies) - if [ ! -z "$one_installed_apps_dependencies" ] - then - one_installed_apps_dependencies_list=($(echo $one_installed_apps_dependencies | tr ", " "\n")) - - # For each dependency of the other apps - for one_installed_app_dependency in "${one_installed_apps_dependencies_list[@]}" - do - if [[ $one_installed_app_dependency == $one_app ]]; then - required_by="$required_by $one_installed_app" - fi - done - fi - done - - # If $one_app is no more required - if [[ -z "$required_by" ]] - then - # Remove $one_app - ynh_print_info --message="Removing of $one_app" - yunohost app remove $one_app --purge - else - ynh_print_info --message="$one_app was not removed because it's still required by${required_by}" - fi - done - fi -}