# Use the solipsist01/rapidleech image as the base FROM solipsist01/rapidleech:latest # Install necessary tools to modify configuration RUN apt-get update && apt-get install -y nano # Enable Apache headers module to control X-Frame-Options and Content Security Policy RUN a2enmod headers # Modify the Apache configuration to listen on port 7860 RUN sed -i 's/80/7860/g' /etc/apache2/ports.conf && \ sed -i 's/80/7860/g' /etc/apache2/sites-available/000-default.conf # Add Content-Security-Policy header to allow iframe from specific domain RUN sed -i '/<\/VirtualHost>/i \n Header always unset X-Frame-Options\n Header always set Content-Security-Policy "frame-ancestors \'self\' https://rapidleech-iframe-test.pages.dev"\n' /etc/apache2/sites-available/000-default.conf # Restart Apache to apply the configuration RUN service apache2 restart # Ensure the same configuration in the main apache2.conf for redundancy RUN echo '\n Header always unset X-Frame-Options\n Header always set Content-Security-Policy "frame-ancestors \'self\' https://rapidleech-iframe-test.pages.dev"\n' >> /etc/apache2/apache2.conf # Expose the new port EXPOSE 7860 # Restart Apache again to ensure all settings are applied CMD ["apache2-foreground"]