diff --git a/.gitignore b/.gitignore index 94bbb6c..c8ca245 100644 --- a/.gitignore +++ b/.gitignore @@ -58,4 +58,5 @@ ENV/ .idea/**/uiDesigner.xml .idea/**/gradle.xml .idea/**/libraries +.idea/** *.iws /out/ \ No newline at end of file diff --git a/.tmp b/.tmp new file mode 100644 index 0000000..e69de29 diff --git a/Dockerfile b/Dockerfile index c7937a3..24f0179 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ FROM tiangolo/uwsgi-nginx-flask -ENV STATIC_URL /static -ENV STATIC_PATH /var/www/app/static -ENV cal_id 9E2AC562-4328-4CA0-B4D1-D730D9F5E9EF -ENV username a@correa.co -ENV password jyxq-avwz-qxfd-dklo -ENV caldav_url https://caldav.icloud.com/ +# Install system dependencies and wkhtmltoimage +RUN apt-get update && apt-get install -y \ + wkhtmltopdf \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* COPY ./requirements.txt /var/www/requirements.txt +COPY ./server ./app RUN pip install -r /var/www/requirements.txt \ No newline at end of file diff --git a/app/__init__.py b/app/__init__.py deleted file mode 100644 index 8f5986d..0000000 --- a/app/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from flask import Flask -app = Flask(__name__) -from app import views \ No newline at end of file diff --git a/app/static/style.css b/app/static/style.css deleted file mode 100644 index 767dcf8..0000000 --- a/app/static/style.css +++ /dev/null @@ -1,95 +0,0 @@ -@import url('fonts/dinpro/dinpro.css'); -@import url('fonts/noto-emoji.css'); -@import url('fonts/openmoji.css'); -@import url('fonts/weather-icons/weather-icons.css'); - -@font-face { - font-family: "Hellovetica"; - src: url("fonts/hellovetica.ttf") format("truetype"); -} - -@font-face { - font-family: "Helvetica"; -} - -.dashboard { - font-family: "Helvetica", sans-serif; - height: 699px; - width: 600px; - text-align: left; - font-size: 17px; -} - -.panel { - position: relative; - height: 50%; - verical-align: top; - /* height: 250px; */ - width: 100%; -} - -.panel.top { - height: 35%; -} - -.panel.bottom { - height: 65%; -} - -.subpanel { - position: relative; - height:100%; - width:48%; - display: inline-block; - text-align: center; -} - -.weather-icon { - - position: relative; - height: 100%; - width: 100%; - object-fit: scale-down; -} - -.week { - text-align: center; -} - -.day { - border-style: solid; - display: inline-block; - min-height: 220px; - max-height: 220px; - width: 135px; - vertical-align: top; - margin: 1px; - align-items: center; - text-align: left; -} - -.day-title{ - background-color: black; - text-align: center; - color: white; - text-transform: uppercase; - font-weight: bold; - -} - -.event { - margin: 3pt; - background-color: white; - border-style: solid; - border-radius: 5px; - padding: 2px; - font-family: "Helvetica"; -} - -.daterange { - font-size: smaller; -} - -.weather-icon { - font-size: 200px; -} \ No newline at end of file diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..5886898 --- /dev/null +++ b/compose.yml @@ -0,0 +1,10 @@ +services: + webcal: + build: . + env_file: + - .env + ports: + - "56733:80" + volumes: + - ./server:/app + \ No newline at end of file diff --git a/main.py b/main.py deleted file mode 100644 index e524e69..0000000 --- a/main.py +++ /dev/null @@ -1 +0,0 @@ -from app import app \ No newline at end of file diff --git a/out.png b/out.png new file mode 100644 index 0000000..75ee7b9 Binary files /dev/null and b/out.png differ diff --git a/requirements.txt b/requirements.txt index b0097ee..d9076af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,7 @@ caldav~=0.9.0 requests~=2.27.1 icalendar~=4.0.9 -Flask~=2.1.2 \ No newline at end of file +Flask~=2.1.2 +Werkzeug==2.2.2 +imgkit +pillow \ No newline at end of file diff --git a/server/app/__init__.py b/server/app/__init__.py new file mode 100644 index 0000000..a7ee582 --- /dev/null +++ b/server/app/__init__.py @@ -0,0 +1,8 @@ +# app/__init__.py +from flask import Flask + +# Create Flask app +app = Flask(__name__,static_url_path='', static_folder='static') + +# Import views to register routes +from app import views \ No newline at end of file diff --git a/server/app/main.py b/server/app/main.py new file mode 100644 index 0000000..e69de29 diff --git a/app/models.py b/server/app/models.py similarity index 100% rename from app/models.py rename to server/app/models.py diff --git a/app/templates/dashboard.html b/server/app/templates/dashboard.html similarity index 89% rename from app/templates/dashboard.html rename to server/app/templates/dashboard.html index c877c27..6f6e555 100644 --- a/app/templates/dashboard.html +++ b/server/app/templates/dashboard.html @@ -2,10 +2,12 @@