Infrastructure and add removeListNeedsHelp to users

This commit is contained in:
2026-02-09 17:56:05 -05:00
parent be3ee9096b
commit 63b19cb78a
9 changed files with 43 additions and 19 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
source 'https://rubygems.org'
gem "couchrest"
gem "pry"
#gem "pry"
+10 -12
View File
@@ -1,27 +1,25 @@
GEM
remote: https://rubygems.org/
specs:
coderay (1.1.2)
couchrest (2.0.1)
httpclient (~> 2.8)
mime-types (>= 1.15)
multi_json (~> 1.7)
httpclient (2.8.3)
method_source (0.9.2)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.1009)
multi_json (1.14.1)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
httpclient (2.9.0)
mutex_m
logger (1.7.0)
mime-types (3.7.0)
logger
mime-types-data (~> 3.2025, >= 3.2025.0507)
mime-types-data (3.2026.0203)
multi_json (1.19.1)
mutex_m (0.3.0)
PLATFORMS
ruby
DEPENDENCIES
couchrest
pry
BUNDLED WITH
1.17.3
2.7.2
+2 -1
View File
@@ -65,12 +65,13 @@ class InMemoryQCounter
def reload_stats!
require 'yaml'
require 'couchrest'
require 'pry'
#require 'pry'
couch_settings_path = 'config/couchdb.yml'
puts "Couch settings path: #{couch_settings_path}"
puts "Environment: #{environment.inspect}"
#couch_settings = YAML.load_file(couch_settings_path)[environment]
couch_settings = YAML.safe_load(ERB.new(File.read(couch_settings_path)).result, permitted_classes: [Symbol])[environment]
puts "Couch-Settings: \n#{couch_settings.to_yaml}"
database = couch_settings['database']
#database = database.sub 'localhost', 'host.docker.internal' unless environment == 'development'
#database = couch_settings['database']
+13 -4
View File
@@ -6,10 +6,18 @@ pwd_dirname=$(basename $(pwd));
script_dirname="drb_counter";
arch=$(uname)
environment="${1:-production}"
if [ "$pwd_dirname" == "$script_dirname" ]; then
echo "PWD DIRNAME: "$pwd_dirname;
echo "You must run this script from the project's root dir (../) for the Dockerfile to have access to the configs to COPY";
exit 1;
# Check for sanity, was debugging database mismatch
if [ "$#" -lt 1 ]; then
nodename=$(uname -n)
known_development_machines=("fedorasahi" "blackview")
for item in "${known_development_machines[@]}"; do
if [[ "$item" == "$nodename" ]]; then
echo "Stupid Error: You are on a known development device: $nodename. As a developer, always explicitly supply the environment as the first argument" >&2
echo "Usage: ./drb_counter/rebuild-docker.sh development"
exit 1
fi
done
fi
# 2. stop and remove all running/existing containers
@@ -31,6 +39,7 @@ if [ $arch == "Darwin" ]; then
else
# docker run --network=host --env DRB_ENV=production --env COUCHDB_ADMIN_PASSWORD=$COUCHDB_ADMIN_PASSWORD --add-host=host.docker.internal:host-gateway --restart unless-stopped --detach --name=mozo_drb_counter mozo_drb_counter
docker run --network=host --env DRB_ENV=$environment --env COUCHDB_ADMIN_PASSWORD=$COUCHDB_ADMIN_PASSWORD --restart unless-stopped --detach --name=mozo_drb_counter mozo_drb_counter
#docker run -p 9022:9022 --env DRB_ENV=$environment --env COUCHDB_ADMIN_PASSWORD=$COUCHDB_ADMIN_PASSWORD --restart unless-stopped --detach --name=mozo_drb_counter mozo_drb_counter
fi
# To just start the container created through al these steps without rebuilding them: