https://www.cnil.fr/en/privacy-impact-assessment-pia
https://github.com/LINCnil/pia-back
https://github.com/LINCnil/pia
benötigte Software für debian 9 (stretch):
apt-get install net-tools curl git postgresql exim4 ruby curl -sL https://deb.nodesource.com/setup_12.x | bash - apt-get update apt-get install npm nodejs apt-get install node-global-modules apt-get install build-essentials make gcc apt-get install yarn apt-get install apache2 libaprutil1-ldap libldap-2.4-2
eigenen Benutzer pia anlegen
useradd -m pia
damit anmelden und da alles rein pullen.
git clone https://github.com/atnos/pia-back.git git clone https://github.com/LINCnil/pia.git npm install save-svg-as-png #npm install node-sass@4.11.0 npm install sass-loader npm install @angular/common@^6.0.0-rc.0 npm install -g @angular/cli npm install -g @angular-devkit/build-angular npm install -g @angular/cli npm install -g @angular/compiler-cli npm install -g @angular/compiler npm install -g typescript npm install -g @angular/cli npm install -g npm@latest npm install -g @angular/cli npm install -g node-sass npm install -g @angular/core npm install -g rxjs npm install -g @angular/animations npm install -g @angular/core npm install -g @angular/forms npm install -g @angular/language-service npm install -g @angular/platform-browser npm install -g rxjs@^6.0.0
cd pia-back
Konfiguration bearbeiten und aktivieren:
cp config/database.example.yml config/database.yml
secret erstellen:
bin/rake secret >>config/application.example.yml #datei editieren! mv config/application.example.yml config/application.yml bin/setup #RAILS_ENV=production bin/rake db:create
postgresbenutzer anlegen
create user my_pia_user with encrypted password 'blablasecret';
postgres weiter konfigurieren
vi /etc/postgresql/9.6/main/pg_hba.conf
Es muss ein Verzeichnis /home/pia/node_modules
mit den Modulen existieren.
Datei /etc/systemd/system/pia.service
als root mit Inhalt anlegen:
# Systemd unit file for pia [Unit] Description=Start the Pia service Requires=network.target local-fs.target After=network.target local-fs.target [Service] Type=simple # ExecStartPre=RAILS_ENV=production ExecStart=/usr/bin/ng serve ExecStop=killall ng WorkingDirectory=/home/pia/pia # Environment="RAILS_ENV=production" User=pia Group=pia [Install] WantedBy=multi-user.target
Datei /etc/systemd/system/pia-back.service
als root mit Inhalt anlegen:
# Systemd unit file for PIA-BACK [Unit] Description=Start the Pia-backend service Requires=network.target local-fs.target After=network.target local-fs.target [Service] Type=simple # ExecStartPre=RAILS_ENV=production ExecStart=/home/pia/pia-back/bin/rails s ExecStop=killall ruby WorkingDirectory=/home/pia/pia-back Environment="RAILS_ENV=production" User=pia Group=pia [Install] WantedBy=multi-user.target
dann als root die Dienste starten:
systemctl restart postgresql systemctl restart pia-back systemctl restart pia
Datei /etc/apache2/sites-available/pia-proxy.conf
als root mit Inhalt anlegen:
<VirtualHost *:80> <Location /> ProxyPass "http://localhost:4200/" ProxyPassReverse "http://localhost:4200/" Order Allow,Deny Allow from All AuthType Basic AuthName "Please login with Domainaccount" AuthBasicProvider ldap #LDAPVerifyServerCert Off AuthLDAPURL 'ldap://mydomainctl:389/DC=my,DC=do,DC=main?sAMAccountName?sub?(objectClass=*)' AuthLDAPBindDN "my_ldap@my.do.main" AuthLDAPBindPassword "geheim" AuthLDAPGroupAttribute sAMAccountName AuthLDAPGroupAttributeIsDN off Require valid-user </Location> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Dann als root Reverseproxysite starten:
a2enmod proxy proxy_http ldap authnz_ldap a2dissite 000-default.conf a2ensite pia-proxy.conf systemctl restart apache2
Dann von einem entfernten Webbrowser http://meinPIAsrv öffnen.
Anmeldung mit Domain-Benutzer erforderlich.
evtl. noch verschlüsseln mit https.