Explorar o código

Add Firefox Sync Server

Dennis Rodewyk %!s(int64=5) %!d(string=hai) anos
pai
achega
637434c741

+ 8 - 0
data/services/firefoxsync/containers.sh

@@ -0,0 +1,8 @@
+firefoxsync_service_dockerbunker() {
+	docker run -d \
+		--name=${FUNCNAME[0]//_/-} \
+		--restart=always \
+		--network ${NETWORK} \
+		--env-file "${SERVICE_ENV}" \
+		${IMAGES[service]} >/dev/null
+}

+ 49 - 0
data/services/firefoxsync/firefoxsync.sh

@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+
+while true;do ls | grep -q dockerbunker.sh;if [[ $? == 0 ]];then BASE_DIR=$PWD;break;else cd ../;fi;done
+
+PROPER_NAME="Firefox Sync"
+SERVICE_NAME="$(echo -e "${PROPER_NAME,,}" | tr -d '[:space:]')"
+PROMPT_SSL=1
+
+declare -a environment=( "data/env/dockerbunker.env" "data/include/init.sh" )
+
+for env in "${environment[@]}";do
+	[[ -f "${BASE_DIR}"/$env ]] && source "${BASE_DIR}"/$env
+done
+
+declare -A WEB_SERVICES
+declare -a containers=( "${SERVICE_NAME}-service-dockerbunker" )
+declare -a add_to_network=( "${SERVICE_NAME}-service-dockerbunker" )
+declare -A IMAGES=( [service]="chaosbunker/firefox-sync-server-docker" )
+declare -a networks=( )
+
+[[ -z $1 ]] && options_menu
+
+configure() {
+	pre_configure_routine
+	
+	echo -e "# \e[4mFirefox Sync Settings\e[0m"
+
+	set_domain
+	
+	cat <<-EOF >> "${SERVICE_ENV}"
+	PROPER_NAME="${PROPER_NAME}"
+	SERVICE_NAME=${SERVICE_NAME}
+	SSL_CHOICE=${SSL_CHOICE}
+	LE_EMAIL=${LE_EMAIL}
+
+	SERVICE_DOMAIN=${SERVICE_DOMAIN}
+	URL=https://${SERVICE_DOMAIN}
+	FORCE_WSGI_ENVIRON=false
+	
+	EOF
+
+	post_configure_routine
+}
+
+if [[ $1 == "letsencrypt" ]];then
+	$1 $*
+else
+	$1
+fi

+ 56 - 0
data/services/firefoxsync/nginx/firefoxsync.conf

@@ -0,0 +1,56 @@
+##
+# You should look at the following URL's in order to grasp a solid understanding
+# of Nginx configuration files in order to fully unleash the power of Nginx.
+# http://wiki.nginx.org/Pitfalls
+# http://wiki.nginx.org/QuickStart
+# http://wiki.nginx.org/Configuration
+#
+# Generally, you will want to move this file somewhere, and start with a clean
+# file but keep this around for reference. Or just disable in sites-enabled.
+#
+# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
+##
+
+# Default server configuration
+#
+upstream firefoxsync {
+ server firefoxsync-service-dockerbunker:5000;
+}
+
+server {
+    listen 80;
+	server_name ${SERVICE_DOMAIN};
+    return 301 https://$host$request_uri;
+}
+
+server {
+    listen 443 ssl;
+	server_name ${SERVICE_DOMAIN};
+	ssl_certificate /etc/nginx/ssl/${SERVICE_DOMAIN}/cert.pem;
+	ssl_certificate_key /etc/nginx/ssl/${SERVICE_DOMAIN}/key.pem;
+	include /etc/nginx/includes/ssl.conf;
+
+    add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
+	add_header X-Frame-Options DENY;
+	add_header X-Content-Type-Options nosniff;
+
+	include /etc/nginx/includes/gzip.conf;
+
+    location / {
+		proxy_pass http://firefoxsync/;
+		proxy_set_header Host $http_host;
+		proxy_set_header X-Forwarded-Proto $scheme;
+		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+		proxy_set_header X-Real-IP $remote_addr;
+		proxy_redirect off;
+		proxy_read_timeout 120;
+		proxy_connect_timeout 10;
+    }
+
+	location ~ /.well-known {
+        allow all;
+		root /var/www/html;
+	}
+}
+
+

+ 1 - 0
dockerbunker.sh

@@ -29,6 +29,7 @@ declare -a ALL_SERVICES=( \
 	"Dillinger" \
 	"Drone CI" \
 	"Firefly III" \
+	"Firefox Sync" \
 	"Ghost" \
 	"GitBucket" \
 	"Gitea" \