Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,43 @@ server {
proxy_pass http://wallet_service;
}

# Blossom file storage routes
location /blossom/ {
proxy_pass http://panel_service;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# Disable buffering for file uploads/downloads
proxy_buffering off;
proxy_request_buffering off;

# Set appropriate headers
proxy_set_header Accept-Encoding "";

# Larger timeouts for file operations
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_connect_timeout 60s;
}

# Default location - Panel service (frontend + API) - MUST BE LAST
location / {
# Add CORS headers for the panel service
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization' always;

# Handle preflight OPTIONS requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization';
add_header 'Content-Length' 0;
return 204;
}

proxy_pass http://panel_service;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
Expand Down
37 changes: 36 additions & 1 deletion fixed_nginx_config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,43 @@ server {
proxy_pass http://wallet_service;
}

# Blossom file storage routes
location /blossom/ {
proxy_pass http://panel_service;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# Disable buffering for file uploads/downloads
proxy_buffering off;
proxy_request_buffering off;

# Set appropriate headers
proxy_set_header Accept-Encoding "";

# Larger timeouts for file operations
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_connect_timeout 60s;
}

# Default location - Panel service (frontend + API) - MUST BE LAST
location / {
# Add CORS headers for the panel service
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization' always;

# Handle preflight OPTIONS requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization';
add_header 'Content-Length' 0;
return 204;
}

proxy_pass http://panel_service;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
Expand All @@ -98,4 +133,4 @@ server {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
}
71 changes: 46 additions & 25 deletions src/components/relay-settings/layouts/DesktopLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ import { NetworkSection } from '@app/components/relay-settings/sections/NetworkS
import { KindsSection } from '@app/components/relay-settings/sections/KindsSection';
import { MediaSection } from '@app/components/relay-settings/sections/MediaSection';
import { ModerationSection } from '@app/components/relay-settings/sections/ModerationSection';
import { CollapsibleSection } from '@app/components/relay-settings/shared/CollapsibleSection/CollapsibleSection';
import { BaseSwitch } from '@app/components/common/BaseSwitch/BaseSwitch';
import { useTranslation } from 'react-i18next';

interface DesktopLayoutProps {
mode: string;
onModeChange: (checked: boolean) => void;
allowUnregisteredKinds: boolean;
registeredKinds: number[];
onAllowUnregisteredKindsChange: (allowed: boolean) => void;
onSaveClick: () => void;
loadings: boolean[];
// Network section props
Expand Down Expand Up @@ -65,8 +68,9 @@ interface DesktopLayoutProps {
}

export const DesktopLayout: React.FC<DesktopLayoutProps> = ({
mode,
onModeChange,
allowUnregisteredKinds,
registeredKinds,
onAllowUnregisteredKindsChange,
onSaveClick,
loadings,
// Network props
Expand Down Expand Up @@ -120,28 +124,46 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = ({
</BaseRow>

<BaseCol xs={24}>
<S.SwitchContainer
style={{
width: '11rem',
display: 'grid',
paddingTop: '3rem',
gap: '.5rem',
gridTemplateColumns: '1fr 3fr',
marginBottom: '1.5rem',
}}
>
<S.LabelSpan>{t('common.serverSetting')}</S.LabelSpan>
<S.LargeSwitch
className="modeSwitch"
checkedChildren="Whitelist"
unCheckedChildren="Blacklist"
checked={mode === 'whitelist'}
onChange={onModeChange}
/>
</S.SwitchContainer>
<CollapsibleSection header="Allow Unregistered Kind Numbers">
<S.Card>
<BaseCol span={24}>
<div style={{ display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between' }}>
<div style={{ flex: 1, marginRight: '2rem' }}>
<h4 style={{ margin: '0 0 0.5rem 0', fontSize: '1rem', fontWeight: 500 }}>
{t('common.allowUnregisteredKinds')}
</h4>
<p style={{ margin: 0, fontSize: '0.9rem', color: '#c5d3e0' }}>
Enable this to allow events with kind numbers that don&apos;t have specific handlers in the relay.
</p>
{allowUnregisteredKinds && (
<div style={{
marginTop: '1rem',
padding: '0.75rem 1rem',
backgroundColor: 'rgba(255, 77, 79, 0.1)',
borderRadius: '4px',
border: '1px solid rgba(255, 77, 79, 0.3)'
}}>
<span style={{ color: '#ff4d4f', fontSize: '0.9rem', display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
<span style={{ fontSize: '1.2rem' }}>⚠️</span>
{t('common.allowUnregisteredKindsWarning')}
</span>
</div>
)}
</div>
<BaseSwitch
checkedChildren="ON"
unCheckedChildren="OFF"
checked={allowUnregisteredKinds}
onChange={onAllowUnregisteredKindsChange}
/>
</div>
</BaseCol>
</S.Card>
</CollapsibleSection>

<KindsSection
mode={mode}
allowUnregisteredKinds={allowUnregisteredKinds}
registeredKinds={registeredKinds}
isKindsActive={isKindsActive}
selectedKinds={selectedKinds}
dynamicKinds={dynamicKinds}
Expand All @@ -154,7 +176,6 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = ({
/>

<MediaSection
mode={mode}
photos={photos}
videos={videos}
audio={audio}
Expand Down
73 changes: 49 additions & 24 deletions src/components/relay-settings/layouts/MobileLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ import { NetworkSection } from '@app/components/relay-settings/sections/NetworkS
import { KindsSection } from '@app/components/relay-settings/sections/KindsSection';
import { MediaSection } from '@app/components/relay-settings/sections/MediaSection';
import { ModerationSection } from '@app/components/relay-settings/sections/ModerationSection';
import { CollapsibleSection } from '@app/components/relay-settings/shared/CollapsibleSection/CollapsibleSection';
import { BaseSwitch } from '@app/components/common/BaseSwitch/BaseSwitch';
import { useTranslation } from 'react-i18next';

interface MobileLayoutProps {
mode: string;
onModeChange: (checked: boolean) => void;
allowUnregisteredKinds: boolean;
registeredKinds: number[];
onAllowUnregisteredKindsChange: (allowed: boolean) => void;
onSaveClick: () => void;
loadings: boolean[];
// Network section props
Expand Down Expand Up @@ -62,8 +65,9 @@ interface MobileLayoutProps {
}

export const MobileLayout: React.FC<MobileLayoutProps> = ({
mode,
onModeChange,
allowUnregisteredKinds,
registeredKinds,
onAllowUnregisteredKindsChange,
onSaveClick,
loadings,
// Network props
Expand Down Expand Up @@ -111,27 +115,49 @@ export const MobileLayout: React.FC<MobileLayoutProps> = ({
onModerationModeChange={onModerationModeChange}
/>

<S.SwitchContainer
style={{
display: 'grid',
paddingTop: '2rem',
gridTemplateColumns: '5rem 6.5rem',
marginBottom: '1.5rem',
marginTop: '1rem',
}}
>
<S.LabelSpan>{t('common.serverSetting')}</S.LabelSpan>
<S.LargeSwitch
className="modeSwitch"
checkedChildren="Whitelist"
unCheckedChildren="Blacklist"
checked={mode === 'whitelist'}
onChange={onModeChange}
/>
</S.SwitchContainer>
<CollapsibleSection header="Allow Unregistered Kind Numbers">
<S.Card>
<BaseCol span={24}>
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
<div>
<h4 style={{ margin: '0 0 0.5rem 0', fontSize: '1rem', fontWeight: 500 }}>
{t('common.allowUnregisteredKinds')}
</h4>
<p style={{ margin: 0, fontSize: '0.85rem', color: '#c5d3e0' }}>
Enable this to allow events with kind numbers that don&apos;t have specific handlers in the relay.
</p>
</div>

<div style={{ display: 'flex', justifyContent: 'flex-start' }}>
<BaseSwitch
checkedChildren="ON"
unCheckedChildren="OFF"
checked={allowUnregisteredKinds}
onChange={onAllowUnregisteredKindsChange}
/>
</div>

{allowUnregisteredKinds && (
<div style={{
padding: '0.75rem',
backgroundColor: 'rgba(255, 77, 79, 0.1)',
borderRadius: '4px',
border: '1px solid rgba(255, 77, 79, 0.3)'
}}>
<span style={{ color: '#ff4d4f', fontSize: '0.85rem', display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
<span style={{ fontSize: '1.1rem' }}>⚠️</span>
{t('common.allowUnregisteredKindsWarning')}
</span>
</div>
)}
</div>
</BaseCol>
</S.Card>
</CollapsibleSection>

<KindsSection
mode={mode}
allowUnregisteredKinds={allowUnregisteredKinds}
registeredKinds={registeredKinds}
isKindsActive={isKindsActive}
selectedKinds={selectedKinds}
dynamicKinds={dynamicKinds}
Expand All @@ -144,7 +170,6 @@ export const MobileLayout: React.FC<MobileLayoutProps> = ({
/>

<MediaSection
mode={mode}
photos={photos}
videos={videos}
audio={audio}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { AddKindForm } from './components/AddKindForm';
import { DynamicKindsList } from './components/DynamicKindsList';

export interface KindsSectionProps {
mode: string;
allowUnregisteredKinds: boolean;
registeredKinds: number[];
isKindsActive: boolean;
selectedKinds: string[];
dynamicKinds: string[];
Expand All @@ -22,7 +23,8 @@ export interface KindsSectionProps {
}

export const KindsSection: React.FC<KindsSectionProps> = ({
mode,
allowUnregisteredKinds,
registeredKinds,
isKindsActive,
selectedKinds,
dynamicKinds,
Expand All @@ -33,37 +35,34 @@ export const KindsSection: React.FC<KindsSectionProps> = ({
onAddKind,
onRemoveKind,
}) => {
const header = mode !== 'whitelist' ? 'Blacklisted Kind Numbers' : 'Kind Numbers';
const header = 'Event Kinds Configuration';

return (
<CollapsibleSection header={header}>
<S.Card>
<div className="flex-col w-full">
{mode !== 'blacklist' && mode !== '' && (
<div className="switch-container">
<BaseSwitch
checkedChildren="ON"
unCheckedChildren="OFF"
checked={isKindsActive}
onChange={() => onKindsActiveChange(!isKindsActive)}
/>
</div>
)}
<div className="switch-container">
<BaseSwitch
checkedChildren="ON"
unCheckedChildren="OFF"
checked={isKindsActive}
onChange={() => onKindsActiveChange(!isKindsActive)}
/>
</div>

<KindsList
mode={mode}
selectedKinds={selectedKinds}
isKindsActive={isKindsActive}
onKindsChange={onKindsChange}
/>

<AddKindForm
mode={mode}
<AddKindForm
onAddKind={onAddKind}
/>

<DynamicKindsList
mode={mode}
allowUnregisteredKinds={allowUnregisteredKinds}
registeredKinds={registeredKinds}
dynamicKinds={dynamicKinds}
selectedDynamicKinds={selectedDynamicKinds}
onDynamicKindsChange={onDynamicKindsChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import { BaseButton } from '@app/components/common/BaseButton/BaseButton';

interface AddKindFormProps {
onAddKind: (kind: string) => void;
mode: string;
}

export const AddKindForm: React.FC<AddKindFormProps> = ({ onAddKind, mode }) => {
export const AddKindForm: React.FC<AddKindFormProps> = ({ onAddKind }) => {
const [newKind, setNewKind] = useState('');

const handleAddKind = () => {
Expand All @@ -23,7 +22,7 @@ export const AddKindForm: React.FC<AddKindFormProps> = ({ onAddKind, mode }) =>

return (
<div style={{ padding: '1.5rem 0rem 0rem 0rem', display: 'flex', flexDirection: 'column', gap: '.5rem' }}>
<h3>{mode === 'blacklist' ? 'Add Custom Kind to Whitelist' : 'Add Custom Kind'}</h3>
<h3>Add Custom Kind</h3>
<div style={{ display: 'flex' }} className="custom-checkbox-group grid-checkbox-group large-label">
<Input
value={newKind}
Expand Down
Loading