Compare commits

...

2 Commits

Author SHA1 Message Date
d0ff1b0e1c Merge pull request 'revert 963e0366d6ea22f3078500b3a569a4d0e5a5345f' (#2) from neurobomber-patch-1 into main
Reviewed-on: #2
2024-09-23 20:39:54 -04:00
3ac1cd4313 revert 963e0366d6
revert first commit
2024-09-23 20:27:35 -04:00
16 changed files with 1 additions and 135 deletions

View File

@ -1,6 +0,0 @@
DBPASS=rittenhop
EMAIL=example@rittenhop.org
TZ=America/New_York
SITE=rittenhop.org
PORT=2368

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
.env
db/
./db
content/logs/
config.*.json

View File

@ -1,31 +0,0 @@
{
"url": "http://localhost:2368",
"server": {
"port": 2368,
"host": "::"
},
"mail": {
"transport": "SMTP",
"options": {
"service": "Mailgun",
"host": "smtp.mailgun.org",
"port": 587,
"secure": false,
"auth": {
"user": "",
"pass": ""
}
}
},
"logging": {
"transports": [
"file",
"stdout"
]
},
"process": "systemd",
"paths": {
"contentPath": "/var/lib/ghost/content"
}
}

View File

@ -1,30 +0,0 @@
{
"url": "http://localhost:2368",
"server": {
"port": 2368,
"host": "::"
},
"mail": {
"transport": "SMTP",
"options": {
"service": "Mailgun",
"host": "smtp.mailgun.org",
"port": 587,
"secure": false,
"auth": {
"user": "",
"pass": ""
}
}
},
"logging": {
"transports": [
"file",
"stdout"
]
},
"process": "systemd",
"paths": {
"contentPath": "/var/lib/ghost/content"
}
}

View File

@ -1 +0,0 @@
const adminUrl=window.location.href.replace("auth-frame/","")+"api/admin",siteOrigin="https://rittenhop.brodin.rocks";window.addEventListener("message",(async function(t){if(t.origin!==siteOrigin)return void console.warn("Ignored message to admin auth iframe because of mismatch in origin","expected",siteOrigin,"got",t.origin,"with data",t.data);let i=null;try{i=JSON.parse(t.data)}catch(t){console.error(t)}function n(n,e){t.source.postMessage(JSON.stringify({uid:i.uid,error:n,result:e}),siteOrigin)}if("getUser"===i.action)try{const t=await fetch(adminUrl+"/users/me/");n(null,await t.json())}catch(t){n(t,null)}if("hideComment"===i.action)try{const t=await fetch(adminUrl+"/comments/"+i.id+"/",{method:"PUT",body:JSON.stringify({comments:[{id:i.id,status:"hidden"}]}),headers:{"Content-Type":"application/json"}});n(null,await t.json())}catch(t){n(t,null)}if("showComment"===i.action)try{const t=await fetch(adminUrl+"/comments/"+i.id+"/",{method:"PUT",body:JSON.stringify({comments:[{id:i.id,status:"published"}]}),headers:{"Content-Type":"application/json"}});n(null,await t.json())}catch(t){n(t,null)}}));

View File

@ -1,6 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<script src="admin-auth.min.js"></script>
</head>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
!async function(){const t={},e=new Set,o=document.querySelector("[data-ghost-comments-counts-api]").dataset.ghostCommentsCountsApi,n=function(o){(o.querySelectorAll?.("[data-ghost-comment-count]")||[]).forEach((o=>{t[o.dataset.ghostCommentCount]||e.add(o.dataset.ghostCommentCount)}))},a=async function(){const n=Array.from(e);if(e.clear(),!n.length)return;const a=await fetch(`${o}?ids=${n.join(",")}`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(200!==a.status)return;const s=await a.json();for(const[e,o]of Object.entries(s))t[e]=o;!function(){for(const[e,o]of Object.entries(t))document.querySelectorAll(`[data-ghost-comment-count="${e}"]`).forEach((t=>{let e=t.dataset.ghostCommentCountEmpty;if(1===o&&(e=t.dataset.ghostCommentCountSingular?`${o} ${t.dataset.ghostCommentCountSingular}`:o),o>1&&(e=t.dataset.ghostCommentCountPlural?`${o} ${t.dataset.ghostCommentCountPlural}`:o),e)if("false"!==t.dataset.ghostCommentCountAutowrap){const o=document.createElement(t.dataset.ghostCommentCountTag);t.dataset.ghostCommentCountClassName&&o.classList.add(t.dataset.ghostCommentCountClassName),o.textContent=e,t.insertAdjacentElement("afterend",o)}else t.insertAdjacentText("afterend",e);t.remove()}))}()};new MutationObserver((t=>{t.forEach((t=>{t.addedNodes.forEach((t=>{n(t),function(t,e=100){let o}()}))}))})).observe(document.body,{subtree:!0,childList:!0}),n(document.body),a()}();

View File

@ -1 +0,0 @@
const STORAGE_KEY="ghost-history",TIMEOUT=864e5,LIMIT=15;!async function(){try{const e=window.localStorage,r=e.getItem(STORAGE_KEY),t=(new Date).getTime();let i=[];if(r)try{i=JSON.parse(r)}catch(e){console.warn("[Member Attribution] Error while parsing history",e)}const a=i.findIndex((e=>{if(!e.time||"number"!=typeof e.time)return!1;const r=t-e.time;return!(isNaN(e.time)||r>TIMEOUT)}));let n,o,s,c,h;a>0?i.splice(0,a):-1===a&&(i=[]);try{const e=new URL(window.location.href);if(n=e.searchParams.get("ref"),o=e.searchParams.get("source"),s=e.searchParams.get("utm_source"),c=e.searchParams.get("utm_medium"),h=n||o||s||null,!h&&e.hash&&e.hash.includes("#/portal")){const e=new URL(window.location.href.replace("/#/portal",""));n=e.searchParams.get("ref"),o=e.searchParams.get("source"),s=e.searchParams.get("utm_source"),c=e.searchParams.get("utm_medium"),h=n||o||s||null}}catch(e){console.error("[Member Attribution] Parsing referrer from querystring failed",e)}const l=c||null,u=window.document.referrer||null;try{const e=new URL(window.location.href),r=e.searchParams;r.get("attribution_id")&&r.get("attribution_type")&&(i.push({time:t,id:r.get("attribution_id"),type:r.get("attribution_type"),referrerSource:h,referrerMedium:l,referrerUrl:u}),r.delete("attribution_id"),r.delete("attribution_type"),e.search="?"+r.toString(),window.history.replaceState({},"",`${e.pathname}${e.search}${e.hash}`))}catch(e){console.error("[Member Attribution] Parsing attribution from querystring failed",e)}const m=window.location.pathname;0===i.length||i[i.length-1].path!==m?i.push({path:m,time:t,referrerSource:h,referrerMedium:l,referrerUrl:u}):i.length>0&&(i[i.length-1].time=t,h&&(i[i.length-1].referrerSource=h,i[i.length-1].referrerMedium=l),u&&(i[i.length-1].referrerUrl=u)),i.length>15&&(i=i.slice(-15)),e.setItem(STORAGE_KEY,JSON.stringify(i))}catch(e){console.error("[Member Attribution] Failed with error",e)}}();

View File

@ -1,10 +0,0 @@
routes:
collections:
/:
permalink: /{slug}/
template: index
taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/

View File

@ -1 +0,0 @@
/var/lib/ghost/current/content/themes/casper

View File

@ -1 +0,0 @@
/var/lib/ghost/current/content/themes/source

View File

@ -1,41 +0,0 @@
services:
ghost:
image: ghost:5
container_name: rittenhop-ghost
restart: always
ports:
- ${PORT}:2368
expose:
- ${PORT}
environment:
# see https://ghost.org/docs/config/#configuration-options
database__client: mysql
database__connection__host: rittenhop-db
database__connection__user: root
database__connection__password: ${DBPASS}
database__connection__database: rittenhop
VIRTUAL_HOST: "${SITE}"
VIRTUAL_PORT: ${PORT}
LETSENCRYPT_HOST: "${SITE}"
LETSENCRYPT_EMAIL: ${EMAIL}
# url: http://0.0.0.0:${PORT} #Dev
url: "https://${SITE}" #Prod
# contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
# NODE_ENV: development
volumes:
- ./content:/var/lib/ghost/content
# - ./themes:/var/lib/ghost/current/content/themes:rw
db:
image: mysql:8.0
container_name: rittenhop-db
restart: always
environment:
MYSQL_DATABASE: rittenhop
MYSQL_ROOT_PASSWORD: ${DBPASS}
volumes:
- ./db:/var/lib/mysql
networks:
default:
name: nginx-proxy
external: true

View File

@ -1,2 +0,0 @@
sudo docker cp config.development.json rittenhop-ghost:/var/lib/ghost/.
sudo docker cp config.production.json rittenhop-ghost:/var/lib/ghost/.