Prosody config file

--BEGINS AT LINE 106 BOSCH GLOBAL


-- Prosody Example Configuration File
--
-- Information on configuring Prosody can be found on our
-- website at https://prosody.im/doc/configure
--
-- Tip: You can check that the syntax of this file is correct
-- when you have finished by running this command:
-- prosodyctl check config
-- If there are any errors, it will let you know what and where
-- they are, otherwise it will keep quiet.
--
-- The only thing left to do is rename this file to remove the .dist ending, and fill in the
-- blanks. Good luck, and happy Jabbering!
-----------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
--Important Prosody/Nginx/PostreSQL paths

--# path to Nginx prosody config file:
-- nano /etc/nginx/conf.d/prosody.conf

--2.10.21 edited this config file according to
--https://prosody.im/doc/setting_up_bosh
--# path to Nginx config
--nano /etc/nginx/nginx.conf



--# make cert
--sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email paracom@protonmail.com -d upload.casp3r.net

-------------------------------------------------------------------------------------------------
--#########################################################
------------------------------------------------------------------------
--links
--////////////////////////////////////////////////////////////////////////////////////////////////////////////////CPY
--### how I set up this server ###--

--# How to Set Up Prosody XMPP Server on Ubuntu 20.04
--https://www.linuxbabe.com/ubuntu/install-configure-prosody-xmpp-server-ubuntu-20-04

--# postgresql install tutorial
--https://blog.vucica.net/2016/05/migrating-prosody-from-text-store-to-postgresql.html

--### end ###--


--## other resources:

--# mod_http_upload_external
--https://modules.prosody.im/mod_http_upload_external.html

--# mod_http_upload
--https://modules.prosody.im/mod_http_upload

--# mod_http_files
--https://prosody.im/doc/modules/mod_http_files --/////////////////////////////////////////////////////////////////CPY

--# Http File Upload Explained.
--https://www.blikoontech.com/tutorials/sending-and-receiving-files-with-xmpp-http-file-upload-explained

--# Prosody Modules
--https://prosody.im/doc/modules

--# Port and network configuration
--https://prosody.im/doc/ports

--# DNS configuration in Jabber/XMPP
--https://prosody.im/doc/dns

--# Components in Prosody
--https://prosody.im/doc/components

--# Configuring Prosody
--https://prosody.im/doc/configure

--# --/////////////////////////////////////////////////////////////////////////////////////////////////////////////CPY
--

--#
--

--# DNS No-Ip
--https://www.noip.com/members/dns/txt.php?host_id=76663090

--# Installing modules
--https://prosody.im/doc/installing_modules#prosody-modules

--# Prosody HTTP server
--https://prosody.im/doc/http

--#
--

--#
--
--/////////////////////////////////////////////////////////////////////////////////////////////////////////////CPY

--#
--

--#
--

-------------------------------------------------------------------------------------------------
----------------------------------------------GLOBAL SETTINGS!!!---------------------------------------
--------------------------------------- ---------------------------------
------------------------------------------ Server-wide settings -----------------------------------
---------------------------------------------------------------------------------------------
-- Settings in this section apply to the whole server and are the default settings
-- for any virtual hosts
------------------------------------------------------------------------------------------


--GLOBAL---------------------------Bosch Global sttings -----------------------------------------

--Prosody contains a mini built-in HTTP server, which is used for BOSH and other modules.--//////////////////CPY

--Documentation:
--Configurations in Nginx--https://prosody.im/doc/setting_up_bosh
--Continued in Prosody--https://prosody.im/doc/http

--cross_domain_bosh = true
--consider_bosh_secure = true
consider_bosh_secure = true;
cross_domain_bosh = true;
https_ssl = {

certificate = "/etc/letsencrypt/live/upload.casp3r.net/fullchain.pem";

key = "/etc/letsencrypt/live/upload.casp3r.net/privkey.pem";

}


--GLOBAL-------------------HTTP SERVER BOSCH SIBLING CODE-------------------------///////////////////////CPY

--https://prosody.im/doc/http


http_ports = { 5280 }
http_interfaces = {"*", "::" }

https_ports = { 5281 }
https_interfaces = {"*", "::"}
---------------------------------------
http_paths = {
bosh = "/http-bind"; -- Serve BOSH at /http-bind
files = "/"; -- Serve files from the base URL
}
-----------------------------------------



--GLOBAL---------------------ADMINS (-on virtual hosts-)--------------------------------------------------////////////CPY


-- This is a (by default, empty) list of accounts that are admins
-- for the server. Note that you must create the accounts separately
-- (see https://prosody.im/doc/creating_accounts for info)
-- Example: admins = { "user1@example.com", "user2@example.net" }
admins = {"tom@casp3r.net","casp3r2@casp3r.net","casp3r@casp3r.net" }




--GLOBAL-----------------------------------_LIB EVENT DECLARATION_-------------------------------------------------------


-- Enable use of libevent for better performance under high load
-- For more information see: https://prosody.im/doc/libevent
use_libevent = true ---LP


--GLOBAL------------------------------------------PLUGINS PATH-----------------------------------------

-- Prosody will always look in its source directory for modules, but --///////////////////////////////////////////////CPY
-- this option allows you to specify additional locations where Prosody
-- will look for modules first. For community modules, see https://modules.prosody.im/


-- For a local administrator it's common to place local modifications
-- under /usr/local/ hierarchy:

plugin_paths = { "/usr/local/lib/prosody/modules" }


--------------------------------------------------------------------------------------------------------
--GLOBAL--------------------------------MODULES ENABLED DECLARATIONS-----------------------------------------


-- This is the list of modules Prosody will load on startup.
-- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too.
-- Documentation for bundled modules can be found at: https://prosody.im/doc/modules

modules_enabled = {
--///////////////////////////////////////////////////////////////////////////////////////////////////////////////////CPY
-- Generally required
"roster"; -- Allow users to have a roster. Recommended ;)
"saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
"tls"; -- Add support for secure TLS on c2s/s2s connections
"dialback"; -- s2s dialback support
"disco"; -- Service discovery

-- Not essential, but recommended
"carbons"; -- Keep multiple clients in sync
"pep"; -- Enables users to publish their avatar, mood, activity, playing music and more
"private"; -- Private XML storage (for room bookmarks, etc.)
"blocklist"; -- Allow users to block communications with other users
"vcard4"; -- User profiles (stored in PEP)
"vcard_legacy"; -- Conversion between legacy vCard and PEP Avatar, vcard

-- Nice to have
"version"; -- Replies to server version requests
"uptime"; -- Report how long server has been running
"time"; -- Let others know the time here on this server
"ping"; -- Replies to XMPP pings with pongs --//////////////////////////////////////////////////////CPY
"register"; -- Allow users to register on this server using a client and change passwords
"mam"; --LP-- Store messages in an archive and allow users to access it
"csi_simple"; --LP-- Simple Mobile optimizations

-- Admin interfaces
"admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands
"admin_telnet"; --LP-- Opens telnet console interface on localhost port 5582

-- HTTP modules
"bosh"; --LP-- Enable BOSH clients, aka "Jabber over HTTP"
"websocket"; --LP-- XMPP over WebSockets
"http_files"; --LP-- Serve static files from a directory over HTTP
"http";--HTTP #1--LP

-- Other specific functionality
"posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
--"limits"; -- Enable bandwidth limiting for XMPP connections
"groups"; --LP-- Shared roster support
--"server_contact_info"; -- Publish contact information for this service
"announce"; --LP-- Send announcement to all online users--//////////////////////////////////////CPY

"welcome"; --LP-- Welcome users who register accounts
"watchregistrations"; --LP-- Alert admins of registrations
"motd"; --LP-- Send a message to users when they log in
"legacyauth"; --LP--- Legacy authentication. Only used by some old clients and bots.
"proxy65"; --LP-- Enables a file transfer proxy service which clients behind NAT can use
}

--GLOBAL--------------------------------------MODULES DISABLED------------------------------------------------------

-- These modules are auto-loaded, but should you want
-- to disable them then uncomment them here:
modules_disabled = {
-- "offline"; -- Store offline messages
--"c2s"; -- Handle client connections
-- "s2s"; -- Handle server-to-server connections
}


--GLOBAL----------------------------------------ACCOUNT CREATION----------------------------------------------////CPY

-- Disable account creation by default, for security
-- For more information see https://prosody.im/doc/creating_accounts
allow_registration = true
minimum_seconds_between_registrations = 21600


--GLOBAL-------------------------------------BACKGROUND DAEMON--------------------------------------------------
-- Debian:
-- Do not send the server to background, either systemd or start-stop-daemon take care of that.
--
daemonize = false;
--GLOBAL-------------------------------------PID FILE PATH------------------------------------------------------

-- Debian:
-- Please, don't change this option since /run/prosody/
-- is one of the few directories Prosody is allowed to write to
--
pidfile = "/run/prosody/prosody.pid";
--/////////////////////////////////////////////////////////////////////////////////////////////////////////////CPY

--GLOBAL--------------------------------CLIENT & SERVER ENCRYPTION---------------------------------------------------------


-- Force clients to use encrypted connections? This option will
-- prevent clients from authenticating unless they are using encryption.

c2s_require_encryption = true

-- Force servers to use encrypted connections? This option will
-- prevent servers from authenticating unless they are using encryption.

s2s_require_encryption = true

-- Force certificate authentication for server-to-server connections?

s2s_secure_auth = false

-- Some servers have invalid or self-signed certificates. You can list
-- remote domains here that will not be required to authenticate using
-- certificates. They will be authenticated using DNS instead, even --///////////////////////////////////////////////CPY
-- when s2s_secure_auth is enabled.

--s2s_insecure_domains = { "insecure.example" }

-- Even if you disable s2s_secure_auth, you can still require valid
-- certificates for some domains by specifying a list here.

--s2s_secure_domains = { "jabber.org" }


--GLOBAL----------------------------------------AUTHENTICATION BACKEND----------------------------------------------


-- Select the authentication backend to use. The 'internal' providers
-- use Prosody's configured data storage to store the authentication data.

authentication = "internal_hashed"

--GLOBAL--------------------------------------STORAGE BACKEND CONFIG-------------------------------------------------////CPY


-- Select the storage backend to use. By default Prosody uses flat files
-- in its configured data directory, but it also supports more backends
-- through modules. An "sql" backend is included by default, but requires
-- additional dependencies. See https://prosody.im/doc/storage for more info.

storage = "sql" -- Default is "internal" (Debian: "sql" requires one of the

--modules_enabled {
-- storage = {archive2 = "sql"};
--}

-- lua-dbi-sqlite3, lua-dbi-mysql or lua-dbi-postgresql packages to work)

-- For the "sql" backend, you can uncomment *one* of the below to configure:
--sql = { driver = "SQLite3", database = "prosody.sqlite" } -- Default. 'database' is the filename.
--sql = { driver = "MySQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }

--default style changed to stack LP 2.10.21
--sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "882Jacqueminot!882", host = "localhost" }--////CPY
--sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "882Jacqueminot!882" }

sql_manage_tables = true
--Stack style:
storage = "sql"
sql = {
driver = "PostgreSQL"; -- May also be "MySQL" or "SQLite3" (case sensitive!)
database = "prosody"; -- The database name to use. For SQLite3 this the database filename (relative to the data storage directory).
-- host = "casp3r.net"; -- The address of the database server (delete this line for Postgres)
-- port = 3306; -- For databases connecting over TCP
username = "prosody"; -- The username to authenticate to the database
password = "882Jacqueminot!882"; -- The password to authenticate to the database

}


--# according to documentation host for postgresql is to be deleted (see link below)
--# https://prosody.im/doc/modules/mod_storage_sql
--//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////CPY

--GLOBAL-----------------------------------------ARCHIVING CONFIG------------------------------------------


-- Archiving configuration
-- If mod_mam is enabled, Prosody will store a copy of every message. This
-- is used to synchronize conversations between multiple clients, even if
-- they are offline. This setting controls how long Prosody will keep
-- messages in the archive before removing them.

archive_expires_after = "1w" -- Remove archived messages after 1 week

-- You can also configure messages to be stored in-memory only. For more
-- archiving options, see https://prosody.im/doc/modules/mod_mam

--GLOBAL----------------------------------LOGGING CONFIG----------------------------------------------

-- Logging configuration
-- For advanced logging see https://prosody.im/doc/logging
--
-- Debian: --/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////CPY

-- Logs info and higher to /var/log
-- Logs errors to syslog also
log = {
-- Log files (change 'info' to 'debug' for debug logs):
info = "/var/log/prosody/prosody.log";
error = "/var/log/prosody/prosody.err";
-- Syslog:
{ levels = { "error" }; to = "syslog"; };
}


--GLOBAL--------------------------------STATISTICS--------------------------------------------
-- Uncomment to enable statistics
-- For more info see https://prosody.im/doc/statistics
statistics = "internal"

--------------------------------------------------------------------------------------
--GLOBAL-------------------------ORIGINAL CERTIFICATES DECLARATION---------------------------------------
-----------------------------------------------SSL------------------------------------------////////////////////////////////CPY

-- Certificates
-- Every virtual host and component needs a certificate so that clients and
-- servers can securely verify its identity. Prosody will automatically load
-- certificates/keys from the directory specified here.
-- For more information, including how to use 'prosodyctl' to auto-import certificates
-- (from e.g. Let's Encrypt) see https://prosody.im/doc/certificates

-- Location of directory to find certificates in (relative to main config file):

--commented out likely will cause problem LP
--DEFAULT
--certificates = "certs" --DEFAULT WAS UNCOMMENTED!!

--------------------------------------------------------------------------

-- HTTPS currently only supports a single certificate, specify it here:
https_certificate = "/etc/letsencrypt/live/upload.casp3r.net/fullchain.pem";


-------------------------------------------------------------------------///////////////////////////////////////////////CPY


--LP
--Maybe...
--https_certificate = "/etc/letsencrypt/live/casp3r.net/fullchain.pem"

--Nginx certbot claims:
--Redirecting all traffic on port 80 to ssl in /etc/nginx/conf.d/prosody.conf

--LP
--JUNK:

-- ssl = {
-- certificate = "/etc/prosody/certs/";
-- key = "/etc/prosody/certs/";
-- }


--ssl = {
-- key = "/etc/letsencrypt/live/casp3r.net/privkey.pem"; --/////////////////////////////////////////////////////CPY
-- certificate = "/etc/letsencrypt/live/casp3r.net/fullchain.pem";
--}
-- certificate = "/etc/nginx/conf.d/prosody.conf"


--------------------------------------------------------------------------------------------

--GLOBAL-------------------------BOSH DEFINITIONS-------------------------------------------

--BOSH DEFINITION (See documentation : Setting up a BOSH server :
--https://prosody.im/doc/setting_up_bosh



-----------------------------------------------------------------------------------------------
--GLOBAL-------------------------VIRTUAL HOSTS-----------------------------------------------
-- You need to add a VirtualHost entry for each domain you wish Prosody to serve.

-- Settings under each VirtualHost entry apply *only* to that host.--///////////////////////////////////////////CPY

-- It's customary to maintain VirtualHost entries in separate config files
-- under /etc/prosody/conf.d/ directory. Examples of such config files can
-- be found in /etc/prosody/conf.avail/ directory.

------ Additional config files ------
-- For organizational purposes you may prefer to add VirtualHost and
-- Component definitions in their own config files. This line includes
-- all config files in /etc/prosody/conf.d/


VirtualHost "localhost"

VirtualHost "casp3r.net"
ssl = {
key = "/etc/letsencrypt/live/casp3r.net/privkey.pem";
certificate = "/etc/letsencrypt/live/casp3r.net/fullchain.pem";
}


--GLOBAL---------------------------------DISCO---------------------------------------------------/////////////CPY
--VirtualHost "foo.casp3r.net"

--VirtualHost "files.casp3r.net"

disco_items = {
{ "upload.casp3r.com" }

}


------------------------------------------------------------------------------------------------
------------------------------ Component Declarations-------------------------------------------
------------------ ------------------------------
---------------components add hosts that provide special services------------------------------
------------------------ like conferences, and transports------------------------------------
-----------------------------------------------------------------------------------------------


-- You can specify components to add hosts that provide special services,
-- like multi-user conferences, and transports. --///////////////////////////////////////////////////////////CPY
-- For more information on components see:
-- https://prosody.im/doc/components



--COMPONENT------------------------------------MUC------------------------------------------
---Set up a MUC (multi-user chat) room server on conference.example.com:

Component "conference.casp3r.net" "muc"

restrict_room_creation = "admin"
admins = { "tom@casp3r.net","casp3r@casp3r.net"}
--admins = { "user1@chat.example.com", "user2@chat.example.com" }
--- Store MUC messages in an archive and allow users to access it
modules_enabled = { "muc_mam" }
---Set up an external component (default component port is 5347)



--COMPONENT-------------------------------HTTP_UPLOAD--------------------------------------------//////////CPY
----------------------------------AND HTTP?-----------------------------------------------
--component declarations found in
--https://modules.prosody.im/mod_http_upload.html


Component "upload.casp3r.net" "http_upload"

--http_upload_file_size_limit = 1024 * 1024 * 25 --20MB -- bytes

--http_upload_expire_after = 60 * 60 * 24 * 7 -- a week in seconds

--mod_http_upload_expire = "casp3r.net"

--http_max_content_size = 1024 * 1024 * 25

--http_upload_quota = 1024 * 1024 * 25 --25MB -- bytes

--By default, uploaded files are put in a sub-directory of the default Prosody storage path (usually /var/lib/prosody). This can be changed:

--http_upload_path = "/usr/lib/prosody/migrator/prosody_sql.lua" --////////////////////////////////////CPY

--http_files_dir = "/var/lib/prosody" -- The base file directory. You must set this to serve files

--http_files_dir = "/usr/lib/prosody/migrator/prosody_sql.lua"

--http_files_dir = "/var/www/prosody"

--http_files_dir = "nil"

--http_index_files = { "index.html", "index.htm" } -- A request for a directory will serve one of these files if the directory contains it

--http_dir_listing = true
--http_dir_listing = false -- Whether to allow a module to create a file listing of directories where no index file is found

--mime_types_file = "/etc/mime.types"-- A file containing MIME types and the file extensions used by it.

--http_files_cache_max_file_size = 1024 * 1024 * 25 --20MB -- Max file size for in-memory cache. Added in 0.9.11


--http_upload_ssl = { --/////////////////////////////////////////////////////////////////////////////CPY
-- certificate = "/etc/letsencrypt/live/upload.casp3r.net/fullchain.pem";
-- key = "/etc/letsencrypt/live/upload.casp3r.net/privkey.pem";
-- }

--http_external_url = "http://www.casp3r.net/"
--trusted_proxies = { "73.92.60.232", "10.0.0.212", }


--HTTP STUFF-----

--http_ports = { 5280 }

--http_interfaces = { "*" }

--http_default_host = "upload.casp3r.net:5281"

--https_ports = { 5281 }

--https_interfaces = { "*" }
--/////////////////////////////////////////////////////////////////////////////////////////////////////CPY
--http_upload_file_size_limit = 1024 * 1024 * 25 --25MB

--https_ssl = {

--https_upload_ssl = {

--HTTP #1-----
--http_ports = { 5280 }
--http_interfaces = { "*" }
--http_default_host = "upload.casp3r.net:5281"
--https_ports = { 5281 }
--https_interfaces = { "*" }
--http_upload_file_size_limit = 1024 * 1024 * 25 --25MB
--https_upload_ssl = {
--certificate = "/etc/prosody/certs/upload.casp3r.net.key";
--key = "/etc/prosody/certs/upload.casp3r.net.cert";
--http_files_dir = "/var/www/prosody"
--END HTTP STUFF------
------------------------------
--///////////////////////////////////////////////////////////////////////////////////////////////////CPY
--------------------------------------------------------------------------------------------------------
--------------------------------------EXTERNAL COMPONENTS------------------------------------------------
----------------------------------------------------------------------------------------------------
-- External components allow adding various services, such as gateways/
-- transports to other networks like ICQ, MSN and Yahoo. For more info
-- see: https://prosody.im/doc/components#adding_an_external_component
--
--Component "gateway.example.com"
-- component_secret = "password"
Include "conf.d/*.cfg.lua"

--///////////END CPY

Prosody config file