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 위 명령을 사용하여 서버를 시작하면 사용되는 구성 파일이됩니다. 웹 UI는 https가 활성화 된 경우 https://server-ip:8443 에서 사용할 수 있고 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
} 서버를 올바르게 구성하면 SRC 폴더에서 node index.js 실행하여 서버를 시작할 수 있습니다. PM2와 같은 프로세스 관리자를 사용하면 서버를 영원히 실행할 수 있습니다. PM2는 Server.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] 과 같은 것을 보낼 것입니다.
이 웹 서버를 가리키는 여러 도메인이있는 경우 도메인 설정이 "domain": "*", 와 같은 단일 *로 설정 되지 않는 한 하나만 사용할 수 있습니다 (와일드 카드 하위 도메인 포함) 만 사용할 수 있습니다. 이는 하위 도메인에 관계없이 모든 도메인이 서버에서 유효한 도메인으로 허용 될 것임을 의미합니다.
어떤 이유로 든 불일치 채널에 웹 서버의 활동을 기록하려면 가능합니다. 다음은 봇 계정을 설정하고 불화 로깅에 필요한 정보를 얻는 방법에 대한 정보입니다.
Destinations -> Custom Uploader SettingsDestination Location 변경하십시오pupload 라는 신체에 필드를 추가 한 다음 비밀번호를 원하는대로 가치를 만듭니다. pupload에 원하는 암호를 사용할 수있을뿐만 아니라 Pupload 필드로 *random* 입력하면 서버가 자동으로 비밀번호를 생성합니다. 이 비밀번호에는 문자, 숫자 및 특수 문자가 포함됩니다. 구성에서 지정한 길이 (puploadkeyGenlength)에 따라 키를 생성합니다. 요청을 할 때 서버는 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 로 업데이트하십시오 . 마지막 숫자 만 업데이트하십시오. 코드가 아닌 업데이트/PR (readme.md, install.sh, sxcu 파일, package.json 등)은 프로젝트의 업데이트 된 버전 번호를 구성하지 않아야하므로 해당 특정 파일의 PRS는 버전 번호를 증가시키지 않습니다.