Giter Club home page Giter Club logo

testdcp's Introduction

#Configuration de développpement

##Installation d'un serveur Le projet repose pour sur un serveur virtuel sous Fedora. Depuis la connexion Root, on lance

dnf install podman
firewall-cmd --zone=public --add-port=9090/tcp

##Renouvellement des certificats Let's encrypt Installation pour fedora

dnf install certbot
firewall-cmd --zone=public --add-port=8080/tcp
certbot certonly --standalone --email [email protected] -d server.f80.fr
mkdir /root/certs
cp /etc/letsencrypt/live/server.f80.fr/* /root/certs

##Netoyage préalable Il peut être nécessaire de netoyer la base prélablement:

python manage.py flush --settings OpenAlumni.settings 
python manage.py search_index --rebuild

##Installation Après avoir récupérer le code, on installe une version locale de postgres puis on execute

python manage.py makemigrations
python manage.py flush
python manage.py migrate

##Création du compte admin

python manage.py createsuperuser

#Tester la sécurisation ##Tester l'obtention des token

http://127.0.0.1:8000/api/token/

#Installation sur un serveur

La base de données

Executer la commande

firewall-cmd --zone=public --add-port=5432/tcp
docker rm -f postgres & docker run --name postgres -p 5432:5432  -v /root/postgre:/var/lib/postgresql/data --restart=always  -e POSTGRES_PASSWORD=hh4271 -e POSTGRES_DB=alumni_db -e POSTGRES_USER=hhoareau -d postgres:13-alpine

ou avec podman

setenforce 0 
mkdir /root/postgre
docker rm -f postgre
docker run --name postgre -p 5432:5432  -v /root/postgre:/var/lib/postgresql/data --restart=always  -e POSTGRES_PASSWORD=hh4271 -e POSTGRES_DB=alumni_db -e POSTGRES_USER=hhoareau -d postgres:13-alpine

Si probléme d'accès au répertoire /root/postgres, il faut fixer avec su -c "setenforce 0"

Créer les utilisateurs admin & anonymous

##Le serveur Django A priori le serveur djando s'installe sur le MainServer

cd /root
mkdir nginx
wget https://raw.githubusercontent.com/f80defv/OpenAlumni/master/nginx.conf nginx.conf && mv nginx.conf /root/nginx
wget https://raw.githubusercontent.com/f80dev/OpenAlumni/master/Dockerfile ./nginx/ 
wget https://raw.githubusercontent.com/f80dev/OpenAlumni/master/docker-compose.yml
docker-compose up -d --build

##Elasticsearch démarrer le noeud elasticsearch pour la production

firewall-cmd --zone=public --add-port=9200/tcp
firewall-cmd --zone=public --add-port=9300/tcp
docker rm -f elastic_search_server
docker run -p 9200:9200 -p 9300:9300 --restart=always -e "discovery.type=single-node" --name elastic_search_server -d docker.elastic.co/elasticsearch/elasticsearch:7.9.2

ou avec docker pour l'environnement de dev

firewall-cmd --zone=public --add-port=9210/tcp
firewall-cmd --zone=public --add-port=9310/tcp
docker run -p 9210:9200 -p 9310:9300 --restart=always -e "discovery.type=single-node" --name elastic_search_server-dev -d docker.elastic.co/elasticsearch/elasticsearch:7.9.2

puis reconstruire l'index par

python manage.py search_index --rebuild

#Développement ##Utilisation d'elasticsearch Voir https://django-elasticsearch-dsl.readthedocs.io/en/latest/about.html et l'intégration avec le rest framework : https://django-elasticsearch-dsl-drf.readthedocs.io/en/latest/quick_start.html

#Tests ##tester en production Ouverture via https://dcp.f80.fr/search

##tester en local Ouverture via http://localhost:4200/admin

#Divers

https://bezkoder.com/django-angular-crud-rest-framework/

Accès aux information LinkedIn:

Demande d'accès au profil complet : https://docs.microsoft.com/en-us/linkedin/shared/references/v2/profile/full-profile?context=linkedin/consumer/context

#Installation du serveur ##Installation de cockpit

dnf install cockpit
dnf install cockpit-dashboard cockpit-podman cockpit-machines cockpit-networkmanager cockpit-packagekit cockpit-storaged
systemctl restart cockpit.socket

##Configuration des sous domaines ###paramaitrage du nom de domaine Connexion à https://my.ionos.fr/domain-details/dcp.f80.fr Paramétrage du dns : Sous domaine de production: - dcp : 185.199.108.153 & 185.199.109.153

Sous domaine de developpement:
- dcp-dev : 185.199.108.153 & 185.199.109.153

###Paramaitrage du github

##Installation du firewall

dnf install 
systemctl unmask firewalld
systemctl start firewalld
systemctl enable firewalld

##Installation de podman (remplacent de docker pour fedora)

 yum -y install podman
 

##Installation de docker-ce

sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
sudo sed -i 's/$releasever/31/g' /etc/yum.repos.d/docker-ce.repo
sudo dnf install docker-ce
sudo systemctl enable --now docker

#Déploiement de la version de production Produire le fichier

#Références ##Analyse du graph social Utilisation de l'appli Gephi Manuel : http://gephi.michalnovak.eu/Mastering%20Gephi%20Network%20Visualization.pdf

testdcp's People

Contributors

f80dev avatar

Watchers

 avatar

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.