From 75939291703cf18010495f6b85d6d65e01184235 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 22 Nov 2018 15:40:49 +0100 Subject: Check free storage before upgrading --- scripts/upgrade.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts') diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index c70b3b42a..0a9ce1dab 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -20,6 +20,14 @@ if [ ! -e "$PEERTUBE_PATH/versions" -o ! -e "$PEERTUBE_PATH/config/production.ya exit 1 fi +REMAINING=$(df -k $PEERTUBE_PATH | awk '{ print $4}' | sed -n 2p) +ONE_GB=$((1024 * 1024)) +if [ "$REMAINING" -lt "$ONE_GB" ]; then + echo "Error - not enough free space for upgrading" + echo "" + echo "Make sure you have at least 1 GB of free space in $PEERTUBE_PATH" + exit 1 +fi # Backup database SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" -- cgit v1.2.3 From 5c94c38d18a02864b6f384bcd829a0d3f2d86c4a Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sat, 1 Dec 2018 14:00:07 +0100 Subject: Check if awk and sed are executable --- scripts/upgrade.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 0a9ce1dab..4f7c58edd 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -20,13 +20,15 @@ if [ ! -e "$PEERTUBE_PATH/versions" -o ! -e "$PEERTUBE_PATH/config/production.ya exit 1 fi -REMAINING=$(df -k $PEERTUBE_PATH | awk '{ print $4}' | sed -n 2p) -ONE_GB=$((1024 * 1024)) -if [ "$REMAINING" -lt "$ONE_GB" ]; then - echo "Error - not enough free space for upgrading" - echo "" - echo "Make sure you have at least 1 GB of free space in $PEERTUBE_PATH" - exit 1 +if [ -x "$(command -v awk)" ] && [ -x "$(command -v sed)" ] ; then + REMAINING=$(df -k $PEERTUBE_PATH | awk '{ print $4}' | sed -n 2p) + ONE_GB=$((1024 * 1024)) + if [ "$REMAINING" -lt "$ONE_GB" ]; then + echo "Error - not enough free space for upgrading" + echo "" + echo "Make sure you have at least 1 GB of free space in $PEERTUBE_PATH" + exit 1 + fi fi # Backup database -- cgit v1.2.3 From d7aea77bdb989df7df4a9c492f5e5ab033291e07 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Dec 2018 17:43:24 +0100 Subject: Add ru pl and it translations --- scripts/build/client.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/build/client.sh b/scripts/build/client.sh index 62daf98cf..be3eef802 100755 --- a/scripts/build/client.sh +++ b/scripts/build/client.sh @@ -41,7 +41,7 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then languages=("fr_FR") else # Supported languages - languages=("fr_FR" "pt_BR" "sv_SE" "eu_ES" "ca_ES" "cs_CZ" "eo" "zh_Hant_TW" "de_DE" "es_ES" "oc" "zh_Hans_CN") + languages=("pl_PL" "it_IT" "ru_RU" "fr_FR" "pt_BR" "sv_SE" "eu_ES" "ca_ES" "cs_CZ" "eo" "zh_Hant_TW" "de_DE" "es_ES" "oc" "zh_Hans_CN") fi for lang in "${languages[@]}"; do -- cgit v1.2.3 From 2feebf3e6afaad9ab80976d1557d3a7bcf94de03 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 5 Dec 2018 17:27:24 +0100 Subject: Add sitemap --- scripts/clean/server/test.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/clean/server/test.sh b/scripts/clean/server/test.sh index 235ff52cc..b897c30ba 100755 --- a/scripts/clean/server/test.sh +++ b/scripts/clean/server/test.sh @@ -18,6 +18,7 @@ removeFiles () { dropRedis () { redis-cli KEYS "bull-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL + redis-cli KEYS "redis-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL } for i in $(seq 1 6); do -- cgit v1.2.3 From 7089e7b4e570710acac408bf95c688932a491707 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 5 Dec 2018 17:44:36 +0100 Subject: Improve information regarding prune storage script --- scripts/prune-storage.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index 4ab0b4863..c0cd198f7 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts @@ -91,6 +91,7 @@ async function askConfirmation () { confirm: { type: 'string', description: 'These following unused files can be deleted, but please check your backups first (bugs happen).' + + ' Notice PeerTube must have been stopped when your ran this script.' + ' Can we delete these files?', default: 'n', required: true -- cgit v1.2.3 From 3ba862daecd3429d4438f0da6c4fa04e9631c0ae Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 6 Dec 2018 09:42:45 +0100 Subject: Add tmp and redundancy directories to prune script --- scripts/prune-storage.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index c0cd198f7..f2be1b8ee 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts @@ -19,7 +19,8 @@ async function run () { const storageOnlyOwnedToPrune = [ CONFIG.STORAGE.VIDEOS_DIR, - CONFIG.STORAGE.TORRENTS_DIR + CONFIG.STORAGE.TORRENTS_DIR, + CONFIG.STORAGE.REDUNDANCY_DIR ] const storageForAllToPrune = [ @@ -36,6 +37,8 @@ async function run () { toDelete = toDelete.concat(await pruneDirectory(directory, false)) } + toDelete = toDelete.concat(await readdir(CONFIG.STORAGE.TMP_DIR)) + if (toDelete.length === 0) { console.log('No files to delete.') return -- cgit v1.2.3 From be9727bd327e8dfb15d440ba8418de7da301a74e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 6 Dec 2018 09:46:22 +0100 Subject: Add base dir to prune storage script --- scripts/prune-storage.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index f2be1b8ee..c9e4dbd4b 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts @@ -37,7 +37,8 @@ async function run () { toDelete = toDelete.concat(await pruneDirectory(directory, false)) } - toDelete = toDelete.concat(await readdir(CONFIG.STORAGE.TMP_DIR)) + const tmpFiles = await readdir(CONFIG.STORAGE.TMP_DIR) + toDelete = toDelete.concat(tmpFiles.map(t => join(CONFIG.STORAGE.TMP_DIR, t))) if (toDelete.length === 0) { console.log('No files to delete.') -- cgit v1.2.3 From 2f1548fda32c3ba9e53913270394eedfacd55986 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 8 Jan 2019 11:26:41 +0100 Subject: Add notifications in the client --- scripts/clean/server/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/clean/server/test.sh b/scripts/clean/server/test.sh index b897c30ba..75ad491bf 100755 --- a/scripts/clean/server/test.sh +++ b/scripts/clean/server/test.sh @@ -13,7 +13,7 @@ recreateDB () { } removeFiles () { - rm -rf "./test$1" "./config/local-test.json" "./config/local-test-$1.json" + rm -rf "./test$1" "./config/local-test-$1.json" } dropRedis () { -- cgit v1.2.3 From d3e56c0c4b307c99e83fbafb7f2c5884cbc20055 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 10 Jan 2019 11:12:41 +0100 Subject: Implement contact form in the client --- scripts/clean/server/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/clean/server/test.sh b/scripts/clean/server/test.sh index 75ad491bf..b897c30ba 100755 --- a/scripts/clean/server/test.sh +++ b/scripts/clean/server/test.sh @@ -13,7 +13,7 @@ recreateDB () { } removeFiles () { - rm -rf "./test$1" "./config/local-test-$1.json" + rm -rf "./test$1" "./config/local-test.json" "./config/local-test-$1.json" } dropRedis () { -- cgit v1.2.3 From 93f85e90ffa27453e2c909406b62bef65963b8ad Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 10 Jan 2019 12:07:34 +0100 Subject: Update credits --- scripts/generate-code-contributors.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/generate-code-contributors.ts b/scripts/generate-code-contributors.ts index 3d37372d1..9824bc2f5 100755 --- a/scripts/generate-code-contributors.ts +++ b/scripts/generate-code-contributors.ts @@ -70,11 +70,17 @@ async function fetchGithub (url: string) { async function fetchZanata (zanataUsername: string, zanataPassword: string) { const today = new Date().toISOString().split('T')[0] - const url = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2018-01-01..${today}` + const year2018 = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2018-01-01..2019-01-01` + const year2019 = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2019-01-01..${today}` const headers = { 'X-Auth-User': zanataUsername, 'X-Auth-Token': zanataPassword } - return get(url, headers) + const [ results2018, results2019 ] = await Promise.all([ + get(year2018, headers), + get(year2019, headers) + ]) + + return results2018.concat(results2019) } -- cgit v1.2.3 From ad3fa0c56715f98886b1b6400fc54ce7d568d899 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 14 Jan 2019 17:45:02 +0100 Subject: Add missing translations in embed template --- scripts/i18n/create-custom-files.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts index eed3182a6..ab28f94c8 100755 --- a/scripts/i18n/create-custom-files.ts +++ b/scripts/i18n/create-custom-files.ts @@ -42,6 +42,12 @@ values(VIDEO_CATEGORIES) .concat(values(VIDEO_PRIVACIES)) .concat(values(VIDEO_STATES)) .concat(values(VIDEO_IMPORT_STATES)) + .concat([ + 'This video does not exist.', + 'We cannot fetch the video. Please try again later.', + 'Sorry', + 'This video is not available because the remote instance is not responding.' + ]) .forEach(v => serverKeys[v] = v) // More keys @@ -103,4 +109,4 @@ function saveToXliffFile (jsonTranslations: TranslationType, cb: Function) { function handleError (err: any) { console.error(err) process.exit(-1) -} \ No newline at end of file +} -- cgit v1.2.3