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 จะเป็นไฟล์กำหนดค่าที่ใช้หากคุณใช้คำสั่งด้านบนเพื่อเริ่มเซิร์ฟเวอร์ Web UI จะพร้อมใช้งานบน 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 เพื่อเริ่มเซิร์ฟเวอร์ คุณสามารถให้เซิร์ฟเวอร์ของคุณทำงานได้ตลอดไปหากคุณใช้ Process Manager เช่น PM2 PM2 ติดตั้งพร้อมกับเซิร์ฟเวอร์ของคุณหากคุณใช้สคริปต์ sosted.sh เพื่อติดตั้งเซิร์ฟเวอร์ของคุณ มิฉะนั้นคุณสามารถเรียกใช้ npm i -g pm2 เพื่อติดตั้ง PM2 จากนั้นคุณสามารถเรียกใช้เซิร์ฟเวอร์ของคุณโดยเรียกใช้ pm2 start index.js และตรวจสอบบันทึกและการใช้ pm2 monit
หากคุณกำหนดค่าเว็บเซิร์ฟเวอร์นี้เพื่อเรียกใช้ผ่านพร็อกซี Nginx Reverse ให้แน่ใจว่าคุณเพิ่มบรรทัดเหล่านี้ลงในการกำหนดค่าพร็อกซีย้อนกลับของคุณ
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] เนื่องจากคุณกำลังใช้แชร์ผ่านพร็อกซีย้อนกลับเว้นแต่คุณจะผ่านส่วนหัว เดิม การแชร์น่าจะส่งอะไรให้คุณ
หากคุณมีหลายโดเมนที่ชี้ไปที่เว็บเซิร์ฟเวอร์นี้สามารถใช้งาน "domain": "*", เพียง อันเดียวเท่านั้น ซึ่งหมายความว่าโดเมนใด ๆ จะได้รับการยอมรับว่าเป็นโดเมนที่ถูกต้องโดยเซิร์ฟเวอร์โดยไม่คำนึงถึงโดเมนย่อย
หากคุณต้องการบันทึกกิจกรรมของเว็บเซิร์ฟเวอร์ในช่อง Discord ด้วยเหตุผลใดก็ตามคุณสามารถทำได้ นี่คือข้อมูลเกี่ยวกับวิธีการตั้งค่าบัญชีบอทและรับข้อมูลที่จำเป็นสำหรับการบันทึกความไม่ลงรอยกัน
Destinations -> Custom Uploader SettingsDestination Locationpupload แล้วสร้างค่าสิ่งที่คุณต้องการให้รหัสผ่านเป็น นอกเหนือจากความสามารถในการใช้รหัสผ่านใด ๆ ที่คุณต้องการสำหรับ puploads หากคุณพิมพ์ *random* เป็นฟิลด์ pupload ของคุณเซิร์ฟเวอร์จะสร้างรหัสผ่านให้คุณโดยอัตโนมัติ รหัสผ่านนี้จะรวมถึงตัวอักษรตัวเลขและอักขระพิเศษ มันจะสร้างคีย์ตามความยาวที่คุณระบุในการกำหนดค่าของคุณ (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 สำหรับไฟล์เฉพาะเหล่านั้นจะไม่เพิ่มหมายเลขเวอร์ชัน