Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create binaries for Windows, macOS, and Linux #11

Open
jef opened this issue Sep 18, 2020 · 9 comments
Open

Create binaries for Windows, macOS, and Linux #11

jef opened this issue Sep 18, 2020 · 9 comments

Comments

@jef
Copy link
Owner

jef commented Sep 18, 2020

Description

It'd be better to create binaries and distribute through Releases in GitHub rather than people download Node.js and go through npm.

Possible solution

Use pkg or something similar.

@jef jef self-assigned this Sep 18, 2020
@Tim-Nosco
Copy link

Tim-Nosco commented Sep 19, 2020

I got close to a working docker build, but the chromium sandbox doesn't seem to work well in the container.

from ubuntu:20.04

env debian_frontend=noninteractive
run apt update && apt install -y git curl \
	libglib2.0-0 libnss3 libatk1.0-0 libatk-bridge2.0-0 libx11-xcb1 libxcb-dri3-0 \
	libxcomposite1 libxdamage1 libxfixes3 libcups2 libdrm2 libxrandr2 libgbm1 \
	libasound2 libpangocairo-1.0-0 libgtk3.0-cil

run curl -sL https://deb.nodesource.com/setup_12.x | bash -
run apt install -y nodejs

workdir /home/runner
copy . .
run npm install

run useradd -m runner
run chown -R runner:runner /home/runner 

env SANDBOX="/home/runner/node_modules/puppeteer/.local-chromium/linux-800071/chrome-linux/chrome_sandbox"
run chown root:root ${SANDBOX} && chmod 4755 ${SANDBOX}

user runner
ENV CHROME_DEVEL_SANDBOX=${SANDBOX}
run npm run start

@jef
Copy link
Owner Author

jef commented Sep 19, 2020

but the chromium sandbox doesn't seem to work well in the container

This was my thoughts exactly... I was gonna publish that route and then distribute easier with Docker images, but could run into more problems that way with people's OSes. *nix based machines handle these a lot easier, but could be a problem.

Also I was considering the open dependency. Not sure if it would open unless we did some volume mounting -- and I don't know if that would even work.

@mr-sour
Copy link
Contributor

mr-sour commented Sep 21, 2020

I did get sandboxing working in docker. I'll look into x11 forwarding but I think on not linux systems it will require an additional package. It would still be just 2 packages to install and 1 command vs actually building it. we can also set it up to just have a docker build script and then provide commands to extract the finished files out of the container and have it run that.

@itsandreramon
Copy link

This is my dockerfile, which works fine in app engine:

FROM node:14-slim

RUN apt-get update \
    && apt-get install -y wget gnupg \
    && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
      --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*

# Install puppeteer so it's available in the container.
RUN npm i puppeteer \
    && groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
    && mkdir -p /home/pptruser/Downloads \
    && chown -R pptruser:pptruser /home/pptruser \
    && chown -R pptruser:pptruser /node_modules

# Everything else
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY ./build .
COPY .env ../.
EXPOSE 80

# Run everything after as non-privileged user.
USER pptruser

CMD [ "node", "index.js"]

@cgarrovillo
Copy link

cgarrovillo commented Dec 1, 2020

Quick q. Don't you think that adding binaries will make it easier for people to use this, thus making it easier for companies to find ways to ban tools like this? (based on it's popularity).

Granted, it is the point of open-source so potato potata

@Skhmt
Copy link

Skhmt commented Dec 4, 2020

It opens chromium, goes to the websites, and scrapes them. There's not much they can do to stop this software.

@jef
Copy link
Owner Author

jef commented Dec 6, 2020

making it easier for companies to find ways to ban tools like this

I think this is a positive. It would be unfortunate for this project and would have to shift, but to have merchandisers improve their point of sale based on this sort of project would be awesome!

@cgarrovillo
Copy link

right. I guess is shouldnt come to this with an exclusivity mindset in mind. +1

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants