Project

General

Profile

Bug #718

redmine: unable to register a new account

Added by Pierre-Louis Bonicoli 8 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Normal
Category:
Service :: Web
Start date:
2021-02-12
Due date:
% Done:

100%

Estimated time:
Patch Available:
Confirmed:
Yes
Branch:
Entity:
DuckCorp
Security:
No
Help Needed:

Description

https://www.redmine.org/account/register https://projects.duckcorp.org/account/register displays an HTTP 500 error.

Redmine logs (/var/log/redmine/dc/production.log) contains:

Processing by WelcomeController#index as HTML
  Current user: anonymous
  Rendering plugins/recaptcha/app/views/account/register.html.erb within layouts/base
  Rendered plugins/recaptcha/app/views/account/register.html.erb within layouts/base (70.2ms)
Completed 500 Internal Server Error in 232ms (ActiveRecord: 8.6ms)

ActionView::Template::Error (No site key specified.):
    26:   <p><%= custom_field_tag_with_label :user, value %></p>
    27: <% end %>
    28:
    29: <%= recaptcha_tags :hl=>current_language, :public_key => Setting.plugin_recaptcha['recaptcha_public_key'] %>
    30: </div>
    31:
    32: <%= submit_tag l(:button_submit) %>

plugins/recaptcha/app/views/account/register.html.erb:29:in `block in _plugins_recaptcha_app_views_account_register_html_erb___990786606388501379_47129660060800'
app/helpers/application_helper.rb:1242:in `labelled_form_for'
plugins/recaptcha/app/views/account/register.html.erb:3:in `_plugins_recaptcha_app_views_account_register_html_erb___990786606388501379_47129660060800'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'


Related issues

Related to DuckCorp Infrastructure - Enhancement #732: passenger: a better path for restart.txtResolved2021-09-12

Actions

Associated revisions

Revision 24cf78d5 (diff)
Added by Marc Dequènes 8 months ago

redmine: update recaptcha config

closes #718

History

#1

Updated by Pierre-Louis Bonicoli 8 months ago

I added this file /usr/share/redmine/config/initializers/recaptcha.rb:

Recaptcha.configure do |config|
  config.site_key   = Setting.plugin_recaptcha['recaptcha_public_key']
  config.secret_key = Setting.plugin_recaptcha['recaptcha_private_key']
end

and restarted apache2 (systemctl restart apache2.service) in order to fix this issue. I don't know why /var/lib/redmine/dc/tmp/restart.txt wasn't sufficient.

First I try to put the file below /var/lib/redmine/dc/config/initializers/ but it wasn't taken in account.

#2

Updated by Pierre-Louis Bonicoli 8 months ago

I added the following file (/root/patches/redmine/recaptcha.patch):

--- /dev/null    2021-02-10 12:46:26.160848555 +0100
+++ config/initializers/recaptcha.rb    2021-02-12 00:23:03.424350312 +0100
@@ -0,0 +1,4 @@
+Recaptcha.configure do |config|
+  config.site_key   = Setting.plugin_recaptcha['recaptcha_public_key']
+  config.secret_key = Setting.plugin_recaptcha['recaptcha_private_key']
+end

#3

Updated by Pierre-Louis Bonicoli 8 months ago

  • Status changed from New to Resolved
  • Assignee set to Pierre-Louis Bonicoli
  • % Done changed from 0 to 100
#4

Updated by Marc Dequènes 8 months ago

  • Status changed from Resolved to In Progress
  • Assignee changed from Pierre-Louis Bonicoli to Marc Dequènes

Considering information about the patch and versioning that I clarified in #719, there is an old patch redmine_recaptcha_api_change.patch that was created for Buster compatibility and reverts the plugin code for the API that is supported in Debian at the time. Now ruby-recaptcha is version 4.11.1-2 and I believe this is not needed anymore. Currently the old patch is fully applied, so maybe simply unapplying it would suffice and your patch might not be necessary. Reopening to test this.

#5

Updated by Marc Dequènes 8 months ago

Without changing anything yet I tried to register and did not get any recaptcha.

#6

Updated by Marc Dequènes 8 months ago

Frack, I followed your link to www.redmine.org… this is not our instance.

#7

Updated by Marc Dequènes 8 months ago

So this works and I'm going to update the Ansible rules now.

#8

Updated by Marc Dequènes 8 months ago

  • Status changed from In Progress to Resolved
#9

Updated by Pierre-Louis Bonicoli 8 months ago

  • Description updated (diff)
#10

Updated by Pierre-Louis Bonicoli about 1 month ago

Pierre-Louis Bonicoli wrote:

I added this file /usr/share/redmine/config/initializers/recaptcha.rb:
[...]

and restarted apache2 (systemctl restart apache2.service) in order to fix this issue. I don't know why /var/lib/redmine/dc/tmp/restart.txt wasn't sufficient.

First I try to put the file below /var/lib/redmine/dc/config/initializers/ but it wasn't taken in account.

Using strace, I looked for the path used by redmine. The result is: /usr/share/redmine/tmp/restart.txt (incidentally i discovered the /usr/share/redmine/tmp/always_restart.txt path).

I checked the Passenger source code, in order to use a better restart.txt path:
  • either application root path (PassengerAppRoot) should be defined
  • or the PassengerRestartDir should be defined as an absolute path

I will open another issue for that.

#11

Updated by Pierre-Louis Bonicoli about 1 month ago

Also available in: Atom PDF