Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
54e56f2
start response
Apr 13, 2025
d6f3893
handle not found response and not allowed methods
Apr 17, 2025
7838175
switch to constructor
Apr 20, 2025
f888452
work on the structure
Apr 21, 2025
cd2b114
rootPath added
Apr 21, 2025
16b7341
solve redirect issue
Apr 22, 2025
12a100a
::setBoundary added
Apr 22, 2025
60bbd46
open index files and get mimetypes
Apr 23, 2025
3861eaf
Content-Lenght::Bad request
Apr 23, 2025
5d41bdd
fix project on llinux
moadboujmaa Apr 24, 2025
8b917c2
tying autoindex
Apr 26, 2025
3e45b53
done with upload
May 5, 2025
b02879d
merged-with-achakkaf
May 7, 2025
034930a
delet comments
May 7, 2025
81663ee
rm std:: at getCurrentTimeMs
May 7, 2025
3816d79
fix Big buffer error
May 7, 2025
dade5ce
pull from otm brunch
May 7, 2025
c60f218
get response done
May 8, 2025
208feda
Error at events(socket)
May 8, 2025
ef272cd
no boundrey at the end of file, and no infinate loops
May 9, 2025
2a78532
Finally upload is working
May 9, 2025
85330ba
timeout::DONE
May 11, 2025
28ec1ec
Delete is working
May 12, 2025
80882cf
merge with otm branch
May 12, 2025
2f25f66
request method added
May 12, 2025
3175864
timeout infinite loop fixed
May 12, 2025
e9ec24a
Merged::with::Mboujama
May 12, 2025
737e12a
Error Fixed
May 13, 2025
bda9bf7
Merged with upload
May 14, 2025
4f4da5b
add allow header
May 14, 2025
f46321c
Merge branch 'otm' of github.com:flutterde/webserv into mboujama
May 14, 2025
f714739
add getters
May 14, 2025
8173d3c
some edits
May 14, 2025
c0daaf1
Merged with moad
May 14, 2025
5ae596f
prepareClientResponse added
May 14, 2025
77036d6
style header files
May 14, 2025
1124314
something comming..
May 14, 2025
354b36d
headers cleaned by achakkaf & merged with him
May 14, 2025
1c07ec4
add getHeadersString function
May 15, 2025
3508ffa
merged with moad
May 15, 2025
fb4e003
fix index fd bug
May 15, 2025
2cdc046
fix directory leaks
May 15, 2025
a550149
add contentLength, and clear leaks
May 15, 2025
c747501
start working on send resp
May 15, 2025
1560bca
response sent successfully
May 17, 2025
8795cdc
improvements added
May 18, 2025
8aef430
fixed in linux
flutterde May 18, 2025
0df2474
add try/catch atWebserv::prepareClientResponse
May 19, 2025
17017b3
put all variable that cgi need in env
May 19, 2025
958d94b
merge with otm
May 20, 2025
417257b
clean
May 21, 2025
f83c837
fix content-length
moadboujmaa May 21, 2025
6832362
changes at configs
May 21, 2025
492ccd5
working on file upload
May 21, 2025
b7c85c4
CORS origin fixed
May 21, 2025
e0db94c
upload files in the right place
May 21, 2025
8968ad6
fsanitize
May 21, 2025
c392a97
Merge branch 'otm' of github.com:flutterde/webserv into otm
May 21, 2025
2e11e4b
comments cleanned
May 21, 2025
a711cdd
adding multiple CGIs but not tested
May 21, 2025
aa48313
merge
May 22, 2025
24a138f
more comment cleanned
May 22, 2025
af32f2d
extra edits
May 23, 2025
ffa20cd
fix query and remove system env
May 24, 2025
0134edd
otm stop point
May 24, 2025
8b6925c
redirected the body to stdin of cgi
May 24, 2025
c2a4d9f
remove \r from the end of values
May 24, 2025
b8d6bb3
solve cookie issue
May 25, 2025
7d73468
Merge branch 'mboujama' of github.com:flutterde/webserv into mboujama
May 25, 2025
2bd4952
solve cookie issue
May 25, 2025
95fe23d
multiple CGI in response
May 25, 2025
0bf4fd1
CGI, website fixed
May 25, 2025
6836cce
merged with moad
May 25, 2025
9a57231
php-cgi not working
May 25, 2025
b8ee90e
debuging
May 25, 2025
151083b
enable upload & CGI failed
May 26, 2025
789ccb0
File without extension fixed
May 26, 2025
f3e3d7a
save point 2025/05/26-15:01:22
May 26, 2025
251ca1c
Everything Cleanned,
May 26, 2025
6d3169d
More cleanning..
May 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ jobs:

- name: Run make
run: make
- name: Run tests
run: make tests

24 changes: 19 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
# Prerequisites
*.d

labs/myfld/*




test/runner
labs/intern/


ts.txt
# Compiled Object files
*.slo
*.lo
*.o
*.obj
*.p
*.mp4

./configs/php/app
configs/php/app
# Precompiled Headers
*.gch
*.pch
labs/app
mmm/
var/tmp/*
var/www/html/main/uploads/*
*.log
ts.html
otm.cpp
*.otm
# Compiled Dynamic libraries
*.so
*.dylib
*.dll

*.zip
uploadtestfile.txt
uploadtestfile.cpp
.DS_Store
# Fortran module files
*.mod
*.smod
Expand All @@ -44,3 +54,7 @@ testing/
*.exe
*.out
*.app
.DS_Store


test*
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
CPP = c++
CPPFLAGS = -Wall -Wextra -Werror -std=c++98 -I./headers/ #-fsanitize=address
CPPFLAGS = -Wall -Wextra -Werror -std=c++98 -I./headers/

NAME=webserv

# OTM
SRCS=main.cpp srcs/parsing/config/readConfig.cpp srcs/parsing/helpers/strTrim.cpp \
srcs/parsing/helpers/FtPars.cpp srcs/models/Server.cpp debug/printing.cpp
srcs/parsing/helpers/FtPars.cpp srcs/models/Server.cpp \
srcs/utils/httpResponseErrors.cpp srcs/utils/serverUtils.cpp srcs/utils/ClientData.cpp \

# ACHAKKAF
SRCS += srcs/cgi/ft_cgi.cpp
SRCS += srcs/models/Upload.cpp srcs/models/Request.cpp

# MOAD
SRCS +=
SRCS += srcs/models/Response.cpp srcs/models/ResponseUtils.cpp srcs/models/MimeTypes.cpp srcs/models/Cgi.cpp

#OTM
SRCS += srcs/models/Webserv.cpp srcs/models/WebservHandler.cpp

HEADERS=headers/*.hpp
OBJS=$(SRCS:.cpp=.o)

all: $(NAME)
mkdir -p ./var/tmp

$(NAME): $(OBJS)
$(CPP) $(CPPFLAGS) $(OBJS) -o $(NAME)
Expand All @@ -32,8 +30,7 @@ clean:

fclean: clean
rm -f $(NAME)
tests:
bash test/test01.sh


re: fclean all

Expand Down
14 changes: 0 additions & 14 deletions configs/500.html

This file was deleted.

100 changes: 30 additions & 70 deletions configs/config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,51 @@
# Server 1: Default server
###############################################################################
[server.default]
# required
host = "127.0.0.1"
port = "8080,5555"
# required
port = "8080,7070"
# optional
server_name = "myserver.local"
client_max_body_size = "1048576"

# Default error pages
error_page_404 = "/errors/404.html"
error_page_500 = "/errors/500.html"

# Route 1 (for path "/")
# location_path = "/" //!
location_root = "/var/www/html"
# location_redirect = "/xyz/index.html"
# optional
client_max_body_size = "40000000000"
# Timeouts IN SECONDS
# optional
client_timeout = "555"
# optional
# redirects = "/index.html:/page.html"
# optional
client_body_temp_path= "var/tmp"

# location_root required
location_root = "var/www/html/main"
# required
indexes = "index.html,index.php,index.py"
allowed_methods = "POST,DELETE,GET"
autoindex = "off"
# upload_enabled = "on"
upload_store = "/var/www/uploads"


# Route 3 (for path "/scripts")
location3_path = "./scripts/php/"
location3_root = "/var/www/cgi-bin"
location3_cgi_enable = ".php,.py"
location3_cgi_path_info = "on"
autoindex = "on"
upload_enabled = "on"
upload_store = "var/www/html/main/uploads/"
cgi = "/bin/bash:.sh"


###############################################################################
# Server 2
###############################################################################
[server.second]
host = "127.0.0.1"
port = "9090"
server_name = "another-server.local"

# Error page for this server
error_page_403 = "/errors/403.html"

# Route (for path "/static")
location1_path = "/static"
location1_root = "/var/www/static"
allowed_methods = "GET"
autoindex = "on"
port = "9000"
server_name = "second.local"
location_root = "var/www/html/magic"
indexes = "index.html,index.php,index.py"


###############################################################################
# Server 3
###############################################################################
[server.third]
host = "192.168.1.1"
port = "8081"
server_name = "third-server.local"
client_max_body_size = "2097152"

# Error pages
error_page_400 = "/errors/400.html"
error_page_500 = "/errors/500.html"

# Route (for path "/")
location1_path = "/"
location1_root = "/var/www/app"
indexes = "home.html"
allowed_methods = "GET,POST"
autoindex = "off"
location1_upload_enabled = "off"


###############################################################################
# Server 4
###############################################################################
[server.fourth]
host = "10.0.0.1"
port = "4444,7070"
server_name = "fourth-server.local"
client_max_body_size = "5242880"

# Error pages
error_page_403 = "/errors/403.html"
error_page_502 = "/errors/502.html"
host = "0.0.0.0"
port = "9999"
server_name = "second.local"
location_root = "var/www/html/simple"
indexes = "index.html,index.php,index.py"

# Route (for path "/")
location1_path = "/"
location1_root = "/var/www/public"
indexes = "default.html"
allowed_methods = "GET,POST,DELETE"
autoindex = "on"
location1_upload_enabled = "on"
location1_upload_store = "/var/www/public/uploads"
4 changes: 0 additions & 4 deletions configs/php/Makefile

This file was deleted.

65 changes: 0 additions & 65 deletions configs/php/app.cpp

This file was deleted.

23 changes: 0 additions & 23 deletions configs/php/index.php

This file was deleted.

Empty file removed configs/py/index.py
Empty file.
Loading