majodev / google-webfonts-helper

A Hassle-Free Way to Self-Host Google Fonts. Get eot, ttf, svg, woff and woff2 files + CSS snippets
https://gwfh.mranftl.com
MIT License
12.02k stars 420 forks source link

Self Hosted Alternative #159

Closed otherwiseGG closed 1 year ago

otherwiseGG commented 1 year ago

Hey!

To avoid Downtime we wanted to host this Instance internally ourselfs and tried to set it up. Switched Arround in Node Versions and followed Comments as for example in #131 or #48.

Unfortunately, we cannot get it running as it seems to interfere with the State of the Project (Old Dependencies, Newer OS Versions etc.) as we keep on getting error upon error.

Is there some guide somewhere / comment where someone explains on how to Self-Host this internally at the current time and not from like... 7-8 years ago?

Thanks in advance!

rponline commented 1 year ago

Oh, it's offline!

@otherwiseGG How I got this software running (on a Debian):

{
  "name": "google-webfonts-helper",
  "version": "0.0.0",
  "dependencies": {
    "angular": "~1.2.*",
    "json3": "~3.3.1",
    "es5-shim": "~3.0.1",
    "jquery": "~1.11.0",
    "bootstrap": "~3.1.1",
    "angular-resource": "~1.2.*",
    "angular-cookies": "~1.2.*",
    "angular-sanitize": "~1.2.*",
    "angular-bootstrap": "~0.11.0",
    "font-awesome": "~4.1.0",
    "lodash": "~2.4.1",
    "angular-ui-router": "~0.2.10",
    "angular-busy": "~4.1.2",
    "highlightjs": "~8.4.0"
  },
  "devDependencies": {
    "angular-mocks": "~1.2.*",
    "angular-scenario": "~1.2.*"
  }
}

Be aware that this old libraries may contain security vulnerabilities.
Cheers!

lxbdr commented 1 year ago

@rponline thanks for pointing out some of the issues... I spent the last few hours trying to make it work in a docker container but I'm encountering loads of issues

What I got so far:

Not yet resolved:

My docker-compose.yml so far:

version: "2"

services:
  node:
    image: "node:0.10.44"
    user: "www-data"
    working_dir: /var/www
    environment:
      - NODE_ENV=development
    volumes:
      - ./:/var/www
    expose:
      - "9000"
    ports:
      - "9000"
      - "8080"
    command:
      - /bin/sh
      - -c
      - |
        npm install
        npm install grunt-cli@0.1.13 --save-dev
        npm install bower@1.3.5 --save-dev
        node_modules/bower/bin/bower install
        mkdir -p client/bower_components
        npm run build
        ln -s dist/public public
        npm run serve

additions to package.json to make local grunt work with npm run xxx

"scripts": {
    "start": "node server/app.js",
    "test": "grunt test",
    "build": "grunt --verbose --force build",
    "serve": "grunt --verbose --force serve",
    "update-webdriver": "node node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update"
  },
otherwiseGG commented 1 year ago

@rponline

Thank you so much for your Awnser! This seems to be something we should be able to reproduce!

rponline commented 1 year ago

oh i forgot grunt!

npm install -g grunt@0.4.5
npm install -g grunt-cli@1.2.0
rponline commented 1 year ago

@lxbdr i don't get why you have to create the directory manually:

mkdir -p client/bower_components

At least it worked for me without. I guess it gets created with bower install. Maybe installing bower globally, changes sth?

This is the path, where bootstrap.less is located (relative to git project root):

client/bower_components/bootstrap/less/bootstrap.less
TechnologyClassroom commented 1 year ago

@rponline This comment should be a pull request with an update to bower.js and documentation in the README.

majodev commented 1 year ago

A proper Dockerfile and setup is now in master. Please check the latest README

jwittorf commented 1 year ago

A proper Dockerfile and setup is now in master. Please check the latest README

Thanks for that! If anybody stumbles upon this and has the issue with their Apple/Mac M1, change the top line of the Dockerfile to: FROM --platform=linux/amd64 debian:bullseye AS development

old: I just tried it but the NodeJS download from https://nodejs.org/dist/v0.10.44/node-v0.10.44-linux-arm64.tar.xz fails:

 => ERROR [development 6/8] RUN mkdir -p /home/node/.nvm     && curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash     && . /home/node/.nvm/nvm.sh     && nvm install 0.10.44     && nvm alias default 0.10.44     && nvm use default              7.0s
------                                                                                                                                                                                                                                                                           
 > [development 6/8] RUN mkdir -p /home/node/.nvm     && curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash     && . /home/node/.nvm/nvm.sh     && nvm install 0.10.44     && nvm alias default 0.10.44     && nvm use default:                         
#0 0.155   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                                                                                                                                                                         
#0 0.155                                  Dload  Upload   Total   Spent    Left  Speed                                                                                                                                                                                           
100 15916  100 15916    0     0   272k      0 --:--:-- --:--:-- --:--:--  272k                                                                                                                                                                                                   
#0 0.220 => Downloading nvm from git to '/home/node/.nvm'                                                                                                                                                                                                                        
=> Cloning into '/home/node/.nvm'...
#0 1.782 * (HEAD detached at FETCH_HEAD)
#0 1.782   master
#0 1.785 => Compressing and cleaning up git repository
#0 1.790 
#0 1.794 => Appending nvm source string to /home/node/.bashrc
#0 1.797 => Appending bash_completion source string to /home/node/.bashrc
#0 1.819 => Installing Node.js version 0.10.44
#0 2.235 Downloading and installing node v0.10.44...
#0 2.374 Downloading https://nodejs.org/dist/v0.10.44/node-v0.10.44-linux-arm64.tar.xz...
curl: (22) The requested URL returned error: 404                                       
#0 2.577 
#0 2.585 Binary download from https://nodejs.org/dist/v0.10.44/node-v0.10.44-linux-arm64.tar.xz failed, trying source.
#0 2.588 grep: /home/node/.nvm/.cache/bin/node-v0.10.44-linux-arm64/node-v0.10.44-linux-arm64.tar.xz: No such file or directory
#0 2.589 Provided file to checksum does not exist.
#0 2.595 Binary download failed, trying source.
#0 2.602 Detected that you have 5 CPU core(s)
#0 2.602 Running with 4 threads to speed up the build
#0 2.890 Downloading https://nodejs.org/dist/v0.10.44/node-v0.10.44.tar.xz...
######################################################################## 100.0%        
#0 4.105 Computing checksum with sha256sum
#0 4.137 Checksums matched!
#0 4.735 $>./configure --prefix=/home/node/.nvm/v0.10.44 <
#0 4.736 /usr/bin/env: 'python': No such file or directory
#0 4.736 nvm: install v0.10.44 failed!
#0 4.899 Failed to install Node.js 0.10.44
#0 4.899 => Close and reopen your terminal to start using nvm or run the following to use it now:
#0 4.899 
#0 4.899 export NVM_DIR="$HOME/.nvm"
#0 4.899 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
#0 4.899 [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
#0 5.340 Downloading and installing node v0.10.44...
#0 5.593 Downloading https://nodejs.org/dist/v0.10.44/node-v0.10.44-linux-arm64.tar.xz...
curl: (22) The requested URL returned error: 404                                       
#0 6.048 
#0 6.065 Binary download from https://nodejs.org/dist/v0.10.44/node-v0.10.44-linux-arm64.tar.xz failed, trying source.
#0 6.069 grep: /home/node/.nvm/.cache/bin/node-v0.10.44-linux-arm64/node-v0.10.44-linux-arm64.tar.xz: No such file or directory
#0 6.070 Provided file to checksum does not exist.
#0 6.077 Binary download failed, trying source.
#0 6.086 Detected that you have 5 CPU core(s)
#0 6.086 Running with 4 threads to speed up the build
#0 6.247 Local cache found: ${NVM_DIR}/.cache/src/node-v0.10.44/node-v0.10.44.tar.xz
#0 6.285 Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/src/node-v0.10.44/node-v0.10.44.tar.xz
#0 6.886 $>./configure --prefix=/home/node/.nvm/v0.10.44 <
#0 6.887 /usr/bin/env: 'python': No such file or directory
#0 6.888 nvm: install v0.10.44 failed!
------
failed to solve: executor failed running [/bin/sh -c mkdir -p $NVM_DIR     && curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash     && . $NVM_DIR/nvm.sh     && nvm install $NODE_VERSION     && nvm alias default $NODE_VERSION     && nvm use default]: exit code: 1
service "service" has no container to start
service "service" is not running container #1

Do you have any tips on how to resolve this?

majodev commented 1 year ago

https://github.com/majodev/google-webfonts-helper/releases/tag/v1.1.0 switches to official Node@v18. However, I don't build/test ARM images currently...