moved domain
This commit is contained in:
@@ -5,4 +5,4 @@ A AIChat Client, but better.
|
||||
|
||||
Msi version: https://github.com/kwaroran/RisuAI-release/releases
|
||||
|
||||
Web version: http://risu.pages.dev/
|
||||
Web version: http://risuai.xyz/
|
||||
|
||||
@@ -3,14 +3,14 @@ export function onRequest(context) {
|
||||
return drive(request, context.env);
|
||||
}
|
||||
|
||||
const encodedRedirectUri = encodeURIComponent("https://risu.pages.dev/")
|
||||
const encodedRedirectUri = encodeURIComponent("https://risuai.xyz/")
|
||||
|
||||
async function drive(request, env){
|
||||
|
||||
const url = new URL(request.url);
|
||||
|
||||
const headerE = {
|
||||
"Access-Control-Allow-Origin": "https://risu.pages.dev",
|
||||
"Access-Control-Allow-Origin": "https://risuai.xyz",
|
||||
"Access-Control-Allow-Headers": "*"
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ async function fetchProxy(request) {
|
||||
const status = originalResponse.status;
|
||||
let newResponseHeaders = new Headers(responseHeaders);
|
||||
|
||||
newResponseHeaders.set('access-control-allow-origin', 'https://risu.pages.dev/');
|
||||
newResponseHeaders.set('access-control-allow-origin', 'https://risuai.xyz/');
|
||||
newResponseHeaders.set('access-control-allow-credentials', "true");
|
||||
newResponseHeaders.delete('content-security-policy');
|
||||
newResponseHeaders.delete('content-security-policy-report-only');
|
||||
|
||||
@@ -10,7 +10,7 @@ import { open } from '@tauri-apps/api/shell';
|
||||
|
||||
export async function checkDriver(type:'save'|'load'|'loadtauri'|'savetauri'){
|
||||
const CLIENT_ID = '580075990041-l26k2d3c0nemmqiu3d3aag01npfrkn76.apps.googleusercontent.com';
|
||||
const REDIRECT_URI = 'https://risu.pages.dev/';
|
||||
const REDIRECT_URI = `https://${location.host}/`
|
||||
const SCOPE = 'https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.appdata';
|
||||
const encodedRedirectUri = encodeURIComponent(REDIRECT_URI);
|
||||
const authorizationUrl = `https://accounts.google.com/o/oauth2/auth?client_id=${CLIENT_ID}&redirect_uri=${encodedRedirectUri}&scope=${SCOPE}&response_type=code&state=${type}`;
|
||||
|
||||
@@ -8,7 +8,7 @@ import { get } from "svelte/store";
|
||||
import { DataBase, loadedStore, setDatabase, type Database, updateTextTheme, defaultSdDataFunc } from "./database";
|
||||
import pako from "pako";
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
import { checkUpdate } from "./update";
|
||||
import { checkOldDomain, checkUpdate } from "./update";
|
||||
import { selectedCharID } from "./stores";
|
||||
import { Body, ResponseType, fetch as TauriFetch } from "@tauri-apps/api/http";
|
||||
import { loadPlugins } from "./process/plugins";
|
||||
@@ -265,6 +265,7 @@ export async function loadData() {
|
||||
else{
|
||||
usingSw = false
|
||||
}
|
||||
checkOldDomain()
|
||||
}
|
||||
try {
|
||||
await pargeChunks()
|
||||
@@ -465,7 +466,7 @@ export async function globalFetch(url:string, arg:{body?:any,headers?:{[key:stri
|
||||
headers["Content-Type"] = `application/json`
|
||||
}
|
||||
if(arg.rawResponse){
|
||||
const furl = new URL("https://risu.pages.dev/proxy")
|
||||
const furl = new URL("/proxy")
|
||||
furl.searchParams.set("url", url)
|
||||
|
||||
const da = await fetch(furl, {
|
||||
@@ -481,7 +482,7 @@ export async function globalFetch(url:string, arg:{body?:any,headers?:{[key:stri
|
||||
}
|
||||
}
|
||||
else{
|
||||
const furl = new URL("https://risu.pages.dev/proxy")
|
||||
const furl = new URL("/proxy")
|
||||
furl.searchParams.set("url", url)
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ convertor.setOption('simpleLineBreaks', true);
|
||||
|
||||
export function ParseMarkdown(data:string) {
|
||||
return DOMPurify.sanitize(convertor.makeHtml(data), {
|
||||
FORBID_TAGS: ['a']
|
||||
FORBID_TAGS: []
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { fetch } from "@tauri-apps/api/http";
|
||||
import { DataBase, appVer, setDatabase } from "./database";
|
||||
import { alertConfirm } from "./alert";
|
||||
import { alertConfirm, alertMd } from "./alert";
|
||||
import { language } from "../lang";
|
||||
import { get } from "svelte/store";
|
||||
import {open} from '@tauri-apps/api/shell'
|
||||
|
||||
const isOldDomain = location.hostname.includes('pages.dev')
|
||||
|
||||
export async function checkUpdate(){
|
||||
try {
|
||||
@@ -49,3 +50,31 @@ function versionStringToNumber(versionString:string):number {
|
||||
.join("")
|
||||
);
|
||||
}
|
||||
|
||||
export function checkOldDomain(){
|
||||
let db = get(DataBase)
|
||||
if(true){
|
||||
if(!db.didFirstSetup){
|
||||
location.href = 'https://risuai.xyz'
|
||||
alertMd("Redirecting...")
|
||||
return
|
||||
}
|
||||
if(db.language === 'ko'){
|
||||
alertMd("# 웹 버전 RisuAI의 도메인이 **risuai.xyz**로 변경되었습니다"
|
||||
+ "\n\nRisuAI의 현재 도메인 risu.pages.dev는 클라우드플레어의 기본 도메인으로, 뭔가를 하기 힘든 구조입니다. 그래서 도메인을 옮기기로 했습니다."
|
||||
+ "\n\n현재 도메인인 risu.pages.dev은 언젠가 셧다운됩니다."
|
||||
+ "\n\n**브라우저는 교차 도메인 저장소를 허용하지 않으므로 설정에서 Google 드라이브에 백업/로드해서 데이터를 옮기거나 새 도메인으로 수동으로 옮겨야합니다. 그렇지 않은 경우 이 도메인이 셧다운 될 때, 데이터는 영원히 사라집니다.**"
|
||||
+ "\n\n[새로운 도메인 링크](https://risuai.xyz/)."
|
||||
)
|
||||
}
|
||||
else{
|
||||
alertMd("# Web version RisuAI's domain has transfered to **risuai.xyz**"
|
||||
+ "\n\nRisuAI's domain risu.pages.dev is cloudflare's default domain name, which we can't do something freely. so we decided to move to another domain."
|
||||
+ "\n\nThe current domain risu.pages.dev will be shut downed eventually."
|
||||
+ "\n\n**Browsers doesn't allow cross-domain storage so you should migrate datas by backuping/loading to google drive in settings or migrate manually to new domain. if not, when this domain shuts down: YOUR DATA WILL BE GONE FOREVER.**"
|
||||
+ "\n\n[Link to new domain](https://risuai.xyz/)."
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user