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

Web Mode (Not-Console/CLI) #11

Open
LeeThompson opened this issue May 22, 2023 · 6 comments
Open

Web Mode (Not-Console/CLI) #11

LeeThompson opened this issue May 22, 2023 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@LeeThompson
Copy link
Contributor

LeeThompson commented May 22, 2023

The original design of get-fav.php seems to have been to be used on a web server. The command line switches aren't very useful in this mode so I'm designing a system for processing options in "web mode".

There will be a master switch to enable these new options, it will default to disabled for security reasons.

define('ENABLE_WEB_INPUT', false);

My current thought is to have options come in over the query string and/or form fields. I have not go into any specifics yet but they will likely follow the general syntax of the command line switches.

I don't really use the script this way so this is a chance for comments/suggestions/notes.

I don't plan on adding security checks to the script itself for incoming requests as that should be handled by the server configuration (htaccess or whatever). I do plan on having some checks with paths, especially for anything that can write.

@gaffling gaffling added the enhancement New feature or request label May 25, 2023
@gaffling
Copy link
Owner

That sounds good to me!

Let me ask, what is your use case for getting all favicons of a list?

@LeeThompson
Copy link
Contributor Author

My personal use case is command line driven, I give it a list and run it in a window. More specifically, I found PHP-Grab-Favicon for a project, I'm converting my old HTML based bookmark page to Dasherr and wanted a way to more easily download icons for use on it.

But I do notice the PHP-Grab-Favicon a lot of web-mode stuff and I don't want to trounce on that so I'm thinking it should be able to do more stuff in that mode too. I don't really have a use case for it in that mode which is partially why I opened this as an issue so we (and others) could talk about it.

My intention is to have it, by default, work like it does now, for security reasons. But if with define('ENABLE_WEB_INPUT', true); it should be able to do everything you can do in console/command line mode (although the input mechanics would be different of course). Like I was thinking for a list of URLs, it would accept a form submit from a textarea or something.

@gaffling
Copy link
Owner

Let us glue your and my version together, I'm fine and happy with it if you will push your version also into this repo 🥇

@LeeThompson
Copy link
Contributor Author

That's the plan, I just have more stuff to do and test before I do a PR.

@LeeThompson
Copy link
Contributor Author

If anyone uses get-fav.php in web mode please share your use cases, does it need more functionality?

@gaffling gaffling added the help wanted Extra attention is needed label May 26, 2023
@LeeThompson
Copy link
Contributor Author

As stated above, I don't personally use the script in an HTTP/HTML context but others might. If this is you and you're reading this please feel free to add comments on what you think.

Proposed Web Variables

  • Variables can be passed in via a form or query string.
  • Options that make no sense in an HTTP context will not be implemented.
  • These will only be used if define('ENABLE_WEB_INPUT', true); in the script which is not the default for security reasons.
  • There should probably be an option to have the browser's user agent be passed on to curl in addition to specifying a specific one.

(This is incomplete, mostly a placeholder for now)

Variable Internal/INI File Switch Comments
DEBUG debug --debug Enables special debug mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants