Author SHA1 Message Date
marc 8e77d7c64e dont ignore my pipfiles
Docker / build (push) Canceled after 0s
Pylint / build (push) Canceled after 0s
2022-08-20 01:06:17 +02:00
marc 550419381a back to root 2022-08-20 01:04:06 +02:00
marc fc9f4cde3b opt website 2022-08-20 01:03:13 +02:00
marc 3f2b863f5a workdir app 2022-08-20 01:02:05 +02:00
marc 8231096b4d npm 2022-08-20 01:00:39 +02:00
marc 87268abcc3 latest python 2022-08-20 00:57:49 +02:00
marc c67e613ba2 local docker cache 2022-08-20 00:48:45 +02:00
marc 76985fa799 Merge branch 'master' into arch 2022-08-20 00:46:15 +02:00
marc 368a74a1c7 docker build test 2022-08-20 00:46:09 +02:00
marc dae43435e4 arch 2022-08-20 00:33:11 +02:00
marc ba7998c636 paru 2022-08-20 00:28:34 +02:00
marc 0ac6f00ef0 arch 2022-08-20 00:26:13 +02:00
marc 2bdc141e2d archlinux first try 2022-08-20 00:11:14 +02:00
marc c1ba069b41 build and push 2022-08-20 00:02:24 +02:00
marc 0271e71974 update apt is slow 2022-08-20 00:01:33 +02:00
marc d209ad28c5 fix mistake 2022-08-19 23:58:22 +02:00
marc 9f5de228b5 trying new docker-push 2022-08-19 23:56:44 +02:00
marc 92871ae135 update 2022-08-19 19:55:11 +02:00
marc a702e9f516 docker-compose rename 2022-05-29 03:02:02 +02:00
marc 9bbde03fbd pipfile.lock 2022-05-29 03:00:17 +02:00
marc c0dc586058 update 2022-05-24 15:35:07 +02:00
marc ddd7c04e12 update 2022-05-24 15:28:34 +02:00
marc f220c5b596 pipfile 2022-05-24 15:15:25 +02:00
marc 1eafde9735 update 2022-04-23 01:22:01 +02:00
marc 96433c7f41 update 2022-04-23 01:10:25 +02:00
marc 6ddcf0380b update 2022-03-31 18:34:08 +02:00
marc ff8f5b64db fix 2022-03-31 18:15:12 +02:00
marc 00e5f58014 update again 2022-03-30 21:42:11 +02:00
marc 2a5635039b big update 2022-03-30 21:37:40 +02:00
marc 282bb58bc3 funding 2022-02-24 00:02:02 +01:00
marc 1f25080a36 walrus or not walrus 2022-02-07 14:35:40 +01:00
marc 33c828fd99 update 2022-01-30 23:35:07 +01:00
marc 6ae02e1bcb fix cd 2022-01-30 23:27:21 +01:00
marc e8a3f845f1 cleaner readme 2022-01-30 23:26:53 +01:00
marc 75629e9fe5 updated readme with actual info 2022-01-30 23:23:11 +01:00
marc 68d3df2af7 deploy 2022-01-30 23:15:06 +01:00
marc 14f804c0ad registering models in admin panel 2022-01-30 23:12:23 +01:00
marc 0709a971dd upodate 2022-01-30 21:52:40 +01:00
marc 1b9c936e00 store
Pylint / build (push) Canceled after 0s
2022-01-30 21:20:37 +01:00
marc d1ae6957a2 first store migration 2022-01-30 16:49:10 +01:00
marc ce9ada5b2b positive integer field 2022-01-30 16:48:59 +01:00
marc dcc7837940 store 2022-01-30 16:44:15 +01:00
marc 79eef3adad wtf 2022-01-30 16:20:39 +01:00
marc 403067a728 pipfile.lock 2022-01-30 16:18:45 +01:00
marc b6ec49e108 gpl3 2022-01-22 16:09:08 +01:00
marc 83e1b50151 pipfile.lock 2022-01-18 10:59:54 +01:00
marc a6f119b6c0 bye run
Pylint / build (push) Canceled after 0s
2022-01-17 20:45:19 +01:00
marc 735450f4b0 runtest 2022-01-17 20:45:09 +01:00
marc 03a587bec9 kill 2022-01-17 20:42:58 +01:00
marc 41f53d1ae2 nosetup 2022-01-17 20:35:35 +01:00
marc 49d360a942 nosetup 2022-01-17 20:28:45 +01:00
marc 1983e73e14 nosetup 2022-01-17 20:27:37 +01:00
marc d82992c8a1 start pipenv 2022-01-17 20:23:22 +01:00
marc 151a44f366 production false 2022-01-17 20:12:59 +01:00
marc f4c572a8a2 generate .env if it does not exist 2022-01-17 20:12:03 +01:00
marc 351f04c859 pipfile.lock 2022-01-17 19:52:34 +01:00
marc db9ca12b4c headless 2022-01-17 19:46:40 +01:00
marc b3ddaae5f2 phony + make list 2022-01-17 19:36:47 +01:00
marc 2c69c495fc pipenv update 2022-01-17 19:17:36 +01:00
marc defde3ff28 pipenv update 2022-01-17 19:15:10 +01:00
marc 512c19746d commenting entrypoint 2022-01-17 19:15:05 +01:00
marc 2d9af7b785 bye useless log 2022-01-17 19:14:39 +01:00
marc 4c669d624d selenium 2022-01-17 19:14:07 +01:00
marc 32bee56dad Merge branch 'master' into test 2022-01-17 18:57:57 +01:00
marc 80391aa894 pipfile.lock 2022-01-17 18:57:51 +01:00
marc 345312a259 testing homepage 2022-01-17 18:57:27 +01:00
marc 889914403c init setup start entrypoint.sh 2022-01-15 20:19:04 +01:00
marc 12297520da pipeline with make to avoid redundancy 2022-01-15 20:01:30 +01:00
marc 2b57f624c5 bye healhthcheck 2022-01-15 19:52:22 +01:00
marc f8380267df updated cv 2022-01-15 19:18:32 +01:00
marc 451ccd8a7d start period for healthcheck + more silent 2022-01-15 19:13:27 +01:00
marc ff569bee10 bye build and deploy 2022-01-15 19:10:57 +01:00
marc bded141624 bye down 2022-01-15 19:10:28 +01:00
marc 552b5d3afe bye up 2022-01-15 19:09:55 +01:00
marc 2989138fac pipenv update 2022-01-15 19:08:24 +01:00
marc fca1b6dfab no ignore files neither 2022-01-11 13:18:48 +01:00
marc b06cf4b749 no .travis.yml 2022-01-11 13:18:09 +01:00
marc d34ca52c4d no pipfile in docker image 2022-01-11 13:16:44 +01:00
marc 09c83fa203 dockerignore 2022-01-11 12:55:08 +01:00
marc 41ebca2bb9 healthcheck secret key docker-compose 2022-01-11 12:52:18 +01:00
marc bce91cc538 updated dependencies 2022-01-11 03:56:05 +01:00
marc 41f5518faa collectstatict 2022-01-11 03:52:42 +01:00
marc a3baef397b added healthcheck 2021-12-30 13:13:51 +01:00
marc df3c691847 host 2021-12-30 01:42:20 +01:00
marc 5a0a585389 update requirements.txt 2021-12-25 01:16:26 +01:00
marc 82232f74ec labels 2021-12-25 01:14:20 +01:00
marc 52856ca529 using established conventions for makefile 2021-12-22 21:18:56 +01:00
27 changed files with 1649 additions and 1020 deletions
+6 -1
View File
@@ -4,12 +4,17 @@ run.sh
runtime.txt runtime.txt
Makefile Makefile
heroku.yml heroku.yml
docker-compose.* docker-compose.yml
dev.yml
db.sqlite3 db.sqlite3
venv venv
.env .env
.github/ .github/
.git
.vim/ .vim/
.buildpacks .buildpacks
*.pem *.pem
*.crt *.crt
.travis.yml
.gitignore
.dockerignore
+4
View File
@@ -1 +1,5 @@
patreon: marcpartensky patreon: marcpartensky
github: marcpartensky
custom:
# - monero:43J2XmRtjDPRLD35UsYGH2AZamFBQz7dt4VdvZXVm3SuadTrvcoXUXBRUNHqukFte23Q5TWXqhbwaLJJgoVQzzbe2AJDANQ
- https://paypal.me/marcpartensky
+47
View File
@@ -0,0 +1,47 @@
name: Docker
on:
push:
branches:
- "*"
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for any PRs.
pull_request:
env:
IMAGE_NAME: website
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
context: .
push: false
tags: marcpartensky/website:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
+17 -21
View File
@@ -19,42 +19,38 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Update apt - name: Install make
run: sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y run: sudo apt install make -y
- name: Install Python3.7 - name: Install Python3.7
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
python-version: 3.7 python-version: 3.7
architecture: x64 architecture: x64
- name: Update pip - name: make init
run: pip install -U pip run: make init
- name: Install pipenv - name: make update
run: pip install pipenv run: make update
- name: Lock pip dependencies
run: pipenv lock --pre --clear
- name: Install dependencies
run: pipenv install
- name: Export to requirements.txt
run: pipenv lock -r > requirements.txt
- name: Collecting static
run: SECRET_KEY=secret pipenv run ./manage.py collectstatic --noinput
- name: Preparing migrations
run: SECRET_KEY=secret pipenv run ./manage.py makemigrations
- name: Updating package.json
run: npm update
- name: Fixing audit npm bugs
run: npm audit fix
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Build and push
id: build
uses: docker/build-push-action@v2
with:
push: false
tags: marcpartensky/website:latest
- name: Compose up
run: docker-compose -f dev.yml up -d website postgres mysql
- name: Test
run: docker-compose run test
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push
id: docker_build id: push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
push: true push: true
+3
View File
@@ -49,3 +49,6 @@ nohup.out
# Staticfiles # Staticfiles
staticfiles staticfiles
# selenium
geckodriver.log
+27 -12
View File
@@ -1,15 +1,27 @@
FROM python:3.7.12 FROM marcpartensky/paru:latest as builder
RUN paru -Syyyu --noconfirm python-pipenv npm make
COPY . /app USER root
WORKDIR /app COPY . /opt/website
WORKDIR /opt/website
RUN apt-get update RUN pipenv update
RUN pipenv run ./manage.py collectstatic --noinput
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash
RUN apt-get install -y nodejs
RUN npm install -g npm@latest RUN npm install -g npm@latest
RUN npm install RUN npm install
FROM marcpartensky/paru:latest
LABEL maintainer="marc.partensky@gmail.com"
LABEL image="https://hub.docker.com/r/marcpartensky/website"
LABEL source="https://github.com/marcpartensky/website"
LABEL link="https://marcpartensky.com"
RUN paru -Syyyu --noconfirm python npm
# ARG timestamp
# ARG commit
# LABEL build.timestamp=timestamp
# LABEL build.commit=commit
COPY --from=builder /app /app
WORKDIR /app
# No .pyo and easier debugging # No .pyo and easier debugging
ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
@@ -18,12 +30,15 @@ RUN pip install -U pip
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
ENV PORT 80 ENV PORT 80
ENV HOST 0.0.0.0
EXPOSE 80 EXPOSE 80
# EXPOSE 443 # EXPOSE 443
HEALTHCHECK --interval=5s \ HEALTHCHECK --interval=30s \
--timeout=5s \ --timeout=10s \
CMD curl -sf http://127.0.0.1:$PORT/robots.txt || exit 1 --start-period=1m \
--retries=3 \
CMD curl -sSf http://127.0.0.1:$PORT/live || exit 1
ENTRYPOINT ["/app/entrypoint.sh"] ENTRYPOINT ["/app/entrypoint.sh"]
# ENTRYPOINT ["daphne", "-e", "ssl:443:privateKey=$KEY:certKey=$CERT", "django_project.asgi:application"] # ENTRYPOINT ["daphne", "-e", "ssl:443:privateKey=$KEY:certKey=$CERT", "django_project.asgi:application"]
+165
View File
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
+40 -17
View File
@@ -1,24 +1,39 @@
run: update # HOST=localhost
pipenv run ./manage.py runserver 127.0.0.1:8000 # PORT=8000
PRODUCTION=false
.PHONY: start list build push setup update init test up down migrate brewstart brewstop dev prod clean deploy
start:
pipenv run ./entrypoint.sh --nosetup
list:
@LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
build: update build: update
docker build . -t marcpartensky/website docker-compose -f dev.yml build website
docker push marcpartensky/website push: build
push: update build
git add -A
git commit -m "Makefile update"
git pushall git pushall
docker push marcpartensky/website docker-compose -f dev.yml push website
update: install setup: init update start
update:
npm update npm update
npm audit fix npm audit fix || echo npm audit fix failed
pipenv lock --pre --clear # pipenv lock --pre --clear
pipenv update
pipenv lock -r > requirements.txt pipenv lock -r > requirements.txt
pipenv run ./manage.py collectstatic --noinput SECRET_KEY=secret pipenv run ./manage.py collectstatic --noinput
pipenv run ./manage.py makemigrations SECRET_KEY=secret pipenv run ./manage.py makemigrations
install: init: .env
pip install --user pipenv pip install --user pipenv
pipenv install --dev pipenv install --dev
npm install --save npm install --save
test:
pipenv run ./manage.py test
runtest:
make start &
make test
make kill
kill:
pipenv run ./entrypoint.sh kill
up: init up: init
docker-compose up -d docker-compose up -d
down: down:
@@ -34,13 +49,21 @@ brewstop:
brew services stop mysql brew services stop mysql
brew services stop redis brew services stop redis
dev: dev:
docker-compose -f dev.yml up -d docker-compose -f dev.yml up -d --build --remove-orphans
exec docker-compose -f dev.yml logs -f exec docker-compose -f dev.yml logs -f
prod: prod:
docker-compose -f docker.compose.yml up -d docker-compose -f docker-compose.yml up -d --build --remove-orphans
clean: clean:
docker-compose -f docker-compose.yml down docker-compose -f docker-compose.yml down
docker-compose -f dev.yml down docker-compose -f dev.yml down
deploy: testdeploy:
DOCKER_HOST=ssh://vps docker-compose -f dev.yml up -d --build --force-recreate --remove-orphans website-test DOCKER_HOST=ssh://vps docker-compose -f dev.yml up -d --build --force-recreate --remove-orphans website-test
DOCKER_HOST=ssh://vps docker-compose -f docker-compose.dev.ym logs -f website-test DOCKER_HOST=ssh://vps docker-compose -f docker-compose.dev.ym logs -f website-test
deploy: push
DOCKER_HOST=ssh://vps docker service update vps_website
.env:
echo HOST=localhost > .env
echo PORT=8000 >> .env
echo PRODUCTION=false >> .env
echo NOSETUP=true >> .env
echo SECRET=$$(date +%s | sha256sum | base64 | head -c 32 && echo) >> .env
+2
View File
@@ -152,6 +152,8 @@ SecretStorage = "*"
service_identity = "*" service_identity = "*"
Twisted = "*" Twisted = "*"
django-robots = "*" django-robots = "*"
selenium = "*"
geckodriver-autoinstaller = "*"
[dev-packages] [dev-packages]
black = "*" black = "*"
Generated
+1008 -730
View File
File diff suppressed because it is too large Load Diff
+9 -15
View File
@@ -6,26 +6,26 @@
This is the code of my personal website. This is the code of my personal website.
[https://marcpartensky.com/](https://marcpartensky.com/) [https://marcpartensky.com/](https://marcpartensky.com/)
[![website](https://cdn.discordapp.com/attachments/507519157387132940/937471879776710676/website.png)](https://marcpartensky.com)
## Light theme ## Light theme
[![light theme](https://cdn.discordapp.com/attachments/702863598761803806/782335262499930112/light.png)](https://websiteofmarcpartensky.herokuapp.com) [![light theme](https://cdn.discordapp.com/attachments/507519157387132940/937472721015668766/website1.png)](https://marcpartensky.com)
## Dark theme ## Dark theme
[![dark theme](https://cdn.discordapp.com/attachments/702863598761803806/782334455385555014/dark.png)](https://websiteofmarcpartensky.herokuapp.com?theme=dark) [![dark theme](https://cdn.discordapp.com/attachments/507519157387132940/937472943422849044/website2.png)](https://marcpartensky.com?theme=dark)
## Install ## Install
### From [source](https://github.com/MarcPartensky/Website) (requires [git](https://git-scm.com/), [python](https://www.python.org/), [pip](https://pip.pypa.io/en/stable/installing/)) ### From [source](https://github.com/MarcPartensky/Website) (requires [git](https://git-scm.com/), [python](https://www.python.org/), [pip](https://pip.pypa.io/en/stable/installing/))
```sh ```sh
git clone https://github.com/marcpartensky/website git clone https://github.com/marcpartensky/website
``` cd website
```sh
pip install -r requirements.txt pip install -r requirements.txt
# or with pipenv (recommended, install pipenv with pip install pipenv) # or with pipenv (recommended, install pipenv with pip install pipenv)
pipenv install pipenv install
```
```sh
./manage.py runserver ./manage.py runserver
``` ```
@@ -37,9 +37,8 @@ pipenv install
```sh ```sh
docker run -it \ docker run -it \
-e SECRET_KEY=$(openssl rand -base64 32) \ -e SECRET_KEY=$(openssl rand -base64 32) \
-p 80:80 \ -p 8080:80 \
marcpartensky/website marcpartensky/website
./manage.py runserver
``` ```
#### or run with ssl certificate #### or run with ssl certificate
@@ -48,7 +47,7 @@ docker run -it \
-env CERT \ # You must export a ssl certificate path -env CERT \ # You must export a ssl certificate path
-env KEY \ # You must export a pem key path -env KEY \ # You must export a pem key path
-e SECRET_KEY=$(openssl rand -base64 32) \ -e SECRET_KEY=$(openssl rand -base64 32) \
-p 443:443 \ -p 8443:443 \
marcpartensky/website marcpartensky/website
``` ```
@@ -59,10 +58,6 @@ cd website
docker-compose up docker-compose up
``` ```
> If you’re using Docker natively on Linux, Docker Desktop for Mac, or Docker Desktop for Windows, then the web app should now be listening on port 443 on your Docker daemon host. Point your web browser to http://localhost:443 to find the Hello World message. If this doesn’t resolve, you can also try http://127.0.0.1:443.
From https://docs.docker.com/compose/gettingstarted/
## Build the docker image from source ## Build the docker image from source
```sh ```sh
docker build . -t marcpartensky/website docker build . -t marcpartensky/website
@@ -77,8 +72,7 @@ Build usually last 5 minutes.
## Notes ## Notes
author: Marc Partensky author: Marc Partensky
name: Website of Marc Partensky created: 8/10/2019
date: 8/10/2019
## Heroku Buildpacks ## Heroku Buildpacks
+3 -2
View File
@@ -1,5 +1,6 @@
from django.contrib import admin from django.contrib import admin
from .models import MarkdownModel from .models import MarkdownModel, NotificationModel, DataModel
# Register your models here.
admin.site.register(MarkdownModel) admin.site.register(MarkdownModel)
admin.site.register(NotificationModel)
admin.site.register(DataModel)
+23
View File
@@ -0,0 +1,23 @@
# Generated by Django 3.2.11 on 2022-01-30 15:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0002_notificationmodel'),
]
operations = [
migrations.CreateModel(
name='DataModel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content', models.JSONField()),
('source', models.GenericIPAddressField()),
('view_count', models.PositiveIntegerField(default=0)),
('created', models.DateTimeField(auto_now_add=True)),
],
),
]
+9
View File
@@ -30,3 +30,12 @@ class NotificationModel(models.Model):
def __str__(self): def __str__(self):
"""Return the notification sent.""" """Return the notification sent."""
return f"{self.message}" return f"{self.message}"
class DataModel(models.Model):
"""A model that represents data sent by either POST or GET requests."""
content = models.JSONField()
source = models.GenericIPAddressField()
view_count = models.PositiveIntegerField(default=0)
created = models.DateTimeField(auto_now_add=True)
@@ -1,32 +0,0 @@
from django.db import models
class MarkdownModel(models.Model):
"""A model to store markdown files"""
title = models.CharField(max_length=80)
file = models.FileField(upload_to="markdown/")
class Meta:
ordering = ["title"]
def __str__(self):
return f"{self.title}"
# def save(self, *args, **kwargs):
# print('saving model somewhere')
# print(args, kwargs)
# return super().save(*args, **kwargs)
class NotificationModel(models.Model):
"""A model that represents a notification."""
message = models.TextField()
source = models.GenericIPAddressField()
timestamp = models.DateTimeField(auto_now_add=True)
seen = models.BooleanField(default=False)
def __str__(self):
"""Return the notification sent."""
return f"{self.message}"
+2
View File
@@ -19,4 +19,6 @@ urlpatterns = [
path("todo/<str:id>", views.todo, name="api-todo"), path("todo/<str:id>", views.todo, name="api-todo"),
path("port/<int:n>", views.port, name="port"), path("port/<int:n>", views.port, name="port"),
path("port", views.port, name="port"), path("port", views.port, name="port"),
path("store", views.store, name="store"),
path("store/<int:id>", views.read_store, name="read-store"),
] ]
+48 -3
View File
@@ -10,8 +10,16 @@ import subprocess
from io import StringIO from io import StringIO
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse, HttpRequest from django.http import (
HttpResponse,
HttpRequest,
HttpResponseBadRequest,
JsonResponse,
HttpResponseRedirect,
)
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from django.forms.models import model_to_dict
from django.views.decorators.csrf import csrf_exempt
from rest_framework.parsers import JSONParser, FileUploadParser from rest_framework.parsers import JSONParser, FileUploadParser
from rest_framework.renderers import JSONRenderer from rest_framework.renderers import JSONRenderer
@@ -19,8 +27,7 @@ from rest_framework.response import Response
from rest_framework.views import APIView from rest_framework.views import APIView
from .forms import UploadFileForm, UploadMarkdownForm, TodoForm from .forms import UploadFileForm, UploadMarkdownForm, TodoForm
from django.views.decorators.csrf import csrf_exempt from .models import MarkdownModel, NotificationModel, DataModel
from .models import MarkdownModel, NotificationModel
from todo.models import Todo from todo.models import Todo
@@ -244,6 +251,7 @@ def port(request: HttpRequest, n: int = 1):
print(result) print(result)
return HttpResponse(result) return HttpResponse(result)
@csrf_exempt @csrf_exempt
def notify(request: HttpRequest): def notify(request: HttpRequest):
"""Notify me with a get request container """Notify me with a get request container
@@ -251,6 +259,7 @@ def notify(request: HttpRequest):
message = request.GET.get("message") message = request.GET.get("message")
return HttpResponse("") return HttpResponse("")
@csrf_exempt @csrf_exempt
def notifications(request: HttpRequest): def notifications(request: HttpRequest):
"""Return the list of notifications.""" """Return the list of notifications."""
@@ -259,3 +268,39 @@ def notifications(request: HttpRequest):
notification.seen = True notification.seen = True
notification.save() notification.save()
return JsonResponse(notifications) return JsonResponse(notifications)
def get_client_ip(request: HttpRequest):
"""Get the ip addresse of a client."""
x_forwarded_for = request.META.get("HTTP_X_FORWARDED_FOR")
if x_forwarded_for:
return x_forwarded_for.split(",")[-1].strip()
else:
return request.META.get("REMOTE_ADDR")
@csrf_exempt
def store(request: HttpRequest):
"""Store data sent."""
request_data: dict
if request.method == "POST":
request_data = request.POST
elif request.method == "GET":
request_data = {key: value[0] for key, value in request.GET.items()}
else:
return HttpResponseBadRequest("Only accept POST or GET requests.")
print(request_data)
data = DataModel(content=json.dumps(request_data), source=get_client_ip(request))
data.save()
print(data)
return JsonResponse(model_to_dict(data))
@csrf_exempt
def read_store(_: HttpRequest, id: int):
"""Read data in the store."""
data = DataModel.objects.get(pk=id)
data.view_count += 1
data.save()
print(data)
return HttpResponse(data.content, content_type="application/json")
+31 -34
View File
@@ -21,17 +21,8 @@ x-common:
REDIS_URL: redis:6379 REDIS_URL: redis:6379
services: services:
# nginx:
# image: jwilder/nginx-proxy
# restart: unless-stopped
# networks:
# - web
# ports:
# - "127.0.1.1:80:80"
# volumes:
# - /var/run/docker.sock:/tmp/docker.sock:ro
website: website:
image: marcpartensky/website
environment: environment:
<<: *website <<: *website
<<: *postgres <<: *postgres
@@ -114,32 +105,38 @@ services:
networks: networks:
- web - web
website-test: # website-test:
environment: # environment:
<<: *website # <<: *website
<<: *postgres # <<: *postgres
<<: *redis # <<: *redis
VIRTUAL_HOST: website.dev # VIRTUAL_HOST: website.dev
build: # build:
context: . # context: .
dockerfile: ./Dockerfile # dockerfile: ./Dockerfile
working_dir: /app # working_dir: /app
entrypoint: /app/entrypoint.sh # entrypoint: /app/entrypoint.sh
command: 80 0.0.0.0 # command: 80 0.0.0.0
volumes: # volumes:
- ".:/app" # - ".:/app"
# networks:
# - web
# - caddy
# healthcheck:
# test: ["CMD", "curl", "-fs", "http://website:80/robots.txt"]
# interval: 1m30s
# timeout: 10s
# retries: 3
# start_period: 40s
# labels:
# - "caddy=test.marcpartensky.com"
# - "caddy.reverse_proxy={{upstreams http 80}}"
test:
image: jwilder/dockerize
networks: networks:
- web - web
- caddy command: -wait http://website:8080/healthcheck -timeout 120s -wait-retry-interval 5s
healthcheck:
test: ["CMD", "curl", "-fs", "http://website:80/robots.txt"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
labels:
- "caddy=test.marcpartensky.com"
- "caddy.reverse_proxy={{upstreams http 80}}"
networks: networks:
web: web:
+6 -4
View File
@@ -1,19 +1,20 @@
from django.contrib import admin from django.contrib import admin
from django.contrib.auth import views as auth_views from django.contrib.auth import views as auth_views
from django.http import HttpResponse
from django.urls import path, include from django.urls import path, include
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static from django.conf.urls.static import static
from django.core.exceptions import ViewDoesNotExist from django.core.exceptions import ViewDoesNotExist
# def response_error_handler(request, exception=None):
# raise HttpResponse('<div class="tenor-gif-embed" data-postid="5094560" data-share-method="host" data-width="100%" data-aspect-ratio="1.7543859649122806"><a href="https://tenor.com/view/elmo-shrug-gif-5094560">Elmo Shrug GIF</a> from <a href="https://tenor.com/search/elmo-gifs">Elmo GIFs</a></div><script type="text/javascript" async src="https://tenor.com/embed.js"></script>', status=404)
def not_found_view(request): def not_found_view(request):
raise ViewDoesNotExist raise ViewDoesNotExist
def healthcheck(request):
return HttpResponse(content="Ok")
urlpatterns = [ urlpatterns = [
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
# path('users/login/', auth_views.LoginView.as_view()), # path('users/login/', auth_views.LoginView.as_view()),
@@ -43,6 +44,7 @@ urlpatterns = [
# path('accounts/', include('allauth.urls')), # path('accounts/', include('allauth.urls')),
path("mdeditor/", include("mdeditor.urls")), path("mdeditor/", include("mdeditor.urls")),
path("404/", not_found_view, name="404"), path("404/", not_found_view, name="404"),
path("live", healthcheck, name="healthcheck"),
path("business/", include("business.urls")), path("business/", include("business.urls")),
path("avatar/", include("avatar.urls")), path("avatar/", include("avatar.urls")),
path("robots.txt", include("robots.urls")), path("robots.txt", include("robots.urls")),
+3 -2
View File
@@ -3,13 +3,13 @@ x-common:
website: website:
&website &website
DJANGO_SETTINGS_MODULE: django_project.settings DJANGO_SETTINGS_MODULE: django_project.settings
SECRET_KEY: "${openssl rand -base64 64}" SECRET_KEY: "$${openssl rand -base64 64}"
FTP_URL: 0.0.0.0:21 FTP_URL: 0.0.0.0:21
postgres: postgres:
&postgres &postgres
POSTGRES_NAME: website POSTGRES_NAME: website
POSTGRESQL_USER: root POSTGRESQL_USER: root
POSTGRES_PASSWORD: "${openssl rand -base64 64}" POSTGRES_PASSWORD: "$${openssl rand -base64 64}"
POSTGRES_HOST: postgres POSTGRES_HOST: postgres
POSTGRES_PORT: 5432 POSTGRES_PORT: 5432
redis: redis:
@@ -18,6 +18,7 @@ x-common:
services: services:
website: website:
image: docker.io/marcpartensky/website:latest
environment: environment:
<<: *website <<: *website
<<: *postgres <<: *postgres
+31 -8
View File
@@ -1,16 +1,39 @@
#!/bin/sh #!/bin/sh
port=${1:-$PORT} port=${1:-$PORT}
addr=${2:-$ADDR} host=${2:-$HOST}
port=${port:-"80"} port=${port:-"80"}
addr=${addr:-"127.0.0.1"} host=${addr:-"0.0.0.0"}
username=${DJANGO_SUPERUSER_USERNAME:-"admin"} username=${DJANGO_SUPERUSER_USERNAME:-"admin"}
email=${DJANGO_SUPERUSER_EMAIL:-"admin@admin.com"} email=${DJANGO_SUPERUSER_EMAIL:-"admin@admin.com"}
DJANGO_SUPERUSER_PASSWORD=${PASSWORD:-$(date +%s | sha256sum | base64 | head -c 32)} DJANGO_SUPERUSER_PASSWORD=${PASSWORD:-$(date +%s | sha256sum | base64 | head -c 32)}
echo -e "Running \033[1mentrypoint.sh\033[0m using $ADDR:$PORT" _kill() {
./manage.py migrate kill $(cat /tmp/website.pid)
echo -e "Creating \033[1msuper user\033[0m using:\n - username: \033[1m$username\033[0m\n - email: \033[1m$email\033[0m\n" }
./manage.py createsuperuser --user $username --email $email --noinput
./manage.py collecstatic --noinput --clear if [ $1 = "kill" ]; then
daphne django_project.asgi:application --port $port --bind $addr -v2 _kill
exit 0
fi
echo $$ > /tmp/website.pid
setup() {
echo -e "Running \033[1mentrypoint.sh\033[0m using $HOST:$PORT"
./manage.py migrate
echo -e "Creating \033[1msuper user\033[0m using:\n - username: \033[1m$username\033[0m\n - email: \033[1m$email\033[0m\n"
./manage.py createsuperuser --user $username --email $email --noinput
./manage.py collectstatic --noinput --clear
}
if [[ ! -z $NOSETUP && ! $1 = "--nosetup" ]]; then
setup
fi
# dev vs prod
if [ -z $PRODUCTION ]; then
daphne django_project.asgi:application --port $port --bind $host -v2
else
./manage.py runserver 127.0.0.1:8000
fi
Binary file not shown.
Binary file not shown.
+24 -2
View File
@@ -1,3 +1,25 @@
from django.test import TestCase import os
import geckodriver_autoinstaller
# Create your tests here. from django.test import TestCase
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
class HomePageTestCase(TestCase):
def setUp(self):
"""Setup selenium."""
geckodriver_autoinstaller.install()
options = Options()
options.headless = True if os.environ.get("HEADLESS") != "False" else False
self.driver = webdriver.Firefox(options=options)
host = os.environ["HOST"]
port = os.environ["PORT"]
self.url = f"{host}:{port}"
def test_home_page_loads(self):
"""Animals that can speak are correctly identified"""
self.driver.get(self.url)
icon = self.driver.find_element_by_id("theme-img")
icon.click()
assert True
+55 -34
View File
@@ -173,9 +173,9 @@
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
}, },
"node_modules/is-core-module": { "node_modules/is-core-module": {
"version": "2.8.0", "version": "2.9.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz",
"integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==",
"dependencies": { "dependencies": {
"has": "^1.0.3" "has": "^1.0.3"
}, },
@@ -261,9 +261,9 @@
"integrity": "sha1-oSvbAQNoHosSapsHHrpMRnx4//4=" "integrity": "sha1-oSvbAQNoHosSapsHHrpMRnx4//4="
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "3.0.4", "version": "3.0.8",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==",
"dependencies": { "dependencies": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
}, },
@@ -272,9 +272,9 @@
} }
}, },
"node_modules/minimist": { "node_modules/minimist": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
}, },
"node_modules/miniq": { "node_modules/miniq": {
"version": "1.0.1", "version": "1.0.1",
@@ -386,12 +386,16 @@
} }
}, },
"node_modules/resolve": { "node_modules/resolve": {
"version": "1.20.0", "version": "1.22.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz",
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==",
"dependencies": { "dependencies": {
"is-core-module": "^2.2.0", "is-core-module": "^2.8.1",
"path-parse": "^1.0.6" "path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
},
"bin": {
"resolve": "bin/resolve"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
@@ -453,6 +457,17 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/supports-preserve-symlinks-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/through2": { "node_modules/through2": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz",
@@ -483,9 +498,9 @@
} }
}, },
"node_modules/uglify-js": { "node_modules/uglify-js": {
"version": "3.14.5", "version": "3.15.5",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.5.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.5.tgz",
"integrity": "sha512-qZukoSxOG0urUTvjc2ERMTcAy+BiFh3weWAkeurLwjrCba73poHmG3E36XEjd/JGukMzwTL7uCxZiAexj8ppvQ==", "integrity": "sha512-hNM5q5GbBRB5xB+PMqVRcgYe4c8jbyZ1pzZhS6jbq54/4F2gFK869ZheiE5A8/t+W5jtTNpWef/5Q9zk639FNQ==",
"optional": true, "optional": true,
"bin": { "bin": {
"uglifyjs": "bin/uglifyjs" "uglifyjs": "bin/uglifyjs"
@@ -727,9 +742,9 @@
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
}, },
"is-core-module": { "is-core-module": {
"version": "2.8.0", "version": "2.9.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz",
"integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==",
"requires": { "requires": {
"has": "^1.0.3" "has": "^1.0.3"
} }
@@ -797,17 +812,17 @@
"integrity": "sha1-oSvbAQNoHosSapsHHrpMRnx4//4=" "integrity": "sha1-oSvbAQNoHosSapsHHrpMRnx4//4="
}, },
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.8",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==",
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"minimist": { "minimist": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
}, },
"miniq": { "miniq": {
"version": "1.0.1", "version": "1.0.1",
@@ -920,12 +935,13 @@
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
}, },
"resolve": { "resolve": {
"version": "1.20.0", "version": "1.22.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz",
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==",
"requires": { "requires": {
"is-core-module": "^2.2.0", "is-core-module": "^2.8.1",
"path-parse": "^1.0.6" "path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
} }
}, },
"safe-buffer": { "safe-buffer": {
@@ -961,6 +977,11 @@
"ansi-regex": "^5.0.1" "ansi-regex": "^5.0.1"
} }
}, },
"supports-preserve-symlinks-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="
},
"through2": { "through2": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz",
@@ -990,9 +1011,9 @@
} }
}, },
"uglify-js": { "uglify-js": {
"version": "3.14.5", "version": "3.15.5",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.5.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.5.tgz",
"integrity": "sha512-qZukoSxOG0urUTvjc2ERMTcAy+BiFh3weWAkeurLwjrCba73poHmG3E36XEjd/JGukMzwTL7uCxZiAexj8ppvQ==", "integrity": "sha512-hNM5q5GbBRB5xB+PMqVRcgYe4c8jbyZ1pzZhS6jbq54/4F2gFK869ZheiE5A8/t+W5jtTNpWef/5Q9zk639FNQ==",
"optional": true "optional": true
}, },
"util-deprecate": { "util-deprecate": {
+86 -71
View File
@@ -8,87 +8,92 @@
-i https://pypi.org/simple -i https://pypi.org/simple
aioredis==1.3.1 aioredis==1.3.1
appdirs==1.4.4 appdirs==1.4.4
appnope==0.1.2 appnope==0.1.3
arrow==1.2.1 arrow==1.2.2
asgiref==3.4.1 asgiref==3.5.2
astroid==2.6.6 astroid==2.11.5
async-timeout==4.0.1 async-generator==1.10; python_version >= '3.5'
attrs==21.2.0 async-timeout==4.0.2
autobahn==21.11.1 attrs==21.4.0
autobahn==22.4.2
automat==20.2.0 automat==20.2.0
backcall==0.2.0 backcall==0.2.0
backports.zoneinfo==0.2.1; python_version < '3.9' backports.zoneinfo==0.2.1; python_version < '3.9'
blessed==1.19.0 blessed==1.19.1
boto3==1.20.23 boto3==1.23.6
botocore==1.23.23 botocore==1.26.6
certifi==2021.10.8 bpyutils==0.5.2
certifi==2022.5.18.1
cffi==1.15.0 cffi==1.15.0
channels-redis==3.3.1 channels-redis==3.4.0
channels==3.0.4 channels==3.0.4
chardet==4.0.0 chardet==4.0.0
charset-normalizer==2.0.9; python_version >= '3' charset-normalizer==2.0.12; python_version >= '3'
click==8.0.3 click==8.1.3
colorama==0.4.4 colorama==0.4.4
commonmark==0.9.1 commonmark==0.9.1
constantly==15.1.0 constantly==15.1.0
coverage==6.2 coverage==6.4
cryptography==36.0.0 cryptography==37.0.2
daphne==3.0.2 daphne==3.0.2
decorator==5.1.0 decorator==5.1.1
defusedxml==0.7.1 defusedxml==0.7.1
dill==0.3.5.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'
dj-database-url==0.5.0 dj-database-url==0.5.0
django-503==0.1 django-503==0.1
django-admin==2.0.1 django-admin==2.0.1
django-allauth==0.47.0 django-allauth==0.50.0
django-appconf==1.0.5 django-appconf==1.0.5
django-avatar==5.0.0 django-avatar==5.0.0
django-compressor==3.0 django-compressor==4.0
django-cors-middleware==1.5.0 django-cors-middleware==1.5.0
django-crispy-forms==1.13.0 django-crispy-forms==1.14.0
django-excel-base==1.0.4 django-excel-base==1.0.4
django-excel-response2==3.0.2 django-excel-response2==3.0.2
django-extensions==3.1.5 django-extensions==3.1.5
django-ftpserver==0.7.0 django-ftpserver==0.8.0
django-heroku==0.3.1 django-heroku==0.3.1
django-jsonfield-backport==1.0.4 django-jsonfield-backport==1.0.5
django-libsass==0.9 django-libsass==0.9
django-markdown-view==0.0.4 django-markdown-view==0.0.5
django-mdeditor==0.1.18 django-mdeditor==0.1.20
django-picklefield==3.0.1 django-picklefield==3.0.1
django-q==1.3.9 django-q==1.3.9
django-rename-app==0.1.3 django-rename-app==0.1.3
django-robots==4.0 django-robots==5.0
django-shortuuidfield==0.1.3 django-shortuuidfield==0.1.3
django-six==1.0.4 django-six==1.0.4
django-sql-explorer==2.3 django-sql-explorer==2.4.1
django-storages==1.12.3 django-storages==1.12.3
django==3.2.10 django==3.2.13
djangorestframework==3.13.0 djangorestframework==3.13.1
docopt==0.6.2 docopt==0.6.2
docutils==0.18.1 docutils==0.18.1
flake8==3.9.2 flake8==3.9.2
future==0.18.2 future==0.18.2
graphviz==0.19.1 geckodriver-autoinstaller==0.1.0
graphviz==0.20
gunicorn==20.1.0 gunicorn==20.1.0
h11==0.13.0; python_version >= '3.6'
h2==4.1.0 h2==4.1.0
hiredis==2.0.0 hiredis==2.0.0
hpack==4.0.0 hpack==4.0.0
hyperframe==6.0.1 hyperframe==6.0.1
hyperlink==21.0.0 hyperlink==21.0.0
idna==3.3 idna==3.3
importlib-metadata==4.8.2 importlib-metadata==4.11.4
incremental==21.3.0 incremental==21.3.0
ipython-genutils==0.2.0 ipython-genutils==0.2.0
ipython==7.30.1 ipython==7.33.0
isort==5.10.1 isort==5.10.1
jedi==0.18.1 jedi==0.18.1
jeepney==0.7.1 jeepney==0.8.0
jmespath==0.10.0 jmespath==1.0.0
keyring==23.4.0 keyring==23.5.1
keyrings.alt==3.2.0 keyrings.alt==3.2.0
lazy-object-proxy==1.6.0 lazy-object-proxy==1.7.1
libsass==0.21.0 libsass==0.21.0
markdown==3.2.2 markdown==3.3.7
matplotlib-inline==0.1.3; python_version >= '3.5' matplotlib-inline==0.1.3; python_version >= '3.5'
mccabe==0.6.1 mccabe==0.6.1
mock==4.0.3 mock==4.0.3
@@ -96,23 +101,25 @@ msgpack-python==0.5.6
msgpack==1.0.3 msgpack==1.0.3
mypy-extensions==0.4.3 mypy-extensions==0.4.3
nose==1.3.7 nose==1.3.7
oauthlib==3.1.1 oauthlib==3.2.0
outcome==1.1.0; python_version >= '3.6'
packaging==21.3; python_version >= '3.6' packaging==21.3; python_version >= '3.6'
parso==0.8.3 parso==0.8.3
pathspec==0.9.0 pathspec==0.9.0
pexpect==4.8.0 pexpect==4.8.0
pickleshare==0.7.5 pickleshare==0.7.5
pillow==8.4.0 pillow==9.1.1
pip-autoremove==0.10.0 pip-autoremove==0.10.0
pip-conflict-checker==0.6.0 pip-conflict-checker==0.6.0
pip-review==1.1.0 pip-review==1.1.1
pip==21.3.1; python_version >= '3.6' pip==22.1.1; python_version >= '3.7'
pipdeptree==2.2.0 pipdeptree==2.2.1
pipupgrade==1.11.0 pipupgrade==1.12.0
platformdirs==2.5.2; python_version >= '3.7'
priority==2.0.0 priority==2.0.0
prompt-toolkit==3.0.24 prompt-toolkit==3.0.29
psycopg2-binary==2.9.2 psycopg2-binary==2.9.3
psycopg2==2.9.2; python_version >= '3.6' psycopg2==2.9.3; python_version >= '3.6'
ptyprocess==0.7.0 ptyprocess==0.7.0
pyasn1-modules==0.2.8 pyasn1-modules==0.2.8
pyasn1==0.4.8 pyasn1==0.4.8
@@ -120,46 +127,54 @@ pycodestyle==2.7.0
pycparser==2.21 pycparser==2.21
pyflakes==2.3.1 pyflakes==2.3.1
pyftpdlib==1.5.6 pyftpdlib==1.5.6
pygments==2.10.0 pygments==2.12.0
pyhamcrest==2.0.3 pyhamcrest==2.0.3
pyjwt==2.3.0 pyjwt==2.4.0
pylint==3.0.0a4 pylint==2.13.9
pyopenssl==21.0.0 pyopenssl==22.0.0
pyparsing==3.0.6 pyparsing==3.0.9
pysocks==1.7.1
python-dateutil==2.8.2 python-dateutil==2.8.2
python-dotenv==0.19.2 python-dotenv==0.20.0
python3-openid==3.2.0 python3-openid==3.2.0
pytz-deprecation-shim==0.1.0.post0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' pytz-deprecation-shim==0.1.0.post0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'
pytz==2021.3 pytz==2022.1
pyyaml==6.0 pyyaml==6.0
rcssmin==1.1.0 rcssmin==1.1.0
redis==3.5.3 redis==3.5.3
regex==2021.11.10 regex==2022.4.24
requests-oauthlib==1.3.0 requests-oauthlib==1.3.1
requests==2.26.0 requests==2.27.1
rich==10.16.0 rich==12.4.4
rjsmin==1.2.0 rjsmin==1.2.0
s3transfer==0.5.0 s3transfer==0.5.2
screen==1.0.1 screen==1.0.1
secretstorage==3.3.1 secretstorage==3.3.2
selenium==4.1.5
service-identity==21.1.0 service-identity==21.1.0
setuptools==59.6.0; python_version >= '3.6' setuptools==62.3.2; python_version >= '3.7'
shortuuid==1.0.8 shortuuid==1.0.9
six==1.16.0 six==1.16.0
sniffio==1.2.0; python_version >= '3.5'
sortedcontainers==2.4.0
sqlparse==0.4.2 sqlparse==0.4.2
toml==0.10.2 toml==0.10.2
traitlets==5.1.1 tomli==2.0.1; python_version < '3.11'
twisted==21.7.0 traitlets==5.2.1.post0
txaio==21.2.1 trio-websocket==0.9.2; python_version >= '3.5'
typed-ast==1.4.3 trio==0.20.0; python_version >= '3.7'
typing-extensions==4.0.1 twisted==22.4.0
tzdata==2021.5; python_version >= '3.6' txaio==22.2.1
tzlocal==4.1 typed-ast==1.5.4
urllib3==1.26.7 typing-extensions==4.2.0
tzdata==2022.1; python_version >= '3.6'
tzlocal==4.2
urllib3==1.26.9
wcwidth==0.2.5 wcwidth==0.2.5
whitenoise==5.3.0 whitenoise==6.1.0
wrapt==1.12.1 wrapt==1.14.1
wsproto==1.1.0; python_version >= '3.7'
xlwt==1.3.0 xlwt==1.3.0
yarg==0.1.9 yarg==0.1.9
zipp==3.6.0 zipp==3.8.0
zope.interface==5.4.0 zope.interface==5.4.0
-32
View File
@@ -27,21 +27,6 @@ django() {
pipenv run daphne -e "ssl:${PORT}:privateKey=${KEY}:certKey=${CERT}" django_project.asgi:application pipenv run daphne -e "ssl:${PORT}:privateKey=${KEY}:certKey=${CERT}" django_project.asgi:application
} }
alias run=django
up() {
postgres
redis
django
}
down() {
docker-compose down
echo -e "Ended \e[31mRedis\e[0m"
echo -e "Ended \e[31mPostgreSQL\e[0m"
kill % && echo -e "Ended \e[31mDjango\e[0m" && echo -e "Ended \e[31mFTP\e[0m"
}
ftp() { ftp() {
echo -e "Starting \e[92mFTP Server\e[0m" echo -e "Starting \e[92mFTP Server\e[0m"
pipenv run ./manage.py ftpserver $FTP_URL pipenv run ./manage.py ftpserver $FTP_URL
@@ -53,23 +38,6 @@ all() {
down down
} }
# build the project for docker
build() {
pipenv run ./manage.py collectstatic --noinput
docker build . -t marcpartensky/website
docker push marcpartensky/website
git pull --all
git push -ll
}
deploy() {
pipenv run ./manage.py collectstatic --noinput
pipenv run ./manage.py makemigrations
pipenv run ./manage.py migrate
run
}
updatepip() { updatepip() {
git pull git pull
pipenv run pip install -U pip pipenv run pip install -U pip