Skip to content

Commit 9eac6e4

Browse files
committed
Continue work
1 parent 39596cf commit 9eac6e4

File tree

2 files changed

+1
-56
lines changed

2 files changed

+1
-56
lines changed

discourse-setup

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -923,60 +923,6 @@ validate_config() {
923923
fi
924924
}
925925

926-
927-
##
928-
## Enable Discourse ID authentication when skipping email setup
929-
##
930-
enable_discourse_id() {
931-
if [ "$SKIP_EMAIL_SETUP" != "1" ]
932-
then
933-
return
934-
fi
935-
936-
echo ""
937-
echo "Configuring Discourse ID authentication..."
938-
939-
local commands=(
940-
" - exec: rails r \"SiteSetting.enable_discourse_id = true\""
941-
" - exec: rails r \"SiteSetting.enable_local_logins = false\""
942-
)
943-
944-
local added_any="0"
945-
local failed_any="0"
946-
947-
for cmd in "${commands[@]}"
948-
do
949-
if grep -qF "$cmd" "$web_file"
950-
then
951-
continue
952-
fi
953-
954-
local escaped_cmd=${cmd//\\/\\\\}
955-
escaped_cmd=${escaped_cmd//&/\\&}
956-
escaped_cmd=${escaped_cmd//\"/\\\"}
957-
958-
if sed -i -e "/exec: echo \"End of custom commands\"/i\\$escaped_cmd" "$web_file"
959-
then
960-
echo "Added: $cmd"
961-
added_any="1"
962-
else
963-
echo "Warning: could not add '$cmd' to $web_file"
964-
failed_any="1"
965-
fi
966-
done
967-
968-
if [ "$failed_any" == "1" ]
969-
then
970-
echo "Please ensure the commands above are present in $web_file before rebuilding."
971-
elif [ "$added_any" != "1" ]
972-
then
973-
echo "Discourse ID commands already present in $web_file"
974-
else
975-
echo "Discourse ID will be enabled and local email logins disabled on first boot."
976-
fi
977-
}
978-
979-
980926
##
981927
## template file names
982928
##
@@ -1065,7 +1011,6 @@ fi
10651011
scale_ram_and_cpu
10661012
ask_user_for_config
10671013
validate_config
1068-
enable_discourse_id
10691014

10701015
##
10711016
## if we reach this point without exiting, OK to proceed

templates/web.template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ run:
2424
- exec:
2525
tag: precompile
2626
cmd:
27-
- /usr/local/bin/ruby -e 'if ENV["DISCOURSE_SMTP_ADDRESS"] == "smtp.example.com"; puts "Aborting! Mail is not configured!"; exit 1; end'
27+
- /usr/local/bin/ruby -e 'if (ENV["DISCOURSE_SMTP_ADDRESS"] == "smtp.example.com" && ENV["SKIP_EMAIL_SETUP"] != "1"); puts "Aborting! Mail is not configured!"; exit 1; end'
2828
- /usr/local/bin/ruby -e 'if ENV["DISCOURSE_HOSTNAME"] == "discourse.example.com"; puts "Aborting! Domain is not configured!"; exit 1; end'
2929
- /usr/local/bin/ruby -e 'if (ENV["DISCOURSE_CDN_URL"] || "")[0..1] == "//"; puts "Aborting! CDN must have a protocol specified. Once fixed you should rebake your posts now to correct all posts."; exit 1; end'
3030
# TODO: move to base image (anacron can not be fired up using rc.d)

0 commit comments

Comments
 (0)