
مشاركة ملفات سهلة وسريعة من سطر الأوامر. يحتوي هذا الرمز على الخادم مع كل ما تحتاجه لإنشاء مثيل خاص بك.
يدعم Transfer.sh حاليًا S3 (Amazon S3) و Gdrive (Google Drive) و Storj (Storj) ونظام الملفات المحلي (محلي).
STEFANBENTEN يصادف أن يكون مشرفًا لهذا المستودع والشخص الذي يستضيف تثبيتًا علنيًا معروفًا للبرنامج في الريبو.
الاثنان غير مرتبطين على أي حال ، والشفاء ليس المكان المناسب لتوجيه الطلبات والمشكلات لأي من التثبيت Pubblic.
لن يتم الإعلان عن أي تثبيت عام لجهة خارجية للبرنامج في الريبو أو يتم ذكره في الريبو نفسه ، لأسباب أمنية.
الموقف الرسمي لي ، aspacca ، بصفته محفوظًا لإعادة الريبو ، هو أنه إذا كنت ترغب في استخدام البرنامج ، فيجب عليك استضافة التثبيت الخاص بك.
$ curl -v --upload-file ./hello.txt https://transfer.sh/hello.txt$ gpg --armor --symmetric --output - /tmp/hello.txt | curl --upload-file - https://transfer.sh/test.txt$ curl https://transfer.sh/1lDau/test.txt | gpg --decrypt --output /tmp/hello.txt$ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal$ curl -X DELETE < X-Url-Delete Response Header URL > $ curl --upload-file ./hello.txt https://transfer.sh/hello.txt -H " Max-Downloads: 1 " # Limit the number of downloads$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt -H " Max-Days: 1 " # Set the number of days before deletion$ curl --upload-file ./hello.txt https://your-transfersh-instance.tld/hello.txt -H " X-Encrypt-Password: test " # Encrypt the content sever side with AES265 using "test" as password$ curl https://your-transfersh-instance.tld/BAYh0/hello.txt -H " X-Decrypt-Password: test " # Decrypt the content sever side with AES265 using "test" as password عنوان URL المستخدم لطلب حذف ملف وإرجاعه كرأس استجابة.
curl -sD - --upload-file ./hello.txt https://transfer.sh/hello.txt | grep -i -E ' transfer.sh|x-url-delete '
x-url-delete: https://transfer.sh/hello.txt/BAYh0/hello.txt/PDw0NHPcqU
https://transfer.sh/hello.txt/BAYh0/hello.txtانظر أمثلة الاستخدام الجيدة على الأمثلة. md
إنشاء رابط تنزيل مباشر:
https://transfer.sh/1ldau/test.txt -> https://transfer.sh/get/1ldau/test.txt
ملف مضمّن:
https://transfer.sh/1ldau/test.txt -> https://transfer.sh/inline/1ldau/test.txt
| المعلمة | وصف | قيمة | البيئة |
|---|---|---|---|
| المستمع | منفذ للاستخدام في HTTP (: 80) | المستمع | |
| ملف تعريف الملف الشخصي | ميناء لاستخدامه لـ Profiler (: 6060) | profile_listener | |
| قوة HTTPS | إعادة التوجيه إلى HTTPS | خطأ شنيع | force_https |
| TLS-Listener | منفذ للاستخدام في HTTPS (: 443) | TLS_Listener | |
| TLS-Listener فقط | العلم لتمكين مستمع TLS فقط | tls_listener_only | |
| ملف TLS-Cert | طريق إلى شهادة TLS | TLS_CERT_FILE | |
| TLS-Private-Key | الطريق إلى مفتاح TLS الخاص | TLS_PRIVAL_KEY | |
| http-auth-user | المستخدم للحصول على مصادقة HTTP الأساسية على التحميل | http_auth_user | |
| http-auth-pass | تمرير للحصول على مصادقة HTTP الأساسية على التحميل | http_auth_pass | |
| http-auth-htpasswd | مسار ملف htpasswd لـ HTTP Auth الأساسي عند التحميل | http_auth_htpasswd | |
| http-auth-ip-whitelist | قائمة مفصولة مفصولة من IPs المسموح لها بالتحميل دون تحدي مصادقة HTTP | http_auth_ip_whitelist | |
| IP-Whitelist | قائمة مفصول الفاصلة المسموح بها بالاتصال بالخدمة | IP_WHITELIST | |
| IP-BlackList | قائمة مفصول الفاصلة غير مسموح بها بالاتصال بالخدمة | IP_BlackList | |
| مسار مؤقت | طريق إلى مجلد Temp | درجة حرارة النظام | temp_path |
| مسار الويب | مسار إلى ملفات الويب الثابتة (للتطوير أو الواجهة الأمامية المخصصة) | web_path | |
| وكيل المسار | بادئة المسار عند تشغيل الخدمة خلف وكيل | proxy_path | |
| بروكسي ميناء | منفذ الوكيل عندما يتم تشغيل الخدمة خلف وكيل | proxy_port | |
| اتصال البريد الإلكتروني | جهة اتصال البريد الإلكتروني للواجهة الأمامية | eMail_Contact | |
| Ga-Key | مفتاح تحليلات Google للواجهة الأمامية | ga_key | |
| مزود | أي مزود تخزين للاستخدام | (S3 ، Storj ، Gdrive أو Local) | |
| uservoice-key | مفتاح صوت المستخدم للواجهة الأمامية | uservoice_key | |
| AWS-Access-Key | AWS مفتاح الوصول | AWS_ACCESS_KEY | |
| AWS-Secret-Key | AWS مفتاح الوصول | AWS_SECRET_KEY | |
| دلو | دلو AWS | دلو | |
| S3-Endpoint | نقطة نهاية S3 مخصصة. | s3_endpoint | |
| S3-Region | منطقة دلو S3 | الاتحاد الأوروبي-ويست -1 | S3_region |
| S3-No-Multipart | تعطيل تحميل S3 Multipart | خطأ شنيع | s3_no_multipart |
| S3-PATH على غرار | عناوين URL لقوات مسار المسار ، مطلوبة للمينيو. | خطأ شنيع | s3_path_style |
| Storj-Access | وصول للمشروع | storj_access | |
| Storj-bucket | دلو لاستخدامه في المشروع | Storj_bucket | |
| مقر | تخزين المسار لمزود المحلية/GDRIVE | مقر | |
| Gdrive-Client-Json-Filepath | مسار إلى Oauth Client JSON Config لمزود GDRIVE | gdrive_client_json_filepath | |
| Gdrive-Local-Config-Path | مسار لتخزين ذاكرة التخزين المؤقت للتكوين المحلي لمزود GDRIVE | gdrive_local_config_path | |
| حجم GDRIVE-SIZE | يجب أن يكون حجم قطعة كبيرة لتحميل GDrive في Megabytes ، أقل من الذاكرة المتوفرة (8 ميغابايت) | gdrive_chunk_size | |
| دعنا نتعرض لاستضافة | المضيفين لاستخدامها في شهادات Encrypt (فاصلة منفصلة) | المضيفين | |
| سجل | مسار السجل ملف | سجل | |
| ناديات الكورس | قائمة مفصول القائمة من المجالات للكسر ، وضعها تمكين الكورس | cors_domains | |
| Clamav-Host | مضيف ميزة Clamav | clamav_host | |
| الأداء الكلياف-برسكان | Prescan كل تحميل من خلال ميزة Clamav (يجب أن يكون Clamav-Host مقبس Clamd Unix محلي) | perform_clamav_prescan | |
| معدل الحد | طلب في الدقيقة | Rate_limit | |
| Max-Upload-size | أقصى حجم التحميل بالكيلوبايت | max_upload_size | |
| تطهير أيام | عدد الأيام التي تلت تحميل التحميل تلقائيًا | purge_days | |
| تطهير الفاصل | الفاصل الزمني في ساعات لتشغيل التطهير التلقائي (لا ينطبق على S3 و Storj) | purge_interval | |
| طول عشوائي | طول الرمز العشوائي لمسار التحميل (ضعف حجم مسار الحذف) | 6 | Random_Token_Length |
إذا كنت ترغب في استخدام TLS باستخدام LETFORS ENCRIPTATATIONS ، فقم بالتعيين ، حيث تتيح المستضافة على المجال الخاص بك ، وتعيين TLS-Listener على: 443 وتمكين HTTPS.
إذا كنت ترغب في استخدام TLS باستخدام الشهادات الخاصة بك ، فقم بتعيين TLS-Listener على: 443 ، و Force-HTTPS ، و TLS-Cert-File و TLS-Private-Ide.
تحول إلى go111module
go run main.go --provider=local --listener :8080 --temp-path=/tmp/ --basedir=/tmp/$ git clone [email protected]:dutchcoders/transfer.sh.git
$ cd transfer.sh
$ go build -o transfersh main.goلسهولة النشر ، أنشأنا حاوية Docker رسمية. هناك نوعان من المتغيرات ، يختلفان فقط الذي يقوم المستخدم بتشغيل العملية.
سيتم تشغيل الافتراضي root :
docker run --publish 8080:8080 dutchcoders/transfer.sh:latest --provider local --basedir /tmp/ ستستخدم تلك الموسومة مع اللاحقة -noroot 5000 كـ UID و GID:
docker run --publish 8080:8080 dutchcoders/transfer.sh:latest-noroot --provider local --basedir /tmp/يمكنك أيضًا بناء الحاوية بنفسك. يتيح لك ذلك اختيار أي UID/GID سيتم استخدامه ، على سبيل المثال عند استخدام حوامل NFS:
# Build arguments:
# * RUNAS: If empty, the container will run as root.
# Set this to anything to enable UID/GID selection.
# * PUID: UID of the process. Needs RUNAS != "". Defaults to 5000.
# * PGID: GID of the process. Needs RUNAS != "". Defaults to 5000.
docker build -t transfer.sh-noroot --build-arg RUNAS=doesntmatter --build-arg PUID=1337 --build-arg PGID=1338 . للاستخدام باستخدام دلو AWS S3 ، تحتاج فقط إلى تحديد الخيارات التالية:
--provider s3AWS_ACCESS_KEY )AWS_SECRET_KEY )BUCKET أو البيئة)S3_REGION )إذا قمت بتحديد S3-Region ، فلن تحتاج إلى تعيين عنوان URL لنقطة النهاية لأن نقطة النهاية الصحيحة ستستخدم تلقائيًا.
لاستخدام مزود S3 غير AWS المخصص ، تحتاج إلى تحديد نقطة النهاية كما هو محدد من مزود السحابة الخاص بك.
لاستخدام شبكة Storj كموفر تخزين تحتاج إلى تحديد الأعلام التالية:
--provider storjتحتاج إلى إنشاء منحة وصول (أو نسخها من تكوين الوصلة الصاعدة) ودلوها قيد الإعداد.
للبدء ، قم بتسجيل الدخول إلى حسابك وانتقل إلى قائمة منحة Access وابدأ المعالج في الجزء العلوي الأيمن.
أدخل اسم منحة Access الخاصة بك ، واضغط على التالي وقصره حسب الضرورة/المفضل. بعد ذلك ، تابع إما في CLI أو داخل المتصفح. بعد ذلك ، سيُطلب منك عبارة تمارين تستخدم كمفتاح تشفير. تأكد من حفظه في مكان آمن. بدونها ، سوف تفقد القدرة على فك تشفير ملفاتك!
بعد ذلك ، يمكنك نسخ منحة الوصول ثم بدء بدء تشغيل نقطة النهاية transfer.sh. يوصى بتوفير منحة الوصول واسم الجرافة كمتغيرات ENV لتحسين الأمان.
مثال:
export STORJ_BUCKET=<BUCKET NAME>
export STORJ_ACCESS=<ACCESS GRANT>
transfer.sh --provider storj
للاستخدام مع Google Drive ، تحتاج إلى تحديد الخيارات التالية:
تحتاج إلى إنشاء معرف عميل OAuth من Console.cloud.google.com ، وتنزيل الملف ، ووضعه في دليل آمن.
go run main.go --provider gdrive --basedir /tmp/ --gdrive-client-json-filepath /[credential_dir] --gdrive-local-config-path [directory_to_save_config]
transfer () (if [ $# -eq 0 ] ; then printf " No arguments specified.nUsage:n transfer <file|directory>n ... | transfer <file_name>n " >&2 ; return 1 ; fi ; file_name= $( basename " $1 " ) ; if [ -t 0 ] ; then file= " $1 " ; if [ ! -e " $file " ] ; then echo " $file : No such file or directory " >&2 ; return 1 ; fi ; if [ -d " $file " ] ; then cd " $file " || return 1 ; file_name= " $file_name .zip " ; set -- zip -r -q - . ; else set -- cat " $file " ; fi ; else set -- cat ; fi ; url= $( " $@ " | curl --silent --show-error --progress-bar --upload-file " - " " https://transfer.sh/ $file_name " ) ; echo " $url " ; ) $ transfer hello.txt
transfer ()
{
local file
declare -a file_array
file_array=( " ${ @ } " )
if [[ " ${file_array[@]} " == " " || " ${1} " == " --help " || " ${1} " == " -h " ]]
then
echo " ${0} - Upload arbitrary files to " transfer.sh " . "
echo " "
echo " Usage: ${0} [options] [<file>]... "
echo " "
echo " OPTIONS: "
echo " -h, --help "
echo " show this message "
echo " "
echo " EXAMPLES: "
echo " Upload a single file from the current working directory: "
echo " ${0} " image.img " "
echo " "
echo " Upload multiple files from the current working directory: "
echo " ${0} " image.img " " image2.img " "
echo " "
echo " Upload a file from a different directory: "
echo " ${0} " /tmp/some_file " "
echo " "
echo " Upload all files from the current working directory. Be aware of the webserver's rate limiting!: "
echo " ${0} * "
echo " "
echo " Upload a single file from the current working directory and filter out the delete token and download link: "
echo " ${0} " image.img " | awk --field-separator= " : " '/Delete token:/ { print $ 2 } /Download link:/ { print $ 2 }' "
echo " "
echo " Show help text from " transfer.sh " : "
echo " curl --request GET " https://transfer.sh " "
return 0
else
for file in " ${file_array[@]} "
do
if [[ ! -f " ${file} " ]]
then
echo -e " e[01;31m' ${file} ' could not be found or is not a file.e[0m " >&2
return 1
fi
done
unset file
fi
local upload_files
local curl_output
local awk_output
du -c -k -L " ${file_array[@]} " >&2
# be compatible with "bash"
if [[ " ${ZSH_NAME} " == " zsh " ]]
then
read $' upload_files? e [01;31mDo you really want to upload the above files ( ' " ${ # file_array[@]} " $' ) to "transfer.sh"? (Y/n): e [0m '
elif [[ " ${BASH} " == * " bash " * ]]
then
read -p $' e [01;31mDo you really want to upload the above files ( ' " ${ # file_array[@]} " $' ) to "transfer.sh"? (Y/n): e [0m ' upload_files
fi
case " ${upload_files :- y} " in
" y " | " Y " )
# for the sake of the progress bar, execute "curl" for each file.
# the parameters "--include" and "--form" will suppress the progress bar.
for file in " ${file_array[@]} "
do
# show delete link and filter out the delete token from the response header after upload.
# it is important to save "curl's" "stdout" via a subshell to a variable or redirect it to another command,
# which just redirects to "stdout" in order to have a sane output afterwards.
# the progress bar is redirected to "stderr" and is only displayed,
# if "stdout" is redirected to something; e.g. ">/dev/null", "tee /dev/null" or "| <some_command>".
# the response header is redirected to "stdout", so redirecting "stdout" to "/dev/null" does not make any sense.
# redirecting "curl's" "stderr" to "stdout" ("2>&1") will suppress the progress bar.
curl_output= $( curl --request PUT --progress-bar --dump-header - --upload-file " ${file} " " https://transfer.sh/ " )
awk_output= $( awk
' gsub("r", "", $0) && tolower($1) ~ /x-url-delete/
{
delete_link=$2;
print "Delete command: curl --request DELETE " """delete_link""";
gsub(".*/", "", delete_link);
delete_token=delete_link;
print "Delete token: " delete_token;
}
END{
print "Download link: " $0;
} ' <<< " ${curl_output} " )
# return the results via "stdout", "awk" does not do this for some reason.
echo -e " ${awk_output} n "
# avoid rate limiting as much as possible; nginx: too many requests.
if (( ${ # file_array[@]} > 4 ))
then
sleep 5
fi
done
;;
" n " | " N " )
return 1
;;
* )
echo -e " e[01;31mWrong input: ' ${upload_files} '.e[0m " >&2
return 1
esac
}$ ls -lh
total 20M
-rw-r--r-- 1 < some_username > < some_username > 10M Apr 4 21:08 image.img
-rw-r--r-- 1 < some_username > < some_username > 10M Apr 4 21:08 image2.img
$ transfer image *
10240K image2.img
10240K image.img
20480K total
Do you really want to upload the above files (2) to " transfer.sh " ? (Y/n):
# ####################################################################################################################################################################################################################################### 100.0%
Delete command: curl --request DELETE " https://transfer.sh/wJw9pz/image2.img/mSctGx7pYCId "
Delete token: mSctGx7pYCId
Download link: https://transfer.sh/wJw9pz/image2.img
# ####################################################################################################################################################################################################################################### 100.0%
Delete command: curl --request DELETE " https://transfer.sh/ljJc5I/image.img/nw7qaoiKUwCU "
Delete token: nw7qaoiKUwCU
Download link: https://transfer.sh/ljJc5I/image.img
$ transfer " image.img " | awk --field-separator= " : " ' /Delete token:/ { print $2 } /Download link:/ { print $2 } '
10240K image.img
10240K total
Do you really want to upload the above files (1) to " transfer.sh " ? (Y/n):
# ####################################################################################################################################################################################################################################### 100.0%
tauN5dE3fWJe
https://transfer.sh/MYkuqn/image.imgالمساهمات موضع ترحيب.
Remco Verhoef
Uvis Grinfelds
أندريا سباكا
ستيفان بنتن
الكود والوثائق حقوق الطبع والنشر 2011-2018 Remco Verhoef. الكود والوثائق حقوق الطبع والنشر 2018-2020 أندريا سباكا. رمز وتوثيق حقوق الطبع والنشر 2020- أندريا سباكا وستيفان بنتن.
رمز صدر تحت رخصة معهد ماساتشوستس للتكنولوجيا.