diff --git a/.gitignore b/.gitignore index 0e81ec3..1c7bf4f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /dist /tube +tube /.DS_Store videos/* diff --git a/.sandstorm/.gitattributes b/.sandstorm/.gitattributes new file mode 100644 index 0000000..5a533b9 --- /dev/null +++ b/.sandstorm/.gitattributes @@ -0,0 +1,5 @@ + + +# vagrant-spk creates shell scripts, which must end in \n, even on a \r\n system. +*.sh text eol=lf + diff --git a/.sandstorm/.gitignore b/.sandstorm/.gitignore new file mode 100644 index 0000000..d70e1e3 --- /dev/null +++ b/.sandstorm/.gitignore @@ -0,0 +1,5 @@ + + +# This file stores a list of sub-paths of .sandstorm/ that should be ignored by git. +.vagrant + diff --git a/.sandstorm/DESCRIPTION.md b/.sandstorm/DESCRIPTION.md new file mode 100644 index 0000000..a4a1c9e --- /dev/null +++ b/.sandstorm/DESCRIPTION.md @@ -0,0 +1,10 @@ +Tube is a YouTube-like (_without censorship and features you don't need!_) +video sharing app written in Go which also supports automatic transcoding to +MP4 H.265 AAC + +## Features + +- Easy to upload videos (just use the builtin uploader and automatic transcoder!) +- Builtin ffmpeg-based Transcoder that automatically converts your uploaded content to MP4 H.264 / AAC +- Builtin automatic thumbnail generator +- Clean, simple, familiar UI \ No newline at end of file diff --git a/.sandstorm/Vagrantfile b/.sandstorm/Vagrantfile new file mode 100644 index 0000000..481ed81 --- /dev/null +++ b/.sandstorm/Vagrantfile @@ -0,0 +1,110 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# CAUTION: DO NOT MAKE CHANGES TO THIS FILE. The vagrant-spk upgradevm process will overwrite it. + +# Guess at a reasonable name for the VM based on the folder vagrant-spk is +# run from. The timestamp is there to avoid conflicts if you have multiple +# folders with the same name. +VM_NAME = File.basename(File.dirname(File.dirname(__FILE__))) + "_sandstorm_#{Time.now.utc.to_i}" + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +# ugly hack to prevent hashicorp's bitrot. See https://github.com/hashicorp/vagrant/issues/9442 +# this setting is required for pre-2.0 vagrant, but causes an error as of 2.0.3, +# remove entirely when confident nobody uses vagrant 1.x for anything. +unless Vagrant::DEFAULT_SERVER_URL.frozen? + Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com') +end + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + # Base on the Sandstorm snapshots of the official Debian 9 (stretch) box with vboxsf support. + config.vm.box = "debian/bullseye64" + config.vm.post_up_message = "Your virtual server is running at http://local.sandstorm.io:6090." + + + if Vagrant.has_plugin?("vagrant-vbguest") then + # vagrant-vbguest is a Vagrant plugin that upgrades + # the version of VirtualBox Guest Additions within each + # guest. If you have the vagrant-vbguest plugin, then it + # needs to know how to compile kernel modules, etc., and so + # we give it this hint about operating system type. + config.vm.guest = "debian" + end + + # We forward port 6090, the vagrant-spk web port, so that developers can + # visit their Sandstorm app from their browser as local.sandstorm.io:6090 + # (aka 127.0.0.1:6090). + config.vm.network :forwarded_port, guest: 6090, host: 6090, host_ip: "127.0.0.1" + + # Use a shell script to "provision" the box. This installs Sandstorm using + # the bundled installer. + config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/global-setup.sh", keep_color: true + # Then, do stack-specific and app-specific setup. + config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/setup.sh", keep_color: true + + # Shared folders are configured per-provider since vboxsf can't handle >4096 open files, + # NFS requires privilege escalation every time you bring a VM up, + # and 9p is only available on libvirt. + + # Calculate the number of CPUs and the amount of RAM the system has, + # in a platform-dependent way; further logic below. + cpus = nil + total_kB_ram = nil + + host = RbConfig::CONFIG['host_os'] + if host =~ /darwin/ + cpus = `sysctl -n hw.ncpu`.to_i + total_kB_ram = `sysctl -n hw.memsize`.to_i / 1024 + elsif host =~ /linux/ + cpus = `nproc`.to_i + total_kB_ram = `grep MemTotal /proc/meminfo | awk '{print $2}'`.to_i + elsif host =~ /mingw/ + cpus = `powershell -Command "(Get-WmiObject Win32_Processor -Property NumberOfLogicalProcessors | Select-Object -Property NumberOfLogicalProcessors | Measure-Object NumberOfLogicalProcessors -Sum).Sum"`.to_i + total_kB_ram = `powershell -Command "[math]::Round((Get-WmiObject -Class Win32_ComputerSystem).TotalPhysicalMemory)"`.to_i / 1024 + end + # Use the same number of CPUs within Vagrant as the system, with 1 + # as a default. + # + # Use at least 512MB of RAM, and if the system has more than 2GB of + # RAM, use 1/4 of the system RAM. This seems a reasonable compromise + # between having the Vagrant guest operating system not run out of + # RAM entirely (which it basically would if we went much lower than + # 512MB) and also allowing it to use up a healthily large amount of + # RAM so it can run faster on systems that can afford it. + if cpus.nil? or cpus.zero? + cpus = 1 + end + if total_kB_ram.nil? or total_kB_ram < 2048000 + assign_ram_mb = 512 + else + assign_ram_mb = (total_kB_ram / 1024 / 4) + end + # Actually apply these CPU/memory values to the providers. + config.vm.provider :virtualbox do |vb, override| + vb.cpus = cpus + vb.memory = assign_ram_mb + vb.name = VM_NAME + vb.customize ["modifyvm", :id, "--nictype1", "Am79C973"] + + # /opt/app and /host-dot-sandstorm are used by vagrant-spk + override.vm.synced_folder "..", "/opt/app" + override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm" + # /vagrant is not used by vagrant-spk; we need this line so it gets disabled; if we removed the + # line, vagrant would automatically insert a synced folder in /vagrant, which is not what we want. + override.vm.synced_folder "..", "/vagrant", disabled: true + end + config.vm.provider :libvirt do |libvirt, override| + libvirt.cpus = cpus + libvirt.memory = assign_ram_mb + libvirt.default_prefix = VM_NAME + + # /opt/app and /host-dot-sandstorm are used by vagrant-spk + override.vm.synced_folder "..", "/opt/app", type: "9p", accessmode: "passthrough" + override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm", type: "9p", accessmode: "passthrough" + # /vagrant is not used by vagrant-spk; we need this line so it gets disabled; if we removed the + # line, vagrant would automatically insert a synced folder in /vagrant, which is not what we want. + override.vm.synced_folder "..", "/vagrant", type: "9p", accessmode: "passthrough", disabled: true + end +end diff --git a/.sandstorm/build.sh b/.sandstorm/build.sh new file mode 100644 index 0000000..a6b3bd1 --- /dev/null +++ b/.sandstorm/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -euo pipefail + +cd /opt/app +if [ ! -e go.mod ]; then + printf "Error: This directory does not contain a go module;\n" + printf "vagrant-spk's golang stack does not support older GOPATH\n" + printf "based projects. Try running:\n" >&2 + printf "\n" >&2 + printf " vagrant-spk vm ssh\n" >&2 + printf " cd /opt/app\n" >&2 + printf " go mod init example.com/mypkg\n" >&2 + exit 1 +fi +go build -o tube +exit 0 diff --git a/.sandstorm/config.json b/.sandstorm/config.json new file mode 100644 index 0000000..88165c9 --- /dev/null +++ b/.sandstorm/config.json @@ -0,0 +1,37 @@ +{ + "library": [ + { + "path": "/var/videos", + "prefix": "" + } + ], + "server": { + "host": "0.0.0.0", + "port": 8000, + "store_path": "/var/tube.db", + "upload_path": "/var/uploads", + "max_upload_size": 104857600 + }, + "thumbnailer": { + "timeout": 60, + "position_from_start": 3 + }, + "transcoder": { + "timeout": 300, + "sizes": null + }, + "feed": { + "external_url": "", + "title": "Feed Title", + "link": "http://your-url.example/about", + "description": "Feed Description", + "author": { + "name": "Author Name", + "email": "author@somewhere.example" + }, + "copyright": "Copyright Text" + }, + "copyright": { + "content": "" + } +} \ No newline at end of file diff --git a/.sandstorm/global-setup.sh b/.sandstorm/global-setup.sh new file mode 100644 index 0000000..0122740 --- /dev/null +++ b/.sandstorm/global-setup.sh @@ -0,0 +1,59 @@ +#!/bin/bash +set -euo pipefail + +# CAUTION: DO NOT MAKE CHANGES TO THIS FILE. The vagrant-spk upgradevm process will overwrite it. +# App-specific setup should be done in the setup.sh file. + +# Set options for curl. Since we only want to show errors from these curl commands, we also use +# 'cat' to buffer the output; for more information: +# https://github.com/sandstorm-io/vagrant-spk/issues/158 + +CURL_OPTS="--silent --show-error" +echo localhost > /etc/hostname +hostname localhost + +# Grub updates don't silent install well +apt-mark hold grub-pc +apt-get update +apt-get upgrade -y + +# Install curl that is needed below. +apt-get install -y curl + +# The following line copies stderr through stderr to cat without accidentally leaving it in the +# output file. Be careful when changing. See: https://github.com/sandstorm-io/vagrant-spk/pull/159 +curl $CURL_OPTS https://install.sandstorm.io/ 2>&1 > /host-dot-sandstorm/caches/install.sh | cat + +SANDSTORM_CURRENT_VERSION=$(curl $CURL_OPTS -f "https://install.sandstorm.io/dev?from=0&type=install") +SANDSTORM_PACKAGE="sandstorm-$SANDSTORM_CURRENT_VERSION.tar.xz" +if [[ ! -f /host-dot-sandstorm/caches/$SANDSTORM_PACKAGE ]] ; then + echo -n "Downloading Sandstorm version ${SANDSTORM_CURRENT_VERSION}..." + curl $CURL_OPTS --output "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE.partial" "https://dl.sandstorm.io/$SANDSTORM_PACKAGE" 2>&1 | cat + mv "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE.partial" "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" + echo "...done." +fi +if [ ! -e /opt/sandstorm/latest/sandstorm ] ; then + echo -n "Installing Sandstorm version ${SANDSTORM_CURRENT_VERSION}..." + bash /host-dot-sandstorm/caches/install.sh -d -e -p 6090 "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" >/dev/null + echo "...done." +fi +modprobe ip_tables +# Make the vagrant user part of the sandstorm group so that commands like +# `spk dev` work. +usermod -a -G 'sandstorm' 'vagrant' +# Bind to all addresses, so the vagrant port-forward works. +sudo sed --in-place='' \ + --expression='s/^BIND_IP=.*/BIND_IP=0.0.0.0/' \ + /opt/sandstorm/sandstorm.conf + +# Force vagrant-spk to use the strict CSP, see sandstorm#3424 for details. +echo 'ALLOW_LEGACY_RELAXED_CSP=false' >> /opt/sandstorm/sandstorm.conf + +sudo service sandstorm restart +# Enable apt-cacher-ng proxy to make things faster if one appears to be running on the gateway IP +GATEWAY_IP=$(ip route | grep ^default | cut -d ' ' -f 3) +if nc -z "$GATEWAY_IP" 3142 ; then + echo "Acquire::http::Proxy \"http://$GATEWAY_IP:3142\";" > /etc/apt/apt.conf.d/80httpproxy +fi +# Configure apt to retry fetching things that fail to download. +echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80sandstorm-retry diff --git a/.sandstorm/launcher.sh b/.sandstorm/launcher.sh new file mode 100644 index 0000000..f15c7d0 --- /dev/null +++ b/.sandstorm/launcher.sh @@ -0,0 +1 @@ +exec /opt/app/tube -c /opt/app/.sandstorm/config.json diff --git a/.sandstorm/pgp-keyring b/.sandstorm/pgp-keyring new file mode 100644 index 0000000..f49fdb7 Binary files /dev/null and b/.sandstorm/pgp-keyring differ diff --git a/.sandstorm/pgp-signature b/.sandstorm/pgp-signature new file mode 100644 index 0000000..9a05e4a Binary files /dev/null and b/.sandstorm/pgp-signature differ diff --git a/.sandstorm/sandstorm-files.list b/.sandstorm/sandstorm-files.list new file mode 100644 index 0000000..8afca50 --- /dev/null +++ b/.sandstorm/sandstorm-files.list @@ -0,0 +1,425 @@ +# *** WARNING: GENERATED FILE *** +# This file is automatically updated and rewritten in sorted order every time +# the app runs in dev mode. You may manually add or remove files, but don't +# expect comments or ordering to be retained. +bin +etc/alternatives/libblas.so.3-x86_64-linux-gnu +etc/alternatives/liblapack.so.3-x86_64-linux-gnu +etc/ld.so.cache +etc/localtime +etc/mime.types +lib +lib64 +opt/app/.sandstorm/config.json +opt/app/.sandstorm/launcher.sh +opt/app/tube +proc/cpuinfo +sandstorm-http-bridge +sandstorm-http-bridge-config +sandstorm-manifest +usr/bin/bash +usr/bin/ffmpeg +usr/lib/x86_64-linux-gnu/blas/libblas.so.3 +usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 +usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3 +usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0 +usr/lib/x86_64-linux-gnu/ld-2.31.so +usr/lib/x86_64-linux-gnu/libFLAC.so.8 +usr/lib/x86_64-linux-gnu/libFLAC.so.8.3.0 +usr/lib/x86_64-linux-gnu/libGL.so.1 +usr/lib/x86_64-linux-gnu/libGL.so.1.7.0 +usr/lib/x86_64-linux-gnu/libGLX.so.0 +usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0 +usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 +usr/lib/x86_64-linux-gnu/libGLdispatch.so.0.0.0 +usr/lib/x86_64-linux-gnu/libOpenCL.so.1 +usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0 +usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 +usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.14.0 +usr/lib/x86_64-linux-gnu/libX11.so.6 +usr/lib/x86_64-linux-gnu/libX11.so.6.4.0 +usr/lib/x86_64-linux-gnu/libXau.so.6 +usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 +usr/lib/x86_64-linux-gnu/libXcursor.so.1 +usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2 +usr/lib/x86_64-linux-gnu/libXdmcp.so.6 +usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 +usr/lib/x86_64-linux-gnu/libXext.so.6 +usr/lib/x86_64-linux-gnu/libXext.so.6.4.0 +usr/lib/x86_64-linux-gnu/libXfixes.so.3 +usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0 +usr/lib/x86_64-linux-gnu/libXi.so.6 +usr/lib/x86_64-linux-gnu/libXi.so.6.1.0 +usr/lib/x86_64-linux-gnu/libXinerama.so.1 +usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0 +usr/lib/x86_64-linux-gnu/libXrandr.so.2 +usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0 +usr/lib/x86_64-linux-gnu/libXrender.so.1 +usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0 +usr/lib/x86_64-linux-gnu/libXss.so.1 +usr/lib/x86_64-linux-gnu/libXss.so.1.0.0 +usr/lib/x86_64-linux-gnu/libXv.so.1 +usr/lib/x86_64-linux-gnu/libXv.so.1.0.0 +usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 +usr/lib/x86_64-linux-gnu/libXxf86vm.so.1.0.0 +usr/lib/x86_64-linux-gnu/libaom.so.0 +usr/lib/x86_64-linux-gnu/libasound.so.2 +usr/lib/x86_64-linux-gnu/libasound.so.2.0.0 +usr/lib/x86_64-linux-gnu/libass.so.9 +usr/lib/x86_64-linux-gnu/libass.so.9.1.1 +usr/lib/x86_64-linux-gnu/libasyncns.so.0 +usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 +usr/lib/x86_64-linux-gnu/libavc1394.so.0 +usr/lib/x86_64-linux-gnu/libavc1394.so.0.3.0 +usr/lib/x86_64-linux-gnu/libavcodec.so.58 +usr/lib/x86_64-linux-gnu/libavcodec.so.58.91.100 +usr/lib/x86_64-linux-gnu/libavdevice.so.58 +usr/lib/x86_64-linux-gnu/libavdevice.so.58.10.100 +usr/lib/x86_64-linux-gnu/libavfilter.so.7 +usr/lib/x86_64-linux-gnu/libavfilter.so.7.85.100 +usr/lib/x86_64-linux-gnu/libavformat.so.58 +usr/lib/x86_64-linux-gnu/libavformat.so.58.45.100 +usr/lib/x86_64-linux-gnu/libavresample.so.4 +usr/lib/x86_64-linux-gnu/libavresample.so.4.0.0 +usr/lib/x86_64-linux-gnu/libavutil.so.56 +usr/lib/x86_64-linux-gnu/libavutil.so.56.51.100 +usr/lib/x86_64-linux-gnu/libblas.so.3 +usr/lib/x86_64-linux-gnu/libblkid.so.1 +usr/lib/x86_64-linux-gnu/libblkid.so.1.1.0 +usr/lib/x86_64-linux-gnu/libbluray.so.2 +usr/lib/x86_64-linux-gnu/libbluray.so.2.3.0 +usr/lib/x86_64-linux-gnu/libbrotlicommon.so.1 +usr/lib/x86_64-linux-gnu/libbrotlicommon.so.1.0.9 +usr/lib/x86_64-linux-gnu/libbrotlidec.so.1 +usr/lib/x86_64-linux-gnu/libbrotlidec.so.1.0.9 +usr/lib/x86_64-linux-gnu/libbs2b.so.0 +usr/lib/x86_64-linux-gnu/libbs2b.so.0.0.0 +usr/lib/x86_64-linux-gnu/libbsd.so.0 +usr/lib/x86_64-linux-gnu/libbsd.so.0.11.3 +usr/lib/x86_64-linux-gnu/libbz2.so.1.0 +usr/lib/x86_64-linux-gnu/libbz2.so.1.0.4 +usr/lib/x86_64-linux-gnu/libc-2.31.so +usr/lib/x86_64-linux-gnu/libc.so.6 +usr/lib/x86_64-linux-gnu/libcaca.so.0 +usr/lib/x86_64-linux-gnu/libcaca.so.0.99.19 +usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 +usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2.11600.0 +usr/lib/x86_64-linux-gnu/libcairo.so.2 +usr/lib/x86_64-linux-gnu/libcairo.so.2.11600.0 +usr/lib/x86_64-linux-gnu/libcdio.so.19 +usr/lib/x86_64-linux-gnu/libcdio.so.19.0.0 +usr/lib/x86_64-linux-gnu/libcdio_cdda.so.2 +usr/lib/x86_64-linux-gnu/libcdio_cdda.so.2.0.0 +usr/lib/x86_64-linux-gnu/libcdio_paranoia.so.2 +usr/lib/x86_64-linux-gnu/libcdio_paranoia.so.2.0.0 +usr/lib/x86_64-linux-gnu/libchromaprint.so.1 +usr/lib/x86_64-linux-gnu/libchromaprint.so.1.5.0 +usr/lib/x86_64-linux-gnu/libcodec2.so.0.9 +usr/lib/x86_64-linux-gnu/libcom_err.so.2 +usr/lib/x86_64-linux-gnu/libcom_err.so.2.1 +usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 +usr/lib/x86_64-linux-gnu/libdatrie.so.1 +usr/lib/x86_64-linux-gnu/libdatrie.so.1.4.0 +usr/lib/x86_64-linux-gnu/libdav1d.so.4 +usr/lib/x86_64-linux-gnu/libdav1d.so.4.0.2 +usr/lib/x86_64-linux-gnu/libdbus-1.so.3 +usr/lib/x86_64-linux-gnu/libdbus-1.so.3.19.13 +usr/lib/x86_64-linux-gnu/libdc1394.so.25 +usr/lib/x86_64-linux-gnu/libdc1394.so.25.0.0 +usr/lib/x86_64-linux-gnu/libdl-2.31.so +usr/lib/x86_64-linux-gnu/libdl.so.2 +usr/lib/x86_64-linux-gnu/libdrm.so.2 +usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0 +usr/lib/x86_64-linux-gnu/libexpat.so.1 +usr/lib/x86_64-linux-gnu/libexpat.so.1.6.12 +usr/lib/x86_64-linux-gnu/libffi.so.7 +usr/lib/x86_64-linux-gnu/libffi.so.7.1.0 +usr/lib/x86_64-linux-gnu/libfftw3.so.3 +usr/lib/x86_64-linux-gnu/libfftw3.so.3.5.8 +usr/lib/x86_64-linux-gnu/libflite.so.1 +usr/lib/x86_64-linux-gnu/libflite.so.2.2 +usr/lib/x86_64-linux-gnu/libflite_cmu_us_awb.so.1 +usr/lib/x86_64-linux-gnu/libflite_cmu_us_awb.so.2.2 +usr/lib/x86_64-linux-gnu/libflite_cmu_us_kal.so.1 +usr/lib/x86_64-linux-gnu/libflite_cmu_us_kal.so.2.2 +usr/lib/x86_64-linux-gnu/libflite_cmu_us_kal16.so.1 +usr/lib/x86_64-linux-gnu/libflite_cmu_us_kal16.so.2.2 +usr/lib/x86_64-linux-gnu/libflite_cmu_us_rms.so.1 +usr/lib/x86_64-linux-gnu/libflite_cmu_us_rms.so.2.2 +usr/lib/x86_64-linux-gnu/libflite_cmu_us_slt.so.1 +usr/lib/x86_64-linux-gnu/libflite_cmu_us_slt.so.2.2 +usr/lib/x86_64-linux-gnu/libflite_cmulex.so.1 +usr/lib/x86_64-linux-gnu/libflite_cmulex.so.2.2 +usr/lib/x86_64-linux-gnu/libflite_usenglish.so.1 +usr/lib/x86_64-linux-gnu/libflite_usenglish.so.2.2 +usr/lib/x86_64-linux-gnu/libfontconfig.so.1 +usr/lib/x86_64-linux-gnu/libfontconfig.so.1.12.0 +usr/lib/x86_64-linux-gnu/libfreetype.so.6 +usr/lib/x86_64-linux-gnu/libfreetype.so.6.17.4 +usr/lib/x86_64-linux-gnu/libfribidi.so.0 +usr/lib/x86_64-linux-gnu/libfribidi.so.0.4.0 +usr/lib/x86_64-linux-gnu/libgbm.so.1 +usr/lib/x86_64-linux-gnu/libgbm.so.1.0.0 +usr/lib/x86_64-linux-gnu/libgcc_s.so.1 +usr/lib/x86_64-linux-gnu/libgcrypt.so.20 +usr/lib/x86_64-linux-gnu/libgcrypt.so.20.2.8 +usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 +usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.4200.2 +usr/lib/x86_64-linux-gnu/libgfortran.so.5 +usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0 +usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 +usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6600.8 +usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 +usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6600.8 +usr/lib/x86_64-linux-gnu/libgme.so.0 +usr/lib/x86_64-linux-gnu/libgme.so.0.6.3 +usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 +usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.6600.8 +usr/lib/x86_64-linux-gnu/libgmp.so.10 +usr/lib/x86_64-linux-gnu/libgmp.so.10.4.1 +usr/lib/x86_64-linux-gnu/libgnutls.so.30 +usr/lib/x86_64-linux-gnu/libgnutls.so.30.29.1 +usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 +usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6600.8 +usr/lib/x86_64-linux-gnu/libgomp.so.1 +usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0 +usr/lib/x86_64-linux-gnu/libgpg-error.so.0 +usr/lib/x86_64-linux-gnu/libgpg-error.so.0.29.0 +usr/lib/x86_64-linux-gnu/libgraphite2.so.3 +usr/lib/x86_64-linux-gnu/libgraphite2.so.3.2.1 +usr/lib/x86_64-linux-gnu/libgsm.so.1 +usr/lib/x86_64-linux-gnu/libgsm.so.1.0.18 +usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 +usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2 +usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 +usr/lib/x86_64-linux-gnu/libharfbuzz.so.0.20704.0 +usr/lib/x86_64-linux-gnu/libhogweed.so.6 +usr/lib/x86_64-linux-gnu/libhogweed.so.6.4 +usr/lib/x86_64-linux-gnu/libicudata.so.67 +usr/lib/x86_64-linux-gnu/libicudata.so.67.1 +usr/lib/x86_64-linux-gnu/libicuuc.so.67 +usr/lib/x86_64-linux-gnu/libicuuc.so.67.1 +usr/lib/x86_64-linux-gnu/libidn2.so.0 +usr/lib/x86_64-linux-gnu/libidn2.so.0.3.7 +usr/lib/x86_64-linux-gnu/libiec61883.so.0 +usr/lib/x86_64-linux-gnu/libiec61883.so.0.1.1 +usr/lib/x86_64-linux-gnu/libjack.so.0 +usr/lib/x86_64-linux-gnu/libjack.so.0.1.0 +usr/lib/x86_64-linux-gnu/libk5crypto.so.3 +usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1 +usr/lib/x86_64-linux-gnu/libkeyutils.so.1 +usr/lib/x86_64-linux-gnu/libkeyutils.so.1.9 +usr/lib/x86_64-linux-gnu/libkrb5.so.3 +usr/lib/x86_64-linux-gnu/libkrb5.so.3.3 +usr/lib/x86_64-linux-gnu/libkrb5support.so.0 +usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1 +usr/lib/x86_64-linux-gnu/liblapack.so.3 +usr/lib/x86_64-linux-gnu/liblilv-0.so.0 +usr/lib/x86_64-linux-gnu/liblilv-0.so.0.24.12 +usr/lib/x86_64-linux-gnu/liblz4.so.1 +usr/lib/x86_64-linux-gnu/liblz4.so.1.9.3 +usr/lib/x86_64-linux-gnu/liblzma.so.5 +usr/lib/x86_64-linux-gnu/liblzma.so.5.2.5 +usr/lib/x86_64-linux-gnu/libm-2.31.so +usr/lib/x86_64-linux-gnu/libm.so.6 +usr/lib/x86_64-linux-gnu/libmd.so.0 +usr/lib/x86_64-linux-gnu/libmd.so.0.0.4 +usr/lib/x86_64-linux-gnu/libmfx.so.1 +usr/lib/x86_64-linux-gnu/libmfx.so.1.34 +usr/lib/x86_64-linux-gnu/libmount.so.1 +usr/lib/x86_64-linux-gnu/libmount.so.1.1.0 +usr/lib/x86_64-linux-gnu/libmp3lame.so.0 +usr/lib/x86_64-linux-gnu/libmp3lame.so.0.0.0 +usr/lib/x86_64-linux-gnu/libmpg123.so.0 +usr/lib/x86_64-linux-gnu/libmpg123.so.0.45.3 +usr/lib/x86_64-linux-gnu/libmysofa.so.1 +usr/lib/x86_64-linux-gnu/libmysofa.so.1.1.0 +usr/lib/x86_64-linux-gnu/libncursesw.so.6 +usr/lib/x86_64-linux-gnu/libncursesw.so.6.2 +usr/lib/x86_64-linux-gnu/libnettle.so.8 +usr/lib/x86_64-linux-gnu/libnettle.so.8.4 +usr/lib/x86_64-linux-gnu/libnorm.so.1 +usr/lib/x86_64-linux-gnu/libnsl.so.2 +usr/lib/x86_64-linux-gnu/libnsl.so.2.0.1 +usr/lib/x86_64-linux-gnu/libnss_files-2.31.so +usr/lib/x86_64-linux-gnu/libnss_files.so.2 +usr/lib/x86_64-linux-gnu/libnuma.so.1 +usr/lib/x86_64-linux-gnu/libnuma.so.1.0.0 +usr/lib/x86_64-linux-gnu/libogg.so.0 +usr/lib/x86_64-linux-gnu/libogg.so.0.8.4 +usr/lib/x86_64-linux-gnu/libopenal.so.1 +usr/lib/x86_64-linux-gnu/libopenal.so.1.19.1 +usr/lib/x86_64-linux-gnu/libopenjp2.so.2.4.0 +usr/lib/x86_64-linux-gnu/libopenjp2.so.7 +usr/lib/x86_64-linux-gnu/libopenmpt.so.0 +usr/lib/x86_64-linux-gnu/libopenmpt.so.0.1.1 +usr/lib/x86_64-linux-gnu/libopus.so.0 +usr/lib/x86_64-linux-gnu/libopus.so.0.8.0 +usr/lib/x86_64-linux-gnu/libp11-kit.so.0 +usr/lib/x86_64-linux-gnu/libp11-kit.so.0.3.0 +usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 +usr/lib/x86_64-linux-gnu/libpango-1.0.so.0.4600.2 +usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 +usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0.4600.2 +usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 +usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0.4600.2 +usr/lib/x86_64-linux-gnu/libpcre.so.3 +usr/lib/x86_64-linux-gnu/libpcre.so.3.13.3 +usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 +usr/lib/x86_64-linux-gnu/libpcre2-8.so.0.10.1 +usr/lib/x86_64-linux-gnu/libpgm-5.3.so.0 +usr/lib/x86_64-linux-gnu/libpgm-5.3.so.0.0.128 +usr/lib/x86_64-linux-gnu/libpixman-1.so.0 +usr/lib/x86_64-linux-gnu/libpixman-1.so.0.40.0 +usr/lib/x86_64-linux-gnu/libpng16.so.16 +usr/lib/x86_64-linux-gnu/libpng16.so.16.37.0 +usr/lib/x86_64-linux-gnu/libpocketsphinx.so.3 +usr/lib/x86_64-linux-gnu/libpocketsphinx.so.3.0.0 +usr/lib/x86_64-linux-gnu/libpostproc.so.55 +usr/lib/x86_64-linux-gnu/libpostproc.so.55.7.100 +usr/lib/x86_64-linux-gnu/libpthread-2.31.so +usr/lib/x86_64-linux-gnu/libpthread.so.0 +usr/lib/x86_64-linux-gnu/libpulse.so.0 +usr/lib/x86_64-linux-gnu/libpulse.so.0.23.0 +usr/lib/x86_64-linux-gnu/libquadmath.so.0 +usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0 +usr/lib/x86_64-linux-gnu/librabbitmq.so.4 +usr/lib/x86_64-linux-gnu/librabbitmq.so.4.4.0 +usr/lib/x86_64-linux-gnu/libraw1394.so.11 +usr/lib/x86_64-linux-gnu/libraw1394.so.11.1.0 +usr/lib/x86_64-linux-gnu/libresolv-2.31.so +usr/lib/x86_64-linux-gnu/libresolv.so.2 +usr/lib/x86_64-linux-gnu/librom1394.so.0 +usr/lib/x86_64-linux-gnu/librom1394.so.0.3.0 +usr/lib/x86_64-linux-gnu/librsvg-2.so.2 +usr/lib/x86_64-linux-gnu/librsvg-2.so.2.47.0 +usr/lib/x86_64-linux-gnu/librt-2.31.so +usr/lib/x86_64-linux-gnu/librt.so.1 +usr/lib/x86_64-linux-gnu/librubberband.so.2 +usr/lib/x86_64-linux-gnu/librubberband.so.2.1.2 +usr/lib/x86_64-linux-gnu/libsamplerate.so.0 +usr/lib/x86_64-linux-gnu/libsamplerate.so.0.2.1 +usr/lib/x86_64-linux-gnu/libselinux.so.1 +usr/lib/x86_64-linux-gnu/libserd-0.so.0 +usr/lib/x86_64-linux-gnu/libserd-0.so.0.30.10 +usr/lib/x86_64-linux-gnu/libshine.so.3 +usr/lib/x86_64-linux-gnu/libshine.so.3.0.1 +usr/lib/x86_64-linux-gnu/libslang.so.2 +usr/lib/x86_64-linux-gnu/libslang.so.2.3.2 +usr/lib/x86_64-linux-gnu/libsnappy.so.1 +usr/lib/x86_64-linux-gnu/libsnappy.so.1.1.8 +usr/lib/x86_64-linux-gnu/libsndfile.so.1 +usr/lib/x86_64-linux-gnu/libsndfile.so.1.0.31 +usr/lib/x86_64-linux-gnu/libsndio.so.7.0 +usr/lib/x86_64-linux-gnu/libsodium.so.23 +usr/lib/x86_64-linux-gnu/libsodium.so.23.3.0 +usr/lib/x86_64-linux-gnu/libsord-0.so.0 +usr/lib/x86_64-linux-gnu/libsord-0.so.0.16.8 +usr/lib/x86_64-linux-gnu/libsoxr.so.0 +usr/lib/x86_64-linux-gnu/libsoxr.so.0.1.2 +usr/lib/x86_64-linux-gnu/libspeex.so.1 +usr/lib/x86_64-linux-gnu/libspeex.so.1.5.0 +usr/lib/x86_64-linux-gnu/libsphinxbase.so.3 +usr/lib/x86_64-linux-gnu/libsphinxbase.so.3.0.0 +usr/lib/x86_64-linux-gnu/libsratom-0.so.0 +usr/lib/x86_64-linux-gnu/libsratom-0.so.0.6.8 +usr/lib/x86_64-linux-gnu/libsrt-gnutls.so.1.4 +usr/lib/x86_64-linux-gnu/libsrt-gnutls.so.1.4.2 +usr/lib/x86_64-linux-gnu/libssh-gcrypt.so.4 +usr/lib/x86_64-linux-gnu/libssh-gcrypt.so.4.8.6 +usr/lib/x86_64-linux-gnu/libssl.so.1.1 +usr/lib/x86_64-linux-gnu/libstdc++.so.6 +usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28 +usr/lib/x86_64-linux-gnu/libswresample.so.3 +usr/lib/x86_64-linux-gnu/libswresample.so.3.7.100 +usr/lib/x86_64-linux-gnu/libswscale.so.5 +usr/lib/x86_64-linux-gnu/libswscale.so.5.7.100 +usr/lib/x86_64-linux-gnu/libsystemd.so.0 +usr/lib/x86_64-linux-gnu/libsystemd.so.0.30.0 +usr/lib/x86_64-linux-gnu/libtasn1.so.6 +usr/lib/x86_64-linux-gnu/libtasn1.so.6.6.0 +usr/lib/x86_64-linux-gnu/libthai.so.0 +usr/lib/x86_64-linux-gnu/libthai.so.0.3.1 +usr/lib/x86_64-linux-gnu/libtheoradec.so.1 +usr/lib/x86_64-linux-gnu/libtheoradec.so.1.1.4 +usr/lib/x86_64-linux-gnu/libtheoraenc.so.1 +usr/lib/x86_64-linux-gnu/libtheoraenc.so.1.1.2 +usr/lib/x86_64-linux-gnu/libtinfo.so.6 +usr/lib/x86_64-linux-gnu/libtinfo.so.6.2 +usr/lib/x86_64-linux-gnu/libtirpc.so.3 +usr/lib/x86_64-linux-gnu/libtirpc.so.3.0.0 +usr/lib/x86_64-linux-gnu/libtwolame.so.0 +usr/lib/x86_64-linux-gnu/libtwolame.so.0.0.0 +usr/lib/x86_64-linux-gnu/libudev.so.1 +usr/lib/x86_64-linux-gnu/libudev.so.1.7.0 +usr/lib/x86_64-linux-gnu/libudfread.so.0 +usr/lib/x86_64-linux-gnu/libudfread.so.0.1.0 +usr/lib/x86_64-linux-gnu/libunistring.so.2 +usr/lib/x86_64-linux-gnu/libunistring.so.2.1.0 +usr/lib/x86_64-linux-gnu/libusb-1.0.so.0 +usr/lib/x86_64-linux-gnu/libusb-1.0.so.0.3.0 +usr/lib/x86_64-linux-gnu/libuuid.so.1 +usr/lib/x86_64-linux-gnu/libuuid.so.1.3.0 +usr/lib/x86_64-linux-gnu/libva-drm.so.2 +usr/lib/x86_64-linux-gnu/libva-drm.so.2.1000.0 +usr/lib/x86_64-linux-gnu/libva-x11.so.2 +usr/lib/x86_64-linux-gnu/libva-x11.so.2.1000.0 +usr/lib/x86_64-linux-gnu/libva.so.2 +usr/lib/x86_64-linux-gnu/libva.so.2.1000.0 +usr/lib/x86_64-linux-gnu/libvdpau.so.1 +usr/lib/x86_64-linux-gnu/libvdpau.so.1.0.0 +usr/lib/x86_64-linux-gnu/libvidstab.so.1.1 +usr/lib/x86_64-linux-gnu/libvorbis.so.0 +usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.9 +usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 +usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.12 +usr/lib/x86_64-linux-gnu/libvorbisfile.so.3 +usr/lib/x86_64-linux-gnu/libvorbisfile.so.3.3.8 +usr/lib/x86_64-linux-gnu/libvpx.so.6 +usr/lib/x86_64-linux-gnu/libvpx.so.6.3.0 +usr/lib/x86_64-linux-gnu/libwavpack.so.1 +usr/lib/x86_64-linux-gnu/libwavpack.so.1.2.3 +usr/lib/x86_64-linux-gnu/libwayland-client.so.0 +usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0 +usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0 +usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0.0.0 +usr/lib/x86_64-linux-gnu/libwayland-egl.so.1 +usr/lib/x86_64-linux-gnu/libwayland-egl.so.1.0.0 +usr/lib/x86_64-linux-gnu/libwayland-server.so.0 +usr/lib/x86_64-linux-gnu/libwayland-server.so.0.1.0 +usr/lib/x86_64-linux-gnu/libwebp.so.6 +usr/lib/x86_64-linux-gnu/libwebp.so.6.0.2 +usr/lib/x86_64-linux-gnu/libwebpmux.so.3 +usr/lib/x86_64-linux-gnu/libwebpmux.so.3.0.1 +usr/lib/x86_64-linux-gnu/libwrap.so.0 +usr/lib/x86_64-linux-gnu/libwrap.so.0.7.6 +usr/lib/x86_64-linux-gnu/libx264.so.160 +usr/lib/x86_64-linux-gnu/libx265.so.192 +usr/lib/x86_64-linux-gnu/libxcb-render.so.0 +usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0 +usr/lib/x86_64-linux-gnu/libxcb-shape.so.0 +usr/lib/x86_64-linux-gnu/libxcb-shape.so.0.0.0 +usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 +usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0 +usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0 +usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0.0.0 +usr/lib/x86_64-linux-gnu/libxcb.so.1 +usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 +usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 +usr/lib/x86_64-linux-gnu/libxkbcommon.so.0.0.0 +usr/lib/x86_64-linux-gnu/libxml2.so.2 +usr/lib/x86_64-linux-gnu/libxml2.so.2.9.10 +usr/lib/x86_64-linux-gnu/libxvidcore.so.4 +usr/lib/x86_64-linux-gnu/libxvidcore.so.4.3 +usr/lib/x86_64-linux-gnu/libz.so.1 +usr/lib/x86_64-linux-gnu/libz.so.1.2.11 +usr/lib/x86_64-linux-gnu/libzmq.so.5 +usr/lib/x86_64-linux-gnu/libzmq.so.5.2.4 +usr/lib/x86_64-linux-gnu/libzstd.so.1 +usr/lib/x86_64-linux-gnu/libzstd.so.1.4.8 +usr/lib/x86_64-linux-gnu/libzvbi.so.0 +usr/lib/x86_64-linux-gnu/libzvbi.so.0.13.2 +usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-14.2.so +usr/lib64/ld-linux-x86-64.so.2 +usr/share/mime/globs2 +usr/share/zoneinfo/Etc/UTC diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp new file mode 100644 index 0000000..d641022 --- /dev/null +++ b/.sandstorm/sandstorm-pkgdef.capnp @@ -0,0 +1,202 @@ +@0xfd1c6ca5525e2cdb; + +using Spk = import "/sandstorm/package.capnp"; +# This imports: +# $SANDSTORM_HOME/latest/usr/include/sandstorm/package.capnp +# Check out that file to see the full, documented package definition format. + +const pkgdef :Spk.PackageDefinition = ( + # The package definition. Note that the spk tool looks specifically for the + # "pkgdef" constant. + + id = "70xjeuj6t85v3s9a3up583q97wu044mnt8aekf3pqs41e3ct2v70", + # Your app ID is actually its public key. The private key was placed in + # your keyring. All updates must be signed with the same key. + + manifest = ( + # This manifest is included in your app package to tell Sandstorm + # about your app. + + appTitle = (defaultText = "Tube"), + + appVersion = 0, # Increment this for every release. + + appMarketingVersion = (defaultText = "0.0.1"), + # Human-readable representation of appVersion. Should match the way you + # identify versions of your app in documentation and marketing. + + actions = [ + # Define your "new document" handlers here. + ( nounPhrase = (defaultText = "channel"), + command = .myCommand + # The command to run when starting for the first time. (".myCommand" + # is just a constant defined at the bottom of the file.) + ) + ], + + continueCommand = .myCommand, + # This is the command called to start your app back up after it has been + # shut down for inactivity. Here we're using the same command as for + # starting a new instance, but you could use different commands for each + # case. + + metadata = ( + icons = ( + appGrid = (svg = embed "../static/tube.svg"), + grain = (svg = embed "../static/tube.svg"), + market = (svg = embed "../static/tube.svg"), + marketBig = (svg = embed "../static/tube.svg"), + ), + + website = "https://git.mills.io/prologic/tube", + + codeUrl = "https://git.mills.io/prologic/tube", + + license = (openSource = mit), + + categories = [media], + + author = ( + contactEmail = "inbox@jacobweisz.com", + + pgpSignature = embed "pgp-signature", + + upstreamAuthor = "James Mills", + ), + + pgpKeyring = embed "pgp-keyring", + + description = (defaultText = embed "DESCRIPTION.md"), + + shortDescription = (defaultText = "Simple video sharing"), + + screenshots = [ + (width = 2624, height = 1624, png = embed "../screenshot-1.png"), + (width = 2624, height = 1624, png = embed "../screenshot-2.png"), + ], + changeLog = (defaultText = embed "../CHANGELOG.md"), + ), + ), + + sourceMap = ( + # Here we defined where to look for files to copy into your package. The + # `spk dev` command actually figures out what files your app needs + # automatically by running it on a FUSE filesystem. So, the mappings + # here are only to tell it where to find files that the app wants. + searchPath = [ + ( sourcePath = "." ), # Search this directory first. + ( sourcePath = "/", # Then search the system root directory. + hidePaths = [ "home", "proc", "sys", + "etc/passwd", "etc/hosts", "etc/host.conf", + "etc/nsswitch.conf", "etc/resolv.conf" ] + # You probably don't want the app pulling files from these places, + # so we hide them. Note that /dev, /var, and /tmp are implicitly + # hidden because Sandstorm itself provides them. + ) + ] + ), + + fileList = "sandstorm-files.list", + # `spk dev` will write a list of all the files your app uses to this file. + # You should review it later, before shipping your app. + + alwaysInclude = [], + # Fill this list with more names of files or directories that should be + # included in your package, even if not listed in sandstorm-files.list. + # Use this to force-include stuff that you know you need but which may + # not have been detected as a dependency during `spk dev`. If you list + # a directory here, its entire contents will be included recursively. + + bridgeConfig = ( + # Used for integrating permissions and roles into the Sandstorm shell + # and for sandstorm-http-bridge to pass to your app. + # Uncomment this block and adjust the permissions and roles to make + # sense for your app. + # For more information, see high-level documentation at + # https://docs.sandstorm.io/en/latest/developing/auth/ + # and advanced details in the "BridgeConfig" section of + # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/package.capnp + viewInfo = ( + # For details on the viewInfo field, consult "ViewInfo" in + # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/grain.capnp + + permissions = [ + # Permissions which a user may or may not possess. A user's current + # permissions are passed to the app as a comma-separated list of `name` + # fields in the X-Sandstorm-Permissions header with each request. + # + # IMPORTANT: only ever append to this list! Reordering or removing fields + # will change behavior and permissions for existing grains! To deprecate a + # permission, or for more information, see "PermissionDef" in + # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/grain.capnp + ( + name = "admin", + # Name of the permission, used as an identifier for the permission in cases where string + # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header. + + title = (defaultText = "admin"), + # Display name of the permission, e.g. to display in a checklist of permissions + # that may be assigned when sharing. + + description = (defaultText = "grants ability to do anything"), + # Prose describing what this role means, suitable for a tool tip or similar help text. + ), + ( + name = "upload", + title = (defaultText = "upload"), + description = (defaultText = "ability to upload content"), + ), + ], + roles = [ + # Roles are logical collections of permissions. For instance, your app may have + # a "viewer" role and an "editor" role + ( + title = (defaultText = "administrator"), + # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles. + + permissions = [true,true], + # An array indicating which permissions this role carries. + # It should be the same length as the permissions array in + # viewInfo, and the order of the lists must match. + + verbPhrase = (defaultText = "can do anything"), + # Brief explanatory text to show in the sharing UI indicating + # what a user assigned this role will be able to do with the grain. + + description = (defaultText = "administrators can edit and configure all settings."), + # Prose describing what this role means, suitable for a tool tip or similar help text. + ), + ( + title = (defaultText = "uploader"), + permissions = [false,true], + verbPhrase = (defaultText = "can upload videos"), + description = (defaultText = "uploaders may upload new videos."), + ), + ( + title = (defaultText = "viewer"), + permissions = [false,false], + verbPhrase = (defaultText = "can watch videos"), + description = (defaultText = "viewers may watch videos on the channel."), + ), + ], + ), + #apiPath = "/api", + # Apps can export an API to the world. The API is to be used primarily by Javascript + # code and native apps, so it can't serve out regular HTML to browsers. If a request + # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with + # this string, if specified. + ), +); + +const myCommand :Spk.Manifest.Command = ( + # Here we define the command used to start up your server. + argv = ["/sandstorm-http-bridge", "8000", "--", "/bin/bash", "/opt/app/.sandstorm/launcher.sh"], + environ = [ + # Note that this defines the *entire* environment seen by your app. + (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin"), + (key = "SANDSTORM", value = "1"), + # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm + # can detect if $SANDSTORM="1" at runtime, switching UI and/or backend to use + # the app's Sandstorm-specific integration code. + ] +); diff --git a/.sandstorm/setup.sh b/.sandstorm/setup.sh new file mode 100644 index 0000000..88d2cca --- /dev/null +++ b/.sandstorm/setup.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# When you change this file, you must take manual action. Read this doc: +# - https://docs.sandstorm.io/en/latest/vagrant-spk/customizing/#setupsh + +set -euo pipefail + +version=1.19.1 +os=linux +arch=amd64 + +# The version of golang in the debian repositories tends to be incredibly +# out of date; let's get ourselves a newer version from upstream: +curl -L https://golang.org/dl/go${version}.${os}-${arch}.tar.gz -o go.tar.gz +tar -C /usr/local -xzf go.tar.gz +rm go.tar.gz +echo 'export PATH=/usr/local/go/bin:$PATH' > /etc/profile.d/go.sh + +# Needed for fetching go libraries: +apt-get install -y git ffmpeg + +exit 0 \ No newline at end of file diff --git a/.sandstorm/stack b/.sandstorm/stack new file mode 100644 index 0000000..f5267c2 --- /dev/null +++ b/.sandstorm/stack @@ -0,0 +1 @@ +golang diff --git a/AUTHORS b/AUTHORS index 6c7ff78..91d770e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,3 +6,4 @@ Darko Simonovski, darko at simonovski dot hotmail dot com Davy Wybiral, davy dot wybiral at gmail dot com James Mills, prologic at shortcircuit dot net dot au Bilel Medimegh, bilel dot medimegh at gmail dot com +Jacob Weisz, inbox at jacobweisz dot com diff --git a/README.md b/README.md index fb36e9c..61b5b06 100644 --- a/README.md +++ b/README.md @@ -236,3 +236,5 @@ tube source code is available under the MIT [License](LICENSE). Previously based off of [tube](https://github.com/wybiral/tube) by [davy wybiral ](https://github.com/wybiral). (See [LICENSE.old](LICENSE.old)) + +App icon is licensed under the Apache license from Google Noto Emoji. \ No newline at end of file diff --git a/app/app.go b/app/app.go index 6b89c5b..11b06f4 100644 --- a/app/app.go +++ b/app/app.go @@ -97,10 +97,15 @@ func NewApp(cfg *Config) (*App, error) { // Setup Router authPassword := os.Getenv("auth_password") + isSandstorm := os.Getenv("SANDSTORM") r := mux.NewRouter().StrictSlash(true) r.HandleFunc("/", a.indexHandler).Methods("GET", "OPTIONS") - r.HandleFunc("/upload", middleware.OptionallyRequireAdminAuth(a.uploadHandler, authPassword)).Methods("GET", "OPTIONS", "POST") + if isSandstorm == "1" { + r.HandleFunc("/upload", middleware.RequireSandstormPermission(a.uploadHandler, "upload")).Methods("GET", "OPTIONS", "POST") + } else { + r.HandleFunc("/upload", middleware.OptionallyRequireAdminAuth(a.uploadHandler, authPassword)).Methods("GET", "OPTIONS", "POST") + } r.HandleFunc("/import", a.importHandler).Methods("GET", "OPTIONS", "POST") r.HandleFunc("/v/{id}.mp4", a.videoHandler).Methods("GET") r.HandleFunc("/v/{prefix}/{id}.mp4", a.videoHandler).Methods("GET") diff --git a/app/middleware/auth.go b/app/middleware/auth.go index 61a58e3..c023492 100644 --- a/app/middleware/auth.go +++ b/app/middleware/auth.go @@ -3,6 +3,7 @@ package middleware import ( "crypto/subtle" "net/http" + "strings" log "github.com/sirupsen/logrus" ) @@ -48,3 +49,17 @@ func OptionallyRequireAdminAuth(handler http.HandlerFunc, password string) http. handler(w, r) } } + +func RequireSandstormPermission(handler http.HandlerFunc, permissionNeeded string) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + + // Failed + if !strings.Contains(r.Header.Get("X-Sandstorm-Permissions"), permissionNeeded) { + http.Error(w, "Unauthorized", http.StatusUnauthorized) + log.Debugln("No upload capability granted") + return + } + + handler(w, r) + } +} diff --git a/screenshot-1.png b/screenshot-1.png index 6ce4b3a..5e01551 100644 Binary files a/screenshot-1.png and b/screenshot-1.png differ diff --git a/screenshot-2.png b/screenshot-2.png index cafc8a4..8adeb7a 100644 Binary files a/screenshot-2.png and b/screenshot-2.png differ diff --git a/static/tube.svg b/static/tube.svg new file mode 100644 index 0000000..2c1525a --- /dev/null +++ b/static/tube.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +