Giter Site home page Giter Site logo

luip-marzban's Introduction

luip-marzban's People

Contributors

mmdzov avatar sm1ky avatar

Stargazers

 avatar Иг avatar Innokenty avatar  avatar Mohammad avatar  avatar  avatar  avatar  avatar  avatar asphyxiamywife avatar  avatar Nikita Korotaev avatar

Watchers

 avatar

luip-marzban's Issues

MySQL

Hi, I read docs and looks like this project is for sqlite database. any chance of supporting mysql in near future?

[Solved] API connection error

In luIP-marzban:
TypeError: Cannot read properties of undefined (reading 'access_token')
at Api.token (/opt/luIP-marzban/config.js:172:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async WebSocket.retryGetToken (/opt/luIP-marzban/config.js:50:21)
In Marzban:
"WebSocket /api/node/1/logs?interval=30&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhbnRpY2Vuem9yIiwiYWNjZXNzIjoic3VkbyIsImlhdCI6MTcwNjk3NjA1MSwiZXhwIjoxNzA3MDYyNDUxfQ.Kb-KjC5aBS3oAnh5MssHqKp37jPtmQx5mdmTwUPY_ZI" 403

[FIX] Функция deleteInactiveUsers работает некорректно

Когда, в таблице users, в колонке ips накапливается более 1 подключения
Например:

test|[{"ip":"1.1.1.1","port":"1972","date":"2024-01-15T19:52:42.381Z"},{"ip":"2.2.2.2","port":"57347","date":"2024-01-15T19:51:56.116Z"},{"ip":"3.3.3.3","port":"2195","date":"2024-01-15T19:52:43.364Z"}]

Функция удаления неактивных подключений не удаляет неактивные ip адреса.

А именно: фильтрация sql запросом

SELECT * FROM users WHERE json_extract(ips, '$[0].date') <= ?

не возвращает строки, в которых неактивный ip находится на 2 или 3 месте в массиве json

Предлагаю модифицированный запрос, который будет находить неактивные ip (элементы массива в json). Далее функция удалит этот элемент и тем самым освободит "слот" под новое подключение

SELECT email, ips FROM users WHERE EXISTS (SELECT 1 FROM json_each(users.ips) AS ip_entry WHERE json_extract(ip_entry.value, '$.date') <= ?)

Хотел сделать это пулл реквестом, но не смог запушить ветку :))

Work without root user

Hello. Is there any way to run the application not under root user? Unfortunately, sudo nvm does not work by default and is not recommended.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.