parent
fe81ae593e
commit
64979308ac
@ -1,4 +1,2 @@ |
||||
android |
||||
browser |
||||
ios |
||||
server |
||||
|
||||
@ -0,0 +1 @@ |
||||
1.5:c17761bf-b2f4-49da-87b9-79a95da91252 |
||||
@ -0,0 +1 @@ |
||||
1440583526 |
||||
@ -0,0 +1 @@ |
||||
1000 |
||||
@ -0,0 +1 @@ |
||||
c17761bf-b2f4-49da-87b9-79a95da91252 |
||||
@ -0,0 +1 @@ |
||||
0d8eab53d7a1444288ff01aef6a03573 |
||||
@ -0,0 +1,27 @@ |
||||
-----BEGIN RSA PRIVATE KEY----- |
||||
MIIEogIBAAKCAQEAk1hkJc1e5h4yDnnOCJ29YUf0x1DhgSkGY0hcfWAubSEGS1HX |
||||
bxLIE+Al44jENNPrrdddtCKY+onxeefQo7FUFxVMEOM5JqFzpyq1Sliw9w7QmJef |
||||
DImS0z54ezqQ952W7BQc/XOndVpzvRPVREcRccOdGk5P60zoWZP/Oy4tviHcH7RM |
||||
faeBrs7ykD6RJKAjKwuMF3p/+FlPCPwql8cTifYZspFwFTja/XStk3PX4eLle5si |
||||
ZFN7SjsDa+FflUenmgkpW04E6TUaQHVhapHJCCbYRqwCrUX/5Yf2PakFPqfnRBaE |
||||
KKkGLRnVc7UrCDk21m/IZRmTHgSLAyDEGkFOIwIDAQABAoIBAHCJBAQzNJXA3i5c |
||||
LVY7U5bnJDbOuUyyjqRpcep3+T10CaChI088Iv+7JHUB0gkfClO9t12LRxejH4Eh |
||||
4iIDn9v5ch07zjyI9xHn9oqP7qji8cJ5mwoyUKdygQZtFqdn/wrT2chh+rYQnXD9 |
||||
otcBCHvBEU40HanzFUrFVBxZCqq5fP69ujsOVghykyzI5mWIRNGFXyvN8HxjXMr6 |
||||
mSiCvzEMscTZzdoCvy18lvDTWg5GyPLq9EM+4xQoEqlQv2RQEUmC2wC4JK09bJ8T |
||||
d19RGax1Nvbvw0ywWTgG/blGS0h7Q4aJziIL1Bv1IoIonn69wjL/qaWh+vqhL6QV |
||||
m87qh7ECgYEAwzy0kwO5Xo1mWZN4lJ8WrU7xh5TtsSJkfMlEQNsmhHAFN9B7p7MX |
||||
CrIAMd+U9z8ptxgFZwfoff4Qcb9QkHo8wZLj9vYWTAoJ0VyvVwUTwi4D5lHvFDe/ |
||||
IX2N4pJv5AB3+xValyg+z6ShGKmWJuLhCYtcYFxdr8tZ45RlHYzv0V0CgYEAwTP1 |
||||
F3dURItjPVQ7BSHXmPoSTSuhAjbQp+jWOIEa+wnM3K3OncfbICFqSwFsz1cjKDjz |
||||
fAMXw9is7s/T8CEm6u4DFKbZ2qlAcvq02oqZu1/6UZXxTXFdjfQaKpSQ4ZWMxVBE |
||||
nKIs/e/416zCH6zd1Xauus92xI+zse5iSn++JX8CgYBGu/ewS+kdGJ28VnGZZwoQ |
||||
QEnBlXOIea1uiHzyAnQyB2PclOw4FeqDNXpcl2ShL4EtlMZgTb0t6J6Ml4PY1HCu |
||||
sUlmcEIjyn9EGxBrtqsx7vn6uDSmXowg1hxRujxPntvZXCM2IJ6hHERBay+7Zveh |
||||
PZx6TPykdEhc66a2zhkVAQKBgAOwHTaUdYxVaNCL4hCIA9iMtXq5oXosV7FM1YIA |
||||
nOY72qg/vRjv7rPfT2sdHNmcXTRwWd19JZ/8a9inKPGFgHutjWuAf9oXrv5C4N7n |
||||
FGYqP9n81b1Xs6R5C2LSsS1NMIG3tYeT5O33/bUIPDBkmVtwx4cTXL4FzDVSSpgH |
||||
dja7AoGAMAXuTIrq1+L6sMQYgwx/9loN4KkdYAP7ZDlX+2uROzk2u/aCw9dGIJMs |
||||
R5JSS5+5oG2MRNTAnz/35qge5M9ucRdiNKdxO4jLK9e009m+wl4AxVFFRz0Bz8Nf |
||||
QYlzA2d5S3I1EJSUNjjDkEq9szaVeRmVKt40n3X/JKjTggX6Ibg= |
||||
-----END RSA PRIVATE KEY----- |
||||
@ -0,0 +1 @@ |
||||
{"virtualbox":{"/opt/app":{"guestpath":"/opt/app","hostpath":"/home/sam/projects/Rocket.Chat/Rocket.Chat","disabled":false},"/host-dot-sandstorm":{"guestpath":"/host-dot-sandstorm","hostpath":"/home/sam/.sandstorm","disabled":false},"/vagrant":{"guestpath":"/vagrant","hostpath":"/home/sam/projects/Rocket.Chat/Rocket.Chat","disabled":false}}} |
||||
@ -0,0 +1,83 @@ |
||||
# -*- mode: ruby -*- |
||||
# vi: set ft=ruby : |
||||
|
||||
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! |
||||
VAGRANTFILE_API_VERSION = "2" |
||||
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
||||
# We base ourselves off Debian Jessie |
||||
config.vm.box = "debian/jessie64" |
||||
|
||||
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 6080, the Sandstorm web port, so that developers can |
||||
# visit their sandstorm app from their browser as local.sandstorm.io:6080 |
||||
# (aka 127.0.0.1:6080). |
||||
config.vm.network :forwarded_port, guest: 6080, host: 6080 |
||||
|
||||
# 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" |
||||
# Then, do stack-specific and app-specific setup. |
||||
config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/setup.sh" |
||||
|
||||
# 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 |
||||
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? |
||||
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 |
||||
|
||||
override.vm.synced_folder "..", "/opt/app" |
||||
override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm" |
||||
override.vm.synced_folder "..", "/vagrant" |
||||
end |
||||
config.vm.provider :libvirt do |libvirt, override| |
||||
libvirt.cpus = cpus |
||||
libvirt.memory = assign_ram_mb |
||||
libvirt.random_hostname = true |
||||
|
||||
override.vm.synced_folder "..", "/opt/app", type: "9p", accessmode: "passthrough" |
||||
override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm", type: "9p", accessmode: "passthrough" |
||||
override.vm.synced_folder "..", "/vagrant", type: "9p", accessmode: "passthrough" |
||||
end |
||||
end |
||||
@ -0,0 +1,15 @@ |
||||
#!/bin/bash |
||||
set -euo pipefail |
||||
|
||||
# Make meteor bundle |
||||
|
||||
METEOR_WAREHOUSE_DIR="${METEOR_WAREHOUSE_DIR:-$HOME/.meteor}" |
||||
METEOR_DEV_BUNDLE=$(dirname $(readlink -f "$METEOR_WAREHOUSE_DIR/meteor"))/dev_bundle |
||||
|
||||
cd /opt/app |
||||
meteor build --directory /home/vagrant/ |
||||
(cd /home/vagrant/bundle/programs/server && "$METEOR_DEV_BUNDLE/bin/npm" install) |
||||
|
||||
# Copy our launcher script into the bundle so the grain can start up. |
||||
mkdir -p /home/vagrant/bundle/opt/app/.sandstorm/ |
||||
cp /opt/app/.sandstorm/launcher.sh /home/vagrant/bundle/opt/app/.sandstorm/ |
||||
@ -0,0 +1,30 @@ |
||||
#!/bin/bash |
||||
set -euo pipefail |
||||
echo localhost > /etc/hostname |
||||
hostname localhost |
||||
curl https://install.sandstorm.io/ > /host-dot-sandstorm/caches/install.sh |
||||
SANDSTORM_CURRENT_VERSION=$(curl -fs "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 |
||||
curl --output "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" "https://dl.sandstorm.io/$SANDSTORM_PACKAGE" |
||||
fi |
||||
bash /host-dot-sandstorm/caches/install.sh -d -e "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" |
||||
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 |
||||
# TODO: update sandstorm installer script to ask about dev accounts, and |
||||
# specify a value for this option in the default config? |
||||
if ! grep --quiet --no-messages ALLOW_DEV_ACCOUNTS=true /opt/sandstorm/sandstorm.conf ; then |
||||
echo "ALLOW_DEV_ACCOUNTS=true" | sudo tee -a /opt/sandstorm/sandstorm.conf |
||||
sudo service sandstorm restart |
||||
fi |
||||
# 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 |
||||
@ -0,0 +1,16 @@ |
||||
#!/bin/bash |
||||
set -euo pipefail |
||||
|
||||
echo '** Starting mongo...' |
||||
/bin/niscud \ |
||||
--fork --port 4002 --dbpath /var --noauth --bind_ip 127.0.0.1 \ |
||||
--nohttpinterface --noprealloc --logpath /var/mongo.log & |
||||
|
||||
# TODO: wait for niscu to be up |
||||
echo '** Starting Meteor...' |
||||
|
||||
export MONGO_URL="mongodb://127.0.0.1:4002/meteor"; |
||||
export ROOT_URL="http://127.0.0.1:8000"; |
||||
export PORT="8000"; |
||||
|
||||
node /main.js |
||||
@ -0,0 +1,66 @@ |
||||
@0xdb0b8a1059adf258; |
||||
|
||||
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 = "1yqjjc9yru8e577pm95peu7t32ccf1xf0mepkvxj9ezch9amj82h", |
||||
# 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 = "Rocket.Chat"), |
||||
|
||||
appVersion = 0, # Increment this for every release. |
||||
|
||||
appMarketingVersion = (defaultText = "0.6"), |
||||
# 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. |
||||
( title = (defaultText = "New Rocket.Chat"), |
||||
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. |
||||
), |
||||
|
||||
sourceMap = ( |
||||
# The following directories will be copied into your package. |
||||
searchPath = [ |
||||
( sourcePath = "/home/vagrant/bundle" ), |
||||
( sourcePath = "/opt/meteor-spk/meteor-spk.deps" ) |
||||
] |
||||
), |
||||
|
||||
alwaysInclude = [ "." ] |
||||
# This says that we always want to include all files from the source map. |
||||
# (An alternative is to automatically detect dependencies by watching what |
||||
# the app opens while running in dev mode. To see what that looks like, |
||||
# run `spk init` without the -A option.) |
||||
); |
||||
|
||||
const myCommand :Spk.Manifest.Command = ( |
||||
# Here we define the command used to start up your server. |
||||
argv = ["/sandstorm-http-bridge", "8000", "--", "/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") |
||||
] |
||||
); |
||||
@ -0,0 +1,47 @@ |
||||
#!/bin/bash |
||||
set -euo pipefail |
||||
|
||||
cd /opt/ |
||||
|
||||
PACKAGE=meteor-spk-0.1.4 |
||||
PACKAGE_FILENAME="$PACKAGE.tar.xz" |
||||
CACHE_TARGET="/host-dot-sandstorm/caches/${PACKAGE_FILENAME}" |
||||
|
||||
# Fetch meteor-spk tarball if not cached |
||||
if [ ! -f "$CACHE_TARGET" ] ; then |
||||
curl https://dl.sandstorm.io/${PACKAGE_FILENAME} > "$CACHE_TARGET" |
||||
fi |
||||
|
||||
# Extract to /opt |
||||
tar xf "$CACHE_TARGET" |
||||
|
||||
# Create symlink so we can rely on the path /opt/meteor-spk |
||||
ln -s "${PACKAGE}" meteor-spk |
||||
|
||||
# Add bash, and its dependencies, so they get mapped into the image. |
||||
# Bash runs the launcher script. |
||||
cp -a /bin/bash /opt/meteor-spk/meteor-spk.deps/bin/ |
||||
cp -a /lib/x86_64-linux-gnu/libncurses.so.* /opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/ |
||||
cp -a /lib/x86_64-linux-gnu/libtinfo.so.* /opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/ |
||||
|
||||
# Unfortunately, Meteor does not explicitly make it easy to cache packages, but |
||||
# we know experimentally that the package is mostly directly extractable to a |
||||
# user's $HOME/.meteor directory. |
||||
METEOR_RELEASE=1.1.0.2 |
||||
METEOR_PLATFORM=os.linux.x86_64 |
||||
METEOR_TARBALL_FILENAME="meteor-bootstrap-${METEOR_PLATFORM}.tar.gz" |
||||
METEOR_TARBALL_URL="https://d3sqy0vbqsdhku.cloudfront.net/packages-bootstrap/${METEOR_RELEASE}/${METEOR_TARBALL_FILENAME}" |
||||
METEOR_CACHE_TARGET="/host-dot-sandstorm/caches/${METEOR_TARBALL_FILENAME}" |
||||
|
||||
# Fetch meteor tarball if not cached |
||||
if [ ! -f "$METEOR_CACHE_TARGET" ] ; then |
||||
curl "$METEOR_TARBALL_URL" > "${METEOR_CACHE_TARGET}.partial" |
||||
mv "${METEOR_CACHE_TARGET}"{.partial,} |
||||
fi |
||||
|
||||
# Extract as unprivileged user, which is the usual meteor setup |
||||
cd /home/vagrant/ |
||||
su -c "tar xf '${METEOR_CACHE_TARGET}'" vagrant |
||||
# Link into global PATH |
||||
ln -s /home/vagrant/.meteor/meteor /usr/bin/meteor |
||||
|
||||
@ -0,0 +1 @@ |
||||
meteor |
||||
@ -0,0 +1,7 @@ |
||||
<template name="sandstormshare"> |
||||
<section class="full-page"> |
||||
<div class="wrapper"> |
||||
|
||||
</div> |
||||
</section> |
||||
</template> |
||||
@ -1,3 +1,4 @@ |
||||
Template.oembedImageWidget.helpers |
||||
showImage: -> |
||||
return @downloadImages is true or not Meteor.Device.isPhone() |
||||
return true |
||||
# @downloadImages is true or not Meteor.Device.isPhone() |
||||
Loading…
Reference in new issue