Go to file
2023-11-23 21:31:50 +04:00
.idea chore: Project files for IDEA 2023-02-06 11:50:16 +03:00
.vscode Migrate to FastAPI (#13) 2022-08-25 20:03:56 +03:00
nixos module: fix sp-nixos-rebuild systemd script 2023-11-23 21:31:50 +04:00
selfprivacy_api fix: Migration from secrets to token 2023-11-23 16:15:53 +03:00
tests refactor: Changes to reflect the new NixOS config structure 2023-11-21 23:14:42 +03:00
.coveragerc More unit tests and bugfixes (#7) 2022-01-10 22:35:00 +02:00
.drone.yml ci: Give redis some time to start? 2023-07-17 19:55:16 +03:00
.flake8 style: set 88 as a line length limit 2023-07-19 16:49:35 +03:00
.gitignore switch to flakes 2023-09-18 02:23:33 +04:00
.pylintrc style: set 88 as a line length limit 2023-07-19 16:49:35 +03:00
CONTRIBUTING.md docs: add CONTRIBUTING.md 2022-12-30 21:21:34 +03:00
default.nix package: buildPythonApplication => buildPythonPackage 2023-11-23 02:42:38 +04:00
flake.lock git rid of NixOS configuration dependency 2023-11-06 12:39:26 +04:00
flake.nix use git revision as Nix derivation version 2023-11-22 09:45:53 +04:00
LICENSE Add a license 2021-11-18 10:05:04 +02:00
nix-dependencies-diagram.puml add README.md 2023-09-18 19:08:36 +04:00
pyproject.toml Migrate to FastAPI (#13) 2022-08-25 20:03:56 +03:00
README.md readme: proxy query to generate plantuml diagram image 2023-09-18 19:08:36 +04:00
setup.py chore: bump version 2023-10-09 12:45:22 +03:00

SelfPrivacy GraphQL API which allows app to control your server

build

$ nix build

As a result, you should get the ./result symlink to a folder (in /nix/store) with build contents.

develop & test

$ nix develop
$ [SP devshell] pytest .
=================================== test session starts =====================================
platform linux -- Python 3.10.11, pytest-7.1.3, pluggy-1.0.0
rootdir: /data/selfprivacy/selfprivacy-rest-api
plugins: anyio-3.5.0, datadir-1.4.1, mock-3.8.2
collected 692 items

tests/test_block_device_utils.py .................                                    [  2%]
tests/test_common.py .....                                                            [  3%]
tests/test_jobs.py ........                                                           [  4%]
tests/test_model_storage.py ..                                                        [  4%]
tests/test_models.py ..                                                               [  4%]
tests/test_network_utils.py ......                                                    [  5%]
tests/test_services.py ......                                                         [  6%]
tests/test_graphql/test_api.py .                                                      [  6%]
tests/test_graphql/test_api_backup.py ...............                                 [  8%]
tests/test_graphql/test_api_devices.py .................                              [ 11%]
tests/test_graphql/test_api_recovery.py .........                                     [ 12%]
tests/test_graphql/test_api_version.py ..                                             [ 13%]
tests/test_graphql/test_backup.py ...............................                     [ 21%]
tests/test_graphql/test_localsecret.py ...                                            [ 22%]
tests/test_graphql/test_ssh.py ............                                           [ 23%]
tests/test_graphql/test_system.py .............................                       [ 28%]
tests/test_graphql/test_system_nixos_tasks.py ........                                [ 29%]
tests/test_graphql/test_users.py ..................................                   [ 42%]
tests/test_graphql/test_repository/test_json_tokens_repository.py                     [ 44%]
tests/test_graphql/test_repository/test_tokens_repository.py ....                     [ 53%]
tests/test_rest_endpoints/test_auth.py ..........................                     [ 58%]
tests/test_rest_endpoints/test_system.py ........................                     [ 63%]
tests/test_rest_endpoints/test_users.py ................................              [ 76%]
tests/test_rest_endpoints/services/test_bitwarden.py ............                     [ 78%]
tests/test_rest_endpoints/services/test_gitea.py ..............                       [ 80%]
tests/test_rest_endpoints/services/test_mailserver.py .....                           [ 81%]
tests/test_rest_endpoints/services/test_nextcloud.py ............                     [ 83%]
tests/test_rest_endpoints/services/test_ocserv.py ..............                      [ 85%]
tests/test_rest_endpoints/services/test_pleroma.py ..............                     [ 87%]
tests/test_rest_endpoints/services/test_services.py ....                              [ 88%]
tests/test_rest_endpoints/services/test_ssh.py .....................                  [100%]

============================== 692 passed in 352.76s (0:05:52) ===============================

dependencies and dependant modules

Current flake inherits nixpkgs from NixOS configuration flake. So there is no need to refer to extra nixpkgs dependency if you want to be aligned with exact NixOS configuration.

diagram

Nix code for NixOS service module for API is located in NixOS configuration repository.

current issues

  • It's not clear how to store in this repository information about several compatible NixOS configuration commits, where API application tests pass. Currently, here is only a single flake.lock.