Skip to content

Commit

Permalink
feat: try to rewrite link rel=me
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Jul 28, 2024
1 parent 2f2b4c8 commit 361fd9e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
5 changes: 4 additions & 1 deletion helm/webapp/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ metadata:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "etag: 9ffa673";
more_set_headers "etag: 2f2b4c8";
sub_filter_once off;
sub_filter_types *;
sub_filter 'https://activitypub.awakari.com@' 'https://activitypub.awakari.com@$arg_id';
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
Expand Down
3 changes: 2 additions & 1 deletion web/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const templateSrcPopular = (share, url) => `

const templateIntPopular = (id, data) => `
<div class="space-x-1 truncate">
<span>${data.hasOwnProperty("followers") ? data.followers : '?'}</span>
<span>${data.hasOwnProperty("followers") ? data.followers : '0'}</span>
<a href="sub-details.html?id=${id}" class="text-blue-500">${data.description}</a>
</div>
`
Expand Down Expand Up @@ -178,6 +178,7 @@ async function loadStatus() {
let count = 0;
Object
.entries(data.interestsMostFollowed)
.filter(e => e[1].hasOwnProperty("followers"))
.sort((a, b) => b[1].followers - a[1].followers)
.slice(0, 5)
.forEach(e => {
Expand Down
7 changes: 4 additions & 3 deletions web/sub-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
<script src="api/sources.js"></script>
<script src="api/status.js"></script>
<script src="attrs.js"></script>
<script src="api/subscriptions.js?v=bd49abb-1"></script>
<script src="api/subscriptions.js?v=2f2b4c8"></script>

<link rel="me" href="https://activitypub.awakari.com@"/>

</head>
<body class="bg-white dark:bg-gray-900 text-slate-700 dark:text-gray-300">
<a rel="me" id="me" class="hidden">Me</a>

<nav class="text-xl flex p-1 sm:p-4 text-slate-700 dark:text-slate-200">
<button onclick="window.location.assign('sub.html')" class="mr-1">
Expand Down Expand Up @@ -197,7 +198,7 @@
id="sub-new-success-btn-ap"
class="flex w-full justify-center text-center"
style="display: none">
<span class="pt-1 flex">
<span class="flex">
<svg width="16px" height="16px" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg">
<path d="M48.186 92.137c0-8.392 6.49-14.89 16.264-14.89s29.827-.225 29.827-.225-.306-6.99-.306-15.88c0-8.888 7.954-14.96 17.49-14.96 9.538 0 56.786.401 61.422.401 4.636 0 8.397 1.719 13.594 5.67 5.196 3.953 13.052 10.56 16.942 14.962 3.89 4.402 5.532 6.972 5.532 10.604 0 3.633 0 76.856-.06 85.34-.059 8.485-7.877 14.757-17.134 14.881-9.257.124-29.135.124-29.135.124s.466 6.275.466 15.15-8.106 15.811-17.317 16.056c-9.21.245-71.944-.49-80.884-.245-8.94.245-16.975-6.794-16.975-15.422s.274-93.175.274-101.566zm16.734 3.946l-1.152 92.853a3.96 3.96 0 0 0 3.958 4.012l73.913.22a3.865 3.865 0 0 0 3.91-3.978l-.218-8.892a1.988 1.988 0 0 0-2.046-1.953s-21.866.64-31.767.293c-9.902-.348-16.672-6.807-16.675-15.516-.003-8.709.003-69.142.003-69.142a1.989 1.989 0 0 0-2.007-1.993l-23.871.082a4.077 4.077 0 0 0-4.048 4.014zm106.508-35.258c-1.666-1.45-3.016-.84-3.016 1.372v17.255c0 1.106.894 2.007 1.997 2.013l20.868.101c2.204.011 2.641-1.156.976-2.606l-20.825-18.135zm-57.606.847a2.002 2.002 0 0 0-2.02 1.988l-.626 96.291a2.968 2.968 0 0 0 2.978 2.997l75.2-.186a2.054 2.054 0 0 0 2.044-2.012l1.268-62.421a1.951 1.951 0 0 0-1.96-2.004s-26.172.042-30.783.042c-4.611 0-7.535-2.222-7.535-6.482S152.3 63.92 152.3 63.92a2.033 2.033 0 0 0-2.015-2.018l-36.464-.23z"
fill-rule="evenodd" fill="currentColor"/>
Expand Down
1 change: 0 additions & 1 deletion web/sub-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ const templateDiscoveredSrc = (addr, type) => `

function loadSubDetailsById(id) {
document.getElementById("id").value = id;
document.getElementById("me").href = `https://activitypub.awakari.com/@${id}`;
document.getElementById("button-delete").style.display = "flex";
document.getElementById("sub-discovered-sources").style.display = "block";
document.getElementById("area-follow").style.display = "flex";
Expand Down
2 changes: 1 addition & 1 deletion web/sub.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<script src="api/subscriptions.js"></script>
<script src="api/usage.js"></script>
<script src="api/limits.js"></script>
<script src="sub.js?v=9ffa673"></script>
<script src="sub.js?v=2f2b4c8"></script>
<script>
navigator.serviceWorker.register("sw.js");
</script>
Expand Down

0 comments on commit 361fd9e

Please sign in to comment.