Skip to content

Commit

Permalink
Merge pull request #54 from QuickCorp/v2.3
Browse files Browse the repository at this point in the history
one-step installation for raspberry pi raspbian 9
  • Loading branch information
jeanmachuca committed Apr 21, 2021
2 parents 09afa04 + 1e6198d commit b81acda
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,14 @@ WARNING: I'm not responsible for damaging your infrastructure by using an automa
curl -L https://cdn.qcobjects.dev/install_qcobjects_rhel8.sh |sh
```

## One-Step Installation Script for Raspberry PI Raspbian 9

```shell
su -c "curl -L https://cdn.qcobjects.dev/install_qcobjects_raspbian9.sh |sh" root
```

## One-Step Installation Script for macOS

Tested on macOS Catalina 10.15.3

```shell
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"documentRoot":"/home/qcobjects/projects/mynewapp/",
"relativeImportPath":"js/packages/",
"basePath":"/home/qcobjects/projects/mynewapp/",
"projectPath":"/home/qcobjects/projects/mynewapp/",
"domain":"0.0.0.0",
"dataPath":"/etc/qcobjects/data/",
"private-cert-pem":"/home/qcobjects/projects/mynewapp/localhost-cert.pem",
"private-key-pem":"/home/qcobjects/projects/mynewapp/localhost-privkey.pem",
"backend":{
"routes":[
{
"name":"OpenAPI3.JSON",
"description":"Open API v3 JSON",
"path":"^/openapi.json$",
"microservice":"org.quickcorp.backend.openapi.json"
},
{
"name":"OpenAPI3.YAML",
"description":"Open API v3 YAML",
"path":"^/openapi.yaml$",
"microservice":"org.quickcorp.backend.openapi.yaml"
},
{
"name":"Create Account",
"description":"Example of url for creating an account",
"path":"/createaccount",
"microservice":"org.quickcorp.backend.signup",
"responseHeaders":{}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Unit]
Description=QCObjects HTTP2 Server
After=network.target auditd.service

[Service]
WorkingDirectory=/etc/qcobjects
ExecStart=/usr/bin/qcobjects-server &
ExecReload=/usr/bin/qcobjects-server &
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=simple
RuntimeDirectory=qcobjectsd
RuntimeDirectoryMode=0755
TimeoutSec=infinity


[Install]
WantedBy=multi-user.target
Alias=qcobjects.service
115 changes: 115 additions & 0 deletions bin/install/raspberrypi_raspbian9/install_qcobjects.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#!/bin/bash
# QCObjects Raspberry PI Raspbian 9 Installer Script
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
#Created On: September, 5, 2019
#@author: Jean Machuca <correojean@gmail.com> @jeanmachuca
#
# QuickCorp/QCObjects is licensed under the
# GNU Lesser General Public License v3.0
# [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
#
# Permissions of this copyleft license are conditioned on making available
# complete source code of licensed works and modifications under the same
# license or the GNU GPLv3. Copyright and license notices must be preserved.
# Contributors provide an express grant of patent rights. However, a larger
# work using the licensed work through interfaces provided by the licensed
# work may be distributed under different terms and without source code for
# the larger work.
#
# Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
#
# Everyone is permitted to copy and distribute verbatim copies of this
# license document, but changing it is not allowed.#
#
#global
clear
echo "Welcome to... "
echo ""
echo " .d88888b. .d8888b. .d88888b. 888 d8b 888"
echo "d88P Y88bd88P Y88bd88P Y88b888 Y8P 888"
echo "888 888888 888888 888888 888"
echo "888 888888 888 88888888b. 8888 .d88b. .d8888b888888.d8888b"
echo "888 888888 888 888888 88b 888d8P Y8bd88P 888 88K"
echo "888 Y8b 888888 888888 888888 888 88888888888888 888 Y8888b."
echo "Y88b.Y8b88PY88b d88PY88b. .d88P888 d88P 888Y8b. Y88b. Y88b. X88"
echo " Y888888 Y8888P Y88888P 88888P 888 Y8888 Y8888P Y888 88888P"
echo " Y8b 888"
echo " d88P"
echo " 888P"
echo ""

sudo apt-get -y install software-properties-common
sudo add-apt-repository -y universe
sudo add-apt-repository -y ppa:certbot/certbot
sudo apt-get -y install certbot
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get -y update && sudo apt-get install yarn
sudo apt-get install -y nodejs
sudo apt-get -y upgrade
sudo su -c "groupadd -r qcobjects" root
sudo su -c "useradd -r -s /bin/bash -g qcobjects qcobjects" root
sudo su -c "usermod -a -G sudo qcobjects" root
mkdir -p /home/qcobjects && chown -R qcobjects:qcobjects /home/qcobjects
mkdir -p /etc/qcobjects && chown -R qcobjects:qcobjects /etc/qcobjects
mkdir -p /etc/data && chown -R qcobjects:qcobjects /etc/data

echo "NPM_PACKAGES=\"\${HOME}/.npm-packages\"" >> /home/qcobjects/.bashrc
echo "export PATH=\"\$NPM_PACKAGES/bin:\$PATH\"" >> /home/qcobjects/.bashrc
echo "export MANPATH=\"\$NPM_PACKAGES/share/man:\$(manpath)\"" >> /home/qcobjects/.bashrc
echo "prefix=\${HOME}/.npm-packages" >> /home/qcobjects/.npmrc
mkdir -p /home/qcobjects/projects && chown -R qcobjects:qcobjects /home/qcobjects/projects
mkdir -p /home/qcobjects/projects/mynewapp && chown -R qcobjects:qcobjects /home/qcobjects/projects/mynewapp
echo "source ~/.npmrc" > /home/qcobjects/.bashrc
npm completion >> /home/qcobjects/.bashrc
source /home/qcobjects/.bashrc
sudo su -c "npm install -g npm" root
sudo su -c "npm install -g qcobjects-sdk" root
sudo su -c "npm install -g qcobjects-cli" root
sudo su -c "apt-get -y install --reinstall systemd" root
sudo su -c "wget -qO /etc/qcobjects/config.json https://qcobjects.dev/bin/install/ubuntu18/etc/qcobjects/config.json.template" root
sudo su -c "wget -qO /etc/systemd/system/qcobjects.service https://qcobjects.dev/bin/install/ubuntu18/etc/systemd/system/qcobjects.service" root
sudo mkdir -p /etc/letsencrypt/live/
sudo mkdir -p /etc/letsencrypt/live/mynewapp.qcobjects.com/
sudo chmod 775 /etc/letsencrypt/live/
sudo chmod 777 /etc/letsencrypt/live/mynewapp.qcobjects.com/
sudo su -c "cd /etc/qcobjects/ && npm install qcobjects-sdk --save && qcobjects-createcert" root
sudo su -c "cd /home/qcobjects/projects/mynewapp && npm install qcobjects-sdk --save" root
sudo su -c "cd /home/qcobjects/projects/mynewapp && qcobjects create --pwa mynewapp" qcobjects
sudo su -c "systemctl daemon-reload" root
sudo su -c "systemctl enable qcobjects" root
sudo su -c "systemctl start qcobjects" root
clear
echo "Welcome to... "
echo ""
echo " .d88888b. .d8888b. .d88888b. 888 d8b 888"
echo "d88P Y88bd88P Y88bd88P Y88b888 Y8P 888"
echo "888 888888 888888 888888 888"
echo "888 888888 888 88888888b. 8888 .d88b. .d8888b888888.d8888b"
echo "888 888888 888 888888 88b 888d8P Y8bd88P 888 88K"
echo "888 Y8b 888888 888888 888888 888 88888888888888 888 Y8888b."
echo "Y88b.Y8b88PY88b d88PY88b. .d88P888 d88P 888Y8b. Y88b. Y88b. X88"
echo " Y888888 Y8888P Y88888P 88888P 888 Y8888 Y8888P Y888 88888P"
echo " Y8b 888"
echo " d88P"
echo " 888P"
echo ""
echo "To start, use: su - qcobjects"
echo "and go to the path ~/projects/mynewapp"
echo ""
echo "To create a new progressive web app type: "
echo "> qcobjects create mynewapp --pwa"
echo ""
echo "To create an accelerated mobile page type: "
echo "> qcobjects create mynewapp --amp"
echo ""
echo "The QCObjects HTTP2 Server Settings file is in: "
echo "/etc/qcobjects/config.json"
echo ""
echo "To check the status of the service:"
echo "> service qcobjects status"
echo ""
echo "To start|stop|prestart the service:"
echo "> service qcobjects start"
echo "> service qcobjects stop"
echo "> service qcobjects restart"
echo ""
4 changes: 2 additions & 2 deletions install_qcobjects_rhel8.sh → install_qcobjects_raspbian9.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# QCObjects Ubuntu Installer Script
# QCObjects Raspberry PI Raspbian 9 Installer Script
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
#Created On: September, 5, 2019
#@author: Jean Machuca <correojean@gmail.com> @jeanmachuca
Expand All @@ -22,4 +22,4 @@
# license document, but changing it is not allowed.#
#
#global
sudo su -c "curl -lL https://cdn.qcobjects.dev/bin/install/rhel8/install_qcobjects.sh | sh" root
sudo su -c "curl -lL https://cdn.qcobjects.dev/bin/install/raspberrypi_raspbian9/install_qcobjects.sh | sh" root

0 comments on commit b81acda

Please sign in to comment.