mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-05-10 16:18:47 +02:00
「🏗️」 wip: Started reading subject
This commit is contained in:
5
.clang-format
Normal file
5
.clang-format
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
UseTab: Always
|
||||||
|
IndentWidth: 4
|
||||||
|
TabWidth: 4
|
||||||
|
AlignConsecutiveDeclarations: true
|
||||||
|
ConstructorInitializerIndentWidth: 4
|
@ -1,21 +1,37 @@
|
|||||||
[server]
|
[server]
|
||||||
server_names = { "localhost", "2B5.local" } # can be a array or a str
|
server_names = { "localhost", "2B5.local" }
|
||||||
port = { 8080, 8090 } # can be a array or a int
|
host = "localhost"
|
||||||
|
port = 8080
|
||||||
|
|
||||||
root = "/nfs/adjoly/workspace/kanel.ovh"
|
root = "/var/www/html"
|
||||||
max_post_size = "10M"
|
methods = { "GET", "POST", "DELETE" }
|
||||||
|
|
||||||
cookies = true
|
dirlist = false
|
||||||
uploads = false
|
uploads = false
|
||||||
dirlist = true
|
cookies = false
|
||||||
|
|
||||||
methods = {"GET", "POST", "DELETE"}
|
cgi_path = "/bin/php"
|
||||||
index = "index.html"
|
cgi_ext = ".php"
|
||||||
|
|
||||||
[server.error_page]
|
client_max_body_size = "10M"
|
||||||
|
|
||||||
|
[server.error_pages]
|
||||||
404 = "not_found.html"
|
404 = "not_found.html"
|
||||||
401 = "unauthorized.html"
|
401 = "unauthorized.html"
|
||||||
402 = "uwu.html"
|
402 = "uwu.html"
|
||||||
|
|
||||||
[server.cgi]
|
[server.location./]
|
||||||
py = "/usr/bin/python3"
|
methods = { "GET" }
|
||||||
|
root = "/var/www/html"
|
||||||
|
dirlist = true
|
||||||
|
|
||||||
|
[server.location./api]
|
||||||
|
methods = { "GET", "POST" }
|
||||||
|
uploads = true
|
||||||
|
root = "/var/www/api"
|
||||||
|
upload_path = "/etc/webserv/up"
|
||||||
|
cgi_path = "/bin/go"
|
||||||
|
cgi_ext = ".go"
|
||||||
|
|
||||||
|
[server.location./redir]
|
||||||
|
redirect = "https://kanel.ovh"
|
||||||
|
25
includes/config/AConfig.hpp
Normal file
25
includes/config/AConfig.hpp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* AConfig.hpp :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/03/19 14:11:28 by adjoly #+# #+# */
|
||||||
|
/* Updated: 2025/03/19 14:27:56 by adjoly ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class AConfig {
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
std::vector<std::string> serverNames;
|
||||||
|
std::map<std::string, std::string> cgi;
|
||||||
|
};
|
15
includes/config/ARoute.hpp
Normal file
15
includes/config/ARoute.hpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ARoute.hpp :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/03/19 14:59:41 by adjoly #+# #+# */
|
||||||
|
/* Updated: 2025/03/19 15:52:16 by adjoly ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
class Route {
|
||||||
|
|
||||||
|
};
|
22
includes/config/ParsedConfig.hpp
Normal file
22
includes/config/ParsedConfig.hpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ParsedConfig.hpp :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/03/19 14:11:28 by adjoly #+# #+# */
|
||||||
|
/* Updated: 2025/03/19 15:52:16 by adjoly ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
class config {
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
std::map cgi;
|
||||||
|
|
||||||
|
};
|
32
includes/config/Route.hpp
Normal file
32
includes/config/Route.hpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* Route.hpp :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/03/19 14:59:41 by adjoly #+# #+# */
|
||||||
|
/* Updated: 2025/03/19 15:52:16 by adjoly ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace webserv {
|
||||||
|
namespace config {
|
||||||
|
|
||||||
|
struct cgi {
|
||||||
|
std::string path;
|
||||||
|
std::string ext;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Route {
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace config
|
||||||
|
} // namespace webserv
|
16
includes/config/default.hpp
Normal file
16
includes/config/default.hpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* default.hpp :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/03/19 14:15:51 by adjoly #+# #+# */
|
||||||
|
/* Updated: 2025/03/19 14:16:39 by adjoly ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <tomlpp.hpp>
|
||||||
|
#include "Config.hpp"
|
Submodule lib/tomlpp updated: 0b512825bc...d81ec4a0ba
@ -6,8 +6,10 @@
|
|||||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/02/03 15:45:07 by mmoussou #+# #+# */
|
/* Created: 2025/02/03 15:45:07 by mmoussou #+# #+# */
|
||||||
/* Updated: 2025/03/19 14:00:51 by adjoly ### ########.fr */
|
/* Updated: 2025/03/19 15:52:16 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include <tomlpp.hpp>
|
#include <tomlpp.hpp>
|
||||||
|
|
||||||
|
int main(int, char **) { return 0; }
|
||||||
|
Reference in New Issue
Block a user