Browse Source

Split backend in its own folder

pull/165/head
squeaky otter 2 years ago
parent
commit
5a8a32551a
Signed by: dashie GPG Key ID: C2D57B325840B755
307 changed files with 155 additions and 571 deletions
  1. +5
    -2
      .circleci/config.yml
  2. +0
    -0
      api/activitypub/backend.py
  3. +0
    -0
      api/activitypub/utils.py
  4. +0
    -0
      api/activitypub/vars.py
  5. +1
    -1
      api/app.py
  6. +0
    -0
      api/app_oauth.py
  7. +0
    -0
      api/assets/logo/Logo.png
  8. +0
    -0
      api/assets/logo/Logo.svg
  9. +0
    -0
      api/assets/logo/Logo@0.5x.png
  10. +0
    -0
      api/assets/logo/Logo@2x.png
  11. +0
    -0
      api/assets/logo/Logo@3x.png
  12. +0
    -0
      api/assets/logo/Round_userpic-L.png
  13. +0
    -0
      api/assets/logo/Round_userpic.png
  14. +0
    -0
      api/assets/logo/Square_userpic-L.png
  15. +0
    -0
      api/assets/logo/Square_userpic.png
  16. +84
    -0
      api/config.py
  17. +0
    -0
      api/config.py.sample
  18. +62
    -0
      api/configtest.py
  19. +0
    -0
      api/controllers/__init__.py
  20. +0
    -0
      api/controllers/admin.py
  21. +0
    -0
      api/controllers/api/__init__.py
  22. +0
    -0
      api/controllers/api/account.py
  23. +0
    -0
      api/controllers/api/albums.py
  24. +0
    -0
      api/controllers/api/pleroma_admin.py
  25. +0
    -0
      api/controllers/api/reel2bits.py
  26. +0
    -0
      api/controllers/api/tracks.py
  27. +0
    -0
      api/controllers/api/v1/__init__.py
  28. +0
    -0
      api/controllers/api/v1/accounts.py
  29. +0
    -0
      api/controllers/api/v1/activitypub.py
  30. +0
    -0
      api/controllers/api/v1/auth.py
  31. +0
    -0
      api/controllers/api/v1/nodeinfo.py
  32. +0
    -0
      api/controllers/api/v1/notifications.py
  33. +0
    -0
      api/controllers/api/v1/timelines.py
  34. +0
    -0
      api/controllers/api/v1/well_known.py
  35. +0
    -0
      api/controllers/feeds.py
  36. +0
    -0
      api/controllers/main.py
  37. +0
    -0
      api/controllers/users.py
  38. +0
    -0
      api/datas_helpers.py
  39. +0
    -0
      api/dbseed.py
  40. +0
    -0
      api/flake_id.py
  41. +0
    -0
      api/forms.py
  42. +0
    -0
      api/migrations/README
  43. +0
    -0
      api/migrations/alembic.ini
  44. +0
    -0
      api/migrations/env.py
  45. +0
    -0
      api/migrations/script.py.mako
  46. +0
    -0
      api/migrations/versions/00_795db5a5e99b_.py
  47. +0
    -0
      api/migrations/versions/01_da3273ca0f0f_.py
  48. +0
    -0
      api/migrations/versions/02_6b5a95742bb4_.py
  49. +0
    -0
      api/migrations/versions/03_052e645c59f4_.py
  50. +0
    -0
      api/migrations/versions/04_96774be568e1_.py
  51. +0
    -0
      api/migrations/versions/05_c517c68df56e_.py
  52. +0
    -0
      api/migrations/versions/06_14ecb77e9482_.py
  53. +0
    -0
      api/migrations/versions/07_13ca6565de5b_.py
  54. +0
    -0
      api/migrations/versions/08_fc50eb4e9b34_.py
  55. +0
    -0
      api/migrations/versions/09_aeb6c1345690_.py
  56. +0
    -0
      api/migrations/versions/10_a901f35d5686_.py
  57. +0
    -0
      api/migrations/versions/11_f41ac4617ef6_.py
  58. +0
    -0
      api/migrations/versions/12_eb934854f591_.py
  59. +0
    -0
      api/migrations/versions/13_3a6904b2b365_.py
  60. +0
    -0
      api/migrations/versions/14_eac3d92deee5_.py
  61. +0
    -0
      api/migrations/versions/15_127a4386b617_.py
  62. +0
    -0
      api/migrations/versions/16_b7bb72b21644_.py
  63. +0
    -0
      api/migrations/versions/17_01e6d591fe6f_.py
  64. +0
    -0
      api/migrations/versions/18_4e87ed4acba9_.py
  65. +0
    -0
      api/migrations/versions/19_98b863ae920c_.py
  66. +0
    -0
      api/migrations/versions/20_691eaff10a88_.py
  67. +0
    -0
      api/migrations/versions/21_abf095d9c9f3_.py
  68. +0
    -0
      api/migrations/versions/22_835be4f73770_.py
  69. +0
    -0
      api/migrations/versions/23_2ec399782f52_.py
  70. +0
    -0
      api/migrations/versions/24_be5369fae219_.py
  71. +0
    -0
      api/migrations/versions/25_32f48de123f3_.py
  72. +0
    -0
      api/migrations/versions/26_d3c41a9e2688_.py
  73. +0
    -0
      api/migrations/versions/27_687d40646d63_.py
  74. +0
    -0
      api/migrations/versions/28_2e83f405e9a4_.py
  75. +0
    -0
      api/migrations/versions/29_4291b06c81bd_.py
  76. +0
    -0
      api/migrations/versions/30_65d2800d0e96_.py
  77. +0
    -0
      api/migrations/versions/31_7ce00beb5b0a_.py
  78. +0
    -0
      api/migrations/versions/32_1a68efa16d1d_.py
  79. +0
    -0
      api/migrations/versions/33_a34711408c8d_.py
  80. +0
    -0
      api/migrations/versions/34_c1aa4c6b9acd_.py
  81. +0
    -0
      api/migrations/versions/35_da6070b2ce4e_.py
  82. +0
    -0
      api/migrations/versions/36_588930f4335e_.py
  83. +0
    -0
      api/migrations/versions/37_9569dcac2399_.py
  84. +0
    -0
      api/migrations/versions/38_d3745d45e223_.py
  85. +0
    -0
      api/migrations/versions/39_463da36c5bd5_.py
  86. +0
    -0
      api/migrations/versions/40_a8e2274a18d3_.py
  87. +0
    -0
      api/migrations/versions/41_7eb56606e9d6_.py
  88. +0
    -0
      api/migrations/versions/42_8b4238e4e1a3_.py
  89. +0
    -0
      api/migrations/versions/43_b34114160aa4_.py
  90. +0
    -0
      api/migrations/versions/44_aed9b823850c_.py
  91. +0
    -0
      api/migrations/versions/45_fc79fead3906_.py
  92. +0
    -0
      api/migrations/versions/46_a3ada8658a05_.py
  93. +0
    -0
      api/migrations/versions/47_68a5afdc49bd_.py
  94. +0
    -0
      api/migrations/versions/48_15c24b2e6402_.py
  95. +0
    -0
      api/models.py
  96. +0
    -0
      api/pyproject.toml
  97. +0
    -0
      api/requirements.txt
  98. +0
    -0
      api/setup.cfg
  99. +0
    -0
      api/setup.py
  100. +0
    -0
      api/static/css/DataTables-1.10.18/css/dataTables.bootstrap.css

+ 5
- 2
.circleci/config.yml View File

@ -85,12 +85,14 @@ aliases:
name: Linters
command: |
. venv/bin/activate
cd api
black --check .
flake8 . --count --show-source --statistics
- run:
name: Tests
command: |
. venv/bin/activate
cd api
cp tests/config_test.py config.py
mkdir test-reports
export AUTHLIB_INSECURE_TRANSPORT=1
@ -101,12 +103,13 @@ aliases:
psql -U postgres -h localhost -w -c 'CREATE DATABASE reel2bits'
psql -U postgres -h localhost -w -c 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";' reel2bits
. venv/bin/activate
cd api
cp config.py.sample config.py
flask db upgrade
- store_test_results:
path: test-reports
path: api/test-reports
- store_artifacts:
path: test-reports
path: api/test-reports
- &lint_steps_front
steps:


activitypub/backend.py → api/activitypub/backend.py View File


activitypub/utils.py → api/activitypub/utils.py View File


activitypub/vars.py → api/activitypub/vars.py View File


app.py → api/app.py View File


app_oauth.py → api/app_oauth.py View File


assets/logo/Logo.png → api/assets/logo/Logo.png View File


assets/logo/Logo.svg → api/assets/logo/Logo.svg View File


assets/logo/Logo@0.5x.png → api/assets/logo/Logo@0.5x.png View File


assets/logo/Logo@2x.png → api/assets/logo/Logo@2x.png View File


assets/logo/Logo@3x.png → api/assets/logo/Logo@3x.png View File


assets/logo/Round_userpic-L.png → api/assets/logo/Round_userpic-L.png View File


assets/logo/Round_userpic.png → api/assets/logo/Round_userpic.png View File


assets/logo/Square_userpic-L.png → api/assets/logo/Square_userpic-L.png View File


assets/logo/Square_userpic.png → api/assets/logo/Square_userpic.png View File


+ 84
- 0
api/config.py View File

@ -0,0 +1,84 @@
DEBUG = True
TESTING = False
TEMPLATES_AUTO_RELOAD = DEBUG
WTF_CSRF_ENABLED = False
REGISTRATION_ENABLED = True
SECRET_KEY = "38rufm3q8uft38gjqh-g31g3j0"
SQLALCHEMY_DATABASE_URI = "postgresql+psycopg2://dashie@localhost/reel2bits"
# SQLALCHEMY_DATABASE_URI = 'sqlite:///ahrl.db'
# SQLALCHEMY_DATABASE_URI = 'mysql://dashie:saucisse@localhost/ahrl'
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_RECORD_QUERIES = True
SECURITY_CONFIRMABLE = False
SECURITY_REGISTERABLE = True # deactivate registration
SECURITY_RECOVERABLE = True
SECURITY_TRACKABLE = False
SECURITY_CHANGEABLE = True
SECURITY_PASSWORD_HASH = "bcrypt"
SECURITY_PASSWORD_SALT = "omgponies"
# SECURITY_URL_PREFIX = '/sec'
SECURITY_SEND_REGISTER_EMAIL = False
SECURITY_SEND_PASSWORD_CHANGE_EMAIL = False
SECURITY_SEND_PASSWORD_RESET_NOTICE_EMAIL = False
BOOTSTRAP_USE_MINIFIED = True
BOOTSTRAP_SERVE_LOCAL = True
BOOTSTRAP_CDN_FORCE_SSL = True
BOOTSTRAP_QUERYSTRING_REVVING = True
DEBUG_TB_PROFILER_ENABLED = True
DEBUG_TB_INTERCEPT_REDIRECTS = False
BABEL_DEFAULT_LOCALE = "en"
BABEL_DEFAULT_TIMEZONE = "UTC"
UPLOADED_SOUNDS_DEST = "/Users/dashie/dev/reel2bits/uploads/sounds"
UPLOADS_DEFAULT_DEST = "/Users/dashie/dev/reel2bits/uploads"
TEMP_DOWNLOAD_FOLDER = "/Users/dashie/dev/reel2bits/tmp"
AUDIOWAVEFORM_BIN = "/usr/local/bin/audiowaveform"
# Sentry
SENTRY_DSN = "" # "https://a0c5bc0d11f74b58b8dfba79b44234e9@sentry.sigpipe.me/12"
# Redis configuration for broker, used for async background tasks
CELERY_BROKER_URL = "redis://127.0.0.1:6379/0"
CELERY_RESULT_BACKEND = "redis://127.0.0.1:6379/0"
# They needs to be identical
# You can't change them after setup !
AP_DOMAIN = "reel2bits.dev.lan.sigpipe.me"
SERVER_NAME = AP_DOMAIN
BASE_URL = "https://" + AP_DOMAIN
AP_ENABLED = True
SOURCES_REPOSITORY_URL = "https://github.com/rhaamo/reel2bits/"
# Mail setup
MAIL_SERVER = "192.168.10.10"
MAIL_PORT = 25
MAIL_USE_TLS = False
MAIL_USE_SSL = False
MAIL_USERNAME = None
MAIL_PASSWORD = None
MAIL_DEFAULT_SENDER = f"postmaster@{AP_DOMAIN}"
SWAGGER_UI_DOC_EXPANSION = "list"
# OAUTH2
# OAUTH2_TOKEN_EXPIRES_IN = {
# 'authorization_code': 864000,
# 'implicit': 3600,
# 'password': 864000,
# 'client_credentials': 864000
# }
# OAUTH2_REFRESH_TOKEN_GENERATOR = True
SECURITY_POST_LOGIN_VIEW = "/home"
SECURITY_POST_LOGOUT_VIEW = "/home"

config.py.sample → api/config.py.sample View File


+ 62
- 0
api/configtest.py View File

@ -0,0 +1,62 @@
DEBUG = True
TESTING = True
# Disable CSRF tokens in the Forms (only valid for testing purposes!)
WTF_CSRF_ENABLED = False
REGISTRATION_ENABLED = True
SECRET_KEY = "udf298euf02uf2f02f2uf0"
SQLALCHEMY_DATABASE_URI = "postgresql+psycopg2://dashie@localhost:5432/reel2bits_test"
# SQLALCHEMY_DATABASE_URI = 'sqlite:///ahrl.db'
# SQLALCHEMY_DATABASE_URI = 'mysql://dashie:saucisse@localhost/ahrl'
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_RECORD_QUERIES = True
SECURITY_CONFIRMABLE = False
SECURITY_REGISTERABLE = True
SECURITY_RECOVERABLE = True
SECURITY_TRACKABLE = False
SECURITY_CHANGEABLE = True
SECURITY_PASSWORD_HASH = "bcrypt"
SECURITY_PASSWORD_SALT = "dsadsaasd"
# SECURITY_URL_PREFIX = '/sec'
SECURITY_SEND_REGISTER_EMAIL = False
SECURITY_SEND_PASSWORD_CHANGE_EMAIL = False
SECURITY_SEND_PASSWORD_RESET_NOTICE_EMAIL = False
BOOTSTRAP_USE_MINIFIED = True
BOOTSTRAP_SERVE_LOCAL = True
BOOTSTRAP_CDN_FORCE_SSL = True
BOOTSTRAP_QUERYSTRING_REVVING = True
DEBUG_TB_PROFILER_ENABLED = False
DEBUG_TB_INTERCEPT_REDIRECTS = False
DEBUG_TB_ENABLED = False
BABEL_DEFAULT_LOCALE = "en"
BABEL_DEFAULT_TIMEZONE = "UTC"
UPLOADED_SOUNDS_DEST = "/home/dashie/dev/reel2bits/uploads/sounds"
UPLOADS_DEFAULT_DEST = "/home/dashie/dev/reel2bits/uploads"
TEMP_DOWNLOAD_FOLDER = "/home/dashie/dev/reel2bits/tmp"
AUDIOWAVEFORM_BIN = "/usr/local/bin/audiowaveform"
# Sentry
SENTRY_DSN = ""
# Bcrypt algorithm hashing rounds (reduced for testing purposes only!)
BCRYPT_LOG_ROUNDS = 4
AP_DOMAIN = "localhost.localdomain"
SERVER_NAME = AP_DOMAIN
BASE_URL = "https://" + AP_DOMAIN
AP_ENABLED = True
SECURITY_POST_LOGIN_VIEW = "/home"
SECURITY_POST_LOGOUT_VIEW = "/home"
SOURCES_REPOSITORY_URL = "https://github.com/rhaamo/reel2bits/"

controllers/__init__.py → api/controllers/__init__.py View File


controllers/admin.py → api/controllers/admin.py View File


controllers/api/__init__.py → api/controllers/api/__init__.py View File


controllers/api/account.py → api/controllers/api/account.py View File


controllers/api/albums.py → api/controllers/api/albums.py View File


controllers/api/pleroma_admin.py → api/controllers/api/pleroma_admin.py View File


controllers/api/reel2bits.py → api/controllers/api/reel2bits.py View File


controllers/api/tracks.py → api/controllers/api/tracks.py View File


controllers/api/v1/__init__.py → api/controllers/api/v1/__init__.py View File


controllers/api/v1/accounts.py → api/controllers/api/v1/accounts.py View File


controllers/api/v1/activitypub.py → api/controllers/api/v1/activitypub.py View File


controllers/api/v1/auth.py → api/controllers/api/v1/auth.py View File


controllers/api/v1/nodeinfo.py → api/controllers/api/v1/nodeinfo.py View File


controllers/api/v1/notifications.py → api/controllers/api/v1/notifications.py View File


controllers/api/v1/timelines.py → api/controllers/api/v1/timelines.py View File


controllers/api/v1/well_known.py → api/controllers/api/v1/well_known.py View File


controllers/feeds.py → api/controllers/feeds.py View File


controllers/main.py → api/controllers/main.py View File


controllers/users.py → api/controllers/users.py View File


datas_helpers.py → api/datas_helpers.py View File


dbseed.py → api/dbseed.py View File


flake_id.py → api/flake_id.py View File


forms.py → api/forms.py View File


migrations/README → api/migrations/README View File


migrations/alembic.ini → api/migrations/alembic.ini View File


migrations/env.py → api/migrations/env.py View File


migrations/script.py.mako → api/migrations/script.py.mako View File


migrations/versions/00_795db5a5e99b_.py → api/migrations/versions/00_795db5a5e99b_.py View File


migrations/versions/01_da3273ca0f0f_.py → api/migrations/versions/01_da3273ca0f0f_.py View File


migrations/versions/02_6b5a95742bb4_.py → api/migrations/versions/02_6b5a95742bb4_.py View File


migrations/versions/03_052e645c59f4_.py → api/migrations/versions/03_052e645c59f4_.py View File


migrations/versions/04_96774be568e1_.py → api/migrations/versions/04_96774be568e1_.py View File


migrations/versions/05_c517c68df56e_.py → api/migrations/versions/05_c517c68df56e_.py View File


migrations/versions/06_14ecb77e9482_.py → api/migrations/versions/06_14ecb77e9482_.py View File


migrations/versions/07_13ca6565de5b_.py → api/migrations/versions/07_13ca6565de5b_.py View File


migrations/versions/08_fc50eb4e9b34_.py → api/migrations/versions/08_fc50eb4e9b34_.py View File


migrations/versions/09_aeb6c1345690_.py → api/migrations/versions/09_aeb6c1345690_.py View File


migrations/versions/10_a901f35d5686_.py → api/migrations/versions/10_a901f35d5686_.py View File


migrations/versions/11_f41ac4617ef6_.py → api/migrations/versions/11_f41ac4617ef6_.py View File


migrations/versions/12_eb934854f591_.py → api/migrations/versions/12_eb934854f591_.py View File


migrations/versions/13_3a6904b2b365_.py → api/migrations/versions/13_3a6904b2b365_.py View File


migrations/versions/14_eac3d92deee5_.py → api/migrations/versions/14_eac3d92deee5_.py View File


migrations/versions/15_127a4386b617_.py → api/migrations/versions/15_127a4386b617_.py View File


migrations/versions/16_b7bb72b21644_.py → api/migrations/versions/16_b7bb72b21644_.py View File


migrations/versions/17_01e6d591fe6f_.py → api/migrations/versions/17_01e6d591fe6f_.py View File


migrations/versions/18_4e87ed4acba9_.py → api/migrations/versions/18_4e87ed4acba9_.py View File


migrations/versions/19_98b863ae920c_.py → api/migrations/versions/19_98b863ae920c_.py View File


migrations/versions/20_691eaff10a88_.py → api/migrations/versions/20_691eaff10a88_.py View File


migrations/versions/21_abf095d9c9f3_.py → api/migrations/versions/21_abf095d9c9f3_.py View File


migrations/versions/22_835be4f73770_.py → api/migrations/versions/22_835be4f73770_.py View File


migrations/versions/23_2ec399782f52_.py → api/migrations/versions/23_2ec399782f52_.py View File


migrations/versions/24_be5369fae219_.py → api/migrations/versions/24_be5369fae219_.py View File


migrations/versions/25_32f48de123f3_.py → api/migrations/versions/25_32f48de123f3_.py View File


migrations/versions/26_d3c41a9e2688_.py → api/migrations/versions/26_d3c41a9e2688_.py View File


migrations/versions/27_687d40646d63_.py → api/migrations/versions/27_687d40646d63_.py View File


migrations/versions/28_2e83f405e9a4_.py → api/migrations/versions/28_2e83f405e9a4_.py View File


migrations/versions/29_4291b06c81bd_.py → api/migrations/versions/29_4291b06c81bd_.py View File


migrations/versions/30_65d2800d0e96_.py → api/migrations/versions/30_65d2800d0e96_.py View File


migrations/versions/31_7ce00beb5b0a_.py → api/migrations/versions/31_7ce00beb5b0a_.py View File


migrations/versions/32_1a68efa16d1d_.py → api/migrations/versions/32_1a68efa16d1d_.py View File


migrations/versions/33_a34711408c8d_.py → api/migrations/versions/33_a34711408c8d_.py View File


migrations/versions/34_c1aa4c6b9acd_.py → api/migrations/versions/34_c1aa4c6b9acd_.py View File


migrations/versions/35_da6070b2ce4e_.py → api/migrations/versions/35_da6070b2ce4e_.py View File


migrations/versions/36_588930f4335e_.py → api/migrations/versions/36_588930f4335e_.py View File


migrations/versions/37_9569dcac2399_.py → api/migrations/versions/37_9569dcac2399_.py View File


migrations/versions/38_d3745d45e223_.py → api/migrations/versions/38_d3745d45e223_.py View File


migrations/versions/39_463da36c5bd5_.py → api/migrations/versions/39_463da36c5bd5_.py View File


migrations/versions/40_a8e2274a18d3_.py → api/migrations/versions/40_a8e2274a18d3_.py View File


migrations/versions/41_7eb56606e9d6_.py → api/migrations/versions/41_7eb56606e9d6_.py View File


migrations/versions/42_8b4238e4e1a3_.py → api/migrations/versions/42_8b4238e4e1a3_.py View File


migrations/versions/43_b34114160aa4_.py → api/migrations/versions/43_b34114160aa4_.py View File


migrations/versions/44_aed9b823850c_.py → api/migrations/versions/44_aed9b823850c_.py View File


migrations/versions/45_fc79fead3906_.py → api/migrations/versions/45_fc79fead3906_.py View File


migrations/versions/46_a3ada8658a05_.py → api/migrations/versions/46_a3ada8658a05_.py View File


migrations/versions/47_68a5afdc49bd_.py → api/migrations/versions/47_68a5afdc49bd_.py View File


migrations/versions/48_15c24b2e6402_.py → api/migrations/versions/48_15c24b2e6402_.py View File


models.py → api/models.py View File


pyproject.toml → api/pyproject.toml View File


requirements.txt → api/requirements.txt View File


setup.cfg → api/setup.cfg View File


setup.py → api/setup.py View File


static/css/DataTables-1.10.18/css/dataTables.bootstrap.css → api/static/css/DataTables-1.10.18/css/dataTables.bootstrap.css View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save