Skip to content
Open
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
3 changes: 3 additions & 0 deletions ansible/roles/distributed_press/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
- name: "Enable libp2p WebSocket TCP traffic through firewall"
shell: "ufw allow in 4002/tcp"

- name: "Enable libp2p WebSocket Secure (WSS) traffic through firewall on port 4003"
shell: "ufw allow in 4003/tcp"

- name: "Enable libp2p WebRTC UDP traffic through firewall (50000-60000)"
shell: "ufw allow 50000:60000/udp"

Expand Down
4 changes: 3 additions & 1 deletion api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export type APIConfig = Partial<{
useSigIntHandler: boolean
useWebringDirectoryListing: boolean
useWebRTC: boolean
useQUIC: boolean
}> & ServerI

async function apiBuilder (cfg: APIConfig): Promise<FastifyTypebox> {
Expand All @@ -56,7 +57,8 @@ async function apiBuilder (cfg: APIConfig): Promise<FastifyTypebox> {
const protocols = new ConcreteProtocolManager({
ipfs: {
path: path.join(protocolStoragePath, 'ipfs'),
useWebRTC: cfg.useWebRTC ?? true
useWebRTC: cfg.useWebRTC ?? true,
useQUIC: cfg.useQUIC ?? true
},
hyper: {
path: path.join(protocolStoragePath, 'hyper')
Expand Down
7 changes: 5 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const argv = yargs(hideBin(process.argv)).options({
host: { type: 'string' },
domain: { type: 'string' },
data: { type: 'string' },
useWebRTC: { type: 'boolean', default: undefined }
useWebRTC: { type: 'boolean', default: undefined },
useQUIC: { type: 'boolean', default: undefined }
}).parseSync()

export interface ServerI {
Expand All @@ -38,6 +39,7 @@ export interface ServerI {
domain: string
storage: string
useWebRTC?: boolean
useQUIC?: boolean
}

const cfg: ServerI = {
Expand All @@ -46,7 +48,8 @@ const cfg: ServerI = {
host: argv.host ?? process.env.HOST ?? '0.0.0.0',
domain: argv.domain ?? process.env.DOMAIN ?? 'localhost',
storage: argv.data ?? paths.data,
useWebRTC: argv.useWebRTC ?? (process.env.USE_WEBRTC?.toLowerCase() === 'false' ? false : process.env.CI !== 'true')
useWebRTC: argv.useWebRTC ?? (process.env.USE_WEBRTC?.toLowerCase() === 'false' ? false : process.env.CI !== 'true'),
useQUIC: argv.useQUIC ?? (process.env.USE_QUIC?.toLowerCase() === 'false' ? false : process.env.CI !== 'true')
}

const server = await apiBuilder({
Expand Down
Loading
Loading