It also includes a number of enhancments over the original.
You may use the public site, or even host your own for super fast offline access!
- πΆοΈ Custom Darkmode (Thanks @Be1zebub/@Phoenixf129!)
- Alternatively, this mirror plays nicely with DarkReader!
- π’ Self-hosting with Docker
- ποΈ Performance enhancements
- Significant performance improvements for CSS styling
- Reduced the total stylesheet size by nearly 90%
- Noticeable improvements to "Page-to-page" navigation speed
- Vastly improved navigation performance on Firefox
- π§ Optimized memory usage
- Caches page content in browser cache rather than Javascript memory
- π Fast searching
- Both basic and full-site searching are implemented
- Search results are not paginated
- πΌοΈ Optimized images
- Image size reduced by > 40% with only a small loss in quality
- βοΈ Hosted entirely on The Cloud
- Very reliable! Should almost never go down
- π€ Automatic content updates
- Page content is automatically updated four times a day
- π οΈ UI bug fixes
?format=json
support~pagelist
support (json format only)/gmod/
redirect support- This means you can safely redirect all gmod links from
wiki.facepunch.com
togmodwiki.com
- This means you can safely redirect all gmod links from
- "Copy markdown link" button (Thanks TankNut!)
- Keyboard navigation/highlighting support for the sidebar
- All external links open in a new tab
Current limitations:
- No Editing (will not implement)
- No change history (probably won't implement)
- All images are mirrored into the
.webp
format, which has somewhat limited browser support - The main page script.js is self-hosted and modified (for performance), meaning any useful updates will need to be manually backported
A docker image is provided to support self-hosting use cases.
The image is about 160mb, making it reasonably portable and quick to download π
First, be sure you have Docker installed.
Run the wiki in the background:
docker run --name gmodwiki -p 127.0.0.1:4321:4321 --rm -d ghcr.io/cfc-servers/gmodwiki:latest
Then visit http://localhost:4321
in your browser.
Stopping the background container:
docker stop --time 1 gmodwiki
With docker compose
Useful if you want to leave the site running at all times
π Instructions
Download the docker-compose.yml
file from this repository and put it somewhere on your machine.
Then, simply docker compose up
(or docker-compose up
for older docker
engines).
You can easily configure the Host and Port when using docker compose.
First, create a .env
file in the same directory as the docker-compose.yml
, in the format of:
GMODWIKI_HOST=127.0.0.1
GMODWIKI_PORT=4321
Then you can change the Host or Port in that file, and then run docker compose up
again.
If you want to expose the wiki instance to the world (not recommended without a reverse proxy like Nginx, and especially not without Cloudflare):
- Set
GMODWIKI_HOST=0.0.0.0
- Forward your chosen port (
4321
by default) in your router/firewall - Visit your public IP in your browser:
http://<your IP>:<your port>
If you want to run another global instance for redundancy / host your own version
π Instructions
This mirror is made to run on Cloudflare. Deploying is really easy, simply clone the project and run:
npm i;
npm run build;
npm run pages:deploy;
Follow the auth/setup prompts from wrangler
.
Then:
- Visit your Cloudflare dashboard
- Select "Workers and Pages" from the sidebar
- Click on your
gmodwiki
instance - Verify that it deployed correctly and that you can visit the latest
.pages.dev
site listed on the page
If you have your own domain:
- Go to the "Custom Domains" tab and click "Set up a custom domain" to connect your own domain
Navigate to Cache Rules:
?format=json
redirect
gmodwiki.com
with your domain!
/gmod/
redirect
Now, wait about 30 seconds, and then try:
- Visiting:
https://<YOUR DOMAIN>/Player_Animations?format=json
and verify that you're redirected to:https://<YOUR DOMAIN>/content/Player_Animations.json
- Visiting:
https://<YOUR DOMAIN>/gmod/Player_Animations
and verify that you're redirected to:https://<YOUR DOMAIN>/Player_Animations
Search Caching Rule (needs to be first in the rule list):
Primary Caching Rule:
- Edge Cache: 3 days
- Brower Cache: 1 day
gmodwiki.com
with your domain!
π Instructions/Details
Development should be fairly simple:
npm i;
npm run build;
npm run astrobuild;
npm run preview;
- The first
npm run build
will take awhile as it scrapes the main website - Those building on windows may need to run the following command to fix issues with
sharp
npm install --force @img/sharp-win32-x64
- Once built:
- All downloaded page content will be cached into
./build/cache/
- All downloaded static content will be cached to
./public/
- You can remove either of these directories if you need to re-parse the remote content again
- All downloaded page content will be cached into
- By default,
npm run astrobuild
will build the site for self hosting, not cloud hosting. If you need to test the cloud environment, you can runexport BUILD_ENV=production
before running the build/preview commands