Comments (2)
Thanks for the idea! I think I could actually vendor those in. Like download them and host them as part of the docker image. I will think of something when dealing with the forward header for reverse proxies.
from seven-wonders.
I have the world's tenth-most-ugliest process ever devised for getting around this. I'm sure whatever you come up with will be more logical and simpler.
Step by step
I fetched all non-local urls with browser developer tools.
- https://fonts.googleapis.com/css2?family=Acme&display=swap
- https://unpkg.com/normalize.css@%5E7.0.0
- https://unpkg.com/@blueprintjs/icons@%5E4.13.0/lib/css/blueprint-icons.css
- https://unpkg.com/@blueprintjs/core@%5E4.15.0/lib/css/blueprint.css
steps taken
cd /var/www/seven-wonders-assets/
wget 'https://fonts.googleapis.com/css2?family=Acme&display=swap'
# modify css2?f* to use url /seven-wonders-assets/
wget 'https://fonts.gstatic.com/s/acme/v21/RrQfboBx-C5_bx0.ttf'
wget 'https://unpkg.com/normalize.css@%5E7.0.0'
wget 'https://unpkg.com/@blueprintjs/icons@%5E4.13.0/lib/css/blueprint-icons.css'
wget 'https://unpkg.com/@blueprintjs/core@%5E4.15.0/lib/css/blueprint.css'
I found app.jar with sudo ls -al /var/lib/docker/overlay2/*/*/app.jar
and finding the exact filesize one that matched from docker exec -it seven_wonders ls -al /app.jar
.
get app.jar from sudo cp -pi /var/lib/docker/overlay2/l/JTQPGSF4VGTC4UPZ4W2Y7JUOXI/app.jar ~/foo
and with openjdk 17 installed, run:
cd ~/foo
jar xvf app.jar
vi BOOT-INF/classes/static/index.html
and modify it to use /seven-wonders-assets/ paths for all the files. I set css2 to just "css2" and renamed the file to omit the question mark and other parameter-type entries. Its whole contents are as follows.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The .ico is for compatibliity with Safari, which doesn't support SVG -->
<link rel="icon" href="./favicon.ico" sizes="48x48">
<link rel="icon" href="./favicon.svg" sizes="any" type="image/svg+xml">
<title>Seven Wonders</title>
<link href='/seven-wonders-assets/css2' rel='stylesheet'>
<!-- Style dependencies -->
<link href="/seven-wonders-assets/normalize.css@^7.0.0" rel="stylesheet"/>
<!-- Blueprint stylesheets -->
<link href="/seven-wonders-assets/blueprint-icons.css" rel="stylesheet"/>
<link href="/seven-wonders-assets/blueprint.css" rel="stylesheet"/>
</head>
<body>
<div id="root"></div>
<script src="sw-ui.js"></script>
</body>
</html>
And now upload the updated file into app.jar
jar -uf app.jar BOOT-INF/classes/static/index.html
And send that file back to where it came from.
sudo cp -pi ~/foo/app.jar /var/lib/docker/overlay2/l/JTQPGSF4VGTC4UPZ4W2Y7JUOXI/app.jar
And restart my docker app, which is a systemd service.
time sudo systemctl restart seven-wonders
And confirm the jar is still updated.
docker exec -it seven_wonders ls -al /app.jar
And now this game works without leaking info to the font and unpkg servers.
from seven-wonders.
Related Issues (20)
- End of game resolved before some extra actions HOT 5
- Add bug report button in the game
- Play-last-card bonus not taken into account when activated on the 6th turn
- Copied guild card doesn't give points (Olympia B)
- Weird animation when re-ordering players
- Show "waiting for others" message on prepared move
- Show loading wheel for initial SAY_READY action instead of READY button
- Incorrect loading wheels when waiting for extra actions
- Bots don't disconnect (until timeout) if all humans leave
- Olympia A allows to play twice the same card
- HTTPS URL is broken HOT 1
- Accept a top-level prefix for a reverse-proxy situation HOT 3
- West trading post does not give you coupon for forum HOT 3
- Design idea: menu of buttons on main gameplay screen
- max length of player name HOT 4
- Improve error shown when refreshing the game list page
- Olympia B wonder points miscalculation HOT 2
- Read bot names from text/separate file HOT 3
- Show cards used to build wonder HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seven-wonders.