Added docker support
This commit is contained in:
+2
-2
@@ -94,11 +94,11 @@ void ServerUtils::process_request(const int client_fd) {
|
||||
}
|
||||
|
||||
else if (url == "/favicon.png") {
|
||||
send_image(client_fd, "/home/skingging/Documents/Projects/CPP/AI-Tarpit-Reimagined/a.png", PNG);
|
||||
send_image(client_fd, options_.favicon, PNG);
|
||||
}
|
||||
|
||||
else if (WordUtils::contains_image(url)) {
|
||||
string p = "/home/skingging/Documents/Projects/CPP/AI-Tarpit-Reimagined/content/images/";
|
||||
string p = options_.images;
|
||||
p += WordUtils::extract_image_name(url);
|
||||
send_image(client_fd, p, AVIF);
|
||||
}
|
||||
|
||||
+11
-9
@@ -14,34 +14,36 @@ using namespace std;
|
||||
int main(const int argc, const char* argv[]) {
|
||||
Options options;
|
||||
|
||||
if (argc > 4)
|
||||
{
|
||||
if (argc > 5) {
|
||||
cout << "Too many arguments";
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!FileUtils::fileExists(argv[1]))
|
||||
{
|
||||
if (!FileUtils::fileExists(argv[1])) {
|
||||
cout << "Filepath: " << argv[1] << " doesn't exist.";
|
||||
return 0;
|
||||
}
|
||||
options.word_lists = argv[1];
|
||||
|
||||
if (!FileUtils::fileExists(argv[2]))
|
||||
{
|
||||
if (!FileUtils::fileExists(argv[2])) {
|
||||
cout << "Filepath: " << argv[2] << " doesn't exist.";
|
||||
return 0;
|
||||
}
|
||||
options.css = argv[2];
|
||||
|
||||
if (!FileUtils::fileExists(argv[3]))
|
||||
{
|
||||
if (!FileUtils::fileExists(argv[3])) {
|
||||
cout << "Filepath: " << argv[3] << " doesn't exist.";
|
||||
return 0;
|
||||
}
|
||||
options.images = argv[3];
|
||||
|
||||
cout << options.word_lists << " " << options.css << " " << options.images << " " << endl;
|
||||
if (!FileUtils::fileExists(argv[4])) {
|
||||
cout << "Filepath: " << argv[4] << " doesn't exist.";
|
||||
return 0;
|
||||
}
|
||||
options.favicon = argv[4];
|
||||
|
||||
//cout << options.word_lists << " " << options.css << " " << options.images << " " << endl;
|
||||
|
||||
auto queue = make_shared<ConcurrentQueue<Track>>();
|
||||
auto metrics = make_shared<unordered_map<uint32_t, Crawler>>();
|
||||
|
||||
Reference in New Issue
Block a user