Klayman
Members
-
Joined
-
Last visited
Solutions
-
Klayman's post in Where to put my own SSL certificate? was marked as the answerok, answer to self: I figured it out with below script, which is a simplification of this:
#!/bin/bash
# Define the source directory where the certificates are stored
# In my case npm-1 contains the wildcard certificate for my domain
source_dir="/mnt/user/appdata/Nginx-Proxy-Manager-Official/letsencrypt/live/npm-1/"
src_cert="cert.pem"
src_chain="chain.pem"
src_key="privkey.pem"
server_name="gorleben" # hostname of your server
##################################################################
# Check if the source directory exists
if [ ! -d "$source_dir" ]; then
echo "Error: Source directory not found: $source_dir. Make sure you have the correct path set in the script."
exit 1
fi
# Check if the source certificate files exist
if [ ! -f "$source_dir/$src_cert" ] || [ ! -f "$source_dir/$src_chain" ] || [ ! -f "$source_dir/$src_key" ]; then
echo "Error: Source certificate files not found. Make sure you have the correct file names set in the script."
exit 1
fi
# Generate certificate file names based on server hostname.
target="/boot/config/ssl/certs/${server_name}_unraid_bundle.pem"
# Copy and rename the source certificate files to each target directory
target_dir=$(dirname "$target")
if [ ! -d "$target_dir" ]; then
echo "Error: Target directory not found: $target_dir"
continue
fi
cat "$source_dir/$src_cert" "$source_dir/$src_chain" "$source_dir/$src_key" > "$target"
# Set appropriate permissions for the certificate files
chmod 600 "$target"
echo "Successfully copied and renamed SSL certificates to $target_dir"
# Restart the Nginx web server to apply the changes
echo "Reloading Nginx web server to apply SSL certificate changes..."
/etc/rc.d/rc.nginx reload || { echo "Failed to reload Nginx"; exit 1; }
echo "SSL certificates successfully reloaded"
-
Klayman's post in (SOLVED) Is there a container with an oauth proxy for legacy scanner/printer devices? was marked as the answerAnswer to self: Yes, there is. It's called email-OAuth2-proxy and can be found here: blacktirion/email-oauth2-proxy-docker: Dockerized Version of simonrob/email-oauth2-proxy
It allows to connect printers and scanners via smtp to services like Exchange365 which only allow OAuth V2 auhentication. Important aspect: The proxy will present an URL through which to authenticate. To do so, the following steps are necessary as the original proxy is not designed to run as a container:
Create emailproxy.config and start container
Open container console
Kill running process: ps aux | grep emailproxy.py kill -9 7
Run interactive: python emailproxy.py --no-gui --config-file /config/emailproxy.config --debug --external-auth
Run SMTP request against container IP and port
Complete login to provided link and provide interactive mode with localhost redirect link
(for me the first of the 2 links showed worked. Also maximizing the console seems to solve some issues with line breaks in the link)
Paste the redirect link with the authorization code from your browser back into the console, the proxy will create a token etc and write it to the config file
Restart container.
For Microsoft365: When you edit the config file, make sure you replace the word "common" in permission_url and token_url contain with your Microsoft/Azure tenant id.
Best,
Klayman