diff --git a/Makefile b/Makefile index 819a0b4..c2d94d7 100644 --- a/Makefile +++ b/Makefile @@ -52,8 +52,8 @@ ifeq ($(I),lang) @: $${L} node tools/build-lang-image.js --lang $(L) else ifeq ($(I),ubuntu) - docker pull ubuntu:rolling - hash="$$(docker inspect ubuntu:rolling -f '{{ .Id }}' | sha1sum | awk '{ print $$1 }')"; echo "FROM ubuntu:rolling" | docker build --label riju.image-hash="$${hash}" -t riju:$(I) - + docker pull ubuntu:21.04 + hash="$$(docker inspect ubuntu:21.04 -f '{{ .Id }}' | sha1sum | awk '{ print $$1 }')"; echo "FROM ubuntu:21.04" | docker build --label riju.image-hash="$${hash}" -t riju:$(I) - else ifneq (,$(filter $(I),admin ci)) docker build . -f docker/$(I)/Dockerfile -t riju:$(I) $(NO_CACHE) else diff --git a/backend/server.js b/backend/server.js index 63305c3..457a679 100644 --- a/backend/server.js +++ b/backend/server.js @@ -15,7 +15,10 @@ const host = process.env.HOST || "localhost"; const port = parseInt(process.env.PORT || "") || 6119; const tlsPort = parseInt(process.env.TLS_PORT || "") || 6120; const useTLS = process.env.TLS ? true : false; -const analyticsTag = process.env.ANALYTICS_TAG || ""; +const analyticsTag = (process.env.ANALYTICS_TAG || "").replace( + /^'(.+)'$/, + "$1" +); const langs = await langsPromise; const app = express(); diff --git a/doc/selfhosting.md b/doc/selfhosting.md index 35ef4ab..43bb580 100644 --- a/doc/selfhosting.md +++ b/doc/selfhosting.md @@ -264,8 +264,9 @@ enable all the fun CloudFlare options you'd like. ## Set up analytics (optional) Sign up for Fathom Analytics, enter your domain name, and get a tag -for embedding. Set this as `ANALYTICS_TAG` in your `.env` file (don't -forget the appropriate quoting), and build and roll out a new web AMI. +for embedding. Set this as `ANALYTICS_TAG` in your `.env` file (use +single quoting, as Makefile handling of quotes is a bit nonstandard), +and build and roll out a new web AMI. ## Set up monitoring (optional) diff --git a/docker/admin/Dockerfile b/docker/admin/Dockerfile index ea76193..1981d6d 100644 --- a/docker/admin/Dockerfile +++ b/docker/admin/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:rolling +FROM ubuntu:21.04 COPY docker/admin/install.bash /tmp/ RUN /tmp/install.bash diff --git a/docker/admin/install.bash b/docker/admin/install.bash index 962ae65..d64abb5 100755 --- a/docker/admin/install.bash +++ b/docker/admin/install.bash @@ -19,7 +19,7 @@ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - ubuntu_ver="$(lsb_release -rs)" ubuntu_name="$(lsb_release -cs)" -node_repo="$(curl -sS https://deb.nodesource.com/setup_current.x | grep NODEREPO= | grep -Eo 'node_[0-9]+\.x' | head -n1)" +node_repo="$(curl -sS https://deb.nodesource.com/setup_16.x | grep NODEREPO= | grep -Eo 'node_[0-9]+\.x' | head -n1)" tee -a /etc/apt/sources.list.d/custom.list >/dev/null </dev/null < <% if (analyticsTag) { %> - <%= analyticsTag %> + <%- analyticsTag %> <% } %> diff --git a/frontend/pages/index.ejs b/frontend/pages/index.ejs index fe25f16..ac45a26 100644 --- a/frontend/pages/index.ejs +++ b/frontend/pages/index.ejs @@ -4,6 +4,9 @@ Riju + <% if (analyticsTag) { %> + <%- analyticsTag %> + <% } %>

Riju: fast online playground for every programming language

@@ -30,8 +33,5 @@ <% } else { %> Riju is loading language configuration... <% } %> - <% if (analyticsTag) { %> - <%= analyticsTag %> - <% } %> diff --git a/langs/ante.yaml b/langs/ante.yaml index 2f34309..344e3e1 100644 --- a/langs/ante.yaml +++ b/langs/ante.yaml @@ -9,6 +9,7 @@ install: - cargo - cmake - libssl-dev + - libunwind-dev - pkg-config - python3-distutils manual: | @@ -17,8 +18,8 @@ install: llvmenv init # If compiler is not explicitly set to LLVM, then we get an # error: unrecognized command-line option ‘-Wnewline-eof’. - CC=/usr/bin/clang CXX=/usr/bin/clang++ llvmenv build-entry -G Makefile -j$(nproc) 10.0.0 - llvmenv global 10.0.0 + CC=/usr/bin/clang CXX=/usr/bin/clang++ llvmenv build-entry -G Makefile -j$(nproc) 12.0.1 + llvmenv global 12.0.1 manual: | git clone https://github.com/jfecher/ante.git pushd ante diff --git a/langs/csharp.yaml b/langs/csharp.yaml index e81e811..3988f44 100644 --- a/langs/csharp.yaml +++ b/langs/csharp.yaml @@ -19,9 +19,9 @@ template: | } compile: | - mcs main.cs + mcs -debug main.cs run: | - mono main.exe + mono --debug main.exe format: run: | diff --git a/packer/riju.service b/packer/riju.service index 6e11ccf..c11177b 100644 --- a/packer/riju.service +++ b/packer/riju.service @@ -11,7 +11,7 @@ ExecStart=riju-supervisor Restart=always RestartSec=5 Environment=AWS_REGION=$AWS_REGION -Environment=ANALYTICS_TAG=ANALYTICS_TAG +Environment=ANALYTICS_TAG=$ANALYTICS_TAG Environment=S3_BUCKET=$S3_BUCKET Environment=SENTRY_DSN=$SENTRY_DSN Environment=SUPERVISOR_ACCESS_TOKEN=$SUPERVISOR_ACCESS_TOKEN