diff --git a/Gemfile b/Gemfile index 7f8d251b3..0c963ad29 100644 --- a/Gemfile +++ b/Gemfile @@ -185,7 +185,7 @@ group :production do # we don"t install these on travis to speed up test runs # Process management - gem "eye", "0.10.0" + gem "foreman", "0.88.1", require: false # Redirects diff --git a/Gemfile.lock b/Gemfile.lock index 3e3a506bb..e74d323cd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,27 +116,6 @@ GEM image_processing (~> 1.1) marcel (~> 1.0.0) ssrf_filter (~> 1.0) - celluloid (0.17.4) - celluloid-essentials - celluloid-extras - celluloid-fsm - celluloid-pool - celluloid-supervision - timers (>= 4.1.1) - celluloid-essentials (0.20.5) - timers (>= 4.1.1) - celluloid-extras (0.20.5) - timers (>= 4.1.1) - celluloid-fsm (0.20.5) - timers (>= 4.1.1) - celluloid-io (0.17.3) - celluloid (>= 0.17.2) - nio4r (>= 1.1) - timers (>= 4.1.1) - celluloid-pool (0.20.5) - timers (>= 4.1.1) - celluloid-supervision (0.20.6) - timers (>= 4.1.1) chrome_remote (0.3.0) websocket-driver (~> 0.6) chunky_png (1.4.0) @@ -237,12 +216,6 @@ GEM ffi (>= 1.15.0) excon (0.110.0) execjs (2.9.1) - eye (0.10.0) - celluloid (~> 0.17.3) - celluloid-io (~> 0.17.0) - kostya-sigar (~> 2.0.0) - state_machines - thor fabrication (2.31.0) factory_bot (6.4.6) activesupport (>= 5.0.0) @@ -291,6 +264,7 @@ GEM fog-xml (0.1.4) fog-core nokogiri (>= 1.5.11, < 2.0.0) + foreman (0.88.1) formatador (1.1.0) fugit (1.11.0) et-orbi (~> 1, >= 1.2.11) @@ -380,7 +354,6 @@ GEM multi_json jwt (2.8.1) base64 - kostya-sigar (2.0.10) language_server-protocol (3.17.0.3) leaflet-rails (1.9.4) actionpack (>= 4.2.0) @@ -710,7 +683,6 @@ GEM activesupport (>= 5.2) sprockets (>= 3.0.0) ssrf_filter (1.1.2) - state_machines (0.6.0) string-direction (1.2.2) strscan (3.1.0) swd (2.0.3) @@ -732,7 +704,6 @@ GEM tilt (2.3.0) timecop (0.9.8) timeout (0.4.1) - timers (4.3.5) toml-rb (3.0.1) citrus (~> 3.0, > 3.0) racc (~> 1.7) @@ -820,7 +791,6 @@ DEPENDENCIES diaspora_federation-json_schema (= 1.1.0) diaspora_federation-rails (= 1.1.0) diaspora_federation-test (= 1.1.0) - eye (= 0.10.0) factory_bot_rails (= 6.4.3) faraday (= 2.9.0) faraday-cookie_jar (= 0.0.7) @@ -829,6 +799,7 @@ DEPENDENCIES faraday-typhoeus (= 1.1.0) fixture_builder (= 0.5.2) fog-aws (= 3.22.0) + foreman (= 0.88.1) fuubar (= 2.5.1) gon (= 6.4.0) haml_lint (= 0.58.0) diff --git a/bin/eye b/bin/foreman similarity index 75% rename from bin/eye rename to bin/foreman index 44948f38f..90b50e265 100755 --- a/bin/eye +++ b/bin/foreman @@ -4,7 +4,7 @@ # # This file was generated by Bundler. # -# The application 'eye' is installed as part of a gem, and +# The application 'foreman' is installed as part of a gem, and # this file is here to facilitate running it. # @@ -13,7 +13,7 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) bundle_binstub = File.expand_path("bundle", __dir__) if File.file?(bundle_binstub) - if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") load(bundle_binstub) else abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. @@ -24,4 +24,4 @@ end require "rubygems" require "bundler/setup" -load Gem.bin_path("eye", "eye") +load Gem.bin_path("foreman", "foreman") diff --git a/config/eye.rb b/config/eye.rb deleted file mode 100644 index 94ded11c5..000000000 --- a/config/eye.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -require_relative "load_config" -rails_env = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development" - -Eye.config do - logger Logger.new(STDOUT) -end - -Eye.application("diaspora") do - working_dir Rails.root.to_s - env "RAILS_ENV" => rails_env - stdout "log/eye_processes_stdout.log" unless rails_env == "development" - stderr "log/eye_processes_stderr.log" - - process :web do - web_command = "bin/puma -C config/puma.rb" - - start_command web_command - daemonize true - restart_command "kill -USR2 {PID}" - restart_grace 10.seconds - - pid_file AppConfig.server.pid.get - stop_signals [:TERM, 10.seconds] - - monitor_children do - stop_command "kill -QUIT {PID}" - end - end - - group :sidekiq do - AppConfig.server.sidekiq_workers.to_i.times do |i| - i += 1 - - process "sidekiq#{i}" do - start_command "bin/bundle exec sidekiq" - daemonize true - pid_file "tmp/pids/sidekiq#{i}.pid" - stop_signals [:USR1, 0, :TERM, 10.seconds, :KILL] - end - end - end -end diff --git a/script/diaspora-dev b/script/diaspora-dev index 65770048c..d8e49e271 100755 --- a/script/diaspora-dev +++ b/script/diaspora-dev @@ -27,9 +27,8 @@ print_usage() { print_usage_header "stop" ;; restart) - echo; echo "Restart diaspora* using bin/eye (fast restart)" - print_usage_header "restart [options]" \ - " --full Restart entire container" + echo; echo "Restart diaspora*" + print_usage_header "restart" ;; logs) echo; echo "Follow log output of the running diaspora* instance" @@ -148,7 +147,7 @@ print_usage_full() { echo " setup Prepare diaspora* to run for development" echo " start Start diaspora*" echo " stop Stop diaspora*" - echo " restart Restart of diaspora*" + echo " restart Restart diaspora*" echo " logs Follow log output of diaspora*" echo " status Show current instance status of diaspora*" echo " clean Reset diaspora* instance" @@ -412,22 +411,8 @@ dia_pronto() { } dia_restart() { - # Restart diaspora inside container if already running; start new container otherwise - for i in "$@"; do - case "$i" in - --full) - dia_restart_full=1 - ;; - esac - done if dia_is_running; then - if [ -z $dia_restart_full ]; then - dia_docker_compose exec \ - diaspora \ - bin/eye restart diaspora - else - dia_docker_compose restart - fi + dia_docker_compose restart else dia_start fi diff --git a/script/server b/script/server index aee6cf4f5..dde21207c 100755 --- a/script/server +++ b/script/server @@ -161,5 +161,5 @@ if [ -n "${ldconfig}" ]; then fi # Start Diaspora -printf "Starting Diaspora in $RAILS_ENV mode with $workers Sidekiq worker(s)." -exec bin/bundle exec loader_eye --stop_all -c config/eye.rb +echo "Starting Diaspora in $RAILS_ENV mode with $workers Sidekiq worker(s)." +exec bin/foreman start -c -m all=1,sidekiq=$workers