GithubHelp home page GithubHelp logo

chatlab's People

Contributors

vongomben avatar

Watchers

 avatar  avatar

chatlab's Issues

add mysql server instructions

  • add mysql-server to the install libraries

docs

You'll be asked to insert a password for the mysql root user.

utf8_unicode_ci

In order to setup the mysql database we need to enter the mysql shell, youl'll be asked the :

mysql -u root -p

From inside the shell we'll create the db, the user and grant the needed perms:

create database labadmin;
# please use a different password
CREATE USER 'labadmin'@'localhost' IDENTIFIED BY 'apasswordforlabadmin';
GRANT ALL PRIVILEGES ON labadmin.* TO 'labadmin'@'localhost';
FLUSH PRIVILEGES;

settings:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'labadmin',
        'USER': 'labadmin',
        'PASSWORD': 'apasswordforlabadmin',
        'HOST': '/var/run/mysqld/mysqld.sock',
    }
}

update labadmin url and settings

urls.py

labadminpatterns = [
    url(r'admin/', admin.site.urls),
    url(r'labAdmin/', include('labAdmin.urls')),
    url(r'o/', include('oauth2_provider.urls', namespace='oauth2_provider')),

    url(r'accounts/login/$', auth_views.login, {'template_name': 'labadmin/login.html'}, name='login'),
    url(r'accounts/logout/$', auth_views.logout, name='logout'),
    url(r'accounts/password_reset/$', auth_views.password_reset, name='password_reset'),
    url(r'accounts/password_reset/done/$', auth_views.password_reset_done, name='password_reset_done'),
    url(r'accounts/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', auth_views.password_reset_confirm, name='password_reset_confirm'),
    url(r'accounts/reset/done/$', auth_views.password_reset_complete, name='password_reset_complete'),
]

urlpatterns = [
    url(r'^labadmin/', include(labadminpatterns)),
]

settings.py

STATIC_URL = '/labadmin/static/'
LOGIN_URL = '/labadmin/accounts/login/'

rivedere app oauth e conf

redirect nell'app oauth

https://labchat.foo.com/_oauth/chatlab

aggiornare path nel provider oauth per mettere /labadmin/ dappertutto e l'hostname pubblico

upstart job for ubuntu 14.04

description     "labadmin"

start on runlevel [345]
stop on runlevel [!2345]

respawn
setuid labadmin
setgid labadmin
chdir /var/www/labadmin

script
    set -x
    exec /var/www/labadmin/bin/labadmin
end script
sudo cp /var/www/labadmin/chatlab/LabAdmin/labadmin.upstart /etc/init/labadmin.conf
sudo initctl reload-configuration
sudo initctl start labadmin

nginx config

Please add the django custom nginx config:

upstream backend {
    server 127.0.0.1:3000;
} 
upstream backenddjango {
    server 127.0.0.1:8888;
}



server {

        listen 8443 ssl;

        root /var/www/;
        index index.html index.htm;
        server_name labchat.officine.cc;
    ssl on;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 
        ssl_certificate /etc/nginx/ssl/certificate-329605.crt;
        ssl_certificate_key /etc/nginx/ssl/labchat.key;

    location /labadmin {
        proxy_pass http://backenddjango;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forward-Proto http;
        proxy_set_header X-Nginx-Proxy true;

        proxy_redirect off;
    }

    location / {
        proxy_pass http://backend/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forward-Proto http;
        proxy_set_header X-Nginx-Proxy true;

        proxy_redirect off;
    }
}

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.