diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/client.sh | 2 | ||||
-rwxr-xr-x | scripts/clean/server/test.sh | 1 | ||||
-rwxr-xr-x | scripts/generate-code-contributors.ts | 10 | ||||
-rwxr-xr-x | scripts/i18n/create-custom-files.ts | 8 | ||||
-rwxr-xr-x | scripts/prune-storage.ts | 7 | ||||
-rwxr-xr-x | scripts/upgrade.sh | 10 |
6 files changed, 33 insertions, 5 deletions
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 | |||
41 | languages=("fr_FR") | 41 | languages=("fr_FR") |
42 | else | 42 | else |
43 | # Supported languages | 43 | # Supported languages |
44 | 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") | 44 | 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") |
45 | fi | 45 | fi |
46 | 46 | ||
47 | for lang in "${languages[@]}"; do | 47 | for lang in "${languages[@]}"; do |
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 () { | |||
18 | 18 | ||
19 | dropRedis () { | 19 | dropRedis () { |
20 | redis-cli KEYS "bull-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL | 20 | redis-cli KEYS "bull-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL |
21 | redis-cli KEYS "redis-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL | ||
21 | } | 22 | } |
22 | 23 | ||
23 | for i in $(seq 1 6); do | 24 | for i in $(seq 1 6); do |
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) { | |||
70 | 70 | ||
71 | async function fetchZanata (zanataUsername: string, zanataPassword: string) { | 71 | async function fetchZanata (zanataUsername: string, zanataPassword: string) { |
72 | const today = new Date().toISOString().split('T')[0] | 72 | const today = new Date().toISOString().split('T')[0] |
73 | const url = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2018-01-01..${today}` | 73 | const year2018 = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2018-01-01..2019-01-01` |
74 | const year2019 = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2019-01-01..${today}` | ||
74 | 75 | ||
75 | const headers = { | 76 | const headers = { |
76 | 'X-Auth-User': zanataUsername, | 77 | 'X-Auth-User': zanataUsername, |
77 | 'X-Auth-Token': zanataPassword | 78 | 'X-Auth-Token': zanataPassword |
78 | } | 79 | } |
79 | return get(url, headers) | 80 | const [ results2018, results2019 ] = await Promise.all([ |
81 | get(year2018, headers), | ||
82 | get(year2019, headers) | ||
83 | ]) | ||
84 | |||
85 | return results2018.concat(results2019) | ||
80 | } | 86 | } |
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) | |||
42 | .concat(values(VIDEO_PRIVACIES)) | 42 | .concat(values(VIDEO_PRIVACIES)) |
43 | .concat(values(VIDEO_STATES)) | 43 | .concat(values(VIDEO_STATES)) |
44 | .concat(values(VIDEO_IMPORT_STATES)) | 44 | .concat(values(VIDEO_IMPORT_STATES)) |
45 | .concat([ | ||
46 | 'This video does not exist.', | ||
47 | 'We cannot fetch the video. Please try again later.', | ||
48 | 'Sorry', | ||
49 | 'This video is not available because the remote instance is not responding.' | ||
50 | ]) | ||
45 | .forEach(v => serverKeys[v] = v) | 51 | .forEach(v => serverKeys[v] = v) |
46 | 52 | ||
47 | // More keys | 53 | // More keys |
@@ -103,4 +109,4 @@ function saveToXliffFile (jsonTranslations: TranslationType, cb: Function) { | |||
103 | function handleError (err: any) { | 109 | function handleError (err: any) { |
104 | console.error(err) | 110 | console.error(err) |
105 | process.exit(-1) | 111 | process.exit(-1) |
106 | } \ No newline at end of file | 112 | } |
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index 4ab0b4863..c9e4dbd4b 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts | |||
@@ -19,7 +19,8 @@ async function run () { | |||
19 | 19 | ||
20 | const storageOnlyOwnedToPrune = [ | 20 | const storageOnlyOwnedToPrune = [ |
21 | CONFIG.STORAGE.VIDEOS_DIR, | 21 | CONFIG.STORAGE.VIDEOS_DIR, |
22 | CONFIG.STORAGE.TORRENTS_DIR | 22 | CONFIG.STORAGE.TORRENTS_DIR, |
23 | CONFIG.STORAGE.REDUNDANCY_DIR | ||
23 | ] | 24 | ] |
24 | 25 | ||
25 | const storageForAllToPrune = [ | 26 | const storageForAllToPrune = [ |
@@ -36,6 +37,9 @@ async function run () { | |||
36 | toDelete = toDelete.concat(await pruneDirectory(directory, false)) | 37 | toDelete = toDelete.concat(await pruneDirectory(directory, false)) |
37 | } | 38 | } |
38 | 39 | ||
40 | const tmpFiles = await readdir(CONFIG.STORAGE.TMP_DIR) | ||
41 | toDelete = toDelete.concat(tmpFiles.map(t => join(CONFIG.STORAGE.TMP_DIR, t))) | ||
42 | |||
39 | if (toDelete.length === 0) { | 43 | if (toDelete.length === 0) { |
40 | console.log('No files to delete.') | 44 | console.log('No files to delete.') |
41 | return | 45 | return |
@@ -91,6 +95,7 @@ async function askConfirmation () { | |||
91 | confirm: { | 95 | confirm: { |
92 | type: 'string', | 96 | type: 'string', |
93 | description: 'These following unused files can be deleted, but please check your backups first (bugs happen).' + | 97 | description: 'These following unused files can be deleted, but please check your backups first (bugs happen).' + |
98 | ' Notice PeerTube must have been stopped when your ran this script.' + | ||
94 | ' Can we delete these files?', | 99 | ' Can we delete these files?', |
95 | default: 'n', | 100 | default: 'n', |
96 | required: true | 101 | required: true |
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index c70b3b42a..4f7c58edd 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh | |||
@@ -20,6 +20,16 @@ if [ ! -e "$PEERTUBE_PATH/versions" -o ! -e "$PEERTUBE_PATH/config/production.ya | |||
20 | exit 1 | 20 | exit 1 |
21 | fi | 21 | fi |
22 | 22 | ||
23 | if [ -x "$(command -v awk)" ] && [ -x "$(command -v sed)" ] ; then | ||
24 | REMAINING=$(df -k $PEERTUBE_PATH | awk '{ print $4}' | sed -n 2p) | ||
25 | ONE_GB=$((1024 * 1024)) | ||
26 | if [ "$REMAINING" -lt "$ONE_GB" ]; then | ||
27 | echo "Error - not enough free space for upgrading" | ||
28 | echo "" | ||
29 | echo "Make sure you have at least 1 GB of free space in $PEERTUBE_PATH" | ||
30 | exit 1 | ||
31 | fi | ||
32 | fi | ||
23 | 33 | ||
24 | # Backup database | 34 | # Backup database |
25 | SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" | 35 | SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" |