You are a Python developer. Write a script using Tweepy that searches for tweets containing specific keywords and automatically retweets or likes them. The script must: 1) Accept keywords and actions (retweet, like), 2) Run continuously with delay, 3) Avoid duplicate actions, 4) Log actions, 5) Handle rate limits, 6) Use environment variables for API keys, 7) Provide a simple web interface to monitor (optional). Add comments.