belenios voting system install
install apache2 and proxy
Install belenios
git clone https://github.com/glondu/belenios.git
Install packages;
apt install bubblewrap build-essential libgmp-dev libpcre3-dev pkg-config m4 libssl-dev libsqlite3-dev wget ca-certificates zip unzip libncurses-dev zlib1g-dev libgd-securityimage-perl cracklib-runtime jq build-essential libgmp-dev libpcre3-dev pkg-config m4 libssl-dev libsqlite3-dev wget ca-certificates unzip libncurses-dev zlib1g-dev rsync darcs
Install opam:
./opam-bootstrap.sh
echo "source /home/pacman/belenios/env.sh" >> /root/.bashrc
source /home/pacman/belenios/env.sh
make build-release-server
make release
make check
Spustenie serveru:
./demo/run-server.sh &
Spustenie serveru pri starte:
nano /etc/rc.local
screen -S belenios -d -m bash -c "source /home/pacman/belenios/env.sh; cd /home/pacman/belenios; /home/pacman/belenios/demo/run-server.sh"
Install apereo CAS
nano etc/cas/config/cas.properties
cas.server.name=https://hlasovaniecas.tuke.sk:8080
cas.server.prefix=${cas.server.name}/cas
logging.config: file:/etc/cas/config/log4j2.xml
server.tomcat.protocol-header-https-value=http
# Run on port 80; disable SSL for now
server.port=8080
server.ssl.enabled=false
cas.serviceRegistry.initFromJson=true
cas.serviceRegistry.json.location=file:///etc/cas/services
# cas.authn.accept.users=
cas.authn.accept.users=
### Connexion LDAP
cas.authn.ldap[0].providerClass=org.ldaptive.provider.unboundid.UnboundIDProvider
cas.authn.ldap[0].type=AUTHENTICATED
cas.authn.ldap[0].useSsl=false
cas.authn.ldap[0].ldapUrl=ldap://ad.tuke.sk:389
cas.authn.ldap[0].baseDn=OU=Users,OU=TUKE,DC=ad,DC=tuke,DC=sk
cas.authn.ldap[0].subtreeSearch=true
#cas.authn.ldap[0].searchFilter=sAMAccountName={user}
cas.authn.ldap[0].searchFilter=mail={user}
cas.authn.ldap[0].principalAttributeList=cn,givenName,mail
### Credential to connect to LDAP
#cas.authn.ldap[0].bindDn=CN=Administrator,CN=Users,DC=lab1,DC=mhasin,DC=eu
#cas.authn.ldap[0].bindCredential=heslo
cas.authn.ldap[0].bindDn=CN=memnooo,OU=Users,OU=TUKE,DC=ad,DC=tuke,DC=sk
cas.authn.ldap[0].bindCredential=heslo
nano etc/cas/services/hlasovanie.tuke.sk-100.json
{
"@class" : "org.apereo.cas.services.RegexRegisteredService",
"serviceId" : "^(http|https)://.*",
"name" : "hlasovanie.tuke.sk",
"id" : 100,
"description" : "Prihlasenie do portalu hlasovanie.tuke.sk",
"properties" : {
"@class" : "java.util.HashMap",
"email" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ "martin.hasin@tuke.sk" ] ]
}
}
}
Run script:
nano /usr/lib/systemd/system/apereo.service
# systemd service unit file that calls the script to load / save persistent data
[Unit]
Description=Docker run apereo
DefaultDependencies=no
# This may need to be changed: sysinit.target may not be the best requirement
After=local-fs.target docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash /home/pacman/cas-overlay-template/docker-run.sh
ExecStop=/bin/bash /home/pacman/cas-overlay-template/docker-stop.sh
[Install]
WantedBy=multi-user.target
nano /home/pacman/cas-overlay-template/docker-stop.sh
#!/bin/bash
docker stop cas > /dev/null 2>&1
docker rm cas > /dev/null 2>&1