diff --git a/README.md b/README.md index 6068361..e103d74 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,37 @@ +Note: Make sure no secrets are leaked! +```bash +gitleaks detect --source . -v +``` + # Server Setups and Stuff we Self Host Shell scripts, ansible scripts and config files for foss united servers and self-hosted applications. -### List of Applications +### List of Applications - [Listmonk](https://listmonk.app) - For sending bulk emails and newsletter -- [Nextcloud](./servers/apps/nextcloud/README.md) - Nextcloud instance self hosted for FOSS United Team's internal usage, and for switching from the GSuite (like Google Docs, Google Sheets). + + https://listmonk.fossunited.org (only admin access) + - [Vaultwarden](./servers/apps/vaultwarden/README.md) - Password Management on Organization and User level - [Mattermost](./servers/apps/mattermost/mattermost.md) - For Internal team discussions + + https://mattermost.fossunited.org (only team access) + +- [Livecode](https://github.com/fossunited/falcon) - A service that execute code in any programming language in a sandboxed environment. +- [Jisti](https://github.com/jitsi/jitsi-meet) - For all Meetings in and around organization + + https://meet.fossunited.org (open for all to use) + + - It also has Etherpad lite for meeting notes + + https://meet.fossunited.org/etherpad/p/dtest (open for all) + +- [Caddy file server](https://caddyserver.com/) - For file sharing with community + + https://files.fossunited.org/ (seldom used, has some files) + + +#### Seldom Used (or Ignored) +- [Nextcloud](./servers/apps/nextcloud/README.md) - Nextcloud instance self hosted for FOSS United Team's internal usage, and for switching from the GSuite (like Google Docs, Google Sheets). - [Librechat](https://www.librechat.ai/) - AI chat platform/search engine called [Echo](https://echo.fossunited.org) -- [Livecode](https://github.com/fossunited/falcon) - A service that execute code in any programming language in a sandboxed environment. diff --git a/servers/README.md b/servers/README.md index cc7961d..cf7e313 100644 --- a/servers/README.md +++ b/servers/README.md @@ -16,6 +16,7 @@ Services Running: - nginx - frape-bench - livecode +- caddy Important Locations: - /home/fossunited/frappe-bench diff --git a/servers/apps/caddy/Caddyfile b/servers/apps/caddy/Caddyfile new file mode 100644 index 0000000..a435661 --- /dev/null +++ b/servers/apps/caddy/Caddyfile @@ -0,0 +1,46 @@ +# again same password as listmonk to decrypt (in emacs M-x epa-decrypt-region) +-----BEGIN PGP MESSAGE----- + +jA0ECQMKduqVxERu8UD/0o8B4hJWwSwrcHzypx+hn4e0GYJcmqeOw0eVxlndWUF+ +mxGo87FHqEn2oUgI+z5MkGQa9UqlosNLReGO4DpaHQWoJqC+oYUVrf42LMXjZUYi +wUP3Ccvq0bhD7S2F9IapF121OdyqYK9i6Bus09JGAjKvF6IwQQ4/p1UAMUDr9LC3 +hRIcQIxOdWHcNTvZpjW3eQ== +=DBeZ +-----END PGP MESSAGE----- + +# Jitsi +meet.fossunited.org { + handle_path /etherpad/* { + reverse_proxy etherpad.meet.jitsi:9001 + } + handle { + reverse_proxy 139.144.1.25:8000 { + header_up X-Real-IP {remote_host} + } + } +} +# Excalidraw backend for jitsi +whiteboard.meet.fossunited.org { + reverse_proxy 139.144.1.25:8695 { + header_up Host {host} + header_up X-Real-IP {remote_host} + # WebSocket upgrade support + transport http { + keepalive 30s + } + } +} + +files.fossunited.org { + file_server { + browse + } + root * /filebrowser +} +filemanager.fossunited.org { + reverse_proxy 139.144.1.25:8090 +} + +fureport.tamilnadu.tech { + reverse_proxy ghost-blog:2368 +} diff --git a/servers/apps/caddy/Dockerfile b/servers/apps/caddy/Dockerfile new file mode 100644 index 0000000..bf5069a --- /dev/null +++ b/servers/apps/caddy/Dockerfile @@ -0,0 +1,9 @@ +FROM caddy:builder-alpine AS builder + +RUN xcaddy build \ + --with github.com/caddy-dns/cloudflare + +FROM caddy:alpine + +COPY --from=builder /usr/bin/caddy /usr/bin/caddy + diff --git a/servers/apps/caddy/README.md b/servers/apps/caddy/README.md new file mode 100644 index 0000000..83ec087 --- /dev/null +++ b/servers/apps/caddy/README.md @@ -0,0 +1,3 @@ +- Instead of nginx, caddy is used for reverse proxy and routing + +- Is in same jitsi server itself diff --git a/servers/apps/caddy/compose.yml b/servers/apps/caddy/compose.yml new file mode 100644 index 0000000..e6518d2 --- /dev/null +++ b/servers/apps/caddy/compose.yml @@ -0,0 +1,26 @@ +services: + caddy: + image: caddy + restart: unless-stopped + ports: + - "80:80" + - "443:443" + - "443:443/udp" + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile + - /root/filebrowser/srv:/filebrowser + - caddy_data:/data + - caddy_config:/config + networks: + - default + - jitsi + +networks: + default: + jitsi: + external: true + name: docker-jitsi-meet_meet.jitsi + +volumes: + caddy_data: + caddy_config: diff --git a/servers/apps/filebrowser/compose.yml b/servers/apps/filebrowser/compose.yml new file mode 100644 index 0000000..a1f084b --- /dev/null +++ b/servers/apps/filebrowser/compose.yml @@ -0,0 +1,11 @@ +services: + filebrowser: + image: filebrowser/filebrowser + restart: unless-stopped + volumes: + - ./srv:/srv + - ./db:/database + - ./config:/config + ports: + - 8090:80 + user: 1000:1000 diff --git a/servers/apps/filebrowser/config/settings.json b/servers/apps/filebrowser/config/settings.json new file mode 100644 index 0000000..e787ef8 --- /dev/null +++ b/servers/apps/filebrowser/config/settings.json @@ -0,0 +1,8 @@ +{ + "port": 80, + "baseURL": "", + "address": "", + "log": "stdout", + "database": "/database/filebrowser.db", + "root": "/srv" +} \ No newline at end of file diff --git a/servers/apps/filebrowser/readme.md b/servers/apps/filebrowser/readme.md new file mode 100644 index 0000000..6b0c291 --- /dev/null +++ b/servers/apps/filebrowser/readme.md @@ -0,0 +1,5 @@ +## A simple caddy file browser + +https://files.fossunited.org + +To add files, either ssh and add or via admin panel: https://filemanager.fossunited.org diff --git a/servers/apps/jitsi/.env b/servers/apps/jitsi/.env new file mode 100644 index 0000000..b5a47b7 --- /dev/null +++ b/servers/apps/jitsi/.env @@ -0,0 +1,270 @@ +# shellcheck disable=SC2034 + +################################################################################ +################################################################################ +# Welcome to the Jitsi Meet Docker setup! +# +# This sample .env file contains some basic options to get you started. +# The full options reference can be found here: +# https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-docker +################################################################################ +################################################################################ + + +# +# Basic configuration options +# + +# Directory where all configuration will be stored +CONFIG=~/.jitsi-meet-cfg + +# Exposed HTTP port (will redirect to HTTPS port) +HTTP_PORT=8000 + +# Exposed HTTPS port +HTTPS_PORT=8443 + +# System time zone +TZ=UTC + +# Public URL for the web service (required) +# Keep in mind that if you use a non-standard HTTPS port, it has to appear in the public URL +PUBLIC_URL=https://meet.fossunited.org + +# Media IP addresses to advertise by the JVB +# This setting deprecates DOCKER_HOST_ADDRESS, and supports a comma separated list of IPs +# See the "Running behind NAT or on a LAN environment" section in the Handbook: +# https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-docker#running-behind-nat-or-on-a-lan-environment +JVB_ADVERTISE_IPS=139.144.1.25 + +# +# Memory limits for Java components +# + +#JICOFO_MAX_MEMORY=3072m +#VIDEOBRIDGE_MAX_MEMORY=3072m + +# +# JaaS Components (beta) +# https://jaas.8x8.vc +# + +# Enable JaaS Components (hosted Jigasi) +# NOTE: if Let's Encrypt is enabled a JaaS account will be automatically created, using the provided email in LETSENCRYPT_EMAIL +#ENABLE_JAAS_COMPONENTS=0 + +# +# Let's Encrypt configuration +# + +# Enable Let's Encrypt certificate generation +ENABLE_LETSENCRYPT=0 +DISABLE_HTTPS=1 +# Domain for which to generate the certificate +#LETSENCRYPT_DOMAIN=meet.example.com + +# E-Mail for receiving important account notifications (mandatory) +#LETSENCRYPT_EMAIL=alice@atlanta.net + +# Use the staging server (for avoiding rate limits while testing) +#LETSENCRYPT_USE_STAGING=1 + +# Set ACME server. Default is zerossl, you can peek one at https://github.com/acmesh-official/acme.sh/wiki/Server +#LETSENCRYPT_ACME_SERVER="letsencrypt" + +# +# Etherpad integration (for document sharing) +# + +# Set the etherpad-lite URL in the docker local network (uncomment to enable) +ENABLE_ETHERPAD=1 +ETHERPAD_URL_BASE=http://etherpad.meet.jitsi:9001 +ETHERPAD_PUBLIC_URL=https://meet.fossunited.org/etherpad/p/ + +# Name your etherpad instance! +ETHERPAD_TITLE=Video Chat + +# The default text of a pad +ETHERPAD_DEFAULT_PAD_TEXT="Welcome to Web Chat!\n\n" + +# Name of the skin for etherpad +ETHERPAD_SKIN_NAME=colibris + +# Skin variants for etherpad +ETHERPAD_SKIN_VARIANTS="super-light-toolbar super-light-editor light-background full-width-editor" + +# +# Whiteboard integration +# + +WHITEBOARD_ENABLED=true +# Internal URL — use the host IP since excalidraw is in a separate compose project +WHITEBOARD_COLLAB_SERVER_URL_BASE=http://139.144.1.25:8695 +WHITEBOARD_COLLAB_SERVER_PUBLIC_URL=https://whiteboard.meet.fossunited.org + +# +# Basic Jigasi configuration options (needed for SIP gateway support) +# + +# SIP URI for incoming / outgoing calls +#JIGASI_SIP_URI=test@sip2sip.info + +# Password for the specified SIP account as a clear text +-----BEGIN PGP MESSAGE----- + +jA0ECQMKUx53LTE1YC7/0loBJMiBWvB/vVtTBiTIKRm6Hh7K3SOFlmCCSukHBPCb +cRmqUsXD39oMVBvTUmrFBzyPhRAquivTLqB52zNLBUQDCcj/aZcBAOaNX4fA2IBH +By1PdyY4BKi8TJE= +=dmoI +-----END PGP MESSAGE----- + +# SIP server (use the SIP account domain if in doubt) +#JIGASI_SIP_SERVER=sip2sip.info + +# SIP server port +#JIGASI_SIP_PORT=5060 + +# SIP server transport +#JIGASI_SIP_TRANSPORT=UDP + + +# +# Authentication configuration (see handbook for details) +# + +# Enable authentication (will ask for login and password to join the meeting) +#ENABLE_AUTH=1 + +# Enable guest access (if authentication is enabled, this allows for users to be held in lobby until registered user lets them in) +#ENABLE_GUESTS=1 + +# Select authentication type: internal, jwt, ldap or matrix +#AUTH_TYPE=internal + +# JWT authentication +# + +# Application identifier +#JWT_APP_ID=my_jitsi_app_id + +# Application secret known only to your token generator +#JWT_APP_SECRET=my_jitsi_app_secret + +# (Optional) Set asap_accepted_issuers as a comma separated list +#JWT_ACCEPTED_ISSUERS=my_web_client,my_app_client + +# (Optional) Set asap_accepted_audiences as a comma separated list +#JWT_ACCEPTED_AUDIENCES=my_server1,my_server2 + +# LDAP authentication (for more information see the Cyrus SASL saslauthd.conf man page) +# + +# LDAP url for connection +#LDAP_URL=ldaps://ldap.domain.com/ + +# LDAP base DN. Can be empty +#LDAP_BASE=DC=example,DC=domain,DC=com + +# LDAP user DN. Do not specify this parameter for the anonymous bind +#LDAP_BINDDN=CN=binduser,OU=users,DC=example,DC=domain,DC=com + +# LDAP user password. Do not specify this parameter for the anonymous bind +#LDAP_BINDPW=LdapUserPassw0rd + +# LDAP filter. Tokens example: +# %1-9 - if the input key is user@mail.domain.com, then %1 is com, %2 is domain and %3 is mail +# %s - %s is replaced by the complete service string +# %r - %r is replaced by the complete realm string +#LDAP_FILTER=(sAMAccountName=%u) + +# LDAP authentication method +#LDAP_AUTH_METHOD=bind + +# LDAP version +#LDAP_VERSION=3 + +# LDAP TLS using +#LDAP_USE_TLS=1 + +# List of SSL/TLS ciphers to allow +#LDAP_TLS_CIPHERS=SECURE256:SECURE128:!AES-128-CBC:!ARCFOUR-128:!CAMELLIA-128-CBC:!3DES-CBC:!CAMELLIA-128-CBC + +# Require and verify server certificate +#LDAP_TLS_CHECK_PEER=1 + +# Path to CA cert file. Used when server certificate verify is enabled +#LDAP_TLS_CACERT_FILE=/etc/ssl/certs/ca-certificates.crt + +# Path to CA certs directory. Used when server certificate verify is enabled +#LDAP_TLS_CACERT_DIR=/etc/ssl/certs + +# Wether to use starttls, implies LDAPv3 and requires ldap:// instead of ldaps:// +# LDAP_START_TLS=1 + + +# +# Security +# +# Set these to strong passwords to avoid intruders from impersonating a service account +# The service(s) won't start unless these are specified +# Running ./gen-passwords.sh will update .env with strong passwords +# You may skip the Jigasi and Jibri passwords if you are not using those +# DO NOT reuse passwords +# + +# [Dilip]: I've added gnupg encryption in region (thought to use age, but emacs had epa already) +# password to decrypt is same password used for listmonk as on [2026-04-07 Tue] +# NOTE: use gitleaks to audit! + +-----BEGIN PGP MESSAGE----- + +jA0ECQMKiKe5Ou2+kCT/0sCzAQuG2WGiBwDLNw3hmLt0ypFNIF5O9iQohaxkrIWO +59ssaMCxRf0DdNnzmKyFAczF5CaWJoYFyFBPllO7ytB60UeOvjM7+eBuN9litoj2 +VRBQLrz7JALdMtZf7vpYNa3r71AU3CoiXqp3KDlDfYOiylBtQSlMdFqkphUzmLKj +YmjfldTc++aevcpISB2XBEmHcPX2sZ1D4R3KRac4w3Cx52cOXdLHz70c3rQKZjwU +pDbyJyntlPNA4SkUdtSSCmI4vfOCYS5nKDlW89oIWbDJrg8bMgJk0f3jdJGzbxFy +H/XWCK78vPL/IYZOXx25MU/71W4oBDHJLMlBS3Ctga3Nb4MkufPobemZBs+BcNMf +R8nARZ+AP75YZlAflUFVCKczrmEa+dmfwoeJUXtVBpZ5GmIqCoRZce8KeB2OYUYL +SOR+RZnI5DtHHTXEXj7aBEHqvgvsT39xPNm4V9UPa2Uk1/vLqADp/Mj1gfUm4FWr +qMwR3K0= +=ypo+ +-----END PGP MESSAGE----- + + +# +# Docker Compose options +# + +# Container restart policy +RESTART_POLICY=unless-stopped + +# Jitsi image version (useful for local development) +#JITSI_IMAGE_VERSION=latest + +-----BEGIN PGP MESSAGE----- + +jA0ECQMKw/m7vs4VA6n/0o4BjAj9frLpdw8GF/TOuQxxyxeCJ5biNgChhrrC9HA9 +j0Rb6IM9s22UpktVll97foOjCih930mTCTbchpxbu/of1QxDGLWugOt7WjBLPXSG +hufu9tM9SpioonU3MK/oUxVBUFoOTbP/Zp86UBcR15bWSb5i/PyxLidZ1LUemIMj +RYBkRmCOH1HArNcjH/Rs +=M3mt +-----END PGP MESSAGE----- + +TURN_HOST=turn.meet.fossunited.org +TURN_PORT=3478 +JVB_STUN_SERVERS=turn.meet.fossunited.org:3478 + +ENABLE_LIVESTREAMING=1 +ENABLE_RECORDING=1 + +# Web (frontend) config +RESOLUTION=1080 +RESOLUTION_MIN=180 +RESOLUTION_WIDTH=1920 +RESOLUTION_WIDTH_MIN=320 + +# avoid turning off screen share due to bad network? +ENABLE_ADAPTIVE_MODE=false +DISABLE_VIDEO_SUSPEND=true +CHANNEL_LAST_N=-1 +ENABLE_SIMULCAST=false \ No newline at end of file diff --git a/servers/apps/jitsi/README.md b/servers/apps/jitsi/README.md new file mode 100644 index 0000000..f4c80ca --- /dev/null +++ b/servers/apps/jitsi/README.md @@ -0,0 +1,87 @@ +# Server + +- uname -a +`Linux localhost 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux` + +```bash +echo "=== CPU ===" +lscpu | grep -E 'Model name|CPU\(s\)|Thread|Core|Socket' + +echo -e "\n=== RAM ===" +free -h + +echo -e "\n=== Disk ===" +df -h / + +echo -e "\n=== OS ===" +cat /etc/os-release | grep PRETTY_NAME + +echo -e "\n=== Kernel ===" +uname -r +``` + +```text +=== CPU === +CPU(s): 4 +On-line CPU(s) list: 0-3 +Model name: AMD EPYC 7713 64-Core Processor +BIOS Model name: pc-q35-7.2 CPU @ 2.0GHz +Thread(s) per core: 1 +Core(s) per socket: 4 +Socket(s): 1 +NUMA node0 CPU(s): 0-3 + +=== RAM === + total used free shared buff/cache available +Mem: 7.8Gi 2.1Gi 2.9Gi 2.3Mi 3.0Gi 5.7Gi +Swap: 511Mi 103Mi 408Mi + +=== Disk === +Filesystem Size Used Avail Use% Mounted on +/dev/sda 157G 16G 134G 11% / + +=== OS === +PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" + +=== Kernel === +6.1.0-37-amd64 +``` + +# Jitsi Meet on Docker + +[Jitsi](https://jitsi.org/) is a set of Open Source projects that allows you to easily build and deploy secure videoconferencing solutions. + +[Jitsi Meet](https://jitsi.org/jitsi-meet/) is a fully encrypted, 100% Open Source video conferencing solution that you can use all day, every day, for free — with no account needed. + +This repository contains the necessary tools to run a Jitsi Meet stack on [Docker](https://www.docker.com) using [Docker Compose](https://docs.docker.com/compose/). + +- The docker setup is directly from: https://github.com/jitsi/docker-jitsi-meet + +Only config changes to `.env` is made, thats it. + +- `config.js`: jitsi frontend Web configuration + - ~/.jitsi-meet-cfg/web/config.js + +- `docker-compose.yml` is same as default + just that etherpad is included to bundle with jitsi + +- `.env` file is configured as required. + +## Updating + +- Modify `.env` file and run: `docker compose up -d --force-recreate` in that dir (~/docker-jitsi-meet) +- `docker network connect docker-jitsi-meet_meet.jitsi caddy-caddy-1` (if caddy network is not synced with jitsi for etherpad to work) +- `docker compose -f ~/docker-jitsi-meet/docker-compose.yml restart web` (restart web if testing frontned changes via config.js) + + +## TODOs + +- [ ] Make fossunited team moderator for all. Any guest who joins early becomes mod, we need Mod for team forcefully (may need Auth or some weird setup) + +## Changes + +### April 2026 +- Connect etherpad to jitsi to make it usable +- Set max resolution to 1080 +- Removed adaptive mode to avoid screen share getting turned off to save bandwidth +- Make etherpad files persist by mounting volume diff --git a/servers/apps/jitsi/config.js b/servers/apps/jitsi/config.js new file mode 100644 index 0000000..3ea23c3 --- /dev/null +++ b/servers/apps/jitsi/config.js @@ -0,0 +1,239 @@ +// Jitsi Meet configuration. + +var config = {}; + +config.hosts = {}; +config.hosts.domain = 'meet.jitsi'; + +var subdir = ''; +var subdomain = ''; +if (subdir.startsWith('