Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e77d7c64e | ||
|
|
550419381a | ||
|
|
fc9f4cde3b | ||
|
|
3f2b863f5a | ||
|
|
8231096b4d | ||
|
|
87268abcc3 | ||
|
|
c67e613ba2 | ||
|
|
76985fa799 | ||
|
|
dae43435e4 | ||
|
|
ba7998c636 | ||
|
|
0ac6f00ef0 | ||
|
|
2bdc141e2d |
@@ -18,4 +18,3 @@ venv
|
||||
.travis.yml
|
||||
.gitignore
|
||||
.dockerignore
|
||||
requirements.txt
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
liberapay: marcpartensky
|
||||
patreon: marcpartensky
|
||||
github: marcpartensky
|
||||
custom:
|
||||
# - monero:43J2XmRtjDPRLD35UsYGH2AZamFBQz7dt4VdvZXVm3SuadTrvcoXUXBRUNHqukFte23Q5TWXqhbwaLJJgoVQzzbe2AJDANQ
|
||||
- https://paypal.me/marcpartensky
|
||||
- https://buymeacoffee.com/marcpartensky
|
||||
|
||||
@@ -4,7 +4,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
- "!master"
|
||||
# Publish `v1.2.3` tags as releases.
|
||||
tags:
|
||||
- v*
|
||||
@@ -33,13 +32,16 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build docker image
|
||||
- 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-to: type=local,dest=/tmp/buildx
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha
|
||||
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
|
||||
|
||||
@@ -3,7 +3,7 @@ name: Docker
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
- master
|
||||
# Publish `v1.2.3` tags as releases.
|
||||
tags:
|
||||
- v*
|
||||
@@ -18,23 +18,40 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install make
|
||||
run: sudo apt install make -y
|
||||
- name: Install Python3.7
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.7
|
||||
architecture: x64
|
||||
- name: make init
|
||||
run: make init
|
||||
- name: make update
|
||||
run: make update
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
uses: docker/setup-qemu-action@v1
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
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
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker images
|
||||
uses: docker/build-push-action@v3
|
||||
- name: Build and push
|
||||
id: push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: marcpartensky/website:latest
|
||||
|
||||
@@ -1,68 +1,44 @@
|
||||
FROM python:3.7.12 as builder
|
||||
|
||||
# Pre installations
|
||||
RUN apt update
|
||||
RUN apt install -y curl npm
|
||||
RUN pip install poetry
|
||||
|
||||
# Copy useful files
|
||||
FROM marcpartensky/paru:latest as builder
|
||||
RUN paru -Syyyu --noconfirm python-pipenv npm make
|
||||
USER root
|
||||
COPY . /opt/website
|
||||
WORKDIR /opt/website
|
||||
COPY pyproject.toml poetry.lock package.json package-lock.json ./
|
||||
|
||||
# Run updates
|
||||
RUN poetry update
|
||||
RUN poetry export -f requirements.txt --without-hashes --output requirements.txt
|
||||
RUN npm update
|
||||
RUN pipenv update
|
||||
RUN pipenv run ./manage.py collectstatic --noinput
|
||||
RUN npm install -g npm@latest
|
||||
RUN npm install
|
||||
|
||||
# Image of production
|
||||
FROM python:3.7.12-alpine
|
||||
ENV SECRET_KEY=whatever
|
||||
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
|
||||
|
||||
# Labels
|
||||
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"
|
||||
|
||||
# Install curl and stuff for pillow
|
||||
RUN apk add --update --virtual .tmp libffi-dev build-base linux-headers
|
||||
RUN apk add curl jpeg-dev zlib-dev
|
||||
|
||||
# Copy useful files
|
||||
WORKDIR /opt/website
|
||||
COPY website /opt/website/website
|
||||
COPY --from=builder /opt/website/requirements.txt ./
|
||||
COPY LICENSE ./
|
||||
COPY --from=builder /app /app
|
||||
WORKDIR /app
|
||||
|
||||
# No .pyo and easier debugging
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
# Install dependencies
|
||||
RUN pip install -U pip
|
||||
RUN pip install -r requirements.txt
|
||||
RUN ./website/manage.py makemigrations
|
||||
RUN ./website/manage.py collectstatic --noinput
|
||||
|
||||
RUN apk del .tmp
|
||||
|
||||
# Setup env vars for entrypoint.sh
|
||||
ENV PORT 80
|
||||
ENV HOST 0.0.0.0
|
||||
EXPOSE 80
|
||||
# EXPOSE 443
|
||||
|
||||
# Check health
|
||||
HEALTHCHECK --interval=30s \
|
||||
--timeout=10s \
|
||||
--start-period=1m \
|
||||
--retries=3 \
|
||||
CMD curl -sSf http://localhost:$PORT/live || exit 1
|
||||
CMD curl -sSf http://127.0.0.1:$PORT/live || exit 1
|
||||
|
||||
WORKDIR /opt/website/website
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||
# ENTRYPOINT ["daphne", "-e", "ssl:443:privateKey=$KEY:certKey=$CERT", "django_project.asgi:application"]
|
||||
|
||||
@@ -5,23 +5,26 @@ PRODUCTION=false
|
||||
.PHONY: start list build push setup update init test up down migrate brewstart brewstop dev prod clean deploy
|
||||
|
||||
start:
|
||||
poetry run ./website/entrypoint.sh --nosetup
|
||||
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:
|
||||
build: update
|
||||
docker-compose -f dev.yml build website
|
||||
push: build
|
||||
git pushall
|
||||
docker-compose -f dev.yml push website
|
||||
setup: init update start
|
||||
update:
|
||||
npm update
|
||||
npm audit fix || echo npm audit fix failed
|
||||
poetry export -o requirements.txt
|
||||
SECRET_KEY=secret poetry run ./website/manage.py collectstatic --noinput
|
||||
SECRET_KEY=secret poetry run ./website/manage.py makemigrations
|
||||
# pipenv lock --pre --clear
|
||||
pipenv update
|
||||
pipenv lock -r > requirements.txt
|
||||
SECRET_KEY=secret pipenv run ./manage.py collectstatic --noinput
|
||||
SECRET_KEY=secret pipenv run ./manage.py makemigrations
|
||||
init: .env
|
||||
pip install --user poetry
|
||||
poetry install --dev
|
||||
pip install --user pipenv
|
||||
pipenv install --dev
|
||||
npm install --save
|
||||
test:
|
||||
pipenv run ./manage.py test
|
||||
@@ -30,7 +33,7 @@ runtest:
|
||||
make test
|
||||
make kill
|
||||
kill:
|
||||
pipenv run ./website/entrypoint.sh kill
|
||||
pipenv run ./entrypoint.sh kill
|
||||
up: init
|
||||
docker-compose up -d
|
||||
down:
|
||||
|
||||
@@ -4,82 +4,161 @@ verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[packages]
|
||||
ansicon = "==1.89.0"
|
||||
arrow = "==1.2.2"
|
||||
asgiref = "==3.5.2"
|
||||
attrs = "==21.4.0"
|
||||
autobahn = "==22.4.2"
|
||||
blessed = "==1.19.1"
|
||||
certifi = "==2022.5.18.1"
|
||||
cffi = "==1.15.0"
|
||||
channels = "==3.0.4"
|
||||
charset-normalizer = "==2.0.12"
|
||||
commonmark = "==0.9.1"
|
||||
constantly = "==15.1.0"
|
||||
cryptography = "==37.0.2"
|
||||
daphne = "==3.0.2"
|
||||
defusedxml = "==0.7.1"
|
||||
dj-database-url = "==0.5.0"
|
||||
django-allauth = "==0.50.0"
|
||||
django-appconf = "==1.0.5"
|
||||
django-compressor = "==4.0"
|
||||
django-crispy-forms = "==1.14.0"
|
||||
django-extensions = "==3.1.5"
|
||||
django-ftpserver = "==0.8.0"
|
||||
django-heroku = "==0.3.1"
|
||||
django-jsonfield-backport = "==1.0.5"
|
||||
django-markdown-view = "==0.0.5"
|
||||
django-mdeditor = "==0.1.20"
|
||||
django-picklefield = "==3.0.1"
|
||||
django-q = "==1.3.9"
|
||||
django-robots = "==5.0"
|
||||
django-shortuuidfield = "==0.1.3"
|
||||
django-sql-explorer = "==2.4.1"
|
||||
django-storages = "==1.12.3"
|
||||
djangorestframework = "==3.13.1"
|
||||
hyperlink = "==21.0.0"
|
||||
idna = "==3.3"
|
||||
incremental = "==21.3.0"
|
||||
jinxed = "==1.2.0"
|
||||
oauthlib = "==3.2.2"
|
||||
psycopg2 = "==2.9.3"
|
||||
pyasn1-modules = "==0.2.8"
|
||||
pyasn1 = "==0.4.8"
|
||||
pycparser = "==2.21"
|
||||
pyftpdlib = "==1.5.6"
|
||||
python-dateutil = "==2.8.2"
|
||||
python-dotenv = "==0.20.0"
|
||||
python3-openid = "==3.2.0"
|
||||
pytz = "==2022.1"
|
||||
rcssmin = "==1.1.0"
|
||||
redis = "==3.5.3"
|
||||
requests-oauthlib = "==1.3.1"
|
||||
requests = "==2.27.1"
|
||||
rich = "==12.4.4"
|
||||
rjsmin = "==1.2.0"
|
||||
service-identity = "==21.1.0"
|
||||
shortuuid = "==1.0.9"
|
||||
six = "==1.16.0"
|
||||
sqlparse = "==0.4.2"
|
||||
twisted-iocpsupport = "==1.0.2"
|
||||
txaio = "==22.2.1"
|
||||
typing-extensions = "==4.2.0"
|
||||
tzdata = "==2022.1"
|
||||
urllib3 = "==1.26.9"
|
||||
wcwidth = "==0.2.5"
|
||||
whitenoise = "==6.1.0"
|
||||
"zope.interface" = "==5.4.0"
|
||||
Automat = "==20.2.0"
|
||||
Django = "==4.0.4"
|
||||
Markdown = "==3.3.7"
|
||||
Pillow = "==9.1.1"
|
||||
Pygments = "==2.12.0"
|
||||
PyJWT = "==2.4.0"
|
||||
pyOpenSSL = "==22.0.0"
|
||||
PyYAML = "==6.0"
|
||||
Twisted = "==22.4.0"
|
||||
aioredis = "*"
|
||||
appdirs = "*"
|
||||
appnope = "*"
|
||||
arrow = "*"
|
||||
asgiref = "*"
|
||||
astroid = "*"
|
||||
async-timeout = "*"
|
||||
attrs = "*"
|
||||
autobahn = "*"
|
||||
backcall = "*"
|
||||
blessed = "*"
|
||||
boto3 = "*"
|
||||
botocore = "*"
|
||||
certifi = "*"
|
||||
cffi = "*"
|
||||
channels = "*"
|
||||
channels-redis = "*"
|
||||
chardet = "*"
|
||||
click = "*"
|
||||
colorama = "*"
|
||||
commonmark = "*"
|
||||
constantly = "*"
|
||||
coverage = "*"
|
||||
cryptography = "*"
|
||||
daphne = "*"
|
||||
decorator = "*"
|
||||
defusedxml = "*"
|
||||
dj-database-url = "*"
|
||||
django-503 = "*"
|
||||
django-admin = "*"
|
||||
django-allauth = "*"
|
||||
django-appconf = "*"
|
||||
django-avatar = "*"
|
||||
django-compressor = "*"
|
||||
django-cors-middleware = "*"
|
||||
django-crispy-forms = "*"
|
||||
django-excel-base = "*"
|
||||
django-excel-response2 = "*"
|
||||
django-extensions = "*"
|
||||
django-ftpserver = "*"
|
||||
django-heroku = "*"
|
||||
django-jsonfield-backport = "*"
|
||||
django-libsass = "*"
|
||||
django-markdown-view = "*"
|
||||
django-mdeditor = "*"
|
||||
django-picklefield = "*"
|
||||
django-q = "*"
|
||||
django-rename-app = "*"
|
||||
django-shortuuidfield = "*"
|
||||
django-six = "*"
|
||||
django-sql-explorer = "*"
|
||||
django-storages = "*"
|
||||
djangorestframework = "*"
|
||||
docopt = "*"
|
||||
docutils = "*"
|
||||
flake8 = "*"
|
||||
future = "*"
|
||||
graphviz = "*"
|
||||
gunicorn = "*"
|
||||
h2 = "*"
|
||||
hiredis = "*"
|
||||
hpack = "*"
|
||||
hyperframe = "*"
|
||||
hyperlink = "*"
|
||||
idna = "*"
|
||||
importlib-metadata = "*"
|
||||
incremental = "*"
|
||||
ipython = "*"
|
||||
isort = "*"
|
||||
jedi = "*"
|
||||
jeepney = "*"
|
||||
jmespath = "*"
|
||||
keyring = "*"
|
||||
"keyrings.alt" = "==3.2.0"
|
||||
lazy-object-proxy = "*"
|
||||
libsass = "*"
|
||||
mccabe = "*"
|
||||
mock = "*"
|
||||
msgpack = "*"
|
||||
msgpack-python = "*"
|
||||
mypy-extensions = "*"
|
||||
nose = "*"
|
||||
oauthlib = "*"
|
||||
parso = "*"
|
||||
pathspec = "*"
|
||||
pexpect = "*"
|
||||
pickleshare = "*"
|
||||
pip-autoremove = "*"
|
||||
pip-conflict-checker = "*"
|
||||
pip-review = "*"
|
||||
pipdeptree = "*"
|
||||
pipupgrade = "*"
|
||||
priority = "*"
|
||||
prompt-toolkit = "*"
|
||||
psycopg2-binary = "*"
|
||||
ptyprocess = "*"
|
||||
pyasn1 = "*"
|
||||
pyasn1-modules = "*"
|
||||
pycodestyle = "*"
|
||||
pycparser = "*"
|
||||
pyflakes = "*"
|
||||
pyftpdlib = "*"
|
||||
pylint = "*"
|
||||
pyparsing = "*"
|
||||
python-dateutil = "*"
|
||||
python-dotenv = "*"
|
||||
python3-openid = "*"
|
||||
pytz = "*"
|
||||
rcssmin = "*"
|
||||
redis = "*"
|
||||
regex = "*"
|
||||
requests = "*"
|
||||
requests-oauthlib = "*"
|
||||
rich = "*"
|
||||
rjsmin = "*"
|
||||
s3transfer = "*"
|
||||
screen = "*"
|
||||
shortuuid = "*"
|
||||
six = "*"
|
||||
sqlparse = "*"
|
||||
toml = "*"
|
||||
traitlets = "*"
|
||||
txaio = "*"
|
||||
typed-ast = "*"
|
||||
typing-extensions = "*"
|
||||
tzlocal = "*"
|
||||
urllib3 = "*"
|
||||
wcwidth = "*"
|
||||
whitenoise = "*"
|
||||
wrapt = "*"
|
||||
xlwt = "*"
|
||||
yarg = "*"
|
||||
zipp = "*"
|
||||
"zope.interface" = "*"
|
||||
Automat = "*"
|
||||
Django = "*"
|
||||
ipython_genutils = "*"
|
||||
Markdown = "*"
|
||||
Pillow = "*"
|
||||
Pygments = "*"
|
||||
PyHamcrest = "*"
|
||||
PyJWT = "*"
|
||||
pyOpenSSL = "*"
|
||||
PyYAML = "*"
|
||||
SecretStorage = "*"
|
||||
service_identity = "*"
|
||||
Twisted = "*"
|
||||
django-robots = "*"
|
||||
selenium = "*"
|
||||
geckodriver-autoinstaller = "*"
|
||||
|
||||
[dev-packages]
|
||||
black = "*"
|
||||
jedi = "*"
|
||||
pylint = "*"
|
||||
|
||||
[requires]
|
||||
python_version = "3.10"
|
||||
python_version = "3.7.12"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
[](https://github.com/MarcPartensky/Website/actions/workflows/docker-push.yml)
|
||||
[](https://github.com/MarcPartensky/Website/actions/workflows/codeql-analysis.yml)
|
||||
<img src="https://img.shields.io/liberapay/goal/marcpartensky.svg?logo=liberapay">
|
||||
|
||||
# Website
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |