generated from ddev/ddev-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from julienloizelet/feat/kasmvnc
Feat/kasmvnc
- Loading branch information
Showing
26 changed files
with
410 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
#ddev-generated | ||
# Remove the line above if you don't want this file to be overwritten when you run | ||
# ddev get julienloizelet/ddev-playwright | ||
# | ||
# This file comes from https://github.com/julienloizelet/ddev-playwright | ||
# | ||
cd /var/www/html || exit 1 | ||
cd "${PLAYWRIGHT_TEST_DIR}" || exit 1 | ||
|
||
export PLAYWRIGHT_BROWSERS_PATH=0 | ||
PRE="sudo -u pwuser PLAYWRIGHT_BROWSERS_PATH=0 " | ||
|
||
$PRE yarn playwright "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
#ddev-generated | ||
# Remove the line above if you don't want this file to be overwritten when you run | ||
# ddev get julienloizelet/ddev-playwright | ||
# | ||
# This file comes from https://github.com/julienloizelet/ddev-playwright | ||
# | ||
cd /var/www/html || exit 1 | ||
cd "${PLAYWRIGHT_TEST_DIR}" || exit 1 | ||
|
||
export PLAYWRIGHT_BROWSERS_PATH=0 | ||
PRE="sudo -u pwuser PLAYWRIGHT_BROWSERS_PATH=0 " | ||
|
||
$PRE yarn install | ||
$PRE yarn playwright install --with-deps | ||
# Conditionally copy an .env file if an example file exists | ||
[ -f .env.example ] && [ ! -f .env ] && $PRE cp -n .env.example .env; exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#ddev-generated | ||
# Remove the line above if you don't want this file to be overwritten when you run | ||
# ddev get julienloizelet/ddev-playwright | ||
# | ||
# This file comes from https://github.com/julienloizelet/ddev-playwright | ||
# | ||
# If on arm64 machine, edit to use mcr.microsoft.com/playwright:focal-arm64 | ||
FROM mcr.microsoft.com/playwright:focal | ||
|
||
# Debian images by default disable apt caching, so turn it on until we finish | ||
# the build. | ||
RUN mv /etc/apt/apt.conf.d/docker-clean /etc/apt/docker-clean-disabled | ||
|
||
USER root | ||
|
||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ | ||
--mount=type=cache,target=/var/lib/apt,sharing=locked \ | ||
apt-get update \ | ||
&& apt-get install -y sudo | ||
|
||
# Give the pwuser user full `sudo` privileges | ||
RUN echo "pwuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/pwuser \ | ||
&& chmod 0440 /etc/sudoers.d/pwuser | ||
|
||
# CAROOT for `mkcert` to use, has the CA config | ||
ENV CAROOT=/mnt/ddev-global-cache/mkcert | ||
|
||
# Install the correct architecture binary of `mkcert` | ||
RUN export TARGETPLATFORM=linux/$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') && mkdir -p /usr/local/bin && curl --fail -JL -s -o /usr/local/bin/mkcert "https://dl.filippo.io/mkcert/latest?for=${TARGETPLATFORM}" | ||
RUN chmod +x /usr/local/bin/mkcert | ||
|
||
|
||
# Install a window manager. | ||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ | ||
--mount=type=cache,target=/var/lib/apt,sharing=locked \ | ||
apt-get update \ | ||
&& apt-get install -y icewm xauth | ||
|
||
# Install kasmvnc for remote access. | ||
RUN /bin/bash -c 'if [ $(arch) == "aarch64" ]; then KASM_ARCH=arm64; else KASM_ARCH=amd64; fi; wget https://github.com/kasmtech/KasmVNC/releases/download/v1.1.0/kasmvncserver_bullseye_1.1.0_${KASM_ARCH}.deb' | ||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ | ||
--mount=type=cache,target=/var/lib/apt,sharing=locked \ | ||
apt-get install -y ./kasmvncserver*.deb | ||
|
||
# We're done with apt so disable caching again for the final image. | ||
RUN mv /etc/apt/docker-clean-disabled /etc/apt/apt.conf.d/docker-clean | ||
|
||
# prepare KasmVNC | ||
RUN sudo -u pwuser mkdir /home/pwuser/.vnc | ||
COPY kasmvnc.yaml xstartup /home/pwuser/.vnc/ | ||
RUN chown pwuser:pwuser /home/pwuser/.vnc/* | ||
RUN sudo -u pwuser touch /home/pwuser/.vnc/.de-was-selected | ||
RUN sudo -u pwuser /bin/bash -c 'echo -e "secret\nsecret\n" | kasmvncpasswd -wo -u pwuser' # We actually disable auth, but KASM complains without it | ||
|
||
|
||
COPY entrypoint.sh /root/entrypoint.sh | ||
ENTRYPOINT "/root/entrypoint.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# This file exists just to aid with local debugging | ||
services: | ||
dummy_playwright: | ||
build: | ||
context: . | ||
environment: | ||
- PLAYWRIGHT_TEST_DIR=tests/Playwright | ||
- NETWORK_IFACE=eth0 | ||
- DISPLAY=:1 | ||
- VIRTUAL_HOST=$DDEV_HOSTNAME | ||
- HTTP_EXPOSE=8443:8444,9323:9324 | ||
- HTTPS_EXPOSE=8444:8444,9324:9324 | ||
- DDEV_UID=1000 | ||
- DDEV_GID=1000 | ||
command: tail -F anything | ||
# command: | | ||
# tail -F foo | ||
# printenv | ||
# sudo usermod -u ${DDEV_UID} pwuser | ||
# sudo groupmod -g ${DDEV_GID} pwuser | ||
# sudo chgrp -R ${DDEV_GID} /etc/ssl/private | ||
# mkcert -install | ||
# vncserver -fg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
#ddev-generated | ||
# Remove the line above if you don't want this file to be overwritten when you run | ||
# ddev get julienloizelet/ddev-playwright | ||
# | ||
# This file comes from https://github.com/julienloizelet/ddev-playwright | ||
# | ||
|
||
# Change pwuser IDs to the host IDs supplied by DDEV | ||
usermod -u ${DDEV_UID} pwuser | ||
groupmod -g ${DDEV_GID} pwuser | ||
usermod -a -G ssl-cert pwuser | ||
|
||
# Install DDEV certificate | ||
mkcert -install | ||
|
||
# Run CMD from parameters as pwuser | ||
sudo -u pwuser vncserver -fg -disableBasicAuth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ddev-generated | ||
# Remove the line above if you don't want this file to be overwritten when you run | ||
# ddev get julienloizelet/ddev-playwright | ||
# | ||
# This file comes from https://github.com/julienloizelet/ddev-playwright | ||
# | ||
logging: | ||
log_writer_name: all | ||
log_dest: syslog | ||
level: 100 | ||
|
||
network: | ||
ssl: | ||
require_ssl: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
#ddev-generated | ||
# Remove the line above if you don't want this file to be overwritten when you run | ||
# ddev get julienloizelet/ddev-playwright | ||
# | ||
# This file comes from https://github.com/julienloizelet/ddev-playwright | ||
# | ||
|
||
export DISPLAY=:1 | ||
|
||
unset SESSION_MANAGER | ||
unset DBUS_SESSION_BUS_ADDRESS | ||
OS=`uname -s` | ||
if [ $OS = 'Linux' ]; then | ||
case "$WINDOWMANAGER" in | ||
*gnome*) | ||
if [ -e /etc/SuSE-release ]; then | ||
PATH=$PATH:/opt/gnome/bin | ||
export PATH | ||
fi | ||
;; | ||
esac | ||
fi | ||
if [ -x /etc/X11/xinit/xinitrc ]; then | ||
exec /etc/X11/xinit/xinitrc | ||
fi | ||
if [ -f /etc/X11/xinit/xinitrc ]; then | ||
exec sh /etc/X11/xinit/xinitrc | ||
fi | ||
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources | ||
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & | ||
icewm-session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
BASEURL="https://ddev-playwright-test.ddev.site" | ||
|
||
PAGE_URL="/home.php" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
pw-browsers | ||
test-results | ||
.env | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"license": "MIT", | ||
"dependencies": { | ||
"@playwright/test": "^1.34.2", | ||
"dotenv": "^16.0.3" | ||
} | ||
} |
Oops, something went wrong.