Skip to content
Open

V2 #28

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
27e1b48
removed old files
afdaniele Jul 11, 2021
65aff3c
moving to official json schemas, bootstrap 5, jquery 3.6
afdaniele Nov 12, 2021
bcb6a54
Merge remote-tracking branch 'origin/stable' into v2
afdaniele Nov 12, 2021
40e6de9
moving from ['success', 'data'] to exceptions
afdaniele Nov 13, 2021
69c1228
minor
afdaniele Nov 13, 2021
bcb19fb
bug fix
afdaniele Nov 13, 2021
85894e1
working on nugget functionality
afdaniele Nov 15, 2021
924862f
removed PHPMailer
afdaniele Nov 17, 2021
b3dd3b6
moved to PHP8.0, apache-bullseye, extensive work done on moving away …
afdaniele Nov 17, 2021
72af65f
working on REST API v2.0
afdaniele Nov 19, 2021
a657cf3
first working version of the new REST API v2.0
afdaniele Nov 19, 2021
280542c
added templates for API service/action definition
afdaniele Nov 19, 2021
c5839fe
added templates for API service/action definition
afdaniele Nov 19, 2021
5c66277
more work
afdaniele Nov 19, 2021
908529d
more work
afdaniele Nov 22, 2021
93d22fa
more work
afdaniele Nov 23, 2021
189e6ad
Merge remote-tracking branch 'origin/v2' into v2
afdaniele Nov 23, 2021
2eced00
fixed login as developer, ported profile page
afdaniele Nov 24, 2021
ef46681
removed old stuff, implemented users/groups pages, table viewer, pagi…
afdaniele Dec 31, 2021
f13e9e0
bug fix w/ PHP 8.1
afdaniele Jan 2, 2022
f636f95
implemented Package Store page using new UI
afdaniele Jan 2, 2022
52198be
minor
afdaniele Jan 3, 2022
0575470
added support for JSON body in API calls
afdaniele Feb 16, 2022
c8aacf2
improved schemas
afdaniele Feb 16, 2022
7689ce1
implemented Settings page with new graphics library
afdaniele Feb 16, 2022
3a0fb6e
worked on themes and icons for v2
afdaniele Feb 16, 2022
4d26c47
bumped bootstrap-icons 1.7.0 -> 1.8.1
afdaniele Feb 16, 2022
c74a073
improved schemas
afdaniele Feb 16, 2022
59023e0
bumped bootstrap icon lib; fixed page metadata schema
afdaniele Feb 17, 2022
cff4a0f
minor
afdaniele Feb 21, 2022
0818635
minor
afdaniele Feb 28, 2022
aaa99c2
added semaphore
afdaniele Mar 16, 2022
b616b59
added JS util declaring `Array.prototype.equals`
afdaniele Mar 20, 2022
6925d5d
bug fix
afdaniele Mar 21, 2022
0313055
minor
afdaniele Mar 26, 2022
88b16cc
added JS utility function `htmlToElement`
afdaniele Apr 4, 2022
2b97144
Merge branch 'v2' of github.com:afdaniele/compose into v2
afdaniele Apr 4, 2022
64024a0
bug fix in sidebar
afdaniele Jul 6, 2022
7f58b71
improvements
afdaniele Jul 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
83 changes: 32 additions & 51 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
ARG ARCH=amd64
ARG PHP_VERSION=7.0.31
ARG OS_DISTRO=stretch
ARG PHP_VERSION=8.1.1
ARG OS_DISTRO=bullseye
ARG COMPOSE_VERSION=stable
ARG GIT_REF=heads

FROM ${ARCH}/php:${PHP_VERSION}-apache-${OS_DISTRO}

# recover arguments
ARG ARCH
ARG PHP_VERSION
ARG OS_DISTRO
ARG GIT_REF
ARG COMPOSE_VERSION

# configure environment: system & libraries
ENV ARCH=${ARCH}
ENV PHP_VERSION=${PHP_VERSION}
ENV OS_DISTRO=${OS_DISTRO}
ENV ARCH=${ARCH} \
PHP_VERSION=${PHP_VERSION} \
OS_DISTRO=${OS_DISTRO} \
QEMU_EXECVE=1

# configure environment: \compose\
ENV APP_DIR "/var/www"
ENV COMPOSE_DIR "${APP_DIR}/html"
ENV COMPOSE_URL "https://github.com/afdaniele/compose.git"
ENV COMPOSE_USERDATA_DIR "/user-data"
ENV HTTP_PORT 80
ENV HTTPS_PORT 443
ENV SSL_DIR "${APP_DIR}/ssl"
ENV SSL_CERTFILE "${SSL_DIR}/certfile.pem"
ENV SSL_KEYFILE "${SSL_DIR}/privkey.pem"
ENV QEMU_EXECVE 1
ENV APP_DIR="/var/www"
ENV SSL_DIR="${APP_DIR}/ssl"
ENV COMPOSE_DIR="${APP_DIR}/html" \
COMPOSE_URL="https://github.com/afdaniele/compose" \
COMPOSE_USERDATA_DIR="/user-data" \
HTTP_PORT=80 \
HTTPS_PORT=443 \
SSL_CERTFILE="${SSL_DIR}/certfile.pem" \
SSL_KEYFILE="${SSL_DIR}/privkey.pem"

# copy QEMU
COPY ./assets/qemu/${ARCH}/ /usr/bin/
Expand All @@ -40,11 +38,6 @@ RUN apt-get update \
$(awk -F: '/^[^#]/ { print $1 }' /tmp/dependencies-apt.txt | uniq) \
&& rm -rf /var/lib/apt/lists/*

# install python dependencies
RUN pip3 install \
run-and-retry \
compose-cms==1.0.3

# install apcu
RUN pecl channel-update pecl.php.net \
&& pecl install apcu
Expand All @@ -63,49 +56,37 @@ COPY assets/usr/local/etc/php/conf.d/apcu.ini /usr/local/etc/php/conf.d/
COPY assets/usr/local/etc/php/conf.d/log_errors.ini /usr/local/etc/php/conf.d/

# remove pre-installed app
RUN rm -rf "${APP_DIR}"
RUN mkdir -p "${COMPOSE_DIR}"
RUN mkdir -p "${COMPOSE_USERDATA_DIR}"
RUN chown -R www-data:www-data "${APP_DIR}"
RUN chown -R www-data:www-data "${COMPOSE_USERDATA_DIR}"

# enable mod rewrite
RUN a2enmod rewrite
RUN rm -rf "${APP_DIR}" && \
mkdir -p "${COMPOSE_DIR}" && \
mkdir -p "${COMPOSE_USERDATA_DIR}" && \
chown -R www-data:www-data "${APP_DIR}" && \
chown -R www-data:www-data "${COMPOSE_USERDATA_DIR}"

# enable mod ssl
RUN a2enmod ssl
# enable modules: rewrite, ssl
RUN a2enmod rewrite && \
a2enmod ssl

# update website configuration file
COPY assets/etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf
COPY assets/etc/apache2/sites-available/000-default-ssl.conf /etc/apache2/sites-available/000-default-ssl.conf

# enable HTTP website
RUN a2ensite 000-default

# disable (default) HTTPS website
RUN a2dissite 000-default-ssl
# by default, we enable HTTP website and disable HTTPS
RUN a2ensite 000-default && \
a2dissite 000-default-ssl

# switch to simple user
USER www-data

# copy SHA of the current commit. This has two effects:
# - stores the SHA of the commit from which the image was built
# - correct the issue with docker cache due to git clone command below
COPY .git/refs/${GIT_REF}/${COMPOSE_VERSION} /compose.builder.version.sha
# install python library
RUN pip3 install compose-cms==1.0.5

# install \compose\
RUN rretry \
--min 40 \
--max 120 \
--tries 3 \
--on-retry "rm -rf ${COMPOSE_DIR}" \
--verbose \
-- \
git clone -b stable "${COMPOSE_URL}" "${COMPOSE_DIR}"
ADD --chown=www-data:www-data . "${COMPOSE_DIR}"

# fetch tags and checkout the wanted version
RUN git -C "${COMPOSE_DIR}" fetch --tags
RUN git -C "${COMPOSE_DIR}" checkout "${COMPOSE_VERSION}"
RUN git -C "${COMPOSE_DIR}" remote set-url origin "${COMPOSE_URL}" && \
git -C "${COMPOSE_DIR}" fetch --tags && \
git -C "${COMPOSE_DIR}" checkout "${COMPOSE_VERSION}"

# switch back to root
USER root
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ JENKINS_BRANCH=$(lastword $(subst /, ,${GIT_BRANCH}))

HEAD_TAG=$(shell git describe --exact-match --tags HEAD 2> /dev/null || :)
LATEST_TAG=$(shell git tag | tail -1)
GIT_REF=$(shell [ "${HEAD_TAG}" = "" ] && echo "remotes/origin" || echo "tags")
HEAD_NAME=$(shell [ "${HEAD_TAG}" = "" ] && git rev-parse --abbrev-ref HEAD || echo "${HEAD_TAG}")
VERSION=$(shell [ "${HEAD_NAME}" = "HEAD" ] && echo "${JENKINS_BRANCH}" || echo "${HEAD_NAME}")
TAG=$(shell [ "${HEAD_TAG}" = "${LATEST_TAG}" ] && echo "latest" || echo "${VERSION}")
Expand Down Expand Up @@ -39,7 +38,6 @@ build:
-f "${DOCKERFILE}" \
--build-arg ARCH=${ARCH} \
--build-arg COMPOSE_VERSION=${COMPOSE_VERSION} \
--build-arg GIT_REF=${GIT_REF} \
--build-arg BASE_VERSION=${BASE_VERSION} \
./

Expand Down
6 changes: 4 additions & 2 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ Things to add later in the development:


[ ] - v2.0
[ ] - switch to Bootstrap 4.X
[ ] - replace JSON with ProtoBuf
[ ] - switch to Bootstrap 5.X
[ ] - use proper JSON schemas
[ ] - use https://github.com/eclipsesource/jsonforms instead of custom form libraries
[ ] - remove all non-MIT libraries

[ ] - v1.1
[ ] - allow the specification of auxiliary libraries to load for specific pages in the page metadata file
Expand Down
34 changes: 0 additions & 34 deletions dependencies.json

This file was deleted.

3 changes: 3 additions & 0 deletions public_html/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?__arg__=$1 [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^nugget/(.*)$ nugget.php?__arg__=$1 [QSA,NC,L]

</IfModule>
49 changes: 0 additions & 49 deletions public_html/css/bootstrap-callout.css

This file was deleted.

Loading