paivana-httpd.h (2473B)
1 /* 2 This file is part of GNUnet. 3 Copyright (C) 2026 Taler Systems SA 4 5 Paivana is free software; you can redistribute it and/or 6 modify it under the terms of the GNU General Public License 7 as published by the Free Software Foundation; either version 8 3, or (at your option) any later version. 9 10 Paivana is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty 12 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 13 the GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public 16 License along with Paivana; see the file COPYING. If not, 17 write to the Free Software Foundation, Inc., 51 Franklin 18 Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 */ 20 21 /** 22 * @author Christian Grothoff 23 * @file paivana-httpd.h 24 * 25 * @brief 26 */ 27 #ifndef PAIVANA_HTTPD_H 28 #define PAIVANA_HTTPD_H 29 30 #define PAIVANA_LOG_INFO(...) \ 31 GNUNET_log (GNUNET_ERROR_TYPE_INFO, __VA_ARGS__) 32 #define PAIVANA_LOG_DEBUG(...) \ 33 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__) 34 #define PAIVANA_LOG_WARNING(...) \ 35 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, __VA_ARGS__) 36 #define PAIVANA_LOG_ERROR(...) \ 37 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, __VA_ARGS__) 38 39 /** 40 * Destination to which HTTP server we forward requests to. 41 * Of the format "http://servername:PORT" 42 */ 43 extern char *PH_target_server_base_url; 44 45 /** 46 * Merchant backend base URL. 47 */ 48 extern char *PH_merchant_base_url; 49 50 /** 51 * Base URL of this site as seen by the client. If not set, 52 * we will try to determine it from "X-Forwarded-Host" and 53 * "Host" and "X-Forwarded-Port" headers. 54 */ 55 extern char *PH_base_url; 56 57 /** 58 * Curl context for making HTTP requests. 59 */ 60 extern struct GNUNET_CURL_Context *PH_ctx; 61 62 /** 63 * Disable paywall check. 64 */ 65 extern int PH_no_check; 66 67 /** 68 * Value to return from main() 69 */ 70 extern int PH_global_ret; 71 72 /** 73 * Our configuration. 74 */ 75 extern const struct GNUNET_CONFIGURATION_Handle *PH_cfg; 76 77 /** 78 * Maximum size (in bytes) of a request body that we will buffer 79 * before forwarding it upstream. Requests exceeding this are 80 * rejected with HTTP 413. Settable via the `-u` / `--max-upload` 81 * command-line option; defaults to 1 MiB. 82 */ 83 extern unsigned long long PH_request_buffer_max; 84 85 86 #endif