mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42:36 +02:00
Enable letsencrypt updates for domain changes
This commit is contained in:
parent
69996cb5e8
commit
9c17b9cddb
1 changed files with 6 additions and 1 deletions
|
@ -225,6 +225,7 @@ post '/settings/:username/custom_domain' do
|
||||||
require_login
|
require_login
|
||||||
require_ownership_for_settings
|
require_ownership_for_settings
|
||||||
|
|
||||||
|
original_domain = @site.domain
|
||||||
@site.domain = params[:domain]
|
@site.domain = params[:domain]
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
@ -243,7 +244,11 @@ post '/settings/:username/custom_domain' do
|
||||||
|
|
||||||
if @site.valid?
|
if @site.valid?
|
||||||
@site.save_changes
|
@site.save_changes
|
||||||
|
|
||||||
|
if @site.domain != original_domain
|
||||||
LetsEncryptWorker.perform_async @site.id
|
LetsEncryptWorker.perform_async @site.id
|
||||||
|
end
|
||||||
|
|
||||||
flash[:success] = 'The domain has been successfully updated.'
|
flash[:success] = 'The domain has been successfully updated.'
|
||||||
redirect "/settings/#{@site.username}#custom_domain"
|
redirect "/settings/#{@site.username}#custom_domain"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue