added p2prc script

This commit is contained in:
2021-07-30 14:45:09 +04:00
parent b5b38bda46
commit 896bd96ffd
5 changed files with 108 additions and 33 deletions

View File

@@ -1,15 +1,65 @@
FROM golang:latest as builder
LABEL maintainer="Adam Jordan <adamyordan@gmail.com>"
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o laplace .
# -----------------------------------------------------------------------------
# This is base image of Ubuntu LTS with SSHD service.
#
# Authors: Art567
# Updated: Sep 20th, 2015
# Require: Docker (http://www.docker.io/)
# -----------------------------------------------------------------------------
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /build/laplace .
COPY files files
EXPOSE 443
CMD ["./laplace"]
# Base system is the latest LTS version of Ubuntu.
# from consol/ubuntu-xfce-vnc
# due to dependency issues vnc is still work in progress
from ubuntu:20.04
# Switch to root user to install additional software
USER 0
# Make sure we don't get notifications we can't answer during building.
env DEBIAN_FRONTEND noninteractive
# Prepare scripts and configs
add ./scripts/start /start
# Download and install everything from the repos.
run apt-get -q -y update; apt-get -q -y upgrade && \
apt-get -q -y install sudo openssh-server && \
mkdir /var/run/sshd
# Installing golang and git
run apt install golang && \
apt install git
# Set root password
run echo 'root:password' >> /root/passwdfile
# Create user and it's password
run useradd -m -G sudo master && \
echo 'master:password' >> /root/passwdfile
# Apply root password
run chpasswd -c SHA512 < /root/passwdfile && \
rm /root/passwdfile
# Port 22 is used for ssh
expose 22
# Assign /data as static volume.
volume ["/data"]
# Fix all permissions
run chmod +x /start
# Starting sshd
cmd ["/start"]

View File

@@ -10,6 +10,6 @@ https://github.com/Akilan1999/laplace/tree/keyboard_mouse
## Installation instruction
```
docker run -p 6080:80 -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
```

View File

@@ -31,7 +31,7 @@ func (b *Barrier)CreateBarrierSession() error {
return err
}
cmd := exec.Command("sudo","-u",configResp.SystemUsername,"barrier.barrierc","-f","--debug", "DEBUG" ,"--log", "/tmp/barrier.log",b.IPAddress)
cmd := exec.Command("sudo","-u",configResp.SystemUsername,"barrierc","-f","--debug", "DEBUG" ,"--log", "/tmp/barrier.log",b.IPAddress)
// USE THE FOLLOWING TO DEBUG
//cmdReader, err := cmd.StdoutPipe()
@@ -81,7 +81,7 @@ func (b *Barrier)DeleteBarrierSession() error {
// DetectBarrier This function ensures that the server has barrier client installed
func DetectBarrier() error {
_, err := exec.LookPath("barrier.barrierc")
_, err := exec.LookPath("barrierc")
if err != nil {
return err
}

41
p2prc.sh Normal file
View File

@@ -0,0 +1,41 @@
# Note: This script is only be executed inside the docker container
# Assumes to be running on ubuntu 20.04
# Ports required to be allocated internally:
# - 8888 (laplace server)
# - 24800 (barrier server)
export REMOTEGAMEPLAY=$PWD
# Updating and installing go compiler
apt update
apt install golang
# Installing barrier
apt install barrier
# Installing chromium
wget https://github.com/RobRich999/Chromium_Clang/releases/download/v94.0.4585.0-r904940-linux64-deb-avx/chromium-browser-unstable_94.0.4585.0-1_amd64.deb
apt install ./v94.0.4585.0-r904940-linux64-deb-avx/chromium-browser-unstable_94.0.4585.0-1_amd64.deb
# clone remotegameplay distribution
git clone https://github.com/Akilan1999/remotegameplay
# enter cloned directory
cd remotegameplay
# Build laplace binary file
go build .
./laplace -setconfig
./laplace -tls -addr 0.0.0.0:8888 &
./laplace -headless &
sleep 2
./laplace -headless -roomInfo >> /tmp/output.txt
# Installation game script here and start remote gameplay

16
run.sh
View File

@@ -1,16 +0,0 @@
export REMOTEGAMEPLAY=$PWD
go build .
./laplace -setconfig
./laplace -tls -addr 0.0.0.0:8888 &
./laplace -headless &
sleep 2
./laplace -headless -roomInfo