Browse Source

🐛: fix WEBHOOK_KEY

ulyc 2 years ago
parent
commit
af5369c64d
3 changed files with 34 additions and 8 deletions
  1. 5 4
      init.sh
  2. 2 2
      template/Dockerfile.template
  3. 27 2
      template/config.ini.template

+ 5 - 4
init.sh

@@ -41,16 +41,16 @@ function progress() {
   printf "[▓"
   printf "[▓"
   while kill -0 "$1" 2>/dev/null; do
   while kill -0 "$1" 2>/dev/null; do
     printf "▓"
     printf "▓"
-    sleep 1
+    sleep 0.05
   done
   done
   wait "$1"
   wait "$1"
   printf "▓] done!"
   printf "▓] done!"
 }
 }
 
 
 function generate_config() {
 function generate_config() {
-  service_key=$(grep <genkeys Service | awk -F: '{print $2}')
-  network_key=$(grep <genkeys Network | awk -F: '{print $2}')
-  webhook_key=$(grep <genkeys Webhook | awk -F: 'BEGIN{print $2}')
+  service_key=$(grep <genkeys "Service" | awk -F: '{sub(/[[:blank:]]*/,"");print $2}')
+  network_key=$(grep <genkeys "Network" | awk -F: '{sub(/[[:blank:]]*/,"");print $2}')
+  webhook_key=$(grep <genkeys "Webhook Private" | awk -F: '{sub(/[[:blank:]]*/,"");print $2}')
   sed "s/{{SERVICE_KEY}}/$service_key/" ./template/config.ini.template >config.ini
   sed "s/{{SERVICE_KEY}}/$service_key/" ./template/config.ini.template >config.ini
   sed -i "s/{{NETWORK_KEY}}/$network_key/" config.ini
   sed -i "s/{{NETWORK_KEY}}/$network_key/" config.ini
   sed -i "s/{{WEBHOOK_KEY}}/$webhook_key/" config.ini
   sed -i "s/{{WEBHOOK_KEY}}/$webhook_key/" config.ini
@@ -203,3 +203,4 @@ echo
 echo
 echo
 
 
 # TODO modules config
 # TODO modules config
+# TODO Database secret

+ 2 - 2
template/Dockerfile.template

@@ -1,8 +1,8 @@
 FROM sr.ht-base:dev
 FROM sr.ht-base:dev
 COPY ./start.sh /
 COPY ./start.sh /
-
+RUN chmod +x /start.sh
 RUN apk add  {{MODULES}}
 RUN apk add  {{MODULES}}
-CMD ["./start.sh"]
+CMD ["/bin/sh", "start.sh"]
 
 
 
 
 
 

+ 27 - 2
template/config.ini.template

@@ -88,7 +88,7 @@ pgp-key-id=
 # Use the `srht-keygen webhook` command to generate this key. Put the private
 # Use the `srht-keygen webhook` command to generate this key. Put the private
 # key here and distribute the public key to anyone who would want to verify
 # key here and distribute the public key to anyone who would want to verify
 # webhook payloads from your service.
 # webhook payloads from your service.
-private-key= {{WEBHOOK_KEY}}
+private-key={{WEBHOOK_KEY}}
 
 
 
 
 [git.sr.ht]
 [git.sr.ht]
@@ -212,4 +212,29 @@ enabled=no
 #
 #
 # Get your keys at https://dashboard.stripe.com/account/apikeys
 # Get your keys at https://dashboard.stripe.com/account/apikeys
 stripe-public-key=
 stripe-public-key=
-stripe-secret-key=
+stripe-secret-key=
+
+[paste.sr.ht]
+#
+# URL paste.sr.ht is being served at (protocol://domain)
+origin=http://paste.sr.ht.local
+#
+# Address and port to bind the debug server to
+debug-host=0.0.0.0
+debug-port=5011
+#
+# Configures the SQLAlchemy connection string for the database.
+connection-string=postgresql://postgres@localhost/paste.sr.ht
+#
+# Set to "yes" to automatically run migrations on package upgrade.
+migrate-on-upgrade=yes
+#
+# paste.sr.ht's OAuth client ID and secret for meta.sr.ht
+# Register your client at meta.example.org/oauth
+oauth-client-id=
+oauth-client-secret=
+#
+# Origin URL for the API
+# Only needed if not run behind a reverse proxy, e.g. for local development.
+# By default, the API port is 100 more than the web port
+#api-origin=http://localhost:5111