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

7
.circleci/config.yml

@ -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:

0
activitypub/backend.py → api/activitypub/backend.py

0
activitypub/utils.py → api/activitypub/utils.py

0
activitypub/vars.py → api/activitypub/vars.py

2
app.py → api/app.py

@ -63,7 +63,7 @@ if os.path.isdir(gitpath):
@cached(spa_cache)
def get_spa_html():
with open(os.path.join(os.getcwd(), "front/dist/index.html")) as f:
with open(os.path.join(os.getcwd(), "../front/dist/index.html")) as f:
return f.read()

0
app_oauth.py → api/app_oauth.py

0
assets/logo/Logo.png → api/assets/logo/Logo.png

Before

Width: 128  |  Height: 84  |  Size: 5.8 KiB

After

Width: 128  |  Height: 84  |  Size: 5.8 KiB

0
assets/logo/Logo.svg → api/assets/logo/Logo.svg

0
assets/logo/Logo@0.5x.png → api/assets/logo/Logo@0.5x.png

Before

Width: 128  |  Height: 128  |  Size: 6.1 KiB

After

Width: 128  |  Height: 128  |  Size: 6.1 KiB

0
assets/logo/Logo@2x.png → api/assets/logo/Logo@2x.png

Before

Width: 256  |  Height: 168  |  Size: 13 KiB

After

Width: 256  |  Height: 168  |  Size: 13 KiB

0
assets/logo/Logo@3x.png → api/assets/logo/Logo@3x.png

Before

Width: 384  |  Height: 252  |  Size: 21 KiB

After

Width: 384  |  Height: 252  |  Size: 21 KiB

0
assets/logo/Round_userpic-L.png → api/assets/logo/Round_userpic-L.png

Before

Width: 1024  |  Height: 1024  |  Size: 63 KiB

After

Width: 1024  |  Height: 1024  |  Size: 63 KiB

0
assets/logo/Round_userpic.png → api/assets/logo/Round_userpic.png

Before

Width: 500  |  Height: 500  |  Size: 25 KiB

After

Width: 500  |  Height: 500  |  Size: 25 KiB

0
assets/logo/Square_userpic-L.png → api/assets/logo/Square_userpic-L.png

Before

Width: 1024  |  Height: 1024  |  Size: 68 KiB

After

Width: 1024  |  Height: 1024  |  Size: 68 KiB

0
assets/logo/Square_userpic.png → api/assets/logo/Square_userpic.png

Before

Width: 512  |  Height: 512  |  Size: 28 KiB

After

Width: 512  |  Height: 512  |  Size: 28 KiB

84
api/config.py

@ -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"

0
config.py.sample → api/config.py.sample

62
api/configtest.py

@ -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/"

0
controllers/__init__.py → api/controllers/__init__.py

0
controllers/admin.py → api/controllers/admin.py

0
controllers/api/__init__.py → api/controllers/api/__init__.py

0
controllers/api/account.py → api/controllers/api/account.py

0
controllers/api/albums.py → api/controllers/api/albums.py

0
controllers/api/pleroma_admin.py → api/controllers/api/pleroma_admin.py

0
controllers/api/reel2bits.py → api/controllers/api/reel2bits.py

0
controllers/api/tracks.py → api/controllers/api/tracks.py

0
controllers/api/v1/__init__.py → api/controllers/api/v1/__init__.py

0
controllers/api/v1/accounts.py → api/controllers/api/v1/accounts.py

0
controllers/api/v1/activitypub.py → api/controllers/api/v1/activitypub.py

0
controllers/api/v1/auth.py → api/controllers/api/v1/auth.py

0
controllers/api/v1/nodeinfo.py → api/controllers/api/v1/nodeinfo.py

0
controllers/api/v1/notifications.py → api/controllers/api/v1/notifications.py

0
controllers/api/v1/timelines.py → api/controllers/api/v1/timelines.py

0
controllers/api/v1/well_known.py → api/controllers/api/v1/well_known.py

0
controllers/feeds.py → api/controllers/feeds.py

0
controllers/main.py → api/controllers/main.py

0
controllers/users.py → api/controllers/users.py

0
datas_helpers.py → api/datas_helpers.py

0
dbseed.py → api/dbseed.py

0
flake_id.py → api/flake_id.py

0
forms.py → api/forms.py

0
migrations/README → api/migrations/README

0
migrations/alembic.ini → api/migrations/alembic.ini

0
migrations/env.py → api/migrations/env.py

0
migrations/script.py.mako → api/migrations/script.py.mako

0
migrations/versions/00_795db5a5e99b_.py → api/migrations/versions/00_795db5a5e99b_.py

0
migrations/versions/01_da3273ca0f0f_.py → api/migrations/versions/01_da3273ca0f0f_.py

0
migrations/versions/02_6b5a95742bb4_.py → api/migrations/versions/02_6b5a95742bb4_.py

0
migrations/versions/03_052e645c59f4_.py → api/migrations/versions/03_052e645c59f4_.py

0
migrations/versions/04_96774be568e1_.py → api/migrations/versions/04_96774be568e1_.py

0
migrations/versions/05_c517c68df56e_.py → api/migrations/versions/05_c517c68df56e_.py

0
migrations/versions/06_14ecb77e9482_.py → api/migrations/versions/06_14ecb77e9482_.py

0
migrations/versions/07_13ca6565de5b_.py → api/migrations/versions/07_13ca6565de5b_.py

0
migrations/versions/08_fc50eb4e9b34_.py → api/migrations/versions/08_fc50eb4e9b34_.py

0
migrations/versions/09_aeb6c1345690_.py → api/migrations/versions/09_aeb6c1345690_.py

0
migrations/versions/10_a901f35d5686_.py → api/migrations/versions/10_a901f35d5686_.py

0
migrations/versions/11_f41ac4617ef6_.py → api/migrations/versions/11_f41ac4617ef6_.py

0
migrations/versions/12_eb934854f591_.py → api/migrations/versions/12_eb934854f591_.py

0
migrations/versions/13_3a6904b2b365_.py → api/migrations/versions/13_3a6904b2b365_.py

0
migrations/versions/14_eac3d92deee5_.py → api/migrations/versions/14_eac3d92deee5_.py

0
migrations/versions/15_127a4386b617_.py → api/migrations/versions/15_127a4386b617_.py

0
migrations/versions/16_b7bb72b21644_.py → api/migrations/versions/16_b7bb72b21644_.py

0
migrations/versions/17_01e6d591fe6f_.py → api/migrations/versions/17_01e6d591fe6f_.py

0
migrations/versions/18_4e87ed4acba9_.py → api/migrations/versions/18_4e87ed4acba9_.py

0
migrations/versions/19_98b863ae920c_.py → api/migrations/versions/19_98b863ae920c_.py

0
migrations/versions/20_691eaff10a88_.py → api/migrations/versions/20_691eaff10a88_.py

0
migrations/versions/21_abf095d9c9f3_.py → api/migrations/versions/21_abf095d9c9f3_.py

0
migrations/versions/22_835be4f73770_.py → api/migrations/versions/22_835be4f73770_.py

0
migrations/versions/23_2ec399782f52_.py → api/migrations/versions/23_2ec399782f52_.py

0
migrations/versions/24_be5369fae219_.py → api/migrations/versions/24_be5369fae219_.py

0
migrations/versions/25_32f48de123f3_.py → api/migrations/versions/25_32f48de123f3_.py

0
migrations/versions/26_d3c41a9e2688_.py → api/migrations/versions/26_d3c41a9e2688_.py

0
migrations/versions/27_687d40646d63_.py → api/migrations/versions/27_687d40646d63_.py

0
migrations/versions/28_2e83f405e9a4_.py → api/migrations/versions/28_2e83f405e9a4_.py

0
migrations/versions/29_4291b06c81bd_.py → api/migrations/versions/29_4291b06c81bd_.py

0
migrations/versions/30_65d2800d0e96_.py → api/migrations/versions/30_65d2800d0e96_.py

0
migrations/versions/31_7ce00beb5b0a_.py → api/migrations/versions/31_7ce00beb5b0a_.py

0
migrations/versions/32_1a68efa16d1d_.py → api/migrations/versions/32_1a68efa16d1d_.py

0
migrations/versions/33_a34711408c8d_.py → api/migrations/versions/33_a34711408c8d_.py

0
migrations/versions/34_c1aa4c6b9acd_.py → api/migrations/versions/34_c1aa4c6b9acd_.py

0
migrations/versions/35_da6070b2ce4e_.py → api/migrations/versions/35_da6070b2ce4e_.py

0
migrations/versions/36_588930f4335e_.py → api/migrations/versions/36_588930f4335e_.py

0
migrations/versions/37_9569dcac2399_.py → api/migrations/versions/37_9569dcac2399_.py

0
migrations/versions/38_d3745d45e223_.py → api/migrations/versions/38_d3745d45e223_.py

0
migrations/versions/39_463da36c5bd5_.py → api/migrations/versions/39_463da36c5bd5_.py

0
migrations/versions/40_a8e2274a18d3_.py → api/migrations/versions/40_a8e2274a18d3_.py

0
migrations/versions/41_7eb56606e9d6_.py → api/migrations/versions/41_7eb56606e9d6_.py

0
migrations/versions/42_8b4238e4e1a3_.py → api/migrations/versions/42_8b4238e4e1a3_.py

0
migrations/versions/43_b34114160aa4_.py → api/migrations/versions/43_b34114160aa4_.py

0
migrations/versions/44_aed9b823850c_.py → api/migrations/versions/44_aed9b823850c_.py

0
migrations/versions/45_fc79fead3906_.py → api/migrations/versions/45_fc79fead3906_.py

0
migrations/versions/46_a3ada8658a05_.py → api/migrations/versions/46_a3ada8658a05_.py

0
migrations/versions/47_68a5afdc49bd_.py → api/migrations/versions/47_68a5afdc49bd_.py

0
migrations/versions/48_15c24b2e6402_.py → api/migrations/versions/48_15c24b2e6402_.py

0
models.py → api/models.py

0
pyproject.toml → api/pyproject.toml

0
requirements.txt → api/requirements.txt

0
setup.cfg → api/setup.cfg

0
setup.py → api/setup.py

0
static/css/DataTables-1.10.18/css/dataTables.bootstrap.css → api/static/css/DataTables-1.10.18/css/dataTables.bootstrap.css

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

Loading…
Cancel
Save