Fix sed instructions relative to file .htaccess#199
Fix sed instructions relative to file .htaccess#199colisee merged 2 commits intoLibreBooking:masterfrom
Conversation
|
I need to check apache docs to understand the format first. I don't get it from here what difference this makes. But my first question is why this is needed in container only? Why is this not fixed in original librebooking git repo .htaccess file? |
|
Unsure if I am doing anything wrong but I took the |
|
I'm on travel, and only on mobile. So I'm likely wrong, but to me it looks like the sed removes the whole "RewriteRule" and "...Cond" as it's within the '()'. Check if it isn't so. |
|
I mean this |
@ikke-t , it is related to the docker image when used with the docker environment variable |
You will see the difference when you restart an existing container. I reckon that the .htaccess-related sed statement is quite "tricky"... Does Copilot offer a simpler/more readable solution? |
|
Like said, I claim it's wrong. It should not substitute the key word Rewrite... |
|
Playing in my mobile while waiting for ferry. I find this good to read and robust: |
|
Actually, this is the neatest and the most readable:
It finds rows starting with Rewrite, and substitutes Web to ${APP_PATH}/Web on matching lines. Much simpler to read. This would not work if run several times to .htaccess, but likely it's not. |
I find the You can see for yourself:
4 Look at the content of |
|
OK, I was thinking we do that only at container creation time. This fixed it, if it's already applied we skip it:
|
Ah. Okay. What if do something like. Instead of trying to make a |
|
sounds good. The last sed should work though, at least on command line it behaves right. Only time it would not work is if somehow the APP_PATH would change between the invocations, but I don't see it changing during the container lifecycle. |
|
@ikke-t : Thank you for the last @JohnVillalovos : Your suggestion to implement an idempotent code makes complete sense and I will implement this. Once this PR is updated, either you or @ikke-t can approve it and confirm the deletion of the remote |
Close issue #198