diff --git a/CONTRIBUTORS b/CONTRIBUTORS new file mode 100644 index 00000000..c39ae7fa --- /dev/null +++ b/CONTRIBUTORS @@ -0,0 +1,65 @@ +Danny Coates +Abhinav Adduri +Daniela Arcese +Peter deHaan +Erica +Francesco Lodolo +Michael Wolf +manxmensch +Håvar Henriksen +Rok Žerdin +Mark Liang +Théo Chevalier +Fjoerfoks +Marcelo Poli +Erica Wright +Matjaž Horvat +Selim Şumlu +Rodrigo +Kohei Yoshino +YFdyh000 +Juraj Cigáň +Bjørn I +Pin-guang Chen +Maykon Chagas +Weihang Lo +ravmn +Rhoslyn Prys +Balázs Meskó +Jordi Serratosa +Michael Köhler +Chuck Harmston +Moḥend Belqasem +Roberto Alvarado +Emin Mastizada +Tymur Faradzhev +avelper +Francesco Lodolo [:flod] +Daniel Thorn +Andreas Pettersson +John Gruen +Wil Clouser +Марко Костић (Marko Kostić) +eljuno +Sahithi +You-Wen Liang (Mark) +Ton +Johann-S +ariestiyansyah +dgadelha +erdem cobanoglu +goofy +Michal Stanke +Michal Vašíček +Alexander Slovesnik +Marco Aurélio +Cynthia Pereira +Rizky Ariestiyansyah +Jim Spentzos +xcffl +Sairam Raavi +Sandro +Lan Glad +Tomáš Zelina +Μιχάλης +Victor Bychek diff --git a/frontend/src/upload.js b/frontend/src/upload.js index 0f768244..9d3171c2 100644 --- a/frontend/src/upload.js +++ b/frontend/src/upload.js @@ -25,6 +25,11 @@ if (storage.has('referrer')) { window.referrer = 'external'; } +const allowedCopy = () => { + const support = !!document.queryCommandSupported; + return support ? document.queryCommandSupported('copy') : false; +}; + $(document).ready(function() { gcmCompliant() .then(function() { @@ -76,22 +81,23 @@ $(document).ready(function() { // copy link to clipboard $copyBtn.click(() => { - // record copied event from success screen - sendEvent('sender', 'copied', { - cd4: 'success-screen' - }); - copyToClipboard($('#link').attr('value')); - //disable button for 3s - $copyBtn.attr('disabled', true); - $('#link').attr('disabled', true); - $copyBtn.html( - '' - ); - window.setTimeout(() => { - $copyBtn.attr('disabled', false); - $('#link').attr('disabled', false); - $copyBtn.attr('data-l10n-id', 'copyUrlFormButton'); - }, 3000); + if (allowedCopy() && copyToClipboard($('#link').attr('value'))) { + // record copied event from success screen + sendEvent('sender', 'copied', { + cd4: 'success-screen' + }); + //disable button for 3s + $copyBtn.attr('disabled', true); + $('#link').attr('disabled', true); + $copyBtn.html( + '' + ); + window.setTimeout(() => { + $copyBtn.attr('disabled', false); + $('#link').attr('disabled', false); + $copyBtn.attr('data-l10n-id', 'copyUrlFormButton'); + }, 3000); + } }); $('.upload-window').on('dragover', () => { @@ -343,7 +349,8 @@ $(document).ready(function() { const $copyIcon = $('', { src: '/resources/copy-16.svg', class: 'icon-copy', - 'data-l10n-id': 'copyUrlHover' + 'data-l10n-id': 'copyUrlHover', + disabled: !allowedCopy() }); const expiry = document.createElement('td'); const del = document.createElement('td'); diff --git a/frontend/src/utils.js b/frontend/src/utils.js index 2566914f..599ef80c 100644 --- a/frontend/src/utils.js +++ b/frontend/src/utils.js @@ -127,12 +127,12 @@ function copyToClipboard(str) { sel.removeAllRanges(); sel.addRange(range); aux.setSelectionRange(0, str.length); - } - else { + } else { aux.select(); } - document.execCommand('copy'); + const result = document.execCommand('copy'); document.body.removeChild(aux); + return result; } const ONE_DAY_IN_MS = 86400000; diff --git a/package.json b/package.json index 8f268c45..91661650 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,7 @@ "build:download": "browserify frontend/src/download.js -g uglifyify -o public/download.js", "build:version": "node scripts/version", "build:vendor": "cp node_modules/l20n/dist/web/l20n.min.js node_modules/babel-polyfill/dist/polyfill.min.js public", + "contributors": "git shortlog -s -n | awk -F\\t '{print $2}' > CONTRIBUTORS", "dev": "npm run build && npm start", "format": "prettier '{frontend/src/,scripts/,server/,test/**/!(bundle)}*.js' 'public/*.css' --single-quote --write", "get-prod-locales": "node scripts/get-prod-locales", diff --git a/public/locales/dsb/send.ftl b/public/locales/dsb/send.ftl index 941aa764..58fedd59 100644 --- a/public/locales/dsb/send.ftl +++ b/public/locales/dsb/send.ftl @@ -67,6 +67,7 @@ expiredPageHeader = Toś ten wótkaz jo spadnjony abo njejo nigda eksistěrował notSupportedHeader = Waš wobglědowak se njepódpěra. // Firefox Send is a brand name and should not be localized. notSupportedDetail = Bóžko toś ten wobglědowak webtechnologiju njepódpěra, na kótarejž Firefox Send bazěrujo. Musyśo drugi wobglědowak wužywaś. My Firefox dopórucujomy! +notSupportedLink = Cogodla se mój wobglědowak njepódpěra? notSupportedOutdatedDetail = Bóžko toś ta wersija Firefox webtechnologiju njepódpěra, na kótarejž Firefox Send bazěrujo. Musyśo swój wobglědowak aktualizěrowaś. updateFirefox = Firefox aktualizěrowaś downloadFirefoxButtonSub = Dermotne ześěgnjenje diff --git a/public/locales/es-AR/send.ftl b/public/locales/es-AR/send.ftl index 6404644d..aa98f7eb 100644 --- a/public/locales/es-AR/send.ftl +++ b/public/locales/es-AR/send.ftl @@ -67,6 +67,7 @@ expiredPageHeader = ¡Este enlace ha expirado o nunca existió en primer lugar! notSupportedHeader = El navegador no está soportado. // Firefox Send is a brand name and should not be localized. notSupportedDetail = Desafortunadamente este navegador no soporta la tecnología web que necesita Firefox Send. Deberías probar otro navegador. ¡Te recomendamos Firefox! +notSupportedLink = ¿Por qué mi navegador no está soportado? notSupportedOutdatedDetail = Desafortunadamente esta versión de Firefox no soporta la tecnología web que necesita Firefox Send. Necesitás actualizar el navegador. updateFirefox = Actualizar Firefox downloadFirefoxButtonSub = Descarga gratuita diff --git a/public/locales/es-CL/send.ftl b/public/locales/es-CL/send.ftl index 9f38e7ac..4b26bda9 100644 --- a/public/locales/es-CL/send.ftl +++ b/public/locales/es-CL/send.ftl @@ -59,6 +59,7 @@ expiredPageHeader = ¡Este enlace ha expirado o quizá jamás existió! notSupportedHeader = Tu navegador no está soportado. // Firefox Send is a brand name and should not be localized. notSupportedDetail = Lamentablemente este navegador no soporta la tecnología web que potencia a Firefox Send. Deberás probar en otro navegador. ¡Recomendamos Firefox! +notSupportedLink = ¿Por qué mi navegador no es soportado? notSupportedOutdatedDetail = Lamentablemente esta versión de Firefox no soporta la tecnología web que potencia a Firefox Send. Deberás actualizar tu navegador. updateFirefox = Actualizar Firefox downloadFirefoxButtonSub = Descarga gratuita @@ -69,10 +70,7 @@ expiryFileList = Expira en deleteFileList = Eliminar nevermindButton = Da lo mismo legalHeader = Términos y privacidad -legalNoticeTestPilot = - Firefox Send es actualmente un experimento de Test Pilot, y está sujeto a los Términos del servicio y la Política de privacidad de Test Pilot. Puedes aprender más sobre este experimento y su recolección de datos aquí. - - +legalNoticeTestPilot = Firefox Send es actualmente un experimento de Test Pilot, y está sujeto a los Términos del servicio y la Política de privacidad de Test Pilot. Puedes aprender más sobre este experimento y su recolección de datos aquí. legalNoticeMozilla = El uso del sitio web de Firefox Send también está sujeto a la Política de privacidad de sitios web y los Términos de uso de sitios web de Mozilla. deletePopupText = ¿Eliminar este archivo? deletePopupYes = Sí diff --git a/public/locales/fy-NL/send.ftl b/public/locales/fy-NL/send.ftl index d3c6b69f..2e59a1a7 100644 --- a/public/locales/fy-NL/send.ftl +++ b/public/locales/fy-NL/send.ftl @@ -67,6 +67,7 @@ expiredPageHeader = Dizze keppeling is ferrûn of hat nea bestien! notSupportedHeader = Jo browser wurdt net stipe. // Firefox Send is a brand name and should not be localized. notSupportedDetail = Spitigernôch stipet dizze browser de webtechnology dy't Firefox Send mooglik makket net. Jo moatte in oare browser probearje. Wy rekommandearje Firefox! +notSupportedLink = Wêrom wurdt myn browser net stipe? notSupportedOutdatedDetail = Spitigernôch stipet dizze ferzje fan Firefox de webtechnology dy't Firefox Send mooflik makket net. Jo moatte jo browser fernije. updateFirefox = Firefox fernije downloadFirefoxButtonSub = Fergese download diff --git a/public/locales/hsb/send.ftl b/public/locales/hsb/send.ftl index b1fbda01..671c1d90 100644 --- a/public/locales/hsb/send.ftl +++ b/public/locales/hsb/send.ftl @@ -67,6 +67,7 @@ expiredPageHeader = Tutón wotkaz je spadnjeny abo njeje ženje eksistował! notSupportedHeader = Waš wobhladowak so njepodpěruje. // Firefox Send is a brand name and should not be localized. notSupportedDetail = Bohužel tutón wobhladowak webtechnologiju njepodpěruje, na kotrejž Firefox Send bazuje. Dyrbiće druhi wobhladowak wužiwać. My Firefox doporučemy! +notSupportedLink = Čehodla so mój wobhladowak njepodpěruje? notSupportedOutdatedDetail = Bohužel tuta wersija Firefox webtechnologiju njepodpěruje, na kotrejž Firefox Send bazuje. Dyrbiće swój wobhladowak aktualizować. updateFirefox = Firefox aktualizować downloadFirefoxButtonSub = Darmotne sćehnjenje diff --git a/public/locales/id/send.ftl b/public/locales/id/send.ftl index 3618fe5c..0f324b01 100644 --- a/public/locales/id/send.ftl +++ b/public/locales/id/send.ftl @@ -45,6 +45,9 @@ downloadFileName = Unduh { $filename } downloadFileSize = ({ $size }) // Firefox Send is a brand name and should not be localized. downloadMessage = Teman Anda mengirimkan berkas dengan Firefox Send, layanan yang memungkinkan Anda berbagi berkas dengan tautan yang aman, pribadi, dan terenkripsi yang secara otomatis berakhir untuk memastikan berkas Anda tidak daring selamanya. +// Text and title used on the download link/button (indicates an action). +downloadButtonLabel = Unduh + .title = Unduh downloadNotification = Unduhan Anda telah selesai. downloadFinish = Unduhan Selesai // Firefox Send is a brand name and should not be localized. Title text for button should be the same. @@ -64,6 +67,7 @@ expiredPageHeader = Tautan ini telah kedaluwarsa atau tidak pernah ada! notSupportedHeader = Peramban Anda tidak mendukung. // Firefox Send is a brand name and should not be localized. notSupportedDetail = Sayangnya peramban ini tidak mendukung teknologi web yang menggerakkan Firefox Send. Anda perlu mencoba peramban lain. Kami merekomendasikan Firefox! +notSupportedLink = Mengapa peramban saya tidak didukung? notSupportedOutdatedDetail = Sayangnya Firefox versi ini tidak mendukung teknologi web yang menggerakkan Firefox Send. Anda perlu memperbarui peramban Anda. updateFirefox = Perbarui Firefox downloadFirefoxButtonSub = Unduh Gratis diff --git a/public/locales/it/send.ftl b/public/locales/it/send.ftl index 2a68c63e..80e7c2d3 100644 --- a/public/locales/it/send.ftl +++ b/public/locales/it/send.ftl @@ -67,6 +67,7 @@ expiredPageHeader = Questo link è scaduto oppure non è mai esistito. notSupportedHeader = Il browser in uso non è supportato. // Firefox Send is a brand name and should not be localized. notSupportedDetail = Purtroppo questo browser non supporta le tecnologie web alla base di Firefox Send. Devi utilizzare un altro browser. Ti consigliamo Firefox! +notSupportedLink = Perché questo browser non risulta supportato? notSupportedOutdatedDetail = Purtroppo questa versione di Firefox non supporta le tecnologie web alla base di Firefox Send. È necessario aggiornare il browser. updateFirefox = Aggiorna Firefox downloadFirefoxButtonSub = Download gratuito diff --git a/public/locales/ja/send.ftl b/public/locales/ja/send.ftl index cb06d3fb..6ecc8a05 100644 --- a/public/locales/ja/send.ftl +++ b/public/locales/ja/send.ftl @@ -67,6 +67,7 @@ expiredPageHeader = このリンクは期限切れとなったか元々存在し notSupportedHeader = お使いのブラウザーには対応していません。 // Firefox Send is a brand name and should not be localized. notSupportedDetail = 残念ながらお使いのブラウザーは Firefox Send が活用しているウェブ技術に対応していません。他のブラウザーで試してください。私たちは Firefox をお勧めします! +notSupportedLink = なぜ私のブラウザには対応していないのでしょうか? notSupportedOutdatedDetail = 残念ながらお使いのバージョンの Firefox は Firefox Send が活用しているウェブ技術に対応していません。ブラウザーを更新する必要があります。 updateFirefox = Firefox を更新 downloadFirefoxButtonSub = 無料ダウンロード diff --git a/public/locales/nl/send.ftl b/public/locales/nl/send.ftl index 63caf79b..6d1b7494 100644 --- a/public/locales/nl/send.ftl +++ b/public/locales/nl/send.ftl @@ -67,6 +67,7 @@ expiredPageHeader = Deze koppeling is verlopen of heeft überhaupt nooit bestaan notSupportedHeader = Uw browser wordt niet ondersteund. // Firefox Send is a brand name and should not be localized. notSupportedDetail = Helaas ondersteunt deze browser de webtechnologie die Firefox Send gebruikt niet. U dient een andere browser te proberen. Firefox wordt aanbevolen! +notSupportedLink = Waarom wordt mijn browser niet ondersteund? notSupportedOutdatedDetail = Helaas ondersteunt deze versie van Firefox de webtechnologie die Firefox Send gebruikt niet. U dient uw browser bij te werken. updateFirefox = Firefox bijwerken downloadFirefoxButtonSub = Gratis download diff --git a/public/locales/ru/send.ftl b/public/locales/ru/send.ftl index 084b3907..7fc46cfd 100644 --- a/public/locales/ru/send.ftl +++ b/public/locales/ru/send.ftl @@ -67,6 +67,7 @@ expiredPageHeader = Это ссылка просрочена или никогд notSupportedHeader = Ваш браузер не поддерживается. // Firefox Send is a brand name and should not be localized. notSupportedDetail = К сожалению, этот браузер не поддерживает веб-технологию, благодаря которой работает Firefox Send. Ваш нужно попробовать использовать другой браузер. Мы рекомендуем Firefox! +notSupportedLink = Почему мой браузер не поддерживается? notSupportedOutdatedDetail = К сожалению, эта версия Firefox не поддерживает веб-технологию, благодаря которой работает Firefox Send. Ваш нужно обновить свой браузер. updateFirefox = Обновить Firefox downloadFirefoxButtonSub = Бесплатная загрузка diff --git a/public/locales/te/send.ftl b/public/locales/te/send.ftl new file mode 100644 index 00000000..4785aaae --- /dev/null +++ b/public/locales/te/send.ftl @@ -0,0 +1,83 @@ +// Firefox Send is a brand name and should not be localized. +title = Firefox Send +siteSubtitle = జాల ప్రయోగం +siteFeedback = అభిప్రాయం +uploadPageLearnMore = ఇంకా తెలుసుకోండి +uploadPageDropMessage = ఎగుమతిని ప్రారంభించడానికి మీ ఫైలును ఇక్కడ విడిచిపెట్టండి +uploadPageSizeMessage = అత్యంత నమ్మకమైన కార్యం కోసం, మీ ఫైలును 1GB కంటే తక్కువగా ఉంచడం ఉత్తమం +uploadPageBrowseButton = మీ కంప్యూటర్లో ఒక ఫైలును ఎంచుకోండి + .title = మీ కంప్యూటర్లో ఒక ఫైలును ఎంచుకోండి +uploadPageBrowseButtonTitle = ఫైలును ఎగుమతి చేయండి +uploadingPageHeader = మీ ఫైలు ఎగుమతి అవుతుంది +importingFile = దిగుమతవుతోంది... +verifyingFile = పరిశీలిస్తున్నది… +encryptingFile = గుప్తీకరిస్తోంది... +decryptingFile = వ్యక్తపరుస్తోంది... +notifyUploadDone = మీ ఎగుమతి పూర్తయింది. +uploadingPageMessage = మీ ఫైలును మీరు ఎగుమతి చేసిన తర్వాత గడువు ఎంపికలను సరిగా ఏర్పాటు చేయగలరు. +uploadingPageCancel = ఎగుమతి రద్దు చేయండి + .title = ఎగుమతి రద్దు చేయండి +uploadCancelNotification = మీ ఎగుమతి రద్దు చేయబడింది. +uploadingPageLargeFileMessage = ఈ ఫైలు పెద్దగా ఉంది అందువలన ఎగుమతి చేయడానికి కొంత సమయం పట్టవచ్చు. వేచి ఉండండి! +uploadingFileNotification = ఎగుమతి పూర్తయినప్పుడు నాకు తెలియచేయండి. +uploadSuccessConfirmHeader = పంపించడానికి సిద్ధంగా ఉంది +uploadSvgAlt + .alt = ఎగుమతి చేయండి +uploadSuccessTimingHeader = మీ ఫైలు లంకె గడువు 1 దిగుమతి తరువాత లేదా 24 గంటల తరువాత ముగుస్తుంది. +copyUrlFormLabelWithName = మీ ఫైల్ను పంపడానికి లంకెను నకలు చేయండి మరియు పంచండి: { $filename } +// Note: Title text for button should be the same. +copyUrlFormButton = క్లిప్బోర్డ్కు నకలు చేయండి + .title = క్లిప్బోర్డ్కు నకలు చేయండి +copiedUrl = నకలు చేయబడింది! +// Note: Title text for button should be the same. +deleteFileButton = ఫైలును తొలగించండి + .title = ఫైలును తొలగించండి +// Note: Title text for button should be the same. +sendAnotherFileLink = మరో ఫైలును పంపండి + .title = మరో ఫైలును పంపండి +// Alternative text used on the download link/button (indicates an action). +downloadAltText + .alt = దిగుమతి +downloadFileName = దిగుమతి { $filename } +downloadFileSize = ({ $size }) +// Text and title used on the download link/button (indicates an action). +downloadButtonLabel = దిగుమతి + .title = దిగుమతి +downloadNotification = మీ దిగుమతి పూర్తయ్యింది. +downloadFinish = దిగుమతి పూర్తయింది +// Firefox Send is a brand name and should not be localized. Title text for button should be the same. +sendYourFilesLink = Firefox sendను ప్రయత్నించండి + .title = Firefox sendను ప్రయత్నించండి +downloadingPageProgress = దిగుమతిచేస్తున్నది { $filename } ({ $size }) +errorAltText + .alt = ఎగుమతిలో లోపం +errorPageHeader = ఏదో తప్పిదం జరిగింది! +errorPageMessage = ఫైల్ను ఎగుమతి చేయడంలో లోపం ఉంది. +errorPageLink = మరో ఫైలును పంపండి +linkExpiredAlt + .alt = లంకె గడువు ముగిసింది +expiredPageHeader = ఈ లంకె గడువు ముగిసింది లేదా ముందు ఎప్పుడూ ఉనికిలో లేదు! +notSupportedHeader = మీ విహారిణికి మద్దతు లేదు. +notSupportedLink = నా విహారిణికి ఎందుకు మద్దతు లేదు? +updateFirefox = Firefoxను నవీకరించు +downloadFirefoxButtonSub = ఉచిత దిగుమతులు +uploadedFile = దస్త్రం +copyFileList = URL నకలుతీయి +// expiryFileList is used as a column header +expiryFileList = ఇంతలో గడువుతీరును +deleteFileList = తొలగించు +nevermindButton = పర్వాలేదు +legalHeader = నిబంధనలు మరియు గోప్యత +deletePopupText = ఈ ఫైలును తొలగించాలా? +deletePopupYes = అవును +deletePopupCancel = రద్దుచేయి +deleteButtonHover + .title = తొలగించు +copyUrlHover + .title = URLను నకలు చేయండి +footerLinkLegal = చట్టపరమైన +// Test Pilot is a proper name and should not be localized. +footerLinkAbout = టెస్ట్ పైలట్ గురించి +footerLinkPrivacy = గోప్యత +footerLinkTerms = నియమాలు +footerLinkCookies = కుకీలు diff --git a/public/locales/uk/send.ftl b/public/locales/uk/send.ftl index 37d6db0b..63668790 100644 --- a/public/locales/uk/send.ftl +++ b/public/locales/uk/send.ftl @@ -67,6 +67,7 @@ expiredPageHeader = Посилання не існує, або час його notSupportedHeader = Ваш браузер не підтримується. // Firefox Send is a brand name and should not be localized. notSupportedDetail = На жаль, цей браузер не підтримує веб-технологію, завдяки якій працює Firefox Send. Вам треба скористатися іншим браузером. Ми рекомендуємо Firefox! +notSupportedLink = Чому мій браузер не підтримується? notSupportedOutdatedDetail = На жаль, ця версія Firefox не підтримує веб-технологію, завдяки якій працює Firefox Send. Вам потрібно оновити свій браузер. updateFirefox = Оновити Firefox downloadFirefoxButtonSub = Безкоштовне завантаження diff --git a/public/locales/zh-CN/send.ftl b/public/locales/zh-CN/send.ftl index 35f391f7..bc633b3e 100644 --- a/public/locales/zh-CN/send.ftl +++ b/public/locales/zh-CN/send.ftl @@ -67,6 +67,7 @@ expiredPageHeader = 此链接已过期或者从未生效。 notSupportedHeader = 不支持您的浏览器。 // Firefox Send is a brand name and should not be localized. notSupportedDetail = 很可惜,您的浏览器不支持 Firefox Send 所使用的 Web 技术。请改用其他浏览器。我们推荐使用 Firefox! +notSupportedLink = 为什么不支持我的浏览器? notSupportedOutdatedDetail = 很可惜,此版本的 Firefox 不支持 Firefox Send 所使用的 Web 技术。您需要更新浏览器才能使用它。 updateFirefox = 更新 Firefox downloadFirefoxButtonSub = 免费下载 diff --git a/public/locales/zh-TW/send.ftl b/public/locales/zh-TW/send.ftl index 59295a92..49a24203 100644 --- a/public/locales/zh-TW/send.ftl +++ b/public/locales/zh-TW/send.ftl @@ -67,6 +67,7 @@ expiredPageHeader = 鏈結已失效,或根本不存在! notSupportedHeader = 不支援您的瀏覽器。 // Firefox Send is a brand name and should not be localized. notSupportedDetail = 很可惜,您使用的瀏覽器並不支援 Firefox Send 所需的 Web 技術。請改用其他瀏覽器,我們推薦使用 Firefox! +notSupportedLink = 為什麼我的瀏覽器不支援? notSupportedOutdatedDetail = 很可惜,此版本的 Firefox 不支援 Firefox Send 所需的 Web 技術。請更新瀏覽器後再使用。 updateFirefox = 更新 Firefox downloadFirefoxButtonSub = 免費下載 diff --git a/public/main.css b/public/main.css index 0960ea61..b3541e23 100644 --- a/public/main.css +++ b/public/main.css @@ -272,6 +272,11 @@ tbody { cursor: pointer; } +.icon-copy[disabled="disabled"] { + pointer-events: none; + opacity: 0.3; +} + /* Popup container */ .popup { position: absolute; @@ -504,6 +509,7 @@ tbody { background: #05a700; border: 1px solid #05a700; cursor: auto; + opacity: 0.3; } #delete-file { diff --git a/server/server.js b/server/server.js index c47bafd8..8415f061 100644 --- a/server/server.js +++ b/server/server.js @@ -175,10 +175,7 @@ app.get('/assets/download/:id', async (req, res) => { file_stream.on('end', async () => { try { - const err = await storage.forceDelete(id); - if (!err) { - log.info('Deleted:', id); - } + await storage.forceDelete(id); } catch (e) { log.info('DeleteError:', id); } @@ -208,7 +205,6 @@ app.post('/delete/:id', async (req, res) => { try { const err = await storage.delete(id, delete_token); if (!err) { - log.info('Deleted:', id); res.sendStatus(200); } } catch (e) { @@ -238,12 +234,9 @@ app.post('/upload', (req, res, next) => { } meta.delete = crypto.randomBytes(10).toString('hex'); - log.info('meta', meta); req.pipe(req.busboy); req.busboy.on('file', async (fieldname, file, filename) => { - log.info('Uploading:', newId); - try { await storage.set(newId, file, filename, meta); @@ -264,10 +257,7 @@ app.post('/upload', (req, res, next) => { req.on('close', async err => { try { - const err = await storage.forceDelete(newId); - if (!err) { - log.info('Deleted:', newId); - } + await storage.forceDelete(newId); } catch (e) { log.info('DeleteError:', newId); } diff --git a/server/storage.js b/server/storage.js index 93d1c46c..8bac8e30 100644 --- a/server/storage.js +++ b/server/storage.js @@ -16,7 +16,7 @@ const redis_client = redis.createClient({ }); redis_client.on('error', err => { - log.info('Redis:', err); + log.error('Redis:', err); }); if (conf.s3_bucket) { @@ -155,6 +155,7 @@ function localDelete(id, delete_token) { reject(); } else { redis_client.del(id); + log.info('Deleted:', id); resolve(fs.unlinkSync(path.join(__dirname, '../static', id))); } }); @@ -201,7 +202,6 @@ function awsGet(id) { try { return s3.getObject(params).createReadStream(); } catch (err) { - log.info('GetFailed', 'Get Object from s3 failed.'); return null; } } @@ -222,7 +222,6 @@ function awsSet(newId, file, filename, meta) { () => { redis_client.hmset(newId, meta); redis_client.expire(newId, conf.expire_seconds); - log.info('awsUploadFinish', 'Upload Finished of ' + filename); }, err => { if (hitLimit) { @@ -263,7 +262,7 @@ function awsForceDelete(id) { s3.deleteObject(params, function(err, _data) { redis_client.del(id); - err ? reject(err) : resolve(err); + err ? reject(err) : resolve(); }); }); }