mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-14 18:56:49 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cae1655ec3 | ||
|
|
26702e6f0d | ||
|
|
7fc9a6bf93 | ||
|
|
781bf940f6 | ||
|
|
92382ca473 | ||
|
|
76a3e913df | ||
|
|
23ab6bb489 | ||
|
|
c799f15067 | ||
|
|
54f1047dcb | ||
|
|
c1e599deef | ||
|
|
476daf0d30 | ||
|
|
79a9dbcf68 | ||
|
|
61c7c26822 | ||
|
|
969dcae8d0 | ||
|
|
ce5a95ff4f | ||
|
|
0d5330d388 |
@@ -1 +1 @@
|
||||
3.2.9
|
||||
3.3.10
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM ruby:3.2.9-alpine3.19 AS base
|
||||
FROM ruby:3.3.10-alpine3.19 AS base
|
||||
ENV LANG=C.UTF-8 \
|
||||
LC_ALL=C.UTF-8 \
|
||||
TZ=Europe/London \
|
||||
@@ -31,4 +31,4 @@ FROM development-base
|
||||
COPY . $RAILS_ROOT
|
||||
COPY Gemfile Gemfile.lock ./
|
||||
RUN bundle install --jobs "$(nproc)"
|
||||
COPY --from=yarn-dependencies $RAILS_ROOT/node_modules ./node_modules
|
||||
COPY --from=yarn-dependencies $RAILS_ROOT/node_modules ./node_modules
|
||||
|
||||
2
Gemfile
2
Gemfile
@@ -49,7 +49,7 @@ gem 'acts_as_list', '1.0.4'
|
||||
gem 'cancancan', '~> 1.15.0'
|
||||
gem 'digest'
|
||||
gem 'ffaker'
|
||||
gem 'highline', '2.0.3' # Necessary for the install generator
|
||||
gem 'highline'
|
||||
gem 'json'
|
||||
gem 'monetize', '~> 1.11'
|
||||
gem 'paranoia', '~> 2.4'
|
||||
|
||||
@@ -389,7 +389,8 @@ GEM
|
||||
hashdiff (1.2.1)
|
||||
hashery (2.1.2)
|
||||
hashie (5.0.0)
|
||||
highline (2.0.3)
|
||||
highline (3.1.2)
|
||||
reline
|
||||
htmlentities (4.4.2)
|
||||
http_parser.rb (0.8.0)
|
||||
i18n (1.14.7)
|
||||
@@ -1018,7 +1019,7 @@ DEPENDENCIES
|
||||
good_migrations
|
||||
haml
|
||||
haml_lint
|
||||
highline (= 2.0.3)
|
||||
highline
|
||||
i18n
|
||||
i18n-js (~> 3.9.0)
|
||||
i18n-tasks
|
||||
@@ -1113,7 +1114,7 @@ DEPENDENCIES
|
||||
wkhtmltopdf-binary
|
||||
|
||||
RUBY VERSION
|
||||
ruby 3.2.9p265
|
||||
ruby 3.3.10p183
|
||||
|
||||
BUNDLED WITH
|
||||
2.4.19
|
||||
2.5.22
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
angular.module('Darkswarm').controller "TmpCtrl", ($scope)->
|
||||
$scope.test = {foo: "bar"}
|
||||
@@ -1,57 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'highline/import'
|
||||
|
||||
# see last line where we create an admin if there is none, asking for email and password
|
||||
def prompt_for_admin_password
|
||||
if ENV['ADMIN_PASSWORD']
|
||||
password = ENV['ADMIN_PASSWORD'].dup
|
||||
say "Admin Password #{password}"
|
||||
else
|
||||
password = ask('Password [ofn123]: ') do |q|
|
||||
q.echo = false
|
||||
q.validate = /^(|.{5,40})$/
|
||||
q.responses[:not_valid] = 'Invalid password. Must be at least 5 characters long.'
|
||||
q.whitespace = :strip
|
||||
end
|
||||
password = 'ofn123' if password.blank?
|
||||
end
|
||||
|
||||
password
|
||||
end
|
||||
|
||||
def prompt_for_admin_email
|
||||
if ENV['ADMIN_EMAIL']
|
||||
email = ENV['ADMIN_EMAIL'].dup
|
||||
say "Admin User #{email}"
|
||||
else
|
||||
email = ask('Email [ofn@example.com]: ') do |q|
|
||||
q.echo = true
|
||||
q.whitespace = :strip
|
||||
end
|
||||
email = 'ofn@example.com' if email.blank?
|
||||
end
|
||||
|
||||
email
|
||||
end
|
||||
|
||||
def create_admin_user
|
||||
attributes = read_user_attributes
|
||||
|
||||
load 'spree/user.rb'
|
||||
|
||||
if Spree::User.find_by(email: attributes[:email])
|
||||
say <<~TEXT
|
||||
|
||||
WARNING: There is already a user with the email: #{email},
|
||||
so no account changes were made. If you wish to create an additional admin
|
||||
user, please run rake spree_auth:admin:create again with a different email.
|
||||
|
||||
TEXT
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
admin = Spree::User.new(attributes)
|
||||
admin.skip_confirmation!
|
||||
admin.skip_confirmation_notification!
|
||||
@@ -60,24 +11,22 @@ def create_admin_user
|
||||
ValidEmail2::Address.define_method(:valid_mx?) { true }
|
||||
|
||||
if admin.save
|
||||
say "New admin user persisted!"
|
||||
printf <<~TEXT
|
||||
New admin user persisted!
|
||||
Username: #{admin.email}
|
||||
Password: #{admin.password}
|
||||
TEXT
|
||||
else
|
||||
say "There was some problems with persisting new admin user:"
|
||||
printf "There was some problems with persisting new admin user:\n"
|
||||
admin.errors.full_messages.each do |error|
|
||||
say error
|
||||
printf "#{error}\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def read_user_attributes
|
||||
if ENV.fetch("AUTO_ACCEPT", true)
|
||||
password = ENV.fetch("ADMIN_PASSWORD", "ofn123")
|
||||
email = ENV.fetch("ADMIN_EMAIL", "ofn@example.com")
|
||||
else
|
||||
say 'Create the admin user (press enter for defaults).'
|
||||
email = prompt_for_admin_email
|
||||
password = prompt_for_admin_password
|
||||
end
|
||||
password = ENV.fetch("ADMIN_PASSWORD", "ofn123")
|
||||
email = ENV.fetch("ADMIN_EMAIL", "ofn@example.com")
|
||||
|
||||
{
|
||||
admin: true,
|
||||
@@ -88,4 +37,4 @@ def read_user_attributes
|
||||
}
|
||||
end
|
||||
|
||||
create_admin_user if Spree::User.admin.empty?
|
||||
create_admin_user if Spree::User.none?
|
||||
|
||||
@@ -10,6 +10,12 @@ set -e
|
||||
|
||||
if ! command -v nodenv > /dev/null; then
|
||||
printf "Please install https://github.com/nodenv/nodenv.\n"
|
||||
printf '```'"\n"
|
||||
printf "git clone https://github.com/nodenv/nodenv.git ~/.nodenv\n"
|
||||
printf "git clone https://github.com/nodenv/node-build.git ~/.nodenv/plugins/node-build\n"
|
||||
printf "nodenv init\n"
|
||||
printf 'eval "$(nodenv init -)"'"\n"
|
||||
printf '```'"\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -24,7 +24,13 @@ if rbenv install --skip-existing; then
|
||||
echo "Ruby is installed."
|
||||
else
|
||||
echo "Upgrading rbenv's ruby-build:"
|
||||
git -C "$(rbenv root)"/plugins/ruby-build pull
|
||||
# If installed with homebrew, use that to update
|
||||
if (command -v brew && brew list --versions ruby-build); then
|
||||
brew update && brew upgrade ruby-build
|
||||
else
|
||||
# Update with git
|
||||
git -C "$(rbenv root)"/plugins/ruby-build pull
|
||||
fi
|
||||
|
||||
rbenv install
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user