diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fae8897 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5e9881 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.pid +*.exe +*.out +*.bin +*cookie_secret* \ No newline at end of file diff --git a/.global/copy-configs.sh b/.global/copy-configs.sh new file mode 100644 index 0000000..8a718a0 --- /dev/null +++ b/.global/copy-configs.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +echo -e "Copying configurations" +mkdir /etc/jupyter/ + +# Create cookie secret file and proxy authenticator +echo -e "Creating authenticator" +touch /etc/jupyter/proxy_auth_token +chown :sudo /etc/jupyter/proxy_auth_token +chmod g+rw /etc/jupyter/proxy_auth_token +openssl rand -hex 32 > /etc/jupyter/proxy_auth_token +touch /etc/jupyter/jupyterhub_cookie_secret +chown :sudo /etc/jupyter/jupyterhub_cookie_secret +chmod g+rw /etc/jupyter/jupyterhub_cookie_secret +openssl rand -hex 32 > /etc/jupyter/jupyterhub_cookie_secret +chmod 600 /etc/jupyter/jupyterhub_cookie_secret +chmod 600 /etc/jupyter/proxy_auth_token + +echo -e "Installing Login Web Templates..." +rmdir --ignore-fail-on-non-empty /usr/local/share/jupyterhub/static +rmdir --ignore-fail-on-non-empty /usr/local/share/jupyterhub/templates +mkdir /usr/local/share/jupyterhub/static +mkdir /usr/local/share/jupyterhub/templates +cp -TRv ./.global/web-portal/hub-login /usr/local/share/jupyterhub + +echo -e "Coping tutorial notebooks into global folder..." +mkdir /etc/jupyter/tutorials-notebooks +cp -TRv ./.global/tutorials-notebooks /etc/jupyter/tutorials-notebooks +chmod 740 /etc/jupyter/tutorials-notebooks diff --git a/.global/install_pip_npm.sh b/.global/install_pip_npm.sh new file mode 100644 index 0000000..d7964bc --- /dev/null +++ b/.global/install_pip_npm.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +echo -e "Installing NPM Packages" +npm install -g configurable-http-proxy npm@10.8.2 + +echo -e "Installing pre-builds" +pip install --upgrade pip setuptools wheel manimlib pycairo +pip install -r ./.global/pip_packages.txt + +echo -e "Installing IBM-Q Packages" +python3 -m build --verbose --wheel --outdir ./.global/ext-pkg --skip-dependency-check --no-isolation ./.global/ext-pkg/ibm-q-labs/ibm_q_lab_server_extension +python3 -m build --verbose --wheel --outdir ./.global/ext-pkg --skip-dependency-check --no-isolation ./.global/ext-pkg/ibm-q-labs/ibm_q_lab_ui_extensions +python3 -m build --verbose --wheel --outdir ./.global/ext-pkg --skip-dependency-check --no-isolation ./.global/ext-pkg/ibm-q-labs/ibm_quantum_widgets +python3 -m build --verbose --wheel --outdir ./.global/ext-pkg --skip-dependency-check --no-isolation ./.global/ext-pkg/ibm-q-labs/ibmq_jupyter_server_health_ext +python3 -m build --verbose --wheel --outdir ./.global/ext-pkg --skip-dependency-check --no-isolation ./.global/ext-pkg/ibm-q-labs/qiskit-kernel +pip install ./.global/ext-pkg/*.whl --ignore-installed --no-deps + +echo -e "Disabling the classic mode" +jupyter lab build +jupyter labextension enable @jupyterlab/extensionmanager-extension +jupyter labextension enable @jupyterlab/help-extension:launch-classic +jupyter labextension update --all + +echo -e "Cleaning up caches..." +apt autoremove -y +apt-get clean +pip cache purge diff --git a/.global/pip_packages.txt b/.global/pip_packages.txt new file mode 100644 index 0000000..b2b2e1a --- /dev/null +++ b/.global/pip_packages.txt @@ -0,0 +1,543 @@ +addict==2.4.0 +aiofile==3.8.8 +aiofiles==22.1.0 +aiohttp==3.9.5 +aiosignal==1.3.1 +aiosqlite==0.20.0 +alabaster==0.7.16 +alembic==1.13.2 +altair==5.3.0 +amazon-braket-schemas==1.22.0 +annotated-types==0.7.0 +ansi2html==1.9.2 +ansicolors==1.1.8 +ansiwrap==0.8.4 +antlr4-python3-runtime==4.11.1 +anyio==4.4.0 +appdirs==1.4.4 +aquirdturtle-collapsible-headings==3.1.0 +argon2-cffi==23.1.0 +argon2-cffi-bindings==21.2.0 +args==0.1.0 +arraylias==0.1.1 +arrow==1.3.0 +asteval==1.0.1 +asttokens==2.4.1 +async-generator==1.10 +async-lru==2.0.4 +async-timeout==4.0.3 +attrs==23.2.0 +autopep8==2.3.1 +azure-core==1.30.2 +azure-identity==1.17.1 +azure-storage-blob==12.20.0 +Babel==2.15.0 +backcall==0.2.0 +backoff==2.2.1 +backports.entry-points-selectable==1.3.0 +backports.functools-lru-cache==2.0.0 +backports.tarfile==1.2.0 +bcrypt==4.1.3 +beautifulsoup4==4.12.3 +beniget==0.4.2.post1 +black==24.4.2 +bleach==6.1.0 +blinker==1.8.2 +blosc2==2.7.0 +bokeh==3.5.0 +boltons==24.0.0 +boto3==1.34.143 +botocore==1.34.143 +Bottleneck==1.4.0 +Brotli==1.1.0 +brotlipy==0.7.0 +build==1.2.1 +cached-property==1.5.2 +cachetools==5.3.3 +caio==0.9.17 +certifi==2024.7.4 +certipy==0.1.3 +cffi==1.15.0 +chardet==5.2.0 +charset-normalizer==3.3.2 +clarabel==0.9.0 +clear==2.0.0 +cliapp==1.20180812.1 +click==8.1.7 +click-plugins==1.1.1 +cligj==0.7.2 +clint==0.5.1 +cloudpickle==2.2.1 +clr-loader==0.2.6 +cmake==3.30.0 +cmdtest==0.32+git +colorama==0.4.6 +colorcet==3.1.0 +coloredlogs==15.0.1 +colour==0.1.5 +comm==0.2.2 +conan==2.5.0 +contourpy==1.2.1 +coverage==7.6.0 +cryptography==42.0.8 +cuquantum-cu11==24.3.0.post1 +cuquantum-cu12==24.3.0.post1 +custatevec-cu11==1.6.0.post1 +custatevec-cu12==1.6.0.post1 +cutensor-cu11==2.0.2 +cutensor-cu12==2.0.2 +cutensornet-cu11==2.4.0.post1 +cutensornet-cu12==2.4.0.post1 +cvxpy==1.5.2 +cycler==0.12.1 +cysignals==1.11.4 +Cython==3.0.10 +cytoolz==0.12.3 +dash==2.17.1 +dash-core-components==2.0.0 +dash-html-components==2.0.0 +dash-table==5.0.0 +dask==2024.7.0 +dbus-next==0.2.3 +debugpy==1.8.2 +decorator==5.1.1 +defusedxml==0.7.1 +Deprecated==1.2.14 +deprecation==2.1.0 +descartes==1.1.0 +dill==0.3.8 +distlib==0.3.8 +distributed==2024.7.0 +distro==1.8.0 +distro-info==1.0 +docplex==2.27.239 +docutils==0.20.1 +dotnetcore2==3.1.23 +ecos==2.0.14 +entrypoints==0.4 +et-xmlfile==1.1.0 +exceptiongroup==1.2.1 +executing==2.0.1 +fastdtw==0.3.4 +fasteners==0.19 +fastjsonschema==2.20.0 +filelock==3.15.4 +fiona==1.9.6 +Flask==3.0.3 +flatbuffers==24.3.25 +flit_core==3.9.0 +fonttools==4.53.1 +fqdn==1.5.1 +frozendict==2.4.4 +frozenlist==1.4.1 +fs==2.4.16 +fsspec==2024.6.1 +furo==2024.1.29 +future==1.0.0 +gaqqie-door==0.2.0 +gast==0.5.5 +gdspy==1.6.12 +geopandas==0.12.2 +gitdb==4.0.11 +GitPython==3.1.43 +glob2==0.7 +gmpy2==2.2.0 +gmsh==4.11.1 +graphviz==0.20.3 +greenlet==3.0.3 +h11==0.14.0 +h5py==3.11.0 +HeapDict==1.0.1 +html5lib==1.1 +httpcore==1.0.5 +httplib2==0.22.0 +httpx==0.27.0 +humanfriendly==10.0 +idna==3.7 +imagecodecs==2024.6.1 +imageio==2.34.2 +imagesize==1.4.1 +importlib_metadata==8.0.0 +importlib_resources==6.4.0 +inflection==0.5.1 +ipycytoscape==1.3.3 +ipykernel==6.29.5 +ipympl==0.9.4 +ipysheet==0.7.0 +ipython==8.10.0 +ipython-genutils==0.2.0 +ipywidgets==8.1.3 +iqm-client==17.7 +isodate==0.6.1 +isoduration==20.11.0 +isort==5.13.2 +itsdangerous==2.2.0 +jaraco.classes==3.4.0 +jaraco.context==5.3.0 +jaraco.functools==4.0.1 +jedi==0.19.1 +jeepney==0.8.0 +Jinja2==3.1.4 +jlab-enhanced-cell-toolbar==3.5.1 +jmespath==1.0.1 +joblib==1.4.2 +json5==0.9.25 +jsonpickle==3.2.2 +jsonpointer==3.0.0 +jsonschema==4.23.0 +jsonschema-specifications==2023.12.1 +jupyter==1.0.0 +jupyter-archive==3.4.0 +jupyter-console==6.6.3 +jupyter-cpp-kernel==1.0.0a8 +jupyter-events==0.10.0 +jupyter-highlight-selected-word==0.2.0 +jupyter-lsp==2.2.5 +jupyter-resource-usage==1.0.2 +jupyter-server-mathjax==0.2.6 +jupyter-telemetry==0.1.0 +jupyter-ydoc==0.2.5 +jupyter_client==7.4.9 +jupyter_contrib_core==0.4.2 +jupyter_contrib_nbextensions==0.7.0 +jupyter_core==5.7.2 +jupyter_nbextensions_configurator==0.6.4 +jupyter_packaging==0.12.3 +jupyter_server==2.14.1 +jupyter_server_fileid==0.9.2 +jupyter_server_proxy==4.3.0 +jupyter_server_terminals==0.5.3 +jupyter_server_ydoc==0.8.0 +jupyterhub==4.0.2 +jupyterhub-nativeauthenticator==1.2.0 +jupyterlab==3.6.7 +jupyterlab-autoversion==0.3.6 +jupyterlab-dash==0.1.0a3 +jupyterlab-drawio==0.9.0 +jupyterlab-execute-time==2.3.1 +jupyterlab-git==0.39.3 +jupyterlab-image-editor==0.1.0 +jupyterlab-language-pack-de-DE==4.2.post1 +jupyterlab-language-pack-es-ES==4.2.post1 +jupyterlab-language-pack-fr-FR==4.2.post1 +jupyterlab-language-pack-ja-JP==4.2.post1 +jupyterlab-language-pack-ru-RU==4.2.post1 +jupyterlab-language-pack-uk-UA==4.2.post1 +jupyterlab-language-pack-vi-VN==4.2.post1 +jupyterlab-limit-output==2.0.0 +jupyterlab-link-share==0.3.0 +jupyterlab-lsp==4.3.0 +jupyterlab-markup==2.0.0 +jupyterlab-mathjax3==4.3.0 +jupyterlab-pullrequests==3.0.2 +jupyterlab-pytutor==0.2.0 +jupyterlab-skip-traceback==5.1.0 +jupyterlab-spreadsheet-editor==0.7.1 +jupyterlab-vega2==3.2.0 +jupyterlab_cell_flash==0.4.0 +jupyterlab_code_formatter==2.2.1 +jupyterlab_fasta==3.3.0 +jupyterlab_favorites==3.2.2 +jupyterlab_geojson==3.4.0 +jupyterlab_katex==3.4.0 +jupyterlab_kernelspy==4.0.0 +jupyterlab_open_url_parameter==0.3.0 +jupyterlab_pyflyby==5.1.2 +jupyterlab_pygments==0.3.0 +jupyterlab_recents==3.3.0 +jupyterlab_server==2.27.2 +jupyterlab_tour==4.0.1 +jupyterlab_vega3==3.3.0 +jupyterlab_widgets==3.0.11 +kaleidoscope==0.2.0 +keyring==25.2.1 +kiwisolver==1.4.5 +launchpadlib==1.11.0 +lazr.restfulclient==0.14.6 +lazr.uri==1.0.6 +lazy_loader==0.4 +lckr_jupyterlab_variableinspector==3.2.1 +lit==18.1.8 +llvmlite==0.43.0 +lmfit==1.3.1 +locket==1.0.0 +lxml==5.2.2 +lz4==4.3.3 +Mako==1.3.5 +mamba==0.11.3 +manimlib==0.2.0 +mapomatic==0.13.0 +Markdown==3.6 +markdown-it-py==3.0.0 +MarkupSafe==2.1.5 +marshmallow==3.21.3 +matplotlib==3.7.0 +matplotlib-inline==0.1.7 +mdurl==0.1.2 +memory_allocator==0.1.4 +mistune==3.0.2 +more-itertools==10.3.0 +mpmath==1.3.0 +msal==1.29.0 +msal-extensions==1.2.0 +msgpack==1.0.8 +msrest==0.7.1 +multidict==6.0.5 +multiset==3.1.0 +multitasking==0.0.11 +munkres==1.1.4 +mypy-extensions==1.0.0 +Nasdaq-Data-Link==1.0.4 +nbclassic==1.1.0 +nbclient==0.10.0 +nbconvert==7.16.4 +nbdime==3.2.1 +nbformat==5.10.4 +nbgitpuller==1.2.1 +ndindex==1.8 +nest-asyncio==1.6.0 +netifaces==0.11.0 +networkx==3.3 +notebook==6.5.7 +notebook_shim==0.2.4 +ntlm-auth==1.5.0 +numba==0.60.0 +numexpr==2.10.1 +numpy==1.26.4 +nvidia-cublas-cu11==11.11.3.6 +nvidia-cublas-cu12==12.5.3.2 +nvidia-cuda-runtime-cu11==11.8.89 +nvidia-cuda-runtime-cu12==12.5.82 +nvidia-cusolver-cu11==11.4.1.48 +nvidia-cusolver-cu12==11.6.3.83 +nvidia-cusparse-cu11==11.7.5.86 +nvidia-cusparse-cu12==12.5.1.3 +nvidia-nvjitlink-cu12==12.5.82 +nxpd==0.2.0 +oauthlib==3.2.2 +olefile==0.47 +onetimepass==1.0.1 +onnxruntime==1.18.1 +opencv-python==4.10.0.84 +openpulse==0.5.0 +openpyxl==3.1.5 +openqasm3==0.5.0 +opt-einsum==3.3.0 +oqpy==0.3.6 +orjson==3.10.6 +osqp==0.6.7.post0 +overrides==7.7.0 +packaging==24.1 +pamela==1.1.0 +pandas==1.5.3 +pandocfilters==1.5.1 +papermill==2.6.0 +param==2.1.1 +parso==0.8.4 +partd==1.4.2 +patch-ng==1.17.4 +pathspec==0.12.1 +patsy==0.5.6 +pbr==6.0.0 +peewee==3.17.6 +pep517==0.13.1 +pexpect==4.9.0 +pickleshare==0.7.5 +pillow==10.4.0 +Pint==0.20.1 +pip-chill==1.0.3 +pip-review==1.3.0 +pipdeptree==2.23.0 +pkgconfig==1.5.5 +pkgutil_resolve_name==1.3.10 +platformdirs==4.2.2 +plotly==5.22.0 +pluggy==1.5.0 +plumbum==1.8.3 +ply==3.11 +pooch==1.8.2 +portalocker==2.10.0 +primecountpy==0.1.0 +progressbar==2.5 +prometheus_client==0.20.0 +prompt_toolkit==3.0.47 +protobuf==5.27.2 +prototype-zne==1.3.1 +psutil==5.9.8 +ptyprocess==0.7.0 +pure-eval==0.2.2 +py==1.11.0 +py-cpuinfo==9.0.0 +py-spy==0.3.14 +pyaedt==0.6.46 +pybind11==2.13.1 +pycairo==1.26.1 +pycodestyle==2.12.0 +pycparser==2.22 +pyct==0.5.0 +pycurl==7.45.3 +pydantic==2.8.2 +pydantic_core==2.20.1 +pydot==2.0.0 +pydub==0.25.1 +pyEPR-quantum==0.8.5.7 +pyflyby==1.9.4 +Pygments==2.14.0 +PyGObject==3.48.2 +PyJWT==2.8.0 +pylatexenc==2.10 +PyMySQL==1.1.1 +pyOpenSSL==24.1.0 +pyparsing==3.1.2 +pyproj==3.6.1 +pyproject-api==1.7.1 +pyproject_hooks==1.1.0 +pyqir==0.10.3 +pyrsistent==0.20.0 +pyscf==2.6.2 +PySide2==5.15.2.1 +PySocks==1.7.1 +pyspnego==0.11.0 +python-constraint==1.4.0 +python-dateutil==2.9.0.post0 +python-dotenv==1.0.1 +python-json-logger==2.0.7 +python-markdown-math==0.8 +pythonnet==3.0.1 +pythran==0.16.1 +pytz==2024.1 +pyvista==0.44.0 +PyWavelets==1.6.0 +PyYAML==6.0 +pyzmq==26.0.3 +QDarkStyle==3.1 +qdldl==0.1.7.post4 +qiskit==1.1.1 +qiskit-aer==0.14.2 +qiskit-aer-gpu==0.14.2 +qiskit-aer-gpu-cu11==0.14.2 +qiskit-algorithms==0.3.0 +qiskit-aqt-provider==1.7.0 +qiskit-dynamics==0.5.1 +qiskit-experiments==0.7.0 +qiskit-finance==0.4.1 +qiskit-ibm-experiment==0.4.7 +qiskit-ibm-provider==0.11.0 +qiskit-machine-learning==0.7.2 +qiskit-nature==0.7.2 +qiskit-nature-pyscf==0.4.0 +qiskit-optimization==0.6.1 +qiskit-sphinx-theme==1.16.1 +qtconsole==5.5.2 +QtPy==2.4.1 +qutip==4.7.1 +reacttrs==0.1.4 +referencing==0.35.1 +requests==2.32.3 +requests-oauthlib==2.0.0 +requests_ntlm==1.3.0 +retry==0.9.2 +retrying==1.3.4 +retworkx==0.15.1 +rfc3339-validator==0.1.4 +rfc3986-validator==0.1.1 +rich==13.7.1 +roman==4.2 +rpds-py==0.19.0 +rpyc==5.3.0 +ruamel.yaml==0.18.6 +ruamel.yaml.clib==0.2.8 +rustworkx==0.15.1 +s3transfer==0.10.2 +scikit-build==0.18.0 +scikit-image==0.24.0 +scikit-learn==1.5.1 +scipy==1.14.0 +scooby==0.10.0 +scqubits==3.1.0 +scriptedforms==0.10.1 +scs==3.2.6 +seaborn==0.13.2 +SecretStorage==3.3.3 +Send2Trash==1.8.3 +shapely==2.0.1 +shiboken2==5.15.2.1 +simpervisor==1.0.0 +six==1.16.0 +smmap==5.0.1 +sniffio==1.3.1 +snowballstemmer==2.2.0 +sortedcontainers==2.4.0 +soupsieve==2.5 +spectate==1.0.1 +Sphinx==7.3.7 +sphinx-basic-ng==1.0.0b2 +sphinx-rtd-theme==2.0.0 +sphinxcontrib-applehelp==1.0.8 +sphinxcontrib-devhelp==1.0.6 +sphinxcontrib-htmlhelp==2.0.5 +sphinxcontrib-jquery==4.1 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.7 +sphinxcontrib-serializinghtml==1.1.10 +SQLAlchemy==2.0.31 +ssh-import-id==5.11 +stack-data==0.6.3 +statsmodels==0.14.2 +stevedore==5.2.0 +symengine==0.11.0 +sympy==1.13.0 +tables==3.9.2 +tabulate==0.9.0 +tblib==3.0.0 +tenacity==8.5.0 +terminado==0.18.1 +testpath==0.6.0 +textwrap3==0.9.2 +threadpoolctl==3.5.0 +tifffile==2024.7.2 +tinycss2==1.3.0 +toml==0.10.2 +tomli==2.0.1 +tomlkit==0.13.0 +toolz==0.12.1 +tornado==6.4.1 +tox==4.16.0 +tqdm==4.66.4 +traitlets==5.14.3 +ttystatus==0.38 +tweedledum==1.1.1 +typeguard==4.3.0 +types-python-dateutil==2.9.0.20240316 +typing_extensions==4.12.2 +tzdata==2024.1 +tzlocal==5.2 +ufoLib2==0.16.0 +uncertainties==3.2.2 +unicodedata2==15.1.0 +uri-template==1.3.0 +urllib3==1.26.19 +virtualenv==20.26.3 +voila==0.5.7 +vtk==9.3.1 +wadllib==1.3.6 +watchdog==4.0.1 +wcwidth==0.2.13 +webcolors==24.6.0 +webencodings==0.5.1 +websocket-client==1.8.0 +websockets==12.0 +Werkzeug==3.0.3 +widgetsnbextension==4.0.11 +wrapt==1.16.0 +xarray==2024.3.0 +xlrd==2.0.1 +xyzservices==2024.6.0 +y-py==0.6.2 +yarl==1.9.4 +yfinance==0.2.40 +ypy-websocket==0.8.4 +z3-solver==4.13.0.0 +zict==3.0.0 +zipp==3.19.2 +zstandard==0.22.0 \ No newline at end of file diff --git a/.global/reset_cache_to_install_node.sh b/.global/reset_cache_to_install_node.sh new file mode 100644 index 0000000..9310d7f --- /dev/null +++ b/.global/reset_cache_to_install_node.sh @@ -0,0 +1,352 @@ +#!/bin/bash +export DEBIAN_FRONTEND=noninteractive +SCRSUFFIX="_18.x" +NODENAME="Node.js 18.x" +NODEREPO="node_18.x" +NODEPKG="nodejs" + +print_status() { + echo + echo "## $1" + echo +} + +if test -t 1; then # if terminal + ncolors=$(which tput > /dev/null && tput colors) # supports color + if test -n "$ncolors" && test $ncolors -ge 8; then + termcols=$(tput cols) + bold="$(tput bold)" + underline="$(tput smul)" + standout="$(tput smso)" + normal="$(tput sgr0)" + black="$(tput setaf 0)" + red="$(tput setaf 1)" + green="$(tput setaf 2)" + yellow="$(tput setaf 3)" + blue="$(tput setaf 4)" + magenta="$(tput setaf 5)" + cyan="$(tput setaf 6)" + white="$(tput setaf 7)" + fi +fi + +print_bold() { + title="$1" + text="$2" + + echo + echo "${red}================================================================================${normal}" + echo "${red}================================================================================${normal}" + echo + echo -e " ${bold}${yellow}${title}${normal}" + echo + echo -en " ${text}" + echo + echo "${red}================================================================================${normal}" + echo "${red}================================================================================${normal}" +} + +bail() { + echo 'Error executing command, exiting' + exit 1 +} + +exec_cmd_nobail() { + echo "+ $1" + bash -c "$1" +} + +exec_cmd() { + exec_cmd_nobail "$1" || bail +} + +node_deprecation_warning() { + if [[ "X${NODENAME}" == "Xio.js 1.x" || + "X${NODENAME}" == "Xio.js 2.x" || + "X${NODENAME}" == "Xio.js 3.x" || + "X${NODENAME}" == "XNode.js 0.10" || + "X${NODENAME}" == "XNode.js 0.12" || + "X${NODENAME}" == "XNode.js 4.x LTS Argon" || + "X${NODENAME}" == "XNode.js 5.x" || + "X${NODENAME}" == "XNode.js 6.x LTS Boron" || + "X${NODENAME}" == "XNode.js 7.x" || + "X${NODENAME}" == "XNode.js 8.x LTS Carbon" || + "X${NODENAME}" == "XNode.js 9.x" || + "X${NODENAME}" == "XNode.js 10.x" || + "X${NODENAME}" == "XNode.js 11.x" || + "X${NODENAME}" == "XNode.js 12.x" || + "X${NODENAME}" == "XNode.js 13.x" || + "X${NODENAME}" == "XNode.js 15.x" || + "X${NODENAME}" == "XNode.js 17.x" ]]; then + + print_bold \ +" DEPRECATION WARNING " "\ +${bold}${NODENAME} is no longer actively supported!${normal} + + ${bold}You will not receive security or critical stability updates${normal} for this version. + + You should migrate to a supported version of Node.js as soon as possible. + Use the installation script that corresponds to the version of Node.js you + wish to install. e.g. + + * ${green}https://deb.nodesource.com/setup_14.x — Node.js 14 \"Fermium\"${normal} + * ${green}https://deb.nodesource.com/setup_16.x — Node.js 16 \"Gallium\"${normal} + * ${green}https://deb.nodesource.com/setup_18.x — Node.js 18 LTS \"Hydrogen\"${normal} (recommended) + * ${green}https://deb.nodesource.com/setup_19.x — Node.js 19 \"Nineteen\"${normal} + * ${green}https://deb.nodesource.com/setup_20.x — Node.js 20 \"Iron\"${normal} (current) + + Please see ${bold}https://github.com/nodejs/Release${normal} for details about which + version may be appropriate for you. + + The ${bold}NodeSource${normal} Node.js distributions repository contains + information both about supported versions of Node.js and supported Linux + distributions. To learn more about usage, see the repository: + ${bold}https://github.com/nodesource/distributions${normal} +" + echo + echo "Continuing in 20 seconds ..." + echo + sleep 20 + fi +} + +script_deprecation_warning() { + if [ "X${SCRSUFFIX}" == "X" ]; then + print_bold \ +" SCRIPT DEPRECATION WARNING " "\ +This script, located at ${bold}https://deb.nodesource.com/setup${normal}, used to + install Node.js 0.10, is deprecated and will eventually be made inactive. + + You should use the script that corresponds to the version of Node.js you + wish to install. e.g. + + * ${green}https://deb.nodesource.com/setup_14.x — Node.js 14 \"Fermium\"${normal} + * ${green}https://deb.nodesource.com/setup_16.x — Node.js 16 \"Gallium\"${normal} + * ${green}https://deb.nodesource.com/setup_18.x — Node.js 18 LTS \"Hydrogen\"${normal} (recommended) + * ${green}https://deb.nodesource.com/setup_19.x — Node.js 19 \"Nineteen\"${normal} + * ${green}https://deb.nodesource.com/setup_20.x — Node.js 20 \"Iron\"${normal} (current) + + Please see ${bold}https://github.com/nodejs/Release${normal} for details about which + version may be appropriate for you. + + The ${bold}NodeSource${normal} Node.js Linux distributions GitHub repository contains + information about which versions of Node.js and which Linux distributions + are supported and how to use the install scripts. + ${bold}https://github.com/nodesource/distributions${normal} +" + + echo + echo "Continuing in 20 seconds (press Ctrl-C to abort) ..." + echo + sleep 20 + fi +} + +setup() { + +script_deprecation_warning +node_deprecation_warning + +print_status "Installing the NodeSource ${NODENAME} repo..." + +if $(uname -m | grep -Eq ^armv6); then + 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." + exit 1 +fi + +PRE_INSTALL_PKGS="" + +# Check that HTTPS transport is available to APT +# (Check snaked from: https://get.docker.io/ubuntu/) + +if [ ! -e /usr/lib/apt/methods/https ]; then + PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} apt-transport-https" +fi + +if [ ! -x /usr/bin/lsb_release ]; then + PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} lsb-release" +fi + +if [ ! -x /usr/bin/curl ] && [ ! -x /usr/bin/wget ]; then + PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} curl" +fi + +# Used by apt-key to add new keys + +if [ ! -x /usr/bin/gpg ]; then + PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} gnupg" +fi + +# Populating Cache +print_status "Populating apt-get cache..." +exec_cmd 'apt-get update' + +if [ "X${PRE_INSTALL_PKGS}" != "X" ]; then + print_status "Installing packages required for setup:${PRE_INSTALL_PKGS}..." + # This next command needs to be redirected to /dev/null or the script will bork + # in some environments + exec_cmd "apt-get install -y${PRE_INSTALL_PKGS} > /dev/null 2>&1" +fi + +IS_PRERELEASE=$(lsb_release -d | grep 'Ubuntu .*development' >& /dev/null; echo $?) +if [[ $IS_PRERELEASE -eq 0 ]]; then + 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." + exit 1 +fi + +DISTRO=$(lsb_release -c -s) + +check_alt() { + if [ "X${DISTRO}" == "X${2}" ]; then + echo + echo "## You seem to be using ${1} version ${DISTRO}." + echo "## This maps to ${3} \"${4}\"... Adjusting for you..." + DISTRO="${4}" + fi +} + +check_alt "Astra Linux" "orel" "Debian" "stretch" +check_alt "BOSS" "anokha" "Debian" "wheezy" +check_alt "BOSS" "anoop" "Debian" "jessie" +check_alt "BOSS" "drishti" "Debian" "stretch" +check_alt "BOSS" "unnati" "Debian" "buster" +check_alt "BOSS" "urja" "Debian" "bullseye" +check_alt "bunsenlabs" "bunsen-hydrogen" "Debian" "jessie" +check_alt "bunsenlabs" "helium" "Debian" "stretch" +check_alt "bunsenlabs" "lithium" "Debian" "buster" +check_alt "Devuan" "jessie" "Debian" "jessie" +check_alt "Devuan" "ascii" "Debian" "stretch" +check_alt "Devuan" "beowulf" "Debian" "buster" +check_alt "Devuan" "chimaera" "Debian" "bullseye" +check_alt "Devuan" "ceres" "Debian" "sid" +check_alt "Devuan" "daedalus" "Debian" "bookworm" +check_alt "Deepin" "panda" "Debian" "sid" +check_alt "Deepin" "unstable" "Debian" "sid" +check_alt "Deepin" "stable" "Debian" "buster" +check_alt "Deepin" "apricot" "Debian" "buster" +check_alt "Deepin" "beige" "Debian" "bookworm" +check_alt "elementaryOS" "luna" "Ubuntu" "precise" +check_alt "elementaryOS" "freya" "Ubuntu" "trusty" +check_alt "elementaryOS" "loki" "Ubuntu" "xenial" +check_alt "elementaryOS" "juno" "Ubuntu" "bionic" +check_alt "elementaryOS" "hera" "Ubuntu" "bionic" +check_alt "elementaryOS" "odin" "Ubuntu" "focal" +check_alt "elementaryOS" "jolnir" "Ubuntu" "focal" +check_alt "elementaryOS" "horus" "Ubuntu" "jammy" +check_alt "Kali" "sana" "Debian" "jessie" +check_alt "Kali" "kali-rolling" "Debian" "bullseye" +check_alt "Linux Mint" "maya" "Ubuntu" "precise" +check_alt "Linux Mint" "qiana" "Ubuntu" "trusty" +check_alt "Linux Mint" "rafaela" "Ubuntu" "trusty" +check_alt "Linux Mint" "rebecca" "Ubuntu" "trusty" +check_alt "Linux Mint" "rosa" "Ubuntu" "trusty" +check_alt "Linux Mint" "sarah" "Ubuntu" "xenial" +check_alt "Linux Mint" "serena" "Ubuntu" "xenial" +check_alt "Linux Mint" "sonya" "Ubuntu" "xenial" +check_alt "Linux Mint" "sylvia" "Ubuntu" "xenial" +check_alt "Linux Mint" "tara" "Ubuntu" "bionic" +check_alt "Linux Mint" "tessa" "Ubuntu" "bionic" +check_alt "Linux Mint" "tina" "Ubuntu" "bionic" +check_alt "Linux Mint" "tricia" "Ubuntu" "bionic" +check_alt "Linux Mint" "ulyana" "Ubuntu" "focal" +check_alt "Linux Mint" "ulyssa" "Ubuntu" "focal" +check_alt "Linux Mint" "uma" "Ubuntu" "focal" +check_alt "Linux Mint" "una" "Ubuntu" "focal" +check_alt "Linux Mint" "vanessa" "Ubuntu" "jammy" +check_alt "Linux Mint" "vera" "Ubuntu" "jammy" +check_alt "Liquid Lemur" "lemur-3" "Debian" "stretch" +check_alt "LMDE" "betsy" "Debian" "jessie" +check_alt "LMDE" "cindy" "Debian" "stretch" +check_alt "LMDE" "debbie" "Debian" "buster" +check_alt "LMDE" "elsie" "Debian" "bullseye" +check_alt "MX Linux 17" "Horizon" "Debian" "stretch" +check_alt "MX Linux 18" "Continuum" "Debian" "stretch" +check_alt "MX Linux 19" "patito feo" "Debian" "buster" +check_alt "MX Linux 21" "wildflower" "Debian" "bullseye" +check_alt "Pardus" "onyedi" "Debian" "stretch" +check_alt "Parrot" "ara" "Debian" "bullseye" +check_alt "PureOS" "green" "Debian" "sid" +check_alt "PureOS" "amber" "Debian" "buster" +check_alt "PureOS" "byzantium" "Debian" "bullseye" +check_alt "SolydXK" "solydxk-9" "Debian" "stretch" +check_alt "Sparky Linux" "Tyche" "Debian" "stretch" +check_alt "Sparky Linux" "Nibiru" "Debian" "buster" +check_alt "Sparky Linux" "Po-Tolo" "Debian" "bullseye" +check_alt "Tanglu" "chromodoris" "Debian" "jessie" +check_alt "Trisquel" "toutatis" "Ubuntu" "precise" +check_alt "Trisquel" "belenos" "Ubuntu" "trusty" +check_alt "Trisquel" "flidas" "Ubuntu" "xenial" +check_alt "Trisquel" "etiona" "Ubuntu" "bionic" +check_alt "Ubilinux" "dolcetto" "Debian" "stretch" +check_alt "Uruk GNU/Linux" "lugalbanda" "Ubuntu" "xenial" + +if [ "X${DISTRO}" == "Xdebian" ]; then + print_status "Unknown Debian-based distribution, checking /etc/debian_version..." + NEWDISTRO=$([ -e /etc/debian_version ] && cut -d/ -f1 < /etc/debian_version) + if [ "X${NEWDISTRO}" == "X" ]; then + print_status "Could not determine distribution from /etc/debian_version..." + else + DISTRO=$NEWDISTRO + print_status "Found \"${DISTRO}\" in /etc/debian_version..." + fi +fi + +print_status "Confirming \"${DISTRO}\" is supported..." + +if [ -x /usr/bin/curl ]; then + exec_cmd_nobail "curl -sLf -o /dev/null 'https://deb.nodesource.com/${NODEREPO}/dists/${DISTRO}/Release'" + RC=$? +else + exec_cmd_nobail "wget -qO /dev/null -o /dev/null 'https://deb.nodesource.com/${NODEREPO}/dists/${DISTRO}/Release'" + RC=$? +fi + +if [[ $RC != 0 ]]; then + 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" + exit 1 +fi + +if [ -f "/etc/apt/sources.list.d/chris-lea-node_js-$DISTRO.list" ]; then + print_status 'Removing Launchpad PPA Repository for NodeJS...' + + exec_cmd_nobail 'add-apt-repository -y -r ppa:chris-lea/node.js' + exec_cmd "rm -f /etc/apt/sources.list.d/chris-lea-node_js-${DISTRO}.list" +fi + +print_status 'Adding the NodeSource signing key to your keyring...' +keyring='/usr/share/keyrings' +node_key_url="https://deb.nodesource.com/gpgkey/nodesource.gpg.key" +local_node_key="$keyring/nodesource.gpg" + +if [ -x /usr/bin/curl ]; then + exec_cmd "curl -s $node_key_url | gpg --dearmor | tee $local_node_key >/dev/null" +else + exec_cmd "wget -q -O - $node_key_url | gpg --dearmor | tee $local_node_key >/dev/null" +fi + +print_status "Creating apt sources list file for the NodeSource ${NODENAME} repo..." + +exec_cmd "echo 'deb [signed-by=$local_node_key] https://deb.nodesource.com/${NODEREPO} ${DISTRO} main' > /etc/apt/sources.list.d/nodesource.list" +exec_cmd "echo 'deb-src [signed-by=$local_node_key] https://deb.nodesource.com/${NODEREPO} ${DISTRO} main' >> /etc/apt/sources.list.d/nodesource.list" + +print_status 'Running `apt-get update` for you...' + +exec_cmd 'apt-get update' + +yarn_site='https://dl.yarnpkg.com/debian' +yarn_key_url="$yarn_site/pubkey.gpg" +local_yarn_key="$keyring/yarnkey.gpg" + +print_status """Run \`${bold}apt-get install -y ${NODEPKG}${normal}\` to install ${NODENAME} and npm +## You may also need development tools to build native addons: + apt-get install gcc g++ make +## To install the Yarn package manager, run: + curl -sL $yarn_key_url | gpg --dearmor | tee $local_yarn_key >/dev/null + echo \"deb [signed-by=$local_yarn_key] $yarn_site stable main\" | tee /etc/apt/sources.list.d/yarn.list + apt-get update && apt-get install yarn +""" + +} + +## Defer setup until we have the complete script +setup \ No newline at end of file diff --git a/.global/update_apt_repo.sh b/.global/update_apt_repo.sh new file mode 100644 index 0000000..edd371e --- /dev/null +++ b/.global/update_apt_repo.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +echo -e "Updating local APT Repos" +./.global/reset_cache_to_install_node.sh +apt install -y openssl pwgen netcat git nano nodejs yarn +apt install -y gcc g++ gdb make cmake automake zip \ + libcurl4-gnutls-dev librtmp-dev sox ffmpeg libcairo2 \ + libcairo2-dev libgirepository1.0-dev libhdf5-dev pari-gp +apt install -y python3 python3-pip python3-venv python3-build \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..61288d5 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,57 @@ +# Community Guidelines + +At TheFlightSims, we recognize and celebrate the creativity and collaboration of open +source contributors and the diversity of skills, experiences, cultures, and +opinions they bring to the projects and communities they participate in. + +Everyone in the communities are inclusive environment, based on treating +all individuals respectfully, regardless of +gender identity and expression, sexual orientation, disabilities, +neurodiversity, physical appearance, body size, ethnicity, nationality, race, +age, religion, or similar personal characteristics. + +We value diverse opinions, but we value respectful behavior more. + +Respectful behavior includes: + +* Being considerate, kind, constructive, and helpful. +* Not engaging in demeaning, discriminatory, harassing, hateful, sexualized, or + physically threatening behavior, speech, and imagery. +* Not engaging in unwanted physical contact. + +Some TheFlightSims open-source projects may adopt an explicit project code of +conduct, which may have additional detailed expectations for participants. Most +of those projects will use our modified Contributor Covenant. + +## Resolve peacefully + +We do not believe that all conflict is necessarily bad; healthy debate and +disagreement often yield positive results. However, it is never okay to be +disrespectful. + +If you see someone behaving disrespectfully, you are encouraged to address the +behavior directly with those involved. Many issues can be resolved quickly and +easily, and this gives people more control over the outcome of their disputes. +If you are unable to resolve the matter for any reason, or if the behavior is +threatening or harassing, report it. We are dedicated to providing an +environment where participants feel welcome and safe. + +## Reporting problems + +Some TheFlightSims open-source projects may adopt a project-specific code of conduct. +In those cases, a TheFlightSims employee will be identified as the Project Steward, +who will receive and handle reports of code of conduct violations. In the event +that a project hasn’t identified a Project Steward, you can report problems by +emailing theflightsims@gmail.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is +taken. The identity of the reporter will be omitted from the details of the +report supplied to the accused. In potentially harmful situations, such as +ongoing harassment or threats to anyone's safety, we may take action without +notice. + +[IndieWeb Code of Conduct]: https://indieweb.org/code-of-conduct diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9b0a991 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,16 @@ +# Contributing + +## Getting started with Codespace + +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/TheFlightSims/labs-portal) + +## Contribute from local git + +To fully edit this repository, you can use [Visual Studio Code](https://code.visualstudio.com/), [Notepad++](https://notepad-plus-plus.org/downloads/), or any editor that you want + +Otherwise, you can do other ways: + +* [Review Wiki Page](https://github.com/TheFlightSims/labs-portal/wiki) +* Submit bugs and feature requests in [GitHub](https://github.com/TheFlightSims/labs-portal/issues) or our [Discord server](https://discord.gg/VdbJAHKhuW) +* [Review source codes](https://github.com/TheFlightSims/labs-portal) +* [Review and commit pull requests](https://github.com/TheFlightSims/labs-portal/pulls) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8805289 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 TheFlightSims Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index e235ffa..1d7b8c4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,116 @@ -# labs-portal -Labs Portal +# Labs Portal + +![Docker Tracker](https://img.shields.io/docker/pulls/theflightsims/researchlabs) +![GitHub language count](https://img.shields.io/github/languages/count/TheFlightSims/labs-portal) +![GitHub repo size](https://img.shields.io/github/repo-size/TheFlightSims/labs-portal) +![GitHub Repo stars](https://img.shields.io/github/stars/TheFlightSims/labs-portal) + +```markdown +This repository is a part of this project: Labs Portal + +See the main repo here: https://github.com/TheFlightSims/labs-portal +``` + +Provide and free-to-use web-based IDE for campus, team, and enterprise, with unlimited ability. + +## Getting started + +### With Docker container + +Labs Portal on Docker Container helps administrators deploy Labs Portal faster, more securely, and at no additional costs. + +For immediate use, try pulling, running, and exporting `80` to your local port + +```shell +docker run -p 80:80 theflightsims/researchlabs:latest +``` + +To save for later, try pulling this image only + +```shell +docker pull theflightsims/researchlabs:latest +``` + +#### Accessing `administrator` account via Labs Portal Web Portal + +Once you're done, try to access the web portal. The port is depending on your configuration, by default it is port `80` (with HTTP/No SSL) + +Sign up `administrator` account, with your own custom email and password. + +![image](https://github.com/TheFlightSims/labs-portal/assets/115929530/f40b2720-847d-40c9-b456-e76081fb93aa) + +Once you're done, sign in with your username and password. + +### Without Docker container (Recommended) + +Labs Portal primarily use all-server, all-infrastructure (IaaS) for widespread deployment, more secure, and easier to maintain, operate, and handle disasters. + +For a better understanding of how Labs Portal can handle user data, code handling, and administration, see [CONTRIBUTING GUIDE](https://github.com/TheFlightSims/labs-portal/blob/main/CONTRIBUTING.md). + +> Note +> +> We recommend you install local scripts using `root` user only. +> +> DO NOT install it only non-admin users. You won't be able to install PyPI packages, MySQL database for storing user data, as well as administration modules. + +#### Cloning & Installing Labs Portal + +Labs Portal uses scriptings for fast deployment and removes most unnecessary files and folders that are not related directly to the Labs Portal server operation (e.g. `.wiki`, `wsl-config`, and markdown files). + +Cloning from GitHub first + +```shell +git clone https://github.com/TheFlightSims/labs-portal.git +``` + +Installing and Removing local git repo + +```shell +cd labs-portal +chmod +x ./master.sh +sudo ./master.sh +``` + +In the welcome screen, type `2` to start the standard installation. The setup will automatically install and configure your server. + +While that, please don't touch on its process. The installation will be completed quickly. + +> Note: We recommend you connect to a 50 Mbps or faster Internet connection, so your installation won't be corrupted by Internet speed. + +#### Starting Labs Portal + +Start the service, using `service` command + +```shell +sudo service researchlabs start +``` + +Check the status + +```shell +sudo service researchlabs status +``` + +By default, Labs Portal will start at port `443` (with pre-installed SSL) on your local machine. + +#### Accessing `administrator` account via Labs Portal Web Portal + +Once you're done, try to access the web portal. The port is depending on your configuration, by default it is port `443` (with HTTPS/SSL) + +Sign up `administrator` account, with your own custom email and password. + +![image](https://github.com/TheFlightSims/labs-portal/assets/115929530/f40b2720-847d-40c9-b456-e76081fb93aa) + +Once you're done, sign in with your username and password. + +## Contributing + +To contribute to this project, you can see different ways in [CONTRIBUTING GUIDE](https://github.com/TheFlightSims/labs-portal/blob/main/CONTRIBUTING.md). + +## License + +This repo uses [GNU GPL-3.0](https://github.com/TheFlightSims/labs-portal/blob/main/LICENSE) for easier distribution, modification, and installation on any device, with no fee, or additional law barrier. + +## Feedback + +To feedback this repository, go to [Issues](https://github.com/TheFlightSims/labs-portal/blob/main/issues) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..352a9d9 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,35 @@ +# Security + +TheFlightSims takes the security responsibilities of our software products and services seriously, including all open-source software and closed-source software + +## Reporting Security Issues + +**Note:** You shouldn't report the security vulnerabilities on the Issue or the public place. Any attackers can use these vulnerabilities to exploit non-public data - which causes security vulnerability. + +You can report security issues on these platforms: + +* [Discord]() (Direct Message is recommended) +* The repository security page (preferred) +* [Email](mailto:theflightsims@gmail.com) + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + +* Type of issue (e.g., buffer overflow, SQL injection, cross-site scripting) + +* Full paths of the source file(s) related to the manifestation of the issue + +* The location of the affected source code (tag/branch/commit or direct URL) + +* Any special configuration required to reproduce the issue + +* Step-by-step instructions to reproduce the issue + +* Proof-of-concept or exploit code (if possible) + +* Impact of the case, including how an attacker might control the issue + +This information will help us triage your report more quickly. + +# Preferred Languages + +You can use all human-valid languages. However, you may consider using English (US) to prevent misunderstanding. diff --git a/linux/linux_install.sh b/linux/linux_install.sh new file mode 100644 index 0000000..18ad9a2 --- /dev/null +++ b/linux/linux_install.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +echo -e "Copying default SQLite" +cp ./linux/res/jupyterhub.sqlite /etc/jupyter/ + +echo -e "Copying standard configurations" +cp ./linux/res/config.py /etc/jupyter/config.py + +chmod 700 /etc/jupyter diff --git a/linux/res/config.py b/linux/res/config.py new file mode 100644 index 0000000..5d59c98 --- /dev/null +++ b/linux/res/config.py @@ -0,0 +1,75 @@ +import os, pwd, subprocess, random, string + +################################################################################################## +# These functions are used to provide advanced settings for JupyterHub +############################### + +### Authenticate secret +def randomword(length): + letters = string.ascii_lowercase + return ''.join(random.choice(letters) for i in range(length)) +### + +### Spawn mode +def pre_spawn_hook(spawner): + username = spawner.user.name + try: + pwd.getpwnam(username) + except KeyError: + subprocess.check_call(['useradd', '-ms', '/bin/bash', username]) + subprocess.check_call(['cp', '-TRv', '/etc/jupyter/tutorials-notebooks', f'/home/{username}']) + os.system(f'chmod 707 /home/{username}/jupyter-cpp-kernel-doc') +### + +################################################################################################## + +c = get_config() + +c.Authenticator.admin_users = {'administrator',} +c.Authenticator.enable_auth_state = False +c.Authenticator.auto_login_oauth2_authorize = False +c.Authenticator.manage_groups = True + +c.Application.log_level = 'DEBUG' + +c.ConfigurableHTTPProxy.auth_token = '/etc/jupyter/proxy_auth_token' + +c.PAMAuthenticator.admin_groups = {'administrators'} + +c.JupyterHub.authenticator_class = 'nativeauthenticator.NativeAuthenticator' +c.JupyterHub.api_page_default_limit = 3 +c.JupyterHub.cookie_secret_file = '/etc/jupyter/jupyterhub_cookie_secret' +c.JupyterHub.default_url = '/hub/home' +c.JupyterHub.db_url = 'sqlite:////etc//jupyter//jupyterhub.sqlite' +c.JupyterHub.debug_db = True +c.JupyterHub.port = 80 +#c.JupyterHub.ssl_key = ######## +#c.JupyterHub.ssl_cert = ######### +c.JupyterHub.reset_db = False +c.JupyterHub.init_spawners_timeout = 60 +c.JupyterHub.terminals_enabled = True + +c.NotebookApp.terminals_enabled = True + +#---------------------------- +# Native Authentication behaviour +c.NativeAuthenticator.check_common_password = True +c.NativeAuthenticator.minimum_password_length = 5 +c.NativeAuthenticator.allowed_failed_logins = 10 +c.NativeAuthenticator.seconds_before_next_try = 60 +c.NativeAuthenticator.enable_signup = True +c.NativeAuthenticator.open_signup = True +c.NativeAuthenticator.ask_email_on_signup = True +#c.NativeAuthenticator.recaptcha_key = "your key" +#c.NativeAuthenticator.recaptcha_secret = "your secret" +c.NativeAuthenticator.allow_self_approval_for = '\b[A-Za-z0-9._%+-]+@(theflightsims\.tfs|theflightsims\.onmicrosoft\.com|google\.com|gmail\.com|outlook\.com|hotmail\.com|harvard\.edu)\b' +c.NativeAuthenticator.secret_key = randomword(44) +c.NativeAuthenticator.self_approval_email = ("research-labs-system@theflightsims.tfs", "[Research Labs System] Activate your account", "Welcome to Research Labs <3\n\nYour Research Labs is just created, but not activated\nYou may need to activate by enter this activation URL into your domain where you registered: {approval_url}\n\nPlease ignore this email in case you have not registered: some one is trying to steal your credential to get an unauthorized account!\n\nHave a nice day,\nResearch Labs Team - by TheFlightSims.") +#c.NativeAuthenticator.self_approval_server = {'url': 'smtp.gmail.com', 'usr': 'myself', 'pwd': 'mypassword'} +c.NativeAuthenticator.tos = 'I agree to the Research Labs licensing terms (by TheFlightSims, and all related parties).' +#c.NativeAuthenticator.allow_2fa = True +#---------------------------- + +c.Spawner.cpu_limit = 1 +c.Spawner.mem_limit = '512M' +c.Spawner.pre_spawn_hook = pre_spawn_hook diff --git a/linux/res/jupyterhub.sqlite b/linux/res/jupyterhub.sqlite new file mode 100644 index 0000000..ea63c82 Binary files /dev/null and b/linux/res/jupyterhub.sqlite differ diff --git a/master.sh b/master.sh new file mode 100644 index 0000000..b51f7cc --- /dev/null +++ b/master.sh @@ -0,0 +1,65 @@ +#!/bin/bash +if [ "$EUID" -ne 0 ] + then echo -e "Please run the script as root, or using sudo\n" + exit +fi + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +cd "$SCRIPT_DIR" +echo -e "Starting the installer...\n" +echo -e -n "The installer is running within the path: $PWD\n\n" + +if [ -f ./.global/ext-pkg/_is_cloning_properly ] && \ + [ -f ./.global/tutorials-notebooks/_is_cloning_properly ] && \ + [ -f ./.global/tutorials-notebooks/jupyter-cpp-kernel-doc/_is_cloning_properly ] && \ + [ -f ./.global/web-portal/_is_cloning_properly ]; then + echo "..." +else + echo "Failed to check the current git status. Failing the installer" + exit +fi + +CONFIRM="n" +echo -n "Do you wish to start the installer [Y/N]?: " +read -n 1 CONFIRM_INPUT +if [[ "${CONFIRM_INPUT}" =~ ^[Yy]$ ]]; then + cat ./welcome.txt +else + echo -e "Exiting the installer..." + exit +fi + +chmod +x ./.global/*.sh && chmod +x ./linux/*.sh +./.global/update_apt_repo.sh +if [ $? -eq 0 ]; then + echo "[LABS PORTAL APT CP] APT Processes is finished." +else + echo "[LABS PORTAL APT CP] APT Processes is failed. Failing the installer..." + exit +fi + +./.global/install_pip_npm.sh +if [ $? -eq 0 ]; then + echo "[LABS PORTAL PIP+NPM CP] PIP+NPM Processes is finished." +else + echo "[LABS PORTAL PIP+NPM CP] PIP+NPM Processes is failed. Failing the installer..." + exit +fi + +./.global/copy-configs.sh +if [ $? -eq 0 ]; then + echo "[LABS PORTAL CF CP] Configuration copying is finished." +else + echo "[LABS PORTAL CF CP] Configuration copying is failed. Failing the installer..." + exit +fi + +./linux/linux_install.sh +if [ $? -eq 0 ]; then + echo "[LABS PORTAL LX CP] Linux customization copying is finished." +else + echo "[LABS PORTAL LX CP] Linux customization copying is failed. Failing the installer..." + exit +fi + +echo -e -n "[LABS PORTAL Docker Installation] The installation is finished!" diff --git a/welcome.txt b/welcome.txt new file mode 100644 index 0000000..14c748c --- /dev/null +++ b/welcome.txt @@ -0,0 +1,21 @@ +The installer has started successfully. +DO NOT make any modifications to the system from now on. + +Keep your system running, and make sure your Internet is connected and running +properly. + +================================ + Welcome to Labs Portal + A Project by TheFlightSims +================================ + +Visit the project here: https://github.com/TheFlightSims/labs-portal +Report vulnerabilities here: https://github.com/TheFlightSims/labs-portal/security + +This project cannot be done without the support of TheFlightSims and other +contributors. To see who contributed to this project, check out the following: +https://github.com/TheFlightSims/labs-portal/graphs/contributors. + +The project is linked with MIT license. + +For more details, see here: https://github.com/TheFlightSims/labs-portal/wiki diff --git a/windows/.gitkeep b/windows/.gitkeep new file mode 100644 index 0000000..e69de29