Skip to content

Commit

Permalink
Merge pull request vfarid#18 from vfarid/revert-14-main
Browse files Browse the repository at this point in the history
Revert "Fix Vless Refused & Update Interface using AdminLTE"
  • Loading branch information
vfarid authored Dec 1, 2023
2 parents 6adb682 + 7631b9c commit 97de301
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 220 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- uses: actions/checkout@v2
- run: npm i
- run: sed -i s/KV_NAME/${{ secrets.KV_NAME }}/g wrangler.toml
- name: Build & Deploy Worker
uses: cloudflare/wrangler-action@v3
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
[نسخه فارسی](https://github.com/vfarid/v2ray-worker/blob/main/README-fa.md)

## How to use
1. Fork this Repo and enable Github Action
2. Open CloudFlare and create KV namespace with name `settings` then copy the ID
3. Go to this forked repo and set secrets with name `KV_NAME` and fill with KV settings ID
4. Edit this `README.md` file, then find and replace this button url bellow with yours `https://github.com/USER/REPO_NAME` then save it.
4. then press `Deploy With Workers` and follow the instruction

To be completed...

[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/vfarid/v2ray-worker)

Expand Down
60 changes: 23 additions & 37 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,39 @@ export async function GetLogin(request: Request, env: Env): Promise<Response> {
var htmlMessage = ""
const message = url.searchParams.get("message")
if (message == "error") {
htmlMessage = `<b class="text-danger">Incorrect Password!</b>`
} else {
htmlMessage = `Login to Panel`
htmlMessage = `<div class="p-3 bg-danger text-white fw-bold text-center">Invalid password / کلمه عبور معتبر نمی‌باشد!</div>`
}

const htmlContent = `
<!DOCTYPE html>
<html>
<head>
<title>Login | Admin Panel</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf8" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.2.0/css/adminlte.min.css" integrity="sha512-IuO+tczf4J43RzbCMEFggCWW5JuX78IrCJRFFBoQEXNvGI6gkUw4OjuwMidiS4Lm9Q2lILzpJwZuMWuSEeT9UQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
</head>
<body class="hold-transition login-page">
<main class="login-box">
<div class="login-logo"> Control <b>Panel</b>
</div>
<div class="card">
<div class="card-body login-card-body">
<p class="login-box-msg">${htmlMessage}</p>
<form method="post">
<div class="input-group mb-3">
<input type="password" class="form-control" id="inputPassword2" placeholder="Password" name="password" minlength="6" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-8">
<div class="icheck-primary">
<input type="checkbox" id="remember">
<label for="remember"> Remember me? </label>
</div>
</div>
<div class="col-4">
<button type="submit" class="btn btn-primary btn-block">Sign In</button>
</div>
</div>
</form>
<body dir="ltr">
<div class="container border p-0">
<div class="p-3 bg-primary text-white">
<div class="text-nowrap fs-4 fw-bold text-center">V2RAY Worker - Control Panel</div>
<div class="text-nowrap fs-6 text-center">
Version 2.0 by
<a href="https://twitter.com/vahidfarid" target="_blank" class="text-white">Vahid Farid</a>
</div>
</div>
</main>
<script src="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/3.2.0/js/adminlte.min.js" integrity="sha512-KBeR1NhClUySj9xBB0+KRqYLPkM6VvXiiWaSz/8LCQNdRpUm38SWUrj0ccNDNSkwCD9qPA4KobLliG26yPppJA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
${htmlMessage}
<form class="mt-5 p-3 row g-3" method="post">
<div class="col-auto">
Enter password / کلمه‌ی عبور را وارد کنید:
</div>
<div class="col-auto">
<label for="inputPassword2" class="visually-hidden">Password</label>
<input type="password" class="form-control" id="inputPassword2" placeholder="Password" name="password" minlength="6" required>
</div>
<div class="col-auto">
<button type="submit" class="btn btn-primary mb-3">Confirm identity / تایید هویت</button>
</div>
</form>
</div>
</body>
</html>
`
Expand Down
Loading

0 comments on commit 97de301

Please sign in to comment.