dstotijn / hetty

An HTTP toolkit for security research.
https://hetty.xyz
MIT License
6.07k stars 346 forks source link

Remember the last open project #52

Open MichalZalecki opened 3 years ago

MichalZalecki commented 3 years ago

Is your feature request related to a problem? Please describe.

Each time I restart Hetty I have to activate the project.

Describe the solution you'd like

I would like my last project to be selected without any additional action. I think this is safe enough to make this a new default behavior. The question is, where to store this information?

My initial idea is to save it in a simple text file in the projPath e.g. ~/.hetty/projects/last_open or something like that.

The other idea that might be worth considering is to have a project-agnostic database file e.g. ~/.hetty/Config.db where all settings that arent related to any particular project can be stored.

Let me know what you think, I'm happy to work on it.

dstotijn commented 3 years ago

I think auto opening the last project at start isn't necessarily expected default behaviour (I guess this is a bit subjective). As far as I know other similar software doesn't do this. I do think there's value in having some control over opening a project at startup. I would opt to introduce a flag to indicate the project (new or existing) that you'd like to open by name. Example usage would be:

hetty --project foobar

The idea you mentioned of project-agnostic settings could be interesting to explore in the future if there's more user settings (e.g. proxy defaults, UI/UX settings) we'd want to persist. But I would say it's best to hold off a bit longer on that until we have more "core" features in place.

MichalZalecki commented 3 years ago

A command-line argument also works for me. I'll prepare a PR 👌