GithubHelp home page GithubHelp logo

atomspace / atomspace.od.ua Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 69.82 MB

Atom Space ๐Ÿš€

Home Page: https://atomspace.od.ua/

License: MIT License

JavaScript 39.02% HTML 16.24% CSS 2.55% Python 22.40% Dockerfile 0.28% Shell 1.62% SCSS 17.90%
docker javascript python atomspace official site

atomspace.od.ua's Introduction

CircleCI dependencies Status devDependencies Status Known Vulnerabilities

Atom Space public site

Development

Client

Requirenments

NODE_ENV=development //Set 'production' if its production

#Main urls to 'media' and 'api'
REACT_APP_MEDIA_URL=https://admin.atomspace-test.com/media/
REACT_APP_API_URL=https://admin.atomspace-test.com/api/v1
npm install
npm run start

Server

Requirenments

Install manually to host machine

pip3 install -r requirements.txt

Start server

cd ./server
python3 manage.py runserver

Production (Docker)

Preinstall:

  • docker
  • node (latest version)
  • python 3 version

Django (Server)

Prebuild

$ mkdir /usr/local/share/postgresql
$ cp ./server/.env.example ./server/.env
$ cp ./server/configure.sh.example ./server/configure.sh

$ mkdir ./server/logs

Check file ./server/.env and ./server/configure.sh to correct all config

Env file descirption

SECRET_KEY=SECRET_KEY // Secret key for hash user passwords

#Main mailbox from where messages will be sent
[email protected] // Mail user
EMAIL_HOST_PASSWORD=askmefromadministration // Mail password

[email protected] // Additional email where all mails will dublicates

#Database config
DB_NAME=atomspace.od.ua // Name of database
DB_USER=admin // database user
DB_PASSWORD=changeme // database user password
DB_PORT=5432 // database port
DB_HOST=postgres // database main host
DB_ENGINE=django.db.backends.postgresql_psycopg2 // dont touch

#Dublicating info for postgres docker container
POSTGRES_USER=the_same_as_DB_NAME
POSTGRES_PASSWORD=the_same_as_DB_PASSWORD
POSTGRES_DB=the_same_as_DB_NAME

#User admin credentials
INITIAL_USER_NAME=atomspace
[email protected]
INITIAL_USER_PASSWORD=ineedmorespace
$ sudo docker-compose -f docker-compose.yml up -d --build

React (Client)

To deploy client first you need to build then to move build to your website folder of nginx

$ cp ./client/.env.example ./client/.env
$ cd client
$ npm install

Check file ./client/.env to correct all config from example ./client/.env.example

$ npm run build
$ cp -R build/* /var/www/{name_of_site}.com/

Nginx

Installing and configure Nginx

$ sudo apt-get install nginx
$ nginx start

Config nginx

$ vim /etc/nginx/sites-available/atomspace.od.ua
server {
        listen 80;
        return 301 https://$host$request_uri;
}

server  {

        # SSL configuration
        #
        listen 443;
        ssl on;
        # listen [::]:443 ssl default_server;

        ssl_certificate /home/ubuntu/ssl/atomspace-test.com.crt;
        ssl_certificate_key /home/ubuntu/ssl/atomspace-test.com-key.pem;

        root /var/www/atomspace.od.ua/;

        index index.html index.htm index.nginx-debian.html;

        server_name atomspace-test.com www.atomspace-test.com;

        location / {
                try_files $uri $uri/ =404;
        }

}

server {
        listen 443;
        ssl on;
        ssl_certificate /home/ubuntu/ssl/admin.atomspace-test.com.crt;
        ssl_certificate_key /home/ubuntu/ssl/admin.atomspace-test.com-key.pem;

        server_name  admin.atomspace-test.com www.admin.atomspace-test.com;

        location /static/ {
                alias /home/ubuntu/atomspace.od.ua/server/static/;
        }

        location /media/ {
                alias /home/ubuntu/atomspace.od.ua/server/media/;
        }

        location / {
                proxy_pass http://atomspace-test.com:8000;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
}
  • create symlink to /etc/nginx/sites-enabled folder
  • copy your ssls to /home/ubuntu/ssl/
    • you must have 2 .crt and 2 .pem files for admin.*.com and *.com
  • reload nginx nginx -s reload

Updating ssl certificates

For client side:

$ sudo certbot certonly --webroot -w /var/www/atomspace-test.com -d www.atomspace-test.com,atomspace-test.com

For admin:

$ letsencrypt-auto --test-cert --nginx --domain admin.atomspace-test.com

atomspace.od.ua's People

Contributors

dependabot[bot] avatar eugeneosadchyi avatar lossless1 avatar max-osadchiy avatar mykhailo-budish avatar osadchyi avatar snyk-bot avatar vikky32 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vikky32

atomspace.od.ua's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.