Script in /head broke site

I was copying over a script i created on my test site and ended up missing a close tag. Bad copy/paste job. This broke my site and i can no longer get to the customization screen to change it. Is there a way I can get to this from another way.

Is it still broken if you access directly any of the /admin URLs?

yes. Its a script that is loading in the header.

Does it save this info into a file in the container or is all kept in the DB?

It’s in the DB. You should be able to recover by disabling the customization via the rails console.

1 Like

Check this post out it should so what you need…

2 Likes

thank you. That worked.

1 Like

For future reference for anybody in the crazy situation where they are an admin but don’t have access to the Discourse instance’s shell…

…but are an admin and still authenticated - you can use the API:

API Key can be found here (THE_API_KEY_OBTAINED_BEFORE_GOES_HERE):
http://www.example.com/admin/api.json

List of customisations to find ID here (THE_CUSTOMIZATION_ID_HERE):
http://www.example.com/admin/customize/css_html.json

Then replacing the domain, customisation ID and API key:

curl -vs 'http://www.example.com/admin/site_customizations/THE_CUSTOMIZATION_ID_HERE?api_key=THE_API_KEY_OBTAINED_BEFORE_GOES_HERE&api_username=system' -X PUT -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data $'site_customization%5Benabled%5D=false' 2>&1
4 Likes

Nice. This thread and referenced thread bookmarked.

Just found my Oh S#!&! button.

This topic was automatically closed after 30 minutes. New replies are no longer allowed.

Note, should not break on latest cause we now normalise html

3 Likes