xrmx / chatlab Goto Github PK
View Code? Open in Web Editor NEWThis project forked from officinearduinotorino/chatlab
A place to store our adventure in self--hosted chats and disasters
This project forked from officinearduinotorino/chatlab
A place to store our adventure in self--hosted chats and disasters
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',
}
}
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/'
smtp, db server and python2.7 should be available on the vm
redirect nell'app oauth
https://labchat.foo.com/_oauth/chatlab
aggiornare path nel provider oauth per mettere /labadmin/ dappertutto e l'hostname pubblico
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
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;
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.