Compare commits
3 Commits
719e4b2780
...
9dfa0e63bb
Author | SHA1 | Date | |
---|---|---|---|
9dfa0e63bb
|
|||
6e78335f5d
|
|||
aa8990e1c7
|
13
20220825081058-batcat.org
Normal file
13
20220825081058-batcat.org
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
:PROPERTIES:
|
||||||
|
:ID: d5b19724-9559-44de-aef7-c4d57fb6dc95
|
||||||
|
:mtime: 20230521174952
|
||||||
|
:ctime: 20220825081058
|
||||||
|
:END:
|
||||||
|
#+title: batcat
|
||||||
|
|
||||||
|
* Introduction
|
||||||
|
utilitaire permettant de visualiser les fichiers depuis un terminal avec une mise en forme plus évoluée que /cat/
|
||||||
|
(coloration syntaxique).
|
||||||
|
|
||||||
|
* Références
|
||||||
|
* [[https://github.com/sharkdp/bat][GitHub - sharkdp/bat: A cat(1) clone with wings.]]
|
145
20230520112339-readflow.org
Normal file
145
20230520112339-readflow.org
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
:PROPERTIES:
|
||||||
|
:ID: af021596-3d07-42bf-9131-0c203ac1c26f
|
||||||
|
:mtime: 20230521180253
|
||||||
|
:ctime: 20230520112339
|
||||||
|
:END:
|
||||||
|
#+title: readflow
|
||||||
|
|
||||||
|
* Introduction
|
||||||
|
Sauvegarde de page web pour lecture offline.
|
||||||
|
|
||||||
|
* Installation
|
||||||
|
** API
|
||||||
|
*** Build
|
||||||
|
#+BEGIN_SRC shell
|
||||||
|
cd /opt/
|
||||||
|
git clone https://github.com/ncarlier/readflow.git readflow
|
||||||
|
cd readflow
|
||||||
|
git submodule init
|
||||||
|
git submodule update
|
||||||
|
make
|
||||||
|
#+END_SRC
|
||||||
|
*** Configuration
|
||||||
|
**** Préparation des variables d'environnement
|
||||||
|
Contenu du fichier ~env~:
|
||||||
|
#+BEGIN_SRC shell
|
||||||
|
export READFLOW_DB="postgres://<db_user>:<db_pass>@localhost/readflow"
|
||||||
|
export READFLOW_LISTEN_ADDR="localhost:8010"
|
||||||
|
export READFLOW_LISTEN_METRICS=
|
||||||
|
export READFLOW_AUTHN="https://login.adrien.run/realms/readings"
|
||||||
|
export READFLOW_PUBLIC_URL="https://readflow.adrien.run"
|
||||||
|
export READFLOW_SECRET_SALT="<salt>"
|
||||||
|
export READFLOW_BLOCK_LIST=
|
||||||
|
export READFLOW_BROKER_URI=
|
||||||
|
export READFLOW_WEB_SCRAPER_URL=
|
||||||
|
export READFLOW_IMAGE_PROXY_URL=
|
||||||
|
export READFLOW_AVATAR_PROVIDER=
|
||||||
|
export READFLOW_SECRETS_ENGINE_PROVIDER=
|
||||||
|
export READFLOW_SENTRY_DSN=
|
||||||
|
export READFLOW_POCKET_CONSUMER_KEY=
|
||||||
|
|
||||||
|
export REACT_APP_API_ROOT="/api"
|
||||||
|
export REACT_APP_AUTHORITY="https://login.adrien.run/realms/readings"
|
||||||
|
export REACT_APP_CLIENT_ID="readflow"
|
||||||
|
export REACT_APP_REDIRECT_URL="https://readflow.adrien.run/login"
|
||||||
|
#+END_SRC
|
||||||
|
**** Substitution des variables du fichier de configuration
|
||||||
|
#+BEGIN_SRC shell
|
||||||
|
source ./env
|
||||||
|
envsubst < ./readflow.toml > ./config.toml
|
||||||
|
#+END_SRC
|
||||||
|
*** Exécution
|
||||||
|
#+BEGIN_SRC shell
|
||||||
|
./release/readflow -config ./config.toml
|
||||||
|
#+END_SRC
|
||||||
|
Ou
|
||||||
|
#+BEGIN_SRC shell
|
||||||
|
cat >/lib/systemd/system/readflow.service <<EOF
|
||||||
|
[Unit]
|
||||||
|
Description=Readflow service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=readflow
|
||||||
|
ExecStart=/opt/readflow/release/readflow -config /opt/readflow/config.toml
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=always
|
||||||
|
RestartSec=3
|
||||||
|
SyslogIdentifier=readflow
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
#+END_SRC
|
||||||
|
#+BEGIN_SRC shell
|
||||||
|
adduser --system --no-create-home --disabled-password --disabled-login readflow
|
||||||
|
systemctl enable readflow
|
||||||
|
systemctl start readflow
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** Webclient
|
||||||
|
#+BEGIN_SRC shell
|
||||||
|
n lts # Require a up to date node version
|
||||||
|
npm install --legacy-peer-deps
|
||||||
|
npm run build
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** Nginx
|
||||||
|
#+BEGIN_SRC conf
|
||||||
|
server {
|
||||||
|
server_name readflow.adrien.run;
|
||||||
|
|
||||||
|
listen 443 ssl http2;
|
||||||
|
listen [::]:443 ssl http2;
|
||||||
|
|
||||||
|
# SSL configuration
|
||||||
|
include /etc/nginx/ssl.conf;
|
||||||
|
ssl_certificate /etc/letsencrypt/live/readflow.adrien.run/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/readflow.adrien.run/privkey.pem;
|
||||||
|
|
||||||
|
# Logging configuration
|
||||||
|
access_log /var/log/nginx/readflow.access.log;
|
||||||
|
error_log /var/log/nginx/readflow.error.log;
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_static on; # allows pre-serving of .gz file if it exists
|
||||||
|
gzip_disable "msie6"; # Disable for user-agent Internet explorer 6. Not supported.
|
||||||
|
gzip_proxied any; # enable gzip for all proxied requests
|
||||||
|
gzip_buffers 16 8k; # number and size of buffers to compress a response
|
||||||
|
gzip_http_version 1.1;
|
||||||
|
gzip_min_length 256; # Only gzip files of size in bytes
|
||||||
|
gzip_types text/plain text/css text/html application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
|
||||||
|
gunzip on;
|
||||||
|
|
||||||
|
add_header 'Access-Control-Allow-Origin' 'https://login.adrien.run';
|
||||||
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||||
|
|
||||||
|
location /api {
|
||||||
|
rewrite /api/(.*) /$1 break;
|
||||||
|
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_pass http://127.0.0.1:8010;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
root /opt/readflow/ui/build;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
server_name readflow.adrien.run;
|
||||||
|
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
if ($host = readflow.adrien.run) {
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
* Références
|
||||||
|
* [[https://github.com/ncarlier/readflow][Readflow - Github]]
|
||||||
|
* [[https://github.com/ncarlier/readflow/issues/48][Can a simple tutorial be provided for non-professionals #48 - Github]]
|
99
20230520122106-keycloak.org
Normal file
99
20230520122106-keycloak.org
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
:PROPERTIES:
|
||||||
|
:ID: e0695c59-6fd5-4074-81ca-8e14ec965bbd
|
||||||
|
:mtime: 20230521180042
|
||||||
|
:ctime: 20230520122106
|
||||||
|
:END:
|
||||||
|
#+title: keycloak
|
||||||
|
|
||||||
|
* Introduction
|
||||||
|
Service open-source de gestion d'authentification et d'accès.
|
||||||
|
|
||||||
|
* Installation
|
||||||
|
** Application
|
||||||
|
#+BEGIN_SRC shell
|
||||||
|
apt install openjdk-19-jre
|
||||||
|
cd /opt/
|
||||||
|
wget https://github.com/keycloak/keycloak/releases/download/21.1.1/keycloak-21.1.1.zip
|
||||||
|
unzip keycloak-21.1.1.zip
|
||||||
|
cd keycloak-21.1.1
|
||||||
|
# bin/kc.sh start-dev
|
||||||
|
|
||||||
|
cat >/opt/keycloak/conf/keycloak.conf <<EOF
|
||||||
|
db=postgres
|
||||||
|
db-username=keycloak
|
||||||
|
db-password=<db_password>
|
||||||
|
proxy=edge
|
||||||
|
hostname=login.adrien.run
|
||||||
|
http-host=127.0.0.1
|
||||||
|
http-port=9090
|
||||||
|
hostname-strict-https=false
|
||||||
|
EOF
|
||||||
|
|
||||||
|
bin/kc.sh build
|
||||||
|
|
||||||
|
cat >/lib/systemd/system/keycloak.service <<EOF
|
||||||
|
[Unit]
|
||||||
|
Description=Keycloak service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=keycloak
|
||||||
|
ExecStart=/opt/keycloak/bin/kc.sh start
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=always
|
||||||
|
RestartSec=3
|
||||||
|
SyslogIdentifier=keycloak
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
|
||||||
|
adduser --system --no-create-home --disabled-password --disabled-login keycloak
|
||||||
|
chown keycloak ./data/ -R
|
||||||
|
|
||||||
|
systemctl enable keycloak
|
||||||
|
systemctl start keycloak
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** Nginx
|
||||||
|
#+BEGIN_SRC conf
|
||||||
|
server {
|
||||||
|
server_name login.adrien.run;
|
||||||
|
|
||||||
|
listen 443 ssl http2;
|
||||||
|
listen [::]:443 ssl http2;
|
||||||
|
|
||||||
|
# SSL configuration
|
||||||
|
include /etc/nginx/ssl.conf;
|
||||||
|
ssl_certificate /etc/letsencrypt/live/login.adrien.run/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/login.adrien.run/privkey.pem;
|
||||||
|
|
||||||
|
# Loggin coinfuguration
|
||||||
|
access_log /var/log/nginx/login.access.log;
|
||||||
|
error_log /var/log/nginx/login.error.log;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:9090;
|
||||||
|
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_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
server_name login.adrien.run;
|
||||||
|
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
if ($host = login.adrien.run) {
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
* Références
|
||||||
|
* [[https://github.com/keycloak/keycloak][Keycloak - Github]]
|
||||||
|
|
Reference in New Issue
Block a user