# Troubleshooting ## Software installation: To generate multiple domain and main domain certicates: ``` apt install rsync vim tmux certbot -y DOMAIN=digitaldemocratic.net certbot certonly --preferred-challenges dns --manual --email digitaldemocratic@$DOMAIN --agree-tos -d *.$DOMAIN,$DOMAIN ``` ## Data and configuration removal If you want to start from the scratch you can remove data and code (optional) Esborrar dades: ``` ./dd-ctl reset-data ``` Remove data, configuration, code and certificates: ``` cd /opt/DD/src ./dd-ctl reset-data # Following commands RESET ALL DATA except for certificates # execute them only if you know what you are doing # This *will* result in DATA LOSS "./dd-ctl" down rm -rf /opt/DD/data/* rm -rf /opt/DD/db/* rm -rf '/opt/DD/src/avatars' rm -rf '/opt/DD/src/moodle' rm -rf '/opt/DD/src/nextcloud' rm -rf '/opt/DD/src/wordpress' cd .. rm -rf /opt/DD/src hostname=test1 cp /opt/src/DD/dd.conf /opt/src/dd.conf.backup git clone https://gitlab.com/DD-workspace/DD /opt/src/DD cd /opt/src/DD cp dd.conf.sample dd.conf cp -r custom.sample custom ./securize_conf.sh # Change domain names in dd configuration to machine's hostname sed -i "s/DOMAIN=mydomain.com/DOMAIN=$hostname.digitaldemocratic.net/g" dd.conf sed -i "s/LETSENCRYPT_DNS=/LETSENCRYPT_DNS=$hostname.digitaldemocratic.net/g" dd.conf sed -i "s/LETSENCRYPT_EMAIL=/LETSENCRYPT_EMAIL=info@digitaldemocratic.net/g" dd.conf ./dd-ctl repo-update ``` ### Problems with dns if automatic renewal is not working, dns challenge method ```bash docker exec -ti dd-sso-haproxy /bin/sh ``` In docker: ```bash mkdir /certs/selfsigned mv /certs/*.pem /certs/selfsigned/ cat /etc/letsencrypt/live/$DOMAIN/fullchain.pem /etc/letsencrypt/live/$DOMAIN/privkey.pem > /certs/chain.pem exit ``` ### Keycloak cache clean Run these command **step by step**: ```bash docker exec -ti dd-sso-keycloak /opt/jboss/keycloak/bin/jboss-cli.sh --connect --command='/subsystem=keycloak-server/theme=defaults/:write-attribute(name=cacheThemes,value=false)' docker exec -ti dd-sso-keycloak /opt/jboss/keycloak/bin/jboss-cli.sh --connect --command='/subsystem=keycloak-server/theme=defaults/:write-attribute(name=cacheTemplates,value=false)' docker exec -ti dd-sso-keycloak /opt/jboss/keycloak/bin/jboss-cli.sh --connect --command='/subsystem=keycloak-server/theme=defaults/:write-attribute(name=staticMaxAge,value=-1)' docker exec -ti dd-sso-keycloak /opt/jboss/keycloak/bin/jboss-cli.sh --connect --command='reload' docker exec -ti dd-sso-keycloak /opt/jboss/keycloak/bin/jboss-cli.sh --connect --command='/subsystem=keycloak-server/theme=defaults/:write-attribute(name=cacheThemes,value=true)' docker exec -ti dd-sso-keycloak /opt/jboss/keycloak/bin/jboss-cli.sh --connect --command='/subsystem=keycloak-server/theme=defaults/:write-attribute(name=cacheTemplates,value=true)' docker exec -ti dd-sso-keycloak /opt/jboss/keycloak/bin/jboss-cli.sh --connect --command='/subsystem=keycloak-server/theme=defaults/:write-attribute(name=staticMaxAge,value=2592000)' docker exec -ti dd-sso-keycloak /opt/jboss/keycloak/bin/jboss-cli.sh --connect --command='reload' ```