euzu / m3u-filter

m3u-filter (iptv filter) is an application which can filter/rename/map entries out of a playlist in M3U / XTREAM format and can save/serve it as m3u, xtream or kodi format. It can be used as reverse or redirect proxy for xtream.
MIT License
65 stars 7 forks source link

Restrict access or suppress web access #52

Closed lezioul closed 4 months ago

lezioul commented 5 months ago

Hi,

it would be a great thing to add credentials on /web or give the ability to disable the webapp without disabling the proxy. I use m3u-filter on a vps and i have disallowed every public IPs except mine so webapp is not fully accessible.

Best Regards,

Lezioul

euzu commented 5 months ago

@lezioul i have pushed the changes to the master branch,

in config.yml

web_ui_enabled web_auth

euzu commented 5 months ago

@lezioul in order to use web_auth you need to build the backend and the frontend. Inside the bin folder are some usefull scripts.

lezioul commented 5 months ago

Seems really nice! I'll try this tomorrow. By the way, how can i activate DEBUG level in logger, is there an environment variable?

Best regards

euzu commented 5 months ago

LogLevel can only be set through program arguments. I could not figure out howto change the log level for the env_logger crate after start. There are other log crates which support dynamic log level changeing.
But i dont think that this is necessary.

-l, --log-level <LOG_LEVEL> log level

Usage: m3u-filter [OPTIONS]

Options:
  -p, --config-path <CONFIG_PATH>  The config directory
  -c, --config <CONFIG_FILE>       The config file
  -i, --source <SOURCE_FILE>       The source config file
  -m, --mapping <MAPPING_FILE>     The mapping file
  -t, --target <TARGET>            The target to process
  -a, --api-proxy <API_PROXY>      The user file
  -s, --server                     Run in server mode
  -l, --log-level <LOG_LEVEL>      log level
  -h, --help                       Print help
  -V, --version                    Print version
  --genpwd                         Generate UI Password
lezioul commented 5 months ago

I was talking about a variable in docker-compose.yml file.

euzu commented 5 months ago

I have updated master branch. M3U_FILTER_LOG env variable can be used to to define the log level.

Cli-Argument -> if not available -> env var M3U_FILTER_LOG -> if not availabel info

Log Level has now module support like m3u_filter::util=error,m3u_filter::filter=debug,m3u_filter=debug

lezioul commented 4 months ago

Sorry, i was not able to build the master, so i could not test.

euzu commented 4 months ago

@lezioul there is a new docker image release if you want to test, you can run it in docker.

lezioul commented 4 months ago

Yep, just have tested it, webaccess with user is working, you should add the following command for thus using docker in order to generate passwd :

docker container exec -it m3u-filter ./m3u-filter --genpwd (the type your passwd and add it in your usr.txt file or whatever)

I'll try to put all log in debug level, to see if there is any problem concerning my other issue #51