Merge pull request #387 from eventcally/issues/386

Rename .de to .com #386
This commit is contained in:
Daniel Grams 2023-03-22 22:19:59 +01:00 committed by GitHub
commit a78932d81c
8 changed files with 35 additions and 34 deletions

View File

@ -87,7 +87,8 @@ jobs:
run: coverage combine coverage*/.coverage* run: coverage combine coverage*/.coverage*
- name: Codecov - name: Codecov
uses: codecov/codecov-action@v1 uses: codecov/codecov-action@v3
with: with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true verbose: true
fail_ci_if_error: true fail_ci_if_error: true

View File

@ -1,6 +1,6 @@
# Open Event Database # Open Event Database
![Tests](https://github.com/eventcally/eventcally/workflows/Tests/badge.svg) [![codecov](https://codecov.io/gh/eventcally/eventcally/branch/main/graph/badge.svg?token=66CLLWWV7Y)](https://codecov.io/gh/eventcally/eventcally) [![Cypress](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/simple/32g194/main&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/32g194/runs) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) ![Docker Pulls](https://img.shields.io/docker/pulls/eventcally/eventcally) ![Tests](https://github.com/eventcally/eventcally/workflows/Tests/badge.svg) [![codecov](https://codecov.io/gh/eventcally/eventcally/branch/main/graph/badge.svg?token=66CLLWWV7Y)](https://codecov.io/gh/eventcally/eventcally) [![Cypress](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/simple/32g194/main&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/32g194/runs) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Docker Pulls](https://img.shields.io/docker/pulls/eventcally/eventcally)](https://hub.docker.com/r/eventcally/eventcally)
Event website using Python, Flask and Postgres. Event website using Python, Flask and Postgres.

View File

@ -3,11 +3,11 @@ http {
server { server {
listen 80 default_server; listen 80 default_server;
listen [::]:80 default_server; listen [::]:80 default_server;
root /var/www/vhosts/eventcally.de; root /var/www/vhosts/eventcally.com;
server_name _; server_name _;
location ^~ /image/ { location ^~ /image/ {
root "/var/www/vhosts/eventcally.de/cache/img"; root "/var/www/vhosts/eventcally.com/cache/img";
expires 1h; expires 1h;
location ~ ^/image/(?<id>[0-9]+)/(?<hash>[0-9]+) { location ~ ^/image/(?<id>[0-9]+)/(?<hash>[0-9]+) {
@ -25,23 +25,23 @@ http {
} }
} }
location ^~ /static/ { location ^~ /static/ {
root "/var/www/vhosts/eventcally.de/"; root "/var/www/vhosts/eventcally.com/";
location ~ ^/static/(.*)$ { location ~ ^/static/(.*)$ {
try_files /static-custom/$1 /static/$1 @docker; try_files /static-custom/$1 /static/$1 @docker;
} }
} }
location ^~ /dump/ { location ^~ /dump/ {
alias "/var/www/vhosts/eventcally.de/cache/dump/"; alias "/var/www/vhosts/eventcally.com/cache/dump/";
} }
location ^~ /sitemap.xml { location ^~ /sitemap.xml {
alias "/var/www/vhosts/eventcally.de/cache/sitemap.xml"; alias "/var/www/vhosts/eventcally.com/cache/sitemap.xml";
} }
location ^~ /robots.txt { location ^~ /robots.txt {
alias "/var/www/vhosts/eventcally.de/cache/robots.txt"; alias "/var/www/vhosts/eventcally.com/cache/robots.txt";
} }
location ^~ /favicon.ico { location ^~ /favicon.ico {
alias "/var/www/vhosts/eventcally.de/static/favicon.ico"; alias "/var/www/vhosts/eventcally.com/static/favicon.ico";
expires 12h; expires 12h;
} }
location @docker { location @docker {

View File

@ -1,5 +1,25 @@
# Development # Development
## Docker
### Compose (including dependencies)
```sh
docker-compose up --build
```
### Build image
```sh
docker build -t eventcally/eventcally:latest .
```
### Run container with existing postgres server
```sh
docker run -p 5000:5000 -e "DATABASE_URL=postgresql://postgres@host.docker.internal/eventcally" eventcally/eventcally:latest
```
## Tests ## Tests
### Create test database ### Create test database
@ -63,26 +83,6 @@ pybabel extract -F babel.cfg -o messages.pot . && pybabel extract -F babel.cfg -
pybabel compile -d project/translations pybabel compile -d project/translations
``` ```
## Docker
### Build image
```sh
docker build -t eventcally/eventcally:latest .
```
### Run container with existing postgres server
```sh
docker run -p 5000:5000 -e "DATABASE_URL=postgresql://postgres@host.docker.internal/eventcally" eventcally/eventcally:latest
```
### Compose (including dependencies)
```sh
docker-compose up --build
```
## Celery ## Celery
```sh ```sh

View File

@ -6,7 +6,7 @@ x-web-env:
FLASK_APP: main.py FLASK_APP: main.py
DATABASE_URL: postgresql://eventcally:pass@db/eventcally DATABASE_URL: postgresql://eventcally:pass@db/eventcally
REDIS_URL: redis://default:pass@redis REDIS_URL: redis://default:pass@redis
MAIL_DEFAULT_SENDER: noresponse@eventcally.de MAIL_DEFAULT_SENDER: noresponse@eventcally.com
MAIL_SERVER: mailhog MAIL_SERVER: mailhog
MAIL_PORT: 1025 MAIL_PORT: 1025
MAIL_USE_TLS: False MAIL_USE_TLS: False

View File

@ -141,7 +141,7 @@ mail_server = os.getenv("MAIL_SERVER")
if not mail_server: if not mail_server:
app.config["MAIL_SUPPRESS_SEND"] = True app.config["MAIL_SUPPRESS_SEND"] = True
app.config["MAIL_DEFAULT_SENDER"] = "test@eventcally.de" app.config["MAIL_DEFAULT_SENDER"] = "test@eventcally.com"
else: # pragma: no cover else: # pragma: no cover
app.config["MAIL_SUPPRESS_SEND"] = False app.config["MAIL_SUPPRESS_SEND"] = False
app.config["MAIL_SERVER"] = mail_server app.config["MAIL_SERVER"] = mail_server

View File

@ -48,14 +48,14 @@ def test_list_unverified(client, app, seeder, utils):
assert response.json["items"][0]["id"] == verified_admin_unit_id assert response.json["items"][0]["id"] == verified_admin_unit_id
# Authorisierte Nutzer, die Organisationen verifizieren dürfen, sehen alle Organisationen. # Authorisierte Nutzer, die Organisationen verifizieren dürfen, sehen alle Organisationen.
# "admin@eventcally.de" ist Mitglied der Organisation "eventcally", die andere Organisationen verifizieren darf. # "admin@eventcally.com" ist Mitglied der Organisation "eventcally", die andere Organisationen verifizieren darf.
with app.app_context(): with app.app_context():
from project.services.admin_unit import get_admin_unit_by_name from project.services.admin_unit import get_admin_unit_by_name
eventcally_id = get_admin_unit_by_name("eventcally").id eventcally_id = get_admin_unit_by_name("eventcally").id
utils.logout() utils.logout()
utils.login("admin@eventcally.de") utils.login("admin@eventcally.com")
response = utils.get_ok(url) response = utils.get_ok(url)
assert len(response.json["items"]) == 3 assert len(response.json["items"]) == 3
assert response.json["items"][0]["id"] == eventcally_id assert response.json["items"][0]["id"] == eventcally_id

View File

@ -104,7 +104,7 @@ class Seeder(object):
if other_admin_unit: if other_admin_unit:
other_admin_unit_id = other_admin_unit.id other_admin_unit_id = other_admin_unit.id
else: else:
other_user_id = self.create_user("admin@eventcally.de") other_user_id = self.create_user("admin@eventcally.com")
other_admin_unit_id = self.create_admin_unit( other_admin_unit_id = self.create_admin_unit(
other_user_id, "eventcally", can_verify_other=True other_user_id, "eventcally", can_verify_other=True
) )