Artisan "bookstack:update-url" doesn't update header image URL #2085

Closed
opened 2026-02-05 02:51:09 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @unknowndomain on GitHub (Feb 8, 2021).

Describe the bug
When migrating the URL of a Bookstack it is advised in the .env file to run php artisan bookstack:update-url https://old.example.com https://new.example.com however this does not update the header image, which has the effect of causing SSL errors if you are moving from HTTP to HTTPS

Steps To Reproduce

  1. Setup a site using http://whatever.com
  2. Enable SSL + redirection
  3. Change the .env domain
  4. Run php artisan bookstack:update-url https://old.example.com https://new.example.com
  5. Note that there is now an SSL error due to mixed secure and insecure content
  6. Reupload the header image
  7. Note that the SSL error has gone

Expected behavior
php artisan bookstack:update-url https://old.example.com https://new.example.com should update all databased fields including settings

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): v0.31.5
  • PHP Version: 7.4.3
  • Hosting Method (Nginx/Apache/Docker): Apache + LetsEncrypt / Certbot
Originally created by @unknowndomain on GitHub (Feb 8, 2021). **Describe the bug** When migrating the URL of a Bookstack it is advised in the .env file to run `php artisan bookstack:update-url https://old.example.com https://new.example.com` however this does not update the header image, which has the effect of causing SSL errors if you are moving from HTTP to HTTPS **Steps To Reproduce** 1. Setup a site using http://whatever.com 2. Enable SSL + redirection 3. Change the .env domain 4. Run `php artisan bookstack:update-url https://old.example.com https://new.example.com` 5. Note that there is now an SSL error due to mixed secure and insecure content 6. Reupload the header image 7. Note that the SSL error has gone **Expected behavior** `php artisan bookstack:update-url https://old.example.com https://new.example.com` should update all databased fields including settings **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): v0.31.5 - PHP Version: 7.4.3 - Hosting Method (Nginx/Apache/Docker): Apache + LetsEncrypt / Certbot
OVERLORD added the 🐛 Bug🏭 Back-End labels 2026-02-05 02:51:09 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 11, 2021):

Thanks for reporting @unknowndomain.

Have now addressed this case in commit ae353bb3f4, but I'm going to leave this open as we'll also need to do this for the more complex way we'll be storing footer link options in the next release.

Notes for future self

Array setting format:

[{"label":"trans::common.terms_of_service","url":"https:\/\/example.com\/terms"},{"label":"Custom Link","url":"https:\/\/danb.me"},{"label":"trans::common.privacy_policy","url":"https:\/\/example.com\/privacy"}]
  • JSON encode find/replace values before running again against this table? Would address different formats.
  • Alternatively;Could decode, update, then re-encode formats but brittle to structural differences in the future.
@ssddanbrown commented on GitHub (Feb 11, 2021): Thanks for reporting @unknowndomain. Have now addressed this case in commit ae353bb3f45dc9e667c68c4dfbd5ea7b6210fcfb, but I'm going to leave this open as we'll also need to do this for the more complex way we'll be storing footer link options in the next release. #### Notes for future self Array setting format: ``` [{"label":"trans::common.terms_of_service","url":"https:\/\/example.com\/terms"},{"label":"Custom Link","url":"https:\/\/danb.me"},{"label":"trans::common.privacy_policy","url":"https:\/\/example.com\/privacy"}] ``` - JSON encode find/replace values before running again against this table? Would address different formats. - Alternatively;Could decode, update, then re-encode formats but brittle to structural differences in the future.
Author
Owner

@ssddanbrown commented on GitHub (Feb 12, 2021):

All cases should now be covered as of 1a4797abc4.

Thanks again @unknowndomain, This will be part of the next feature release.

@ssddanbrown commented on GitHub (Feb 12, 2021): All cases should now be covered as of 1a4797abc4f6acef6732a05bf977b743b931200e. Thanks again @unknowndomain, This will be part of the next feature release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2085