mirror of https://github.com/EasyCTF/librectf
get some more dependencies into the derivation
This commit is contained in:
parent
ede6d28cf6
commit
d1e9e85540
|
@ -0,0 +1,2 @@
|
|||
/Cargo.nix
|
||||
/crate-hashes.json
|
|
@ -1,5 +1,5 @@
|
|||
[run]
|
||||
branch = True
|
||||
source = easyctf
|
||||
source = librectf
|
||||
|
||||
[report]
|
||||
|
|
|
@ -1,18 +1,33 @@
|
|||
{ buildPythonApplication, nix-gitignore, python39Packages }:
|
||||
{ buildPythonApplication, nix-gitignore, python39Packages, callPackage }:
|
||||
|
||||
let
|
||||
dontCheck = p: p.overrideAttrs (a: {
|
||||
setuptoolsCheckPhase = "true";
|
||||
doCheck = false;
|
||||
});
|
||||
extraPypi = callPackage ./extra-pypi.nix {};
|
||||
propagatedBuildInputs = with python39Packages; [
|
||||
flask
|
||||
flask-caching
|
||||
flask_login
|
||||
flask_wtf
|
||||
markdown2
|
||||
paramiko
|
||||
passlib
|
||||
pillow
|
||||
pycryptodome
|
||||
pyotp
|
||||
raven
|
||||
requests
|
||||
email_validator
|
||||
wtforms
|
||||
pyqrcode
|
||||
|
||||
# TODO: figure out why these fail tests
|
||||
(dontCheck flask_migrate)
|
||||
];
|
||||
] ++ (with extraPypi; [
|
||||
wtforms-components
|
||||
]);
|
||||
checkInputs = with python39Packages; [
|
||||
pytest
|
||||
webtest
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
{ buildPythonPackage, fetchPypi, fetchFromGitHub, python39Packages }:
|
||||
|
||||
rec {
|
||||
wtforms-components = buildPythonPackage rec {
|
||||
pname = "WTForms-Components";
|
||||
version = "0.10.5";
|
||||
propagatedBuildInputs = with python39Packages; [
|
||||
wtforms
|
||||
email_validator
|
||||
intervals
|
||||
validators
|
||||
];
|
||||
doCheck = false;
|
||||
src = fetchFromGitHub {
|
||||
owner = "kvesteri";
|
||||
repo = "wtforms-components";
|
||||
rev = "0.10.5";
|
||||
sha256 = "sha256-6Yu8dwuPQC+E1Irr8PdaeoR0kTOOSHV9rXXhDkTksgQ=";
|
||||
};
|
||||
};
|
||||
|
||||
intervals = buildPythonPackage rec {
|
||||
pname = "intervals";
|
||||
version = "0.9.2";
|
||||
propagatedBuildInputs = with python39Packages; [ infinity ];
|
||||
checkInputs = with python39Packages; [ pytest ];
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-x+5WjFg8qFfA2Rr22Q7l4Oit7z9WRtAHa/uHMFrkMJA=";
|
||||
};
|
||||
};
|
||||
|
||||
infinity = buildPythonPackage rec {
|
||||
pname = "infinity";
|
||||
version = "1.5";
|
||||
propagatedBuildInputs = with python39Packages; [ ];
|
||||
checkInputs = with python39Packages; [ pytest ];
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-jap8Fc4hAP3M/eISM34M1c8IWGn1TcJjS2ww1hRh7No=";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -9,13 +9,13 @@ import traceback
|
|||
from io import BytesIO, StringIO
|
||||
from string import Template
|
||||
|
||||
import onetimepass
|
||||
import paramiko
|
||||
import yaml
|
||||
from Crypto.PublicKey import RSA
|
||||
from flask import current_app as app
|
||||
from flask import url_for
|
||||
from flask_login import current_user
|
||||
from pyotp import TOTP
|
||||
from markdown2 import markdown
|
||||
from passlib.hash import bcrypt
|
||||
from sqlalchemy import and_, func, select
|
||||
|
@ -251,7 +251,9 @@ class User(db.Model):
|
|||
)
|
||||
|
||||
def verify_totp(self, token):
|
||||
return onetimepass.valid_totp(token, self.otp_secret)
|
||||
totp = TOTP(self.otp_secret)
|
||||
return totp.verify(token)
|
||||
# return onetimepass.valid_totp(token, self.otp_secret)
|
||||
|
||||
@cache.memoize(timeout=120)
|
||||
def points(self):
|
||||
|
|
|
@ -4,9 +4,9 @@ import tempfile
|
|||
import pytest
|
||||
from webtest import TestApp
|
||||
|
||||
from easyctf import create_app
|
||||
from easyctf.config import Config
|
||||
from easyctf.objects import db as _db
|
||||
from librectf import create_app
|
||||
from librectf.config import Config
|
||||
from librectf.objects import db as _db
|
||||
|
||||
|
||||
@pytest.yield_fixture(scope="function")
|
||||
|
|
Loading…
Reference in New Issue