diff --git a/sources/git.ts b/sources/git.ts index 96aca81..82a6e87 100644 --- a/sources/git.ts +++ b/sources/git.ts @@ -7,14 +7,6 @@ export async function PushTokenToRepo(Repo: string, Token: string, SHA: string, repo: Repo.split('/')[1], path: SHA, message: `Update for ${SHA}`, - content: Token, - committer: { - name: 'bot', - email: '' - }, - author: { - name: 'bot', - email: '' - } + content: btoa(Token) }) } \ No newline at end of file diff --git a/sources/index.ts b/sources/index.ts index 105736a..3ed648e 100644 --- a/sources/index.ts +++ b/sources/index.ts @@ -21,7 +21,7 @@ FastifyInstance.post('/token', async (FRequest, FResponse) => { FResponse.status(400).send('Invalid request') return } - const SHA = Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(FRequest.body)))).map(Block =>Block.toString(16).padStart(2, '0')).join('') + const SHA = Array.from(new Uint8Array(await crypto.subtle.digest('SHA-1', new TextEncoder().encode(FRequest.body)))).map(Block =>Block.toString(16).padStart(2, '0')).join('') try { await got.get(`https://cdn.jsdelivr.net/gh/List-KR/microShield-token@main/${SHA}`, { http2: true,