diff --git a/.fabmanager-version b/.fabmanager-version index 30f69e8cc..a45141e5d 100644 --- a/.fabmanager-version +++ b/.fabmanager-version @@ -1 +1 @@ -2.5.9 +2.5.10-dev diff --git a/README.md b/README.md index 8bd19ad13..cbd6a1f8b 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ In you only intend to run fab-manager on your local machine for testing purposes ```bash rake db:create rake db:migrate - rake db:seed + ADMIN_EMAIL=youradminemail ADMIN_PASSWORD=youradminpassword rake db:seed ``` 9. Create the pids folder used by Sidekiq. If you want to use a different location, you can configure it in `config/sidekiq.yml` @@ -279,7 +279,7 @@ If this parameter is not specified the maximum size allowed will be 2MB. ADMIN_EMAIL, ADMIN_PASSWORD -Credentials for the first admin user created when seeding the project. +Credentials for the first admin user created when seeding the project. (not present in application.yml because they are only used once when running the database seed with the command `rake db:seed`) Settings related to Open Projects diff --git a/config/application.yml.default b/config/application.yml.default index ab2e0b224..fd3b8e8f4 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -27,9 +27,6 @@ SMTP_PASSWORD: GA_ID: '' ## -ADMIN_EMAIL: 'admin@fab-manager.com' -ADMIN_PASSWORD: 'adminadmin' - DISQUS_SHORTNAME: TWITTER_NAME: 'FablabGrenoble' diff --git a/config/secrets.yml b/config/secrets.yml index d7cfafe37..451419cad 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -42,8 +42,6 @@ development: facebook_app_id: <%= ENV["FACEBOOK_APP_ID"] %> elaticsearch_host: <%= ENV["ELASTICSEARCH_HOST"] %> max_image_size: <%= ENV["MAX_IMAGE_SIZE"] %> - admin_email: <%= ENV["ADMIN_EMAIL"] %> - admin_password: <%= ENV["ADMIN_PASSWORD"] %> test: secret_key_base: 83daf5e7b80d990f037407bab78dff9904aaf3c195a50f84fa8695a22287e707dfbd9524b403b1dcf116ae1d8c06844c3d7ed942564e5b46be6ae3ead93a9d30 @@ -77,8 +75,6 @@ test: facebook_app_id: <%= ENV["FACEBOOK_APP_ID"] %> elaticsearch_host: localhost max_image_size: <%= ENV["MAX_IMAGE_SIZE"] %> - admin_email: <%= ENV["ADMIN_EMAIL"] %> - admin_password: <%= ENV["ADMIN_PASSWORD"] %> staging: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> @@ -117,8 +113,6 @@ staging: facebook_app_id: <%= ENV["FACEBOOK_APP_ID"] %> elaticsearch_host: <%= ENV["ELASTICSEARCH_HOST"] %> max_image_size: <%= ENV["MAX_IMAGE_SIZE"] %> - admin_email: <%= ENV["ADMIN_EMAIL"] %> - admin_password: <%= ENV["ADMIN_PASSWORD"] %> # Do not keep production secrets in the repository, # instead read values from the environment. @@ -159,6 +153,4 @@ production: log_level: <%= ENV["LOG_LEVEL"] %> facebook_app_id: <%= ENV["FACEBOOK_APP_ID"] %> elaticsearch_host: <%= ENV["ELASTICSEARCH_HOST"] %> - max_image_size: <%= ENV["MAX_IMAGE_SIZE"] %> - admin_email: <%= ENV["ADMIN_EMAIL"] %> - admin_password: <%= ENV["ADMIN_PASSWORD"] %> + max_image_size: <%= ENV["MAX_IMAGE_SIZE"] %> \ No newline at end of file diff --git a/db/seeds.rb b/db/seeds.rb index e88938c09..011bd0609 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -84,7 +84,7 @@ end # Create the default admin if none exists yet if Role.where(name: 'admin').joins(:users).count === 0 - admin = User.new(username: 'admin', email: Rails.application.secrets.admin_email, password: Rails.application.secrets.admin_password, password_confirmation: Rails.application.secrets.admin_password, group_id: Group.first.id, profile_attributes: {first_name: 'admin', last_name: 'admin', gender: true, phone: '0123456789', birthday: Time.now}) + admin = User.new(username: 'admin', email: ENV["ADMIN_EMAIL"], password: ENV["ADMIN_PASSWORD"], password_confirmation: Rails.application.secrets.admin_password, group_id: Group.first.id, profile_attributes: {first_name: 'admin', last_name: 'admin', gender: true, phone: '0123456789', birthday: Time.now}) admin.add_role 'admin' admin.save! end diff --git a/docker/README.md b/docker/README.md index 0454ab43e..aa68af960 100644 --- a/docker/README.md +++ b/docker/README.md @@ -195,7 +195,7 @@ docker run --rm \ --link=fabmanager-postgres:postgres \ --link=fabmanager-redis:redis \ --link=fabmanager-elastic:elasticsearch \ - -e RAILS_ENV=production \ + -e RAILS_ENV=production ADMIN_EMAIL=youradminemail ADMIN_PASSWORD=youradminpassword \ --env-file /home/core/fabmanager/config/env \ -v /home/core/fabmanager/plugins:/usr/src/app/plugins \ sleede/fab-manager \