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というファイルが表示されます。これは、Webサーバーが適切に動作するように入力する必要があります。以下に構成ファイルと各部分が何をするかについて説明します
{
"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のようなプロセスマネージャーを使用する場合、サーバーを永久に実行することができます。 Install.shスクリプトを使用してサーバーをインストールした場合、PM2はサーバーと一緒にインストールします。それ以外の場合はnpm i -g pm2を実行してPM2をインストールできます。次に、 pm2 start index.jsを実行して、 pm2 monitを使用してログなどを監視することでサーバーを実行できます
このWebServerを構成している場合は、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]のようなものを送信する可能性が高いためです。
複数のドメインがこのWebServerを指している場合、ドメイン設定が単一 *のように設定されていない限り、1つ(ワイルドカードサブ"domain": "*",を含めることができます)のみを使用できます。これは、サブドメインに関係なく、サーバーによって有効なドメインとして任意のドメインが受け入れられることを意味します。
何らかの理由で不一致チャネルでWebサーバーのアクティビティを記録したい場合は、できます。ボットアカウントをセットアップし、不一致ロギングに必要な情報を取得する方法に関する情報を次に示します
Destinations -> Custom Uploader SettingsDestination Locationを変更しますpuploadと呼ばれるあなたの体にフィールドを追加し、パスワードを望むものは何でも値を作成しますPuploadsに必要なパスワードを使用できることに加えて、Puploadフィールドとして*random*を入力すると、サーバーは自動的にパスワードを生成します。このパスワードには、文字、数字、特殊文字が含まれます。構成(puploadkeygenlength)で指定した長さに基づいてキーを生成します。リクエストを行うとき、サーバーはSo 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はバージョン番号を増やしません。