Merge pull request 'Properly fix actions to work with Forgejo Actions' (#38) from sugar/forkey:use-pnpm-action-4.0.0 into main

Reviewed-on: woem.men/forkey#38
This commit is contained in:
sugar 2025-01-17 11:42:38 +00:00
commit b279f6e3d2
16 changed files with 59 additions and 37 deletions

View file

@ -0,0 +1,16 @@
# Workaround for Forgejo not supporting port redirection
url: 'http://misskey.local'
port: 61812
db:
host: postgres
port: 5432
db: test-misskey
user: postgres
pass: ''
redis:
host: dragonfly
port: 6379
id: aidx

View file

@ -21,7 +21,7 @@ jobs:
submodules: true submodules: true
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4.0.0
with: with:
run_install: false run_install: false

View file

@ -26,7 +26,7 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
submodules: true submodules: true
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4.0.0
with: with:
run_install: false run_install: false
- uses: actions/setup-node@v4.1.0 - uses: actions/setup-node@v4.1.0
@ -51,7 +51,7 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
submodules: true submodules: true
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4.0.0
with: with:
run_install: false run_install: false
- uses: actions/setup-node@v4.1.0 - uses: actions/setup-node@v4.1.0
@ -75,7 +75,7 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
submodules: true submodules: true
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4.0.0
with: with:
run_install: false run_install: false
- uses: actions/setup-node@v4.1.0 - uses: actions/setup-node@v4.1.0

View file

@ -25,8 +25,6 @@ jobs:
services: services:
postgres: postgres:
image: postgres:15 image: postgres:15
ports:
- 54312:5432
env: env:
POSTGRES_DB: test-misskey POSTGRES_DB: test-misskey
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
@ -42,8 +40,6 @@ jobs:
DFLY_conn_io_threads: 4 DFLY_conn_io_threads: 4
DFLY_epoll_file_threads: 4 DFLY_epoll_file_threads: 4
DFLY_proactor_threads: 4 DFLY_proactor_threads: 4
ports:
- 56312:6379
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -51,11 +47,11 @@ jobs:
fetch-depth: 0 fetch-depth: 0
submodules: true submodules: true
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4.0.0
with: with:
run_install: false run_install: false
- name: Install FFmpeg - name: Install FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3 uses: https://github.com/FedericoCarboni/setup-ffmpeg@v3
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.1.0 uses: actions/setup-node@v4.1.0
with: with:
@ -65,7 +61,7 @@ jobs:
- name: Check pnpm-lock.yaml - name: Check pnpm-lock.yaml
run: git diff --exit-code pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml
- name: Copy Configure - name: Copy Configure
run: cp .forgejo/misskey/test.yml .config run: cp .forgejo/misskey/test-forgejo.yml .config/test.yml
- name: Build - name: Build
run: pnpm build run: pnpm build
- name: Test - name: Test
@ -81,8 +77,6 @@ jobs:
services: services:
postgres: postgres:
image: postgres:15 image: postgres:15
ports:
- 54312:5432
env: env:
POSTGRES_DB: test-misskey POSTGRES_DB: test-misskey
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
@ -98,8 +92,6 @@ jobs:
DFLY_conn_io_threads: 4 DFLY_conn_io_threads: 4
DFLY_epoll_file_threads: 4 DFLY_epoll_file_threads: 4
DFLY_proactor_threads: 4 DFLY_proactor_threads: 4
ports:
- 56312:6379
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -107,7 +99,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
submodules: true submodules: true
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4.0.0
with: with:
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
@ -119,7 +111,7 @@ jobs:
- name: Check pnpm-lock.yaml - name: Check pnpm-lock.yaml
run: git diff --exit-code pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml
- name: Copy Configure - name: Copy Configure
run: cp .forgejo/misskey/test.yml .config run: cp .forgejo/misskey/test-forgejo.yml .config/test.yml
- name: Build - name: Build
run: pnpm build run: pnpm build
- name: Test - name: Test

View file

@ -35,7 +35,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
submodules: true submodules: true
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4.0.0
with: with:
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
@ -47,7 +47,7 @@ jobs:
- name: Check pnpm-lock.yaml - name: Check pnpm-lock.yaml
run: git diff --exit-code pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml
- name: Copy Configure - name: Copy Configure
run: cp .forgejo/misskey/test.yml .config run: cp .forgejo/misskey/test-forgejo.yml .config/test.yml
- name: Build - name: Build
run: pnpm build run: pnpm build
- name: Test - name: Test

View file

@ -31,7 +31,7 @@ jobs:
submodules: true submodules: true
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4.0.0
with: with:
run_install: false run_install: false

View file

@ -23,7 +23,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
submodules: true submodules: true
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4.0.0
with: with:
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
@ -35,6 +35,6 @@ jobs:
- name: Check pnpm-lock.yaml - name: Check pnpm-lock.yaml
run: git diff --exit-code pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml
- name: Copy Configure - name: Copy Configure
run: cp .forgejo/misskey/test.yml .config/default.yml run: cp .forgejo/misskey/test-forgejo.yml .config/default.yml
- name: Build - name: Build
run: pnpm build run: pnpm build

View file

@ -24,7 +24,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
submodules: true submodules: true
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4.0.0
with: with:
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}

View file

@ -651,6 +651,14 @@ export const packedMeDetailedOnlySchema = {
type: 'boolean', type: 'boolean',
nullable: true, optional: true, nullable: true, optional: true,
}, },
approved: {
type: 'boolean',
nullable: false, optional: true,
},
signupReason: {
type: 'string',
nullable: true, optional: true,
},
securityKeysList: { securityKeysList: {
type: 'array', type: 'array',
nullable: false, optional: true, nullable: false, optional: true,

View file

@ -244,14 +244,14 @@ export class SignupApiService {
} else { } else {
try { try {
const { account, secret } = await this.signupService.signup({ const { account, secret } = await this.signupService.signup({
username, password, host, reason username, password, host, reason,
}); });
if (instance.approvalRequiredForSignup) { if (instance.approvalRequiredForSignup) {
if (emailAddress) { if (emailAddress) {
this.emailService.sendEmail(emailAddress, 'Approval pending', this.emailService.sendEmail(emailAddress, 'Approval pending',
'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.', 'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.',
'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.'); 'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.');
} }
} }

View file

@ -63,12 +63,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
await this.usedUsernamesRepository.delete({ username: user.username }); await this.usedUsernamesRepository.delete({ username: user.username });
//Actually delete it since the last function doesnt actually delete the account //Actually delete it since the last function doesnt actually delete the account
//Note: Before approval these accounts wont federate so this is totally fine. //Note: Before approval these accounts wont federate so this is totally fine.
await this.usersRepository.delete(user.id); await this.usersRepository.delete(user.id);
this.moderationLogService.log(me, 'decline', { this.moderationLogService.log(me, 'decline', {
userId: user.id, userId: user.id,
userUsername: user.username, userUsername: user.username,

View file

@ -37,9 +37,9 @@ export const meta = {
unapprovedUser: { unapprovedUser: {
message: 'The user has not been approved yet.', message: 'The user has not been approved yet.',
code: 'UNAPPROVED_USER', code: 'UNAPPROVED_USER',
id: '8d66f136-b3e1-48fd-92c4-30ecfd7fdb7a', id: '8d66f136-b3e1-48fd-92c4-30ecfd7fdb7a',
}, },
followeeIsYourself: { followeeIsYourself: {
message: 'Followee is yourself.', message: 'Followee is yourself.',

View file

@ -151,6 +151,8 @@ describe('ユーザー', () => {
...(security ? { ...(security ? {
email: user.email, email: user.email,
emailVerified: user.emailVerified, emailVerified: user.emailVerified,
approved: user.approved,
signupReason: user.signupReason,
securityKeysList: user.securityKeysList, securityKeysList: user.securityKeysList,
} : {}), } : {}),
}); });

View file

@ -46,8 +46,8 @@ const pagination = {
function deleted(id: string) { function deleted(id: string) {
if (paginationComponent.value) { if (paginationComponent.value) {
paginationComponent.value.items = paginationComponent.value.items.filter( paginationComponent.value.items = paginationComponent.value.items.filter(
(item: any) => item.id !== id (item: any) => item.id !== id,
); );
} }
} }

View file

@ -484,13 +484,13 @@ const routes: RouteDef[] = [{
component: page(() => import('@/pages/admin/invites.vue')), component: page(() => import('@/pages/admin/invites.vue')),
}, { }, {
path: '/approvals', path: '/approvals',
name: 'approvals', name: 'approvals',
component: page(() => import('@/pages/admin/approvals.vue')), component: page(() => import('@/pages/admin/approvals.vue')),
}, { }, {
path: '/', path: '/',
component: page(() => import('@/pages/_empty_.vue')), component: page(() => import('@/pages/_empty_.vue')),
}], }],
},{ }, {
path: '/my/notifications', path: '/my/notifications',
component: page(() => import('@/pages/notifications.vue')), component: page(() => import('@/pages/notifications.vue')),
loginRequired: true, loginRequired: true,

View file

@ -4103,6 +4103,8 @@ export type components = {
policies: components['schemas']['RolePolicies']; policies: components['schemas']['RolePolicies'];
email?: string | null; email?: string | null;
emailVerified?: boolean | null; emailVerified?: boolean | null;
approved?: boolean;
signupReason?: string | null;
securityKeysList?: { securityKeysList?: {
/** /**
* Format: id * Format: id
@ -15517,6 +15519,8 @@ export type operations = {
type?: string | null; type?: string | null;
/** @enum {string|null} */ /** @enum {string|null} */
sort?: '+createdAt' | '-createdAt' | '+name' | '-name' | '+size' | '-size' | null; sort?: '+createdAt' | '-createdAt' | '+name' | '-name' | '+size' | '-size' | null;
/** @default */
searchQuery?: string;
}; };
}; };
}; };
@ -16116,6 +16120,8 @@ export type operations = {
* @default null * @default null
*/ */
folderId?: string | null; folderId?: string | null;
/** @default */
searchQuery?: string;
}; };
}; };
}; };