cd /root && git clone https://github.com/internetee/auction_center.git
cd /root/auction_center && bin/setup
rbenv: version `3.0.2' is not installed (set by /root/auction_center/.ruby-version)
既然已经安装 rbenv 3.0.5 ，直接在 .ruby-version 中修改版本号即可。
== Installing dependencies == https://github.com/internetee/directo.git (at master@711ce2d) is not yet checked out. Run `bundle install` first. Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
installing your bundle as root will break this application for all non-root users on this machine. ... Bundle complete! 47 Gemfile dependencies, 145 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. 1 installed gem you directly depend on is looking for funding. Run `bundle fund` for details
Yarn executable was not detected in the system. Download Yarn at https://yarnpkg.com/en/docs/install
那就安装 yarn ：
sudo apt install yarn
00h00m00s 0/0: : ERROR: There are no scenarios; must have at least one.
sudo apt remove cmdtest sudo apt remove yarn curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt update sudo apt install yarn
error email@example.com: The engine "node" is incompatible with this module. Expected version ">=14.16". Got "12.22.9" error Found incompatible module.
NodeJS版本要求高于 14.16 。
warning " > firstname.lastname@example.org" has incorrect peer dependency "webpack@^4.0.0".
npm install -g yarn
== Preparing database == /root/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bootsnap-1.8.1/lib/bootsnap/compile_cache/iseq.rb:13:in `to_binary': wrong argument type false (expected Symbol) (TypeError) ... from bin/rails:4:in `<main>' == Command ["bin/rails db:prepare"] failed ==
bundle update bootsnap
== Preparing database == rails aborted! ActiveRecord::ConnectionNotEstablished: connection to server at "localhost" (127.0.0.1), port 5432 failed: fe_sendauth: no password supplied Caused by: PG::ConnectionBad: connection to server at "localhost" (127.0.0.1), port 5432 failed: fe_sendauth: no password supplied Tasks: TOP => db:prepare (See full trace by running task with --trace) == Command ["bin/rails db:prepare"] failed ==
connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "pguser"
== 20181029121254 AddSettingsRelatedToCurrencyAndPrice: migrating ============= rails aborted! StandardError: An error has occurred, this and all later migrations canceled: undefined method `value_format' for #<Setting id: nil, code: "auction_currency", description: "Currency in which all invoices and offers are to b...", value: "EUR", created_at: nil, updated_at: nil> Did you mean? values_at /root/auction_center/db/migrate/20181029121254_add_settings_related_to_currency_and_price.rb:11:in `up' Caused by: NoMethodError: undefined method `value_format' for #<Setting id: nil, code: "auction_currency", description: "Currency in which all invoices and offers are to b...", value: "EUR", created_at: nil, updated_at: nil> Did you mean? values_at /root/auction_center/db/migrate/20181029121254_add_settings_related_to_currency_and_price.rb:11:in `up' Tasks: TOP => db:prepare (See full trace by running task with --trace) == Command ["bin/rails db:prepare"] failed ==
关键信息：NoMethodError: undefined method `value_format’
Software for managing TLD domain auctions
Configure database in config/database.yml according to your needs
Adjust configuration variables in config/customization.yml.
Run bundle exec rake db:setup
Default user account
By default, the application creates an administrator user account that should be used only to create new user accounts, and then deleted.
System provides auction API endpoint & self-health check API endpoint.
Auction center exposes list of current auctions as JSON api. Time reported in ends_at and starts_at are always in UTC.
GET /auctions HTTP/1.1
Health check API
Documentation on health check API is available at project WiKi here.
There are certain settings stored in the database that are used for the application logic. For example, the currency in which all auctions are conducted. An administrator can change these settings in /admin/settings page.
To send out emails and perform other asynchronous tasks, we use a background processing with PostgreSQL as queue backend. To start an executor, use bundle exec rails jobs:work.
Part of running the application according to EIS business rules includes creating new auctions at the beginning of the day. Jobs are scheduled outside of the application, as the exact times are no concern of the application.
Due to various regulatory requirements, all database tables are audited according to the following procedure:
Changes in public.users table are recorded into audit.users. Audit records action old_value, new_value, recorded_at time according to postgres time zone and object_id which corresponds to the primary key of data in users.
History of each object is visible in the UI for the administrator.
Audit data is never deleted, even if the original object is. For example, if you destroy user with id 123, it’s history can still be accessed under /admin/users/123/versions.
Adding new database table to audits
Create a migration similar to AuditUsersTable
Create a new audit model like Audit::User. Make sure to set self.table_name to audit.your_table
Add auditable concern to administrator routes:
namespace :admin, constraints: Constraints::Administrator.new do
resources posts, concerns: [:auditable]
Estonian Internet Foundation’s software for auctioning domain names