Compare commits
No commits in common. "0f8842dd56b5304d8f19e1285c46e837d1da8df0" and "d8bd75003ba5af45901ee355a00ba8f5a4d9cf3a" have entirely different histories.
0f8842dd56
...
d8bd75003b
8 changed files with 117 additions and 188 deletions
13
README.md
13
README.md
|
|
@ -1,13 +0,0 @@
|
||||||
### Useful intel
|
|
||||||
|
|
||||||
Nginx reverse proxy installed on the remote server
|
|
||||||
- forwards requests to docker-compose powered python app
|
|
||||||
- serves static content found in /var/www/sciodog.fr/
|
|
||||||
|
|
||||||
SSL is setup using certbot
|
|
||||||
|
|
||||||
Docker-compose app is in /home/Zoe/sciodog
|
|
||||||
|
|
||||||
Quick restart: `docker compose down; docker compose up -d`
|
|
||||||
Project update: `docker compose down; docker rmi sciodog-sciodog; docker compose up -d`
|
|
||||||
|
|
||||||
|
|
@ -6,11 +6,7 @@ services:
|
||||||
environment:
|
environment:
|
||||||
WSGI_FILE: "sciodog.wsgi"
|
WSGI_FILE: "sciodog.wsgi"
|
||||||
HOSTNAME: "sciodog.fr"
|
HOSTNAME: "sciodog.fr"
|
||||||
PORT: 8000
|
PORT: 80
|
||||||
volumes:
|
|
||||||
- /var/www/sciodog.fr/:/var/www/sciodog.fr:rw
|
|
||||||
ports:
|
|
||||||
- "8000:8000"
|
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: "wget -O/dev/null -q http://127.0.0.1/"
|
test: "wget -O/dev/null -q http://127.0.0.1/"
|
||||||
|
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
server {
|
|
||||||
|
|
||||||
root /var/www/sciodog.fr;
|
|
||||||
|
|
||||||
index index.html index.htm index.nginx-debian.html;
|
|
||||||
|
|
||||||
server_name sciodog.fr;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
|
|
||||||
proxy_pass http://localhost:8000;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /static/ {
|
|
||||||
root /var/www/sciodog.fr/blog/;
|
|
||||||
}
|
|
||||||
|
|
||||||
listen [::]:443 ssl ipv6only=on; # managed by Certbot
|
|
||||||
listen 443 ssl; # managed by Certbot
|
|
||||||
ssl_certificate /etc/letsencrypt/live/sciodog.fr/fullchain.pem; # managed by Certbot
|
|
||||||
ssl_certificate_key /etc/letsencrypt/live/sciodog.fr/privkey.pem; # managed by Certbot
|
|
||||||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
||||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
||||||
|
|
||||||
}
|
|
||||||
server {
|
|
||||||
if ($host = sciodog.fr) {
|
|
||||||
return 301 https://$host$request_uri;
|
|
||||||
} # managed by Certbot
|
|
||||||
|
|
||||||
|
|
||||||
listen 80 default_server;
|
|
||||||
listen [::]:80 default_server;
|
|
||||||
|
|
||||||
server_name sciodog.fr;
|
|
||||||
return 404; # managed by Certbot
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -7,7 +7,7 @@ FROM alpine:latest
|
||||||
# UWSGI Configuration
|
# UWSGI Configuration
|
||||||
COPY configuration/ /etc/uwsgi/
|
COPY configuration/ /etc/uwsgi/
|
||||||
RUN mkdir -p /etc/uwsgi ; \
|
RUN mkdir -p /etc/uwsgi ; \
|
||||||
adduser uwsgi -S -D -H -s /usr/sbin/nologin -u 33; \
|
adduser uwsgi -S -D -H -s /usr/sbin/nologin ; \
|
||||||
apk add python3 python3-dev py3-pip gcc musl-dev linux-headers ; \
|
apk add python3 python3-dev py3-pip gcc musl-dev linux-headers ; \
|
||||||
pip install --break-system-packages uwsgi django
|
pip install --break-system-packages uwsgi django
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.7 KiB |
0
sciodog-app/app/blog/static/blog/images/carousel/logo-radio-flam.png
Normal file → Executable file
0
sciodog-app/app/blog/static/blog/images/carousel/logo-radio-flam.png
Normal file → Executable file
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
|
|
@ -72,69 +72,60 @@
|
||||||
<section id="partenaires" class="d-flex flex-column col-12 align-items-center justify-content-center mt-5">
|
<section id="partenaires" class="d-flex flex-column col-12 align-items-center justify-content-center mt-5">
|
||||||
<h1 class="title" style="line-height: 48px;">Ils font confiance à Sciodog</h1>
|
<h1 class="title" style="line-height: 48px;">Ils font confiance à Sciodog</h1>
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div id="recipeCarousel" class="carousel slide" data-bs-ride="carousel">
|
<div id="recipeCarousel" class="carousel slide" data-bs-ride="carousel">
|
||||||
<div class="carousel-inner" role="listbox">
|
<div class="carousel-inner" role="listbox">
|
||||||
<div class="carousel-item active align-items-center">
|
<div class="carousel-item active">
|
||||||
<div class="col-md-3 p-2">
|
<div class="col-md-3 p-2">
|
||||||
<a href="https://www.francebleu.fr/cotentin">
|
<a href="https://www.francebleu.fr/cotentin">
|
||||||
<div class="card p-2">
|
<div class="card p-2">
|
||||||
<div class="card-img">
|
<div class="card-img">
|
||||||
<img src="{% static 'blog/images/carousel/France_Bleu_Cotentin_2021.png' %}" class="img-fluid">
|
<img src="{% static 'blog/images/carousel/France_Bleu_Cotentin_2021.png' %}" class="img-fluid">
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="carousel-item">
|
||||||
|
<div class="col-md-3 p-2">
|
||||||
|
<a href="https://vetobricquebec.fr/">
|
||||||
|
<div class="card p-2">
|
||||||
|
<div class="card-img">
|
||||||
|
<img src="{% static 'blog/images/carousel/clinique.png' %}" class="img-fluid">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="carousel-item">
|
||||||
|
<div class="col-md-3 p-2">
|
||||||
|
<a href="https://www.tomandco.com/fr-fr/Nos-magasins/#!/l/cherbourg-en-cotentin/260-rue-du-grand-pre/3793999">
|
||||||
|
<div class="card p-2">
|
||||||
|
<div class="card-img" style="max-height=250px">
|
||||||
|
<img src="{% static 'blog/images/carousel/les_cotentinois_500.png' %}" class="img-fluid">
|
||||||
|
</div>
|
||||||
|
</div></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="carousel-item">
|
||||||
|
<div class="col-md-3 p-2">
|
||||||
|
<a href="https://www.radioflam.fr/">
|
||||||
|
<div class="card p-2">
|
||||||
|
<div class="card-img">
|
||||||
|
<img src="{% static 'blog/images/carousel/logo-radio-flam.png' %}" class="img-fluid">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="carousel-item align-items-center">
|
|
||||||
<div class="col-md-3 p-2">
|
|
||||||
<a href="https://vetobricquebec.fr/">
|
|
||||||
<div class="card p-2">
|
|
||||||
<div class="card-img">
|
|
||||||
<img src="{% static 'blog/images/carousel/clinique.png' %}" class="img-fluid">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="carousel-item align-items-center">
|
|
||||||
<div class="col-md-3 p-2">
|
|
||||||
<a href="https://www.tomandco.com/fr-fr/Nos-magasins/#!/l/cherbourg-en-cotentin/260-rue-du-grand-pre/3793999">
|
|
||||||
<div class="card p-2">
|
|
||||||
<div class="card-img" style="max-height=250px">
|
|
||||||
<img src="{% static 'blog/images/carousel/les_cotentinois_500.png' %}" class="img-fluid">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="carousel-item align-items-center">
|
|
||||||
<div class="col-md-3 p-2">
|
|
||||||
<a href="https://www.radioflam.fr/">
|
|
||||||
<div class="card p-2">
|
|
||||||
<div class="card-img">
|
|
||||||
<img src="{% static 'blog/images/carousel/logo-radio-flam.png' %}" class="img-fluid">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="carousel-item align-items-center">
|
|
||||||
<div class="col-md-3 p-2">
|
|
||||||
<a href="https://www.quimper-commerces.bzh/commerce/jmt-quimper">
|
|
||||||
<div class="card p-2">
|
|
||||||
<div class="card-img">
|
|
||||||
<img src="{% static 'blog/images/carousel/logo-jmt-quimper.png' %}" class="img-fluid" style="margin-top: auto; margin-bottom: auto;">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</div>
|
<section id="clients" class="d-flex flex-column col-12 align-items-center justify-content-center mt-2">
|
||||||
</section>
|
<div class="row justify-content-center">
|
||||||
<section id="clients" class="d-flex flex-column col-12 align-items-center justify-content-center mt-2">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-4 p-2">
|
<div class="col-md-4 p-2">
|
||||||
<a href="https://g.co/kgs/3SFJKb">
|
<a href="https://g.co/kgs/3SFJKb">
|
||||||
<img src="{% static 'blog/images/carousel/avis1.png' %}" class="img-fluid">
|
<img src="{% static 'blog/images/carousel/avis1.png' %}" class="img-fluid">
|
||||||
|
|
@ -163,109 +154,106 @@
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
<div class="d-flex flex-row justify-content-center align-items-center">
|
<div class="d-flex flex-row justify-content-center align-items-center">
|
||||||
<p class="my-1 title subtitle me-3" style="font-size: 16px;">sciodog50@gmail.com</p>
|
<p class="my-1 title subtitle me-3" style="font-size: 16px;">sciodog50@gmail.com</p>
|
||||||
<a class="d-flex flex-row justify-content-center align-self-end p-2"
|
<a class="d-flex flex-row justify-content-center align-self-end p-2"
|
||||||
href="https://www.instagram.com/sciodog/"
|
href="https://www.instagram.com/sciodog/"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
target="_blank">
|
target="_blank">
|
||||||
<img src="{% static 'blog/images/insta-logo.png' %}" width="40" height="40"
|
<img src="{% static 'blog/images/insta-logo.png' %}" width="40" height="40"
|
||||||
alt="logo instagram"/>
|
alt="logo instagram"/>
|
||||||
</a>
|
</a>
|
||||||
<a class="d-flex flex-row justify-content-center align-self-end p-2"
|
<a class="d-flex flex-row justify-content-center align-self-end p-2"
|
||||||
href="https://www.facebook.com/Sciodog"
|
href="https://www.facebook.com/Sciodog"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
target="_blank">
|
target="_blank">
|
||||||
<img src="{% static 'blog/images/fb-logo.png' %}" width="40" height="40"
|
<img src="{% static 'blog/images/fb-logo.png' %}" width="40" height="40"
|
||||||
alt="logo facebook"/>
|
alt="logo facebook"/>
|
||||||
</a>
|
</a>
|
||||||
<a class="d-flex flex-row justify-content-center align-self-end p-2"
|
<a class="d-flex flex-row justify-content-center align-self-end p-2"
|
||||||
href=""
|
href=""
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
target="_blank">
|
target="_blank">
|
||||||
<img src="{% static 'blog/images/LinkedIn_logo.png' %}" width="40" height="40"
|
<img src="{% static 'blog/images/LinkedIn_logo.png' %}" width="40" height="40"
|
||||||
alt="logo LinkedIn"/>
|
alt="logo LinkedIn"/>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://www.proxianimaux.fr/">
|
</div>
|
||||||
<img src="https://www.proxianimaux.fr/ressources/images/logo.png" alt="proxianimaux" width="160" style="max-width: 160px;" />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</footer>
|
</footer>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||||
<script>
|
<script>
|
||||||
fetch("https://sciodog.fr/posts").then((response) => {
|
fetch("https://sciodog.fr/posts").then((response) => {
|
||||||
response.json().then((json) => {
|
response.json().then((json) => {
|
||||||
let first = true;
|
let first = true;
|
||||||
json.forEach((el) => {
|
json.forEach((el) => {
|
||||||
if (el["message"] === undefined)
|
if (el["message"] === undefined)
|
||||||
return;
|
return;
|
||||||
let carousel = document.getElementById("fb-carousel");
|
let carousel = document.getElementById("fb-carousel");
|
||||||
let postContainer = document.createElement("div");
|
let postContainer = document.createElement("div");
|
||||||
postContainer.classList.add("carousel-item");
|
postContainer.classList.add("carousel-item");
|
||||||
postContainer.classList.add("justify-content-evenly");
|
postContainer.classList.add("justify-content-evenly");
|
||||||
if (first)
|
if (first)
|
||||||
postContainer.classList.add("active");
|
postContainer.classList.add("active");
|
||||||
let post = document.createElement("div");
|
let post = document.createElement("div");
|
||||||
post.classList.add("card");
|
post.classList.add("card");
|
||||||
post.classList.add("col-md-3");
|
post.classList.add("col-md-3");
|
||||||
let imgcontainer = document.createElement("div");
|
let imgcontainer = document.createElement("div");
|
||||||
imgcontainer.style = "max-height: 250px; overflow: hidden";
|
imgcontainer.style = "max-height: 250px; overflow: hidden";
|
||||||
let image = document.createElement("img");
|
let image = document.createElement("img");
|
||||||
image.alt = "fb post image";
|
image.alt = "fb post image";
|
||||||
image.src = el["media"];
|
image.src = el["media"];
|
||||||
image.classList.add("card-img-top");
|
image.classList.add("card-img-top");
|
||||||
let body = document.createElement("div");
|
let body = document.createElement("div");
|
||||||
body.classList.add("card-body");
|
body.classList.add("card-body");
|
||||||
let text = document.createElement("p");
|
let text = document.createElement("p");
|
||||||
text.classList.add("card-text");
|
text.classList.add("card-text");
|
||||||
text.classList.add("fb-text");
|
text.classList.add("fb-text");
|
||||||
text.innerText = el["message"];
|
text.innerText = el["message"];
|
||||||
let link = document.createElement("a");
|
let link = document.createElement("a");
|
||||||
link.href = el["url"];
|
link.href = el["url"];
|
||||||
link.classList.add("btn");
|
link.classList.add("btn");
|
||||||
link.style = "background-color: #C472A3";
|
link.style = "background-color: #C472A3";
|
||||||
link.innerText = "Voir plus";
|
link.innerText = "Voir plus";
|
||||||
imgcontainer.appendChild(image);
|
imgcontainer.appendChild(image);
|
||||||
body.appendChild(text);
|
body.appendChild(text);
|
||||||
body.appendChild(link);
|
body.appendChild(link);
|
||||||
post.appendChild(imgcontainer);
|
post.appendChild(imgcontainer);
|
||||||
post.appendChild(body);
|
post.appendChild(body);
|
||||||
postContainer.appendChild(post);
|
postContainer.appendChild(post);
|
||||||
carousel.appendChild(postContainer);
|
carousel.appendChild(postContainer);
|
||||||
first = false;
|
first = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
let items = document.querySelectorAll('#postsCarousel .carousel-item')
|
let items = document.querySelectorAll('#postsCarousel .carousel-item')
|
||||||
|
|
||||||
items.forEach((el) => {
|
items.forEach((el) => {
|
||||||
const minPerSlide = 3;
|
const minPerSlide = 3;
|
||||||
let next = el.nextElementSibling
|
let next = el.nextElementSibling
|
||||||
for (var i = 1; i < minPerSlide; i++) {
|
for (var i = 1; i < minPerSlide; i++) {
|
||||||
if (!next) {
|
if (!next) {
|
||||||
next = items[0];
|
next = items[0];
|
||||||
}
|
}
|
||||||
let cloneChild = next.cloneNode(true);
|
let cloneChild = next.cloneNode(true);
|
||||||
el.appendChild(cloneChild.children[0]);
|
el.appendChild(cloneChild.children[0]);
|
||||||
next = next.nextElementSibling;
|
next = next.nextElementSibling;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
let items = document.querySelectorAll('#recipeCarousel .carousel-item')
|
let items = document.querySelectorAll('#recipeCarousel .carousel-item')
|
||||||
|
|
||||||
items.forEach((el) => {
|
items.forEach((el) => {
|
||||||
const minPerSlide = 4;
|
const minPerSlide = 4;
|
||||||
let next = el.nextElementSibling
|
let next = el.nextElementSibling
|
||||||
for (var i = 1; i < minPerSlide; i++) {
|
for (var i = 1; i < minPerSlide; i++) {
|
||||||
if (!next) {
|
if (!next) {
|
||||||
next = items[0];
|
next = items[0];
|
||||||
}
|
}
|
||||||
let cloneChild = next.cloneNode(true);
|
let cloneChild = next.cloneNode(true);
|
||||||
el.appendChild(cloneChild.children[0]);
|
el.appendChild(cloneChild.children[0]);
|
||||||
next = next.nextElementSibling;
|
next = next.nextElementSibling;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class IndexView(View):
|
||||||
params = {
|
params = {
|
||||||
'access_token': access_token
|
'access_token': access_token
|
||||||
}
|
}
|
||||||
url = 'https://graph.facebook.com/v13.0/102786409210660/posts?fields=attachments,message,permalink_url&limit=10'
|
url = 'https://graph.facebook.com/v13.0/102786409210660/feed?fields=attachments,message,permalink_url&limit=10'
|
||||||
response = requests.get(url, params=params)
|
response = requests.get(url, params=params)
|
||||||
posts = []
|
posts = []
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue