forked from publiclab/plots2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes publiclab#11369: Added store button to link store and wiki pages
- Loading branch information
1 parent
9411c29
commit 74077fc
Showing
10 changed files
with
290 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | ||
load Gem.bin_path('bundler', 'bundle') | ||
#!/usr/bin/env ruby | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | ||
load Gem.bin_path('bundler', 'bundle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
APP_PATH = File.expand_path('../../config/application', __FILE__) | ||
require_relative '../config/boot' | ||
require 'rails/commands' | ||
#!/usr/bin/env ruby | ||
APP_PATH = File.expand_path('../../config/application', __FILE__) | ||
require_relative '../config/boot' | ||
require 'rails/commands' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
require_relative '../config/boot' | ||
require 'rake' | ||
Rake.application.run | ||
#!/usr/bin/env ruby | ||
require_relative '../config/boot' | ||
require 'rake' | ||
Rake.application.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
#!/usr/bin/env ruby | ||
require 'pathname' | ||
require 'fileutils' | ||
include FileUtils | ||
|
||
# path to your application root. | ||
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) | ||
|
||
def system!(*args) | ||
system(*args) || abort("\n== Command #{args} failed ==") | ||
end | ||
|
||
chdir APP_ROOT do | ||
# This script is a starting point to setup your application. | ||
# Add necessary setup steps to this file. | ||
|
||
puts '== Installing dependencies ==' | ||
system! 'gem install bundler --conservative' | ||
system('bundle check') || system!('bundle install --without production mysql') | ||
|
||
|
||
puts "\n== Copying sample files ==" | ||
unless File.exist?('db/schema.rb') | ||
cp 'db/schema.rb.example', 'db/schema.rb' | ||
end | ||
|
||
unless File.exist?('config/database.yml') | ||
cp 'config/database.yml.sqlite.example', 'config/database.yml' | ||
end | ||
|
||
|
||
puts "\n== Preparing database ==" | ||
system! 'rake db:setup' | ||
|
||
|
||
puts "\n== Installing static assets ==" | ||
system! 'bower install' | ||
|
||
puts "\n== Removing old logs and tempfiles ==" | ||
system! 'rake log:clear tmp:clear' | ||
|
||
puts "\n== Restarting application server ==" | ||
system! 'passenger start' | ||
end | ||
#!/usr/bin/env ruby | ||
require 'pathname' | ||
require 'fileutils' | ||
include FileUtils | ||
|
||
# path to your application root. | ||
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) | ||
|
||
def system!(*args) | ||
system(*args) || abort("\n== Command #{args} failed ==") | ||
end | ||
|
||
chdir APP_ROOT do | ||
# This script is a starting point to setup your application. | ||
# Add necessary setup steps to this file. | ||
|
||
puts '== Installing dependencies ==' | ||
system! 'gem install bundler --conservative' | ||
system('bundle check') || system!('bundle install --without production mysql') | ||
|
||
|
||
puts "\n== Copying sample files ==" | ||
unless File.exist?('db/schema.rb') | ||
cp 'db/schema.rb.example', 'db/schema.rb' | ||
end | ||
|
||
unless File.exist?('config/database.yml') | ||
cp 'config/database.yml.sqlite.example', 'config/database.yml' | ||
end | ||
|
||
|
||
puts "\n== Preparing database ==" | ||
system! 'rake db:setup' | ||
|
||
|
||
puts "\n== Installing static assets ==" | ||
system! 'bower install' | ||
|
||
puts "\n== Removing old logs and tempfiles ==" | ||
system! 'rake log:clear tmp:clear' | ||
|
||
puts "\n== Restarting application server ==" | ||
system! 'passenger start' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
#!/usr/bin/env ruby | ||
|
||
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" | ||
ENV["NODE_ENV"] ||= "development" | ||
|
||
require "pathname" | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
require "bundler/setup" | ||
|
||
require "webpacker" | ||
require "webpacker/webpack_runner" | ||
|
||
APP_ROOT = File.expand_path("..", __dir__) | ||
Dir.chdir(APP_ROOT) do | ||
Webpacker::WebpackRunner.run(ARGV) | ||
end | ||
#!/usr/bin/env ruby | ||
|
||
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" | ||
ENV["NODE_ENV"] ||= "development" | ||
|
||
require "pathname" | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
require "bundler/setup" | ||
|
||
require "webpacker" | ||
require "webpacker/webpack_runner" | ||
|
||
APP_ROOT = File.expand_path("..", __dir__) | ||
Dir.chdir(APP_ROOT) do | ||
Webpacker::WebpackRunner.run(ARGV) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
#!/usr/bin/env ruby | ||
|
||
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" | ||
ENV["NODE_ENV"] ||= "development" | ||
|
||
require "pathname" | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
require "bundler/setup" | ||
|
||
require "webpacker" | ||
require "webpacker/dev_server_runner" | ||
|
||
APP_ROOT = File.expand_path("..", __dir__) | ||
Dir.chdir(APP_ROOT) do | ||
Webpacker::DevServerRunner.run(ARGV) | ||
end | ||
#!/usr/bin/env ruby | ||
|
||
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" | ||
ENV["NODE_ENV"] ||= "development" | ||
|
||
require "pathname" | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
require "bundler/setup" | ||
|
||
require "webpacker" | ||
require "webpacker/dev_server_runner" | ||
|
||
APP_ROOT = File.expand_path("..", __dir__) | ||
Dir.chdir(APP_ROOT) do | ||
Webpacker::DevServerRunner.run(ARGV) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
#!/usr/bin/env ruby | ||
require "rubygems" | ||
require "bundler/setup" | ||
require "mailman" | ||
|
||
Mailman.config.logger = Logger.new("log/mailman.log") | ||
|
||
Mailman.config.ignore_stdin = true #ignore input from STDIN | ||
|
||
Mailman.config.poll_interval = 20 # To poll for mails in every 5 seconds | ||
|
||
|
||
# Email Configration for mailman | ||
Mailman.config.pop3 = { | ||
server: ENV['SERVER_ADDRESS'], # example pop.example.com | ||
port: 995, | ||
ssl: true, | ||
username: ENV['USERNAME'], | ||
password: ENV['EMAIL_PASSWORD'] | ||
} | ||
|
||
Mailman::Application.run do | ||
# routes are written here | ||
# route for mail having node with id in their subject will only be accepted for processing | ||
default do | ||
# REMOVING ENTIRE 'begin/rescue' loop to try to address mailmain issues | ||
# begin | ||
# retries ||= 0 | ||
# do something with the database that does not fetch mails yet (let's try to ensure we have a MySQL connection first) | ||
puts Comment.last.inspect | ||
Mailman.logger.info "Mail received from #{message.from.first}: '#{message.subject}' - '#{message&.html_part}'" | ||
if message.subject == "Incoming mail parsing test" | ||
Mailman.logger.info "Received incoming mail parsing test from #{message.from.first} at #{Time.now.to_s}" | ||
end | ||
last_comment = Comment.last | ||
comment_node_id = Comment.new_comment_from_email(message) | ||
if Comment.last.id != last_comment.id | ||
Mailman.logger.info "Comment created from #{message.from.first}: '#{message.subject}' - https://publiclab.org/n/#{comment_node_id}" | ||
end | ||
# rescue Exception => e | ||
# Mailman.logger.error "Exception occurred while receiving message:\n#{message}" | ||
# Mailman.logger.error [e, *e.backtrace].join("\n") | ||
# Seeing major site slowdowns; commenting out for now; | ||
# https://github.com/publiclab/plots2/issues/5817 | ||
# retry if (retries += 1) < 3 | ||
# end | ||
end | ||
|
||
end | ||
#!/usr/bin/env ruby | ||
require "rubygems" | ||
require "bundler/setup" | ||
require "mailman" | ||
|
||
Mailman.config.logger = Logger.new("log/mailman.log") | ||
|
||
Mailman.config.ignore_stdin = true #ignore input from STDIN | ||
|
||
Mailman.config.poll_interval = 20 # To poll for mails in every 5 seconds | ||
|
||
|
||
# Email Configration for mailman | ||
Mailman.config.pop3 = { | ||
server: ENV['SERVER_ADDRESS'], # example pop.example.com | ||
port: 995, | ||
ssl: true, | ||
username: ENV['USERNAME'], | ||
password: ENV['EMAIL_PASSWORD'] | ||
} | ||
|
||
Mailman::Application.run do | ||
# routes are written here | ||
# route for mail having node with id in their subject will only be accepted for processing | ||
default do | ||
# REMOVING ENTIRE 'begin/rescue' loop to try to address mailmain issues | ||
# begin | ||
# retries ||= 0 | ||
# do something with the database that does not fetch mails yet (let's try to ensure we have a MySQL connection first) | ||
puts Comment.last.inspect | ||
Mailman.logger.info "Mail received from #{message.from.first}: '#{message.subject}' - '#{message&.html_part}'" | ||
if message.subject == "Incoming mail parsing test" | ||
Mailman.logger.info "Received incoming mail parsing test from #{message.from.first} at #{Time.now.to_s}" | ||
end | ||
last_comment = Comment.last | ||
comment_node_id = Comment.new_comment_from_email(message) | ||
if Comment.last.id != last_comment.id | ||
Mailman.logger.info "Comment created from #{message.from.first}: '#{message.subject}' - https://publiclab.org/n/#{comment_node_id}" | ||
end | ||
# rescue Exception => e | ||
# Mailman.logger.error "Exception occurred while receiving message:\n#{message}" | ||
# Mailman.logger.error [e, *e.backtrace].join("\n") | ||
# Seeing major site slowdowns; commenting out for now; | ||
# https://github.com/publiclab/plots2/issues/5817 | ||
# retry if (retries += 1) < 3 | ||
# end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env ruby | ||
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | ||
|
||
APP_PATH = File.expand_path('../../config/application', __FILE__) | ||
require File.expand_path('../../config/boot', __FILE__) | ||
require 'rails/commands' | ||
#!/usr/bin/env ruby | ||
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | ||
|
||
APP_PATH = File.expand_path('../../config/application', __FILE__) | ||
require File.expand_path('../../config/boot', __FILE__) | ||
require 'rails/commands' |
Oops, something went wrong.