Update totara-docker-dev with support for the new entrypoint#387
Open
angelakuznetsova wants to merge 1 commit intototara:masterfrom
Open
Update totara-docker-dev with support for the new entrypoint#387angelakuznetsova wants to merge 1 commit intototara:masterfrom
angelakuznetsova wants to merge 1 commit intototara:masterfrom
Conversation
8bf5e6d to
3806c47
Compare
3806c47 to
ff4400e
Compare
NingZhou-NZ
requested changes
Apr 17, 2026
NingZhou-NZ
left a comment
There was a problem hiding this comment.
Good job! I just had a few suggestions. Have a look when you have a moment. :)
| @@ -10,6 +10,7 @@ client_max_body_size 1G; | |||
|
|
|||
| location / { | |||
| autoindex on; | |||
There was a problem hiding this comment.
I think we can wrap this in if condition. This is for if the index file missing then show the folder content
Suggested change
| autoindex on; | |
| if (!$use_front_controller) { | |
| autoindex on; | |
| } |
|
|
||
| location / { | ||
| autoindex on; | ||
| try_files $uri $uri/ /index.php?$query_string; |
There was a problem hiding this comment.
Suggested change
| try_files $uri $uri/ /index.php?$query_string; | |
| # Redirect non-existing files to index.php for "pretty" URLs | |
| try_files $uri $uri/ /index.php?$query_string; |
Comment on lines
-26
to
+38
| fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; | ||
| fastcgi_param SCRIPT_NAME $fastcgi_script_name; | ||
|
|
||
| # For v21+ installs (public/ webroot), all PHP requests are routed through | ||
| # public/index.php (the front controller). The front controller reads | ||
| # REQUEST_URI to dispatch to the correct script inside server/. | ||
| # For v13-20 installs the real script exists under server/ and is served directly. | ||
| set $script_filename $document_root$fastcgi_script_name; | ||
| if ($use_front_controller) { | ||
| set $script_filename $document_root/index.php; | ||
| } | ||
| fastcgi_param SCRIPT_FILENAME $script_filename; | ||
|
|
There was a problem hiding this comment.
These changes are not necessary as long as you made the change in server.conf
Comment on lines
27
to
+53
| # Default root | ||
| set $rootdir "$REMOTE_SRC"; | ||
|
|
||
| if ($sitename != "") { | ||
| set $rootdir "$rootdir/$sitename"; | ||
| } | ||
|
|
||
| # If we have the server directory (version 13 and newer) use this as the wwwroot | ||
| # If we have the server directory (version 13 to 20) use this as the wwwroot | ||
| if (-f "$rootdir/server/version.php") { | ||
| # in which case, set that directory as the root | ||
| set $rootdir "$rootdir/server"; | ||
| } | ||
|
|
||
| # If we have the public directory (version 21 and newer) it is a sibling of server/, | ||
| # so check from the original sitename root. Re-check against REMOTE_SRC base. | ||
| # We use a separate variable to avoid double-appending on the server/ branch. | ||
| set $publicrootdir "$REMOTE_SRC"; | ||
| if ($sitename != "") { | ||
| set $publicrootdir "$publicrootdir/$sitename"; | ||
| } | ||
|
|
||
| # $use_front_controller is set to 1 for v21+ installs that use a public/ webroot | ||
| # and rely on public/index.php as the single entry point for all PHP requests. | ||
| set $use_front_controller 0; | ||
| if (-d "$publicrootdir/public") { | ||
| set $rootdir "$publicrootdir/public"; | ||
| set $use_front_controller 1; | ||
| } |
There was a problem hiding this comment.
Suggested change
| } | |
| # Default root | |
| set $base_rootdir "$REMOTE_SRC"; | |
| if ($sitename != "") { | |
| set $base_rootdir "$base_rootdir/$sitename"; | |
| } | |
| # If we have the server directory (version 13 to 20) use this as the wwwroot | |
| if (-f "$base_rootdir/server/version.php") { | |
| set $rootdir "$base_rootdir/server"; | |
| set $use_front_controller 0; | |
| } | |
| # If we have the public directory (version 21 and newer) it is a sibling of server/, | |
| # so check from the original sitename root. Re-check against REMOTE_SRC base. | |
| # We use a separate variable to avoid double-appending on the server/ branch. | |
| if (-d "$base_rootdir/public") { | |
| set $rootdir "$base_rootdir/public"; | |
| set $use_front_controller 1; | |
| } |
There was a problem hiding this comment.
I think this will be easier to read
Comment on lines
-53
to
+67
| fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; | ||
| fastcgi_param SCRIPT_NAME $fastcgi_script_name; | ||
|
|
||
| # For v21+ installs (public/ webroot), route all PHP through the front controller. | ||
| set $script_filename $document_root$fastcgi_script_name; | ||
| if ($use_front_controller) { | ||
| set $script_filename $document_root/index.php; | ||
| } | ||
| fastcgi_param SCRIPT_FILENAME $script_filename; | ||
|
|
There was a problem hiding this comment.
These change will not be necessary if you applied the change in server.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Describe what this pull request is about
Testing Instructions
Checklist
bin/directory run correctly on both MacOS and WSLtbuild container && tup container)config.phpare compatible with our oldest supported Totara version, our newest Totara version, and Moodle