faye docker updates for mac system and not the linux letsencrypt
This commit is contained in:
@@ -23,6 +23,7 @@ require 'faye'
|
|||||||
#require File.expand_path('../config/initializers/faye_token.rb', __FILE__)
|
#require File.expand_path('../config/initializers/faye_token.rb', __FILE__)
|
||||||
Process.setproctitle('mozo_faye') if Process.respond_to?(:setproctitle)
|
Process.setproctitle('mozo_faye') if Process.respond_to?(:setproctitle)
|
||||||
VALID_TOKENS = ['6be65f9b5e7d21b8ca8de4ccfad5ba24cf40d440b370af79']
|
VALID_TOKENS = ['6be65f9b5e7d21b8ca8de4ccfad5ba24cf40d440b370af79']
|
||||||
|
# Comment
|
||||||
class ServerAuth
|
class ServerAuth
|
||||||
def incoming(message, callback)
|
def incoming(message, callback)
|
||||||
if message['channel'] !~ %r{^/meta/}
|
if message['channel'] !~ %r{^/meta/}
|
||||||
|
|||||||
+13
-1
@@ -4,7 +4,8 @@
|
|||||||
# 1. ensure this script is run from the project's root, not the faye directory
|
# 1. ensure this script is run from the project's root, not the faye directory
|
||||||
pwd_dirname=$(basename $(pwd))
|
pwd_dirname=$(basename $(pwd))
|
||||||
script_dirname="faye"
|
script_dirname="faye"
|
||||||
certs_dir="/etc/letsencrypt/live/mozo.bar"
|
#1certs_dir="/etc/letsencrypt/live/mozo.bar"
|
||||||
|
certs_dir="/Users/bj/Library/Application Support/mkcert"
|
||||||
#certs_dir="/home/benjamin/mozo/mozo-user/ssl"
|
#certs_dir="/home/benjamin/mozo/mozo-user/ssl"
|
||||||
if [ "$pwd_dirname" == "$script_dirname" ]; then
|
if [ "$pwd_dirname" == "$script_dirname" ]; then
|
||||||
echo "PWD DIRNAME: "$pwd_dirname;
|
echo "PWD DIRNAME: "$pwd_dirname;
|
||||||
@@ -15,9 +16,20 @@ fi
|
|||||||
if [ -d "$certs_dir" ]; then
|
if [ -d "$certs_dir" ]; then
|
||||||
echo "Found certificates directory, copy it to local for inclusion in the docker build"
|
echo "Found certificates directory, copy it to local for inclusion in the docker build"
|
||||||
rm -rf $script_dirname/ssl
|
rm -rf $script_dirname/ssl
|
||||||
|
mkdir $script_dirname/ssl
|
||||||
# Note the -L option for copy is required, since the target are symbolic links and we want the real files
|
# Note the -L option for copy is required, since the target are symbolic links and we want the real files
|
||||||
|
if [ -f "$certs_dir/localhost-key.pem" ]; then
|
||||||
|
echo "Using localhost certificate copy https://medium.com/@matayoshi.mariano/how-to-add-ssl-to-your-localhost-with-puma-37a66a649f29"
|
||||||
|
cp "$certs_dir/localhost-key.pem" $script_dirname/ssl/privkey.pem
|
||||||
|
cp "$certs_dir/localhost.pem" $script_dirname/ssl/fullchain.pem
|
||||||
|
else
|
||||||
|
echo "Using letsencrypt folder copy"
|
||||||
|
# copy full directory, assuming letsencrypt
|
||||||
cp -rL $certs_dir $script_dirname/ssl
|
cp -rL $certs_dir $script_dirname/ssl
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "Certs dir not found at: $certs_dir"
|
||||||
|
fi
|
||||||
|
|
||||||
# 2. stop and remove all running/existing containers
|
# 2. stop and remove all running/existing containers
|
||||||
docker rm $(docker stop $(docker ps -a -q --filter ancestor=mozo_faye))
|
docker rm $(docker stop $(docker ps -a -q --filter ancestor=mozo_faye))
|
||||||
|
|||||||
Reference in New Issue
Block a user