Update.
So, I just deleted everything in my input fields and it saves.
If I try and add ANY code it doesn’t save.
So now I have a broken site which is not great.
Adding code the template files for now
I even tried creating a new admin user. That didn’t work either.
More Testing
Hoping this might help someone point me in the right direction…
If I add the following to header or footer - it saves. <!-- Google Ad Manager -->
If I add any actual scripts like the following to header or footer - it does not save. <script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
Assertion failed: Input argument is not an HTMLInputElement
PUT https://****/ghost/api/v3/admin/settings/ 403
`Error: Request was rejected because user is not permitted to perform this operation.`
Btw, I’m the only staff on the site are me(admin) and ghost.
Where it gets a little insane is that I can add <style> to the header/footer, but the moment I write the word <script> the page throws the warning!?
Do you have any firewalls on the droplet or a cdn/security service sitting in front? It sounds like something is blocking what it thinks is “unsafe” content in the request.
Another thing to check is any security software on your computer, are you able to try from a different device? Testing from a phone/tablet connected to a different network (4g instead of wi-fi for example) could help determine if it’s a problem specific to your computer
@Kevin I owe you big time!
This has been driving me crazy for months, across 4 different installations of Ghost.
I just added a page rule in Cloudflare to disable the firewall when trying to access ‘/ghost/api/v3/admin/settings/’ and I can now save code injections.
In general, yes, it’s safe unless you have a specific need that warrants a firewall. Only you can know if it’s necessary based on how you are hosting, who has access, which networks your traffic is passing through, etc.
The problem and solution is the same across the board. If you copied the page rule directly from above rather than adapting it to your situation then it will only work for saving code injection.
It’s recommended to have the firewall disabled for all of /ghost/* to avoid problems but if you need it then you should adapt your firewall rules to suit.