initial sandstorm port

pull/923/head
westmakaha 10 years ago
parent fe81ae593e
commit 64979308ac
  1. 8
      .meteor/packages
  2. 2
      .meteor/platforms
  3. 4
      .meteor/versions
  4. 1
      .sandstorm/.vagrant/machines/default/virtualbox/action_provision
  5. 1
      .sandstorm/.vagrant/machines/default/virtualbox/action_set_name
  6. 1
      .sandstorm/.vagrant/machines/default/virtualbox/creator_uid
  7. 1
      .sandstorm/.vagrant/machines/default/virtualbox/id
  8. 1
      .sandstorm/.vagrant/machines/default/virtualbox/index_uuid
  9. 27
      .sandstorm/.vagrant/machines/default/virtualbox/private_key
  10. 1
      .sandstorm/.vagrant/machines/default/virtualbox/synced_folders
  11. 83
      .sandstorm/Vagrantfile
  12. 15
      .sandstorm/build.sh
  13. 30
      .sandstorm/global-setup.sh
  14. 16
      .sandstorm/launcher.sh
  15. 66
      .sandstorm/sandstorm-pkgdef.capnp
  16. 47
      .sandstorm/setup.sh
  17. 1
      .sandstorm/stack
  18. 3
      client/lib/avatar.coffee
  19. 3
      client/views/account/avatar/prompt.html
  20. 3
      client/views/app/sideNav/userStatus.html
  21. 12
      client/views/main.html
  22. 7
      client/views/username/sandstormshare.html
  23. 4
      packages/rocketchat-hubot/hubot.coffee
  24. 1
      packages/rocketchat-lib/settings/server/updateServices.coffee
  25. 3
      packages/rocketchat-oembed/client/oembedImageWidget.coffee
  26. 3
      server/configuration/accounts_meld.coffee
  27. 12
      server/lib/accounts.coffee
  28. 12
      server/startup/avatar.coffee
  29. 1
      server/startup/initialData.coffee

@ -34,10 +34,10 @@ rocketchat:markdown
rocketchat:me
#rocketchat:slashcommands-invite
rocketchat:mentions
rocketchat:oembed
rocketchat:webrtc
#rocketchat:external
#rocketchat:hubot
#rocketchat:oembed
rocketchat:webrtc-ib
#rocketchat:external
#rocketchat:irc
konecty:change-case
@ -82,3 +82,5 @@ monbro:mongodb-mapreduce-aggregation
rocketchat:custom-oauth
rocketchat:gitlab
rocketchat:statistics
kenton:accounts-sandstorm

@ -1,4 +1,2 @@
android
browser
ios
server

@ -46,6 +46,7 @@ jquery@1.11.3_2
json@1.0.3
kadira:blaze-layout@2.0.1
kadira:flow-router@2.4.0
kenton:accounts-sandstorm@0.1.4
kevohagan:sweetalert@1.0.0
konecty:autolinker@1.0.2
konecty:change-case@2.3.0
@ -114,9 +115,8 @@ rocketchat:logger@0.0.1
rocketchat:markdown@0.0.1
rocketchat:me@0.0.1
rocketchat:mentions@0.0.1
rocketchat:oembed@0.0.1
rocketchat:statistics@0.0.1
rocketchat:webrtc@0.0.1
rocketchat:webrtc-ib@0.0.1
routepolicy@1.0.5
service-configuration@1.0.4
session@1.1.0

@ -0,0 +1 @@
1.5:c17761bf-b2f4-49da-87b9-79a95da91252

@ -0,0 +1 @@
c17761bf-b2f4-49da-87b9-79a95da91252

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

@ -4,7 +4,8 @@
if not username?
return
return "#{Meteor.absoluteUrl()}avatar/#{username}.jpg?_dc=#{random}"
# return "#{Meteor.absoluteUrl()}avatar/#{username}.jpg?_dc=#{random}"
return "/avatar/#{username}.jpg?_dc=#{random}"
Blaze.registerHelper 'avatarUrlFromUsername', getAvatarUrlFromUsername

@ -58,7 +58,7 @@
{{/unless}}
</div>
</div>
<!-- disable for sandstorm
{{#if suggestions.ready}}
{{> avatarSuggestion suggestions.avatars.gravatar}}
{{> avatarSuggestion suggestions.avatars.facebook}}
@ -83,6 +83,7 @@
{{else}}
{{_ "Loading_suggestion"}}
{{/if}}
-->
</div>
</div>

@ -18,10 +18,13 @@
<a href="" data-status="busy" class="status busy"><span>{{_ "Busy" context="male"}}</span></a>
<a href="" data-status="offline" class="status offline"><span>{{_ "Invisible"}}</span></a>
<a href="" id="account" class='account-link'><i class="icon-sliders"></i><span>{{_ "My_Account"}}</span></a>
<!-- disable admin and logout for sandstorm
{{#if isAdmin}}
<a href="" id="admin" class='account-link'><i class="icon-wrench"></i><span>{{_ "Administration"}}</span></a>
{{/if}}
<a href="" id="logout"><i class="icon-logout"></i><span>{{_ "Logout"}}</span></a>
-->
</div>
</nav>
{{/with}}

@ -44,11 +44,18 @@
<template name="main">
{{#if subsReady}}
<!--
{{#unless logged}}
{{> loginLayout}}
{{else}}
-->
{{#unless hasUsername}}
{{> username}}
{{#if logged}}
{{> username}}
{{else}}
<!-- shared link cannot be disabled in sandstorm, so we show a blank page -->
{{> sandstormshare}}
{{/if}}
{{else}}
{{> spotlight}}
{{> mobileMessageMenu}}
@ -63,7 +70,10 @@
{{> sideNav }}
</div>
{{> audioNotification }}
{{/unless}}
<!--
{{/unless}}
-->
{{/if}}
</template>

@ -0,0 +1,7 @@
<template name="sandstormshare">
<section class="full-page">
<div class="wrapper">
</div>
</section>
</template>

@ -55,8 +55,8 @@ class RocketChatAdapter extends Hubot.Adapter
console.log 'ROCKETCHATADAPTER -> send'.blue
# console.log envelope, strings
sendHelper @robot, envelope, strings, (string) =>
console.log "send #{envelope.room}: #{string} (#{envelope.user.id})" if DEBUG
RocketChat.sendMessage RocketBot.user, { msg: string }, { _id: envelope.room }
# console.log "send #{envelope.room}: #{string} (#{envelope.user.id})" if DEBUG
RocketChat.sendMessage RocketBot.user, { msg: string }, { _id: envelope.room }
# Public: Raw method for sending emote data back to the chat source.
#

@ -10,6 +10,7 @@ updateServices = ->
serviceName = service._id.replace('Accounts_OAuth_', '')
if serviceName is 'Meteor'
serviceName = 'meteor-developer'

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

@ -1,6 +1,7 @@
orig_updateOrCreateUserFromExternalService = Accounts.updateOrCreateUserFromExternalService
Accounts.updateOrCreateUserFromExternalService = (serviceName, serviceData, options) ->
if serviceName not in ['facebook', 'github', 'google', 'meteor-developer', 'linkedin', 'twitter'] and serviceData._oAuthCustom isnt true
if serviceName not in ['facebook', 'github', 'gitlab', 'google', 'meteor-developer', 'linkedin', 'twitter', 'sandstorm'] and serviceData._oAuthCustom isnt true
return
if serviceName is 'meteor-developer'

@ -15,16 +15,18 @@ Accounts.emailTemplates.resetPassword.text = (user, url) ->
verifyEmailText user, url
Accounts.onCreateUser (options, user) ->
# console.log 'onCreateUser ->',JSON.stringify arguments, null, ' '
# console.log 'options ->',JSON.stringify options, null, ' '
# console.log 'user ->',JSON.stringify user, null, ' '
console.log 'onCreateUser ->',JSON.stringify arguments, null, ' '
console.log 'options ->',JSON.stringify options, null, ' '
console.log 'user ->',JSON.stringify user, null, ' '
user.status = 'offline'
user.active = not RocketChat.settings.get 'Accounts_ManuallyApproveNewUsers'
# disable admin for sandstorm
# when inserting first user, set admin: true
unless Meteor.users.findOne()
user.admin = true
# unless Meteor.users.findOne()
# user.admin = true
if not user?.name? or user.name is ''
if options.profile?.name?

@ -1,8 +1,11 @@
Meteor.startup ->
storeType = 'GridFS'
storeType = 'FileSystem'
# Sandstorm must store avatar in mongo
#if RocketChat.settings.get 'avatarStore_type'
# storeType = RocketChat.settings.get 'avatarStore_type'
if RocketChat.settings.get 'Accounts_AvatarStoreType'
storeType = RocketChat.settings.get 'Accounts_AvatarStoreType'
RocketChatStore = RocketChatFile[storeType]
@ -18,7 +21,7 @@ Meteor.startup ->
transformWrite = (file, readStream, writeStream) ->
RocketChatFile.gm(readStream, file.fileName).background('#ffffff').resize(width, height+'^>').gravity('Center').extent(width, height).stream('jpeg').pipe(writeStream)
path = "~/uploads"
path = "/var"
if RocketChat.settings.get('Accounts_AvatarStorePath')?.trim() isnt ''
path = RocketChat.settings.get 'Accounts_AvatarStorePath'
@ -29,6 +32,7 @@ Meteor.startup ->
transformWrite: transformWrite
WebApp.connectHandlers.use '/avatar/', (req, res, next) ->
console.log 'avatar called!'
this.params =
username: req.url.replace(/^\//, '').replace(/\?.*$/, '')

@ -16,6 +16,7 @@ Meteor.startup ->
name: 'general'
msgs: 0
if process.env.ADMIN_EMAIL? and process.env.ADMIN_PASS?
re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if re.test process.env.ADMIN_EMAIL

Loading…
Cancel
Save