forked from naskya/firefish
refactor: remove single sign-on
This commit is contained in:
parent
a932378851
commit
9021e2247c
59 changed files with 139 additions and 1609 deletions
|
@ -42,6 +42,8 @@
|
||||||
|
|
||||||
- まだマージされていない本家 Firefish へのマージリクエストを独断で取り込み
|
- まだマージされていない本家 Firefish へのマージリクエストを独断で取り込み
|
||||||
- 投稿ページのタブに表示される英単語の単数形・複数形を正しくする ([MR](https://git.joinfirefish.org/firefish/firefish/-/merge_requests/10621))
|
- 投稿ページのタブに表示される英単語の単数形・複数形を正しくする ([MR](https://git.joinfirefish.org/firefish/firefish/-/merge_requests/10621))
|
||||||
|
- GitHub や Discord のアカウントでサインインする機能の廃止 ([MR](https://git.joinfirefish.org/firefish/firefish/-/merge_requests/10612))
|
||||||
|
- Misskey v12 のときからずっとこの機能ってちゃんと使えた記憶が無い……
|
||||||
- リアクションの履歴を公開する設定をデフォルトで有効に
|
- リアクションの履歴を公開する設定をデフォルトで有効に
|
||||||
- 私がみんなのリアクションを見たいと思っているため
|
- 私がみんなのリアクションを見たいと思っているため
|
||||||
- もちろん設定から無効にできます
|
- もちろん設定から無効にできます
|
||||||
|
|
|
@ -312,9 +312,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "الصفحات"
|
pages: "الصفحات"
|
||||||
integration: "التكامل"
|
|
||||||
connectService: "اتصل"
|
|
||||||
disconnectService: "اقطع الاتصال"
|
|
||||||
enableLocalTimeline: "تفعيل الخيط المحلي"
|
enableLocalTimeline: "تفعيل الخيط المحلي"
|
||||||
enableGlobalTimeline: "تفعيل الخيط الزمني الشامل"
|
enableGlobalTimeline: "تفعيل الخيط الزمني الشامل"
|
||||||
disablingTimelinesInfo: "سيتمكن المديرون والمشرفون من الوصول إلى كل الخيوط الزمنية حتى وإن لم تفعّل."
|
disablingTimelinesInfo: "سيتمكن المديرون والمشرفون من الوصول إلى كل الخيوط الزمنية حتى وإن لم تفعّل."
|
||||||
|
|
|
@ -316,9 +316,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "পৃষ্ঠা"
|
pages: "পৃষ্ঠা"
|
||||||
integration: "ইন্টিগ্রেশন"
|
|
||||||
connectService: "সংযুক্ত করুন"
|
|
||||||
disconnectService: "সংযোগ বিচ্ছিন্ন করুন"
|
|
||||||
enableLocalTimeline: "স্থানীয় টাইমলাইন চালু করুন"
|
enableLocalTimeline: "স্থানীয় টাইমলাইন চালু করুন"
|
||||||
enableGlobalTimeline: "গ্লোবাল টাইমলাইন চালু করুন"
|
enableGlobalTimeline: "গ্লোবাল টাইমলাইন চালু করুন"
|
||||||
disablingTimelinesInfo: "আপনি এই টাইমলাইনগুলি বন্ধ করলেও প্রশাসক এবং মডারেটররা এই টাইমলাইনগুলি ব্যাবহার করতে পারবে"
|
disablingTimelinesInfo: "আপনি এই টাইমলাইনগুলি বন্ধ করলেও প্রশাসক এবং মডারেটররা এই টাইমলাইনগুলি ব্যাবহার করতে পারবে"
|
||||||
|
|
|
@ -944,7 +944,6 @@ dayX: '{day}'
|
||||||
tosUrl: URL de les Condicions d'ús
|
tosUrl: URL de les Condicions d'ús
|
||||||
thisYear: Any
|
thisYear: Any
|
||||||
thisMonth: Mes
|
thisMonth: Mes
|
||||||
integration: Integracions
|
|
||||||
driveCapacityPerRemoteAccount: Capacitat del Disc per usuari remot
|
driveCapacityPerRemoteAccount: Capacitat del Disc per usuari remot
|
||||||
inMb: En megabytes
|
inMb: En megabytes
|
||||||
iconUrl: Adreça URL de la icona
|
iconUrl: Adreça URL de la icona
|
||||||
|
@ -1036,8 +1035,6 @@ accept: Accepta
|
||||||
reject: Rebutja
|
reject: Rebutja
|
||||||
yearX: '{year}'
|
yearX: '{year}'
|
||||||
pages: Pàgines
|
pages: Pàgines
|
||||||
disconnectService: Desconnectar
|
|
||||||
connectService: Connectar
|
|
||||||
enableLocalTimeline: Activa la línea de temps local
|
enableLocalTimeline: Activa la línea de temps local
|
||||||
enableRecommendedTimeline: Activa la línea de temps de recomanacions
|
enableRecommendedTimeline: Activa la línea de temps de recomanacions
|
||||||
pinnedClipId: ID del clip que vols fixar
|
pinnedClipId: ID del clip que vols fixar
|
||||||
|
|
|
@ -310,9 +310,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "Stránky"
|
pages: "Stránky"
|
||||||
integration: "Integrace"
|
|
||||||
connectService: "Připojit"
|
|
||||||
disconnectService: "Odpojit"
|
|
||||||
enableLocalTimeline: "Povolit lokální čas"
|
enableLocalTimeline: "Povolit lokální čas"
|
||||||
enableGlobalTimeline: "Povolit globální čas"
|
enableGlobalTimeline: "Povolit globální čas"
|
||||||
registration: "Registrace"
|
registration: "Registrace"
|
||||||
|
|
|
@ -350,9 +350,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "Nutzer-Seiten"
|
pages: "Nutzer-Seiten"
|
||||||
integration: "Integration"
|
|
||||||
connectService: "Verbinden"
|
|
||||||
disconnectService: "Trennen"
|
|
||||||
enableLocalTimeline: "Local-Timeline aktivieren"
|
enableLocalTimeline: "Local-Timeline aktivieren"
|
||||||
enableGlobalTimeline: "Global-Timeline aktivieren"
|
enableGlobalTimeline: "Global-Timeline aktivieren"
|
||||||
disablingTimelinesInfo: "Administratoren und Moderatoren haben immer Zugriff auf alle
|
disablingTimelinesInfo: "Administratoren und Moderatoren haben immer Zugriff auf alle
|
||||||
|
|
|
@ -215,8 +215,6 @@ thisMonth: "Μήνας"
|
||||||
today: "Σήμερα"
|
today: "Σήμερα"
|
||||||
dayX: "{day}"
|
dayX: "{day}"
|
||||||
pages: "Σελίδες"
|
pages: "Σελίδες"
|
||||||
connectService: "Σύνδεση"
|
|
||||||
disconnectService: "Αποσύνδεση"
|
|
||||||
registration: "Εγγραφή"
|
registration: "Εγγραφή"
|
||||||
pinnedPages: "Καρφιτσωμένες Σελίδες"
|
pinnedPages: "Καρφιτσωμένες Σελίδες"
|
||||||
pinnedNotes: "Καρφιτσωμένες δημοσιεύσεις"
|
pinnedNotes: "Καρφιτσωμένες δημοσιεύσεις"
|
||||||
|
@ -730,7 +728,6 @@ lightThemes: Φωτεινά θέματα
|
||||||
darkThemes: Σκοτεινά θέματα
|
darkThemes: Σκοτεινά θέματα
|
||||||
inputNewFolderName: Πληκτρολογήστε ένα νέο όνομα φακέλου
|
inputNewFolderName: Πληκτρολογήστε ένα νέο όνομα φακέλου
|
||||||
hasChildFilesOrFolders: Εφόσον αυτός ο φάκελος δεν είναι άδειος, δεν μπορεί να διαγραφεί.
|
hasChildFilesOrFolders: Εφόσον αυτός ο φάκελος δεν είναι άδειος, δεν μπορεί να διαγραφεί.
|
||||||
integration: Ενσωματώσεις
|
|
||||||
enableRecommendedTimeline: Ενεργοποίηση χρονολογίου προτεινόμενων
|
enableRecommendedTimeline: Ενεργοποίηση χρονολογίου προτεινόμενων
|
||||||
driveCapacityPerLocalAccount: Μέγεθος Αποθηκευτικού Χώρου ανά τοπικό μέλος
|
driveCapacityPerLocalAccount: Μέγεθος Αποθηκευτικού Χώρου ανά τοπικό μέλος
|
||||||
driveCapacityPerRemoteAccount: Μέγεθος Αποθηκευτικού Χώρου ανά απομακρυσμένο μέλος
|
driveCapacityPerRemoteAccount: Μέγεθος Αποθηκευτικού Χώρου ανά απομακρυσμένο μέλος
|
||||||
|
|
|
@ -375,9 +375,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "Pages"
|
pages: "Pages"
|
||||||
integration: "Integrations"
|
|
||||||
connectService: "Connect"
|
|
||||||
disconnectService: "Disconnect"
|
|
||||||
enableLocalTimeline: "Enable local timeline"
|
enableLocalTimeline: "Enable local timeline"
|
||||||
enableGlobalTimeline: "Enable global timeline"
|
enableGlobalTimeline: "Enable global timeline"
|
||||||
enableRecommendedTimeline: "Enable recommended timeline"
|
enableRecommendedTimeline: "Enable recommended timeline"
|
||||||
|
|
|
@ -340,9 +340,6 @@ dayX: "Día {day}"
|
||||||
monthX: "Mes {month}"
|
monthX: "Mes {month}"
|
||||||
yearX: "Año {year}"
|
yearX: "Año {year}"
|
||||||
pages: "Páginas"
|
pages: "Páginas"
|
||||||
integration: "Integraciones"
|
|
||||||
connectService: "Conectar"
|
|
||||||
disconnectService: "Desconectar"
|
|
||||||
enableLocalTimeline: "Habilitar linea de tiempo local"
|
enableLocalTimeline: "Habilitar linea de tiempo local"
|
||||||
enableGlobalTimeline: "Habilitar linea de tiempo global"
|
enableGlobalTimeline: "Habilitar linea de tiempo global"
|
||||||
disablingTimelinesInfo: "Aunque se desactiven estas lineas de tiempo, por conveniencia
|
disablingTimelinesInfo: "Aunque se desactiven estas lineas de tiempo, por conveniencia
|
||||||
|
|
|
@ -339,8 +339,6 @@ instanceName: Instanssin nimi
|
||||||
thisMonth: Kuukausi
|
thisMonth: Kuukausi
|
||||||
today: Tänään
|
today: Tänään
|
||||||
monthX: '{month}'
|
monthX: '{month}'
|
||||||
connectService: Yhdistä
|
|
||||||
disconnectService: Katkaise yhteys
|
|
||||||
enableLocalTimeline: Ota käyttöön paikallinen aikajana
|
enableLocalTimeline: Ota käyttöön paikallinen aikajana
|
||||||
enableGlobalTimeline: Ota käyttöön globaali aikajana
|
enableGlobalTimeline: Ota käyttöön globaali aikajana
|
||||||
enableRecommendedTimeline: Ota käyttöön suositellut -aikajana
|
enableRecommendedTimeline: Ota käyttöön suositellut -aikajana
|
||||||
|
@ -385,7 +383,6 @@ disablingTimelinesInfo: Järjestelmänvalvojilla ja moderaattoreilla on aina pä
|
||||||
dayX: '{day}'
|
dayX: '{day}'
|
||||||
yearX: '{year}'
|
yearX: '{year}'
|
||||||
pages: Sivut
|
pages: Sivut
|
||||||
integration: Integraatiot
|
|
||||||
instanceDescription: Instanssin kuvaus
|
instanceDescription: Instanssin kuvaus
|
||||||
invite: Kutsu
|
invite: Kutsu
|
||||||
iconUrl: Ikoni URL-linkki
|
iconUrl: Ikoni URL-linkki
|
||||||
|
|
|
@ -341,9 +341,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "Pages"
|
pages: "Pages"
|
||||||
integration: "Intégrations"
|
|
||||||
connectService: "Connexion"
|
|
||||||
disconnectService: "Déconnexion"
|
|
||||||
enableLocalTimeline: "Activer le fil local"
|
enableLocalTimeline: "Activer le fil local"
|
||||||
enableGlobalTimeline: "Activer le fil global"
|
enableGlobalTimeline: "Activer le fil global"
|
||||||
disablingTimelinesInfo: "Même si vous désactivez ces fils, les administrateur·rice·s
|
disablingTimelinesInfo: "Même si vous désactivez ces fils, les administrateur·rice·s
|
||||||
|
|
|
@ -342,9 +342,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "Halaman"
|
pages: "Halaman"
|
||||||
integration: "Integrasi"
|
|
||||||
connectService: "Sambungkan"
|
|
||||||
disconnectService: "Putuskan"
|
|
||||||
enableLocalTimeline: "Nyalakan linimasa lokal"
|
enableLocalTimeline: "Nyalakan linimasa lokal"
|
||||||
enableGlobalTimeline: "Nyalakan linimasa global"
|
enableGlobalTimeline: "Nyalakan linimasa global"
|
||||||
disablingTimelinesInfo: "Admin dan Moderator akan selalu memiliki akses ke semua linimasa
|
disablingTimelinesInfo: "Admin dan Moderator akan selalu memiliki akses ke semua linimasa
|
||||||
|
|
|
@ -331,9 +331,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "Pagine"
|
pages: "Pagine"
|
||||||
integration: "Integrazioni"
|
|
||||||
connectService: "Connetti"
|
|
||||||
disconnectService: "Disconnetti"
|
|
||||||
enableLocalTimeline: "Abilita timeline locale"
|
enableLocalTimeline: "Abilita timeline locale"
|
||||||
enableGlobalTimeline: "Abilita timeline federata"
|
enableGlobalTimeline: "Abilita timeline federata"
|
||||||
disablingTimelinesInfo: "Anche se disabiliti queste timeline, gli amministratori e
|
disablingTimelinesInfo: "Anche se disabiliti queste timeline, gli amministratori e
|
||||||
|
|
|
@ -338,9 +338,6 @@ dayX: "{day}日"
|
||||||
monthX: "{month}月"
|
monthX: "{month}月"
|
||||||
yearX: "{year}年"
|
yearX: "{year}年"
|
||||||
pages: "ページ"
|
pages: "ページ"
|
||||||
integration: "連携"
|
|
||||||
connectService: "接続する"
|
|
||||||
disconnectService: "切断する"
|
|
||||||
enableLocalTimeline: "ローカルタイムラインを有効にする"
|
enableLocalTimeline: "ローカルタイムラインを有効にする"
|
||||||
enableGlobalTimeline: "グローバルタイムラインを有効にする"
|
enableGlobalTimeline: "グローバルタイムラインを有効にする"
|
||||||
enableRecommendedTimeline: "おすすめタイムラインを有効にする"
|
enableRecommendedTimeline: "おすすめタイムラインを有効にする"
|
||||||
|
|
|
@ -317,9 +317,6 @@ dayX: "{day}日"
|
||||||
monthX: "{month}月"
|
monthX: "{month}月"
|
||||||
yearX: "{year}年"
|
yearX: "{year}年"
|
||||||
pages: "ページ"
|
pages: "ページ"
|
||||||
integration: "連携"
|
|
||||||
connectService: "つなげるで"
|
|
||||||
disconnectService: "切るで"
|
|
||||||
enableLocalTimeline: "ローカルタイムラインを使えるようにする"
|
enableLocalTimeline: "ローカルタイムラインを使えるようにする"
|
||||||
enableGlobalTimeline: "グローバルタイムラインを使えるようにする"
|
enableGlobalTimeline: "グローバルタイムラインを使えるようにする"
|
||||||
disablingTimelinesInfo: "ここらへんのタイムラインを使えんようにしてしもても、管理者とモデレーターは使えるままになってるで、そうやなかったら不便やからな。"
|
disablingTimelinesInfo: "ここらへんのタイムラインを使えんようにしてしもても、管理者とモデレーターは使えるままになってるで、そうやなかったら不便やからな。"
|
||||||
|
|
|
@ -36,7 +36,6 @@ selectList: "Fren tabdart"
|
||||||
youHaveNoLists: "Ulac ɣur-k·m ula d yiwet n tabdart"
|
youHaveNoLists: "Ulac ɣur-k·m ula d yiwet n tabdart"
|
||||||
security: "Taɣellist"
|
security: "Taɣellist"
|
||||||
remove: "Kkes"
|
remove: "Kkes"
|
||||||
connectService: "Qqen"
|
|
||||||
userList: "Tibdarin"
|
userList: "Tibdarin"
|
||||||
securityKey: "Tasarutt n tɣellist"
|
securityKey: "Tasarutt n tɣellist"
|
||||||
securityKeyName: "Isem n tsarutt"
|
securityKeyName: "Isem n tsarutt"
|
||||||
|
|
|
@ -323,9 +323,6 @@ dayX: "{day}일"
|
||||||
monthX: "{month}월"
|
monthX: "{month}월"
|
||||||
yearX: "{year}년"
|
yearX: "{year}년"
|
||||||
pages: "페이지"
|
pages: "페이지"
|
||||||
integration: "연동"
|
|
||||||
connectService: "계정 연동"
|
|
||||||
disconnectService: "계정 연동 해제"
|
|
||||||
enableLocalTimeline: "로컬 타임라인 활성화"
|
enableLocalTimeline: "로컬 타임라인 활성화"
|
||||||
enableGlobalTimeline: "글로벌 타임라인 활성화"
|
enableGlobalTimeline: "글로벌 타임라인 활성화"
|
||||||
disablingTimelinesInfo: "특정 타임라인을 비활성화하더라도 관리자 및 모더레이터는 계속 사용할 수 있습니다."
|
disablingTimelinesInfo: "특정 타임라인을 비활성화하더라도 관리자 및 모더레이터는 계속 사용할 수 있습니다."
|
||||||
|
|
|
@ -483,8 +483,6 @@ accept: Accepteren
|
||||||
reject: Afwijzen
|
reject: Afwijzen
|
||||||
normal: Normaal
|
normal: Normaal
|
||||||
pages: Pagina's
|
pages: Pagina's
|
||||||
integration: Integraties
|
|
||||||
connectService: Koppelen
|
|
||||||
monthX: '{month}'
|
monthX: '{month}'
|
||||||
yearX: '{year}'
|
yearX: '{year}'
|
||||||
instanceName: Servernaam
|
instanceName: Servernaam
|
||||||
|
@ -492,7 +490,6 @@ instanceDescription: Server omschrijving
|
||||||
maintainerName: Onderhouder
|
maintainerName: Onderhouder
|
||||||
maintainerEmail: Onderhouder email
|
maintainerEmail: Onderhouder email
|
||||||
tosUrl: Algemene Voorwaarden URL
|
tosUrl: Algemene Voorwaarden URL
|
||||||
disconnectService: Ontkoppelen
|
|
||||||
unread: Ongelezen
|
unread: Ongelezen
|
||||||
manageGroups: Beheer groepen
|
manageGroups: Beheer groepen
|
||||||
subscribePushNotification: Pushmeldingen inschakelen
|
subscribePushNotification: Pushmeldingen inschakelen
|
||||||
|
|
|
@ -225,8 +225,6 @@ instanceDescription: Tjenerbeskrivelse
|
||||||
maintainerName: Administrator
|
maintainerName: Administrator
|
||||||
maintainerEmail: Administrator-epost
|
maintainerEmail: Administrator-epost
|
||||||
monthX: '{month}'
|
monthX: '{month}'
|
||||||
connectService: Koble til
|
|
||||||
disconnectService: Koble fra
|
|
||||||
enableLocalTimeline: Aktiver lokal tidslinje
|
enableLocalTimeline: Aktiver lokal tidslinje
|
||||||
enableRegistration: Tillat registrering av nye brukere
|
enableRegistration: Tillat registrering av nye brukere
|
||||||
invite: Inviter
|
invite: Inviter
|
||||||
|
@ -449,7 +447,6 @@ watch: Følg med på
|
||||||
thisMonth: Måned
|
thisMonth: Måned
|
||||||
today: I dag
|
today: I dag
|
||||||
dayX: '{day}'
|
dayX: '{day}'
|
||||||
integration: Integrasjoner
|
|
||||||
yearX: '{year}'
|
yearX: '{year}'
|
||||||
pages: Sider
|
pages: Sider
|
||||||
enableRecaptcha: Slå på reCAPTCHA
|
enableRecaptcha: Slå på reCAPTCHA
|
||||||
|
|
|
@ -331,9 +331,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "Strony"
|
pages: "Strony"
|
||||||
integration: "Integracje"
|
|
||||||
connectService: "Połącz"
|
|
||||||
disconnectService: "Rozłącz"
|
|
||||||
enableLocalTimeline: "Włącz lokalną oś czasu"
|
enableLocalTimeline: "Włącz lokalną oś czasu"
|
||||||
enableGlobalTimeline: "Włącz globalną oś czasu"
|
enableGlobalTimeline: "Włącz globalną oś czasu"
|
||||||
disablingTimelinesInfo: "Administratorzy i moderatorzy będą zawsze mieć dostęp do
|
disablingTimelinesInfo: "Administratorzy i moderatorzy będą zawsze mieć dostęp do
|
||||||
|
|
|
@ -339,9 +339,6 @@ dayX: " Dia {day}"
|
||||||
monthX: "mês de {month}"
|
monthX: "mês de {month}"
|
||||||
yearX: "Ano {year}"
|
yearX: "Ano {year}"
|
||||||
pages: "Páginas"
|
pages: "Páginas"
|
||||||
integration: "Integração"
|
|
||||||
connectService: "Conectar"
|
|
||||||
disconnectService: "Desconectar"
|
|
||||||
enableLocalTimeline: "Ativar linha do tempo local"
|
enableLocalTimeline: "Ativar linha do tempo local"
|
||||||
enableGlobalTimeline: "Ativar linha do tempo global"
|
enableGlobalTimeline: "Ativar linha do tempo global"
|
||||||
disablingTimelinesInfo: "Se você desabilitar essas linhas do tempo, administradores
|
disablingTimelinesInfo: "Se você desabilitar essas linhas do tempo, administradores
|
||||||
|
|
|
@ -316,9 +316,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "Pagini"
|
pages: "Pagini"
|
||||||
integration: "Integrare"
|
|
||||||
connectService: "Conectează"
|
|
||||||
disconnectService: "Deconectează"
|
|
||||||
enableLocalTimeline: "Activează cronologia locală"
|
enableLocalTimeline: "Activează cronologia locală"
|
||||||
enableGlobalTimeline: "Activeaza cronologia globală"
|
enableGlobalTimeline: "Activeaza cronologia globală"
|
||||||
disablingTimelinesInfo: "Administratorii și Moderatorii vor avea mereu access la toate cronologiile, chiar dacă nu sunt activate."
|
disablingTimelinesInfo: "Administratorii și Moderatorii vor avea mereu access la toate cronologiile, chiar dacă nu sunt activate."
|
||||||
|
|
|
@ -335,9 +335,6 @@ dayX: "{day} день"
|
||||||
monthX: "{month} месяц"
|
monthX: "{month} месяц"
|
||||||
yearX: "{year} год"
|
yearX: "{year} год"
|
||||||
pages: "Страницы"
|
pages: "Страницы"
|
||||||
integration: "Интеграции"
|
|
||||||
connectService: "Подключиться"
|
|
||||||
disconnectService: "Отключиться"
|
|
||||||
enableLocalTimeline: "Включить локальную ленту"
|
enableLocalTimeline: "Включить локальную ленту"
|
||||||
enableGlobalTimeline: "Включить глобальную ленту"
|
enableGlobalTimeline: "Включить глобальную ленту"
|
||||||
disablingTimelinesInfo: "У администраторов и модераторов есть доступ ко всем лентам,
|
disablingTimelinesInfo: "У администраторов и модераторов есть доступ ко всем лентам,
|
||||||
|
|
|
@ -317,9 +317,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "Stránky"
|
pages: "Stránky"
|
||||||
integration: "Integrácia"
|
|
||||||
connectService: "Pripojiť"
|
|
||||||
disconnectService: "Odpojiť"
|
|
||||||
enableLocalTimeline: "Povoliť lokálnu časovú os"
|
enableLocalTimeline: "Povoliť lokálnu časovú os"
|
||||||
enableGlobalTimeline: "Povoliť globálnu časovú os"
|
enableGlobalTimeline: "Povoliť globálnu časovú os"
|
||||||
disablingTimelinesInfo: "Administrátori a moderátori majú vždy prístup ku všetkým časovým osiam, aj keď sú vypnuté."
|
disablingTimelinesInfo: "Administrátori a moderátori majú vždy prístup ku všetkým časovým osiam, aj keď sú vypnuté."
|
||||||
|
|
|
@ -365,8 +365,6 @@ today: Idag
|
||||||
dayX: '{day}'
|
dayX: '{day}'
|
||||||
monthX: '{month}'
|
monthX: '{month}'
|
||||||
yearX: '{year}'
|
yearX: '{year}'
|
||||||
connectService: Anslut
|
|
||||||
disconnectService: Bortkoppla
|
|
||||||
enableLocalTimeline: Anslut till lokal tidslinje
|
enableLocalTimeline: Anslut till lokal tidslinje
|
||||||
invite: Bjud in
|
invite: Bjud in
|
||||||
driveCapacityPerLocalAccount: Enhetens kapacitet per lokal användare
|
driveCapacityPerLocalAccount: Enhetens kapacitet per lokal användare
|
||||||
|
@ -779,7 +777,6 @@ serverLogs: Serverloggar
|
||||||
deleteAll: Radera alla
|
deleteAll: Radera alla
|
||||||
removeAllFollowing: Sluta följa alla följda användare
|
removeAllFollowing: Sluta följa alla följda användare
|
||||||
medium: Mellan
|
medium: Mellan
|
||||||
integration: Integreringar
|
|
||||||
xl: XL
|
xl: XL
|
||||||
desktop: Skrivbord
|
desktop: Skrivbord
|
||||||
createNew: Skapa nya
|
createNew: Skapa nya
|
||||||
|
|
|
@ -327,9 +327,6 @@ dayX: "{วัน}"
|
||||||
monthX: "{เดือน}"
|
monthX: "{เดือน}"
|
||||||
yearX: "{ปี}"
|
yearX: "{ปี}"
|
||||||
pages: "หน้า"
|
pages: "หน้า"
|
||||||
integration: "รวบรวม"
|
|
||||||
connectService: "เชื่อมต่อ"
|
|
||||||
disconnectService: "ตัดการเชื่อมต่อ"
|
|
||||||
enableLocalTimeline: "เปิดใช้งานไทม์ไลน์ในพื้นที่"
|
enableLocalTimeline: "เปิดใช้งานไทม์ไลน์ในพื้นที่"
|
||||||
enableGlobalTimeline: "เปิดใช้งานไทม์ไลน์ทั่วโลก"
|
enableGlobalTimeline: "เปิดใช้งานไทม์ไลน์ทั่วโลก"
|
||||||
disablingTimelinesInfo: "ผู้ดูแลระบบและผู้ควบคุมจะสามารถเข้าถึงไทม์ไลน์ทั้งหมด ถึงแม้ว่าจะไม่ได้เปิดใช้งานก็ตาม"
|
disablingTimelinesInfo: "ผู้ดูแลระบบและผู้ควบคุมจะสามารถเข้าถึงไทม์ไลน์ทั้งหมด ถึงแม้ว่าจะไม่ได้เปิดใช้งานก็ตาม"
|
||||||
|
|
|
@ -760,7 +760,6 @@ banner: Banner
|
||||||
nsfw: NSFW
|
nsfw: NSFW
|
||||||
doNothing: Görmezden Gel
|
doNothing: Görmezden Gel
|
||||||
watch: İzle
|
watch: İzle
|
||||||
connectService: Bağlan
|
|
||||||
registration: Kayıt
|
registration: Kayıt
|
||||||
hcaptcha: hCaptcha
|
hcaptcha: hCaptcha
|
||||||
pinnedNotes: Sabitlenmiş gönderiler
|
pinnedNotes: Sabitlenmiş gönderiler
|
||||||
|
@ -885,7 +884,6 @@ deleteFolder: Bu klasörü sil
|
||||||
addFile: Dosya ekle
|
addFile: Dosya ekle
|
||||||
dayX: '{day}'
|
dayX: '{day}'
|
||||||
enableLocalTimeline: Yerel zaman çizgisini aktif et
|
enableLocalTimeline: Yerel zaman çizgisini aktif et
|
||||||
disconnectService: Bağlantıyı kes
|
|
||||||
enableGlobalTimeline: Global zaman çizgisini aktif et
|
enableGlobalTimeline: Global zaman çizgisini aktif et
|
||||||
enableRegistration: Yeni kullanıcı kaydını aktif et
|
enableRegistration: Yeni kullanıcı kaydını aktif et
|
||||||
invite: Davet et
|
invite: Davet et
|
||||||
|
@ -1206,7 +1204,6 @@ location: Konum
|
||||||
registeredDate: Katılım tarihi
|
registeredDate: Katılım tarihi
|
||||||
yearX: '{year}'
|
yearX: '{year}'
|
||||||
pages: Sayfalar
|
pages: Sayfalar
|
||||||
integration: Entegrasyonlar
|
|
||||||
antennasDesc: "Antenler, belirlediğiniz kriterlere uyan yeni gönderiler görüntüler!\n
|
antennasDesc: "Antenler, belirlediğiniz kriterlere uyan yeni gönderiler görüntüler!\n
|
||||||
Zaman çizelgeleri sayfasından erişilebilirler."
|
Zaman çizelgeleri sayfasından erişilebilirler."
|
||||||
notesAndReplies: Gönderiler ve yanıtlar
|
notesAndReplies: Gönderiler ve yanıtlar
|
||||||
|
|
|
@ -336,9 +336,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "Сторінки"
|
pages: "Сторінки"
|
||||||
integration: "Інтеграції"
|
|
||||||
connectService: "Під’єднати"
|
|
||||||
disconnectService: "Відключитися"
|
|
||||||
enableLocalTimeline: "Увімкнути локальну стрічку"
|
enableLocalTimeline: "Увімкнути локальну стрічку"
|
||||||
enableGlobalTimeline: "Увімкнути глобальну стрічку"
|
enableGlobalTimeline: "Увімкнути глобальну стрічку"
|
||||||
disablingTimelinesInfo: "Адміністратори та модератори завжди мають доступ до всіх
|
disablingTimelinesInfo: "Адміністратори та модератори завжди мають доступ до всіх
|
||||||
|
|
|
@ -338,9 +338,6 @@ dayX: "{day}"
|
||||||
monthX: "{month}"
|
monthX: "{month}"
|
||||||
yearX: "{year}"
|
yearX: "{year}"
|
||||||
pages: "Trang"
|
pages: "Trang"
|
||||||
integration: "Tương tác"
|
|
||||||
connectService: "Kết nối"
|
|
||||||
disconnectService: "Ngắt kết nối"
|
|
||||||
enableLocalTimeline: "Bật bảng tin máy chủ"
|
enableLocalTimeline: "Bật bảng tin máy chủ"
|
||||||
enableGlobalTimeline: "Bật bảng tin liên hợp"
|
enableGlobalTimeline: "Bật bảng tin liên hợp"
|
||||||
disablingTimelinesInfo: "Quản trị viên và Kiểm duyệt viên luôn có quyền truy cập mọi
|
disablingTimelinesInfo: "Quản trị viên và Kiểm duyệt viên luôn có quyền truy cập mọi
|
||||||
|
|
|
@ -325,9 +325,6 @@ dayX: "{day} 日"
|
||||||
monthX: "{month} 月"
|
monthX: "{month} 月"
|
||||||
yearX: "{year} 年"
|
yearX: "{year} 年"
|
||||||
pages: "页面"
|
pages: "页面"
|
||||||
integration: "整合"
|
|
||||||
connectService: "连接"
|
|
||||||
disconnectService: "断开连接"
|
|
||||||
enableLocalTimeline: "启用本地时间线功能"
|
enableLocalTimeline: "启用本地时间线功能"
|
||||||
enableGlobalTimeline: "启用全局时间线"
|
enableGlobalTimeline: "启用全局时间线"
|
||||||
disablingTimelinesInfo: "管理员和监察员将始终拥有对所有时间线的访问权,即使它们没有被启用。"
|
disablingTimelinesInfo: "管理员和监察员将始终拥有对所有时间线的访问权,即使它们没有被启用。"
|
||||||
|
|
|
@ -324,9 +324,6 @@ dayX: "{day}日"
|
||||||
monthX: "{month}月"
|
monthX: "{month}月"
|
||||||
yearX: "{year}年"
|
yearX: "{year}年"
|
||||||
pages: "頁面"
|
pages: "頁面"
|
||||||
integration: "整合"
|
|
||||||
connectService: "己連結"
|
|
||||||
disconnectService: "己斷開"
|
|
||||||
enableLocalTimeline: "開啟本地時間線"
|
enableLocalTimeline: "開啟本地時間線"
|
||||||
enableGlobalTimeline: "啟用公開時間線"
|
enableGlobalTimeline: "啟用公開時間線"
|
||||||
disablingTimelinesInfo: "即使您關閉了時間線功能,管理員和板主仍可訪問所有的時間線。"
|
disablingTimelinesInfo: "即使您關閉了時間線功能,管理員和板主仍可訪問所有的時間線。"
|
||||||
|
|
|
@ -1,3 +1,15 @@
|
||||||
-- emoji-moderator
|
-- emoji-moderator
|
||||||
ALTER TABLE "user" DROP COLUMN "emojiModPerm";
|
ALTER TABLE "user" DROP COLUMN "emojiModPerm";
|
||||||
DROP TYPE "public"."user_emojimodperm_enum";
|
DROP TYPE "public"."user_emojimodperm_enum";
|
||||||
|
|
||||||
|
-- remove sso
|
||||||
|
ALTER TABLE "meta" ADD COLUMN "discordClientSecret" character varying(128);
|
||||||
|
ALTER TABLE "meta" ADD COLUMN "discordClientId" character varying(128);
|
||||||
|
ALTER TABLE "meta" ADD COLUMN "enableDiscordIntegration" boolean DEFAULT false NOT NULL;
|
||||||
|
ALTER TABLE "meta" ADD COLUMN "githubClientSecret" character varying(128);
|
||||||
|
ALTER TABLE "meta" ADD COLUMN "githubClientId" character varying(128);
|
||||||
|
ALTER TABLE "meta" ADD COLUMN "enableGithubIntegration" boolean DEFAULT false NOT NULL;
|
||||||
|
ALTER TABLE "meta" ADD COLUMN "twitterConsumerSecret" character varying(128);
|
||||||
|
ALTER TABLE "meta" ADD COLUMN "twitterConsumerKey" character varying(128);
|
||||||
|
ALTER TABLE "meta" ADD COLUMN "enableTwitterIntegration" boolean DEFAULT false NOT NULL;
|
||||||
|
ALTER TABLE "user_profile" ADD "integrations" jsonb NOT NULL DEFAULT '{}';
|
||||||
|
|
|
@ -7,6 +7,7 @@ mod m20230627_185451_index_note_url;
|
||||||
mod m20230709_000510_move_antenna_to_cache;
|
mod m20230709_000510_move_antenna_to_cache;
|
||||||
mod m20230806_170616_fix_antenna_stream_ids;
|
mod m20230806_170616_fix_antenna_stream_ids;
|
||||||
mod m20230904_013244_is_indexable;
|
mod m20230904_013244_is_indexable;
|
||||||
|
mod m20231002_143323_remove_integrations;
|
||||||
|
|
||||||
pub struct Migrator;
|
pub struct Migrator;
|
||||||
|
|
||||||
|
@ -19,6 +20,7 @@ impl MigratorTrait for Migrator {
|
||||||
Box::new(m20230709_000510_move_antenna_to_cache::Migration),
|
Box::new(m20230709_000510_move_antenna_to_cache::Migration),
|
||||||
Box::new(m20230806_170616_fix_antenna_stream_ids::Migration),
|
Box::new(m20230806_170616_fix_antenna_stream_ids::Migration),
|
||||||
Box::new(m20230904_013244_is_indexable::Migration),
|
Box::new(m20230904_013244_is_indexable::Migration),
|
||||||
|
Box::new(m20231002_143323_remove_integrations::Migration),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,117 @@
|
||||||
|
use sea_orm_migration::prelude::*;
|
||||||
|
|
||||||
|
#[derive(DeriveMigrationName)]
|
||||||
|
pub struct Migration;
|
||||||
|
|
||||||
|
#[async_trait::async_trait]
|
||||||
|
impl MigrationTrait for Migration {
|
||||||
|
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||||
|
manager
|
||||||
|
.alter_table(
|
||||||
|
Table::alter()
|
||||||
|
.table(UserProfile::Table)
|
||||||
|
.drop_column(UserProfile::Integrations)
|
||||||
|
.to_owned(),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
manager
|
||||||
|
.alter_table(
|
||||||
|
Table::alter()
|
||||||
|
.table(Meta::Table)
|
||||||
|
.drop_column(Meta::EnableTwitterIntegration)
|
||||||
|
.drop_column(Meta::TwitterConsumerKey)
|
||||||
|
.drop_column(Meta::TwitterConsumerSecret)
|
||||||
|
.drop_column(Meta::EnableGithubIntegration)
|
||||||
|
.drop_column(Meta::GithubClientId)
|
||||||
|
.drop_column(Meta::GithubClientSecret)
|
||||||
|
.drop_column(Meta::EnableDiscordIntegration)
|
||||||
|
.drop_column(Meta::DiscordClientId)
|
||||||
|
.drop_column(Meta::DiscordClientSecret)
|
||||||
|
.to_owned(),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||||
|
manager
|
||||||
|
.alter_table(
|
||||||
|
Table::alter()
|
||||||
|
.table(Meta::Table)
|
||||||
|
.add_column(ColumnDef::new(Meta::DiscordClientSecret).string())
|
||||||
|
.add_column(ColumnDef::new(Meta::DiscordClientId).string())
|
||||||
|
.add_column(
|
||||||
|
ColumnDef::new(Meta::EnableDiscordIntegration)
|
||||||
|
.boolean()
|
||||||
|
.not_null()
|
||||||
|
.default(false),
|
||||||
|
)
|
||||||
|
.add_column(ColumnDef::new(Meta::GithubClientSecret).string())
|
||||||
|
.add_column(ColumnDef::new(Meta::GithubClientId).string())
|
||||||
|
.add_column(
|
||||||
|
ColumnDef::new(Meta::EnableGithubIntegration)
|
||||||
|
.boolean()
|
||||||
|
.not_null()
|
||||||
|
.default(false),
|
||||||
|
)
|
||||||
|
.add_column(ColumnDef::new(Meta::TwitterConsumerSecret).string())
|
||||||
|
.add_column(ColumnDef::new(Meta::TwitterConsumerKey).string())
|
||||||
|
.add_column(
|
||||||
|
ColumnDef::new(Meta::EnableTwitterIntegration)
|
||||||
|
.boolean()
|
||||||
|
.not_null()
|
||||||
|
.default(false),
|
||||||
|
)
|
||||||
|
.to_owned(),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
manager
|
||||||
|
.alter_table(
|
||||||
|
Table::alter()
|
||||||
|
.table(UserProfile::Table)
|
||||||
|
.add_column(
|
||||||
|
ColumnDef::new(UserProfile::Integrations)
|
||||||
|
.json()
|
||||||
|
.default("{}"),
|
||||||
|
)
|
||||||
|
.to_owned(),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Iden)]
|
||||||
|
|
||||||
|
enum UserProfile {
|
||||||
|
Table,
|
||||||
|
#[iden = "integrations"]
|
||||||
|
Integrations,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Iden)]
|
||||||
|
enum Meta {
|
||||||
|
Table,
|
||||||
|
#[iden = "enableTwitterIntegration"]
|
||||||
|
EnableTwitterIntegration,
|
||||||
|
#[iden = "twitterConsumerKey"]
|
||||||
|
TwitterConsumerKey,
|
||||||
|
#[iden = "twitterConsumerSecret"]
|
||||||
|
TwitterConsumerSecret,
|
||||||
|
#[iden = "enableGithubIntegration"]
|
||||||
|
EnableGithubIntegration,
|
||||||
|
#[iden = "githubClientId"]
|
||||||
|
GithubClientId,
|
||||||
|
#[iden = "githubClientSecret"]
|
||||||
|
GithubClientSecret,
|
||||||
|
#[iden = "enableDiscordIntegration"]
|
||||||
|
EnableDiscordIntegration,
|
||||||
|
#[iden = "discordClientId"]
|
||||||
|
DiscordClientId,
|
||||||
|
#[iden = "discordClientSecret"]
|
||||||
|
DiscordClientSecret,
|
||||||
|
}
|
|
@ -71,24 +71,6 @@ pub struct Model {
|
||||||
pub sw_public_key: Option<String>,
|
pub sw_public_key: Option<String>,
|
||||||
#[sea_orm(column_name = "swPrivateKey")]
|
#[sea_orm(column_name = "swPrivateKey")]
|
||||||
pub sw_private_key: Option<String>,
|
pub sw_private_key: Option<String>,
|
||||||
#[sea_orm(column_name = "enableTwitterIntegration")]
|
|
||||||
pub enable_twitter_integration: bool,
|
|
||||||
#[sea_orm(column_name = "twitterConsumerKey")]
|
|
||||||
pub twitter_consumer_key: Option<String>,
|
|
||||||
#[sea_orm(column_name = "twitterConsumerSecret")]
|
|
||||||
pub twitter_consumer_secret: Option<String>,
|
|
||||||
#[sea_orm(column_name = "enableGithubIntegration")]
|
|
||||||
pub enable_github_integration: bool,
|
|
||||||
#[sea_orm(column_name = "githubClientId")]
|
|
||||||
pub github_client_id: Option<String>,
|
|
||||||
#[sea_orm(column_name = "githubClientSecret")]
|
|
||||||
pub github_client_secret: Option<String>,
|
|
||||||
#[sea_orm(column_name = "enableDiscordIntegration")]
|
|
||||||
pub enable_discord_integration: bool,
|
|
||||||
#[sea_orm(column_name = "discordClientId")]
|
|
||||||
pub discord_client_id: Option<String>,
|
|
||||||
#[sea_orm(column_name = "discordClientSecret")]
|
|
||||||
pub discord_client_secret: Option<String>,
|
|
||||||
#[sea_orm(column_name = "pinnedUsers")]
|
#[sea_orm(column_name = "pinnedUsers")]
|
||||||
pub pinned_users: StringVec,
|
pub pinned_users: StringVec,
|
||||||
#[sea_orm(column_name = "ToSUrl")]
|
#[sea_orm(column_name = "ToSUrl")]
|
||||||
|
|
|
@ -46,8 +46,6 @@ pub struct Model {
|
||||||
pub pinned_page_id: Option<String>,
|
pub pinned_page_id: Option<String>,
|
||||||
#[sea_orm(column_type = "JsonBinary")]
|
#[sea_orm(column_type = "JsonBinary")]
|
||||||
pub room: Json,
|
pub room: Json,
|
||||||
#[sea_orm(column_type = "JsonBinary")]
|
|
||||||
pub integrations: Json,
|
|
||||||
#[sea_orm(column_name = "injectFeaturedNote")]
|
#[sea_orm(column_name = "injectFeaturedNote")]
|
||||||
pub inject_featured_note: bool,
|
pub inject_featured_note: bool,
|
||||||
#[sea_orm(column_name = "enableWordMute")]
|
#[sea_orm(column_name = "enableWordMute")]
|
||||||
|
|
|
@ -96,7 +96,6 @@
|
||||||
"node-fetch": "3.3.2",
|
"node-fetch": "3.3.2",
|
||||||
"nodemailer": "6.9.4",
|
"nodemailer": "6.9.4",
|
||||||
"nsfwjs": "2.4.2",
|
"nsfwjs": "2.4.2",
|
||||||
"oauth": "^0.10.0",
|
|
||||||
"opencc-js": "^1.0.5",
|
"opencc-js": "^1.0.5",
|
||||||
"os-utils": "0.0.14",
|
"os-utils": "0.0.14",
|
||||||
"otpauth": "^9.1.4",
|
"otpauth": "^9.1.4",
|
||||||
|
|
|
@ -354,57 +354,6 @@ export class Meta {
|
||||||
})
|
})
|
||||||
public swPrivateKey: string | null;
|
public swPrivateKey: string | null;
|
||||||
|
|
||||||
@Column("boolean", {
|
|
||||||
default: false,
|
|
||||||
})
|
|
||||||
public enableTwitterIntegration: boolean;
|
|
||||||
|
|
||||||
@Column("varchar", {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public twitterConsumerKey: string | null;
|
|
||||||
|
|
||||||
@Column("varchar", {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public twitterConsumerSecret: string | null;
|
|
||||||
|
|
||||||
@Column("boolean", {
|
|
||||||
default: false,
|
|
||||||
})
|
|
||||||
public enableGithubIntegration: boolean;
|
|
||||||
|
|
||||||
@Column("varchar", {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public githubClientId: string | null;
|
|
||||||
|
|
||||||
@Column("varchar", {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public githubClientSecret: string | null;
|
|
||||||
|
|
||||||
@Column("boolean", {
|
|
||||||
default: false,
|
|
||||||
})
|
|
||||||
public enableDiscordIntegration: boolean;
|
|
||||||
|
|
||||||
@Column("varchar", {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public discordClientId: string | null;
|
|
||||||
|
|
||||||
@Column("varchar", {
|
|
||||||
length: 128,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public discordClientSecret: string | null;
|
|
||||||
|
|
||||||
@Column("varchar", {
|
@Column("varchar", {
|
||||||
length: 128,
|
length: 128,
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
|
@ -215,11 +215,6 @@ export class UserProfile {
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
public pinnedPage: Page | null;
|
public pinnedPage: Page | null;
|
||||||
|
|
||||||
@Column("jsonb", {
|
|
||||||
default: {},
|
|
||||||
})
|
|
||||||
public integrations: Record<string, any>;
|
|
||||||
|
|
||||||
@Index()
|
@Index()
|
||||||
@Column("boolean", {
|
@Column("boolean", {
|
||||||
default: false,
|
default: false,
|
||||||
|
|
|
@ -566,7 +566,6 @@ export const UserRepository = db.getRepository(User).extend({
|
||||||
hasUnreadNotification: this.getHasUnreadNotification(user.id),
|
hasUnreadNotification: this.getHasUnreadNotification(user.id),
|
||||||
hasPendingReceivedFollowRequest:
|
hasPendingReceivedFollowRequest:
|
||||||
this.getHasPendingReceivedFollowRequest(user.id),
|
this.getHasPendingReceivedFollowRequest(user.id),
|
||||||
integrations: profile!.integrations,
|
|
||||||
mutedWords: profile!.mutedWords,
|
mutedWords: profile!.mutedWords,
|
||||||
mutedInstances: profile!.mutedInstances,
|
mutedInstances: profile!.mutedInstances,
|
||||||
mutingNotificationTypes: profile!.mutingNotificationTypes,
|
mutingNotificationTypes: profile!.mutingNotificationTypes,
|
||||||
|
|
|
@ -459,11 +459,6 @@ export const packedMeDetailedOnlySchema = {
|
||||||
nullable: false,
|
nullable: false,
|
||||||
optional: false,
|
optional: false,
|
||||||
},
|
},
|
||||||
integrations: {
|
|
||||||
type: "object",
|
|
||||||
nullable: true,
|
|
||||||
optional: false,
|
|
||||||
},
|
|
||||||
mutedWords: {
|
mutedWords: {
|
||||||
type: "array",
|
type: "array",
|
||||||
nullable: false,
|
nullable: false,
|
||||||
|
|
|
@ -184,7 +184,7 @@ export async function createPerson(
|
||||||
|
|
||||||
const host = toPuny(new URL(object.id).hostname);
|
const host = toPuny(new URL(object.id).hostname);
|
||||||
|
|
||||||
const { fields } = analyzeAttachments(person.attachment || []);
|
const fields = analyzeAttachments(person.attachment || []);
|
||||||
|
|
||||||
const tags = extractApHashtags(person.tag)
|
const tags = extractApHashtags(person.tag)
|
||||||
.map((tag) => normalizeForSearch(tag))
|
.map((tag) => normalizeForSearch(tag))
|
||||||
|
@ -638,39 +638,6 @@ export async function resolvePerson(
|
||||||
return await createPerson(uri, resolver);
|
return await createPerson(uri, resolver);
|
||||||
}
|
}
|
||||||
|
|
||||||
const services: {
|
|
||||||
[x: string]: (id: string, username: string) => any;
|
|
||||||
} = {
|
|
||||||
"misskey:authentication:twitter": (userId, screenName) => ({
|
|
||||||
userId,
|
|
||||||
screenName,
|
|
||||||
}),
|
|
||||||
"misskey:authentication:github": (id, login) => ({ id, login }),
|
|
||||||
"misskey:authentication:discord": (id, name) => $discord(id, name),
|
|
||||||
};
|
|
||||||
|
|
||||||
const $discord = (id: string, name: string) => {
|
|
||||||
if (typeof name !== "string") {
|
|
||||||
name = "unknown#0000";
|
|
||||||
}
|
|
||||||
const [username, discriminator] = name.split("#");
|
|
||||||
return { id, username, discriminator };
|
|
||||||
};
|
|
||||||
|
|
||||||
function addService(target: { [x: string]: any }, source: IApPropertyValue) {
|
|
||||||
const service = services[source.name];
|
|
||||||
|
|
||||||
if (typeof source.value !== "string") {
|
|
||||||
source.value = "unknown";
|
|
||||||
}
|
|
||||||
|
|
||||||
const [id, username] = source.value.split("@");
|
|
||||||
|
|
||||||
if (service) {
|
|
||||||
target[source.name.split(":")[2]] = service(id, username);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function analyzeAttachments(
|
export function analyzeAttachments(
|
||||||
attachments: IObject | IObject[] | undefined,
|
attachments: IObject | IObject[] | undefined,
|
||||||
) {
|
) {
|
||||||
|
@ -678,22 +645,17 @@ export function analyzeAttachments(
|
||||||
name: string;
|
name: string;
|
||||||
value: string;
|
value: string;
|
||||||
}[] = [];
|
}[] = [];
|
||||||
const services: { [x: string]: any } = {};
|
|
||||||
|
|
||||||
if (Array.isArray(attachments)) {
|
if (Array.isArray(attachments)) {
|
||||||
for (const attachment of attachments.filter(isPropertyValue)) {
|
for (const attachment of attachments.filter(isPropertyValue)) {
|
||||||
if (isPropertyValue(attachment.identifier)) {
|
fields.push({
|
||||||
addService(services, attachment.identifier);
|
name: attachment.name,
|
||||||
} else {
|
value: fromHtml(attachment.value),
|
||||||
fields.push({
|
});
|
||||||
name: attachment.name,
|
|
||||||
value: fromHtml(attachment.value),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { fields, services };
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateFeatured(userId: User["id"], resolver?: Resolver) {
|
export async function updateFeatured(userId: User["id"], resolver?: Resolver) {
|
||||||
|
|
|
@ -170,21 +170,6 @@ export const meta = {
|
||||||
optional: false,
|
optional: false,
|
||||||
nullable: false,
|
nullable: false,
|
||||||
},
|
},
|
||||||
enableTwitterIntegration: {
|
|
||||||
type: "boolean",
|
|
||||||
optional: false,
|
|
||||||
nullable: false,
|
|
||||||
},
|
|
||||||
enableGithubIntegration: {
|
|
||||||
type: "boolean",
|
|
||||||
optional: false,
|
|
||||||
nullable: false,
|
|
||||||
},
|
|
||||||
enableDiscordIntegration: {
|
|
||||||
type: "boolean",
|
|
||||||
optional: false,
|
|
||||||
nullable: false,
|
|
||||||
},
|
|
||||||
enableServiceWorker: {
|
enableServiceWorker: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
optional: false,
|
optional: false,
|
||||||
|
@ -326,36 +311,6 @@ export const meta = {
|
||||||
nullable: true,
|
nullable: true,
|
||||||
format: "id",
|
format: "id",
|
||||||
},
|
},
|
||||||
twitterConsumerKey: {
|
|
||||||
type: "string",
|
|
||||||
optional: true,
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
twitterConsumerSecret: {
|
|
||||||
type: "string",
|
|
||||||
optional: true,
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
githubClientId: {
|
|
||||||
type: "string",
|
|
||||||
optional: true,
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
githubClientSecret: {
|
|
||||||
type: "string",
|
|
||||||
optional: true,
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
discordClientId: {
|
|
||||||
type: "string",
|
|
||||||
optional: true,
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
discordClientSecret: {
|
|
||||||
type: "string",
|
|
||||||
optional: true,
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
summaryProxy: {
|
summaryProxy: {
|
||||||
type: "string",
|
type: "string",
|
||||||
optional: true,
|
optional: true,
|
||||||
|
@ -544,9 +499,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
defaultLightTheme: instance.defaultLightTheme,
|
defaultLightTheme: instance.defaultLightTheme,
|
||||||
defaultDarkTheme: instance.defaultDarkTheme,
|
defaultDarkTheme: instance.defaultDarkTheme,
|
||||||
enableEmail: instance.enableEmail,
|
enableEmail: instance.enableEmail,
|
||||||
enableTwitterIntegration: instance.enableTwitterIntegration,
|
|
||||||
enableGithubIntegration: instance.enableGithubIntegration,
|
|
||||||
enableDiscordIntegration: instance.enableDiscordIntegration,
|
|
||||||
enableServiceWorker: instance.enableServiceWorker,
|
enableServiceWorker: instance.enableServiceWorker,
|
||||||
translatorAvailable:
|
translatorAvailable:
|
||||||
instance.deeplAuthKey != null || instance.libreTranslateApiUrl != null,
|
instance.deeplAuthKey != null || instance.libreTranslateApiUrl != null,
|
||||||
|
@ -573,12 +525,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
enableSensitiveMediaDetectionForVideos:
|
enableSensitiveMediaDetectionForVideos:
|
||||||
instance.enableSensitiveMediaDetectionForVideos,
|
instance.enableSensitiveMediaDetectionForVideos,
|
||||||
proxyAccountId: instance.proxyAccountId,
|
proxyAccountId: instance.proxyAccountId,
|
||||||
twitterConsumerKey: instance.twitterConsumerKey,
|
|
||||||
twitterConsumerSecret: instance.twitterConsumerSecret,
|
|
||||||
githubClientId: instance.githubClientId,
|
|
||||||
githubClientSecret: instance.githubClientSecret,
|
|
||||||
discordClientId: instance.discordClientId,
|
|
||||||
discordClientSecret: instance.discordClientSecret,
|
|
||||||
summalyProxy: instance.summalyProxy,
|
summalyProxy: instance.summalyProxy,
|
||||||
email: instance.email,
|
email: instance.email,
|
||||||
smtpSecure: instance.smtpSecure,
|
smtpSecure: instance.smtpSecure,
|
||||||
|
|
|
@ -46,13 +46,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const maskedKeys = ["accessToken", "accessTokenSecret", "refreshToken"];
|
|
||||||
Object.keys(profile.integrations).forEach((integration) => {
|
|
||||||
maskedKeys.forEach(
|
|
||||||
(key) => (profile.integrations[integration][key] = "<MASKED>"),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
const signins = await Signins.findBy({ userId: user.id });
|
const signins = await Signins.findBy({ userId: user.id });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -67,7 +60,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
carefulBot: profile.carefulBot,
|
carefulBot: profile.carefulBot,
|
||||||
injectFeaturedNote: profile.injectFeaturedNote,
|
injectFeaturedNote: profile.injectFeaturedNote,
|
||||||
receiveAnnouncementEmail: profile.receiveAnnouncementEmail,
|
receiveAnnouncementEmail: profile.receiveAnnouncementEmail,
|
||||||
integrations: profile.integrations,
|
|
||||||
mutedWords: profile.mutedWords,
|
mutedWords: profile.mutedWords,
|
||||||
mutedInstances: profile.mutedInstances,
|
mutedInstances: profile.mutedInstances,
|
||||||
mutingNotificationTypes: profile.mutingNotificationTypes,
|
mutingNotificationTypes: profile.mutingNotificationTypes,
|
||||||
|
|
|
@ -132,15 +132,6 @@ export const paramDef = {
|
||||||
deeplIsPro: { type: "boolean" },
|
deeplIsPro: { type: "boolean" },
|
||||||
libreTranslateApiUrl: { type: "string", nullable: true },
|
libreTranslateApiUrl: { type: "string", nullable: true },
|
||||||
libreTranslateApiKey: { type: "string", nullable: true },
|
libreTranslateApiKey: { type: "string", nullable: true },
|
||||||
enableTwitterIntegration: { type: "boolean" },
|
|
||||||
twitterConsumerKey: { type: "string", nullable: true },
|
|
||||||
twitterConsumerSecret: { type: "string", nullable: true },
|
|
||||||
enableGithubIntegration: { type: "boolean" },
|
|
||||||
githubClientId: { type: "string", nullable: true },
|
|
||||||
githubClientSecret: { type: "string", nullable: true },
|
|
||||||
enableDiscordIntegration: { type: "boolean" },
|
|
||||||
discordClientId: { type: "string", nullable: true },
|
|
||||||
discordClientSecret: { type: "string", nullable: true },
|
|
||||||
enableEmail: { type: "boolean" },
|
enableEmail: { type: "boolean" },
|
||||||
email: { type: "string", nullable: true },
|
email: { type: "string", nullable: true },
|
||||||
smtpSecure: { type: "boolean" },
|
smtpSecure: { type: "boolean" },
|
||||||
|
@ -395,42 +386,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
set.summalyProxy = ps.summalyProxy;
|
set.summalyProxy = ps.summalyProxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ps.enableTwitterIntegration !== undefined) {
|
|
||||||
set.enableTwitterIntegration = ps.enableTwitterIntegration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.twitterConsumerKey !== undefined) {
|
|
||||||
set.twitterConsumerKey = ps.twitterConsumerKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.twitterConsumerSecret !== undefined) {
|
|
||||||
set.twitterConsumerSecret = ps.twitterConsumerSecret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.enableGithubIntegration !== undefined) {
|
|
||||||
set.enableGithubIntegration = ps.enableGithubIntegration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.githubClientId !== undefined) {
|
|
||||||
set.githubClientId = ps.githubClientId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.githubClientSecret !== undefined) {
|
|
||||||
set.githubClientSecret = ps.githubClientSecret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.enableDiscordIntegration !== undefined) {
|
|
||||||
set.enableDiscordIntegration = ps.enableDiscordIntegration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.discordClientId !== undefined) {
|
|
||||||
set.discordClientId = ps.discordClientId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.discordClientSecret !== undefined) {
|
|
||||||
set.discordClientSecret = ps.discordClientSecret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.enableEmail !== undefined) {
|
if (ps.enableEmail !== undefined) {
|
||||||
set.enableEmail = ps.enableEmail;
|
set.enableEmail = ps.enableEmail;
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,21 +268,6 @@ export const meta = {
|
||||||
optional: false,
|
optional: false,
|
||||||
nullable: false,
|
nullable: false,
|
||||||
},
|
},
|
||||||
enableTwitterIntegration: {
|
|
||||||
type: "boolean",
|
|
||||||
optional: false,
|
|
||||||
nullable: false,
|
|
||||||
},
|
|
||||||
enableGithubIntegration: {
|
|
||||||
type: "boolean",
|
|
||||||
optional: false,
|
|
||||||
nullable: false,
|
|
||||||
},
|
|
||||||
enableDiscordIntegration: {
|
|
||||||
type: "boolean",
|
|
||||||
optional: false,
|
|
||||||
nullable: false,
|
|
||||||
},
|
|
||||||
enableServiceWorker: {
|
enableServiceWorker: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
optional: false,
|
optional: false,
|
||||||
|
@ -343,21 +328,6 @@ export const meta = {
|
||||||
optional: false,
|
optional: false,
|
||||||
nullable: false,
|
nullable: false,
|
||||||
},
|
},
|
||||||
twitter: {
|
|
||||||
type: "boolean",
|
|
||||||
optional: false,
|
|
||||||
nullable: false,
|
|
||||||
},
|
|
||||||
github: {
|
|
||||||
type: "boolean",
|
|
||||||
optional: false,
|
|
||||||
nullable: false,
|
|
||||||
},
|
|
||||||
discord: {
|
|
||||||
type: "boolean",
|
|
||||||
optional: false,
|
|
||||||
nullable: false,
|
|
||||||
},
|
|
||||||
serviceWorker: {
|
serviceWorker: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
optional: false,
|
optional: false,
|
||||||
|
@ -493,10 +463,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
})),
|
})),
|
||||||
enableEmail: instance.enableEmail,
|
enableEmail: instance.enableEmail,
|
||||||
|
|
||||||
enableTwitterIntegration: instance.enableTwitterIntegration,
|
|
||||||
enableGithubIntegration: instance.enableGithubIntegration,
|
|
||||||
enableDiscordIntegration: instance.enableDiscordIntegration,
|
|
||||||
|
|
||||||
enableServiceWorker: instance.enableServiceWorker,
|
enableServiceWorker: instance.enableServiceWorker,
|
||||||
|
|
||||||
translatorAvailable:
|
translatorAvailable:
|
||||||
|
@ -539,9 +505,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
hcaptcha: instance.enableHcaptcha,
|
hcaptcha: instance.enableHcaptcha,
|
||||||
recaptcha: instance.enableRecaptcha,
|
recaptcha: instance.enableRecaptcha,
|
||||||
objectStorage: instance.useObjectStorage,
|
objectStorage: instance.useObjectStorage,
|
||||||
twitter: instance.enableTwitterIntegration,
|
|
||||||
github: instance.enableGithubIntegration,
|
|
||||||
discord: instance.enableDiscordIntegration,
|
|
||||||
serviceWorker: instance.enableServiceWorker,
|
serviceWorker: instance.enableServiceWorker,
|
||||||
postEditing: true,
|
postEditing: true,
|
||||||
postImports: instance.experimentalFeatures?.postImports || false,
|
postImports: instance.experimentalFeatures?.postImports || false,
|
||||||
|
|
|
@ -21,9 +21,6 @@ import signup from "./private/signup.js";
|
||||||
import signin from "./private/signin.js";
|
import signin from "./private/signin.js";
|
||||||
import signupPending from "./private/signup-pending.js";
|
import signupPending from "./private/signup-pending.js";
|
||||||
import verifyEmail from "./private/verify-email.js";
|
import verifyEmail from "./private/verify-email.js";
|
||||||
import discord from "./service/discord.js";
|
|
||||||
import github from "./service/github.js";
|
|
||||||
import twitter from "./service/twitter.js";
|
|
||||||
import { koaBody } from "koa-body";
|
import { koaBody } from "koa-body";
|
||||||
import {
|
import {
|
||||||
convertId,
|
convertId,
|
||||||
|
@ -181,10 +178,6 @@ router.post("/signin", signin);
|
||||||
router.post("/signup-pending", signupPending);
|
router.post("/signup-pending", signupPending);
|
||||||
router.post("/verify-email", verifyEmail);
|
router.post("/verify-email", verifyEmail);
|
||||||
|
|
||||||
router.use(discord.routes());
|
|
||||||
router.use(github.routes());
|
|
||||||
router.use(twitter.routes());
|
|
||||||
|
|
||||||
router.post("/miauth/:session/check", async (ctx) => {
|
router.post("/miauth/:session/check", async (ctx) => {
|
||||||
const token = await AccessTokens.findOneBy({
|
const token = await AccessTokens.findOneBy({
|
||||||
session: ctx.params.session,
|
session: ctx.params.session,
|
||||||
|
|
|
@ -1,333 +0,0 @@
|
||||||
import type Koa from "koa";
|
|
||||||
import Router from "@koa/router";
|
|
||||||
import { OAuth2 } from "oauth";
|
|
||||||
import { v4 as uuid } from "uuid";
|
|
||||||
import { IsNull } from "typeorm";
|
|
||||||
import { getJson } from "@/misc/fetch.js";
|
|
||||||
import config from "@/config/index.js";
|
|
||||||
import { publishMainStream } from "@/services/stream.js";
|
|
||||||
import { fetchMeta } from "@/misc/fetch-meta.js";
|
|
||||||
import { Users, UserProfiles } from "@/models/index.js";
|
|
||||||
import type { ILocalUser } from "@/models/entities/user.js";
|
|
||||||
import { redisClient } from "../../../db/redis.js";
|
|
||||||
import signin from "../common/signin.js";
|
|
||||||
|
|
||||||
function getUserToken(ctx: Koa.BaseContext): string | null {
|
|
||||||
return ((ctx.headers["cookie"] || "").match(/igi=(\w+)/) || [null, null])[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
function compareOrigin(ctx: Koa.BaseContext): boolean {
|
|
||||||
function normalizeUrl(url?: string): string {
|
|
||||||
return url ? (url.endsWith("/") ? url.slice(0, url.length - 1) : url) : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
const referer = ctx.headers["referer"];
|
|
||||||
|
|
||||||
return normalizeUrl(referer) === normalizeUrl(config.url);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Init router
|
|
||||||
const router = new Router();
|
|
||||||
|
|
||||||
router.get("/disconnect/discord", async (ctx) => {
|
|
||||||
if (!compareOrigin(ctx)) {
|
|
||||||
ctx.throw(400, "invalid origin");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const userToken = getUserToken(ctx);
|
|
||||||
if (!userToken) {
|
|
||||||
ctx.throw(400, "signin required");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const user = await Users.findOneByOrFail({
|
|
||||||
host: IsNull(),
|
|
||||||
token: userToken,
|
|
||||||
});
|
|
||||||
|
|
||||||
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
|
|
||||||
|
|
||||||
profile.integrations.discord = undefined;
|
|
||||||
|
|
||||||
await UserProfiles.update(user.id, {
|
|
||||||
integrations: profile.integrations,
|
|
||||||
});
|
|
||||||
|
|
||||||
ctx.body = "Discordの連携を解除しました :v:";
|
|
||||||
|
|
||||||
// Publish i updated event
|
|
||||||
publishMainStream(
|
|
||||||
user.id,
|
|
||||||
"meUpdated",
|
|
||||||
await Users.pack(user, user, {
|
|
||||||
detail: true,
|
|
||||||
includeSecrets: true,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
async function getOAuth2() {
|
|
||||||
const meta = await fetchMeta(true);
|
|
||||||
|
|
||||||
if (meta.enableDiscordIntegration) {
|
|
||||||
return new OAuth2(
|
|
||||||
meta.discordClientId!,
|
|
||||||
meta.discordClientSecret!,
|
|
||||||
"https://discord.com/",
|
|
||||||
"api/oauth2/authorize",
|
|
||||||
"api/oauth2/token",
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
router.get("/connect/discord", async (ctx) => {
|
|
||||||
if (!compareOrigin(ctx)) {
|
|
||||||
ctx.throw(400, "invalid origin");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const userToken = getUserToken(ctx);
|
|
||||||
if (!userToken) {
|
|
||||||
ctx.throw(400, "signin required");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const params = {
|
|
||||||
redirect_uri: `${config.url}/api/dc/cb`,
|
|
||||||
scope: ["identify"],
|
|
||||||
state: uuid(),
|
|
||||||
response_type: "code",
|
|
||||||
};
|
|
||||||
|
|
||||||
redisClient.set(userToken, JSON.stringify(params));
|
|
||||||
|
|
||||||
const oauth2 = await getOAuth2();
|
|
||||||
ctx.redirect(oauth2!.getAuthorizeUrl(params));
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get("/signin/discord", async (ctx) => {
|
|
||||||
const sessid = uuid();
|
|
||||||
|
|
||||||
const params = {
|
|
||||||
redirect_uri: `${config.url}/api/dc/cb`,
|
|
||||||
scope: ["identify"],
|
|
||||||
state: uuid(),
|
|
||||||
response_type: "code",
|
|
||||||
};
|
|
||||||
|
|
||||||
ctx.cookies.set("signin_with_discord_sid", sessid, {
|
|
||||||
path: "/",
|
|
||||||
secure: config.url.startsWith("https"),
|
|
||||||
httpOnly: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
redisClient.set(sessid, JSON.stringify(params));
|
|
||||||
|
|
||||||
const oauth2 = await getOAuth2();
|
|
||||||
ctx.redirect(oauth2!.getAuthorizeUrl(params));
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get("/dc/cb", async (ctx) => {
|
|
||||||
const userToken = getUserToken(ctx);
|
|
||||||
|
|
||||||
const oauth2 = await getOAuth2();
|
|
||||||
|
|
||||||
if (!userToken) {
|
|
||||||
const sessid = ctx.cookies.get("signin_with_discord_sid");
|
|
||||||
|
|
||||||
if (!sessid) {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const code = ctx.query.code;
|
|
||||||
|
|
||||||
if (!code || typeof code !== "string") {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { redirect_uri, state } = await new Promise<any>((res, rej) => {
|
|
||||||
redisClient.get(sessid, async (_, state) => {
|
|
||||||
res(JSON.parse(state));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
if (ctx.query.state !== state) {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { accessToken, refreshToken, expiresDate } = await new Promise<any>(
|
|
||||||
(res, rej) =>
|
|
||||||
oauth2!.getOAuthAccessToken(
|
|
||||||
code,
|
|
||||||
{
|
|
||||||
grant_type: "authorization_code",
|
|
||||||
redirect_uri,
|
|
||||||
},
|
|
||||||
(err, accessToken, refreshToken, result) => {
|
|
||||||
if (err) {
|
|
||||||
rej(err);
|
|
||||||
} else if (result.error) {
|
|
||||||
rej(result.error);
|
|
||||||
} else {
|
|
||||||
res({
|
|
||||||
accessToken,
|
|
||||||
refreshToken,
|
|
||||||
expiresDate: Date.now() + Number(result.expires_in) * 1000,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
const { id, username, discriminator } = (await getJson(
|
|
||||||
"https://discord.com/api/users/@me",
|
|
||||||
"*/*",
|
|
||||||
10 * 1000,
|
|
||||||
{
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
)) as Record<string, unknown>;
|
|
||||||
|
|
||||||
if (
|
|
||||||
typeof id !== "string" ||
|
|
||||||
typeof username !== "string" ||
|
|
||||||
typeof discriminator !== "string"
|
|
||||||
) {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const profile = await UserProfiles.createQueryBuilder()
|
|
||||||
.where("\"integrations\"->'discord'->>'id' = :id", { id: id })
|
|
||||||
.andWhere('"userHost" IS NULL')
|
|
||||||
.getOne();
|
|
||||||
|
|
||||||
if (profile == null) {
|
|
||||||
ctx.throw(
|
|
||||||
404,
|
|
||||||
`@${username}#${discriminator}と連携しているMisskeyアカウントはありませんでした...`,
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await UserProfiles.update(profile.userId, {
|
|
||||||
integrations: {
|
|
||||||
...profile.integrations,
|
|
||||||
discord: {
|
|
||||||
id: id,
|
|
||||||
accessToken: accessToken,
|
|
||||||
refreshToken: refreshToken,
|
|
||||||
expiresDate: expiresDate,
|
|
||||||
username: username,
|
|
||||||
discriminator: discriminator,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
signin(
|
|
||||||
ctx,
|
|
||||||
(await Users.findOneBy({ id: profile.userId })) as ILocalUser,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
const code = ctx.query.code;
|
|
||||||
|
|
||||||
if (!code || typeof code !== "string") {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { redirect_uri, state } = await new Promise<any>((res, rej) => {
|
|
||||||
redisClient.get(userToken, async (_, state) => {
|
|
||||||
res(JSON.parse(state));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
if (ctx.query.state !== state) {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { accessToken, refreshToken, expiresDate } = await new Promise<any>(
|
|
||||||
(res, rej) =>
|
|
||||||
oauth2!.getOAuthAccessToken(
|
|
||||||
code,
|
|
||||||
{
|
|
||||||
grant_type: "authorization_code",
|
|
||||||
redirect_uri,
|
|
||||||
},
|
|
||||||
(err, accessToken, refreshToken, result) => {
|
|
||||||
if (err) {
|
|
||||||
rej(err);
|
|
||||||
} else if (result.error) {
|
|
||||||
rej(result.error);
|
|
||||||
} else {
|
|
||||||
res({
|
|
||||||
accessToken,
|
|
||||||
refreshToken,
|
|
||||||
expiresDate: Date.now() + Number(result.expires_in) * 1000,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
const { id, username, discriminator } = (await getJson(
|
|
||||||
"https://discord.com/api/users/@me",
|
|
||||||
"*/*",
|
|
||||||
10 * 1000,
|
|
||||||
{
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
)) as Record<string, unknown>;
|
|
||||||
if (
|
|
||||||
typeof id !== "string" ||
|
|
||||||
typeof username !== "string" ||
|
|
||||||
typeof discriminator !== "string"
|
|
||||||
) {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const user = await Users.findOneByOrFail({
|
|
||||||
host: IsNull(),
|
|
||||||
token: userToken,
|
|
||||||
});
|
|
||||||
|
|
||||||
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
|
|
||||||
|
|
||||||
await UserProfiles.update(user.id, {
|
|
||||||
integrations: {
|
|
||||||
...profile.integrations,
|
|
||||||
discord: {
|
|
||||||
accessToken: accessToken,
|
|
||||||
refreshToken: refreshToken,
|
|
||||||
expiresDate: expiresDate,
|
|
||||||
id: id,
|
|
||||||
username: username,
|
|
||||||
discriminator: discriminator,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
ctx.body = `Discord: @${username}#${discriminator} を、Misskey: @${user.username} に接続しました!`;
|
|
||||||
|
|
||||||
// Publish i updated event
|
|
||||||
publishMainStream(
|
|
||||||
user.id,
|
|
||||||
"meUpdated",
|
|
||||||
await Users.pack(user, user, {
|
|
||||||
detail: true,
|
|
||||||
includeSecrets: true,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default router;
|
|
|
@ -1,296 +0,0 @@
|
||||||
import type Koa from "koa";
|
|
||||||
import Router from "@koa/router";
|
|
||||||
import { OAuth2 } from "oauth";
|
|
||||||
import { v4 as uuid } from "uuid";
|
|
||||||
import { IsNull } from "typeorm";
|
|
||||||
import { getJson } from "@/misc/fetch.js";
|
|
||||||
import config from "@/config/index.js";
|
|
||||||
import { publishMainStream } from "@/services/stream.js";
|
|
||||||
import { fetchMeta } from "@/misc/fetch-meta.js";
|
|
||||||
import { Users, UserProfiles } from "@/models/index.js";
|
|
||||||
import type { ILocalUser } from "@/models/entities/user.js";
|
|
||||||
import { redisClient } from "../../../db/redis.js";
|
|
||||||
import signin from "../common/signin.js";
|
|
||||||
|
|
||||||
function getUserToken(ctx: Koa.BaseContext): string | null {
|
|
||||||
return ((ctx.headers["cookie"] || "").match(/igi=(\w+)/) || [null, null])[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
function compareOrigin(ctx: Koa.BaseContext): boolean {
|
|
||||||
function normalizeUrl(url?: string): string {
|
|
||||||
return url ? (url.endsWith("/") ? url.slice(0, url.length - 1) : url) : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
const referer = ctx.headers["referer"];
|
|
||||||
|
|
||||||
return normalizeUrl(referer) === normalizeUrl(config.url);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Init router
|
|
||||||
const router = new Router();
|
|
||||||
|
|
||||||
router.get("/disconnect/github", async (ctx) => {
|
|
||||||
if (!compareOrigin(ctx)) {
|
|
||||||
ctx.throw(400, "invalid origin");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const userToken = getUserToken(ctx);
|
|
||||||
if (!userToken) {
|
|
||||||
ctx.throw(400, "signin required");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const user = await Users.findOneByOrFail({
|
|
||||||
host: IsNull(),
|
|
||||||
token: userToken,
|
|
||||||
});
|
|
||||||
|
|
||||||
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
|
|
||||||
|
|
||||||
profile.integrations.github = undefined;
|
|
||||||
|
|
||||||
await UserProfiles.update(user.id, {
|
|
||||||
integrations: profile.integrations,
|
|
||||||
});
|
|
||||||
|
|
||||||
ctx.body = "GitHubの連携を解除しました :v:";
|
|
||||||
|
|
||||||
// Publish i updated event
|
|
||||||
publishMainStream(
|
|
||||||
user.id,
|
|
||||||
"meUpdated",
|
|
||||||
await Users.pack(user, user, {
|
|
||||||
detail: true,
|
|
||||||
includeSecrets: true,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
async function getOath2() {
|
|
||||||
const meta = await fetchMeta(true);
|
|
||||||
|
|
||||||
if (
|
|
||||||
meta.enableGithubIntegration &&
|
|
||||||
meta.githubClientId &&
|
|
||||||
meta.githubClientSecret
|
|
||||||
) {
|
|
||||||
return new OAuth2(
|
|
||||||
meta.githubClientId,
|
|
||||||
meta.githubClientSecret,
|
|
||||||
"https://github.com/",
|
|
||||||
"login/oauth/authorize",
|
|
||||||
"login/oauth/access_token",
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
router.get("/connect/github", async (ctx) => {
|
|
||||||
if (!compareOrigin(ctx)) {
|
|
||||||
ctx.throw(400, "invalid origin");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const userToken = getUserToken(ctx);
|
|
||||||
if (!userToken) {
|
|
||||||
ctx.throw(400, "signin required");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const params = {
|
|
||||||
redirect_uri: `${config.url}/api/gh/cb`,
|
|
||||||
scope: ["read:user"],
|
|
||||||
state: uuid(),
|
|
||||||
};
|
|
||||||
|
|
||||||
redisClient.set(userToken, JSON.stringify(params));
|
|
||||||
|
|
||||||
const oauth2 = await getOath2();
|
|
||||||
ctx.redirect(oauth2!.getAuthorizeUrl(params));
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get("/signin/github", async (ctx) => {
|
|
||||||
const sessid = uuid();
|
|
||||||
|
|
||||||
const params = {
|
|
||||||
redirect_uri: `${config.url}/api/gh/cb`,
|
|
||||||
scope: ["read:user"],
|
|
||||||
state: uuid(),
|
|
||||||
};
|
|
||||||
|
|
||||||
ctx.cookies.set("signin_with_github_sid", sessid, {
|
|
||||||
path: "/",
|
|
||||||
secure: config.url.startsWith("https"),
|
|
||||||
httpOnly: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
redisClient.set(sessid, JSON.stringify(params));
|
|
||||||
|
|
||||||
const oauth2 = await getOath2();
|
|
||||||
ctx.redirect(oauth2!.getAuthorizeUrl(params));
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get("/gh/cb", async (ctx) => {
|
|
||||||
const userToken = getUserToken(ctx);
|
|
||||||
|
|
||||||
const oauth2 = await getOath2();
|
|
||||||
|
|
||||||
if (!userToken) {
|
|
||||||
const sessid = ctx.cookies.get("signin_with_github_sid");
|
|
||||||
|
|
||||||
if (!sessid) {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const code = ctx.query.code;
|
|
||||||
|
|
||||||
if (!code || typeof code !== "string") {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { redirect_uri, state } = await new Promise<any>((res, rej) => {
|
|
||||||
redisClient.get(sessid, async (_, state) => {
|
|
||||||
res(JSON.parse(state));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
if (ctx.query.state !== state) {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { accessToken } = await new Promise<any>((res, rej) =>
|
|
||||||
oauth2!.getOAuthAccessToken(
|
|
||||||
code,
|
|
||||||
{
|
|
||||||
redirect_uri,
|
|
||||||
},
|
|
||||||
(err, accessToken, refresh, result) => {
|
|
||||||
if (err) {
|
|
||||||
rej(err);
|
|
||||||
} else if (result.error) {
|
|
||||||
rej(result.error);
|
|
||||||
} else {
|
|
||||||
res({ accessToken });
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
const { login, id } = (await getJson(
|
|
||||||
"https://api.github.com/user",
|
|
||||||
"application/vnd.github.v3+json",
|
|
||||||
10 * 1000,
|
|
||||||
{
|
|
||||||
Authorization: `bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
)) as Record<string, unknown>;
|
|
||||||
if (typeof login !== "string" || typeof id !== "string") {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const link = await UserProfiles.createQueryBuilder()
|
|
||||||
.where("\"integrations\"->'github'->>'id' = :id", { id: id })
|
|
||||||
.andWhere('"userHost" IS NULL')
|
|
||||||
.getOne();
|
|
||||||
|
|
||||||
if (link == null) {
|
|
||||||
ctx.throw(
|
|
||||||
404,
|
|
||||||
`@${login}と連携しているMisskeyアカウントはありませんでした...`,
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
signin(
|
|
||||||
ctx,
|
|
||||||
(await Users.findOneBy({ id: link.userId })) as ILocalUser,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
const code = ctx.query.code;
|
|
||||||
|
|
||||||
if (!code || typeof code !== "string") {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { redirect_uri, state } = await new Promise<any>((res, rej) => {
|
|
||||||
redisClient.get(userToken, async (_, state) => {
|
|
||||||
res(JSON.parse(state));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
if (ctx.query.state !== state) {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { accessToken } = await new Promise<any>((res, rej) =>
|
|
||||||
oauth2!.getOAuthAccessToken(
|
|
||||||
code,
|
|
||||||
{ redirect_uri },
|
|
||||||
(err, accessToken, refresh, result) => {
|
|
||||||
if (err) {
|
|
||||||
rej(err);
|
|
||||||
} else if (result.error) {
|
|
||||||
rej(result.error);
|
|
||||||
} else {
|
|
||||||
res({ accessToken });
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
const { login, id } = (await getJson(
|
|
||||||
"https://api.github.com/user",
|
|
||||||
"application/vnd.github.v3+json",
|
|
||||||
10 * 1000,
|
|
||||||
{
|
|
||||||
Authorization: `bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
)) as Record<string, unknown>;
|
|
||||||
|
|
||||||
if (typeof login !== "string" || typeof id !== "string") {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const user = await Users.findOneByOrFail({
|
|
||||||
host: IsNull(),
|
|
||||||
token: userToken,
|
|
||||||
});
|
|
||||||
|
|
||||||
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
|
|
||||||
|
|
||||||
await UserProfiles.update(user.id, {
|
|
||||||
integrations: {
|
|
||||||
...profile.integrations,
|
|
||||||
github: {
|
|
||||||
accessToken: accessToken,
|
|
||||||
id: id,
|
|
||||||
login: login,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
ctx.body = `GitHub: @${login} を、Misskey: @${user.username} に接続しました!`;
|
|
||||||
|
|
||||||
// Publish i updated event
|
|
||||||
publishMainStream(
|
|
||||||
user.id,
|
|
||||||
"meUpdated",
|
|
||||||
await Users.pack(user, user, {
|
|
||||||
detail: true,
|
|
||||||
includeSecrets: true,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default router;
|
|
|
@ -1,226 +0,0 @@
|
||||||
import type Koa from "koa";
|
|
||||||
import Router from "@koa/router";
|
|
||||||
import { v4 as uuid } from "uuid";
|
|
||||||
import autwh from "autwh";
|
|
||||||
import { IsNull } from "typeorm";
|
|
||||||
import { publishMainStream } from "@/services/stream.js";
|
|
||||||
import config from "@/config/index.js";
|
|
||||||
import { fetchMeta } from "@/misc/fetch-meta.js";
|
|
||||||
import { Users, UserProfiles } from "@/models/index.js";
|
|
||||||
import type { ILocalUser } from "@/models/entities/user.js";
|
|
||||||
import signin from "../common/signin.js";
|
|
||||||
import { redisClient } from "../../../db/redis.js";
|
|
||||||
|
|
||||||
function getUserToken(ctx: Koa.BaseContext): string | null {
|
|
||||||
return ((ctx.headers["cookie"] || "").match(/igi=(\w+)/) || [null, null])[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
function compareOrigin(ctx: Koa.BaseContext): boolean {
|
|
||||||
function normalizeUrl(url?: string): string {
|
|
||||||
return url == null
|
|
||||||
? ""
|
|
||||||
: url.endsWith("/")
|
|
||||||
? url.substr(0, url.length - 1)
|
|
||||||
: url;
|
|
||||||
}
|
|
||||||
|
|
||||||
const referer = ctx.headers["referer"];
|
|
||||||
|
|
||||||
return normalizeUrl(referer) === normalizeUrl(config.url);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Init router
|
|
||||||
const router = new Router();
|
|
||||||
|
|
||||||
router.get("/disconnect/twitter", async (ctx) => {
|
|
||||||
if (!compareOrigin(ctx)) {
|
|
||||||
ctx.throw(400, "invalid origin");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const userToken = getUserToken(ctx);
|
|
||||||
if (userToken == null) {
|
|
||||||
ctx.throw(400, "signin required");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const user = await Users.findOneByOrFail({
|
|
||||||
host: IsNull(),
|
|
||||||
token: userToken,
|
|
||||||
});
|
|
||||||
|
|
||||||
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
|
|
||||||
|
|
||||||
profile.integrations.twitter = undefined;
|
|
||||||
|
|
||||||
await UserProfiles.update(user.id, {
|
|
||||||
integrations: profile.integrations,
|
|
||||||
});
|
|
||||||
|
|
||||||
ctx.body = "Twitterの連携を解除しました :v:";
|
|
||||||
|
|
||||||
// Publish i updated event
|
|
||||||
publishMainStream(
|
|
||||||
user.id,
|
|
||||||
"meUpdated",
|
|
||||||
await Users.pack(user, user, {
|
|
||||||
detail: true,
|
|
||||||
includeSecrets: true,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
async function getTwAuth() {
|
|
||||||
const meta = await fetchMeta(true);
|
|
||||||
|
|
||||||
if (
|
|
||||||
meta.enableTwitterIntegration &&
|
|
||||||
meta.twitterConsumerKey &&
|
|
||||||
meta.twitterConsumerSecret
|
|
||||||
) {
|
|
||||||
return autwh({
|
|
||||||
consumerKey: meta.twitterConsumerKey,
|
|
||||||
consumerSecret: meta.twitterConsumerSecret,
|
|
||||||
callbackUrl: `${config.url}/api/tw/cb`,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
router.get("/connect/twitter", async (ctx) => {
|
|
||||||
if (!compareOrigin(ctx)) {
|
|
||||||
ctx.throw(400, "invalid origin");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const userToken = getUserToken(ctx);
|
|
||||||
if (userToken == null) {
|
|
||||||
ctx.throw(400, "signin required");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const twAuth = await getTwAuth();
|
|
||||||
const twCtx = await twAuth!.begin();
|
|
||||||
redisClient.set(userToken, JSON.stringify(twCtx));
|
|
||||||
ctx.redirect(twCtx.url);
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get("/signin/twitter", async (ctx) => {
|
|
||||||
const twAuth = await getTwAuth();
|
|
||||||
const twCtx = await twAuth!.begin();
|
|
||||||
|
|
||||||
const sessid = uuid();
|
|
||||||
|
|
||||||
redisClient.set(sessid, JSON.stringify(twCtx));
|
|
||||||
|
|
||||||
ctx.cookies.set("signin_with_twitter_sid", sessid, {
|
|
||||||
path: "/",
|
|
||||||
secure: config.url.startsWith("https"),
|
|
||||||
httpOnly: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
ctx.redirect(twCtx.url);
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get("/tw/cb", async (ctx) => {
|
|
||||||
const userToken = getUserToken(ctx);
|
|
||||||
|
|
||||||
const twAuth = await getTwAuth();
|
|
||||||
|
|
||||||
if (userToken == null) {
|
|
||||||
const sessid = ctx.cookies.get("signin_with_twitter_sid");
|
|
||||||
|
|
||||||
if (sessid == null) {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const get = new Promise<any>((res, rej) => {
|
|
||||||
redisClient.get(sessid, async (_, twCtx) => {
|
|
||||||
res(twCtx);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const twCtx = await get;
|
|
||||||
|
|
||||||
const verifier = ctx.query.oauth_verifier;
|
|
||||||
if (!verifier || typeof verifier !== "string") {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = await twAuth!.done(JSON.parse(twCtx), verifier);
|
|
||||||
|
|
||||||
const link = await UserProfiles.createQueryBuilder()
|
|
||||||
.where("\"integrations\"->'twitter'->>'userId' = :id", {
|
|
||||||
id: result.userId,
|
|
||||||
})
|
|
||||||
.andWhere('"userHost" IS NULL')
|
|
||||||
.getOne();
|
|
||||||
|
|
||||||
if (link == null) {
|
|
||||||
ctx.throw(
|
|
||||||
404,
|
|
||||||
`@${result.screenName}と連携しているMisskeyアカウントはありませんでした...`,
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
signin(
|
|
||||||
ctx,
|
|
||||||
(await Users.findOneBy({ id: link.userId })) as ILocalUser,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
const verifier = ctx.query.oauth_verifier;
|
|
||||||
|
|
||||||
if (!verifier || typeof verifier !== "string") {
|
|
||||||
ctx.throw(400, "invalid session");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const get = new Promise<any>((res, rej) => {
|
|
||||||
redisClient.get(userToken, async (_, twCtx) => {
|
|
||||||
res(twCtx);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const twCtx = await get;
|
|
||||||
|
|
||||||
const result = await twAuth!.done(JSON.parse(twCtx), verifier);
|
|
||||||
|
|
||||||
const user = await Users.findOneByOrFail({
|
|
||||||
host: IsNull(),
|
|
||||||
token: userToken,
|
|
||||||
});
|
|
||||||
|
|
||||||
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
|
|
||||||
|
|
||||||
await UserProfiles.update(user.id, {
|
|
||||||
integrations: {
|
|
||||||
...profile.integrations,
|
|
||||||
twitter: {
|
|
||||||
accessToken: result.accessToken,
|
|
||||||
accessTokenSecret: result.accessTokenSecret,
|
|
||||||
userId: result.userId,
|
|
||||||
screenName: result.screenName,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
ctx.body = `Twitter: @${result.screenName} を、Misskey: @${user.username} に接続しました!`;
|
|
||||||
|
|
||||||
// Publish i updated event
|
|
||||||
publishMainStream(
|
|
||||||
user.id,
|
|
||||||
"meUpdated",
|
|
||||||
await Users.pack(user, user, {
|
|
||||||
detail: true,
|
|
||||||
includeSecrets: true,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default router;
|
|
|
@ -124,38 +124,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="social _section">
|
|
||||||
<a
|
|
||||||
v-if="meta && meta.enableTwitterIntegration"
|
|
||||||
class="_borderButton _gap"
|
|
||||||
:href="`${apiUrl}/signin/twitter`"
|
|
||||||
><i
|
|
||||||
class="ph-twitter-logo ph-bold ph-lg"
|
|
||||||
style="margin-right: 4px"
|
|
||||||
></i
|
|
||||||
>{{ i18n.t("signinWith", { x: "Twitter" }) }}</a
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
v-if="meta && meta.enableGithubIntegration"
|
|
||||||
class="_borderButton _gap"
|
|
||||||
:href="`${apiUrl}/signin/github`"
|
|
||||||
><i
|
|
||||||
class="ph-github-logo ph-bold ph-lg"
|
|
||||||
style="margin-right: 4px"
|
|
||||||
></i
|
|
||||||
>{{ i18n.t("signinWith", { x: "GitHub" }) }}</a
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
v-if="meta && meta.enableDiscordIntegration"
|
|
||||||
class="_borderButton _gap"
|
|
||||||
:href="`${apiUrl}/signin/discord`"
|
|
||||||
><i
|
|
||||||
class="ph-discord-logo ph-bold ph-lg"
|
|
||||||
style="margin-right: 4px"
|
|
||||||
></i
|
|
||||||
>{{ i18n.t("signinWith", { x: "Discord" }) }}</a
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -169,7 +137,6 @@ import { apiUrl, host as configHost } from "@/config";
|
||||||
import { byteify, hexify } from "@/scripts/2fa";
|
import { byteify, hexify } from "@/scripts/2fa";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { login } from "@/account";
|
import { login } from "@/account";
|
||||||
import { instance } from "@/instance";
|
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
|
|
||||||
const signing = ref(false);
|
const signing = ref(false);
|
||||||
|
@ -184,8 +151,6 @@ const queryingKey = ref(false);
|
||||||
const hCaptchaResponse = ref(null);
|
const hCaptchaResponse = ref(null);
|
||||||
const reCaptchaResponse = ref(null);
|
const reCaptchaResponse = ref(null);
|
||||||
|
|
||||||
const meta = computed(() => instance);
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: "login", v: any): void;
|
(ev: "login", v: any): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
|
@ -264,14 +264,6 @@ const menuDef = computed(() => [
|
||||||
to: "/admin/relays",
|
to: "/admin/relays",
|
||||||
active: currentPage.value?.route.name === "relays",
|
active: currentPage.value?.route.name === "relays",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
icon: "ph-plug ph-bold ph-lg",
|
|
||||||
text: i18n.ts.integration,
|
|
||||||
to: "/admin/integrations",
|
|
||||||
active:
|
|
||||||
currentPage.value?.route.name ===
|
|
||||||
"integrations",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
icon: "ph-prohibit ph-bold ph-lg",
|
icon: "ph-prohibit ph-bold ph-lg",
|
||||||
text: i18n.ts.instanceBlocking,
|
text: i18n.ts.instanceBlocking,
|
||||||
|
|
|
@ -1,70 +0,0 @@
|
||||||
<template>
|
|
||||||
<FormSuspense :p="init">
|
|
||||||
<div class="_formRoot">
|
|
||||||
<FormSwitch v-model="enableDiscordIntegration" class="_formBlock">
|
|
||||||
<template #label>{{ i18n.ts.enable }}</template>
|
|
||||||
</FormSwitch>
|
|
||||||
|
|
||||||
<template v-if="enableDiscordIntegration">
|
|
||||||
<FormInfo class="_formBlock"
|
|
||||||
>Callback URL: {{ `${uri}/api/dc/cb` }}</FormInfo
|
|
||||||
>
|
|
||||||
|
|
||||||
<FormInput v-model="discordClientId" class="_formBlock">
|
|
||||||
<template #prefix
|
|
||||||
><i class="ph-key ph-bold ph-lg"></i
|
|
||||||
></template>
|
|
||||||
<template #label>Client ID</template>
|
|
||||||
</FormInput>
|
|
||||||
|
|
||||||
<FormInput v-model="discordClientSecret" class="_formBlock">
|
|
||||||
<template #prefix
|
|
||||||
><i class="ph-key ph-bold ph-lg"></i
|
|
||||||
></template>
|
|
||||||
<template #label>Client Secret</template>
|
|
||||||
</FormInput>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<FormButton primary class="_formBlock" @click="save"
|
|
||||||
><i class="ph-floppy-disk-back ph-bold ph-lg"></i>
|
|
||||||
{{ i18n.ts.save }}</FormButton
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</FormSuspense>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { ref } from "vue";
|
|
||||||
|
|
||||||
import FormSwitch from "@/components/form/switch.vue";
|
|
||||||
import FormInput from "@/components/form/input.vue";
|
|
||||||
import FormButton from "@/components/MkButton.vue";
|
|
||||||
import FormInfo from "@/components/MkInfo.vue";
|
|
||||||
import FormSuspense from "@/components/form/suspense.vue";
|
|
||||||
import * as os from "@/os";
|
|
||||||
import { fetchInstance } from "@/instance";
|
|
||||||
import { i18n } from "@/i18n";
|
|
||||||
|
|
||||||
const uri = ref("");
|
|
||||||
const enableDiscordIntegration = ref(false);
|
|
||||||
const discordClientId = ref(null);
|
|
||||||
const discordClientSecret = ref(null);
|
|
||||||
|
|
||||||
async function init() {
|
|
||||||
const meta = await os.api("admin/meta");
|
|
||||||
uri.value = meta.uri;
|
|
||||||
enableDiscordIntegration.value = meta.enableDiscordIntegration;
|
|
||||||
discordClientId.value = meta.discordClientId;
|
|
||||||
discordClientSecret.value = meta.discordClientSecret;
|
|
||||||
}
|
|
||||||
|
|
||||||
function save() {
|
|
||||||
os.apiWithDialog("admin/update-meta", {
|
|
||||||
enableDiscordIntegration: enableDiscordIntegration.value,
|
|
||||||
discordClientId: discordClientId.value,
|
|
||||||
discordClientSecret: discordClientSecret.value,
|
|
||||||
}).then(() => {
|
|
||||||
fetchInstance();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
|
@ -1,70 +0,0 @@
|
||||||
<template>
|
|
||||||
<FormSuspense :p="init">
|
|
||||||
<div class="_formRoot">
|
|
||||||
<FormSwitch v-model="enableGithubIntegration" class="_formBlock">
|
|
||||||
<template #label>{{ i18n.ts.enable }}</template>
|
|
||||||
</FormSwitch>
|
|
||||||
|
|
||||||
<template v-if="enableGithubIntegration">
|
|
||||||
<FormInfo class="_formBlock"
|
|
||||||
>Callback URL: {{ `${uri}/api/gh/cb` }}</FormInfo
|
|
||||||
>
|
|
||||||
|
|
||||||
<FormInput v-model="githubClientId" class="_formBlock">
|
|
||||||
<template #prefix
|
|
||||||
><i class="ph-key ph-bold ph-lg"></i
|
|
||||||
></template>
|
|
||||||
<template #label>Client ID</template>
|
|
||||||
</FormInput>
|
|
||||||
|
|
||||||
<FormInput v-model="githubClientSecret" class="_formBlock">
|
|
||||||
<template #prefix
|
|
||||||
><i class="ph-key ph-bold ph-lg"></i
|
|
||||||
></template>
|
|
||||||
<template #label>Client Secret</template>
|
|
||||||
</FormInput>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<FormButton primary class="_formBlock" @click="save"
|
|
||||||
><i class="ph-floppy-disk-back ph-bold ph-lg"></i>
|
|
||||||
{{ i18n.ts.save }}</FormButton
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</FormSuspense>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { ref } from "vue";
|
|
||||||
|
|
||||||
import FormSwitch from "@/components/form/switch.vue";
|
|
||||||
import FormInput from "@/components/form/input.vue";
|
|
||||||
import FormButton from "@/components/MkButton.vue";
|
|
||||||
import FormInfo from "@/components/MkInfo.vue";
|
|
||||||
import FormSuspense from "@/components/form/suspense.vue";
|
|
||||||
import * as os from "@/os";
|
|
||||||
import { fetchInstance } from "@/instance";
|
|
||||||
import { i18n } from "@/i18n";
|
|
||||||
|
|
||||||
const uri = ref("");
|
|
||||||
const enableGithubIntegration = ref(false);
|
|
||||||
const githubClientId = ref(null);
|
|
||||||
const githubClientSecret = ref(null);
|
|
||||||
|
|
||||||
async function init() {
|
|
||||||
const meta = await os.api("admin/meta");
|
|
||||||
uri.value = meta.uri;
|
|
||||||
enableGithubIntegration.value = meta.enableGithubIntegration;
|
|
||||||
githubClientId.value = meta.githubClientId;
|
|
||||||
githubClientSecret.value = meta.githubClientSecret;
|
|
||||||
}
|
|
||||||
|
|
||||||
function save() {
|
|
||||||
os.apiWithDialog("admin/update-meta", {
|
|
||||||
enableGithubIntegration: enableGithubIntegration.value,
|
|
||||||
githubClientId: githubClientId.value,
|
|
||||||
githubClientSecret: githubClientSecret.value,
|
|
||||||
}).then(() => {
|
|
||||||
fetchInstance();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
|
@ -1,68 +0,0 @@
|
||||||
<template>
|
|
||||||
<MkStickyContainer>
|
|
||||||
<template #header
|
|
||||||
><MkPageHeader
|
|
||||||
:actions="headerActions"
|
|
||||||
:tabs="headerTabs"
|
|
||||||
:display-back-button="true"
|
|
||||||
/></template>
|
|
||||||
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32">
|
|
||||||
<FormSuspense :p="init">
|
|
||||||
<FormFolder class="_formBlock">
|
|
||||||
<template #icon
|
|
||||||
><i class="ph-github-logo ph-bold ph-lg"></i
|
|
||||||
></template>
|
|
||||||
<template #label>GitHub</template>
|
|
||||||
<template #suffix>{{
|
|
||||||
enableGithubIntegration
|
|
||||||
? i18n.ts.enabled
|
|
||||||
: i18n.ts.disabled
|
|
||||||
}}</template>
|
|
||||||
<XGithub />
|
|
||||||
</FormFolder>
|
|
||||||
<FormFolder class="_formBlock">
|
|
||||||
<template #icon
|
|
||||||
><i class="ph-discord-logo ph-bold ph-lg"></i
|
|
||||||
></template>
|
|
||||||
<template #label>Discord</template>
|
|
||||||
<template #suffix>{{
|
|
||||||
enableDiscordIntegration
|
|
||||||
? i18n.ts.enabled
|
|
||||||
: i18n.ts.disabled
|
|
||||||
}}</template>
|
|
||||||
<XDiscord />
|
|
||||||
</FormFolder>
|
|
||||||
</FormSuspense>
|
|
||||||
</MkSpacer>
|
|
||||||
</MkStickyContainer>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { computed, ref } from "vue";
|
|
||||||
|
|
||||||
import XGithub from "./integrations.github.vue";
|
|
||||||
import XDiscord from "./integrations.discord.vue";
|
|
||||||
import FormSuspense from "@/components/form/suspense.vue";
|
|
||||||
import FormFolder from "@/components/form/folder.vue";
|
|
||||||
import * as os from "@/os";
|
|
||||||
import { i18n } from "@/i18n";
|
|
||||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
|
||||||
|
|
||||||
const enableGithubIntegration = ref(false);
|
|
||||||
const enableDiscordIntegration = ref(false);
|
|
||||||
|
|
||||||
async function init() {
|
|
||||||
const meta = await os.api("admin/meta");
|
|
||||||
enableGithubIntegration.value = meta.enableGithubIntegration;
|
|
||||||
enableDiscordIntegration.value = meta.enableDiscordIntegration;
|
|
||||||
}
|
|
||||||
|
|
||||||
const headerActions = computed(() => []);
|
|
||||||
|
|
||||||
const headerTabs = computed(() => []);
|
|
||||||
|
|
||||||
definePageMetadata({
|
|
||||||
title: i18n.ts.integration,
|
|
||||||
icon: "ph-plug ph-bold ph-lg",
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -116,12 +116,6 @@ const menuDef = computed(() => [
|
||||||
to: "/settings/email",
|
to: "/settings/email",
|
||||||
active: currentPage.value?.route.name === "email",
|
active: currentPage.value?.route.name === "email",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
icon: "ph-share-network ph-bold ph-lg",
|
|
||||||
text: i18n.ts.integration,
|
|
||||||
to: "/settings/integration",
|
|
||||||
active: currentPage.value?.route.name === "integration",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
icon: "ph-lock ph-bold ph-lg",
|
icon: "ph-lock ph-bold ph-lg",
|
||||||
text: i18n.ts.security,
|
text: i18n.ts.security,
|
||||||
|
|
|
@ -1,118 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="_formRoot">
|
|
||||||
<FormSection v-if="instance.enableDiscordIntegration">
|
|
||||||
<template #label
|
|
||||||
><i class="ph-discord-logo ph-bold ph-lg"></i> Discord</template
|
|
||||||
>
|
|
||||||
<p v-if="integrations.discord">
|
|
||||||
{{ i18n.ts.connectedTo }}:
|
|
||||||
<a
|
|
||||||
:href="`https://discord.com/users/${integrations.discord.id}`"
|
|
||||||
rel="nofollow noopener"
|
|
||||||
target="_blank"
|
|
||||||
>@{{ integrations.discord.username }}#{{
|
|
||||||
integrations.discord.discriminator
|
|
||||||
}}</a
|
|
||||||
>
|
|
||||||
</p>
|
|
||||||
<MkButton
|
|
||||||
v-if="integrations.discord"
|
|
||||||
danger
|
|
||||||
@click="disconnectDiscord"
|
|
||||||
>{{ i18n.ts.disconnectService }}</MkButton
|
|
||||||
>
|
|
||||||
<MkButton v-else primary @click="connectDiscord">{{
|
|
||||||
i18n.ts.connectService
|
|
||||||
}}</MkButton>
|
|
||||||
</FormSection>
|
|
||||||
|
|
||||||
<FormSection v-if="instance.enableGithubIntegration">
|
|
||||||
<template #label
|
|
||||||
><i class="ph-github-logo ph-bold ph-lg"></i> GitHub</template
|
|
||||||
>
|
|
||||||
<p v-if="integrations.github">
|
|
||||||
{{ i18n.ts.connectedTo }}:
|
|
||||||
<a
|
|
||||||
:href="`https://github.com/${integrations.github.login}`"
|
|
||||||
rel="nofollow noopener"
|
|
||||||
target="_blank"
|
|
||||||
>@{{ integrations.github.login }}</a
|
|
||||||
>
|
|
||||||
</p>
|
|
||||||
<MkButton
|
|
||||||
v-if="integrations.github"
|
|
||||||
danger
|
|
||||||
@click="disconnectGithub"
|
|
||||||
>{{ i18n.ts.disconnectService }}</MkButton
|
|
||||||
>
|
|
||||||
<MkButton v-else primary @click="connectGithub">{{
|
|
||||||
i18n.ts.connectService
|
|
||||||
}}</MkButton>
|
|
||||||
</FormSection>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { computed, onMounted, ref, watch } from "vue";
|
|
||||||
import { apiUrl } from "@/config";
|
|
||||||
import FormSection from "@/components/form/section.vue";
|
|
||||||
import MkButton from "@/components/MkButton.vue";
|
|
||||||
import { $i } from "@/account";
|
|
||||||
import { instance } from "@/instance";
|
|
||||||
import { i18n } from "@/i18n";
|
|
||||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
|
||||||
|
|
||||||
const twitterForm = ref<Window | null>(null);
|
|
||||||
const discordForm = ref<Window | null>(null);
|
|
||||||
const githubForm = ref<Window | null>(null);
|
|
||||||
|
|
||||||
const integrations = computed(() => $i!.integrations);
|
|
||||||
|
|
||||||
function openWindow(service: string, type: string) {
|
|
||||||
return window.open(
|
|
||||||
`${apiUrl}/${type}/${service}`,
|
|
||||||
`${service}_${type}_window`,
|
|
||||||
"height=570, width=520",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function connectDiscord() {
|
|
||||||
discordForm.value = openWindow("discord", "connect");
|
|
||||||
}
|
|
||||||
|
|
||||||
function disconnectDiscord() {
|
|
||||||
openWindow("discord", "disconnect");
|
|
||||||
}
|
|
||||||
|
|
||||||
function connectGithub() {
|
|
||||||
githubForm.value = openWindow("github", "connect");
|
|
||||||
}
|
|
||||||
|
|
||||||
function disconnectGithub() {
|
|
||||||
openWindow("github", "disconnect");
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
document.cookie =
|
|
||||||
`igi=${$i!.token}; path=/;` +
|
|
||||||
" max-age=31536000;" +
|
|
||||||
(document.location.protocol.startsWith("https") ? " secure" : "");
|
|
||||||
|
|
||||||
watch(integrations, () => {
|
|
||||||
if (integrations.value.twitter) {
|
|
||||||
if (twitterForm.value) twitterForm.value.close();
|
|
||||||
}
|
|
||||||
if (integrations.value.discord) {
|
|
||||||
if (discordForm.value) discordForm.value.close();
|
|
||||||
}
|
|
||||||
if (integrations.value.github) {
|
|
||||||
if (githubForm.value) githubForm.value.close();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
definePageMetadata({
|
|
||||||
title: i18n.ts.integration,
|
|
||||||
icon: "ph-share-network ph-bold ph-lg",
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -103,11 +103,6 @@ export const routes = [
|
||||||
name: "email",
|
name: "email",
|
||||||
component: page(() => import("./pages/settings/email.vue")),
|
component: page(() => import("./pages/settings/email.vue")),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: "/integration",
|
|
||||||
name: "integration",
|
|
||||||
component: page(() => import("./pages/settings/integration.vue")),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "/security",
|
path: "/security",
|
||||||
name: "security",
|
name: "security",
|
||||||
|
@ -527,11 +522,6 @@ export const routes = [
|
||||||
name: "relays",
|
name: "relays",
|
||||||
component: page(() => import("./pages/admin/relays.vue")),
|
component: page(() => import("./pages/admin/relays.vue")),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: "/integrations",
|
|
||||||
name: "integrations",
|
|
||||||
component: page(() => import("./pages/admin/integrations.vue")),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "/instance-block",
|
path: "/instance-block",
|
||||||
name: "instance-block",
|
name: "instance-block",
|
||||||
|
|
|
@ -306,9 +306,6 @@ importers:
|
||||||
nsfwjs:
|
nsfwjs:
|
||||||
specifier: 2.4.2
|
specifier: 2.4.2
|
||||||
version: 2.4.2(@tensorflow/tfjs@4.11.0)
|
version: 2.4.2(@tensorflow/tfjs@4.11.0)
|
||||||
oauth:
|
|
||||||
specifier: ^0.10.0
|
|
||||||
version: 0.10.0
|
|
||||||
opencc-js:
|
opencc-js:
|
||||||
specifier: ^1.0.5
|
specifier: ^1.0.5
|
||||||
version: 1.0.5
|
version: 1.0.5
|
||||||
|
|
Loading…
Reference in a new issue