Skip to content

Commit

Permalink
refactor(yukon)!: update builder script
Browse files Browse the repository at this point in the history
BREAKING CHANGE: env var ASSETS_TAR_URL has been changed to ASSETS_REPOSITORY

You should pass a complete git repository now
  • Loading branch information
n0bodysec committed Nov 6, 2022
1 parent 1bfb21d commit b2f4c05
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
12 changes: 6 additions & 6 deletions yukon/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ GAME_PREFERRED_SPAWN=0
# Docker
#################################################
#
# ASSETS_TAR_URL
# --------------
# The URL where you can find a compressed
# file (.tar.gz) with the client's assets.
# ASSETS_REPOSITORY
# -----------------
# The URL where you can find a git repository
# containing the client assets.
# It is fine to leave this so long as you
# do not use the builder service.
#
Expand All @@ -169,7 +169,7 @@ GAME_PREFERRED_SPAWN=0
#
#################################################

ASSETS_TAR_URL=https://gitea.com/USERNAME/REPOSITORY/archive/master.tar.gz
ASSETS_REPOSITORY=https://gitea.com/USERNAME/REPOSITORY.git
CLIENT_BRANCH=main
SERVER_BRANCH=master
DOCKERIZE_VERSION=v0.6.1
DOCKERIZE_VERSION=v0.6.1
2 changes: 1 addition & 1 deletion yukon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Yukon is an HTML5 CPPS written in JavaScript. This repository contains a series
If you want to deploy Yukon with almost no effort, follow the next steps:

1. Copy `.env.example` to `.env` and edit it accordingly.
> Please make sure to set **ASSETS_TAR_URL** correctly.
> Please make sure to set **ASSETS_REPOSITORY** correctly.
2. Run the `builder` compose service.
3. Run `docker compose up -d`.

Expand Down
3 changes: 2 additions & 1 deletion yukon/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ services:
wget -qO /tmp/res.json https://api.github.com/repos/ruffle-rs/ruffle/releases
node -p "require('/tmp/res.json').flatMap(x => x.assets).find(y => y.browser_download_url.includes('selfhosted')).browser_download_url;" | xargs -n1 wget -qO /tmp/ruffle.zip
unzip -d www/assets/scripts/lib/ruffle /tmp/ruffle.zip
wget -qO- $$ASSETS_TAR_URL | tar --strip-components=1 -C www/assets -xzvf-
git clone $$ASSETS_REPOSITORY /tmp/assets
mv /tmp/assets/* /tmp/assets/.[!.]* www/assets
node:
image: node:alpine
Expand Down
5 changes: 5 additions & 0 deletions yukon/templates/yukon.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ server {
root /usr/share/nginx/html;
index index.html index.htm;

# block files/folders starting with a dot (e.g. .git)
location ~ /\. {
deny all;
}

location /world/login {
proxy_pass {{ .Env.GAME_ADDRESS }}:{{ .Env.GAME_LOGIN_PORT }};
proxy_set_header Upgrade $http_upgrade;
Expand Down

0 comments on commit b2f4c05

Please sign in to comment.