Commit Graph

150 Commits

Author SHA1 Message Date
Yonle
75e061a9f7 html.c & httpd.c: Fix hardlink.
Some people may still want to post in the web client with such different
way, Such as posting from Yggdrasil / SSH port forwarder, and so on.

This commit gives the workaround for that purpose, However things will
go messed up when current path were ends with / (Like: user/, admin/).

But overall, If user just uses it like normal, Then things will just
worked well as expected.

Signed-off-by: Yonle <yonle@lecturify.net>
2023-07-24 19:42:20 +07:00
default
d343b40ee5 Added HTTP caching to static data. 2023-07-02 11:11:01 +02:00
default
2f3ed55790 The WWW-Authenticate real also includes the user. 2023-06-24 08:29:29 +02:00
default
3da32bd327 Fixed missing end quote in the WWW-Authenticate header. 2023-06-24 08:07:46 +02:00
default
7eb80e9916 Renamed the HTTP Basic auth realm to something more informative. 2023-06-18 19:34:35 +02:00
default
8c91956947 Replace an sprintf() with an snprintf(). 2023-06-05 18:36:36 +02:00
default
65f5173c2a Moved srv_running variable to httpd.c. 2023-06-05 18:18:50 +02:00
default
efec8a6eae If sem_open() fails, try again with sem_init(). 2023-05-25 17:20:21 +02:00
default
970ad7a540 Got rid of xs_encdec.h. 2023-05-17 10:08:57 +02:00
default
a15ec49a1d Fixed conflict. 2023-05-09 17:22:31 +02:00
poesty
3bd83457d9 Fixed the issue of semaphore name conflicts. 2023-05-09 23:11:57 +08:00
default
920ff76297 Print the total running time at httpd stop. 2023-05-08 09:34:27 +02:00
default
6bad2355ef Moved sem_close() further to the end. 2023-05-08 09:17:00 +02:00
default
2824ba5be3 Added some includes needed for last sem_open() / uintptr_t changes. 2023-05-07 17:58:11 +02:00
Saagar Jha
e25960c548 Fix pointer-to-int cast
Resolves "warning: performing pointer subtraction with a null pointer
has undefined behavior [-Wnull-pointer-subtraction]"
2023-05-07 04:19:37 -07:00
Saagar Jha
578c94ba69 Use named semaphores
Unnamed semaphores are not supported on macOS.
2023-05-07 04:18:30 -07:00
default
185aac2387 Added -Wextra to C flags. 2023-05-04 09:28:36 +02:00
default
753eadfd17 Added some const here and there. 2023-05-04 09:25:09 +02:00
default
997b17d854 Moved JSON output validation to httpd.c. 2023-04-23 15:37:09 +02:00
default
8804227798 New function mastoapi_put_handler(). 2023-04-22 01:21:09 +02:00
default
526d4e8abb Added a new compilation variable NO_MASTODON_API.
The Mastodon API is a big and ugly beast; if you don't want
it in your snac, you can compile it out by running

make CFLAGS=-DNO_MASTODON_API

And your snac binary will be as slim as always.
2023-04-21 23:17:58 +02:00
default
bd539b8350 Replace %admin_email% in greeting.html. 2023-04-20 18:12:56 +02:00
default
c0a48f1f4e Added support for likes and boosts. 2023-04-11 21:07:47 +02:00
default
4ced03bac1 OAuth login now works. 2023-04-09 20:34:05 +02:00
default
4964a56456 More mastoapi work. 2023-04-08 09:09:43 +02:00
default
eba6987fd5 Added some OAuth scaffold code. 2023-04-08 07:04:40 +02:00
default
353e393f4d New file mastoapi.c. 2023-04-08 06:09:05 +02:00
default
14cbf124f9 More log level tweaks. 2023-04-04 10:40:22 +02:00
default
b2ce9323db Added the url to srv_archive(). 2023-03-02 17:13:17 +01:00
default
5036cb5e11 Connection jobs are treated as urgent. 2023-03-02 12:38:02 +01:00
default
60c50c02f6 Create sleep mutex and cond variable only once. 2023-02-22 10:35:26 +01:00
default
295507fd9e Close everything if xs_socket_accept() returns NULL. 2023-02-22 10:02:24 +01:00
default
3283536cfa Deleted useless code. 2023-02-22 09:31:18 +01:00
default
2bfebba7be Don't wait for 3 seconds if there were some q_items processed. 2023-02-22 08:39:54 +01:00
default
7e27ccfde8 Try to show a piece of the error after connecting. 2023-02-14 08:15:43 +01:00
default
28d1da0a81 Don't fail silently if the job fifo is not ready. 2023-02-11 06:28:36 +01:00
default
381129fb25 Move the #fds log line to dbglevel 0. 2023-02-10 13:53:12 +01:00
default
5f89816bb4 Show (dbglevel 1) the number of file descriptors available. 2023-02-10 13:45:26 +01:00
default
03325d04a5 Show the fd rlimit at httpd startup. 2023-02-10 13:39:17 +01:00
default
d4979d9403 Added more job_fifo concurrency protections. 2023-02-10 11:23:42 +01:00
default
3ba3815b64 Fixed 32bit arch warnings when passing the thread id. 2023-02-10 09:07:54 +01:00
default
090a28ba4e The number of threads can be forced from the config file. 2023-02-09 08:09:55 +01:00
default
09a4423efc Debug level tweaks. 2023-02-07 20:25:18 +01:00
default
3ddf76c2aa New function send_to_inbox_raw(). 2023-02-07 10:29:06 +01:00
default
b8b0b96cce Changed some debug levels. 2023-02-07 08:27:23 +01:00
default
b2d186cd0f The pool of threads now process q_items.
Also, the purge is commanded as a q_item.
2023-02-06 20:07:29 +01:00
default
b16ceafdde Identify the job threads by number. 2023-02-06 19:29:22 +01:00
default
8b465a586d Incoming connections are processed by the pool of threads. 2023-02-06 19:23:35 +01:00
default
451d964c0c More thread work. 2023-02-06 18:59:20 +01:00
default
06fc40e1cd Simplified job_post() and job_wait(). 2023-02-06 18:43:27 +01:00
default
6bcc6bfa1c New functions job_post() and job_wait() (untested). 2023-02-06 11:29:46 +01:00
default
66d974a0c6 Started work towards the pool of threads. 2023-02-06 10:53:29 +01:00
default
307e0aa27a Input connections cannot be non-threaded. 2023-02-06 08:44:00 +01:00
default
928f22fbba Email notifications have been moved to the global queue. 2023-02-02 05:21:16 +01:00
default
8d22c448d4 process_queue() has been renamed to process_user_queue(). 2023-02-02 04:50:51 +01:00
default
a3ed2408fc New function default_avatar_base64(). 2023-01-27 18:17:11 +01:00
default
a38c7aeadc Updated year in copyright notices. 2023-01-17 09:50:16 +01:00
default
bb0d8f2a27 Backport from xs. 2023-01-12 09:28:02 +01:00
default
a67a82d545 In server_get_handler(), body must be a dynamic string. 2022-12-13 15:40:59 +01:00
Alex Schroeder
63f02f45c6 Serve robots.txt (disallow all) 2022-12-12 22:11:07 +01:00
default
14a516b542 Call pthread_detach() and spawning the purge. 2022-12-10 17:15:26 +01:00
default
5c6d44cdbc Added support for /.well-known/nodeinfo. 2022-12-08 09:58:47 +01:00
Alex Schroeder
eda9e94086 Handle /favicon.ico
Reply with the susie.png.
2022-12-04 20:16:40 +01:00
default
afb970a757 purge_server() deletes using object_del(). 2022-11-26 05:05:57 +01:00
default
bc5b881c94 Serve the root and susie even if the query does not have an Accept header. 2022-11-18 19:44:43 +01:00
default
ec2d6bc4a4 Call pthread_detach(). 2022-11-09 16:09:12 +01:00
default
78b3a30447 Some code moving to avoid false positive leaks. 2022-10-25 13:59:15 +02:00
default
d2095105de Don't load unneeded actor info in html_entry(). 2022-10-24 20:06:02 +02:00
default
c7ff714710 New thread for purge. 2022-10-17 11:18:09 +02:00
default
395f80bdc4 Added support for HEAD methods.
Mastodon uses them when it founds an attachment.
2022-10-16 19:00:17 +02:00
default
c5070941cf Replace %host% in greeting.html. 2022-10-16 09:59:36 +02:00
default
bc417bb520 Add the user agent to httpd start log line. 2022-10-14 08:47:52 +02:00
default
8635c5df90 The waiting of the queue thread is done in a more appropriate way. 2022-10-13 15:56:19 +02:00
default
1e9d21147b Connections are now attended by threads. 2022-10-10 19:50:37 +02:00
default
95d0ce8382 Call xs_socket_accept() from httpd(). 2022-10-10 19:33:39 +02:00
default
8bb7582062 Implemented the helper thread. 2022-10-01 20:57:06 +02:00
default
80d1700f6a Added some signal control. 2022-09-29 12:50:50 +02:00
default
7ae3064210 Better coping with timeouts. 2022-09-28 16:27:53 +02:00
default
b2c8264003 Added dummy HTTP handlers for html. 2022-09-28 05:22:08 +02:00
default
94ef803701 Timeline pages are also served. 2022-09-27 19:00:24 +02:00
default
f1dbd8e700 New variable USER_AGENT. 2022-09-27 18:01:51 +02:00
default
4f3b70d997 More work in not_really_markdown(). 2022-09-27 10:51:57 +02:00
default
48a50770f4 Use xs_replace_i() in some places. 2022-09-27 10:20:33 +02:00
default
fd6f71bfe3 More work but signatures seem to still fail. 2022-09-26 11:19:45 +02:00
default
b070d2d8f8 The HTTP request headers are stored in a plain dict. 2022-09-25 07:42:57 +02:00
default
58de0798f2 New function srv_archive(). 2022-09-25 07:28:42 +02:00
default
c3e19f1650 Added some aechiving. 2022-09-24 12:22:17 +02:00
default
e9afd7cd13 More work. 2022-09-24 11:54:35 +02:00
default
6e6c315494 New function activitypub_get_handler(). 2022-09-23 20:59:19 +02:00
default
1d694a245a xs_httpd_request() also returns the payload. 2022-09-23 20:28:23 +02:00
default
02b0df78c6 server_get_handler() returns the status. 2022-09-23 17:44:02 +02:00
default
11134e58a3 webfinger_get_handler() returns the status. 2022-09-23 17:40:59 +02:00
default
595ded1fc7 httpd serves susie.png. 2022-09-22 17:55:59 +02:00
default
7a60c71744 Fixed memleak in greeting. 2022-09-22 17:44:23 +02:00
default
6e4294f8e8 Added a webfinger handler. 2022-09-21 21:12:49 +02:00
default
8df3d4ab5d Fix q_path. 2022-09-21 19:46:02 +02:00
default
9270a0077e Added a global server handler. 2022-09-21 19:28:30 +02:00
default
e7c886beb7 More httpd work. 2022-09-21 18:27:30 +02:00
default
7efb6d5833 New flag srv_running. 2022-09-21 18:13:11 +02:00
default
8e653d201f [httpd.c] new file. 2022-09-21 18:09:16 +02:00