Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move add SSL certs to Nextcloud from Collabora Online into SSL4tor. #39

Open
3 tasks done
a-t-0 opened this issue May 2, 2023 · 0 comments
Open
3 tasks done

Comments

@a-t-0
Copy link
Contributor

a-t-0 commented May 2, 2023

  • DO NOT Include:
set_nextcloud_port() {
  local nextcloud_port="$1"

  yellow_msg "\nConfiguring NextCloud:${nextcloud_port}, please wait...\n"
  sudo snap set nextcloud ports.http="${nextcloud_port}"
  # TODO: verify nextcloud port is set successfully.

  #The website should display:
  #Secure Connection Failed

  #An error occurred during a connection to localhost:81. SSL received a
  # record that exceeded the maximum permissible length.

  # Error code: SSL_ERROR_RX_RECORD_TOO_LONG

}

  • Include:
add_onion_to_nextcloud_trusted_domain() {

  local onion_address
  onion_address=$(sudo cat "$NEXTCLOUD_HIDDEN_SERVICE_PATH/hostname")

  # TODO: verify format of incoming onion address.

  #add Hidden Service address like a trusted domain in NextCloud instance
  sudo /snap/bin/nextcloud.occ config:system:set trusted_domains 1 --value="$onion_address"
  printf "\nThe Hidden Service address has been added like trusted domain successfully.\n"

  # TODO: verify output:
  sudo /snap/bin/nextcloud.occ config:system:get trusted_domains
}
  • Include:
dd_certs_to_nextcloud() {
  local ssl_public_key_filename="$1"
  local ssl_private_key_filename="$2"
  local merged_ca_ssl_cert_filename="$3"

  # First copy the files into nextcloud.
  # Source: https://github.com/nextcloud-snap/nextcloud-snap/issues/256
  # (see nextcloud.enable-https custom -h command).
  #sudo cp ca.pem /var/snap/nextcloud/current/ca.pem
  sudo cp "$ssl_public_key_filename" /var/snap/nextcloud/current/"$ssl_public_key_filename"
  sudo cp "$ssl_private_key_filename" /var/snap/nextcloud/current/"$ssl_private_key_filename"
  sudo cp "$merged_ca_ssl_cert_filename" /var/snap/nextcloud/current/"$merged_ca_ssl_cert_filename"
  read -p "Before enable"

  # CLI sudo /snap/bin/nextcloud.enable-https custom Says:
  sudo /snap/bin/nextcloud.enable-https custom "/var/snap/nextcloud/current/$ssl_public_key_filename" "/var/snap/nextcloud/current/$ssl_private_key_filename" "/var/snap/nextcloud/current/$merged_ca_ssl_cert_filename"
  #sudo /snap/bin/nextcloud.enable-https custom "/var/snap/nextcloud/current/cert.pem" "/var/snap/nextcloud/current/cert-key.pem" "/var/snap/nextcloud/current/fullchain.pem"
}

From here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant