Skip to content
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

Anonymize paths in fastlane env output #7037

Merged
merged 1 commit into from
Nov 18, 2016
Merged

Conversation

0xced
Copy link
Contributor

@0xced 0xced commented Nov 16, 2016

  • Run bundle exec rspec from the subdirectory of each tool you modified. Alternatively, run rake test_all from the root directory.
  • Run bundle exec rubocop -a to ensure the code style is valid
  • Read the Contribution Guidelines
  • We currently don't accept new actions, please publish a plugin instead, more information in Plugins.md

This way, the username is not leaked. Also, it makes it easy to visually spot when a path is in the user’s home directory.

@hjanuschka
Copy link
Collaborator

i really like that. recently was thinking about doing a UI.input before copy&paste - and asking the user for strings that they wan't to be removed? like (app identifier ...) - what do you think about it @0xced

@0xced
Copy link
Contributor Author

0xced commented Nov 16, 2016

@hjanuschka This is a good idea, but it should be done in another pull request IMHO. I wonder how much data we could anonymize automatically, without needing UI.input.

@@ -270,6 +270,10 @@ def self.print_fastlane_files
env_output
end

def self.anonymized_path(path)
return ENV['HOME'] ? path.gsub(/^#{ENV['HOME']}/, '~') : path
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the super edgy edge case that the user's home dir is the prefix of other folders this is gonna output garbage. Example: $HOME=/work, anonymized_path("/workspace/whatever/fastlane") => ~space/whatever/fastlane.

Might be more applicable to linux where the user's home dir is not generally inside the /Users/ folder.

@hjanuschka
Copy link
Collaborator

@milch @0xced

how about this PR here -> #5982
we could refactor all options and set the flags on all critical parameters, and use this in some way to anonymize?

@milch
Copy link
Collaborator

milch commented Nov 17, 2016

@hjanuschka Yeah, I've thought about something like that before. Sounds good to me, @0xced do you have any thoughts about that?

This way, the username is not leaked. Also, it makes it easy to visually spot when a path is in the user’s home directory.
@0xced
Copy link
Contributor Author

0xced commented Nov 18, 2016

I updated the code, and added a spec.

With $HOME == /Users/john
/Users/john/.fastlane/bin/bundle/bin/fastlane~/.fastlane/bin/bundle/bin/fastlane
/Users/john~
/Users/john/~/

With $HOME == /work
/workspace/project/test/workspace/project/test

Copy link
Collaborator

@milch milch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now! Thanks for your contribution 🚀

@milch milch merged commit de19b6d into fastlane:master Nov 18, 2016
@0xced 0xced deleted the anonymize-paths branch November 18, 2016 21:05
@asfalcone asfalcone mentioned this pull request Nov 29, 2016
@fastlane fastlane locked and limited conversation to collaborators Feb 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants