Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Disable symlinks option#454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
joseluisq merged 3 commits intomasterfromfeat-disable-symlinks
Jun 11, 2024
Merged

Disable symlinks option#454

joseluisq merged 3 commits intomasterfromfeat-disable-symlinks
Jun 11, 2024

Conversation

joseluisq
Copy link
Collaborator

@joseluisqjoseluisq commentedJun 10, 2024
edited
Loading

Description

This PR adds support to disable symlinks via the boolean--disable-symlinks by preventing following files or directories if any path name component is a symbolic link and returning403 Forbidden in case accessing a path directly if the feature is enabled.
This applies also to the directory listing. In this case, the file or directory won't be shown in the list.

The feature is off (false) by default.

      --disable-symlinks[=<DISABLE_SYMLINKS>]          Prevent following files or directoriesif any path name component is a symbolic link [env: SERVER_DISABLE_SYMLINKS=] [default: false] [possible values: true, false]\

Related Issue

Motivation and Context

How Has This Been Tested?

Feature disabled (default)

curl -I http://127.0.0.1:8787/static-web-server/# HTTP/1.1 200 OK# content-type: text/html; charset=utf-8# content-length: 4423# cache-control: public, max-age=86400# date: Mon, 10 Jun 2024 20:20:56 GMT

Feature enabled

curl -I http://127.0.0.1:8787/static-web-server/# HTTP/1.1 403 Forbidden# content-type: text/html; charset=utf-8# content-length: 106# accept-ranges: bytes# cache-control: public, max-age=86400# date: Mon, 10 Jun 2024 20:22:38 GMT

Screenshots (if appropriate):

--disable-symlinks[=<DISABLE_SYMLINKS>]  Prevent following files or directories if any path name component is  a symbolic link [env: SERVER_DISABLE_SYMLINKS=] [default: false]  [possible values: true, false]
@semanticdiff-comSemanticDiff.com
Copy link

semanticdiff-combot commentedJun 10, 2024
edited
Loading

Review changes withSemanticDiff.

Analyzed 11 of 16 files.

Overall, the semantic diff is2% smaller than the GitHub diff.

FilenameStatus
docs/content/configuration/command-line-arguments.mdUnsupported file format
docs/content/configuration/environment-variables.mdUnsupported file format
docs/content/features/disable-symlinks.mdUnsupported file format
docs/mkdocs.ymlUnsupported file format
✔️src/directory_listing.rs6.79% smaller
✔️src/handler.rsAnalyzed
✔️src/server.rsAnalyzed
✔️src/settings/cli.rsAnalyzed
✔️src/settings/file.rsAnalyzed
✔️src/settings/mod.rsAnalyzed
✔️src/static_files.rsAnalyzed
✔️src/testing.rsAnalyzed
✔️tests/compression_static.rsAnalyzed
✔️tests/dir_listing.rsAnalyzed
tests/fixtures/public/symlinkUnsupported file format
✔️tests/static_files.rs1.24% smaller

@joseluisqjoseluisq added enhancementNew feature or request v2v2 release generalRelated to general server configuration labelsJun 10, 2024
@joseluisqjoseluisq merged commiteeb88da intomasterJun 11, 2024
@joseluisqjoseluisq deleted the feat-disable-symlinks branchJune 11, 2024 20:46
@joseluisqjoseluisq added this to thev2.32.0 milestoneJun 12, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
enhancementNew feature or requestgeneralRelated to general server configurationv2v2 release
Projects
None yet
Milestone
v2.32.0
Development

Successfully merging this pull request may close these issues.

1 participant
@joseluisq

[8]ページ先頭

©2009-2025 Movatter.jp