diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2d0d5799 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM ruby:3.4.1 + +# Install dependencies +RUN apt-get update -qq && apt-get install -y nodejs postgresql-client + +WORKDIR /app + +COPY Gemfile Gemfile.lock ./ +RUN gem install bundler && bundle install + +COPY . . + +EXPOSE 3000 + +CMD ["rails", "server", "-b", "0.0.0.0"] \ No newline at end of file diff --git a/app/controllers/participants_controller.rb b/app/controllers/participants_controller.rb index 26f5002e..38fe3b24 100644 --- a/app/controllers/participants_controller.rb +++ b/app/controllers/participants_controller.rb @@ -56,7 +56,8 @@ def participant_params params.require(controller_name.singularize).permit( :name, :email, :password, :bio, :github_profile_username, - :twitter_handle, :code_of_conduct_agreement + :twitter_handle, :mastodon_url, + :bluesky_handle,:code_of_conduct_agreement ) end diff --git a/app/models/sessions_json_builder.rb b/app/models/sessions_json_builder.rb index 01e6794a..3d9d46ab 100644 --- a/app/models/sessions_json_builder.rb +++ b/app/models/sessions_json_builder.rb @@ -6,6 +6,8 @@ def to_hash(session) participant_id: s.participant.id, presenter_name: s.participant.name, presenter_twitter_handle: s.participant.twitter_handle, + presenter_mastodon_url: s.participant.mastodon_url, + presenter_bluesky_handle: s.participant.bluesky_handle, presenter_github_username: s.participant.github_profile_username, presenter_github_og_image: s.participant.github_og_image, presenter_bio: s.participant.bio, diff --git a/app/views/participants/edit.html.erb b/app/views/participants/edit.html.erb index 14619ef1..27763c48 100644 --- a/app/views/participants/edit.html.erb +++ b/app/views/participants/edit.html.erb @@ -6,8 +6,10 @@ <%= f.inputs do %> <%= f.input :name, :label => 'Your name', :hint => "Please use your real name. This will be used in our printed materials." %> <%= f.input :email, :label => 'Your email', :hint => "Please use a real email address. We need this to contact you about your presentation." %> - <%= f.input :github_profile_username, :label => 'Your GitHub username' %> - <%= f.input :twitter_handle, :label => 'Your Twitter handle' %> + <%= f.input :github_profile_username, :label => 'Your GitHub username (optional)' %> + <%= f.input :twitter_handle, :label => 'Your Twitter (X) handle (optional)' %> + <%= f.input :mastodon_url, :label => 'Your Mastodon URL (optional)' %> + <%= f.input :bluesky_handle, :label => 'Your Bluesky handle (optional)' %> <%= f.input :bio, :hint => 'You can use Markdown syntax here. Examples: **bold**, *italic*, [link](http://example.com)'.html_safe %> <%= f.input :code_of_conduct_agreement, diff --git a/app/views/participants/show.html.erb b/app/views/participants/show.html.erb index af51f196..e2e75d74 100644 --- a/app/views/participants/show.html.erb +++ b/app/views/participants/show.html.erb @@ -20,6 +20,20 @@
@<%= @participant.twitter_handle %>
<% end %> + + <% if @participant.mastodon_url.present? %> +
+

Mastodon:

+
<%= @participant.mastodon_url %>
+
+ <% end %> + + <% if @participant.bluesky_handle.present? %> +
+

Bluesky:

+
@<%= @participant.bluesky_handle %>
+
+ <% end %>
diff --git a/config/database.yml b/config/database.yml index cdbbed25..6df81bbc 100644 --- a/config/database.yml +++ b/config/database.yml @@ -3,8 +3,8 @@ development: encoding: unicode host: localhost pool: 5 - username: postgres - password: + username: sessionizer + password: asdf1234 database: sessionizer_development test: @@ -13,6 +13,6 @@ test: # Database does not work in GitHub Workflows if host parameter is not specified host: localhost pool: 5 - username: postgres - password: + username: sessionizer + password: asdf1234 database: sessionizer_test diff --git a/db/schema.rb b/db/schema.rb index ff38ad79..5e005a88 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -78,6 +78,8 @@ t.string "github_og_image" t.string "github_og_url" t.string "twitter_handle" + t.string "mastodon_url" + t.string "bluesky_handle" t.index ["email"], name: "index_participants_on_email", unique: true t.index ["perishable_token"], name: "index_participants_on_perishable_token" end diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..53bee4b2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,34 @@ +version: '3.9' + +services: + db: + image: postgres:15 + restart: always + volumes: + - postgres_data:/var/lib/postgresql/data + environment: + POSTGRES_USER: sessionizer + POSTGRES_PASSWORD: asdf1234 + POSTGRES_DB: sessionizer_development + ports: + - "5432:5432" + + web: + build: . + depends_on: + - db + volumes: + - .:/app + environment: + DATABASE_URL: postgres://db:5432/sessionizer_development + ports: + - "3000:3000" + command: > + sh -c " + bundle install && + rails db:setup && + bundle exec rake app:make_believe && + rails server -b 0.0.0.0" + +volumes: + postgres_data: