]> git.r.bdr.sh - rbdr/blog/commitdiff
Use rsync instead of aws for ephemeral blog
authorRuben Beltran del Rio <redacted>
Wed, 26 Apr 2023 13:50:31 +0000 (15:50 +0200)
committerRuben Beltran del Rio <redacted>
Wed, 26 Apr 2023 13:50:31 +0000 (15:50 +0200)
lib/blog.js
templates/index.html

index 6923a10b3b649c845e0ae8386fa690fff498f57b..05c1ab6c847b36b218d61abfad2a39b7dfc4b3e6 100644 (file)
@@ -108,9 +108,9 @@ module.exports = class Blog {
    * @return {Promise<undefined>} empty promise, returns no value
    * @instance
    */
-  async publish(bucket) {
+  async publish(host) {
 
-    internals.debuglog(`Publishing to ${bucket}`);
+    internals.debuglog(`Publishing to ${host}`);
     try {
       await internals.exec('which aws');
     }
@@ -119,8 +119,8 @@ module.exports = class Blog {
     }
 
     try {
-      await internals.exec(`aws s3 sync --acl public-read --delete ${this.staticDirectory} s3://${bucket}`);
-      await internals.exec(`aws s3 cp --content-type 'text/plain; charset=utf-8 ' --acl public-read ${this.staticDirectory}/index.txt s3://${bucket}`);
+      internals.debuglog(`Copying ephemeral blog from ${this.staticDirectory}`);
+      await internals.exec(`rsync -r ${this.staticDirectory}/ ${host}`);
     }
     catch (err) {
       console.error('Failed to publish');
@@ -151,7 +151,7 @@ module.exports = class Blog {
 
     try {
       const gemlogPath = resolve(join(__dirname, '../', '.gemlog'));
-      internals.debuglog(`Reading archive from ${gemlogPath}`);
+      internals.debuglog(`Copying archive from ${gemlogPath}`);
       await internals.exec(`rsync -r ${gemlogPath}/ ${host}`);
     }
     catch (err) {
index a8d7f37217f988e6722f84cd0817247678810a4e..490f4e99d685fbe72847ddc0057bd515a43eee50 100644 (file)
@@ -12,7 +12,7 @@
 
     <script src="./js/blog.js"></script>
 
-    <link href="./css/style.css" rel="stylesheet">
+    <link href="/css/style.css" rel="stylesheet">
     <link href="./feed.xml" rel="alternate" hreflang="en" title="RSS feed">
 
     <script type="module" src="//www.unlimited.pizza/js/animation.js"></script>