subdomain ayarları

This commit is contained in:
Sedat ÖZTÜRK 2025-05-23 11:53:46 +03:00
parent b04567bab6
commit d64a419396
8 changed files with 35 additions and 27 deletions

View file

@ -2,7 +2,7 @@
"App": { "App": {
"SelfUrl": "https://kurs-api.sozsoft.com", "SelfUrl": "https://kurs-api.sozsoft.com",
"ClientUrl": "https://kurs.sozsoft.com", "ClientUrl": "https://kurs.sozsoft.com",
"CorsOrigins": "https://kurs.sozsoft.com", "CorsOrigins": "https://kurs.sozsoft.com,https://demo.sozsoft.com",
"RedirectAllowedUrls": "https://kurs.sozsoft.com,https://kurs.sozsoft.com/authentication/callback", "RedirectAllowedUrls": "https://kurs.sozsoft.com,https://kurs.sozsoft.com/authentication/callback",
"AttachmentsPath": "/etc/api/mail-queue/attachments", "AttachmentsPath": "/etc/api/mail-queue/attachments",
"CdnPath": "/etc/api/cdn" "CdnPath": "/etc/api/cdn"

View file

@ -27,7 +27,7 @@ const Hero: React.FC = () => {
<div className="flex flex-col md:flex-row justify-center gap-6 mb-16"> <div className="flex flex-col md:flex-row justify-center gap-6 mb-16">
<Link <Link
to="/demo" to="/contact"
className="inline-flex items-center justify-center px-8 py-4 bg-gradient-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 text-white rounded-lg font-semibold transition-all transform hover:scale-105" className="inline-flex items-center justify-center px-8 py-4 bg-gradient-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 text-white rounded-lg font-semibold transition-all transform hover:scale-105"
> >
{t('hero.cta.consultation')} {t('hero.cta.consultation')}

View file

@ -105,8 +105,11 @@
- sedat.ozturk isimli kullanıcı tanımlanacak. - sedat.ozturk isimli kullanıcı tanımlanacak.
- "kurs" isimli new organization tanımlanacak. - "kurs" isimli new organization tanımlanacak.
- "kurs-platform" isimli repository kurs organizasyonunun içerisine tanımlanacak. - "kurs-platform" isimli repository kurs organizasyonunun içerisine tanımlanacak.
- Fork üzerinden Remotes tanımlaması yapılacak. Remote: devops.sozsoft.com RepositoryUrl: https://devops.sozsoft.com/kurs/kurs-platform - Fork üzerinden https://devops.sozsoft.com/user/settings/applications kısmına "sozsoft.com" ismiyle Access Token ekle. Eklenen token bilgisi Fork içerisinde kullanılacak.
- Fork üzerinden Authorization işlemi yapılacak URL kısmı localhost olarak geliyor. Onu devops.sozsoft.com olarak değiştirmek gerekiyor. - Fork üzerinden Remotes tanımlaması yapılacak.
Remote: devops.sozsoft.com
RepositoryUrl: https://sedat.ozturk:1b48921c4cc6cd5c79e8ac121ede9f78afd1d9be@devops.sozsoft.com/kurs/kurs-platform.git
- https://devops.sozsoft.com/user/settings/applications sayfasında OAuth2 kısmında "sozsoft.com" ismiyle Application Name eklenecek. Redirect URL kısmında https://devops.sozsoft.com eklenecektir.
## docker-compose-devops.yml kurulumu ## docker-compose-devops.yml kurulumu

View file

@ -63,24 +63,6 @@ server {
} }
} }
# kurs.sozsoft.com
server {
listen 443 ssl http2;
server_name kurs.sozsoft.com;
ssl_certificate /etc/ssl/sozsoft.com/cert1.pem;
ssl_certificate_key /etc/ssl/sozsoft.com/privkey1.pem;
underscores_in_headers on;
ignore_invalid_headers off;
large_client_header_buffers 4 16k;
location / {
proxy_pass http://127.0.0.1:3002; # PORT belirtildi
include /etc/nginx/proxy_params;
}
}
# sozsoft.com # sozsoft.com
server { server {
listen 443 ssl http2; listen 443 ssl http2;
@ -126,3 +108,21 @@ server {
include /etc/nginx/proxy_params; include /etc/nginx/proxy_params;
} }
} }
# *.sozsoft.com
server {
listen 443 ssl http2;
server_name *.sozsoft.com;
ssl_certificate /etc/ssl/sozsoft.com/cert1.pem;
ssl_certificate_key /etc/ssl/sozsoft.com/privkey1.pem;
underscores_in_headers on;
ignore_invalid_headers off;
large_client_header_buffers 4 16k;
location / {
proxy_pass http://127.0.0.1:3002; # PORT belirtildi
include /etc/nginx/proxy_params;
}
}

View file

@ -61,6 +61,8 @@ const Login = () => {
const { signIn } = useAuth() const { signIn } = useAuth()
const { translate } = useLocalization() const { translate } = useLocalization()
const defaultSubDomain = 'KURS'
const getSubdomain = () => { const getSubdomain = () => {
if (typeof window === 'undefined') return null if (typeof window === 'undefined') return null
@ -72,6 +74,10 @@ const Login = () => {
return null return null
} }
if (parts[0].toUpperCase() === defaultSubDomain) {
return null
}
if (parts[0] === 'www') { if (parts[0] === 'www') {
return parts[1] return parts[1]
} }
@ -168,10 +174,9 @@ const Login = () => {
} }
const subDomainName = getSubdomain() const subDomainName = getSubdomain()
//const subDomainName = 'KURS2'
const tenantId = useStoreState((a) => a.auth.tenantId) ?? subDomainName const tenantId = useStoreState((a) => a.auth.tenantId) ?? subDomainName
const tenantStyle: React.CSSProperties | undefined = const tenantStyle: React.CSSProperties | undefined =
subDomainName && subDomainName !== 'KURS' subDomainName && subDomainName !== defaultSubDomain
? { ? {
opacity: 0, opacity: 0,
position: 'absolute', position: 'absolute',
@ -211,7 +216,7 @@ const Login = () => {
value={tenantId || ''} value={tenantId || ''}
onChange={(e) => setTenantId(e.target.value)} onChange={(e) => setTenantId(e.target.value)}
style={tenantStyle} style={tenantStyle}
aria-hidden={subDomainName && subDomainName !== 'KURS' ? 'true' : 'false'} //aria-hidden={subDomainName && subDomainName !== defaultSubDomain ? 'true' : 'false'}
/> />
</div> </div>
</> </>

View file

@ -62,6 +62,6 @@ export default defineConfig({
host: '0.0.0.0', host: '0.0.0.0',
port: 80, port: 80,
open: false, open: false,
allowedHosts: ['kurs-dev.sozsoft.com', 'kurs.sozsoft.com', 'localhost'], allowedHosts: ['kurs-dev.sozsoft.com', 'kurs.sozsoft.com', 'localhost', 'demo.sozsoft.com'],
}, },
}) })