Darwin fixes

This commit is contained in:
Benjamin
2021-04-22 17:50:59 -05:00
parent 714ce8f8c6
commit d64772bdfc
4 changed files with 23 additions and 8 deletions
+12 -4
View File
@@ -11,12 +11,20 @@ require 'sprockets/railtie'
require 'net/http' # lib/qwaiter/broadcaster/faye.rb
# custom override hack for the couchbase-setting gem, needs to be loaded before other gems, is settings only without dependencies
require File.expand_path('./../../lib/couchbase-setting', __FILE__)
#require File.expand_path('./../../lib/couchbase-setting', __FILE__)
Bundler.require(*Rails.groups(assets: %w[development test user_app]))
Bundler.require(:assets) if ENV['DEPLOY'] == 'yes'
Bundler.require(*Rails.groups(assets: %w[ development test user_app ]))
Bundler.require(:assets) if ENV['DEPLOY']=='yes'
#NOTE: the JSON.create_id getter/setter has been moved to Thread.current implementation which
# leads to "json_class" fallbacks for created threads. Maybe this will be fixed for future
# rails versions. Current is: 6.1.3.1
# For now make the getter Thread universal, not safe
module JSON
def self.create_id
'ruby_class'
end
end
if Rails.env.development?
class CouchRest::Connection
alias_method :old_execute, :execute
+1 -1
View File
@@ -1,7 +1,7 @@
development:
validation_framework: :active_model #optional
#database: "http://mozo:secret@localhost:5984/qwaiter_development"
database: "http://admin:development@localhost:5984/mozo_development"
database: "http://admin:admin@localhost:5984/mozo_development"
#database: mozo_development
test:
validation_framework: :active_model #optional
+1
View File
@@ -36,6 +36,7 @@ COPY ./faye /usr/src/app
ENV FAYE_PORT=9296
EXPOSE $FAYE_PORT
#CMD thin start -R config.ru -p $FAYE_PORT
CMD thin start -R config.ru -p $FAYE_PORT --ssl --ssl-key-file=ssl/privkey.pem --ssl-cert-file=ssl/fullchain.pem
+9 -3
View File
@@ -4,6 +4,7 @@
# 1. ensure this script is run from the project's root, not the faye directory
pwd_dirname=$(basename $(pwd))
script_dirname="faye"
arch=$(uname)
#1certs_dir="/etc/letsencrypt/live/mozo.bar"
certs_dir="/Users/bj/Library/Application Support/mkcert"
#certs_dir="/home/benjamin/mozo/mozo-user/ssl"
@@ -18,8 +19,9 @@ if [ -d "$certs_dir" ]; then
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
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"
#if [ -f "$certs_dir/localhost-key.pem" ]; then
if [ $arch == "Darwin" ]; then
echo "Using Darwin 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
@@ -44,7 +46,11 @@ docker build -f faye/Dockerfile -t mozo_faye .
# docker run -t -i --rm mozo_faye bash
# 5. Spin up the counter container from the generated image
docker run --network=host --restart unless-stopped --detach --name=mozo_faye mozo_faye
if [ $arch == "Darwin" ]; then
docker run -p 9296:9296 --restart unless-stopped --detach --name=mozo_faye mozo_faye
else
docker run --network=host --restart unless-stopped --detach --name=mozo_faye mozo_faye
fi
# To just start the container created through al these steps without rebuilding them:
# docker container start $(docker ps -a -q --filter ancestor=mozo_faye)