viewscreen
1.0.0
VPS上的運行ViewScreen設計為盡可能簡單。
推薦規格
推薦提供者
在您的域中創建DNS A ,指向服務器的IP地址。
示例: viewscreen.example.com A 172.16.1.1
當使用--letsencrypt標誌啟用時,ViewScreen在端口443上運行tls(“ SSL”)HTTPS服務器。它還在端口80上運行標準的Web服務器,以將客戶端重定向到安全服務器。
要求
# Install ffmpeg.
$ sudo add-apt-repository -y ppa:jonathonf/ffmpeg-3
$ sudo apt-get update
$ sudo apt-get install -y wget ffmpeg x264
# Download the viewscreen binary.
$ sudo wget -O /usr/bin/viewscreen https://github.com/viewscreen/viewscreen/raw/master/viewscreen-linux-amd64
# Make it executable.
$ sudo chmod +x /usr/bin/viewscreen
# Allow it to bind to privileged ports 80 and 443.
$ sudo setcap cap_net_bind_service=+ep /usr/bin/viewscreen
# Enable Let's Encrypt using your domain for automatic TLS configuration.
$ viewscreen --http-host viewscreen.example.com --http-username $USER --download-dir $HOME /Downloads --letsencrypt
INFO[0000] viewscreen URL: https://viewscreen.example.com/viewscreen
INFO[0001] Login credentials: < username > / < password >
示例用法:
$ viewscreen --letsencrypt --http-host viewscreen.example.com --download-dir /home/ubuntu/DownloadsUsage of viewscreen-linux-amd64:
-backlink string
backlink (optional)
-debug
debug mode
-download-dir string
download directory (default " /data " )
-http-addr string
listen address (default " :80 " )
-http-host string
HTTP host
-http-prefix string
HTTP URL prefix (not supported yet) (default " /viewscreen " )
-http-username string
HTTP basic auth username (default " viewscreen " )
-letsencrypt
enable TLS using Let ' s Encrypt
-metadata
use metadata service
-reverse-proxy-header string
reverse proxy auth header (default "X-Authenticated-User")
-reverse-proxy-ip string
reverse proxy auth IP
-torrent-addr string
listen address for torrent client (default ":61337")
-version
display version and exit
官方圖像是viewscreen/viewscreen ,應在任何最新的Docker環境中運行。
按照官方的Docker安裝說明:獲取Ubuntu的Docker CE
# Your download directory should be bind-mounted as `/data` inside the container using the `--volume` flag.
$ mkdir /home/ < username > /Downloads
$ sudo docker create
--name viewscreen --init --restart always
--publish 80:80 --publish 443:443
--volume /home/ < username > /Downloads:/data
viewscreen/viewscreen:latest --letsencrypt --http-host viewscreen.example.com
$ sudo docker start viewscreen
$ sudo docker logs -f viewscreen
time= " 2027-01-19T00:00:00Z " level=info msg= " viewscreen URL: https://viewscreen.example.com/viewscreen "
time= " 2027-01-19T00:00:00Z " level=info msg= " Login credentials: viewscreen / 924433342 "
INFO[0000] viewscreen URL: https://viewscreen.example.com/viewscreen
INFO[0001] Login credentials: viewscreen / 398032092
拉動最新圖像,卸下容器,然後按照上述說明重新創建容器。
# Pull the latest image
$ sudo docker pull viewscreen/viewscreen
# Stop the container
$ sudo docker stop viewscreen
# Remove the container (data is stored on the mounted volume)
$ sudo docker rm viewscreen
# Re-create and start the container
$ sudo docker create ... (see above)
如果您遇到問題,則在啟用Debug Logging的屏幕會話中運行ViewScreen可能會有助於運行ViewScreen。
# Install screen
$ screen || sudo apt-get install -y screen
# Launch in a detached screen session.
$ screen -S viewscreen -d -m viewscreen --debug --letsencrypt --http-host < your domain name >
# List all screen sessions.
$ screen -ls
# Attach to the running session.
$ screen -r viewscreen
# Press ctrl-a + ctrl-d to detach.構建靜態二進制的最簡單方法是使用Dockerfile.build文件。您還可以構建用於運行二進製文件的Docker映像。
# Download the git repo.
$ git clone https://github.com/viewscreen/viewscreen.git
$ cd viewscreen/
# Compile the code and create a Docker image for it.
$ sudo docker build --build-arg BUILD_VERSION= $( git rev-parse --short HEAD ) -t viewscreen:build -f Dockerfile.build .
# Create a container based on the image we just built.
$ sudo docker create --name viewscreenbuild viewscreen:build
# Extract the binary from the image.
$ sudo docker cp viewscreenbuild:/usr/bin/viewscreen-linux-amd64 viewscreen-linux-amd64
# We're done with the build container.
$ sudo docker rm viewscreenbuild
# Inspect the binary.
$ file viewscreen-linux-amd64
viewscreen-linux-amd64: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=c2a6f5a9e12c8c35117ec52c3572bf844c510957, stripped
# Run the binary.
$ ./viewscreen-linux-amd64 --help
# Build a tiny alpine "runner" image.
$ sudo docker build -t viewscreen:latest .感謝所有使該項目成為可能的項目和開發人員。