Skip to content

Hosting the pack

Ember Forge writes plugins/EmberForge/output/forge.zip and forge.sha1 on every build. How it reaches players is up to hosting.mode.

Self-host

hosting:
  mode: self-host
  self-host:
    port: 8163
    public-address: "play.example.com"
  send-on-join: true
  prompt: "Server items"

Ember Forge serves the pack itself on that port. Simplest option; the port has to be reachable from the internet.

Folder

hosting:
  mode: folder
  folder:
    publish-dir: "/var/www/pack"
    url: "https://cdn.example.com/pack.zip"
  send-on-join: true

The pack is copied to publish-dir and players are sent url. Use this when nginx, Apache or a CDN already fronts your server.

Sending it yourself

Set send-on-join: false and another plugin can send the pack. Read the hash from forge.sha1 — never hardcode it.

The hash must match the bytes you serve

If the SHA-1 you send does not match the zip the client downloads, the client rejects the pack and every custom model silently disappears. Whatever publishes the file must publish the hash from that same file, in the same step.

A safe publish looks like:

want=$(cat "$FO/forge.sha1")
got=$(sha1sum "$FO/forge.zip" | cut -d' ' -f1)
[ "$want" = "$got" ] || exit 0        # mid-write; try again next tick
cp "$FO/forge.zip" /var/www/pack/pack.zip.tmp
mv -f /var/www/pack/pack.zip.tmp /var/www/pack/pack.zip
printf '%s' "$want" > /var/www/pack/pack.sha1

Copying to a temporary name and moving it into place is what stops a client downloading a half-written zip.