Compare commits

...

3 commits

3 changed files with 23 additions and 15 deletions

View file

@ -7,11 +7,11 @@ use OCP\AppFramework\Db\Entity;
class MatrixTicket extends Entity implements JsonSerializable
{
protected $matrixControlRoom;
protected $matrixAssistedUser; // The ID of the person who created the ticket. Usually the person who needs help.
protected $matrixHelperUser;
protected $status;
protected $version;
protected string $matrixControlRoom;
protected string $matrixAssistedUser; // The ID of the person who created the ticket. Usually the person who needs help.
protected string $matrixHelperUser;
protected string $status;
protected int $version;
public function jsonSerialize(): array
{

18
run.sh
View file

@ -5,11 +5,11 @@ IFS=$'\n\t'
DIR="$(realpath ${0%/*})"
RUNTIME_IS_PODMAN="false"
if [[ -x "$(which podman)" ]]; then
CONTAINER_RUNTIME="$(which podman 2> /dev/null)"
if [[ -x "$(command -v podman)" ]]; then
CONTAINER_RUNTIME="$(command -v podman 2> /dev/null)"
RUNTIME_IS_PODMAN="true"
elif [[ -x "$(which docker)" ]]; then
CONTAINER_RUNTIME="$(which docker 2> /dev/null)"
elif [[ -x "$(command -v docker)" ]]; then
CONTAINER_RUNTIME="$(command -v docker 2> /dev/null)"
else
echo "Container runtime (docker/podman) not found!"
exit 1
@ -38,13 +38,21 @@ $CONTAINER_RUNTIME run -d \
-p 8081:80 \
-p 8082:8082 \
-p 8008:8008 \
-p 2280:22 \
-e PHP_MEMORY_LIMIT=512M \
-v "$DIR:/var/www/html/custom_apps/upschooling" \
--add-host "synapse:127.0.0.1" \
docker.io/nextcloud
echo -e "Nextcloud has started. \e[1;38;5;2mOK\033[0m"
$CONTAINER_RUNTIME exec nextcloud bash -c 'apt-get update && apt-get install -y git'
$CONTAINER_RUNTIME exec nextcloud bash -c 'apt-get update && apt-get upgrade -y && apt-get install --no-install-recommends -y git openssh-server'
# sets www-data password to extrasecret
$CONTAINER_RUNTIME exec nextcloud usermod \
--password '$6$bpNXAZwf$Xt.BzPV.mNTx5qVJQLK9Lut4VqMcrotgDHdcSZ0SwMxz2k9KVMSpAU7QmCv5vqj87ykIErYGpj9.Hb0A/XpX81' \
--shell '/bin/bash' \
www-data
$CONTAINER_RUNTIME exec nextcloud /etc/init.d/ssh start
$CONTAINER_RUNTIME exec nextcloud chown -R 33 /var/www/html/custom_apps
if [[ $(id -u) -ne 0 && $RUNTIME_IS_PODMAN == "true" ]]; then

10
test.sh
View file

@ -5,14 +5,14 @@ IFS=$'\n\t'
DIR="$(realpath ${0%/*})"
RUNTIME_IS_PODMAN="false"
if [[ -x "$(which podman)" ]]; then
CONTAINER_RUNTIME="$(which podman 2> /dev/null)"
if [[ -x "$(command -v podman)" ]]; then
CONTAINER_RUNTIME="$(command -v podman 2> /dev/null)"
RUNTIME_IS_PODMAN="true"
elif [[ -x "$(which docker)" ]]; then
CONTAINER_RUNTIME="$(which docker 2> /dev/null)"
elif [[ -x "$(command -v docker)" ]]; then
CONTAINER_RUNTIME="$(command -v docker 2> /dev/null)"
else
echo "Container runtime (docker/podman) not found!"
exit 1
fi
$CONTAINER_RUNTIME exec --user 33 nextcloud bash -c 'cd /var/www/html/custom_apps/upschooling && make test'
$CONTAINER_RUNTIME exec --user 33 nextcloud bash -c 'cd /var/www/html/custom_apps/upschooling && make test'