This commit is contained in:
nm1 2026-11-04 00:33:23 +05:30
commit 74ae93a96e
4 changed files with 94691 additions and 0 deletions

View file

@ -0,0 +1,46 @@
caddy
either install go binary and place it where root user can access or use your package manager to install
and for domains which are not public use this TLD
`.local`, `.internal`, `.localhost` and make to sure to register them like this
```sh
sudo nano /etc/hosts
```
then
add this
`127.0.0.1 exampler1267.internal`
Caddyfile example
```txt
localhost:3009 {
respond "Hello, world!"
}
# :8007 {
# bind 0.0.0.0
# tls internal
# reverse_proxy :8008
# }
https://localhost:8007 {
bind 0.0.0.0
tls internal
reverse_proxy :8008
}
https://192.168.29.234:8007 {
bind 0.0.0.0
tls internal
reverse_proxy :8008
}
```
use `caddy start` and `caddy stop` to start and end process

View file

@ -0,0 +1,337 @@
resource
https://github.com/spantaleev/matrix-docker-ansible-deploy
matrix homeserver
some servers
- synapse : standard one and feature rich but heavy
lightweight ones
https://git.telodendria.org/jakubgencur/Telodendria, conduit,dendrite and https://github.com/heusalagroup/hghs, https://github.com/matrix-construct/tuwunel
trying tuwunel
1. download release https://github.com/matrix-construct/tuwunel/releases/download/v1.5.1/v1.5.1-release-all-x86_64-v3-linux-gnu-tuwunel.zst
2. executing it will work but first needed to be configured
3. create a toml file say `config.toml` and use example from https://matrix-construct.github.io/tuwunel/configuration/examples.html#example-configuration (it acts as template). or [config.toml](../../../../_resources/config.toml)
```toml
[global]
# The server_name is the pretty name of this server. It is used as a
# suffix for user and room IDs/aliases.
#
# See the docs for reverse proxying and delegation:
# https://tuwunel.chat/deploying/generic.html#setting-up-the-reverse-proxy
#
# Also see the `[global.well_known]` config section at the very bottom.
#
# Examples of delegation:
# - https://matrix.org/.well-known/matrix/server
# - https://matrix.org/.well-known/matrix/client
#
# YOU NEED TO EDIT THIS. THIS CANNOT BE CHANGED AFTER WITHOUT A DATABASE
# WIPE.
#
# example: "girlboss.ceo"
#
server_name = "muty.org"
# This is the only directory where tuwunel will save its data, including
# media. Note: this was previously "/var/lib/matrix-conduit".
#
database_path = "database"
allow_registration = true
# Enabling this setting opens registration to anyone without restrictions.
# This makes your server vulnerable to abuse
#
yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse = true
# by adding 0.0.0.0 it will not only be available for localhost but for devices sharing same wifi too
address = ["127.0.0.1", "::1","0.0.0.0"]
```
 
synapse
https://element-hq.github.io/synapse/latest/setup/installation.html#installing-as-a-python-module-from-pypi
pip way
after creating a folder and cd to it
```sh
python3 -m venv env # to create venv
source env/bin/activate # to activate it
pip install --upgrade pip
pip install --upgrade setuptools
pip install matrix-synapse
```
configuration
`python -m synapse.app.homeserver \
--server-name my.domain.name \
--config-path homeserver.yaml \
--generate-config \
--report-stats=[yes|no]`
starting it
`synctl start`
or for non daemon
`python3 -m synapse.app.homeserver -c homeserver.yaml`
more configuration
```yml
enable_registration: true
enable_registration_without_verification: true
url_preview_enabled: true
url_preview_ip_range_blacklist: null
```
using postgresql instead of sqlite for production
https://element-hq.github.io/synapse/latest/postgres.html#porting-from-sqlite
![Using Postgres - Synapse.pdf](../../../../_resources/Using%20Postgres%20-%20Synapse.pdf)
1. Make sure to install `psycopg2` by `source env/bin/activate && pip install psycopg2-binary`
 
 
**connecting with ngrok**
The error you're seeing—"homeserver configuration found with <url> is unusable"—typically comes from **Element** (or another Matrix client) when it discovers your homeserver's configuration (via `.well-known` or direct probing) but decides the setup is invalid or unreachable for some reason.
This is **very common** when using **ngrok** to expose a local Synapse server (especially on localhost:8008), because ngrok creates a temporary HTTPS URL, but several things break federation/client discovery.
### Most likely causes with ngrok
1. **Your `server_name`** in `homeserver.yaml` is still set to something like `localhost`, `127.0.0.1`, or your local machine name (not the ngrok URL).
- Synapse **must** know its public identity → `server_name: your-ngrok-subdomain.ngrok-free.app` (or whatever your ngrok URL is without https://).
- Clients expect the homeserver to present itself consistently under that name.
2. **No `.well-known/matrix/server`** and/or `.well-known/matrix/client`** delegation set up.
- Modern clients (especially Element) strongly prefer or require **delegation** via these files when the base URL ≠ server_name.
- With ngrok you almost always need them.
3. **Ngrok free tier limitations** — the random/free URLs often cause strict clients to reject the certificate or see the setup as "unusable" because:
- The domain doesn't match expectations
- No proper TLS setup or mixed HTTP/HTTPS probing
- Ngrok injects a page/captchas sometimes → breaks /.well-known requests
4. **You're entering the wrong URL in the client**:
- Don't enter `http://localhost:8008`
- Don't enter `https://xxxx.ngrok-free.app:8008` (ngrok already forwards to 8008)
- Usually just enter `https://xxxx.ngrok-free.app` (or your custom ngrok domain)
### Quick fix steps (most reliable for ngrok)
1. **Stop Synapse**, edit `homeserver.yaml`:
```yaml
server_name: "abcd1234.ngrok-free.app" # ← use your ACTUAL ngrok URL here (no https://, no port)
# If you want federation later (optional but recommended)
federation_domain_whitelist: [] # or leave commented
# Make sure these are NOT forcing http or weird ports
public_baseurl: https://abcd1234.ngrok-free.app/ # optional but helps
```
→ Restart Synapse
2. **Set up .well-known delegation** (this is usually what fixes the "unusable" error):
Create a simple static web server (or use Python's built-in one) on port 80 or 443 if you can, but since you're using ngrok for 8008, the easiest is:
- Run a tiny HTTP server in a separate terminal (in a new folder):
```bash
mkdir well-known
cd well-known
mkdir -p .well-known/matrix
```
Create two files:
`.well-known/matrix/server`:
```json
{
"m.server": "abcd1234.ngrok-free.app:443"
}
```
`.well-known/matrix/client`:
```json
{
"m.homeserver": {
"base_url": "https://abcd1234.ngrok-free.app"
}
}
```
- Start a simple server in that folder:
```bash
python3 -m http.server 8080
```
- Run a **second ngrok** tunnel just for this well-known:
```bash
ngrok http 8080
```
→ Get a new ngrok URL, e.g. `https://abcd-wellknown.ngrok-free.app`
- Then in your **main** homeserver.yaml add/change:
```yaml
serve_server_wellknown: false # optional
```
But actually tell clients to use the well-known domain as the homeserver URL.
Better: use your main ngrok URL as server_name, and serve the .well-known files via Synapse itself (add to homeserver.yaml):
```yaml
additional_wellknown_roots:
- path: /.well-known/matrix/server
content: '{"m.server": "your-ngrok-url:443"}'
- path: /.well-known/matrix/client
content: '{"m.homeserver": {"base_url": "https://your-ngrok-url"}}'
```
Restart Synapse → it will serve them directly.
3. **In Element** (web/desktop/mobile):
- Custom server / Edit → enter exactly `https://your-ngrok-url` (no port, no /)
- It should discover the config and say something like "Homeserver configuration found with https://your-ngrok-url"
- If it still says unusable → open browser dev tools (F12) → Network tab → look what request to `/_matrix/client/versions` or `/.well-known` fails and why (404, 502, cert error, etc.)
### Even easier alternatives if ngrok keeps fighting you
- Use a free static tunnel like **bore.pub**, **pinggy.io**, or **localhost.run** (sometimes behave better with Matrix)
- Get a cheap domain + Cloudflare Tunnel (zero trust) — much more reliable for Synapse
- Use Tailscale / Headscale + funnel — exposes localhost securely without public URL hassle
Test first with `curl https://your-ngrok-url/_matrix/client/versions` — should return JSON with `"versions": [...]`.
If you share:
- Your exact `server_name:` line
- The full ngrok URL you're using
- What exactly you enter in Element
- The **exact** error message (including the <url> part)
I can narrow it down further!
&nbsp;
&nbsp;
### for converting to https for LAN IP
resource : https://medium.com/@antelle/how-to-generate-a-self-signed-ssl-certificate-for-an-ip-address-f0dd8dddf754
![How to generate a self-signed SSL certificate for an IP address _ by Dimitri Witkowski _ Medium.pdf](../../../../_resources/How%20to%20generate%20a%20self-signed%20SSL%20certificate%20for%20.pdf)
**Self sign certificate way**
- create the following file named `openssl.cnf`. `192.168.1.50` is LAN IP
```
[ req ]
default_bits = 2048
distinguished_name = req_distinguished_name
req_extensions = req_ext
prompt = no
[ req_distinguished_name ]
C = US
ST = State
L = City
O = Local
CN = 127.0.0.1
[ req_ext ]
subjectAltName = @alt_names
[ alt_names ]
IP.1 = 127.0.0.1
DNS.1 = localhost
IP.2 = 192.168.1.50
```
- now using this configuration, generate certificate and private key
`openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt -config openssl.cnf -extensions req_ext`
- not finallly in `homeserver.yaml` add these cetificates and enable tls
```yaml
server_name: "muta.org"
pid_file: /home/hpmi/Downloads/executables/synapse/homeserver.pid
# 1. Add these two lines globally to define your certificate paths
tls_certificate_path: "/home/hpmi/Downloads/executables/synapse/server.crt"
tls_private_key_path: "/home/hpmi/Downloads/executables/synapse/server.key"
listeners:
- bind_addresses:
- ::1
- 0.0.0.0
port: 8008
resources:
- compress: false
names:
- client
- federation
tls: true # 2. Change this from false to true
type: http
x_forwarded: true
```
- Now trust these certificates in client. in browser or maybe some apps there might be prompt to trust them so do that. in browser open the server LAN IP(not the client one) in tab and select 'accpet risk and continue'. in case of desktop like linux add them like this. add that crt file in this location `/usr/local/share/ca-certificates/` and then run command for updating `sudo update-ca-certificates`
&nbsp;
for a full ca one use
`openssl req -x509 -newkey rsa:4048 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/CN=localhost" -addext "basicConstraints=critical,CA:TRUE"`
with https there can be issues with client which give no proper option to allow self signed certifciates so best way is to use both and use http where it can be used
in `homeserver.yaml`
```yaml
listeners:
# HTTPS
- port: 8448
bind_addresses:
- "0.0.0.0"
- "::1"
type: http
tls: true
x_forwarded: false
resources:
- names:
- client
- federation
compress: false
# HTTP
- port: 8008
bind_addresses:
- "0.0.0.0"
- "::1"
type: http
tls: false
x_forwarded: false
resources:
- names:
- client
- federation
compress: false
```
Client
Nheko
for managing multiple accounts use profile
`flatpak run im.nheko.Nheko -p default` or `flatpak run im.nheko.Nheko`
if not flatpak and directly installed
`nheko -p default`
for something other than default
`nheko -p work`

View file

@ -0,0 +1,174 @@
spacebar chat
also on
https://sbar.fyi
client on
https://git.sovrahi.com/oh64/Fermo
Date created : 11 feb 2026
**Server setup**
1. Get the files from https://github.com/spacebarchat/server
2. Now make sure to have node, python and psql installed. check version requiremnts on site
3. Install all node depedencies with `npm i`
4. Setup the postgresql database by creating a database say `spacebar` with query `create database spacebar`
5. Create a .env file in root of project and type `postgres://postgres:PASS@localhost:5432/spacebar` here PASS is password. by default password maybe your system one which is used to install program
6. Now run `npm run build` to build distribution files and `npm run start` to execute those
7. There will be error related to invalid values of configs. In database spacebar many tables will be created. One such is config. So update some values. If using cli then execute following queries
```sql
update config set value='"http://localhost:3001"' where key='general_serverName';
update config set value='"http://localhost:3001/api/v9"' where key='api_endpointPublic';
update config set value='"http://localhost:3001"' where key='cdn_endpointPublic';
update config set value='"http://localhost:3001"' where key='cdn_endpointPrivate';
update config set value='"ws://localhost:3001"' where key='gateway_endpointPublic';
```
or
in .env use
```txt
DATABASE=postgres://postgres:PASS@localhost:5432/spacebar
CONFIG_PATH=config.json
STORAGE_LOCATION=/mnt/hdd/files #Optional
```
for more environment variables refer to this
https://docs.spacebar.chat/setup/server/configuration/env/
now the config.json will be created when using npm run start and then mutate the values too. after mutating values this will be config.json
[config.json](../../../../_resources/config.json)
&nbsp;
**Client setup**
1. after cloning and moving to that directory simply `npm run build` and `npm start` will work
2. In order to connect with custom server, add instance like this. here instanced named 'MySpacebar' is added. this file is in `src/webpage/instances.json`
```json
[
{
"name": "Spacebar",
"description": "The official Spacebar instance.",
"image": "https://raw.githubusercontent.com/spacebarchat/spacebarchat/master/branding/png/Spacebar__Icon-Discord.png",
"url": "https://spacebar.chat"
},
{
"name": "MySpacebar",
"description": "My Own Spacebar instance.",
"url": "http://localhost:3001"
},
{
"name": "Fastbar",
"description": "The best Spacebar instance with 95% uptime, running under on a NVME drive running with bleeding edge stuff <3",
"image": "https://spacebar.greysilly7.xyz/logo.png",
"url": "https://greysilly7.xyz",
"language": "en",
"country": "US",
"display": true,
"urls": {
"wellknown": "https://greysilly7.xyz",
"api": "https://api-spacebar.greysilly7.xyz/api",
"cdn": "https://cdn-spacebar.greysilly7.xyz",
"gateway": "wss://gateway-spacebar.greysilly7.xyz"
},
"contactInfo": {
"discord": "greysilly7",
"github": "https://github.com/greysilly7",
"email": "greysilly7@gmail.com"
}
}
]
```
&nbsp;
personal bash script to open server, client and scn server
```sh
#!/bin/bash
SESSION="spacebar_session"
FIRST_COMMAND='nvm use 24 && cd "/home/hpmi/Videos/imp/github_forks/set2/spacebar/server" && npm run start'
# SECOND_COMMAND='nvm use 24 && cd "/home/hpmi/Videos/imp/github_forks/set2/spacebar/spacebar client/Fermi" && npm run start1'
SECOND_COMMAND='nvm use 24 && cd "/home/hpmi/Videos/imp/github_forks/set2/spacebar/spacebar client/Fermo" && caddy run --config ./Caddyfile'
THIRD_COMMAND='cd "/media/hpmi/Seagate/main/symlinks/selfBot/files" && python3 -m http.server 3003'
tmux new-session -d -s $SESSION
#C-m emulates pressing enter key
tmux send-keys -t $SESSION:0 "$FIRST_COMMAND" C-m
#create a new window of index 1 with name 'logs'
tmux new-window -t $SESSION:1 -n "client"
tmux send-keys -t $SESSION:1 "$SECOND_COMMAND" C-m
tmux new-window -t $SESSION:2 -n "cdn_serve"
tmux send-keys -t $SESSION:2 "$THIRD_COMMAND" C-m
tmux attach-session -t $SESSION
```
&nbsp;
fermo
so fork fermo then `npm build`
now for static hosting, make some rewrites
by caddy
```txt
http://localhost:8080 {
root * "/home/hpmi/Videos/imp/github_forks/set2/spacebar/spacebar client/Fermo/dist/webpage"
file_server
# Fallback rewrites for specific path prefixes
rewrite /channels/* /app.html
rewrite /invite/* /invite.html
rewrite /template/* /template.html
# Static file routing with a custom 404 fallback
try_files {path} {path}/ /404.html
}
```
nginx
```
server {
listen 80;
server_name localhost;
root /path/to/fermo/dist/webpage;
index index.html;
location /channels/ {
rewrite ^ /app.html last;
}
location /invite/ {
rewrite ^ /invite.html last;
}
location /template/ {
rewrite ^ /template.html last;
}
# Static files and directories
location / {
try_files $uri $uri/ /404.html;
}
error_page 404 /404.html;
}
```
&nbsp;
for spacebarchat ferno pull requests
You can log in with codeberg or Github or create a full sovrahi account, to send a commit the easiest way is to create a token in the forgejo token and do
https://[yourtoken]@git.sovrahi.com/yourfork
Then create a pull request
how to explain it better hmmm
you go on https://git.sovrahi.com/oh64/Fermo click on "Fork" then confirm
once in your fork copy the link to it (the url should be different)
in your account setting, go in https://git.sovrahi.com/user/settings/applications
Create a new token need to give it read and write for repository
then on your computer (you need git installed) you make a `git clone https://git.sovrahi.com/yoururl` OR this step you can also do git clone `https://[yourtoken]@git.sovrahi.com/yoururl`
but if you do it the first way it will ask for the token when you will try to push
on the fermo repo, on pull request, click on "new pull request" explain your things and create it!
![5719f80d5a9d122e8691c52648e90f60.png](../../../../_resources/5719f80d5a9d122e8691c52648e90f60.png)

View file

@ -0,0 +1,127 @@
xmpp
resources
https://www.reddit.com/r/xmpp/comments/cavyiv/good_xmpp_clients_and_servers/
clients
https://xmpp.org/getting-started/
one such is https://mov.im/login, conversejs
and gajim for windows and linux ie https://github.com/gajim/gajim
- xmpp providers: https://providers.xmpp.net/provider/07f.de/, https://providers.xmpp.net/provider/chapril.org/ (weird capchas) , https://providers.xmpp.net/provider/movim.eu/ (50 mb max file)
https://07f.de/ provides other free services too
dino client
https://github.com/dino/dino/
after building it,to have different profiles
`XDG_DATA_HOME="$HOME/.dino_profiles/work/share" XDG_CONFIG_HOME="$HOME/.dino_profiles/work/config" dino`
or
`XDG_DATA_HOME="$HOME/.dino_profiles/work/" dino`
**server**
prosody
https://prosody.im/doc/installing_from_source
first install lua and all the dependecnies
`apt install lua5.4 liblua5.4-dev libicu-dev libssl-dev`
and also luarocks too
then more lua dependencies using luarocks
to use luarocks directly
`luarocks install luaexpat --local --lua-version=5.4`
similarly do same for luafilesystem and luaunbound too
this can be headache too like setting ssl and all that thing so using snikket can help too, only con is more space required and cant be simply used in termux
**snikket**
https://snikket.org/service/quickstart/
if using podman then add `docker.io/` before images so podman knows to fetch from here
and also change the port too by changing `snikket.conf` and adding these lines
```txt
SNIKKET_TWEAK_HTTP_PORT=5080
SNIKKET_TWEAK_HTTPS_PORT=5443
# The primary domain of your Snikket instance
SNIKKET_DOMAIN=snikket.local
# An email address where the admin can be contacted
# (also used to register your Let's Encrypt account to obtain certificates)
SNIKKET_ADMIN_EMAIL=admin@localhost
```
Also create a `.env` file and
```txt
SNIKKET_DATA_DIR=/home/hpmi/Downloads/executables/Snikket/data
```
and in compose file make these changes
```yml
version: "3.3"
services:
snikket_proxy:
container_name: snikket-proxy
image: docker.io/snikket/snikket-web-proxy:stable
env_file: snikket.conf
network_mode: host
volumes:
- ${SNIKKET_DATA_DIR}:/snikket
- acme_challenges:/var/www/html/.well-known/acme-challenge
restart: "unless-stopped"
snikket_certs:
container_name: snikket-certs
image: docker.io/snikket/snikket-cert-manager:stable
network_mode: host
env_file: snikket.conf
volumes:
- ${SNIKKET_DATA_DIR}:/snikket
- acme_challenges:/var/www/.well-known/acme-challenge
restart: "unless-stopped"
snikket_portal:
container_name: snikket-portal
image: docker.io/snikket/snikket-web-portal:stable
network_mode: host
env_file: snikket.conf
restart: "unless-stopped"
snikket_server:
container_name: snikket
image: docker.io/snikket/snikket-server:stable
network_mode: host
volumes:
- ${SNIKKET_DATA_DIR}:/snikket
env_file: snikket.conf
restart: "unless-stopped"
volumes:
acme_challenges:
```
so for localhost, need to generate fake certificates
```sh
# 1. Create the new folder structure matching the domain
mkdir -p /your/custom/path/letsencrypt/live/snikket.local/
# 2. Generate the certificate with Multi-SAN support
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
-keyout /your/custom/path/letsencrypt/live/snikket.local/privkey.pem \
-out /your/custom/path/letsencrypt/live/snikket.local/fullchain.pem \
-subj "/CN=snikket.local" \
-addext "subjectAltName=DNS:snikket.local,DNS:localhost,IP:127.0.0.1,IP:
```
in `/etc/hosts`
```txt
127.0.0.1 snikket.local share.snikket.local
```
using this will give invite link for admin
`docker exec snikket create-invite --admin --group default`
since port 5443 is used so add that. eg
`https://snikket.local:5443/invite/PP46bac4bk0wxHD50RbR7_6G/`