1.0.1 release #15

Merged
williamp merged 35 commits from testing into master 2023-03-21 18:10:14 +00:00
32 changed files with 314 additions and 96 deletions
Showing only changes of commit a1bfc827d4 - Show all commits

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
### Database file ### Database file
database.db database.db
database_mysql/
### Python template ### Python template
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files

View File

@@ -1,6 +1,7 @@
FROM python:3.11.0-alpine3.16 FROM python:3.11.0-alpine3.16
COPY ./app /app COPY ./app /app
WORKDIR /app WORKDIR /app
RUN apk add gcc musl-dev mariadb-connector-c-dev
RUN pip3 install -r requirements.txt RUN pip3 install -r requirements.txt
ENV FLASK_APP=app.py ENV FLASK_APP=app.py
CMD ["gunicorn", "-b", "0.0.0.0:80", "-w", "4", "app:app"] CMD ["gunicorn", "-b", "0.0.0.0:80", "-w", "4", "app:app"]

View File

@@ -13,7 +13,11 @@ basedir = os.path.abspath(os.path.dirname(__file__))
app = Flask(__name__) app = Flask(__name__)
app.config['SECRET_KEY'] = os.environ['SECRET_KEY'] app.config['SECRET_KEY'] = os.environ['SECRET_KEY']
app.config['SQLALCHEMY_DATABASE_URI'] =\ app.config['SQLALCHEMY_DATABASE_URI'] =\
'sqlite:///' + os.path.join(basedir, os.environ['SQLITE_DB']) 'mysql://' + os.environ['MYSQL_USER'] + \
':' + os.environ['MYSQL_PASSWORD'] + \
'@' + os.environ['MYSQL_HOST'] + \
':' + os.environ['MYSQL_PORT'] + \
'/' + os.environ['MYSQL_DB']
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db.init_app(app) db.init_app(app)

View File

@@ -16,49 +16,49 @@ period9 = Period(period=9, periodTime='15:30:00', weekendSchedule=False)
task1 = Task(id=1, task1 = Task(id=1,
title="Sexy ERP time", title="Sexy ERP time",
description="Be the dominant partner and fuck so much XD", description="Be the dominant partner and fuck so much XD",
created_timestamp='1668278862', due_timestamp='') created_timestamp=1668278862, due_timestamp=None)
task2 = Task(id=2, title="Test task", task2 = Task(id=2, title="Test task",
description="Test", description="Test",
created_timestamp='1668278862', created_timestamp=1668278862,
due_timestamp='') due_timestamp=None)
task3 = Task(id=3, title="La Nager", task3 = Task(id=3, title="La Nager",
description="Francis stuff", description="Francis stuff",
created_timestamp='1668278862', created_timestamp=1668278862,
due_timestamp='') due_timestamp=None)
task4 = Task(id=4, title="Ops/Tech Meeting", task4 = Task(id=4, title="Ops/Tech Meeting",
description="HEIL GEORGE!", description="HEIL GEORGE!",
created_timestamp='1668278862', created_timestamp=1668278862,
due_timestamp='') due_timestamp=None)
task5 = Task(id=5, title="Tech Team Meeting", task5 = Task(id=5, title="Tech Team Meeting",
description="Awkward AF", description="Awkward AF",
created_timestamp='1668278862', created_timestamp=1668278862,
due_timestamp='') due_timestamp=None)
task6 = Task(id=6, title="Write BellScheduler", task6 = Task(id=6, title="Write BellScheduler",
description="heh", description="heh",
created_timestamp='1668278862', created_timestamp=1668278862,
due_timestamp='') due_timestamp=None)
task7 = Task(id=7, title="Fap to cunny porn", task7 = Task(id=7, title="Fap to cunny porn",
description="FBI OPEN UP!", description="FBI OPEN UP!",
created_timestamp='1668278862', created_timestamp=1668278862,
due_timestamp='') due_timestamp=None)
task8 = Task(id=8, title="Go on vrchat", task8 = Task(id=8, title="Go on vrchat",
description="Mmm... virtual headpats!", description="Mmm... virtual headpats!",
created_timestamp='1668278862', created_timestamp=1668278862,
due_timestamp='') due_timestamp=None)
task9 = Task(id=9, title="Brush teeth", task9 = Task(id=9, title="Brush teeth",
description="Ya dont do that more often, ya gross fuck", description="Ya dont do that more often, ya gross fuck",
created_timestamp='1668278862', created_timestamp=1668278862,
due_timestamp='') due_timestamp=None)
event1 = Event(id=1, scheduled_date='11-12-2022', period_num=1, task_id=4) event1 = Event(id=1, scheduled_date='03-17-2023', period_num=1, task_id=4)
event2 = Event(id=2, scheduled_date='11-12-2022', period_num=2, task_id=2) event2 = Event(id=2, scheduled_date='03-17-2023', period_num=2, task_id=2)
event3 = Event(id=3, scheduled_date='11-12-2022', period_num=3, task_id=5) event3 = Event(id=3, scheduled_date='03-17-2023', period_num=3, task_id=5)
event4 = Event(id=4, scheduled_date='11-12-2022', period_num=4, task_id=6) event4 = Event(id=4, scheduled_date='03-17-2023', period_num=4, task_id=6)
event5 = Event(id=5, scheduled_date='11-12-2022', period_num=5, task_id=1) event5 = Event(id=5, scheduled_date='03-17-2023', period_num=5, task_id=1)
event6 = Event(id=6, scheduled_date='11-12-2022', period_num=6, task_id=3) event6 = Event(id=6, scheduled_date='03-17-2023', period_num=6, task_id=3)
event7 = Event(id=7, scheduled_date='11-12-2022', period_num=7, task_id=7) event7 = Event(id=7, scheduled_date='03-17-2023', period_num=7, task_id=7)
event8 = Event(id=8, scheduled_date='11-12-2022', period_num=8, task_id=8) event8 = Event(id=8, scheduled_date='03-17-2023', period_num=8, task_id=8)
event9 = Event(id=9, scheduled_date='11-12-2022', period_num=9, task_id=9) event9 = Event(id=9, scheduled_date='03-17-2023', period_num=9, task_id=9)
db.session.add_all([period1, period2, period3, period4, period5, period6, period7, period8, period9]) db.session.add_all([period1, period2, period3, period4, period5, period6, period7, period8, period9])
db.session.add_all([task1, task2, task3, task4, task5, task6, task7, task8, task9]) db.session.add_all([task1, task2, task3, task4, task5, task6, task7, task8, task9])

View File

@@ -1,36 +0,0 @@
"""empty message
Revision ID: bf65c9f77f9f
Revises:
Create Date: 2022-11-19 09:49:20.565127
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bf65c9f77f9f'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('userName', sa.String(length=1000), nullable=True),
sa.Column('email', sa.String(length=100), nullable=True),
sa.Column('password', sa.String(length=100), nullable=True),
sa.Column('realName', sa.String(length=1000), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('user')
# ### end Alembic commands ###

View File

@@ -1,28 +0,0 @@
"""empty message
Revision ID: d92ccc005d22
Revises: bf65c9f77f9f
Create Date: 2022-11-23 20:32:41.868230
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd92ccc005d22'
down_revision = 'bf65c9f77f9f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('timezone', sa.String(length=20), nullable=True, server_default='UTC'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user', 'timezone')
# ### end Alembic commands ###

View File

@@ -32,3 +32,6 @@ pytz==2022.6
# Automated tests # Automated tests
pytest==7.2.0 pytest==7.2.0
pytest-cov==4.0.0 pytest-cov==4.0.0
# MySQL Package
mysqlclient==2.1.1

View File

@@ -4,14 +4,25 @@ services:
image: container-registry.infra.dubyatp.xyz/bellscheduler/app:latest-testing image: container-registry.infra.dubyatp.xyz/bellscheduler/app:latest-testing
restart: always restart: always
environment: environment:
- SQLITE_DB=database.db - MYSQL_USER=root
- MYSQL_PASSWORD=notasecuresecretkeyonlyuseforlocaldevelopment
- MYSQL_HOST=db
- MYSQL_PORT=3306
- MYSQL_DB=bellscheduler
- SECRET_KEY=notasecuresecretkeyonlyuseforlocaldevelopment - SECRET_KEY=notasecuresecretkeyonlyuseforlocaldevelopment
- NODE_NAME=local - NODE_NAME=local
- POD_NAME=local - POD_NAME=local
- FLASK_ENV=development - FLASK_ENV=development
- FLASK_DEBUG=1 - FLASK_DEBUG=1
- PYTHONUNBUFFERED=1 - PYTHONUNBUFFERED=1
volumes:
- ./database.db:/app/database.db
ports: ports:
- 127.0.0.1:80:80 - 127.0.0.1:80:80
db:
image: mariadb:10.7.8-focal
restart: always
environment:
- MARIADB_ROOT_PASSWORD=notasecuresecretkeyonlyuseforlocaldevelopment
volumes:
- ./database_mysql:/var/lib/mysql
ports:
- 127.0.0.1:3306:3306