-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
177 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set outputs | ||
id: sha | ||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- name: docker login | ||
env: | ||
DOCKER_USER: ${{secrets.DOCKER_USER}} | ||
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | ||
run: | | ||
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | ||
- name: Build the Docker image | ||
run: docker build . --file dockerfile --tag ${{secrets.DOCKER_USER}}/${{ github.event.repository.name }} --tag ${{secrets.DOCKER_USER}}/${{ github.event.repository.name }}:${{ steps.sha.outputs.sha_short }} | ||
|
||
- name: Docker Push SHA | ||
run: docker push ${{secrets.DOCKER_USER}}/${{ github.event.repository.name }}:${{ steps.sha.outputs.sha_short }} | ||
- name: Docker Push Main | ||
run: docker push ${{secrets.DOCKER_USER}}/${{ github.event.repository.name }} | ||
|
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 @@ | ||
2024.3.1.2 |
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,36 @@ | ||
ARG BASE_TAG="develop" | ||
ARG BASE_IMAGE="core-ubuntu-focal" | ||
FROM kasmweb/$BASE_IMAGE:$BASE_TAG | ||
USER root | ||
|
||
ENV HOME /home/kasm-default-profile | ||
ENV STARTUPDIR /dockerstartup | ||
ENV INST_SCRIPTS $STARTUPDIR/install | ||
WORKDIR $HOME | ||
|
||
######### Customize Container Here ########### | ||
|
||
|
||
COPY ./install/install_rdm.sh $INST_SCRIPTS/rdm/install_rdm.sh | ||
RUN bash $INST_SCRIPTS/rdm/install_rdm.sh && rm -rf $INST_SCRIPTS/rdm/ | ||
|
||
COPY ./install/custom_startup.sh $STARTUPDIR/custom_startup.sh | ||
RUN chmod +x $STARTUPDIR/custom_startup.sh | ||
RUN chmod 755 $STARTUPDIR/custom_startup.sh | ||
|
||
|
||
# Update the desktop environment to be optimized for a single application | ||
RUN cp $HOME/.config/xfce4/xfconf/single-application-xfce-perchannel-xml/* $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/ | ||
RUN cp /usr/share/backgrounds/bg_kasm.png /usr/share/backgrounds/bg_default.png | ||
RUN apt-get remove -y xfce4-panel | ||
|
||
|
||
######### End Customizations ########### | ||
|
||
RUN chown 1000:0 $HOME | ||
|
||
ENV HOME /home/kasm-user | ||
WORKDIR $HOME | ||
RUN mkdir -p $HOME && chown -R 1000:0 $HOME | ||
|
||
USER 1000 |
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,84 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
START_COMMAND="/usr/bin/remotedesktopmanager" | ||
PGREP="Remote Desktop Manager" | ||
export MAXIMIZE="true" | ||
export MAXIMIZE_NAME="Remote Desktop Manager" | ||
MAXIMIZE_SCRIPT=$STARTUPDIR/maximize_window.sh | ||
DEFAULT_ARGS="--no-sandbox" | ||
ARGS=${APP_ARGS:-$DEFAULT_ARGS} | ||
|
||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit | ||
eval set -- "$options" | ||
|
||
while [[ $1 != -- ]]; do | ||
case $1 in | ||
-g|--go) GO='true'; shift 1;; | ||
-a|--assign) ASSIGN='true'; shift 1;; | ||
-u|--url) OPT_URL=$2; shift 2;; | ||
*) echo "bad option: $1" >&2; exit 1;; | ||
esac | ||
done | ||
shift | ||
|
||
# Process non-option arguments. | ||
for arg; do | ||
echo "arg! $arg" | ||
done | ||
|
||
FORCE=$2 | ||
|
||
kasm_exec() { | ||
if [ -n "$OPT_URL" ] ; then | ||
URL=$OPT_URL | ||
elif [ -n "$1" ] ; then | ||
URL=$1 | ||
fi | ||
|
||
# Since we are execing into a container that already has the browser running from startup, | ||
# when we don't have a URL to open we want to do nothing. Otherwise a second browser instance would open. | ||
if [ -n "$URL" ] ; then | ||
/usr/bin/filter_ready | ||
/usr/bin/desktop_ready | ||
bash ${MAXIMIZE_SCRIPT} & | ||
$START_COMMAND $ARGS $OPT_URL | ||
else | ||
echo "No URL specified for exec command. Doing nothing." | ||
fi | ||
} | ||
|
||
kasm_startup() { | ||
if [ -n "$KASM_URL" ] ; then | ||
URL=$KASM_URL | ||
elif [ -z "$URL" ] ; then | ||
URL=$LAUNCH_URL | ||
fi | ||
|
||
if [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ; then | ||
|
||
echo "Entering process startup loop" | ||
set +x | ||
while true | ||
do | ||
if ! pgrep -x $PGREP > /dev/null | ||
then | ||
/usr/bin/filter_ready | ||
/usr/bin/desktop_ready | ||
set +e | ||
bash ${MAXIMIZE_SCRIPT} & | ||
$START_COMMAND $ARGS $URL & | ||
set -e | ||
fi | ||
sleep 1 | ||
done | ||
set -x | ||
|
||
fi | ||
|
||
} | ||
|
||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then | ||
kasm_exec | ||
else | ||
kasm_startup | ||
fi |
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,25 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
# Install Remote Desktop Manager from deb | ||
apt-get update | ||
curl -L -o remotedesktopmanager.deb "https://cdn.devolutions.net/download/Linux/RDM/2024.3.1.2/RemoteDesktopManager_2024.3.1.2_amd64.deb" | ||
apt-get install -y ./remotedesktopmanager.deb | ||
rm remotedesktopmanager.deb | ||
|
||
# Desktop file setup | ||
cp /usr/share/applications/com.devolutionns.remotedesktopmanager.desktop $HOME/Desktop/remotedesktopmanager.desktop | ||
chmod +x $HOME/Desktop/remotedesktopmanager.desktop | ||
|
||
# Cleanup | ||
if [ -z ${SKIP_CLEAN+x} ]; then | ||
apt-get autoclean | ||
rm -rf \ | ||
/var/lib/apt/lists/* \ | ||
/var/tmp/* \ | ||
/tmp/* | ||
fi | ||
|
||
# Cleanup for app layer | ||
chown -R 1000:0 $HOME | ||
find /usr/share/ -name "icon-theme.cache" -exec rm -f {} \; |