Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
Carl Schwan 2022-01-05 14:18:42 +01:00
Родитель ec44de7687
Коммит c68907b252
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 06B35D38387B67BE
13 изменённых файлов: 32 добавлений и 61 удалений

4
.github/workflows/yarn.yml поставляемый
Просмотреть файл

@ -11,7 +11,7 @@ env:
jobs:
test:
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
strategy:
matrix:
@ -41,6 +41,8 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pip install poetry==1.1.12
- uses: browser-actions/setup-firefox@latest
with:
firefox-version: latest

Просмотреть файл

@ -41,10 +41,7 @@ dev-setup:
rm -f db.sqlite3
$(yarn) install
$(yarn) run build
poetry install
ifeq ($(db), postgres)
$(pip) install -r $(CURDIR)/requirements/production.txt
endif
$(poetry) install
cp $(CURDIR)/scripts/development/settings/base.py $(CURDIR)/nextcloudappstore/settings/development.py
cat $(CURDIR)/scripts/development/settings/$(db).py >> $(CURDIR)/nextcloudappstore/settings/development.py
$(MAKE) initdb

Просмотреть файл

@ -35,6 +35,12 @@ Clone the repository using git and change into it::
git clone https://github.com/nextcloud/appstore.git
cd appstore
Install poetry
--------------
Install poetry to handle python dependencies::
pip install poetry==1.1.12
App Store Setup
---------------
The project root contains a **Makefile** which allows you to quickly set everything up by running::
@ -47,7 +53,7 @@ Launching the Development Server
--------------------------------
The server can be started after activating the virtual environment first::
source venv/bin/activate
poetry shell
export DJANGO_SETTINGS_MODULE=nextcloudappstore.settings.development
python manage.py runserver
@ -55,12 +61,12 @@ The website is available at `http://127.0.0.1:8000 <http://127.0.0.1:8000>`_. Co
Every time you start a new terminal session you will need to reactive the virtual environment and set the development settings::
source venv/bin/activate
poetry shell
export DJANGO_SETTINGS_MODULE=nextcloudappstore.settings.development
We therefore recommend creating a small bash alias in your **~/.bashrc**::
alias cda='cd path/to/appstore && source venv/bin/activate && export DJANGO_SETTINGS_MODULE=nextcloudappstore.settings.development'
alias cda='cd path/to/appstore && poetry shell && export DJANGO_SETTINGS_MODULE=nextcloudappstore.settings.development'
Keeping Up to Date
------------------

Просмотреть файл

@ -12,8 +12,7 @@ def escape_tpl_string(string):
class Command(BaseCommand):
translation_file = ('nextcloudappstore/core/templates/translation/'
'db_translations.txt')
translation_file = ('core/templates/translation/' 'db_translations.txt')
help = (
'Goes through all translated database models (hardcoded) and creates '
'translations in %s' % translation_file)

Просмотреть файл

@ -34,12 +34,10 @@ class UploadAppReleaseTest(BaseStoreTest, AppDevSteps):
self.assertEqual(NEWS_ARCHIVE_URL, a.get_attribute('href'))
def upload_app(el):
with self.settings(VALIDATE_CERTIFICATES=True):
self._upload_app(NEWS_ARCHIVE_URL, NEWS_ARCHIVE_SIGNATURE)
self.wait_for('.global-success-msg', check_app_version_page)
self._upload_app(NEWS_ARCHIVE_URL, NEWS_ARCHIVE_SIGNATURE)
self.wait_for('.global-success-msg', check_app_version_page)
# this signature is secret so ignore cert checks here
with self.settings(VALIDATE_CERTIFICATES=False):
with self.settings(VALIDATE_CERTIFICATES=True):
self.register_app(NEWS_CERT, 'test')
# and run them for uploading the app archive
@ -49,4 +47,4 @@ class UploadAppReleaseTest(BaseStoreTest, AppDevSteps):
self.go_to_app_upload()
self.by_id('id_download').send_keys(url)
self.by_id('id_signature').send_keys(sig)
self.by_id('id_signature').submit()
self.by_id('submit').click()

Просмотреть файл

@ -7,16 +7,13 @@ from django.test import tag
@tag('e2e')
class UserRegisterTest(BaseStoreTest):
def setUp(self):
super().setUp()
os.environ['RECAPTCHA_DISABLE'] = 'True'
def test_register(self):
self.go_to('account_signup')
self.by_id('id_first_name').send_keys('john')
self.by_id('id_last_name').send_keys('doe')
self.by_id('id_username').send_keys('johndoe')
self.by_id('id_email').send_keys('john@doe.com')
self.by_id('id_captcha_1').send_keys('PASSED')
self.by_id('id_password1').send_keys('oalx77rkdf')
self.by_id('id_password2').send_keys('oalx77rkdf')
@ -35,7 +32,3 @@ class UserRegisterTest(BaseStoreTest):
self.by_id('id_password').send_keys('oalx77rkdf')
self.by_css('.auth-form button[type="submit"]').click()
self.assertOnPage('home')
def tearDown(self):
super().tearDown()
del os.environ['RECAPTCHA_DISABLE']

Просмотреть файл

@ -242,7 +242,7 @@ LOGGING = {
},
}
LOCALE_PATHS = (
BASE_DIR / 'locale/',
BASE_DIR.parent / 'locale/',
)
# Disable in order for cooldown periods to work properly
@ -272,10 +272,8 @@ ARCHIVE_FOLDER_BLACKLIST = {
}
# certificate location configuration
NEXTCLOUD_CERTIFICATE_LOCATION = BASE_DIR / \
'nextcloudappstore/certificate/nextcloud.crt'
NEXTCLOUD_CRL_LOCATION = BASE_DIR / \
'nextcloudappstore/certificate/nextcloud.crl'
NEXTCLOUD_CERTIFICATE_LOCATION = BASE_DIR / 'certificate/nextcloud.crt'
NEXTCLOUD_CRL_LOCATION = BASE_DIR / 'certificate/nextcloud.crl'
# whitelist for serializing markdown
MARKDOWN_ALLOWED_TAGS = [
@ -313,3 +311,5 @@ GITHUB_API_TOKEN = None
# Nextcloud Email
NEXTCLOUD_FROM_EMAIL = 'appstore@nextcloud.com'
NEXTCLOUD_INTEGRATIONS_APPROVAL_EMAILS = ['marketing-team@nextcloud.com']
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

4
poetry.lock сгенерированный
Просмотреть файл

@ -933,8 +933,8 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes
[metadata]
lock-version = "1.1"
python-versions = "3.6"
content-hash = "05a1a51adc9094bcc5e2b6a201a4defa83f59080b0d6e6e1427945852e5f92f5"
python-versions = "^3.6"
content-hash = "8026c80d4a1aedc95b27c88427b556dd155555b3df468b46d674efa19d626201"
[metadata.files]
asgiref = [

Просмотреть файл

@ -5,7 +5,7 @@ description = "App store for Nextcloud apps"
authors = ["Morris Jobke <hey@morrisjobke.de>"]
[tool.poetry.dependencies]
python = "3.6"
python = "^3.6"
Django = "3.2"
django-braces = "~1.13"
djangorestframework-camel-case = "^1.3.0"

Просмотреть файл

@ -1,18 +0,0 @@
Django==3.0.13
djangorestframework==3.12.4
semantic-version==2.8.5
djangorestframework-camel-case==1.2.0
django-parler==2.2
django-parler-rest==2.1
django-allauth==0.44.0
django-recaptcha2==1.4.1
lxml==4.6.3
pytz==2021.1
requests==2.25.1
pymple==0.1.3
django-csp==3.7
django-cors-middleware==1.5.0
pyOpenSSL==20.0.1
pem==21.2.0
Markdown==3.2.1
bleach==3.3.0

Просмотреть файл

@ -1,7 +0,0 @@
pycodestyle
mypy
bandit
django-debug-toolbar
coverage
selenium
coveralls

Просмотреть файл

@ -1,3 +0,0 @@
uWSGI==2.0.19.1
newrelic==5.24.0.153
psycopg2==2.8.6

Просмотреть файл

@ -14,7 +14,7 @@ INTERNAL_IPS = ('127.0.0.1',)
VALIDATE_CERTIFICATES = False
FIXTURE_DIRS = (
BASE_DIR / 'nextcloudappstore/core/tests/e2e/fixtures',
BASE_DIR / 'core/tests/e2e/fixtures',
)
LOGGING['handlers']['console'] = {
@ -40,3 +40,7 @@ if 'test' in sys.argv:
EMAIL_HOST = 'localhost'
EMAIL_HOST_USER = "noreply@nextcloud.com"
# Disable testing in tests
TESTING = bool(len(sys.argv) > 1 and sys.argv[1] == 'test')
CAPTCHA_TEST_MODE = TESTING