Skip to content

Commit

Permalink
pick retpack code from newer version of hubs
Browse files Browse the repository at this point in the history
  • Loading branch information
aspalding committed Oct 6, 2023
1 parent 9d49b6f commit a45a551
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
7 changes: 3 additions & 4 deletions RetPageOriginDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
# this dockerfile produces image/container that serves customly packaged hubs and admin static files
# the result container should serve reticulum as "hubs_page_origin" and "admin_page_origin" on (path) "/hubs/pages"
###
from node:16.13 as builder
from node:16.20 as builder
run mkdir -p /hubs/admin/ && cd /hubs
copy package.json ./
copy package-lock.json ./
run npm ci
copy admin/package.json admin/
copy admin/package-lock.json admin/
run cd admin && npm ci && cd ..
run cd admin && npm ci --legacy-peer-deps && cd ..
copy . .
env BASE_ASSETS_PATH="{{rawhubs-base-assets-path}}"
run npm run build 1> /dev/null
copy scripts/docker/turkey-swaps/admin-menu.js admin/src/react-components/admin-menu.js
run cd admin && npm run build 1> /dev/null && cp -R dist/* ../dist && cd ..
run mkdir -p dist/pages && mv dist/*.html dist/pages && mv dist/hub.service.js dist/pages && mv dist/schema.toml dist/pages
run mkdir /hubs/rawhubs && mv dist/pages /hubs/rawhubs && mv dist/assets /hubs/rawhubs && mv dist/react-components /hubs/rawhubs/pages && mv dist/favicon.ico /hubs/rawhubs/pages
run mkdir /hubs/rawhubs && mv dist/pages /hubs/rawhubs && mv dist/assets /hubs/rawhubs && mv dist/favicon.ico /hubs/rawhubs/pages

from alpine/openssl as ssl
run mkdir /ssl && openssl req -x509 -newkey rsa:2048 -sha256 -days 36500 -nodes -keyout /ssl/key -out /ssl/cert -subj '/CN=hubs'
Expand Down
18 changes: 18 additions & 0 deletions retpack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

if ! command -v docker &> /dev/null; then
echo "ERR: this script requires docker (https://docs.docker.com/engine/install/)"
exit 1
fi

DOCKER_DEFAULT_PLATFORM=linux/amd64
echo -e "\n ### building ### "
docker build -f RetPageOriginDockerfile -t hubs:retpack .

echo -e "\n ### packing ### "
docker run -v $PWD/.retpack/:/tmp/ \
--entrypoint sh hubs:retpack \
-c 'cd /www/hubs/ && tar -czvf /tmp/retpack.tar.gz .'

echo -e "\n ### done ### "
ls -lha ./.retpack/retpack.tar.gz

0 comments on commit a45a551

Please sign in to comment.