-
Notifications
You must be signed in to change notification settings - Fork 173
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: restrict secretFile
path
#669
fix: restrict secretFile
path
#669
Conversation
wrap the existing component to restrict secretFile path
func getPrefixConfigFilePath() string { | ||
prefix := "" | ||
for i, str := range os.Args { | ||
if str == "-c" || str == "-config" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FIXME
said that we should get the startup parameters in main.go and you can take
Line 455 in 9a31451
stm := stagemanager.InitStageManager(c, c.String("config"), app) |
Checking
-c
or -config
here is not enough, since users can just ./layotto start
and layotto will use the default configuration path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
FIXME
said that we should get the startup parameters in main.go and you can takeLine 455 in 9a31451
stm := stagemanager.InitStageManager(c, c.String("config"), app) as an example.
Checking-c
or-config
here is not enough, since users can just./layotto start
and layotto will use the default configuration path
Is there means I can get configuration path by used c.String("config")
in main.go to replace if str == "-c" || str == "-config"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! you can get the path by c.String("config")
in main.go and then put it in a common place in the memory
We need to review the code and find a suitable place to store the path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how to store var in memory? Can you give me some refs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The easiest way is to store it in the main.go as a global variable. But this "global variable" way is not "elegant".
I suggest you read the startup code and try to pass the var to the runtime server without using global variable.
If you really can't find a way, then use global variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichaelDeSteven Hi ,are u still working on it?
Do you need help? I can help with this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry that I cant find the method of store var in startup code. can you give me some tips?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. let me take a look
I submitted #698 to test the case @MichaelDeSteven Could u modify the quickstart doc to test the |
I will modify and test it later. |
Signed-off-by: seeflood <[email protected]>
Hi @MichaelDeSteven , I submitted a PR MichaelDeSteven#3 to your branch.
Please review and merge :) |
chore: layotto start without `-c` or `--config`
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
What this PR does:
Which issue(s) this PR fixes:
Fixes #631
Special notes for your reviewer:
Does this PR introduce a user-facing change?: