Browse Source

🌊😅 Updated with Glitch

master
Glitch (steady-sundial) 1 year ago
parent
commit
ee03b706e0
11 changed files with 297 additions and 245 deletions
  1. +1
    -6
      .sqlite_history
  2. +2
    -1
      lib/models/site.js
  3. +1
    -1
      package.json
  4. +62
    -3
      public/style.css
  5. +44
    -7
      server.js
  6. +116
    -182
      shrinkwrap.yaml
  7. +51
    -30
      views/dashboard.hbs
  8. +8
    -0
      views/directory.hbs
  9. +2
    -15
      views/layouts/main.hbs
  10. +7
    -0
      views/partials/profile.hbs
  11. +3
    -0
      views/profile.hbs

+ 1
- 6
.sqlite_history View File

@@ -1,6 +1 @@
select * from Sites where url like '%tantek.com%';
select * from Sites where url like '%tantek.com%';
select * from Sites where slug like '%❕?%';
select * from Sites where slug like '%â%';
select * from Sites where slug like '%â%';
select * from Sites where url like '%tantek.com%';
select * from Sites where url like '%index.html';

+ 2
- 1
lib/models/site.js View File

@@ -49,7 +49,8 @@ module.exports = function(db) {
const saveProfile = (site, profile) => {
return new Promise((fulfill, reject) => {
db.run(`UPDATE Sites SET PROFILE = ? WHERE SLUG = ?;`, JSON.stringify(profile), site.slug);
let profileStr = (profile === null) ? null : JSON.stringify(profile);
db.run(`UPDATE Sites SET PROFILE = ? WHERE SLUG = ?;`, profileStr, site.slug);
fulfill();
});
};

+ 1
- 1
package.json View File

@@ -12,7 +12,7 @@
"express": "^4.16.4",
"express-handlebars": "^3.0.0",
"hash-emoji-without-borders": "git+https://github.com/martymcguire/hash-emoji-without-borders#master",
"indieauth-authentication": "^0.0.3",
"indieauth-authentication": "^0.0.4",
"microformat-node": "^2.0.1",
"request": "^2.88.0",
"sqlite3": "^4.0.4"

+ 62
- 3
public/style.css View File

@@ -29,7 +29,7 @@ form {
background-color: cyan;
display: inline-block;
width: 100%;
max-width: 340px;
max-width: 50ch;
border-radius: 3px;
}

@@ -70,9 +70,68 @@ footer {
border-top: 1px solid lightgrey;
}

.status {
border: 1px solid lightgrey;
margin: 0 0 1em 0;
max-width: 72ch;
padding: 1em;
}
.status.active {
border-color: green;
background-color: honeydew;
}
.status.active::before {
content: '✔️';
color: green;
}
.status.active::after {
content: '😀';
}
.status.inactive {
border-color: red;
background-color: lavenderblush;
}
.status.inactive::before {
content: '⛔';
}
.status.inactive::after {
content: '😢';
}
.dashboard-urls summary {
font-weight: bold;
}
.dashboard-urls p {
font-style: italic;
}

.profile {
display: grid;
display: flex;
flex-direction: column;
}
.profile > * {
margin-top: 1em;
}
.profile > *:first-child {
margin-top: 0;
}
.profile > a {
text-decoration: none;
}
.profile > img {
max-width: 100%;
width: 100%;
}
.profile .slug {
font-size: 2em;
margin-top: auto;
text-align: center;
}

.directory {
display: grid;
grid-gap: 1rem;
grid-template-columns: repeat( auto-fit, minmax(25ch, 1fr) );
}
.directory .profile {
background-color: cyan;
padding: 1rem;
}

+ 44
- 7
server.js View File

@@ -66,9 +66,15 @@ function requireLogin(request, response, next) {
// http://expressjs.com/en/starter/static-files.html
app.use(express.static('public'));

function profileFromHCard(card) {
let profile = {};
if ( ! 'properties' in card ) {
function profileFromHCard(site, card) {
const u = new URL(site.url);
let profile = {
cute_url: u.hostname.replace(/^www./,'') + u.pathname.replace(/\/(index.html)?$/,''),
slug: site.slug,
slug_encoded: encodeURIComponent(site.slug),
url: site.url, // don't necessarily trust the URL in the h-card.
};
if ( ! ('properties' in card) ) {
return profile;
}
["name","note","photo"].forEach((prop) => {
@@ -94,10 +100,9 @@ app.get('/dashboard', requireLogin, function(request, response) {
return row;
});
if(site.profile) {
site.profile = profileFromHCard(JSON.parse(site.profile));
site.profile = profileFromHCard(site, JSON.parse(site.profile));
}
const u = new URL(site.url);
site.cute = u.hostname + u.pathname.replace(/\/$/,'')
site.slug_encoded = encodeURIComponent(site.slug);
response.locals.context['site'] = site;
response.locals.context['hostname'] = process.env.MAIN_URL;
response.locals.context['checks'] = rows;
@@ -110,6 +115,21 @@ app.get('/dashboard', requireLogin, function(request, response) {
});
});

app.get('/directory', function(request, response) {
return new Promise((fulfill, reject) => {
db.all('SELECT * FROM Sites WHERE active=1 AND profile IS NOT NULL ORDER BY timestamp DESC', function(err, rows){
let profiles = Array.prototype.map.call(rows, row => {
return profileFromHCard(row, JSON.parse(row.profile));
});
fulfill(profiles);
});
})
.then((profiles) => {
response.locals.context['profiles'] = profiles;
response.render('directory', response.locals.context);
});
});

app.post('/check-profile', requireLogin, function(request, response) {
getSite(request.session.user.me)
.then((site) => {
@@ -120,6 +140,14 @@ app.post('/check-profile', requireLogin, function(request, response) {
}
})
})
.then(() => { setTimeout(() => { response.redirect('/dashboard'); }, 500); });
});

app.post('/remove-profile', requireLogin, function(request, response) {
getSite(request.session.user.me)
.then((site) => {
return saveProfile(site, null);
})
.then(() => { response.redirect('/dashboard'); });
});

@@ -162,7 +190,16 @@ app.get('/:slug/previous', function(request, response) {

app.get('/:slug', function(request, response) {
getSiteBySlug(request.params.slug)
.then((site) => { response.redirect(site['url']); })
.then((site) => {
if(site.profile) {
let profile = profileFromHCard(site, JSON.parse(site.profile));
profile.standalone = true;
response.locals.context['profile'] = profile;
response.render('profile', response.locals.context);
} else {
response.redirect(site['url']);
}
})
.catch(() => { response.redirect('/'); });
});


+ 116
- 182
shrinkwrap.yaml View File

@@ -4,15 +4,15 @@ dependencies:
express: 4.16.4
express-handlebars: 3.0.0
hash-emoji-without-borders: github.com/martymcguire/hash-emoji-without-borders/888e7cf7030e39ef1032ef85dca16730cd7b8c4f
indieauth-authentication: 0.0.3
indieauth-authentication: 0.0.4
microformat-node: 2.0.1
request: 2.88.0
sqlite3: 4.0.4
packages:
/abab/1.0.4:
/abab/2.0.0:
dev: false
resolution:
integrity: sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=
integrity: sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==
/abbrev/1.1.1:
dev: false
resolution:
@@ -26,28 +26,33 @@ packages:
node: '>= 0.6'
resolution:
integrity: sha1-63d99gEXI6OxTopywIBcjoZ0a9I=
/acorn-globals/4.1.0:
/acorn-globals/4.3.0:
dependencies:
acorn: 5.7.1
acorn: 6.0.5
acorn-walk: 6.1.1
dev: false
resolution:
integrity: sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==
/acorn/5.7.1:
integrity: sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==
/acorn-walk/6.1.1:
dev: false
engines:
node: '>=0.4.0'
resolution:
integrity: sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==
/acorn/5.7.3:
dev: false
engines:
node: '>=0.4.0'
hasBin: true
resolution:
integrity: sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==
/ajv/5.5.2:
dependencies:
co: 4.6.0
fast-deep-equal: 1.1.0
fast-json-stable-stringify: 2.0.0
json-schema-traverse: 0.3.1
integrity: sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==
/acorn/6.0.5:
dev: false
engines:
node: '>=0.4.0'
hasBin: true
resolution:
integrity: sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=
integrity: sha512-i33Zgp3XWtmZBMNvCr4azvOFeWVw1Rk6p3hfi3LUDvIFraOMywb1kAtrbi+med14m4Xfpqm3zRZMT+c0FNE7kg==
/ajv/6.6.2:
dependencies:
fast-deep-equal: 2.0.1
@@ -137,10 +142,6 @@ packages:
dev: false
resolution:
integrity: sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=
/aws4/1.7.0:
dev: false
resolution:
integrity: sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==
/aws4/1.8.0:
dev: false
resolution:
@@ -187,10 +188,10 @@ packages:
dev: false
resolution:
integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
/browser-process-hrtime/0.1.2:
/browser-process-hrtime/0.1.3:
dev: false
resolution:
integrity: sha1-Ql1opY00R/AqBKqJQYf86K+Le44=
integrity: sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==
/bytes/3.0.0:
dev: false
engines:
@@ -254,27 +255,12 @@ packages:
optional: true
resolution:
integrity: sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=
/co/4.6.0:
dev: false
engines:
iojs: '>= 1.0.0'
node: '>= 0.12.0'
resolution:
integrity: sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=
/code-point-at/1.1.0:
dev: false
engines:
node: '>=0.10.0'
resolution:
integrity: sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
/combined-stream/1.0.6:
dependencies:
delayed-stream: 1.0.0
dev: false
engines:
node: '>= 0.8'
resolution:
integrity: sha1-cj599ugBrFYTETp+RFqbactjKBg=
/combined-stream/1.0.7:
dependencies:
delayed-stream: 1.0.0
@@ -347,16 +333,16 @@ packages:
dev: false
resolution:
integrity: sha512-wan8dMWQ0GUeF7DGEPVjhHemVW/vy6xUYmFzRY8RYqgA0JtXC9rJmbScBjqSu6dg9q0lwPQy6ZAmJVr3PPTvqQ==
/cssom/0.3.3:
/cssom/0.3.4:
dev: false
resolution:
integrity: sha512-pjE/I/NSp3iyeoxXN5QaoJpgzYUMj2dJHx9OSufoTliJLDx+kuOQaMCJW8OwvrKJswhXUHnHN6eUmUSETN0msg==
/cssstyle/0.3.1:
integrity: sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==
/cssstyle/1.1.1:
dependencies:
cssom: 0.3.3
cssom: 0.3.4
dev: false
resolution:
integrity: sha512-tNvaxM5blOnxanyxI6panOsnfiyLRj3HV4qjqqS45WPNS1usdYWRUQjqTEEELK73lpeP/1KoIGYUwrBn/VcECA==
integrity: sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog==
/dashdash/1.14.1:
dependencies:
assert-plus: 1.0.0
@@ -365,14 +351,14 @@ packages:
node: '>=0.10'
resolution:
integrity: sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=
/data-urls/1.0.0:
/data-urls/1.1.0:
dependencies:
abab: 1.0.4
whatwg-mimetype: 2.1.0
whatwg-url: 6.5.0
abab: 2.0.0
whatwg-mimetype: 2.3.0
whatwg-url: 7.0.0
dev: false
resolution:
integrity: sha512-ai40PPQR0Fn1lD2PPie79CibnlMN2AYiDhwFX/rZHVsxbs5kNJSjegqXIprhouGXlRdEnfybva7kqRGnB6mypA==
integrity: sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==
/debug/2.6.9:
dependencies:
ms: 2.0.0
@@ -492,7 +478,7 @@ packages:
integrity: sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=
/encoding/0.1.12:
dependencies:
iconv-lite: 0.4.23
iconv-lite: 0.4.24
dev: false
resolution:
integrity: sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=
@@ -508,7 +494,7 @@ packages:
dev: false
resolution:
integrity: sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
/escodegen/1.10.0:
/escodegen/1.11.0:
dependencies:
esprima: 3.1.3
estraverse: 4.2.0
@@ -521,7 +507,7 @@ packages:
optionalDependencies:
source-map: 0.6.1
resolution:
integrity: sha512-fjUOf8johsv23WuIKdNQU4P9t9jhQ4Qzx6pC2uW890OloK3Zs1ZAoCNpg/2larNF501jLl3UNy0kIRcF6VI22g==
integrity: sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==
/esprima/3.1.3:
dev: false
engines:
@@ -596,10 +582,6 @@ packages:
node: '>= 0.10.0'
resolution:
integrity: sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==
/extend/3.0.1:
dev: false
resolution:
integrity: sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=
/extend/3.0.2:
dev: false
resolution:
@@ -616,10 +598,6 @@ packages:
'0': node >=0.6.0
resolution:
integrity: sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
/fast-deep-equal/1.1.0:
dev: false
resolution:
integrity: sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=
/fast-deep-equal/2.0.1:
dev: false
resolution:
@@ -654,16 +632,6 @@ packages:
dev: false
resolution:
integrity: sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
/form-data/2.3.2:
dependencies:
asynckit: 0.4.0
combined-stream: 1.0.6
mime-types: 2.1.18
dev: false
engines:
node: '>= 0.12'
resolution:
integrity: sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=
/form-data/2.3.3:
dependencies:
asynckit: 0.4.0
@@ -765,15 +733,6 @@ packages:
node: '>=4'
resolution:
integrity: sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=
/har-validator/5.0.3:
dependencies:
ajv: 5.5.2
har-schema: 2.0.0
dev: false
engines:
node: '>=4'
resolution:
integrity: sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=
/har-validator/5.1.3:
dependencies:
ajv: 6.6.2
@@ -795,7 +754,7 @@ packages:
integrity: sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=
/html-encoding-sniffer/1.0.2:
dependencies:
whatwg-encoding: 1.0.3
whatwg-encoding: 1.0.5
dev: false
resolution:
integrity: sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==
@@ -832,12 +791,6 @@ packages:
npm: '>=1.3.7'
resolution:
integrity: sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=
/iconv-lite/0.4.19:
dev: false
engines:
node: '>=0.10.0'
resolution:
integrity: sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==
/iconv-lite/0.4.23:
dependencies:
safer-buffer: 2.1.2
@@ -860,15 +813,15 @@ packages:
dev: false
resolution:
integrity: sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==
/indieauth-authentication/0.0.3:
/indieauth-authentication/0.0.4:
dependencies:
form-data: 2.3.2
form-data: 2.3.3
isomorphic-fetch: 2.2.1
jsdom: 11.11.0
qs: 6.5.2
jsdom: 11.12.0
qs: 6.6.0
dev: false
resolution:
integrity: sha512-PgpTSkWRzhOmjMQXKKlQSAd5t/Yosw4gO+CGWs/dfdDG6QpYu4w+PvJp7ORFc1UwA8NP97PLh/aSMvbb9XA4vA==
integrity: sha512-nQzefq6aC/s7TMFWMYgnaFDUsDbDAo6b/9rXjb6b+4IGBxn5rLZszzxMizNQro1DWqE4PUwmxNVoBwJrWI2X6A==
/inflight/1.0.6:
dependencies:
once: 1.4.0
@@ -884,6 +837,12 @@ packages:
dev: false
resolution:
integrity: sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
/ip-regex/3.0.0:
dev: false
engines:
node: '>=8'
resolution:
integrity: sha512-T8wDtjy+Qf2TAPDQmBp0eGKJ8GavlWlUnamr3wRn6vvdZlKVuJXXMlSncYFRYgVHOM3If5NR1H4+OvVQU9Idvg==
/ipaddr.js/1.8.0:
dev: false
engines:
@@ -926,7 +885,7 @@ packages:
/isomorphic-fetch/2.2.1:
dependencies:
node-fetch: 1.7.3
whatwg-fetch: 2.0.4
whatwg-fetch: 3.0.0
dev: false
resolution:
integrity: sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=
@@ -938,41 +897,37 @@ packages:
dev: false
resolution:
integrity: sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
/jsdom/11.11.0:
/jsdom/11.12.0:
dependencies:
abab: 1.0.4
acorn: 5.7.1
acorn-globals: 4.1.0
abab: 2.0.0
acorn: 5.7.3
acorn-globals: 4.3.0
array-equal: 1.0.0
cssom: 0.3.3
cssstyle: 0.3.1
data-urls: 1.0.0
cssom: 0.3.4
cssstyle: 1.1.1
data-urls: 1.1.0
domexception: 1.0.1
escodegen: 1.10.0
escodegen: 1.11.0
html-encoding-sniffer: 1.0.2
left-pad: 1.3.0
nwsapi: 2.0.4
nwsapi: 2.0.9
parse5: 4.0.0
pn: 1.1.0
request: 2.87.0
request-promise-native: /request-promise-native/1.0.5/request@2.87.0
request: 2.88.0
request-promise-native: /request-promise-native/1.0.5/request@2.88.0
sax: 1.2.4
symbol-tree: 3.2.2
tough-cookie: 2.4.3
tough-cookie: 2.5.0
w3c-hr-time: 1.0.1
webidl-conversions: 4.0.2
whatwg-encoding: 1.0.3
whatwg-mimetype: 2.1.0
whatwg-encoding: 1.0.5
whatwg-mimetype: 2.3.0
whatwg-url: 6.5.0
ws: 4.1.0
ws: 5.2.2
xml-name-validator: 3.0.0
dev: false
resolution:
integrity: sha512-ou1VyfjwsSuWkudGxb03FotDajxAto6USAlmMZjE2lc0jCznt7sBWkhfRBRaWwbnmDqdMSTKTLT5d9sBFkkM7A==
/json-schema-traverse/0.3.1:
dev: false
resolution:
integrity: sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=
integrity: sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==
/json-schema-traverse/0.4.1:
dev: false
resolution:
@@ -1083,10 +1038,10 @@ packages:
dev: false
resolution:
integrity: sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=
/lodash/4.17.10:
/lodash/4.17.11:
dev: false
resolution:
integrity: sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==
integrity: sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
/longest/1.0.1:
dev: false
engines:
@@ -1125,26 +1080,12 @@ packages:
dev: false
resolution:
integrity: sha1-A1DattosUX+PTO8asof+a+6uxyU=
/mime-db/1.33.0:
dev: false
engines:
node: '>= 0.6'
resolution:
integrity: sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==
/mime-db/1.37.0:
dev: false
engines:
node: '>= 0.6'
resolution:
integrity: sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==
/mime-types/2.1.18:
dependencies:
mime-db: 1.33.0
dev: false
engines:
node: '>= 0.6'
resolution:
integrity: sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==
/mime-types/2.1.21:
dependencies:
mime-db: 1.37.0
@@ -1284,14 +1225,10 @@ packages:
node: '>=0.10.0'
resolution:
integrity: sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
/nwsapi/2.0.4:
dev: false
resolution:
integrity: sha512-Zt6HRR6RcJkuj5/N9zeE7FN6YitRW//hK2wTOwX274IBphbY3Zf5+yn5mZ9v/SzAOTMjQNxZf9KkmPLWn0cV4g==
/oauth-sign/0.8.2:
/nwsapi/2.0.9:
dev: false
resolution:
integrity: sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=
integrity: sha512-nlWFSCTYQcHk/6A9FFnfhKc14c3aFhfdNBXgo8Qgi9QTBu/qg3Ww+Uiz9wMzXd1T8GFxPc2QIHB6Qtf2XFryFQ==
/oauth-sign/0.9.0:
dev: false
resolution:
@@ -1451,6 +1388,12 @@ packages:
node: '>=0.6'
resolution:
integrity: sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
/qs/6.6.0:
dev: false
engines:
node: '>=0.6'
resolution:
integrity: sha512-KIJqT9jQJDQx5h5uAVPimw6yVg2SekOKu959OCtktD3FjzbpvaPr8i4zzg07DOMz+igA4W/aNM7OV8H37pFYfA==
/range-parser/1.2.0:
dev: false
engines:
@@ -1507,10 +1450,10 @@ packages:
optional: true
resolution:
integrity: sha1-jcrkcOHIirwtYA//Sndihtp15jc=
/request-promise-core/1.1.1/request@2.87.0:
/request-promise-core/1.1.1/request@2.88.0:
dependencies:
lodash: 4.17.10
request: 2.87.0
lodash: 4.17.11
request: 2.88.0
dev: false
engines:
node: '>=0.10.0'
@@ -1519,12 +1462,12 @@ packages:
request: ^2.34
resolution:
integrity: sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=
/request-promise-native/1.0.5/request@2.87.0:
/request-promise-native/1.0.5/request@2.88.0:
dependencies:
request: 2.87.0
request-promise-core: /request-promise-core/1.1.1/request@2.87.0
request: 2.88.0
request-promise-core: /request-promise-core/1.1.1/request@2.88.0
stealthy-require: 1.1.1
tough-cookie: 2.4.3
tough-cookie: 3.0.0
dev: false
engines:
node: '>=0.12.0'
@@ -1533,33 +1476,6 @@ packages:
request: ^2.34
resolution:
integrity: sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=
/request/2.87.0:
dependencies:
aws-sign2: 0.7.0
aws4: 1.7.0
caseless: 0.12.0
combined-stream: 1.0.6
extend: 3.0.1
forever-agent: 0.6.1
form-data: 2.3.2
har-validator: 5.0.3
http-signature: 1.2.0
is-typedarray: 1.0.0
isstream: 0.1.2
json-stringify-safe: 5.0.1
mime-types: 2.1.18
oauth-sign: 0.8.2
performance-now: 2.1.0
qs: 6.5.2
safe-buffer: 5.1.2
tough-cookie: 2.3.4
tunnel-agent: 0.6.0
uuid: 3.3.2
dev: false
engines:
node: '>= 4'
resolution:
integrity: sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==
/request/2.88.0:
dependencies:
aws-sign2: 0.7.0
@@ -1800,23 +1716,34 @@ packages:
node: '>=4.5'
resolution:
integrity: sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==
/tough-cookie/2.3.4:
/tough-cookie/2.4.3:
dependencies:
psl: 1.1.31
punycode: 1.4.1
dev: false
engines:
node: '>=0.8'
resolution:
integrity: sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==
/tough-cookie/2.4.3:
integrity: sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==
/tough-cookie/2.5.0:
dependencies:
psl: 1.1.31
punycode: 1.4.1
punycode: 2.1.1
dev: false
engines:
node: '>=0.8'
resolution:
integrity: sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==
integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==
/tough-cookie/3.0.0:
dependencies:
ip-regex: 3.0.0
psl: 1.1.31
punycode: 2.1.1
dev: false
engines:
node: '>=6'
resolution:
integrity: sha512-LHMvg+RBP/mAVNqVbOX8t+iJ+tqhBA/t49DuI7+IDAWHrASnesqSu1vWbKB7UrE2yk+HMFUBMadRGMkB4VCfog==
/tr46/1.0.1:
dependencies:
punycode: 2.1.1
@@ -1913,7 +1840,7 @@ packages:
integrity: sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=
/w3c-hr-time/1.0.1:
dependencies:
browser-process-hrtime: 0.1.2
browser-process-hrtime: 0.1.3
dev: false
resolution:
integrity: sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=
@@ -1921,20 +1848,20 @@ packages:
dev: false
resolution:
integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==
/whatwg-encoding/1.0.3:
/whatwg-encoding/1.0.5:
dependencies:
iconv-lite: 0.4.19
iconv-lite: 0.4.24
dev: false
resolution:
integrity: sha512-jLBwwKUhi8WtBfsMQlL4bUUcT8sMkAtQinscJAe/M4KHCkHuUJAF6vuB0tueNIw4c8ziO6AkRmgY+jL3a0iiPw==
/whatwg-fetch/2.0.4:
integrity: sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==
/whatwg-fetch/3.0.0:
dev: false
resolution:
integrity: sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==
/whatwg-mimetype/2.1.0:
integrity: sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==
/whatwg-mimetype/2.3.0:
dev: false
resolution:
integrity: sha512-FKxhYLytBQiUKjkYteN71fAUA3g6KpNXoho1isLiLSB3N1G4F35Q5vUxWfKFhBwi5IWF27VE6WxhrnnC+m0Mew==
integrity: sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==
/whatwg-url/6.5.0:
dependencies:
lodash.sortby: 4.7.0
@@ -1943,6 +1870,14 @@ packages:
dev: false
resolution:
integrity: sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==
/whatwg-url/7.0.0:
dependencies:
lodash.sortby: 4.7.0
tr46: 1.0.1
webidl-conversions: 4.0.2
dev: false
resolution:
integrity: sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==
/wide-align/1.1.3:
dependencies:
string-width: 2.1.1
@@ -1977,13 +1912,12 @@ packages:
dev: false
resolution:
integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
/ws/4.1.0:
/ws/5.2.2:
dependencies:
async-limiter: 1.0.0
safe-buffer: 5.1.2
dev: false
resolution:
integrity: sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==
integrity: sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==
/xml-name-validator/3.0.0:
dev: false
resolution:
@@ -2018,7 +1952,7 @@ specifiers:
express: ^4.16.4
express-handlebars: ^3.0.0
hash-emoji-without-borders: 'git+https://github.com/martymcguire/hash-emoji-without-borders.git#master'
indieauth-authentication: ^0.0.3
indieauth-authentication: ^0.0.4
microformat-node: ^2.0.1
request: ^2.88.0
sqlite3: ^4.0.4

+ 51
- 30
views/dashboard.hbs View File

@@ -1,37 +1,58 @@
<h3>
<h2>
Hello, {{ site.url }} ({{ site.slug }})!
</h3>
</h2>

<form action="/check-profile" method="POST">
{{#if site.profile }}
<section class="profile">
{{#if site.profile.photo }}<img src="{{ site.profile.photo }}" />{{/if}}
<a href="{{ site.url }}">{{ site.cute }}</a>
{{#if site.profile.name }}<div class="name">{{ site.profile.name }}</div>{{/if}}
{{#if site.profile.note }}<div class="note">{{ site.profile.note }}</div>{{/if }}
</section>
{{/if}}
<input type="submit" value="Fetch updated profile."/>
</form>
<section>
<h2>Your Profile</h2>
<p>If you have one, your profile will be displayed on:</p>
<ul>
<li><a href="/directory">The webring directory</a></li>
<li><a href="/{{ site.slug_encoded }}">Your profile page ({{ site.slug }})</a></li>
</ul>

<div>
Your site is currently: {{#unless site.active }}NOT {{/unless}} ACTIVE.
</div>
<div class="directory" style="grid-template-columns: minmax(25ch, 50ch);">
{{#if site.profile }}
{{> profile site.profile }}
<form action="/remove-profile" method="POST" style="display: block; margin-bottom: 0">
<input type="submit" value="🗑 Remove my profile."/>
<small style="display: block; font-style: italic; padding: 0 1em;">
You'll still be in the webring, but will not appear in the directory.
Your profile page will redirect directly to your site.
</small>
</form>
{{ else }}
<div class="profile">You currently have no profile information.</div>
{{/if}}
</div>
<form action="/check-profile" method="POST">
<input type="submit" value="🔃 Check for updated profile."/>
<small style="display: block; font-style: italic; padding: 0 1em;">
We'll look for your name, photo, and note on the <a href="http://microformats.org/wiki/representative-h-card-authoring">representative h-card</a>
on your page. If you're having trouble, you can <a href="https://indiewebify.me/validate-h-card/?url={{ site.url }}">test your page with indiewebify.me</a>.
</small>
</form>
</section>

<div>
To stay active, make sure links like these are visible on your site:
</div>
<section>
<h2>Your Site's Status</h2>
<div class="status {{#if site.active}}active{{else}}inactive{{/if}}">
Your site is currently: {{#unless site.active }}NOT {{/unless}} ACTIVE
</div>

<div>
<textarea rows="6" cols="60">
<a href="https://{{ hostname }}/{{ site.slug }}/previous">←</a>
An IndieWeb Webring 🕸💍
<a href="https://{{ hostname }}/{{ site.slug }}/next">→</a>
</textarea>
</div>
<p>
To stay active, make sure links like these are visible on your site:
</p>

<form action="/check-links" method="POST">
<input type="submit" value="Check links now!"/>
</form>
<div>
<textarea rows="6" cols="60" id="urls-compatible">
<a href="https://{{ hostname }}/{{ site.slug_encoded }}/previous">&larr;</a>
An IndieWeb Webring 🕸💍
<a href="https://{{ hostname }}/{{ site.slug_encoded }}/next">&rarr;</a></textarea>
</div>

{{#if checks }}{{> checks }}{{/if}}
<form action="/check-links" method="POST" style="margin-top: 1em">
<input type="submit" value="Check links now!"/>
</form>

{{#if checks }}{{> checks }}{{/if}}
</section>

+ 8
- 0
views/directory.hbs View File

@@ -0,0 +1,8 @@
<h2>
A Directory of Active Sites with Profiles
</h2>
<div class="directory">
{{#each profiles }}
{{> profile . }}
{{/each }}
</div>

+ 2
- 15
views/layouts/main.hbs View File

@@ -1,12 +1,3 @@
<!-- This is a static file -->
<!-- served from your routes in server.js -->

<!-- You might want to try something fancier: -->
<!-- html/nunjucks docs: https://mozilla.github.io/nunjucks/ -->
<!-- pug: https://pugjs.org/ -->
<!-- haml: http://haml.info/ -->
<!-- hbs(handlebars): http://handlebarsjs.com/ -->

<!DOCTYPE html>
<html lang="en">
<head>
@@ -22,12 +13,8 @@
</head>
<body>
<header>
<h1>
An <img style="height: 3em; margin-bottom: -1em" src="/images/indiewebcamp-logo-lockup-color.svg" alt="IndieWebCamp logo" /> Web Ring
</h1>
<h2>
Or: if you like it then you should put it on a 🕸💍
</h2>
<div style="display: flex; flex-wrap: wrap; font-size: 3em"><img style="height: 1.3em; margin-top: -0.1em" src="/images/indiewebcamp-logo-lockup-color.svg" alt="IndieWebCamp logo" />🕸💍 –&nbsp; <h1 style="font-size: 1em; margin: 0;">An IndieWeb Webring</h1></div>
<small>Or: if you like it then you should put it on a 🕸💍</small>
</header>

<main>

+ 7
- 0
views/partials/profile.hbs View File

@@ -0,0 +1,7 @@
<section class="profile h-card">
{{#if photo }}<img src="{{ photo }}" />{{/if}}
<a class="u-url" {{#if standalone}}rel="me" {{/if}}href="{{ url }}">{{ cute_url }}</a>
{{#if name }}<div class="name p-name">{{ name }}</div>{{/if}}
{{#if note }}<div class="note p-note">{{ note }}</div>{{/if }}
<a class="slug p-webring-id" href="/{{ slug_encoded }}">{{ slug }}</a>
</section>

+ 3
- 0
views/profile.hbs View File

@@ -0,0 +1,3 @@
<div style="background-color: cyan; max-width: 60ch; padding: 1rem">
{{> profile profile }}
</div>

Loading…
Cancel
Save