.ctdl-grid-banner-item { /* These grid items will be referenced in the grid container */
grid-area: header;
- background-color: #282a35;
+ background-color: DarkSlateGrey;
}
.ctdl-grid-navbar-item {
grid-area: menu;
- background-color: ghostwhite;
+ background-color: GhostWhite;
}
.ctdl-grid-main-item {
'header header'
'menu main';
gap: 3px;
- background-color: #456789; /* This is the color of the lines between the boxes, and also the boxes themselves if not overridden */
- padding: 0; /* This is the border around the edges of the screen */
+ background-color: DarkSlateGrey; /* This is the color of the lines between the boxes, and also the boxes themselves if not overridden */
+ padding: 0; /* This is the border around the edges of the screen */
width: 100vw;
height: 100vh;
}
float: left;
display: block;
padding: 8px;
- background-color: #282a35;
- color: white;
+ background-color: DarkSlateGrey;
+ color: White;
font-size: 1.25vw;
}
.ctdl-banner-buttons li:hover { /* Buttons that appear in the top banner also reference this class when hovered over */
- background-color: black;
+ background-color: Black;
}
.ctdl-banner-buttons a {
- color: white;
+ color: White;
}
html,body,h1,h2,h3,h4,h5 {
transform: translate(-50%, -50%);
border-style: outset;
border-width: 3px;
- border-color: black;
+ border-color: Black;
justify-content: center;
align-items: center;
padding: 10px;
padding: 10px;
text-align: left;
border-color: GhostWhite;
- background-color: #GhostWhite;;
+ background-color: GhostWhite;
color: #000000;
font-size: 1vw;
}
.ctdl-sidebar-class button:hover {
- background-color: #ffffff;
+ background-color: White;
}
.ctdl-grid-banner-item button {
.ctdl-fmsg-wrapper { /* message wrapper for forum view */
overflow: hidden;
border-radius: 10px;
- background-color: white;
+ background-color: White;
margin: 1vw;
padding: 5px; /* inside the box */
}
.ctdl-mmsg-wrapper { /* message wrapper for mailbox view */
overflow: hidden;
- background-color: white;
+ background-color: White;
padding: 5px; /* inside the box */
border-style: solid; /* could also be: dotted, dashed, solid, double, groove, ridge, inset, outset, none, hidden */
border-width: 1px;
.ctdl-msg-button {
margin-left: 2px;
border-radius: 5px;
- background-color: blue;
- color: black;
+ background-color: Blue;
+ color: Black;
padding: 2px;
background-color: GhostWhite;
border-style: solid;
border-width: thin;
- border-color: black;
+ border-color: Black;
}
.ctdl-msg-button a {
- color: black;
+ color: Black;
}
.ctdl-msg-button:hover {
}
.ctdl-msg-button a:hover {
- color: white;
+ color: White;
}
blockquote {
background-color: #f5f5f5 !important;
- color: navy !important;
+ color: Navy !important;
margin-bottom: 0px;
padding-bottom: 0px;
}
blockquote blockquote {
background-color: #ebebeb !important;
- color: maroon !important;
+ color: Maroon !important;
}
blockquote blockquote blockquote {
background-color: #e1e1e1 !important;
- color: green !important;
+ color: Green !important;
}
blockquote blockquote blockquote blockquote {
background-color: #d7d7d7 !important;
- color: purple !important;
+ color: Purple !important;
}
blockquote blockquote blockquote blockquote blockquote {
background-color: #cdcdcd !important;
- color: teal !important;
+ color: Teal !important;
}
blockquote pre {
.ctdl-roomlist-room {
overflow: hidden;
border-radius: 10px;
- background-color: white;
+ background-color: White;
padding: 0.5vw;
margin-bottom: 0.5vw;
width: 100%;
background-color: #DDDDDD;
}
+.ctdl-mailbox-table {
+ width: 100%;
+ background-color: GhostWhite;
+ border-collapse: collapse;
+}
+
+.ctdl-mailbox-table tr {
+ border-top: 1px solid red;
+ border-bottom: 1px solid red;
+}
+
.ctdl-mailbox-heading {
position: sticky;
top: 0;
background-color: #CCCCCC;
}
+
.ctdl-mailbox-reading-pane { /* message reading pane when in mailbox view */
height: 80vw;
overflow-x: hidden;
+++ /dev/null
-// Functions in this module handle SSL encryption when WebCit is running
-// as an HTTPS server.
-//
-// Copyright (c) 1996-2022 by the citadel.org team
-//
-// This program is open source software. Use, duplication, or
-// disclosure are subject to the GNU General Public License v3.
-
-#include "webcit.h"
-
-SSL_CTX *ssl_ctx; // global SSL context
-char key_file[PATH_MAX] = "";
-char cert_file[PATH_MAX] = "";
-char *ssl_cipher_list = DEFAULT_SSL_CIPHER_LIST;
-
-
-// Set the private key and certificate chain for the global SSL Context.
-// This is called during initialization, and can be called again later if the certificate changes.
-void bind_to_key_and_certificate(void)
-{
- SSL_CTX *old_ctx, *new_ctx;
-
- if (!(new_ctx = SSL_CTX_new(SSLv23_server_method()))) {
- syslog(LOG_WARNING, "SSL_CTX_new failed: %s",
- ERR_reason_error_string(ERR_get_error()));
- return;
- }
-
- syslog(LOG_INFO, "Requesting cipher list: %s", ssl_cipher_list);
- if (!(SSL_CTX_set_cipher_list(new_ctx, ssl_cipher_list))) {
- syslog(LOG_WARNING, "SSL_CTX_set_cipher_list failed: %s",
- ERR_reason_error_string(ERR_get_error()));
- return;
- }
-
- if (IsEmptyStr(key_file)) {
- snprintf(key_file, sizeof key_file, "%s/keys/citadel.key",
- ctdl_dir);
- }
- if (IsEmptyStr(cert_file)) {
- snprintf(cert_file, sizeof key_file, "%s/keys/citadel.cer",
- ctdl_dir);
- }
-
- syslog(LOG_DEBUG,
- "crypto: [re]installing key \"%s\" and certificate \"%s\"",
- key_file, cert_file);
-
- SSL_CTX_use_certificate_chain_file(new_ctx, cert_file);
- SSL_CTX_use_PrivateKey_file(new_ctx, key_file, SSL_FILETYPE_PEM);
-
- if (!SSL_CTX_check_private_key(new_ctx)) {
- syslog(LOG_WARNING,
- "crypto: cannot install certificate: %s",
- ERR_reason_error_string(ERR_get_error()));
- }
-
- old_ctx = ssl_ctx;
- ssl_ctx = new_ctx;
- sleep(1);
- SSL_CTX_free(old_ctx);
-}
-
-
-// Initialize ssl engine, load certs and initialize openssl internals
-void init_ssl(void)
-{
-
- // Initialize the OpenSSL library
- SSL_load_error_strings();
- ERR_load_crypto_strings();
- OpenSSL_add_all_algorithms();
- SSL_library_init();
-
- // Now try to bind to the key and certificate.
- bind_to_key_and_certificate();
-}
-
-
-// Check the modification time of the key and certificate -- reload if they changed
-void update_key_and_cert_if_needed(void)
-{
- static time_t previous_mtime = 0;
- struct stat keystat;
- struct stat certstat;
-
- if (stat(key_file, &keystat) != 0) {
- syslog(LOG_ERR, "%s: %s", key_file, strerror(errno));
- return;
- }
- if (stat(cert_file, &certstat) != 0) {
- syslog(LOG_ERR, "%s: %s", cert_file, strerror(errno));
- return;
- }
-
- if ((keystat.st_mtime + certstat.st_mtime) != previous_mtime) {
- bind_to_key_and_certificate();
- previous_mtime = keystat.st_mtime + certstat.st_mtime;
- }
-}
-
-
-// starts SSL/TLS encryption for the current session.
-void starttls(struct client_handle *ch)
-{
- int retval, bits, alg_bits;
-
- if (!ssl_ctx) {
- return;
- }
- // Check the modification time of the key and certificate -- reload if they changed
- update_key_and_cert_if_needed();
-
- if (!(ch->ssl_handle = SSL_new(ssl_ctx))) {
- syslog(LOG_WARNING, "SSL_new failed: %s",
- ERR_reason_error_string(ERR_get_error()));
- return;
- }
- if (!(SSL_set_fd(ch->ssl_handle, ch->sock))) {
- syslog(LOG_WARNING, "SSL_set_fd failed: %s",
- ERR_reason_error_string(ERR_get_error()));
- SSL_free(ch->ssl_handle);
- return;
- }
- retval = SSL_accept(ch->ssl_handle);
- if (retval < 1) {
- syslog(LOG_WARNING, "SSL_accept failed: %s",
- ERR_reason_error_string(ERR_get_error()));
- } else {
- syslog(LOG_INFO, "SSL_accept success");
- }
- bits =
- SSL_CIPHER_get_bits(SSL_get_current_cipher(ch->ssl_handle),
- &alg_bits);
- syslog(LOG_INFO, "SSL/TLS using %s on %s (%d of %d bits)",
- SSL_CIPHER_get_name(SSL_get_current_cipher(ch->ssl_handle)),
- SSL_CIPHER_get_version(SSL_get_current_cipher
- (ch->ssl_handle)), bits, alg_bits);
- syslog(LOG_INFO, "SSL started");
-}
-
-
-// shuts down the TLS connection
-void endtls(struct client_handle *ch)
-{
- syslog(LOG_INFO, "Ending SSL/TLS");
- if (ch->ssl_handle != NULL) {
- SSL_shutdown(ch->ssl_handle);
- SSL_get_SSL_CTX(ch->ssl_handle);
- SSL_free(ch->ssl_handle);
- }
- ch->ssl_handle = NULL;
-}
-
-
-// Send binary data to the client encrypted.
-int client_write_ssl(struct client_handle *ch, char *buf, int nbytes)
-{
- int retval;
- int nremain;
- char junk[1];
-
- if (ch->ssl_handle == NULL)
- return (-1);
-
- nremain = nbytes;
- while (nremain > 0) {
- if (SSL_want_write(ch->ssl_handle)) {
- if ((SSL_read(ch->ssl_handle, junk, 0)) < 1) {
- syslog(LOG_WARNING,
- "SSL_read in client_write: %s",
- ERR_reason_error_string
- (ERR_get_error()));
- }
- }
- retval =
- SSL_write(ch->ssl_handle, &buf[nbytes - nremain],
- nremain);
- if (retval < 1) {
- long errval;
-
- errval = SSL_get_error(ch->ssl_handle, retval);
- if (errval == SSL_ERROR_WANT_READ
- || errval == SSL_ERROR_WANT_WRITE) {
- sleep(1);
- continue;
- }
- syslog(LOG_WARNING, "SSL_write: %s",
- ERR_reason_error_string(ERR_get_error()));
- if (retval == -1) {
- syslog(LOG_WARNING, "errno is %d", errno);
- endtls(ch);
- }
- return -1;
- }
- nremain -= retval;
- }
- return 0;
-}
-
-
-// read data from the encrypted layer
-int client_read_ssl(struct client_handle *ch, char *buf, int nbytes)
-{
- int bytes_read = 0;
- int rlen = 0;
- char junk[1];
-
- if (ch->ssl_handle == NULL)
- return (-1);
-
- while (bytes_read < nbytes) {
- if (SSL_want_read(ch->ssl_handle)) {
- if ((SSL_write(ch->ssl_handle, junk, 0)) < 1) {
- syslog(LOG_WARNING,
- "SSL_write in client_read");
- }
- }
- rlen =
- SSL_read(ch->ssl_handle, &buf[bytes_read],
- nbytes - bytes_read);
- if (rlen < 1) {
- long errval;
- errval = SSL_get_error(ch->ssl_handle, rlen);
- if (errval == SSL_ERROR_WANT_READ
- || errval == SSL_ERROR_WANT_WRITE) {
- sleep(1);
- continue;
- }
- syslog(LOG_WARNING, "SSL_read error %ld", errval);
- endtls(ch);
- return (-1);
- }
- bytes_read += rlen;
- }
- return (bytes_read);
-}