Revert "Merge branch 'main' into api/v1/instance"

This reverts commit 077611411a, reversing
changes made to 4ef9d98e12.
pull/366/head
Jorge Caballero (DataDrivenMD) 2023-03-02 14:29:18 -08:00
rodzic 077611411a
commit 1a38165274
6 zmienionych plików z 17 dodań i 25 usunięć

Wyświetl plik

@ -4,7 +4,6 @@ on:
branches:
- main
repository_dispatch:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest

Wyświetl plik

@ -64,4 +64,4 @@ export type PollsConfiguration = {
max_characters_per_option: number
min_expiration: number
max_expiration: number
}
}

Wyświetl plik

@ -14,21 +14,15 @@ export function parseHandle(query: string): Handle {
query = decodeURIComponent(query)
const parts = query.split('@')
if (parts.length > 0) {
const localPart = parts[0]
const localPart = parts[0]
if (!/^[\w-.]+$/.test(localPart)) {
throw new Error('invalid handle: localPart: ' + localPart)
}
if (!/^[\w-.]+$/.test(localPart)) {
throw new Error('invalid handle: localPart: ' + localPart)
}
if (parts.length > 1) {
return { localPart, domain: parts[1] }
} else {
return { localPart, domain: null }
}
if (parts.length > 1) {
return { localPart, domain: parts[1] }
} else {
// it's a URI handle?
const urlParts = query.replace(/^https?:\/\//, '').split('/')
return { domain: urlParts[0], localPart: urlParts[urlParts.length - 1] }
return { localPart, domain: null }
}
}

Wyświetl plik

@ -2,4 +2,4 @@ import type { DefaultImages } from '../backend/src/types/configs'
export const defaultImages: DefaultImages = {
avatar: 'https://raw.githubusercontent.com/mastodon/mastodon/main/public/avatars/original/missing.png',
header: 'https://imagedelivery.net/NkfPDviynOyTAOI79ar_GQ/b24caf12-5230-48c4-0bf7-2f40063bd400/header',
}
}

Wyświetl plik

@ -81,4 +81,4 @@ export async function handleRequest(domain: string, db: Database, env: Env) {
rules: [],
}
return new Response(JSON.stringify(res), { headers })
}
}

Wyświetl plik

@ -143,13 +143,12 @@ resource "cloudflare_pages_project" "wildebeest_pages_project" {
}
resource "cloudflare_record" "record" {
allow_overwrite = true
zone_id = trimspace(var.cloudflare_zone_id)
name = trimspace(var.cloudflare_deploy_domain)
value = cloudflare_pages_project.wildebeest_pages_project.subdomain
type = "CNAME"
ttl = 1
proxied = true
zone_id = trimspace(var.cloudflare_zone_id)
name = trimspace(var.cloudflare_deploy_domain)
value = cloudflare_pages_project.wildebeest_pages_project.subdomain
type = "CNAME"
ttl = 1
proxied = true
}
resource "cloudflare_pages_domain" "domain" {
@ -168,6 +167,6 @@ resource "cloudflare_access_application" "wildebeest_access" {
name = "wildebeest-${lower(var.name_suffix)}"
domain = "${trimspace(var.cloudflare_deploy_domain)}/oauth/authorize"
type = "self_hosted"
session_duration = "24h"
session_duration = "730h"
auto_redirect_to_identity = false
}