Add Sandstorm packaging files (#26)

I am not quite done here, I need to finish some of the packaging metadata, and I am going to maybe take a pass at permissions prior to release. Opening the pull request so you can easily track the progress.

Note that Sandstorm app metadata is supposed to be less than 1 MB total, so I optimized your screenshots. I dare you to tell the difference with the naked eye.

Co-authored-by: Jacob Weisz <inbox@jacobweisz.com>
Reviewed-on: https://git.mills.io/prologic/tube/pulls/26
Co-authored-by: Jacob Weisz <ocdtrekkie@noreply@mills.io>
Co-committed-by: Jacob Weisz <ocdtrekkie@noreply@mills.io>
This commit is contained in:
Jacob Weisz 2022-09-24 05:29:27 +00:00 committed by James Mills
parent 29f2784591
commit 70fbc8c7b0
22 changed files with 965 additions and 1 deletions

1
.gitignore vendored
View file

@ -5,6 +5,7 @@
/dist /dist
/tube /tube
tube
/.DS_Store /.DS_Store
videos/* videos/*

5
.sandstorm/.gitattributes vendored Normal file
View file

@ -0,0 +1,5 @@
# vagrant-spk creates shell scripts, which must end in \n, even on a \r\n system.
*.sh text eol=lf

5
.sandstorm/.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
# This file stores a list of sub-paths of .sandstorm/ that should be ignored by git.
.vagrant

10
.sandstorm/DESCRIPTION.md Normal file
View file

@ -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

110
.sandstorm/Vagrantfile vendored Normal file
View file

@ -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

16
.sandstorm/build.sh Normal file
View file

@ -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

37
.sandstorm/config.json Normal file
View file

@ -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": ""
}
}

View file

@ -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

1
.sandstorm/launcher.sh Normal file
View file

@ -0,0 +1 @@
exec /opt/app/tube -c /opt/app/.sandstorm/config.json

BIN
.sandstorm/pgp-keyring Normal file

Binary file not shown.

BIN
.sandstorm/pgp-signature Normal file

Binary file not shown.

View file

@ -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

View file

@ -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.
]
);

22
.sandstorm/setup.sh Normal file
View file

@ -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

1
.sandstorm/stack Normal file
View file

@ -0,0 +1 @@
golang

View file

@ -6,3 +6,4 @@ Darko Simonovski, darko at simonovski dot hotmail dot com
Davy Wybiral, davy dot wybiral at gmail dot com Davy Wybiral, davy dot wybiral at gmail dot com
James Mills, prologic at shortcircuit dot net dot au James Mills, prologic at shortcircuit dot net dot au
Bilel Medimegh, bilel dot medimegh at gmail dot com Bilel Medimegh, bilel dot medimegh at gmail dot com
Jacob Weisz, inbox at jacobweisz dot com

View file

@ -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 Previously based off of [tube](https://github.com/wybiral/tube) by [davy wybiral
](https://github.com/wybiral). (See [LICENSE.old](LICENSE.old)) ](https://github.com/wybiral). (See [LICENSE.old](LICENSE.old))
App icon is licensed under the Apache license from Google Noto Emoji.

View file

@ -97,10 +97,15 @@ func NewApp(cfg *Config) (*App, error) {
// Setup Router // Setup Router
authPassword := os.Getenv("auth_password") authPassword := os.Getenv("auth_password")
isSandstorm := os.Getenv("SANDSTORM")
r := mux.NewRouter().StrictSlash(true) r := mux.NewRouter().StrictSlash(true)
r.HandleFunc("/", a.indexHandler).Methods("GET", "OPTIONS") r.HandleFunc("/", a.indexHandler).Methods("GET", "OPTIONS")
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("/upload", middleware.OptionallyRequireAdminAuth(a.uploadHandler, authPassword)).Methods("GET", "OPTIONS", "POST")
}
r.HandleFunc("/import", a.importHandler).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/{id}.mp4", a.videoHandler).Methods("GET")
r.HandleFunc("/v/{prefix}/{id}.mp4", a.videoHandler).Methods("GET") r.HandleFunc("/v/{prefix}/{id}.mp4", a.videoHandler).Methods("GET")

View file

@ -3,6 +3,7 @@ package middleware
import ( import (
"crypto/subtle" "crypto/subtle"
"net/http" "net/http"
"strings"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -48,3 +49,17 @@ func OptionallyRequireAdminAuth(handler http.HandlerFunc, password string) http.
handler(w, r) 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)
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 534 KiB

After

Width:  |  Height:  |  Size: 134 KiB

47
static/tube.svg Normal file
View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
<g>
<path style="fill:#455A64;" d="M60.64,41.1L38.95,13.88c-0.3-0.38-0.25-0.93,0.11-1.25v0c0.38-0.33,0.95-0.3,1.28,0.08L63.41,38.7
c0.33,0.38,0.3,0.95-0.08,1.28l-1.38,1.22C61.56,41.55,60.96,41.5,60.64,41.1z"/>
<path style="fill:#455A64;" d="M66.21,40.95l-1.24-1.1c-0.41-0.37-0.45-1-0.08-1.41l22.94-25.86c0.37-0.41,1-0.45,1.41-0.08v0
c0.4,0.35,0.45,0.96,0.12,1.38l-21.7,26.96C67.29,41.27,66.63,41.33,66.21,40.95z"/>
<path style="fill:#455A64;" d="M47.74,42.46c0-3.49,7.74-6.33,17.29-6.33s17.29,2.83,17.29,6.33H47.74z"/>
<g>
<path style="fill:#82AEC0;" d="M119.57,124H8.43C5.98,124,4,121.94,4,119.41V45.1c0-2.54,1.98-4.59,4.43-4.59h111.15
c2.44,0,4.43,2.06,4.43,4.59v74.31C124,121.94,122.02,124,119.57,124z"/>
</g>
<path style="fill:#212121;" d="M116.35,119.64H11.97c-1.96,0-3.55-1.59-3.55-3.55V48.04c0-1.96,1.59-3.55,3.55-3.55h104.38
c1.96,0,3.55,1.59,3.55,3.55v68.05C119.9,118.05,118.31,119.64,116.35,119.64z"/>
<path style="fill:#B9E4EA;" d="M15.39,108.96l-4.8,7.55c-0.84,1.32,0.06,3.11,1.62,3.12c0.02,0,0.04,0,0.06,0
c2.13,0,80.24,0,82.72,0l0.07,0c1.77-0.01,2.92-1.87,2.15-3.46l-3-6.18L15.39,108.96z"/>
<path style="fill:#2F7889;stroke:#212121;stroke-width:4;stroke-miterlimit:10;" d="M95.45,105.47c-0.77,3.47-3.34,6.15-6.64,6.88
c-5.42,1.21-15.52,2.72-32.16,2.72c-17.47,0-29.19-1.66-35.5-2.89c-3.49-0.68-6.23-3.54-6.91-7.23c-1.57-8.48-3.54-25.43,0.08-46.6
c0.67-3.92,3.66-6.93,7.39-7.44c6.73-0.93,18.75-2.17,34.94-2.17c15.36,0,25.65,1.12,31.48,2.02c3.59,0.56,6.46,3.47,7.19,7.24
C99.65,80.3,97.26,97.29,95.45,105.47z"/>
<g>
<path style="fill:#455A64;" d="M114.89,116.47H103.5c-1.16,0-2.09-0.94-2.09-2.09V90.63c0-1.16,0.94-2.09,2.09-2.09h11.39
c1.16,0,2.09,0.94,2.09,2.09v23.75C116.98,115.53,116.05,116.47,114.89,116.47z"/>
</g>
<g>
<circle style="fill:#455A64;" cx="109.2" cy="58.31" r="6.89"/>
</g>
<path style="fill:#82AEC0;" d="M109.2,51.98L109.2,51.98c-0.53,0-0.99,0.36-1.11,0.87l-0.9,3.7c-0.28,1.15-0.28,2.35,0,3.51
l0.9,3.7c0.13,0.51,0.58,0.87,1.11,0.87h0c0.53,0,0.99-0.36,1.11-0.87l0.9-3.7c0.28-1.15,0.28-2.35,0-3.51l-0.9-3.7
C110.18,52.34,109.72,51.98,109.2,51.98z"/>
<g>
<circle style="fill:#455A64;" cx="109.2" cy="76.12" r="6.89"/>
</g>
<path style="fill:#82AEC0;" d="M104.33,72.08L104.33,72.08c-0.34,0.41-0.35,0.99-0.04,1.41l2.27,3.05c0.71,0.95,1.63,1.72,2.7,2.24
l3.42,1.66c0.47,0.23,1.04,0.11,1.38-0.3l0,0c0.34-0.41,0.35-0.99,0.04-1.41l-2.27-3.05c-0.71-0.95-1.63-1.72-2.7-2.24l-3.42-1.66
C105.24,71.55,104.67,71.68,104.33,72.08z"/>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="29.3551" y1="35.1457" x2="28.3104" y2="73.0555">
<stop offset="0" style="stop-color:#FFFFFF"/>
<stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0"/>
</linearGradient>
<path style="fill:url(#SVGID_1_);" d="M31.08,55.78c1.68-0.2,4.86-0.06,5.98,3.35s-1.34,4.33-2.66,5.34
c-3.79,2.89-5.67,3.99-7.95,7.14c-1.82,2.52-5,1.73-5.95,0.07c-0.76-1.34-1.32-5.64,0.29-8.48C24.26,57.12,29.4,55.98,31.08,55.78z
"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB