freemt
commited on
Commit
•
10f2d95
1
Parent(s):
303d329
Update requirements.txt
Browse files- .stignore +101 -0
- install-sw.sh +23 -0
- install-sw1.sh +25 -0
- okteto.yml +45 -0
- requirements.txt +24 -0
- setup_12.x +362 -0
- start-sshd.sh +2 -0
.stignore
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.git
|
2 |
+
# Byte-compiled / optimized / DLL files
|
3 |
+
__pycache__
|
4 |
+
*.py[cod]
|
5 |
+
*$py.class
|
6 |
+
|
7 |
+
# C extensions
|
8 |
+
*.so
|
9 |
+
|
10 |
+
# Distribution / packaging
|
11 |
+
.Python
|
12 |
+
build
|
13 |
+
develop-eggs
|
14 |
+
dist
|
15 |
+
downloads
|
16 |
+
eggs
|
17 |
+
.eggs
|
18 |
+
lib
|
19 |
+
lib64
|
20 |
+
parts
|
21 |
+
sdist
|
22 |
+
var
|
23 |
+
wheels
|
24 |
+
pip-wheel-metadata
|
25 |
+
share/python-wheels
|
26 |
+
*.egg-info
|
27 |
+
.installed.cfg
|
28 |
+
*.egg
|
29 |
+
MANIFEST
|
30 |
+
|
31 |
+
# PyInstaller
|
32 |
+
# Usually these files are written by a python script from a template
|
33 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
34 |
+
*.manifest
|
35 |
+
*.spec
|
36 |
+
|
37 |
+
# Installer logs
|
38 |
+
pip-log.txt
|
39 |
+
pip-delete-this-directory.txt
|
40 |
+
|
41 |
+
# Translations
|
42 |
+
*.mo
|
43 |
+
*.pot
|
44 |
+
|
45 |
+
# Django stuff:
|
46 |
+
*.log
|
47 |
+
local_settings.py
|
48 |
+
db.sqlite3
|
49 |
+
|
50 |
+
# Flask stuff:
|
51 |
+
instance
|
52 |
+
.webassets-cache
|
53 |
+
|
54 |
+
# Scrapy stuff:
|
55 |
+
.scrapy
|
56 |
+
|
57 |
+
# Sphinx documentation
|
58 |
+
docs/_build
|
59 |
+
|
60 |
+
# PyBuilder
|
61 |
+
target
|
62 |
+
|
63 |
+
# Jupyter Notebook
|
64 |
+
.ipynb_checkpoints
|
65 |
+
|
66 |
+
# IPython
|
67 |
+
profile_default
|
68 |
+
ipython_config.py
|
69 |
+
|
70 |
+
# pyenv
|
71 |
+
.python-version
|
72 |
+
|
73 |
+
# celery beat schedule file
|
74 |
+
celerybeat-schedule
|
75 |
+
|
76 |
+
# SageMath parsed files
|
77 |
+
*.sage.py
|
78 |
+
|
79 |
+
# Environments
|
80 |
+
.env
|
81 |
+
.venv
|
82 |
+
env
|
83 |
+
venv
|
84 |
+
ENV
|
85 |
+
env.bak
|
86 |
+
venv.bak
|
87 |
+
|
88 |
+
# Spyder project settings
|
89 |
+
.spyderproject
|
90 |
+
.spyproject
|
91 |
+
|
92 |
+
# Rope project settings
|
93 |
+
.ropeproject
|
94 |
+
|
95 |
+
# mypy
|
96 |
+
.mypy_cache
|
97 |
+
.dmypy.json
|
98 |
+
dmypy.json
|
99 |
+
|
100 |
+
# Pyre type checker
|
101 |
+
.pyre
|
install-sw.sh
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# pip install pipx
|
2 |
+
# pipx install poetry
|
3 |
+
# pipx ensurepath
|
4 |
+
# source ~/.bashrc
|
5 |
+
|
6 |
+
# curl -sSL https://install.python-poetry.org | python3 -
|
7 |
+
# -C- continue -S show error -o output
|
8 |
+
curl -sSL -C- -o install-poetry.py https://install.python-poetry.org
|
9 |
+
python install-poetry.py
|
10 |
+
rm install-poetry.py
|
11 |
+
echo export PATH=~/.local/bin:$PATH > ~/.bashrc
|
12 |
+
source ~/.bashrc
|
13 |
+
# ~/.local/bin/poetry install
|
14 |
+
|
15 |
+
wget -c https://deb.nodesource.com/setup_14.x
|
16 |
+
bash setup_14.x
|
17 |
+
apt-get install -y nodejs
|
18 |
+
npm install -g npm@latest
|
19 |
+
npm install -g nodemon
|
20 |
+
rm setup_14.x
|
21 |
+
|
22 |
+
# apt upate # alerady done in apt-get install -y nodejs
|
23 |
+
apt install byobu -y > /dev/null 2>&1
|
install-sw1.sh
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# pip install pipx
|
2 |
+
# pipx install poetry
|
3 |
+
# pipx ensurepath
|
4 |
+
# source ~/.bashrc
|
5 |
+
|
6 |
+
# curl -sSL https://install.python-poetry.org | python3 -
|
7 |
+
# -C- continue -S show error -o output
|
8 |
+
curl -sSL -C- -o install-poetry.py https://install.python-poetry.org
|
9 |
+
python install-poetry.py
|
10 |
+
rm install-poetry.py
|
11 |
+
echo export PATH=~/.local/bin:$PATH > ~/.bashrc
|
12 |
+
source ~/.bashrc
|
13 |
+
# ~/.local/bin/poetry install
|
14 |
+
|
15 |
+
wget -c https://deb.nodesource.com/setup_12.x
|
16 |
+
bash setup_14.x
|
17 |
+
apt-get install -y nodejs
|
18 |
+
npm install -g npm@latest
|
19 |
+
npm install -g nodemon
|
20 |
+
rm setup_14.x
|
21 |
+
|
22 |
+
# apt update # alerady done in apt-get install -y nodejs
|
23 |
+
apt install byobu -y > /dev/null 2>&1
|
24 |
+
byobu-enable
|
25 |
+
byobu
|
okteto.yml
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: gradio-cmat
|
2 |
+
|
3 |
+
# The build section defines how to build the images of
|
4 |
+
# your development environment
|
5 |
+
# More info: https://www.okteto.com/docs/reference/manifest/#build
|
6 |
+
# build:
|
7 |
+
# my-service:
|
8 |
+
# context: .
|
9 |
+
|
10 |
+
# The deploy section defines how to deploy your development environment
|
11 |
+
# More info: https://www.okteto.com/docs/reference/manifest/#deploy
|
12 |
+
# deploy:
|
13 |
+
# commands:
|
14 |
+
# - name: Deploy
|
15 |
+
# command: echo 'Replace this line with the proper 'helm'
|
16 |
+
|
17 |
+
# or 'kubectl' commands to deploy your development environment'
|
18 |
+
|
19 |
+
# The dependencies section defines other git repositories to be
|
20 |
+
# deployed as part of your development environment
|
21 |
+
# More info: https://www.okteto.com/docs/reference/manifest/#dependencies
|
22 |
+
# dependencies:
|
23 |
+
# - https://github.com/okteto/sample
|
24 |
+
# The dev section defines how to activate a development container
|
25 |
+
# More info: https://www.okteto.com/docs/reference/manifest/#dev
|
26 |
+
dev:
|
27 |
+
gradio-cmat:
|
28 |
+
# image: okteto/dev:latest
|
29 |
+
# image: python:3.8.13-bullseye
|
30 |
+
# image: simbachain/poetry-3.8
|
31 |
+
image: python:3.8
|
32 |
+
command: bash
|
33 |
+
workdir: /usr/src/app
|
34 |
+
sync:
|
35 |
+
- .:/usr/src/app
|
36 |
+
environment:
|
37 |
+
- name=$USER
|
38 |
+
forward:
|
39 |
+
- 7861:7861
|
40 |
+
- 7860:7860
|
41 |
+
- 8501:8501
|
42 |
+
- 22:22
|
43 |
+
reverse:
|
44 |
+
- 9000:9000
|
45 |
+
autocreate: true
|
requirements.txt
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
anyio==3.6.1 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
2 |
+
asttokens==2.0.8 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
3 |
+
certifi==2022.6.15 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
4 |
+
click==8.1.3 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
5 |
+
colorama==0.4.5 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
6 |
+
environs==9.5.0 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
7 |
+
executing==1.0.0 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
8 |
+
h11==0.12.0 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
9 |
+
httpcore==0.15.0 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
10 |
+
httpx==0.23.0 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
11 |
+
icecream==2.1.3 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
12 |
+
idna==3.3 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
13 |
+
install==1.3.5 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
14 |
+
logzero==1.7.0 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
15 |
+
marshmallow==3.17.1 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
16 |
+
packaging==21.3 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
17 |
+
pygments==2.13.0 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
18 |
+
pyparsing==3.0.9 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
19 |
+
python-dotenv==0.21.0 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
20 |
+
rfc3986[idna2008]==1.5.0 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
21 |
+
set-loglevel==0.1.2 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
22 |
+
six==1.16.0 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
23 |
+
sniffio==1.3.0 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
24 |
+
typer==0.4.2 ; python_full_version >= "3.8.3" and python_full_version < "4.0.0"
|
setup_12.x
ADDED
@@ -0,0 +1,362 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
# Discussion, issues and change requests at:
|
4 |
+
# https://github.com/nodesource/distributions
|
5 |
+
#
|
6 |
+
# Script to install the NodeSource Node.js 12.x repo onto a
|
7 |
+
# Debian or Ubuntu system.
|
8 |
+
#
|
9 |
+
# Run as root or insert `sudo -E` before `bash`:
|
10 |
+
#
|
11 |
+
# curl -sL https://deb.nodesource.com/setup_12.x | bash -
|
12 |
+
# or
|
13 |
+
# wget -qO- https://deb.nodesource.com/setup_12.x | bash -
|
14 |
+
#
|
15 |
+
# CONTRIBUTIONS TO THIS SCRIPT
|
16 |
+
#
|
17 |
+
# This script is built from a template in
|
18 |
+
# https://github.com/nodesource/distributions/tree/master/deb/src
|
19 |
+
# please don't submit pull requests against the built scripts.
|
20 |
+
#
|
21 |
+
|
22 |
+
|
23 |
+
export DEBIAN_FRONTEND=noninteractive
|
24 |
+
SCRSUFFIX="_12.x"
|
25 |
+
NODENAME="Node.js 12.x"
|
26 |
+
NODEREPO="node_12.x"
|
27 |
+
NODEPKG="nodejs"
|
28 |
+
|
29 |
+
print_status() {
|
30 |
+
echo
|
31 |
+
echo "## $1"
|
32 |
+
echo
|
33 |
+
}
|
34 |
+
|
35 |
+
if test -t 1; then # if terminal
|
36 |
+
ncolors=$(which tput > /dev/null && tput colors) # supports color
|
37 |
+
if test -n "$ncolors" && test $ncolors -ge 8; then
|
38 |
+
termcols=$(tput cols)
|
39 |
+
bold="$(tput bold)"
|
40 |
+
underline="$(tput smul)"
|
41 |
+
standout="$(tput smso)"
|
42 |
+
normal="$(tput sgr0)"
|
43 |
+
black="$(tput setaf 0)"
|
44 |
+
red="$(tput setaf 1)"
|
45 |
+
green="$(tput setaf 2)"
|
46 |
+
yellow="$(tput setaf 3)"
|
47 |
+
blue="$(tput setaf 4)"
|
48 |
+
magenta="$(tput setaf 5)"
|
49 |
+
cyan="$(tput setaf 6)"
|
50 |
+
white="$(tput setaf 7)"
|
51 |
+
fi
|
52 |
+
fi
|
53 |
+
|
54 |
+
print_bold() {
|
55 |
+
title="$1"
|
56 |
+
text="$2"
|
57 |
+
|
58 |
+
echo
|
59 |
+
echo "${red}================================================================================${normal}"
|
60 |
+
echo "${red}================================================================================${normal}"
|
61 |
+
echo
|
62 |
+
echo -e " ${bold}${yellow}${title}${normal}"
|
63 |
+
echo
|
64 |
+
echo -en " ${text}"
|
65 |
+
echo
|
66 |
+
echo "${red}================================================================================${normal}"
|
67 |
+
echo "${red}================================================================================${normal}"
|
68 |
+
}
|
69 |
+
|
70 |
+
bail() {
|
71 |
+
echo 'Error executing command, exiting'
|
72 |
+
exit 1
|
73 |
+
}
|
74 |
+
|
75 |
+
exec_cmd_nobail() {
|
76 |
+
echo "+ $1"
|
77 |
+
bash -c "$1"
|
78 |
+
}
|
79 |
+
|
80 |
+
exec_cmd() {
|
81 |
+
exec_cmd_nobail "$1" || bail
|
82 |
+
}
|
83 |
+
|
84 |
+
node_deprecation_warning() {
|
85 |
+
if [[ "X${NODENAME}" == "Xio.js 1.x" ||
|
86 |
+
"X${NODENAME}" == "Xio.js 2.x" ||
|
87 |
+
"X${NODENAME}" == "Xio.js 3.x" ||
|
88 |
+
"X${NODENAME}" == "XNode.js 0.10" ||
|
89 |
+
"X${NODENAME}" == "XNode.js 0.12" ||
|
90 |
+
"X${NODENAME}" == "XNode.js 4.x LTS Argon" ||
|
91 |
+
"X${NODENAME}" == "XNode.js 5.x" ||
|
92 |
+
"X${NODENAME}" == "XNode.js 6.x LTS Boron" ||
|
93 |
+
"X${NODENAME}" == "XNode.js 7.x" ||
|
94 |
+
"X${NODENAME}" == "XNode.js 8.x LTS Carbon" ||
|
95 |
+
"X${NODENAME}" == "XNode.js 9.x" ||
|
96 |
+
"X${NODENAME}" == "XNode.js 10.x" ||
|
97 |
+
"X${NODENAME}" == "XNode.js 11.x" ||
|
98 |
+
"X${NODENAME}" == "XNode.js 12.x" ||
|
99 |
+
"X${NODENAME}" == "XNode.js 13.x" ||
|
100 |
+
"X${NODENAME}" == "XNode.js 15.x" ||
|
101 |
+
"X${NODENAME}" == "XNode.js 17.x" ]]; then
|
102 |
+
|
103 |
+
print_bold \
|
104 |
+
" DEPRECATION WARNING " "\
|
105 |
+
${bold}${NODENAME} is no longer actively supported!${normal}
|
106 |
+
|
107 |
+
${bold}You will not receive security or critical stability updates${normal} for this version.
|
108 |
+
|
109 |
+
You should migrate to a supported version of Node.js as soon as possible.
|
110 |
+
Use the installation script that corresponds to the version of Node.js you
|
111 |
+
wish to install. e.g.
|
112 |
+
|
113 |
+
* ${green}https://deb.nodesource.com/setup_14.x — Node.js 14 LTS \"Fermium\"${normal} (recommended)
|
114 |
+
* ${green}https://deb.nodesource.com/setup_16.x — Node.js 16 \"Gallium\"${normal}
|
115 |
+
* ${green}https://deb.nodesource.com/setup_18.x — Node.js 18 \"Eighteen\"${normal} (current)
|
116 |
+
|
117 |
+
Please see ${bold}https://github.com/nodejs/Release${normal} for details about which
|
118 |
+
version may be appropriate for you.
|
119 |
+
|
120 |
+
The ${bold}NodeSource${normal} Node.js distributions repository contains
|
121 |
+
information both about supported versions of Node.js and supported Linux
|
122 |
+
distributions. To learn more about usage, see the repository:
|
123 |
+
${bold}https://github.com/nodesource/distributions${normal}
|
124 |
+
"
|
125 |
+
echo
|
126 |
+
echo "Continuing in 20 seconds ..."
|
127 |
+
echo
|
128 |
+
sleep 20
|
129 |
+
fi
|
130 |
+
}
|
131 |
+
|
132 |
+
script_deprecation_warning() {
|
133 |
+
if [ "X${SCRSUFFIX}" == "X" ]; then
|
134 |
+
print_bold \
|
135 |
+
" SCRIPT DEPRECATION WARNING " "\
|
136 |
+
This script, located at ${bold}https://deb.nodesource.com/setup${normal}, used to
|
137 |
+
install Node.js 0.10, is deprecated and will eventually be made inactive.
|
138 |
+
|
139 |
+
You should use the script that corresponds to the version of Node.js you
|
140 |
+
wish to install. e.g.
|
141 |
+
|
142 |
+
* ${green}https://deb.nodesource.com/setup_14.x — Node.js 14 LTS \"Fermium\"${normal} (recommended)
|
143 |
+
* ${green}https://deb.nodesource.com/setup_16.x — Node.js 16 \"Gallium\"${normal}
|
144 |
+
* ${green}https://deb.nodesource.com/setup_18.x — Node.js 18 \"Eighteen\"${normal} (current)
|
145 |
+
|
146 |
+
Please see ${bold}https://github.com/nodejs/Release${normal} for details about which
|
147 |
+
version may be appropriate for you.
|
148 |
+
|
149 |
+
The ${bold}NodeSource${normal} Node.js Linux distributions GitHub repository contains
|
150 |
+
information about which versions of Node.js and which Linux distributions
|
151 |
+
are supported and how to use the install scripts.
|
152 |
+
${bold}https://github.com/nodesource/distributions${normal}
|
153 |
+
"
|
154 |
+
|
155 |
+
echo
|
156 |
+
echo "Continuing in 20 seconds (press Ctrl-C to abort) ..."
|
157 |
+
echo
|
158 |
+
sleep 20
|
159 |
+
fi
|
160 |
+
}
|
161 |
+
|
162 |
+
setup() {
|
163 |
+
|
164 |
+
script_deprecation_warning
|
165 |
+
node_deprecation_warning
|
166 |
+
|
167 |
+
print_status "Installing the NodeSource ${NODENAME} repo..."
|
168 |
+
|
169 |
+
if $(uname -m | grep -Eq ^armv6); then
|
170 |
+
print_status "You appear to be running on ARMv6 hardware. Unfortunately this is not currently supported by the NodeSource Linux distributions. Please use the 'linux-armv6l' binary tarballs available directly from nodejs.org for Node.js 4 and later."
|
171 |
+
exit 1
|
172 |
+
fi
|
173 |
+
|
174 |
+
PRE_INSTALL_PKGS=""
|
175 |
+
|
176 |
+
# Check that HTTPS transport is available to APT
|
177 |
+
# (Check snaked from: https://get.docker.io/ubuntu/)
|
178 |
+
|
179 |
+
if [ ! -e /usr/lib/apt/methods/https ]; then
|
180 |
+
PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} apt-transport-https"
|
181 |
+
fi
|
182 |
+
|
183 |
+
if [ ! -x /usr/bin/lsb_release ]; then
|
184 |
+
PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} lsb-release"
|
185 |
+
fi
|
186 |
+
|
187 |
+
if [ ! -x /usr/bin/curl ] && [ ! -x /usr/bin/wget ]; then
|
188 |
+
PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} curl"
|
189 |
+
fi
|
190 |
+
|
191 |
+
# Used by apt-key to add new keys
|
192 |
+
|
193 |
+
if [ ! -x /usr/bin/gpg ]; then
|
194 |
+
PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} gnupg"
|
195 |
+
fi
|
196 |
+
|
197 |
+
# Populating Cache
|
198 |
+
print_status "Populating apt-get cache..."
|
199 |
+
exec_cmd 'apt-get update'
|
200 |
+
|
201 |
+
if [ "X${PRE_INSTALL_PKGS}" != "X" ]; then
|
202 |
+
print_status "Installing packages required for setup:${PRE_INSTALL_PKGS}..."
|
203 |
+
# This next command needs to be redirected to /dev/null or the script will bork
|
204 |
+
# in some environments
|
205 |
+
exec_cmd "apt-get install -y${PRE_INSTALL_PKGS} > /dev/null 2>&1"
|
206 |
+
fi
|
207 |
+
|
208 |
+
IS_PRERELEASE=$(lsb_release -d | grep 'Ubuntu .*development' >& /dev/null; echo $?)
|
209 |
+
if [[ $IS_PRERELEASE -eq 0 ]]; then
|
210 |
+
print_status "Your distribution, identified as \"$(lsb_release -d -s)\", is a pre-release version of Ubuntu. NodeSource does not maintain official support for Ubuntu versions until they are formally released. You can try using the manual installation instructions available at https://github.com/nodesource/distributions and use the latest supported Ubuntu version name as the distribution identifier, although this is not guaranteed to work."
|
211 |
+
exit 1
|
212 |
+
fi
|
213 |
+
|
214 |
+
DISTRO=$(lsb_release -c -s)
|
215 |
+
|
216 |
+
check_alt() {
|
217 |
+
if [ "X${DISTRO}" == "X${2}" ]; then
|
218 |
+
echo
|
219 |
+
echo "## You seem to be using ${1} version ${DISTRO}."
|
220 |
+
echo "## This maps to ${3} \"${4}\"... Adjusting for you..."
|
221 |
+
DISTRO="${4}"
|
222 |
+
fi
|
223 |
+
}
|
224 |
+
|
225 |
+
check_alt "SolydXK" "solydxk-9" "Debian" "stretch"
|
226 |
+
check_alt "Kali" "sana" "Debian" "jessie"
|
227 |
+
check_alt "Kali" "kali-rolling" "Debian" "bullseye"
|
228 |
+
check_alt "Sparky Linux" "Tyche" "Debian" "stretch"
|
229 |
+
check_alt "Sparky Linux" "Nibiru" "Debian" "buster"
|
230 |
+
check_alt "Sparky Linux" "Po-Tolo" "Debian" "bullseye"
|
231 |
+
check_alt "MX Linux 17" "Horizon" "Debian" "stretch"
|
232 |
+
check_alt "MX Linux 18" "Continuum" "Debian" "stretch"
|
233 |
+
check_alt "MX Linux 19" "patito feo" "Debian" "buster"
|
234 |
+
check_alt "MX Linux 21" "wildflower" "Debian" "bullseye"
|
235 |
+
check_alt "Linux Mint" "maya" "Ubuntu" "precise"
|
236 |
+
check_alt "Linux Mint" "qiana" "Ubuntu" "trusty"
|
237 |
+
check_alt "Linux Mint" "rafaela" "Ubuntu" "trusty"
|
238 |
+
check_alt "Linux Mint" "rebecca" "Ubuntu" "trusty"
|
239 |
+
check_alt "Linux Mint" "rosa" "Ubuntu" "trusty"
|
240 |
+
check_alt "Linux Mint" "sarah" "Ubuntu" "xenial"
|
241 |
+
check_alt "Linux Mint" "serena" "Ubuntu" "xenial"
|
242 |
+
check_alt "Linux Mint" "sonya" "Ubuntu" "xenial"
|
243 |
+
check_alt "Linux Mint" "sylvia" "Ubuntu" "xenial"
|
244 |
+
check_alt "Linux Mint" "tara" "Ubuntu" "bionic"
|
245 |
+
check_alt "Linux Mint" "tessa" "Ubuntu" "bionic"
|
246 |
+
check_alt "Linux Mint" "tina" "Ubuntu" "bionic"
|
247 |
+
check_alt "Linux Mint" "tricia" "Ubuntu" "bionic"
|
248 |
+
check_alt "Linux Mint" "ulyana" "Ubuntu" "focal"
|
249 |
+
check_alt "Linux Mint" "ulyssa" "Ubuntu" "focal"
|
250 |
+
check_alt "Linux Mint" "uma" "Ubuntu" "focal"
|
251 |
+
check_alt "Linux Mint" "una" "Ubuntu" "focal"
|
252 |
+
check_alt "Linux Mint" "vanessa" "Ubuntu" "jammy"
|
253 |
+
check_alt "LMDE" "betsy" "Debian" "jessie"
|
254 |
+
check_alt "LMDE" "cindy" "Debian" "stretch"
|
255 |
+
check_alt "LMDE" "debbie" "Debian" "buster"
|
256 |
+
check_alt "LMDE" "elsie" "Debian" "bullseye"
|
257 |
+
check_alt "elementaryOS" "luna" "Ubuntu" "precise"
|
258 |
+
check_alt "elementaryOS" "freya" "Ubuntu" "trusty"
|
259 |
+
check_alt "elementaryOS" "loki" "Ubuntu" "xenial"
|
260 |
+
check_alt "elementaryOS" "juno" "Ubuntu" "bionic"
|
261 |
+
check_alt "elementaryOS" "hera" "Ubuntu" "bionic"
|
262 |
+
check_alt "elementaryOS" "odin" "Ubuntu" "focal"
|
263 |
+
check_alt "elementaryOS" "jolnir" "Ubuntu" "focal"
|
264 |
+
check_alt "Trisquel" "toutatis" "Ubuntu" "precise"
|
265 |
+
check_alt "Trisquel" "belenos" "Ubuntu" "trusty"
|
266 |
+
check_alt "Trisquel" "flidas" "Ubuntu" "xenial"
|
267 |
+
check_alt "Trisquel" "etiona" "Ubuntu" "bionic"
|
268 |
+
check_alt "Uruk GNU/Linux" "lugalbanda" "Ubuntu" "xenial"
|
269 |
+
check_alt "BOSS" "anokha" "Debian" "wheezy"
|
270 |
+
check_alt "BOSS" "anoop" "Debian" "jessie"
|
271 |
+
check_alt "BOSS" "drishti" "Debian" "stretch"
|
272 |
+
check_alt "BOSS" "unnati" "Debian" "buster"
|
273 |
+
check_alt "bunsenlabs" "bunsen-hydrogen" "Debian" "jessie"
|
274 |
+
check_alt "bunsenlabs" "helium" "Debian" "stretch"
|
275 |
+
check_alt "bunsenlabs" "lithium" "Debian" "buster"
|
276 |
+
check_alt "Tanglu" "chromodoris" "Debian" "jessie"
|
277 |
+
check_alt "PureOS" "green" "Debian" "sid"
|
278 |
+
check_alt "PureOS" "amber" "Debian" "buster"
|
279 |
+
check_alt "PureOS" "byzantium" "Debian" "bullseye"
|
280 |
+
check_alt "Devuan" "jessie" "Debian" "jessie"
|
281 |
+
check_alt "Devuan" "ascii" "Debian" "stretch"
|
282 |
+
check_alt "Devuan" "beowulf" "Debian" "buster"
|
283 |
+
check_alt "Devuan" "chimaera" "Debian" "bullseye"
|
284 |
+
check_alt "Devuan" "ceres" "Debian" "sid"
|
285 |
+
check_alt "Deepin" "panda" "Debian" "sid"
|
286 |
+
check_alt "Deepin" "unstable" "Debian" "sid"
|
287 |
+
check_alt "Deepin" "stable" "Debian" "buster"
|
288 |
+
check_alt "Pardus" "onyedi" "Debian" "stretch"
|
289 |
+
check_alt "Liquid Lemur" "lemur-3" "Debian" "stretch"
|
290 |
+
check_alt "Astra Linux" "orel" "Debian" "stretch"
|
291 |
+
check_alt "Ubilinux" "dolcetto" "Debian" "stretch"
|
292 |
+
|
293 |
+
if [ "X${DISTRO}" == "Xdebian" ]; then
|
294 |
+
print_status "Unknown Debian-based distribution, checking /etc/debian_version..."
|
295 |
+
NEWDISTRO=$([ -e /etc/debian_version ] && cut -d/ -f1 < /etc/debian_version)
|
296 |
+
if [ "X${NEWDISTRO}" == "X" ]; then
|
297 |
+
print_status "Could not determine distribution from /etc/debian_version..."
|
298 |
+
else
|
299 |
+
DISTRO=$NEWDISTRO
|
300 |
+
print_status "Found \"${DISTRO}\" in /etc/debian_version..."
|
301 |
+
fi
|
302 |
+
fi
|
303 |
+
|
304 |
+
print_status "Confirming \"${DISTRO}\" is supported..."
|
305 |
+
|
306 |
+
if [ -x /usr/bin/curl ]; then
|
307 |
+
exec_cmd_nobail "curl -sLf -o /dev/null 'https://deb.nodesource.com/${NODEREPO}/dists/${DISTRO}/Release'"
|
308 |
+
RC=$?
|
309 |
+
else
|
310 |
+
exec_cmd_nobail "wget -qO /dev/null -o /dev/null 'https://deb.nodesource.com/${NODEREPO}/dists/${DISTRO}/Release'"
|
311 |
+
RC=$?
|
312 |
+
fi
|
313 |
+
|
314 |
+
if [[ $RC != 0 ]]; then
|
315 |
+
print_status "Your distribution, identified as \"${DISTRO}\", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support"
|
316 |
+
exit 1
|
317 |
+
fi
|
318 |
+
|
319 |
+
if [ -f "/etc/apt/sources.list.d/chris-lea-node_js-$DISTRO.list" ]; then
|
320 |
+
print_status 'Removing Launchpad PPA Repository for NodeJS...'
|
321 |
+
|
322 |
+
exec_cmd_nobail 'add-apt-repository -y -r ppa:chris-lea/node.js'
|
323 |
+
exec_cmd "rm -f /etc/apt/sources.list.d/chris-lea-node_js-${DISTRO}.list"
|
324 |
+
fi
|
325 |
+
|
326 |
+
print_status 'Adding the NodeSource signing key to your keyring...'
|
327 |
+
keyring='/usr/share/keyrings'
|
328 |
+
node_key_url="https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
|
329 |
+
local_node_key="$keyring/nodesource.gpg"
|
330 |
+
|
331 |
+
if [ -x /usr/bin/curl ]; then
|
332 |
+
exec_cmd "curl -s $node_key_url | gpg --dearmor | tee $local_node_key >/dev/null"
|
333 |
+
else
|
334 |
+
exec_cmd "wget -q -O - $node_key_url | gpg --dearmor | tee $local_node_key >/dev/null"
|
335 |
+
fi
|
336 |
+
|
337 |
+
print_status "Creating apt sources list file for the NodeSource ${NODENAME} repo..."
|
338 |
+
|
339 |
+
exec_cmd "echo 'deb [signed-by=$local_node_key] https://deb.nodesource.com/${NODEREPO} ${DISTRO} main' > /etc/apt/sources.list.d/nodesource.list"
|
340 |
+
exec_cmd "echo 'deb-src [signed-by=$local_node_key] https://deb.nodesource.com/${NODEREPO} ${DISTRO} main' >> /etc/apt/sources.list.d/nodesource.list"
|
341 |
+
|
342 |
+
print_status 'Running `apt-get update` for you...'
|
343 |
+
|
344 |
+
exec_cmd 'apt-get update'
|
345 |
+
|
346 |
+
yarn_site='https://dl.yarnpkg.com/debian'
|
347 |
+
yarn_key_url="$yarn_site/pubkey.gpg"
|
348 |
+
local_yarn_key="$keyring/yarnkey.gpg"
|
349 |
+
|
350 |
+
print_status """Run \`${bold}sudo apt-get install -y ${NODEPKG}${normal}\` to install ${NODENAME} and npm
|
351 |
+
## You may also need development tools to build native addons:
|
352 |
+
sudo apt-get install gcc g++ make
|
353 |
+
## To install the Yarn package manager, run:
|
354 |
+
curl -sL $yarn_key_url | gpg --dearmor | sudo tee $local_yarn_key >/dev/null
|
355 |
+
echo \"deb [signed-by=$local_yarn_key] $yarn_site stable main\" | sudo tee /etc/apt/sources.list.d/yarn.list
|
356 |
+
sudo apt-get update && sudo apt-get install yarn
|
357 |
+
"""
|
358 |
+
|
359 |
+
}
|
360 |
+
|
361 |
+
## Defer setup until we have the complete script
|
362 |
+
setup
|
start-sshd.sh
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
apt update && apt-get install openssh-server -y
|
2 |
+
/etc/init.d/ssh restart && mkdir -p ~/.ssh && echo ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOl+SiDFL1ZUh1QJ0454eYKtamkMCVs2hhuv3cWN1LU7 id_ed25519_colab > ~/.ssh/authorized_keys && echo cd /usr/src/app/ >> ~/.bashrc
|