-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Several 2.0 regression fixes #876
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dd9db5e
Minor cosmetic commit
kontsevoy 1755870
Logging fixes and more
kontsevoy 35f80ca
Added 'data_dir' value to backend params
kontsevoy 1cab059
Changes to Unix socket path to make it cross platform.
russjones d304e47
Use ioutil.TempDir to create path to socket instead.
russjones 81b379e
Remove log line that contains err.
russjones fd46d88
try to fix the test
klizhentas 835a754
Fixed Ansible regressions and added documentation for docker build.
russjones e9b1754
Added Ansible playbook for testing and docs on how to run it.
russjones File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
- hosts: all | ||
tasks: | ||
- name: "simple copy" | ||
copy: | ||
src: /root/go/src/github.com/gravitational/teleport/docker/ansible/simple.txt | ||
dest: /tmp/simple.txt.out | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
|
||
- name: recursive copy | ||
copy: | ||
src: /root/go/src/github.com/gravitational/teleport/docker/ansible/rdir | ||
dest: /tmp" | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
|
||
- name: simple template | ||
template: | ||
src: /root/go/src/github.com/gravitational/teleport/docker/ansible/template.j2 | ||
dest: /tmp/template.out | ||
owner: root | ||
group: root | ||
mode: 0644 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rdir |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hello, world |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
template_host: {{ template_host }} | ||
template_uid: {{ template_uid }} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ package srv | |
import ( | ||
"fmt" | ||
"io" | ||
"io/ioutil" | ||
"net" | ||
"os" | ||
"os/exec" | ||
|
@@ -42,7 +43,6 @@ import ( | |
"github.com/gravitational/teleport/lib/sshutils" | ||
"github.com/gravitational/teleport/lib/teleagent" | ||
"github.com/gravitational/teleport/lib/utils" | ||
"github.com/pborman/uuid" | ||
|
||
log "github.com/Sirupsen/logrus" | ||
"github.com/gravitational/trace" | ||
|
@@ -872,13 +872,17 @@ func (s *Server) handleAgentForward(ch ssh.Channel, req *ssh.Request, ctx *ctx) | |
|
||
authChan, _, err := ctx.conn.OpenChannel("[email protected]", nil) | ||
if err != nil { | ||
return err | ||
return trace.Wrap(err) | ||
} | ||
clientAgent := agent.NewClient(authChan) | ||
ctx.setAgent(clientAgent, authChan) | ||
|
||
pid := os.Getpid() | ||
socketPath := filepath.Join(os.TempDir(), fmt.Sprintf("teleport-agent-%v.socket", uuid.New())) | ||
socketDir, err := ioutil.TempDir(os.TempDir(), "teleport-") | ||
if err != nil { | ||
return trace.Wrap(err) | ||
} | ||
socketPath := filepath.Join(socketDir, fmt.Sprintf("teleport-%v.socket", pid)) | ||
|
||
agentServer := &teleagent.AgentServer{Agent: clientAgent} | ||
err = agentServer.ListenUnixSocket(socketPath, uid, gid, 0600) | ||
|
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
@russjones this overwrites the user-supplied value at all times, what should not be the case. We should only overwrite the value if user haven't supplied the value. You can fix that yourself as @kontsevoy is OOO at the moment.
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.
@klizhentas there are no user-supplied values in
StorageConfig.Params
[1]. Storage config is a static, backend-specific YAML configuration, with "data_dir" being a reserved word. In fact, we guarantee the presence of "data_dir" in.Params
(and back-end code expects it to be there) This needs to be reflected in backend developer README. In other words, this behavior is as-designed.[1] Bolt used to accept an arbitrary JSON string, so that's why you think there are user-supplied values. This is no longer true since the Great Christmas-2016 Back-end Redesign
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.
I think users can supply Params["path"] for backend, at least what I have observed in configs and the code, so I don't quite understand the fix then. Why is it setting "data_dir" and not "path" like for example "boltdb" requires.
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.
My question basically is - can you explain to me how does this change fixes the case reported here:
#867
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.
@russjones: @kontsevoy explained to me how it works, so this part lgtm, please fix the part with socket path and merge the whole thing