git clone https://github.com/TannerReynolds/ShareX-Upload-Server.git
cd ShareX-Upload-Server
chmod +x install.sh
./install.shdocker build -t sharex-upload-server .
docker run --name " sharex-upload-server " -d
-v $( pwd ) /src/config.json:/usr/src/app/config.json
-v $( pwd ) /src/db.json:/usr/src/app/db.json
-v $( pwd ) /src/server/uploads/:/usr/src/app/server/uploads/
-p 8000:80 -p 8443:443
sharex-upload-server
docker logs -f sharex-upload-server سيكون /src/config.json هو ملف التكوين المستخدم إذا استخدمت الأمر أعلاه لبدء الخادم. ستتوفر واجهة المستخدم على الويب على https://server-ip:8443 إذا تم تمكين https ، و http://server-ip:8000 إذا لم يكن كذلك.
في الملفات التي قمت بتنزيلها من هذا المستودع ، سترى ملفًا يسمى config.json ، يجب عليك ملء ذلك حتى يعمل خادم الويب بشكل صحيح. أدناه يشرح ملف التكوين وما يفعله كل جزء
{
"key" : [ "" ] , // Password(s) for private uploading
"domain" : "*.example.com" , // Domain server will use. Will error if domain not used in request. Place "*" as the subdomain to enable wildcard subdomains for the webserver.
"puploadKeyGenLength" : 64 , // Amount of characters server should use for pupload files
"public" : false , // Disables auth and does not render a password field for /upload
"maxUploadSize" : 50 , // max upload size for non-admins using regular key in MB
"markdown" : true , // enables markdown rendering (upload whole .md file for render)
"port" : 80 , // port to listen on
"secure" : true , // Whether or not you want https. (make sure key and cert.pem are in src directory)
"fileNameLength" : 4 , // File name length
"shortUrlLength" : 3 , // File name length for short URLs
"securePort" : 443 , // Port to use when secure is true
"ratelimit" : 1000 , // Ratelimit for POSTing in milliseconds
"dateURLPath" : false , // Set to true to prefix uploads with the date (Ex: https://domain.com/2020/04/22/ghNa.pdf)
"allowed" : [
"png" , "jpg" , "gif" , "mp4" , "mp3" , "jpeg" , "tiff" , "bmp" , "ico" , "psd" , "eps" , "raw" , "cr2" , "nef" , "sr2" , "orf" , "svg" , "wav" , "webm" , "aac" , "flac" , "ogg" , "wma" , "m4a" , "gifv"
] , // Allowed file types for non-admins
"admin" : {
"key" : [ "" ] , // Admin password(s) for uploading & for gallery access
"maxUploadSize" : 1024 , // Max upload size for admin in MB
"allowed" : [
"png" , "jpg" , "gif" , "mp4" , "mp3" , "jpeg" , "tiff" , "bmp" , "ico" , "psd" , "eps" , "raw" , "cr2" , "nef" , "sr2" , "orf" , "svg" , "wav" , "webm" , "aac" , "flac" , "ogg" , "wma" , "m4a" , "gifv" , "html"
] // Allowed file types for admins
} ,
"paste" : {
"maxUploadSize" : 20 // allowed paste upload size in MB
} ,
"discordToken" : "" , // Discord bot token
"discordAdminIDs" : [ "discord IDs of people who can run commands go here" , "Like this" ] , // User IDs in an array
"discordChannelID" : "" , // Channel ID for monitoring uploads to
"prefix" : "" // Bot Prefix
} بمجرد تكوين الخادم الخاص بك بشكل صحيح ، يمكنك تشغيل node index.js في مجلد SRC لبدء الخادم. يمكنك الحفاظ على تشغيل الخادم الخاص بك إلى الأبد إذا كنت تستخدم مدير المعالجة ، مثل PM2. يتم تثبيت PM2 مع الخادم الخاص بك إذا استخدمت البرنامج النصي install.sh لتثبيت الخادم الخاص بك. وإلا يمكنك تشغيل npm i -g pm2 لتثبيت PM2. بعد ذلك ، يمكنك تشغيل الخادم الخاص بك عن طريق تشغيل pm2 start index.js ، ومراقبة السجلات ومثل هذا باستخدام pm2 monit
إذا كنت تقوم بتكوين خادم الويب هذا لتشغيله عبر الوكيل العكسي Nginx ، فتأكد من إضافة هذه الخطوط إلى تكوين الوكيل العكسي
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
هذا عمومًا بعض الأشياء التي تريد إضافتها إلى التكوين الخاص بك ، وهو ما هو مطلوب فعليًا للأسهم للعمل بشكل صحيح. وذلك لأن الأسهم إرجاع عمليات التحميل مثل [http/https]://[requested url]/[filename] ولأنك تقوم بتشغيل الأسهم من خلال وكيل عكسي ، إلا إذا كنت تمر على طول الرؤوس الأصلية ، فمن المرجح أن ترسل لك الأسهم شيئًا مثل http://[server's real ip address]/[filename]
إذا كان لديك مجالات متعددة تشير إلى خادم الويب هذا ، فيمكن استخدام واحد فقط (يمكن أن يشمل نطاق البدل الفرعي) ، ما لم يتم ضبط إعداد المجال على واحد فقط * مثل SO: "domain": "*", . هذا يعني أنه سيتم قبول أي مجال كمجال صالح من قبل الخادم ، بغض النظر عن النطاق الفرعي.
إذا كنت ترغب في تسجيل نشاط خادم الويب الخاص بك في قناة Discord لأي سبب من الأسباب ، يمكنك ذلك. فيما يلي معلومات حول كيفية إعداد حساب BOT والحصول على المعلومات اللازمة لتسجيل الخلاف
Destinations -> Custom Uploader SettingsDestination Locationpupload ، ثم اجعل القيمة كل ما تريد أن تكون كلمة المرور بالإضافة إلى القدرة على استخدام أي كلمة مرور تريدها للتحميل ، إذا قمت بكتابة *random* كحقل التحميل الخاص بك ، فسيقوم الخادم تلقائيًا بإنشاء كلمة مرور لك. ستتضمن كلمة المرور هذه الرسائل والأرقام والأحرف الخاصة. سيقوم بإنشاء مفتاح بناءً على الطول الذي تحدده في التكوين الخاص بك (PuploAdKeyGenLength). عند تقديم الطلبات ، سيقوم الخادم بإرجاع عنوان URL للصورة مع المفتاح مثل URL: https://qoilo.com/lhHr | KEY: Np$[CBk>X[c^YY{MDlCHH0|Qfm1uK0*lld^Mi$f4d62R5x6C2>~yaL}3*QYnziuZ
showCase ، ثم اجعل القيمة trueمن أجل استخدام الأسهم مع Flameshot ، ستحتاج إلى استخدام برنامج نصي بسيط ، إليك مثال:
key= " YourPassword "
# Only needed for multi-domain support, if you only have one simply set the url
# 2 lines below to url="https://your.domain/api/files"
urls=( " https://example.com/api/files " " https://example.org/api/files " )
url= ${urls[$RANDOM % ${#urls[@]} ]}
temp_file= " /tmp/screenshot.png "
# Run flameshot --help for options
flameshot gui -r > $temp_file
# For some reason flameshot always seems to exit with 0 even when aborting the process
# so we had to find a way around that.
if [[ $( file --mime-type -b $temp_file ) != " image/png " ]] ; then
rm $temp_file
notify-send " Screenshot aborted " -a " Flameshot " && exit 1
fi
image_url= $( curl -X POST -F " fdata=@ " $temp_file -F " key= " $key -v " $url " 2> /dev/null )
echo -n $image_url | xclip -sel c
notify-send " Image URL copied to clipboard " " $image_url " -a " Flameshot " -i $temp_file
rm $temp_fileعند تشغيل هذا البرنامج النصي ، اضغط ببساطة على Enter عندما تكون راضيًا عن صورتك ، فسيقوم Flameshot بعد ذلك بحفظ الصورة إلى الحافظة الخاصة بك والتي سيتم استبدالها بعنوان URL للصورة بمجرد تحميله. للحصول على أفضل النتائج ، أقترح تعطيل الإخطارات في تطبيق Flameshot.
4.5.6 ، فتأكد من تغيير الدرع في ملف ReadMe و Package.json ليقول الإصدار 4.5.7 . إذا كان الإصدار هو 4.5.10 ، فحرفه إلى 4.5.11 . فقط تحديث الرقم الأخير. يجب ألا تشكل التحديثات/PRs التي لا تعتبر رمزًا (readme.md ، install.sh ، sxcu ، package.json ، إلخ) رقم إصدار محدث للمشروع ، لذلك لن تقوم PRS بتزايد رقم الإصدار