initial commit of file from CVS for smeserver-rocketchat on Sat Sep 7 21:01:48 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 21:01:48 +10:00
parent 32aa4b87e1
commit 60d3846703
27 changed files with 786 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
{
# Load wstunnel if available
if ( -e '/usr/lib64/httpd/modules/mod_proxy_wstunnel.so' ||
-e '/usr/lib/httpd/modules/mod_proxy_wstunnel.so'){
$OUT .= "LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so\n";
}
}

View File

@@ -0,0 +1,9 @@
{
use esmith::DomainsDB;
# Convert the passed hash for the domain object back into an object.
$domain = bless \%domain, 'esmith::DB::db::Record';
# Make scalars from some of the properties of the domain
$virtualHost = $domain->key;
$OUT = "";
}

View File

@@ -0,0 +1 @@
ServerName {$virtualHost}

View File

@@ -0,0 +1,13 @@
ServerAlias {
use esmith::HostsDB;
use esmith::DomainsDB;
my $hdb = esmith::HostsDB->open_ro();
my %domains = map { $_->key => 1 } esmith::DomainsDB->open_ro->domains;
my @hosts = grep {
my $h = $_;
($h->prop('HostType') eq 'Self') && !$domains{$h->key}
} $hdb->get_hosts_by_domain($virtualHost);
$OUT = join " ", map { $_->key } @hosts;
}

View File

@@ -0,0 +1,29 @@
{
my $ssl = $domain->prop('RequireSSL') || 'disabled';
my $auth = $domain->prop('Authentication') || 'none';
if (($modSSL{TCPPort} || "443") eq $port){
$OUT .= " SSLEngine on\n";
}
elsif (($ssl =~ m/^enabled|yes|on|1$/i) || ($auth =~ /^LemonLDAP/)){
$OUT .=<<'EOF';
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
RewriteRule ^/.well-known/acme-challenge(/.*|\$) https://%{HTTP_HOST}/.well-known/acme-challenge\$1 [L,R]
RewriteRule ^/(.*|$) https://%{HTTP_HOST}/$1 [L,R]
EOF
}
elsif ($ssl =~ m#/#){
$OUT .= " RewriteEngine on\n";
foreach my $loc (split(/[;,]/, $ssl)){
$OUT .= " # Rewriting $loc to use SSL\n";
$loc =~ s#^/##;
$OUT .= " RewriteRule ^/$loc(/.*|\$) https://%\{HTTP_HOST\}/$loc\$1 \[L,R\]\n";
}
}
else{
$OUT .= '';
}
}

View File

@@ -0,0 +1,8 @@
{
$OUT =<<'HERE';
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
HERE
}

View File

@@ -0,0 +1,2 @@
# Alias for letsencrypt
Alias /.well-known/acme-challenge/ /home/e-smith/files/ibays/Primary/html/.well-known/acme-challenge/

View File

@@ -0,0 +1,13 @@
{
my $alias = $domain->prop('IconAlias') || 'enabled';
$OUT .= '';
unless ($alias =~ m/disabled|off|no|0/i){
$OUT .=<<'EOF';
# alias for Apache icons
Alias /icons/ /var/www/icons/
EOF
}
}

View File

@@ -0,0 +1,21 @@
ProxyPreserveHost on
SetEnv proxy-nokeepalive 1
ProxyPass /.well-known/acme-challenge/ !
DocumentRoot /home/e-smith/files/ibays/Primary/html
<IfModule mod_proxy_wstunnel.c>
ProxyPassMatch ^/sockjs/(.*)/websocket ws://localhost:3000/sockjs/$1/websocket
ProxyPass /websocket ws://localhost:3000/websocket
</IfModule>
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
<Location />
Require all granted
</Location>
<Location /.well-known/acme-challenge/>
Require all granted
</Location>

View File

@@ -0,0 +1,2 @@
<VirtualHost {$ipAddress}:{$port}>

View File

@@ -0,0 +1,32 @@
rocketchat:
{
my $version = ${rocketchat}{Version} || "1.0.0";
#$OUT .= " image: registry.rocket.chat/rocketchat/rocket.chat:$version";
$OUT .= " image: rocketchat/rocket.chat:$version";
}
container_name: rocketchat
environment:
# Use ?replSet=rs0 if you have replica sets (this is the templates-custom template)
- MONGO_URL=mongodb://127.0.0.1:27017/rocketchat?replicaSet=rs0
- MONGO_OPLOG_URL=mongodb://127.0.0.1:27017/local?replicaSet=rs0
{
$OUT .= " - ROOT_URL=https://$rocketchat{rootURL}\n";
$OUT .= " - MAIL_URL=smtp://$rocketchat{mailURL}";
}
- HTTP_FORWARDED_COUNT=1
- Accounts_UseDNSDomainCheck=True
- OVERWRITE_SETTING_Accounts_TwoFactorAuthentication_Enforce_Password_Fallback=false
- OVERWRITE_SETTING_Accounts_TwoFactorAuthentication_Enabled=false
# ports:
# - 3000:3000
network_mode: host
# Specify an absolute path mapping
volumes:
- /opt/uploads/:/opt/uploads/
restart: on-failure:2
# Might need the UID/GID rather than name
# user: dockerroot:dockerroot
# user: 392:390
# Memory Limit
mem_limit: 2048MB