diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..58ecf2c20 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.github/ +.git/ + +uoj_data/ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..bb75b4481 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,68 @@ +name: Build & Push Docker Images + +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_BASENAME: uoj + +jobs: + build: + name: Build Image + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + strategy: + matrix: + include: + - image_name: db + context: db + dockerfile: db/Dockerfile + - image_name: judger + context: judger + dockerfile: judger/Dockerfile + - image_name: web + context: . + dockerfile: web/Dockerfile + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v2.1.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4.3.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_BASENAME }}-${{ matrix.image_name }} + tags: | + latest + type=ref,event=branch + type=ref,event=pr + type=sha,prefix= + + - name: Build and push Docker image + uses: docker/build-push-action@v3.3.0 + with: + context: ${{ matrix.context }} + file: ${{ matrix.dockerfile }} + push: ${{ github.event_name == 'push' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore index 485dee64b..41e90d100 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea +uoj_data/ diff --git a/db/Dockerfile b/db/Dockerfile new file mode 100644 index 000000000..b184ed471 --- /dev/null +++ b/db/Dockerfile @@ -0,0 +1,12 @@ +FROM mysql:5.7 +MAINTAINER Baoshuo +LABEL org.opencontainers.image.source=https://github.com/UniversalOJ/UOJ-System +LABEL org.opencontainers.image.description="UOJ Database" +LABEL org.opencontainers.image.licenses=MIT + +ADD . /opt/uoj_db +WORKDIR /opt/uoj_db + +RUN sh install.sh + +ENV LANG=C.UTF-8 TZ=Asia/Shanghai diff --git a/db/add_judger.sql b/db/add_judger.sql new file mode 100644 index 000000000..bd7340570 --- /dev/null +++ b/db/add_judger.sql @@ -0,0 +1,2 @@ +USE `app_uoj233`; +insert into judger_info (judger_name, password) values ('compose_judger', '_judger_password_'); diff --git a/install/db/app_uoj233.sql b/db/app_uoj233.sql similarity index 100% rename from install/db/app_uoj233.sql rename to db/app_uoj233.sql diff --git a/install/db/install.sh b/db/install.sh similarity index 81% rename from install/db/install.sh rename to db/install.sh index 063cf41f4..4618093a5 100644 --- a/install/db/install.sh +++ b/db/install.sh @@ -21,8 +21,8 @@ setWebConf(){ cat >/docker-entrypoint-initdb.d/000-native_password.sql </docker-entrypoint-initdb.d/001-app_uoj233.sql - curl $RAW_URL/install/judger/add_judger.sql >/docker-entrypoint-initdb.d/002-add_judger.sql + cp app_uoj233.sql /docker-entrypoint-initdb.d/001-app_uoj233.sql + cp add_judger.sql /docker-entrypoint-initdb.d/002-add_judger.sql } echo 'Preparing UOJ System db environment...' diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..003234065 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,66 @@ +version: '3' + +services: + uoj-db: + image: ghcr.io/UniversalOJ/uoj-db:latest + build: + context: ./db/ + dockerfile: Dockerfile + container_name: uoj-db + restart: always + volumes: + - ./uoj_data/db/mysql:/var/lib/mysql + environment: + - MYSQL_DATABASE=app_uoj233 + - MYSQL_ROOT_PASSWORD=root + + uoj-judger: + image: ghcr.io/UniversalOJ/uoj-judger:latest + build: + context: ./judger/ + dockerfile: Dockerfile + container_name: uoj-judger + restart: always + stdin_open: true + tty: true + cap_add: + - SYS_PTRACE + volumes: + - ./uoj_data/judger/log:/opt/uoj_judger/log + environment: + - UOJ_PROTOCOL=http + - UOJ_HOST=uoj-web + - JUDGER_NAME=compose_judger + - JUDGER_PASSWORD=_judger_password_ + - SOCKET_PORT=2333 + - SOCKET_PASSWORD=_judger_socket_password_ + + uoj-web: + image: ghcr.io/UniversalOJ/uoj-web:latest + build: + context: ./ + dockerfile: web/Dockerfile + container_name: uoj-web + restart: always + stdin_open: true + tty: true + cap_add: + - SYS_PTRACE + depends_on: + - uoj-db + - uoj-judger + volumes: + - ./uoj_data/web/data:/var/uoj_data + ports: + - "80:80" + - "3690:3690" + environment: + - DATABASE_HOST=uoj-db + - DATABASE_PASSWORD=root + - JUDGER_SOCKET_PORT=2333 + - JUDGER_SOCKET_PASSWORD=_judger_socket_password_ + - SALT_0=_salt_0_ + - SALT_1=_salt_1_ + - SALT_2=_salt_2_ + - SALT_3=_salt_3_ + - UOJ_PROTOCOL=http diff --git a/install/bundle/Dockerfile b/install/bundle/Dockerfile deleted file mode 100644 index c37ebef3b..000000000 --- a/install/bundle/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM ubuntu:20.04 -MAINTAINER MascoSkray -ARG CLONE_ADDFLAG - -WORKDIR /opt -ENV DEBIAN_FRONTEND=noninteractive -#Update apt and install git -RUN apt-get update && apt-get install -y apache2 cmake curl fp-compiler g++ git gnupg libapache2-mod-php libapache2-mod-xsendfile libyaml-dev make mysql-server ntp openjdk-11-jdk openjdk-8-jdk php php-dev php-mbstring php-mysql php-pear php-zip python python3 python3-requests re2c unzip vim wget zip --no-install-recommends -#Clone the latest UOJ Community verison to local -RUN git clone https://github.com/UniversalOJ/UOJ-System.git --depth 1 --single-branch ${CLONE_ADDFLAG} uoj -#Install environment and set startup script -RUN cd uoj/install/bundle && sh install.sh -p && echo "\ -#!/bin/sh\n\ -rm -rf /run/mysqld/*\n\ -chown -R mysql:mysql /var/lib/mysql /var/run/mysqld\n\ -if [ ! -f \"/var/uoj_data/.UOJSetupDone\" ]; then\n\ - cd /opt/uoj/install/bundle && sh install.sh -i\n\ -fi\n\ -service ntp start\n\ -service mysql start\n\ -service apache2 start\n\ -su local_main_judger -c \"/opt/uoj/judger/judge_client start\"\n\ -exec bash\n" >/opt/up && chmod +x /opt/up - -ENV LANG=C.UTF-8 TZ=Asia/Shanghai -EXPOSE 80 3690 -CMD /opt/up diff --git a/install/bundle/hooks/build b/install/bundle/hooks/build deleted file mode 100644 index 63e260519..000000000 --- a/install/bundle/hooks/build +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -CLONE_ADDFLAG="-b $DOCKER_TAG" -if [ "$DOCKER_TAG" = "latest" ]; then - CLONE_ADDFLAG="-b master" -fi -docker build -t $IMAGE_NAME --build-arg CLONE_ADDFLAG="$CLONE_ADDFLAG" . diff --git a/install/bundle/install.sh b/install/bundle/install.sh deleted file mode 100644 index 45b5c2070..000000000 --- a/install/bundle/install.sh +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/bash -genRandStr(){ - cat /dev/urandom | tr -dc [:alnum:] | head -c $1 -} -#Set some vars -_database_password_=root -_judger_socket_port_=2333 -_judger_socket_password_=$(genRandStr 32) -_main_judger_password_=$(genRandStr 32) - -getAptPackage(){ - printf "\n\n==> Getting environment packages\n" - #Set MySQL root password - export DEBIAN_FRONTEND=noninteractive - (echo "mysql-server mysql-server/root_password password $_database_password_";echo "mysql-server mysql-server/root_password_again password $_database_password_") | debconf-set-selections - #Update apt sources and install - echo "deb http://ppa.launchpad.net/stesie/libv8/ubuntu bionic main" | tee /etc/apt/sources.list.d/stesie-libv8.list && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D858A0DF - apt-get update && apt-get install -y libv8-7.5-dev - #Install PHP extensions - yes | pecl install yaml - git clone https://github.com/phpv8/v8js.git --depth=1 /tmp/pear/download/v8js-master && cd /tmp/pear/download/v8js-master - phpize && ./configure --with-php-config=/usr/bin/php-config --with-v8js=/opt/libv8-7.5 && make install && cd - -} - -setLAMPConf(){ - printf "\n\n==> Setting LAMP configs\n" - #Set Apache UOJ site conf - cat >/etc/apache2/sites-available/000-uoj.conf < - #ServerName local_uoj.ac - ServerAdmin opensource@uoj.ac - DocumentRoot /var/www/uoj - - SetEnvIf Request_URI "^/judge/.*$" judgelog - #LogLevel info ssl:warn - ErrorLog \${APACHE_LOG_DIR}/uoj_error.log - CustomLog \${APACHE_LOG_DIR}/uoj_judge.log common env=judgelog - CustomLog \${APACHE_LOG_DIR}/uoj_access.log combined env=!judgelog - - XSendFile On - XSendFilePath /var/uoj_data - XSendFilePath /var/www/uoj/app/storage - XSendFilePath /opt/uoj/judger/uoj_judger/include - -UOJEOF - #Enable modules and make UOJ site conf enabled - a2ensite 000-uoj.conf && a2dissite 000-default.conf - a2enmod rewrite headers && sed -i -e '172s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf - #Create UOJ session save dir and make PHP extensions available - mkdir --mode=733 /var/lib/php/uoj_sessions && chmod +t /var/lib/php/uoj_sessions - sed -i -e '912a\extension=v8js.so\nextension=yaml.so' /etc/php/7.4/apache2/php.ini - #Set MySQL user directory and connection config - usermod -d /var/lib/mysql/ mysql - cat >/etc/mysql/mysql.conf.d/uoj_mysqld.cnf < Setting web files\n" - #Set webroot path - ln -sf /opt/uoj/web /var/www/uoj - chown -R www-data /var/www/uoj/app/storage - #Set web config file - php -a < Setting judger files\n" - #specify environment - cat > /etc/environment <uoj_judger/include/uoj_work_path.h <../../judger/.conf.json < Doing initial config and start service\n" - #Replace password placeholders - sed -i -e "s/_main_judger_password_/$_main_judger_password_/g" -e "s/_judger_socket_password_/$_judger_socket_password_/g" /opt/uoj/judger/.conf.json - sed -i -e "s/salt0/$(genRandStr 32)/g" -e "s/salt1/$(genRandStr 16)/g" -e "s/salt2/$(genRandStr 16)/g" -e "s/salt3/$(genRandStr 16)/g" -e "s/_judger_socket_password_/$_judger_socket_password_/g" /var/www/uoj/app/.config.php - #Import judge_client to MySQL database - service mysql start - echo "insert into judger_info (judger_name, password) values (\"main_judger\", \"$_main_judger_password_\")" | mysql app_uoj233 -u root --password=$_database_password_ - #Using cli upgrade to latest - php /var/www/uoj/app/cli.php upgrade:latest - #Start services - service ntp restart - service mysql restart - service apache2 restart - su local_main_judger -c '/opt/uoj/judger/judge_client start' - #Touch SetupDone flag file - touch /var/uoj_data/.UOJSetupDone - printf "\n\n***Installation complete. Enjoy!***\n" -} - -prepProgress(){ - getAptPackage;setLAMPConf;setWebConf;setJudgeConf -} - -if [ $# -le 0 ]; then - echo 'Installing UOJ System bundle...' - prepProgress;initProgress -fi -while [ $# -gt 0 ]; do - case "$1" in - -p | --prep) - echo 'Preparing UOJ System bundle environment...' - prepProgress - ;; - -i | --init) - echo 'Initing UOJ System bundle...' - initProgress - ;; - -? | --*) - echo "Illegal option $1" - ;; - esac - shift $(( $#>0?1:0 )) -done diff --git a/install/db/Dockerfile b/install/db/Dockerfile deleted file mode 100644 index b0cc8324e..000000000 --- a/install/db/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM mysql:latest -MAINTAINER MascoSkray - -#Update apt and install curl -RUN apt-get update && apt-get install -y curl -#Run the latest UOJ Community verison db install script -RUN export RAW_URL=https://raw.githubusercontent.com/UniversalOJ/UOJ-System/master && curl $RAW_URL/install/db/install.sh | sh - -ENV LANG=C.UTF-8 TZ=Asia/Shanghai diff --git a/install/judger/Dockerfile b/install/judger/Dockerfile deleted file mode 100644 index 98f3c4c88..000000000 --- a/install/judger/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM ubuntu:18.04 -MAINTAINER MascoSkray -ARG CLONE_ADDFLAG - -WORKDIR /opt -#Update apt and install git -RUN apt-get update && apt-get install -y git -#Clone the latest UOJ Community verison to local -RUN git clone https://github.com/UniversalOJ/UOJ-System.git --depth 1 --single-branch ${CLONE_ADDFLAG} uoj -#Install environment and set startup script -RUN cd uoj/install/judger && sh install.sh -p && echo "\ -#!/bin/sh\n\ -if [ ! -f \"/opt/uoj/judger/.conf.json\" ]; then\n\ - cd /opt/uoj/install/judger && sh install.sh -i\n\ -fi\n\ -service ntp start\n\ -su judger -c \"/opt/uoj/judger/judge_client start\"\n\ -exec bash\n" >/opt/up && chmod +x /opt/up - -ENV LANG=C.UTF-8 TZ=Asia/Shanghai -EXPOSE 2333 -CMD /opt/up diff --git a/install/web/Dockerfile b/install/web/Dockerfile deleted file mode 100644 index 55e9fea5b..000000000 --- a/install/web/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM ubuntu:20.04 -MAINTAINER MascoSkray -ARG CLONE_ADDFLAG - -WORKDIR /opt -#Update apt and install git -RUN apt-get update && apt-get install -y git -#Clone the latest UOJ Community verison to local -RUN git clone https://github.com/UniversalOJ/UOJ-System.git --depth 1 --single-branch ${CLONE_ADDFLAG} uoj -#Install environment and set startup script -RUN cd uoj/install/web && sh install.sh -p && echo "\ -#!/bin/sh\n\ -if [ ! -f \"/var/uoj_data/.UOJSetupDone\" ]; then\n\ - cd /opt/uoj/install/web && sh install.sh -i\n\ -fi\n\ -service ntp start\n\ -service apache2 start\n\ -exec bash\n" >/opt/up && chmod +x /opt/up - -ENV LANG=C.UTF-8 TZ=Asia/Shanghai -EXPOSE 80 3690 -CMD /opt/up diff --git a/judger/Dockerfile b/judger/Dockerfile new file mode 100644 index 000000000..2b1d5786a --- /dev/null +++ b/judger/Dockerfile @@ -0,0 +1,34 @@ +FROM ubuntu:20.04 +MAINTAINER Baoshuo +LABEL org.opencontainers.image.source=https://github.com/UniversalOJ/UOJ-System +LABEL org.opencontainers.image.description="UOJ Judger" +LABEL org.opencontainers.image.licenses=MIT + +SHELL ["/bin/bash", "-c"] + +ENV DEBIAN_FRONTEND=noninteractive +ARG CLONE_ADDFLAG + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg ca-certificates apt-transport-https && \ + apt-get update && \ + for pkg in git vim ntp zip unzip curl wget build-essential fp-compiler python python3 python3-requests openjdk-8-jdk openjdk-11-jdk tzdata; do \ + cnt=10 && \ + while ! apt-get install -y "$pkg"; do \ + if [ $cnt -le 0 ]; then \ + echo "Failed to install $pkg" && \ + exit 1; \ + fi; \ + cnt=$((cnt - 1)); \ + done; \ + done + +ADD . /opt/uoj_judger +WORKDIR /opt/uoj_judger + +# Install environment and set startup script +RUN sh install.sh -p && sh install.sh -d + +ENV LANG=C.UTF-8 TZ=Asia/Shanghai +EXPOSE 2333 +CMD /opt/up diff --git a/install/judger/add_judger.sql b/judger/add_judger.sql similarity index 100% rename from install/judger/add_judger.sql rename to judger/add_judger.sql diff --git a/install/judger/install.sh b/judger/install.sh similarity index 65% rename from install/judger/install.sh rename to judger/install.sh index bcebe99cc..5300fc016 100644 --- a/install/judger/install.sh +++ b/judger/install.sh @@ -3,24 +3,28 @@ getAptPackage(){ printf "\n\n==> Getting environment packages\n" export DEBIAN_FRONTEND=noninteractive - apt-get update && apt-get install -y vim ntp zip unzip curl wget build-essential fp-compiler python python3 python3-requests openjdk-8-jdk openjdk-11-jdk + apt-get update && apt-get install -y vim ntp zip unzip curl wget build-essential fp-compiler python2.7 python3.8 python3-requests } setJudgeConf(){ printf "\n\n==> Setting judger files\n" + #specify environment + cat > /etc/environment <uoj_judger/include/uoj_work_path.h < Doing initial config and start service\n" - #Check envs + # Check envs if [ -z "$UOJ_PROTOCOL" -o -z "$UOJ_HOST" -o -z "$JUDGER_NAME" -o -z "$JUDGER_PASSWORD" -o -z "$SOCKET_PORT" -o -z "$SOCKET_PASSWORD" ]; then echo "!! Environment variables not set! Please edit config file by yourself!" else - #Set judge_client config file - cat >../../judger/.conf.json <.conf.json </opt/up + chmod +x /opt/up } if [ $# -le 0 ]; then @@ -69,6 +84,10 @@ while [ $# -gt 0 ]; do echo 'Preparing UOJ System judger environment...' prepProgress ;; + -d | --docker) + echo '[Docker] Preparing UOJ System judger environment...' + dockerPrep + ;; -i | --init) echo 'Initing UOJ System judger...' initProgress diff --git a/web/Dockerfile b/web/Dockerfile new file mode 100644 index 000000000..3af78ff19 --- /dev/null +++ b/web/Dockerfile @@ -0,0 +1,32 @@ +FROM ubuntu:20.04 +MAINTAINER Baoshuo +LABEL org.opencontainers.image.source=https://github.com/UniversalOJ/UOJ-System +LABEL org.opencontainers.image.description="UOJ Web" +LABEL org.opencontainers.image.licenses=MIT + +ARG CLONE_ADDFLAG + +ENV DEBIAN_FRONTEND=noninteractive +RUN dpkg -s gnupg 2>/dev/null || (apt-get update && apt-get install -y gnupg) &&\ +echo "deb http://ppa.launchpad.net/stesie/libv8/ubuntu bionic main" | tee /etc/apt/sources.list.d/stesie-libv8.list && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D858A0DF &&\ +apt-get update && apt-get install -y git vim ntp zip unzip curl wget apache2 libapache2-mod-xsendfile libapache2-mod-php php php-dev php-pear php-zip php-mysql php-mbstring php-gd php-intl php-xsl g++ make re2c libv8-7.5-dev libyaml-dev &&\ +yes | pecl install yaml &&\ +git clone https://github.com/phpv8/v8js.git --depth=1 -b 2.1.2 /tmp/pear/download/v8js-master && cd /tmp/pear/download/v8js-master &&\ +phpize && ./configure --with-php-config=/usr/bin/php-config --with-v8js=/opt/libv8-7.5 && make install && cd - + +ADD . /opt/uoj +WORKDIR /opt/uoj + +# Install environment and set startup script +RUN sh web/install.sh -p && echo "\ +#!/bin/sh\n\ +if [ ! -f \"/var/uoj_data/.UOJSetupDone\" ]; then\n\ + cd /opt/uoj/web && sh install.sh -i\n\ +fi\n\ +service ntp start\n\ +service apache2 start\n\ +exec bash\n" >/opt/up && chmod +x /opt/up + +ENV LANG=C.UTF-8 TZ=Asia/Shanghai +EXPOSE 80 +CMD /opt/up diff --git a/install/web/install.sh b/web/install.sh similarity index 71% rename from install/web/install.sh rename to web/install.sh index 0d133b75e..cfa58085b 100644 --- a/install/web/install.sh +++ b/web/install.sh @@ -3,21 +3,26 @@ genRandStr(){ cat /dev/urandom | tr -dc [:alnum:] | head -c $1 } #Set some vars -_database_host_=uoj-db -_database_password_=root -_judger_socket_port_=2333 -_judger_socket_password_=_judger_socket_password_ +_database_host_="${DATABASE_HOST:-uoj-db}" +_database_password_="${DATABASE_PASSWORD:-root}" +_judger_socket_port_="${JUDGER_SOCKET_PORT:-2333}" +_judger_socket_password_="${JUDGER_SOCKET_PASSWORD:-_judger_socket_password_}" +_salt0_="${SALT_0:-salt0}" +_salt1_="${SALT_1:-salt1}" +_salt2_="${SALT_2:-salt2}" +_salt3_="${SALT_3:-salt3}" +_uoj_protocol_="${UOJ_PROTOCOL:-http}" getAptPackage(){ printf "\n\n==> Getting environment packages\n" - #Update apt sources and install + # Update apt sources and install export DEBIAN_FRONTEND=noninteractive dpkg -s gnupg 2>/dev/null || (apt-get update && apt-get install -y gnupg) echo "deb http://ppa.launchpad.net/stesie/libv8/ubuntu bionic main" | tee /etc/apt/sources.list.d/stesie-libv8.list && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D858A0DF - apt-get update && apt-get install -y git vim ntp zip unzip curl wget apache2 libapache2-mod-xsendfile libapache2-mod-php php php-dev php-pear php-zip php-mysql php-mbstring g++ cmake re2c libv8-7.5-dev libyaml-dev - #Install PHP extensions + apt-get update && apt-get install -y git vim ntp zip unzip curl wget apache2 libapache2-mod-xsendfile libapache2-mod-php php php-dev php-pear php-zip php-mysql php-mbstring php-gd php-intl php-xsl g++ make re2c libv8-7.5-dev libyaml-dev + # Install PHP extensions yes | pecl install yaml - git clone https://github.com/phpv8/v8js.git --depth=1 /tmp/pear/download/v8js-master && cd /tmp/pear/download/v8js-master + git clone https://github.com/phpv8/v8js.git --depth=1 -b 4c026f3fb291797c109adcabda6aeba6491fe44f /tmp/pear/download/v8js-master && cd /tmp/pear/download/v8js-master phpize && ./configure --with-php-config=/usr/bin/php-config --with-v8js=/opt/libv8-7.5 && make install && cd - } @@ -47,15 +52,16 @@ UOJEOF a2enmod rewrite headers && sed -i -e '172s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf #Create UOJ session save dir and make PHP extensions available mkdir --mode=733 /var/lib/php/uoj_sessions && chmod +t /var/lib/php/uoj_sessions - sed -i -e '912a\extension=v8js.so\nextension=yaml.so' /etc/php/7.2/apache2/php.ini + sed -i -e '912a\extension=v8js.so\nextension=yaml.so' /etc/php/7.4/apache2/php.ini + sed -i 's|;sys_temp_dir = "/tmp"|sys_temp_dir = "/tmp"|g' /etc/php/7.4/apache2/php.ini } setWebConf(){ printf "\n\n==> Setting web files\n" - #Set webroot path + # Set webroot path ln -sf /opt/uoj/web /var/www/uoj chown -R www-data /var/www/uoj/app/storage - #Set web config file + # Set web config file php -a <include/uoj_work_path.h <