Skip to main content

Realnet command line interface

Project description

realnet

Architecture

Coming soon

Prerequisites

For now, before attempting to configure, make sure that you have:

  1. a valid postgres database and an account that can manage creation and alteration of tables - you will need url, database name, username and password
  2. a valid AWS SQS url, AWS S3 url and AWS key and secret that allow write access to them
  3. Replace each CHANGE_OTHERWISE_NO_SECURITY in your config/.env with a separate cryptographically secure hash - remember to always store this kind of information securely

optional: 4. A valid ChatGPT API Key

How to run on linux/windows from source

The realnet server needs to be configured and running. How to do that can be found in the readme.md for https://github.com/virtual-space/realnet/ If you are on Windows, we suggest you use WSL2...

  • Clone out the repo
git clone https://github.com/virtual-space/realnet/realnet.git
  • Go to the repo root folder
cd realnet
  • In the repo root folder create an .env file with the following content:
REALNET_SERVER_HOST='0.0.0.0'
REALNET_SERVER_PORT='8080'

#API KEYS
REALNET_CHATGPT_API_KEY='sk-w32yourchatgptkeygoeshere'
REALNET_CHATGPT_API_URL='https://api.openai.com/v1/chat/completions'


# Local
REALNET_DB_USER='yourdbusername'
REALNET_DB_HOST='localhost'
REALNET_DB_PASS='CHANGE_OTHERWISE_NO_SECURITY'
REALNET_DB_PORT='5432'
REALNET_DB_NAME='realnet'
REALNET_URI='http://localhost:8080'
REALNET_REDIRECT_URI='http://localhost:4200/callback'
REALNET_MOBILE_REDIRECT_URI='io.realnet.app:/oauth2redirect'
REALNET_USERNAME='admin'
REALNET_PASSWORD='CHANGE_OTHERWISE_NO_SECURITY'
REALNET_EMAIL='admin@yourcompanydomain'
REALNET_SQS_URL=yourawssqsurl
REALNET_STORAGE_S3_BUCKET=yourrealnets3storagebucketname
REALNET_STORAGE_TYPE='s3'
REALNET_STORAGE_S3_KEY=yourrealnets3storagekey
REALNET_STORAGE_S3_SECRET=yourrealnets3storagesecret
REALNET_STORAGE_S3_REGION=yourrealnets3storageregion
# REALNET_BASE64_ENCODE_DATA='True'
REALNET_NAME='public'
REALNET_DB_TYPE=postgresql
REALNET_APP_SECRET='CHANGE_OTHERWISE_NO_SECURITY'
REALNET_USE_S3_UPLOAD_URL='True'
REALNET_TOKEN='[generated by realnet auth token]'
REALNET_CLIENT_KEY='[Retrieve by running command "realnet server initialize"]'
REALNET_CLIENT_SECRET='[Retrieve by running command "realnet server initialize"]'
REALNET_URL='[get from realnet server serve command or use 'https://realnet.io' for public]'
  • run command
chmod 700 .env
  • run the following commands:
python -m venv venv
. ./venv/bin/activate
python setup.py install
realnet server initialize
  • finally to start realnet and see available commands, run the following command:
realnet server start
  • for further info about the commands, run the following command:
realnet -h

How to build a Docker image and run it locally

TODO please validate and correct

docker build -t realnet:latest .
docker run -d -p 8080:8080 realnet:latest

How to install a pip package and run it locally

TODO please validate and correct

Make sure that you have the .env file present with the folder with the right values (see other sections). Your python version should probably be 3.10.11 or later

To upgrade python on ubuntu follow steps from https://computingforgeeks.com/how-to-install-python-on-ubuntu-linux-system/ and then if it is still not working try the following

curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3.10

sudo apt-get install python3.10-pip python3.10-distutils python3.10-dev python3.10-venv
curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3.10

Once the pre-requisits are satisfied, you can run realnet in the following way:

python3 -m venv venv
. ./venv/bin/activate
pip install realnet
pip install pyopenssl --upgrade
realnet server initialize
realnet server start

How to run on kubernetes via docker

deployment.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: realnet
spec:
  replicas: 1
  selector:
    matchLabels:
      app: realnet
  template:
    metadata:
      labels:
        app: realnet
    spec:
      containers:
        - name: realnet
          image: 'l33tsys/realnet'
          imagePullPolicy: "Always"
          ports:
            - containerPort: 8080
          envFrom:
            - configMapRef:
                name: realnet-config

configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: realnet-config
  labels:
    app: realnet
data:
  REALNET_SERVER_HOST: '0.0.0.0'
  REALNET_SERVER_PORT: '8080'
  # Local
  REALNET_DB_USER: 'postgres'
  REALNET_DB_HOST: 'localhost'
  REALNET_DB_PASS: 'CHANGE_OTHERWISE_NO_SECURITY'
  REALNET_DB_PORT: '5432'
  REALNET_DB_NAME: 'postgres'
  REALNET_URI: 'https://realnet.io'
  REALNET_REDIRECT_URI: 'https://www.realscape.io/callback'
  REALNET_MOBILE_REDIRECT_URI: 'io.realnet.app:/oauth2redirect'
  REALNET_USERNAME: 'admin'
  REALNET_PASSWORD: 'CHANGE_OTHERWISE_NO_SECURITY'
  REALNET_EMAIL: 'admin@yourcompanydomain'
  REALNET_SQS_URL: 'yourawssqsurl'
  REALNET_STORAGE_S3_BUCKET: yourrealnets3storagebucketname
  REALNET_STORAGE_TYPE: 's3'
  REALNET_STORAGE_S3_KEY: yourrealnets3storagekey
  REALNET_STORAGE_S3_SECRET: yourrealnets3storagesecret
  REALNET_STORAGE_S3_REGION: yourrealnets3storageregion
  REALNET_BASE64_ENCODE_DATA: 'True'
  REALNET_NAME: 'public'
  REALNET_DB_TYPE: postgresql
  REALNET_APP_SECRET: 'CHANGE_OTHERWISE_NO_SECURITY'
  REALNET_USE_S3_UPLOAD_URL: 'True'

service.yaml

apiVersion: v1
kind: Service
metadata:
  name: realnet
  annotations:
    external-dns.alpha.kubernetes.io/hostname: yourcompanydomain
    service.beta.kubernetes.io/aws-load-balancer-ssl-cert: yourlbcerturl
  labels:
    app: realnet
spec:
  type: LoadBalancer
  ports:
  - protocol: TCP
    port: 443
    targetPort: 8080
  selector:
   app: realnet

installation notes (python setup.py | pip install)

TODO: Review if below still applies

You may need to manually install some dependencies. The install command should tell you what is missing.

The Cryptography module takes a long time to compile.

Below is an incomplete list of installation instructions for dependencies. If you're not doing this on a fresh installation, you should run python setup.py install or pip install realnet to see what you need first.

  • Inside VENV
pip install --upgrade pip
pip install setuptools-rust
  • Outside VENV postgreSQL (pg_config is missing)
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql

c/c++ compilers (gcc/g++ is missing)

sudo apt update
sudo apt install build-essential

Optional Man pages

sudo apt-get install manpages-dev

To test the C & C++ compiler installations run these commands:

gcc --version
g++ --version

bluetooth dev tools (bluetooth/bluetooth.h is missing)

sudo apt-get install libbluetooth-dev

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

realnet-0.0.95.tar.gz (864.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

realnet-0.0.95-py3.10.egg (1.0 MB view details)

Uploaded Egg

realnet-0.0.95-py3-none-any.whl (895.2 kB view details)

Uploaded Python 3

File details

Details for the file realnet-0.0.95.tar.gz.

File metadata

  • Download URL: realnet-0.0.95.tar.gz
  • Upload date:
  • Size: 864.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for realnet-0.0.95.tar.gz
Algorithm Hash digest
SHA256 e01a42811c1ed9334f378352d31b1933e2ec0260fa666cf68e9602e26bb6eb4f
MD5 9952f0625141d27e79be365e81bf4d51
BLAKE2b-256 3456aa5ddb3066ea443fef39e95d451e434bbf406326d6bcbe622676a275d336

See more details on using hashes here.

File details

Details for the file realnet-0.0.95-py3.10.egg.

File metadata

  • Download URL: realnet-0.0.95-py3.10.egg
  • Upload date:
  • Size: 1.0 MB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for realnet-0.0.95-py3.10.egg
Algorithm Hash digest
SHA256 fb89e3e4cfa9dff3704e3a23d96c78f792d3512d198b7a14c462c45d6a79a0e5
MD5 fcb2d1c4db050595f566c8af88faaba0
BLAKE2b-256 8010be60a61e080621f85e8fe4d14f867a2f930bf80de60e0c72eadc97b90070

See more details on using hashes here.

File details

Details for the file realnet-0.0.95-py3-none-any.whl.

File metadata

  • Download URL: realnet-0.0.95-py3-none-any.whl
  • Upload date:
  • Size: 895.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for realnet-0.0.95-py3-none-any.whl
Algorithm Hash digest
SHA256 6d6df6a91ea6a5b2f7fa3f89c589185c88f6c3ffc972df89d536c670d00f37a5
MD5 3e983c15a7fffaf126854d4c73bd688d
BLAKE2b-256 cec9ffd82b282056dfcbf6630d58b6b33da8b0491df9790a2d1e750a6cca5c15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page