ubergeek77/Lemmy-Easy-Deploy

Add support for www.domain.com

Closed this issue · 4 comments

Did you check the FAQ & Troubleshooting section for answers to common questions and issues?

Yes

Describe the issue

www.mydomain.com is not working with current build
mydomain.com is working. Just not if added www

Diagnostic Information

==== Docker Information ====
Detected runtime: docker (Docker version 20.10.24+dfsg1, build 297e128)
Detected compose: docker-compose (docker-compose version 1.29.2, build unknown)
Runtime state: OK


WARNING: Your version of Docker Compose is outdated and unsupported.
Docker Compose v2 has been Generally Available (GA) for over 1 year,
and as of June 2023, Docker Compose v1 has been officially deprecated
by Docker Inc.
https://www.docker.com/blog/new-docker-compose-v2-and-v1-deprecation/
Popular Linux distributions, such as Debian and Ubuntu, are still distributing
outdated and unofficial packages of Docker and Docker Compose.
However, those packages are neither supported nor endorsed by Docker Inc.
Lemmy-Easy-Deploy might still work regardless, but testing is only done
with Docker Compose v2. Compose v1 is not supported.
For the best experience, please install the official version of Docker:
https://docs.docker.com/engine/install/

==== System Information ====
OS: Linux
KERNEL: 6.1.0-9-cloud-amd64 (x86_64)
HOSTNAME: OK
SHELL: bash
MEMORY:
total used free shared buff/cache available
Mem: 7.7Gi 1.1Gi 2.4Gi 70Mi 4.6Gi 6.6Gi
Swap: 0B 0B 0B
DISTRO:

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_CODENAME=bookworm

==== Lemmy-Easy-Deploy Information ====
Version: 1.2.8
IMAGE CREATED STATUS
caddy:latest 7 hours ago Up 7 hours
ghcr.io/ubergeek77/lemmy-ui:0.18.2 7 hours ago Up 7 hours
ghcr.io/ubergeek77/lemmy:0.18.2 7 hours ago Up 7 hours
asonix/pictrs:0.4.0 7 hours ago Up 7 hours
postgres:15-alpine 7 hours ago Up 7 hours
Integrity:
074ae41957936daac883c66bcac0ca12093343ef5e923752689b936b3c6b1b25 ./deploy.sh
1e9b0c0988998dcc33cb0fbfdb0e1679229424e724f898b797380adc7d102446 ./templates/Caddy-Dockerfile.template
c1202e70662dd2228da36a35a0f38ec8fc81bec8964d7315d02e8671a58dd7d7 ./templates/Caddyfile.template
2537678c7971df36c1ed95f4228d3cfcb15bb4a28a60d939eaf8dd75b5d64a36 ./templates/cloudflare.snip
c494a610bcb4cd1cfc0a4fe4fb0f6d437b2a84a0ad1625daee240e6dd6f1c910 ./templates/compose-email-volumes.snip
c9cb4c5fee12930e17798a02ae1bd12e2dc69e149a394c24511bc9d4e6b776d4 ./templates/compose-email.snip
f5325a9e26b29da51c6d3295aa278ff08ce71ffd2cd63dc4bebf00e54c468899 ./templates/docker-compose.yml.template
1c202b1b6e87c65b2fcda6035c9fe3f8631d76662907ffd38f24b14686e30647 ./templates/lemmy-email.snip
c834cdce9eaf77f38155b404724fdfe66845575386ee516987452aa715642a6f ./templates/lemmy.hjson.template
Custom Files:
*** No custom files ***
==== Settings ====
CLOUDFLARE: No
CADDY_DISABLE_TLS: false
CADDY_HTTP_PORT: 80
CADDY_HTTPS_PORT: 443
LEMMY_TLS_ENABLED: true
ENABLE_EMAIL: false
SMTP_PORT: 25
ENABLE_POSTFIX: false
POSTGRES_POOL_SIZE: 5
==== Generated Files ====
Deploy Version: 0.18.2;0.18.2
total 44K
drwxr-xr-x 2 0 0 4.0K Jul 22 13:10 caddy
-rw-r--r-- 1 0 0 30 Jul 22 13:13 caddy.env
-rw-r--r-- 1 0 0 1.7K Jul 22 13:13 docker-compose.yml
drwxr-xr-x 14 0 0 4.0K Jul 22 13:13 lemmy
drwxr-xr-x 7 0 0 4.0K Jul 22 13:13 lemmy-ui
-rw-r--r-- 1 0 0 50 Jul 19 22:49 lemmy.env
-rw-r--r-- 1 0 0 471 Jul 22 13:13 lemmy.hjson
-rw-r--r-- 1 0 0 49 Jul 19 22:49 pictrs.env
-rw-r--r-- 1 0 0 34 Jul 22 13:13 postfix.env
-rw-r--r-- 1 0 0 51 Jul 19 22:49 postgres.env
-rw-r--r-- 1 0 0 14 Jul 22 06:17 version

Sorry, but this is not an issue in Lemmy-Easy-Deploy, and technically speaking it isn't really an issue.

The internet does not use www anymore. In the modern internet, www.domain.com is no different than any other subdomain. You are essentially trying to have Lemmy accessible from two distinct domains.

Lemmy only supports being available at a single domain, so I cannot support situations where the user wants to use two domains at once, www or not.

Maybe an option for a redirect? If I put in for example "domain" and press ctrl enter on my browser, it will automatically make it "www.domain.com" . There are several shortcuts still present in pretty much all browsers to this day to automatically complete for certain domain types. That's at least one of the reasons why pretty much all websites still support it.

Lemmy fundamentally does not support being accessed from different domains. This is just how ActivityPub works.

A redirect could work, but it's an advanced use case with little benefit, and unfortunately I will not be adding an option for this. Please just use the regular domain.

If you must have www for some reason, you can check out the Advanced Configuration page on this repo and modify the Caddyfile template accordingly 👍

Will do. Thank you