shopping list init

main
Mel 3 years ago
parent b6f33bcddf
commit fd7225123b

@ -16,12 +16,11 @@
"obsidian-dice-roller", "obsidian-dice-roller",
"obsidian-pocket", "obsidian-pocket",
"note-refactor-obsidian", "note-refactor-obsidian",
"code-block-copy",
"meld-encrypt", "meld-encrypt",
"find-and-replace-in-selection", "find-and-replace-in-selection",
"obsidian-auto-link-title", "obsidian-auto-link-title",
"obsidian-itinerary", "obsidian-itinerary",
"file-tree-alternative",
"customjs", "customjs",
"obsidian42-brat" "obsidian42-brat",
"code-block-copy"
] ]

@ -1,22 +0,0 @@
{
"ribbonIcon": true,
"showRootFolder": true,
"showFilesFromSubFolders": true,
"searchFunction": true,
"showFilesFromSubFoldersButton": true,
"excludedExtensions": "",
"excludedFolders": "",
"folderIcon": "default",
"folderCount": true,
"folderCountOption": "notes",
"evernoteView": true,
"filePreviewOnHover": false,
"sortFilesBy": "name",
"fixedHeaderInFileList": false,
"openFolders": [
"/"
],
"pinnedFiles": [],
"customHeight": 0,
"activeFolderPath": "02.01 London"
}

File diff suppressed because one or more lines are too long

@ -1,10 +0,0 @@
{
"id": "file-tree-alternative",
"name": "File Tree Alternative Plugin",
"version": "1.5.7",
"minAppVersion": "0.9.12",
"description": "This plugin allows you to have an alternative file tree view.",
"author": "Ozan Tellioglu",
"authorUrl": "https://www.ozan.pl",
"isDesktopOnly": false
}

@ -1,235 +0,0 @@
.oz-file-tree-header {
height: 22px;
color: var(--text-normal);
font-size: 15px;
font-weight: bold;
text-align: center;
}
.oz-nav-action-button {
color: var(--text-normal);
display: inline-block;
padding: 3px 0px 0 3px !important;
}
.oz-input-container {
margin-bottom: 3px !important;
margin-top: 3px !important;
height: 30px;
}
.oz-nav-buttons-right-block {
text-align: right;
}
.oz-nav-file-title {
padding-left: 2px !important;
padding-right: 2px !important;
}
div.workspace-leaf-content[data-type='file-tree-view'] > div.view-content {
padding: 10px 5px 5px 5px;
}
.oz-flex-container {
display: flex;
flex-direction: row;
justify-content: space-between;
height: 26px;
}
.is-mobile .oz-flex-container {
height: 31px;
}
.oz-explorer-container {
padding-left: 3px !important;
padding-right: 3px !important;
}
.oz-file-tree-files {
padding-top: 3px !important;
}
.drag-entered,
.oz-folder-element:hover,
.oz-nav-file:hover {
background-color: var(--text-selection);
}
.oz-folder-contents {
will-change: transform, opacity, height;
margin-left: 6;
padding: 4px 0px 0px 14px;
border-left: 1px dashed;
border-left-color: var(--text-muted);
font-size: 12.8px;
}
.oz-folder-toggle {
width: 1em;
height: 1em;
margin-right: 10px;
cursor: pointer;
vertical-align: middle;
}
.treeview {
position: relative;
padding: 4px 0px 0px 0px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
vertical-align: middle;
}
.oz-folder-type {
text-transform: uppercase;
font-family: monospace;
font-size: 0.6em;
vertical-align: middle;
display: inline-block;
}
.oz-folder-name {
vertical-align: middle;
display: inline-block;
color: var(--text-normal);
font-size: 13px;
}
div.oz-folder-name.is-root-folder {
font-size: 16px;
}
.is-mobile .oz-folder-name.is-root-folder {
font-size: 18px;
}
.is-mobile .oz-folder-name {
font-size: 15.5px;
}
.is-mobile div.oz-nav-file-title .nav-file-title-content {
font-size: 15px;
}
.oz-icon-div {
display: inline-block;
}
.oz-folder-block {
display: inline-block;
width: 100%;
}
.oz-folder-count.no-root {
float: right;
padding-right: 25px;
}
.oz-folder-count.with-root {
float: right;
padding-right: 32px;
}
.oz-folders-tree-wrapper {
overflow: hidden;
overflow-y: auto;
padding-bottom: 5px;
padding-left: 8px;
height: 100%;
}
.oz-folder-element {
line-height: 1.35em;
padding: 0px 0px 0px 0px;
}
.oz-input-container > input {
padding-left: 8px;
padding-right: 4px;
}
.oz-nav-action-button:hover {
color: var(--interactive-accent);
}
.oz-nav-action-button .fa-lg {
font-size: 1.15em;
}
.file-tree-container {
display: flex;
flex-direction: column;
height: 100%;
max-height: 100%;
}
.file-tree-plugin-view {
height: 100%;
}
.oz-folder-pane {
display: block;
width: 100%;
overflow-y: auto;
height: 50%;
resize: vertical;
}
.oz-file-list-pane {
display: block;
width: 100%;
overflow-y: auto;
flex: 1;
}
.oz-coffee-div {
text-align: center;
margin-top: 20px;
}
#file-tree-divider {
height: 2.5px;
background-color: var(--text-muted);
cursor: row-resize;
}
.is-folder-active {
color: var(--text-accent);
font-weight: bold;
}
.file-tree-header-fixed {
position: fixed;
width: 100%;
left: 0;
padding-left: 4px;
padding-right: 4px;
background-color: var(--background-secondary);
}
.file-tree-files-fixed {
padding-top: 50px !important;
display: flex;
flex-direction: column;
}
.is-mobile .file-tree-files-fixed {
padding-top: 55px !important;
}
.file-tree-files-fixed-with-search {
padding-top: 80px !important;
display: flex;
flex-direction: column;
}
.is-mobile .file-tree-files-fixed-with-search {
padding-top: 85px !important;
}
svg.oz-folder-toggle path {
fill: var(--interactive-accent);
}

File diff suppressed because one or more lines are too long

@ -1,7 +1,7 @@
{ {
"id": "meld-encrypt", "id": "meld-encrypt",
"name": "Meld Encrypt", "name": "Meld Encrypt",
"version": "1.4.2", "version": "1.5.1",
"minAppVersion": "0.12.15", "minAppVersion": "0.12.15",
"description": "Hide secrets in your notes", "description": "Hide secrets in your notes",
"author": "meld-cp", "author": "meld-cp",

@ -1 +1,38 @@
Not Found .meld-e-row{
display: flex;
margin-bottom: 1em;
}
.meld-e-icon{
flex: 1;
display: inline-block;
margin-right: 1em;
}
.meld-e-row input{
flex: 20;
}
.meld-e-platform-desktop .meld-e-button-confirm {
margin-left: 2.8em;
padding: 1em 2em;
}
.meld-e-platform-desktop .meld-e-button-confirm:focus{
font-weight: bold;
}
.meld-e-message{
margin-left: 2.8em;
margin-bottom: 1em;
}
.meld-e-button-next{
margin-left: 1em;
flex: 3;
}
.meld-e-platform-mobile .meld-e-button-next{
display: inline-block;
margin: 0 0 0 1em;
width: auto;
}

@ -92,8 +92,8 @@
} }
}, },
"syntaxHighlight": false, "syntaxHighlight": false,
"copyButton": false, "copyButton": true,
"version": "6.3.5", "version": "6.4.1",
"autoCollapse": false, "autoCollapse": false,
"defaultCollapseType": "open", "defaultCollapseType": "open",
"syncLinks": true, "syncLinks": true,

File diff suppressed because one or more lines are too long

@ -1,7 +1,7 @@
{ {
"id": "obsidian-admonition", "id": "obsidian-admonition",
"name": "Admonition", "name": "Admonition",
"version": "6.3.5", "version": "6.4.1",
"minAppVersion": "0.11.0", "minAppVersion": "0.11.0",
"description": "Admonition block-styled content for Obsidian.md", "description": "Admonition block-styled content for Obsidian.md",
"author": "Jeremy Valentine", "author": "Jeremy Valentine",

@ -36,6 +36,7 @@
justify-content: center; justify-content: center;
margin: 0 0.5em 0 0.25em; margin: 0 0.5em 0 0.25em;
min-width: 1em; min-width: 1em;
width: min-content;
} }
.admonition-title-markdown { .admonition-title-markdown {
@ -259,3 +260,4 @@ input.is-invalid {
box-shadow: 0px 0px 5px rgb(0 0 0 / 50%); box-shadow: 0px 0px 5px rgb(0 0 0 / 50%);
border-color: var(--background-modifier-border-focus); border-color: var(--background-modifier-border-focus);
} }

@ -7,11 +7,8 @@
"id": "c1cbd199334b4022", "id": "c1cbd199334b4022",
"type": "leaf", "type": "leaf",
"state": { "state": {
"type": "markdown", "type": "empty",
"state": { "state": {}
"file": "00.01 Admin/Templates/NewFile1.md",
"mode": "source"
}
} }
} }
], ],
@ -54,14 +51,6 @@
"useHierarchy": true "useHierarchy": true
} }
} }
},
{
"id": "dc65fd5a9b9d6216",
"type": "leaf",
"state": {
"type": "file-tree-view",
"state": {}
}
} }
], ],
"currentTab": 0 "currentTab": 0
@ -76,7 +65,6 @@
"state": { "state": {
"type": "backlink", "type": "backlink",
"state": { "state": {
"file": "00.01 Admin/Templates/NewFile1.md",
"collapseAll": false, "collapseAll": false,
"extraContext": false, "extraContext": false,
"sortOrder": "alphabetical", "sortOrder": "alphabetical",
@ -115,15 +103,15 @@
}, },
"active": "c1cbd199334b4022", "active": "c1cbd199334b4022",
"lastOpenFiles": [ "lastOpenFiles": [
"00.01 Admin/Templates/NewFile1.md", "03.02 Travels/Turkey.md",
"01.01 Life Orga/@Life Organisation.md", "05.02 Networks/VPS Console Dialogue.md",
"01.02 Home/MRCK.md", "05.02 Networks/Server VPN.md",
"02.01 London/@@London.md", "05.02 Networks/Server Tools.md",
"02.02 Paris/@@Paris.md", "05.02 Networks/Server Cloud.md",
"03.02 Travels/@Travels.md", "05.02 Networks/Server Alias.md",
"03.01 Reading list/@Reading master.md", "05.02 Networks/Selfhosting.md",
"06.02 Investments/@Investment Task master.md", "05.02 Networks/Configuring UFW.md",
"06.02 Investments/@Investment master.md", "05.02 Networks/Configuring Postfix.md",
"05.02 Networks/@Networks.md" "05.02 Networks/Configuring Monit.md"
] ]
} }

@ -1,12 +1,8 @@
class templaterFunc { class templaterFunc {
createNewFile(tp) { createNewFile(tp, templatelist) {
const fileName = this.getUserInput(tp, "File name") const fileName = await tp.system.prompt("File name")
const templateName = this.getUserInput(tp, "File name") const templateName = await tp.system.suggester(templatelist, templatelist)
return tp.file.create_new(tp.file.find_tfile("Template ") + templateName, filename, true, tp.file.folder()) return tp.file.create_new(tp.file.find_tfile("Template ") + templateName, fileName, tp.file.folder())
} }
getUserInput(tp, promptScript) {
const tempresult = await tp.system.prompt(promptScript)
return tempresult
}
} }

@ -1,4 +1,5 @@
<%* <%*
const {templaterFunc} = tp.obsidian.plugins.plugins.CustomJS const {templaterFunc} = this.app.plugins.plugins["CustomJS"].customJS
templaterFunc.createNewFile(tp) templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
tp.file.content.replace(/[\w\W]+?\n+?/,"")
%> %>

@ -1,5 +1,5 @@
```ad-code ```ad-code
~~~ ~~~bash
<% tp.file.selection() %> <% tp.file.selection() %>
~~~ ~~~
``` ```

@ -1,5 +1,3 @@
```ad-path ```ad-path
~~~
<% tp.file.selection() %> <% tp.file.selection() %>
~~~
``` ```

@ -13,24 +13,80 @@ ChildrenType: ["Note", "Task", "Recipe"]
```button ```button
name Create Note name Create Note
type append template type append template
action NewFile2 action NewFile1
color blue color blue
templater true templater true
``` ```
const {templaterFunc} = this.app.plugins.plugins["CustomJS"].customJS
templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
tp.file.content.replace(/[\w\W]+?\n+?/,"")
%>
const {templaterFunc} = tp.obsidian.plugins.plugins.CustomJS const {templaterFunc} = this.app.plugins.plugins["CustomJS"].customJS
templaterFunc.createNewFile(tp) templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%>
const {templaterFunc} = this.app.plugins.plugins["CustomJS"].api.customJS
templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%>
const templaterFunc = this.app.plugins.plugins["CustomJS"].api.customJS
templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%>
const templaterFunc = this.app.plugins.plugins["CustomJS"].customJS
templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%>
const {templaterFunc} = this.app.plugins.plugins["CustomJS"].customJS
templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%>
const {templaterFunc} = this.app.plugins.plugins["CustomJS"].api.customJS
templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%>
const {templaterFunc} = this.app.plugins.plugins["CustomJS"].customJS
templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%> %>
const {templaterFunc} = customJS const {templaterFunc} = this.app.plugins.plugins["CustomJS"]
templaterFunc.createNewFile(tp) templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%> %>
const {templaterFunc} = app.plugins.plugins.CustomJS tR += const {templaterFunc} = this.app.plugins.plugins["CustomJS"]
templaterFunc.createNewFile(tp) templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%> %>
const {templaterFunc} = customJS tR += const {templaterFunc} = this.app.plugins.plugins["customJS"]
templaterFunc.createNewFile(tp) templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%> %>
tR += const {templaterFunc} = this.app.plugins.plugins["customJS"].api
templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%>
tR += const {templaterFunc} = this.app.plugins.plugins["CustomJS"].api
templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%>
tR += const {templaterFunc} = tp.obsidian.plugins.plugins.CustomJS
%>
<% templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType) %>
tR += const {templaterFunc} = customJS
%>
<% templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType) %>
const templaterFunc = customJS
tR += templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%>
const templaterFunc = tp.obsidian.plugins.plugins.CustomJS
tR += templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%>
const {templaterFunc} = tp.obsidian.plugins.plugins.CustomJS
tR += templaterFunc.createNewFile(tp, tp.frontmatter.ChildrenType)
%>

@ -0,0 +1,105 @@
class shoppingFunc {
getNewItems(args) {
const {
dv,
catItem
} = args;
return 0
}
getItems2Change(args) {
const {
that,
app,
dv,
luxon,
theme,
} = args;
const { metaedit, buttons } = app.plugins.plugins
const { update } = metaedit.api
const { createButton } = buttons
const btnStr = this.getBtnName(theme)
const updateSct = "Groceries"// await app.obsidian.system.suggester(["groceries", "health", "household"], ["groceries", "health", "household"]); //"Groceries"
const updateStr = this.getPoint(dv, updateSct)
return dv.el('p',
createButton({
app,
el: that.container,
args: { name: btnStr, color: 'blue' },
clickOverride: { click: update, params: [updateSct, updateStr, dv.current().file.path]}
}),
)
}
getBtnStrings(dv, oprType) {
let categItems = ["groceries", "health", "household"];
let tempRes1 = "Test" //await app.system.suggester(catItems, catItems);
let tempRes2 = "Test"
switch(oprType) {
case 'to0':
tempRes2 = "Test"
break;
case 'add':
// const listItems = this.getNewItems(dv, catItem: updateSct);
tempRes2 = "Test" ////await dv.system.suggester(listItems, listItems);
break;
}
return tempRes2
}
getBtnName(arg1) {
let tempresult = "Test";
switch(arg1) {
case 'to0':
tempresult = "Reset shopping list"
break;
case 'add':
tempresult = "Add an item"
break;
}
return tempresult
}
getPoint(p, datapoint) {
let result = null
switch(datapoint) {
case 'Groceries':
result = p.Groceries
break;
case 'Health':
result = p.Health
break;
case 'Household':
result = p.Household
break;
case 'type':
result = p.DocType
break;
case 'createddate':
result = p.Date
break;
case 'tag':
result = p.Tag
break;
case 'hierarchy':
result = p.Hierarchy
break;
case 'alias':
result = p.Alias
break;
case 'location':
result = p.location
break;
}
return result
}
}

@ -0,0 +1,23 @@
const {globalFunc} = customJS;
let {items} = input;
let ing = [];
let j = 0;
if (!Boolean(items)) {
return "⚠️ <b>Warning</b>\nYou have not specified ahoppong items!\n<b>The shopping list cannot be printed.</b>"
}
for (let i = 0; i < items.length; i++) {
let name = items[i].replace(items[i].split(" ")[0] + " " + items[i].split(" ")[1]+ " " + items[i].split(" ")[2], "");
let unit = items[i].split(" ")[2];
if (unit.contains('whole')) {unit = ""}
let amount = items[i].split(" ")[1];
let emoji = items[i].split(" ")[0];
if (amount > 0) {
ing[j] = emoji + " " + amount + " " + unit + " <b>" + name + "</b>"
j++
}
}
dv.el('p', globalFunc.BuildList(ing, "\n"))

@ -0,0 +1,126 @@
---
Alias: ["Shopping list"]
Tag: ["Groceries"]
Date: 2021-10-25
DocType: "Groceries"
Hierarchy: "NonRoot"
TimeStamp:
location:
CollapseMetaTable: Yes
Groceries:
- 🍶 6 bottle(s) Coke 0
- 🍿 1 whole Snacks
- 🧈 0 packet(s) Beurre
- 🫒 0 bottle(s) Olive oil
- 🍺 0 bottle(s) Beers
- 🥯 0 packet(s) Bagels
- 🍯 1 jar(s) Bonne Maman
- 🍌 6 whole Bananas
- 🧀 0 packet(s) Fromage rape
- 🥩 0 packet(s) Cured meat
- 🍐 6 whole Fruit
- 🍝 2 packet(s) Pasta
- 🌶️ 1 bottle(s) Tabasco
Health:
- 🚿 1 whole shower gel
- 🧴 1 whole shampoo
- 🪥 1 whole toothbrush
- 🦷 1 whole toothpaste
- 👂 1 whole earbuds
- 🪒 1 whole razor blades (mach3)
- 🍦 1 whole shaving cream
- 🧻 1 whole loo rolls
- 🦨 1 whole deo
Household:
- 👔 1 whole Washing gel
- 🧻 1 whole Kitchen towel
- 🧽 1 whole Sponge
- 👕 1 whole Softener
- 🍽️ 1 whole Dishwasher tablets
- 🧂 1 whole Dishwasher salt
- 🚰 1 whole Dishwasher rinsing aid
---
Parent::
---
&emsp;
```button
name Save
type command
action Save current file
id Save
```
^button-ShoppinglistNSave
&emsp;
```dataviewjs
const {shoppingFunc} = customJS
shoppingFunc.getItems2Change({app: app, dv: dv, luxon: luxon, that:this, theme: "to0"})
```
# Shopping list
&emsp;
```ad-abstract
title: Summary
collapse: open
Shopping list management.
```
&emsp;
```toc
style: number
```
&emsp;
---
&emsp;
### Groceries
&emsp;
```dataviewjs
dv.view("00.01 Admin/dv-views/print_shoppingitems", {items: dv.current().Groceries})
```
&emsp;
---
&emsp;
### Health
&emsp;
```dataviewjs
dv.view("00.01 Admin/dv-views/print_shoppingitems", {items: dv.current().Health})
```
&emsp;
---
&emsp;
### Household
&emsp;
```dataviewjs
dv.view("00.01 Admin/dv-views/print_shoppingitems", {items: dv.current().Household})
```
&emsp;
&emsp;

@ -100,6 +100,8 @@ Paris, Zürich, London
&emsp; &emsp;
60's is their best decade
&emsp; &emsp;
--- ---

@ -37,6 +37,11 @@ id CreateNote
``` ```
^button-ReadingNewNote ^button-ReadingNewNote
```button ```button
name Save name Save
type command type command

@ -145,15 +145,13 @@ sudo chown -R caddy:caddy /var/log/caddy
Caddy's configuration file is inder: Caddy's configuration file is inder:
```ad-path ```ad-path
~~~
/etc/caddy/Caddyfile /etc/caddy/Caddyfile
~~~
``` ```
Default configuration is: Default configuration is:
```ad-code ```ad-code
~~~ ~~~yaml
(localhost) { (localhost) {
root * /var/www/html root * /var/www/html
encode gzip zstd encode gzip zstd
@ -176,15 +174,13 @@ Default configuration is:
To update php, edit the following file: To update php, edit the following file:
```ad-path ```ad-path
~~~ /etc/php/7.4/fpm/pool.d/www.conf
sudo nano /etc/php/7.4/fpm/pool.d/www.conf
~~~
``` ```
Change all 'www-data' user reference with 'caddy' including: Change all 'www-data' user reference with 'caddy' including:
```ad-code ```ad-code
~~~ ~~~yaml
listen.owner = caddy listen.owner = caddy
listen.group = caddy listen.group = caddy
~~~ ~~~
@ -211,7 +207,7 @@ sudo systemctl restart php7.4-fpm
##### Preliminary CORS code snippet ##### Preliminary CORS code snippet
```ad-code ```ad-code
~~~ ~~~yaml
(cors) { (cors) {
@origin{args.0} header Origin {args.0} @origin{args.0} header Origin {args.0}
header @origin{args.0} Access-Control-Allow-Origin "{args.0}" header @origin{args.0} Access-Control-Allow-Origin "{args.0}"
@ -224,7 +220,7 @@ sudo systemctl restart php7.4-fpm
##### CORS for a sub-domain ##### CORS for a sub-domain
```ad-code ```ad-code
~~~ ~~~yaml
import cors (http://subdomain.tld) import cors (http://subdomain.tld)
header Access-Control-Allow-Methods "POST, GET, OPTIONS, PUT" header Access-Control-Allow-Methods "POST, GET, OPTIONS, PUT"
header Access-Control-Allow-Headers "*" header Access-Control-Allow-Headers "*"
@ -242,7 +238,7 @@ sudo systemctl restart php7.4-fpm
Configuration requires to add the following in the sub-domain definition: Configuration requires to add the following in the sub-domain definition:
```ad-code ```ad-code
~~~ ~~~yaml
handle_path /(suffix)* { handle_path /(suffix)* {
root * /(path to suffix) root * /(path to suffix)
file_server file_server
@ -261,7 +257,7 @@ Configuration requires to add the following in the sub-domain definition:
Configuration of a service attached to the docker network is easy: Configuration of a service attached to the docker network is easy:
```ad-code ```ad-code
~~~ ~~~yaml
(hostname) { (hostname) {
encode zstd gzip encode zstd gzip
reverse_proxy xxx.yyy.zzz.aaa:port reverse_proxy xxx.yyy.zzz.aaa:port
@ -297,7 +293,7 @@ caddy hash-password
2. **Define the array of users and hashed password** 2. **Define the array of users and hashed password**
```ad-code ```ad-code
~~~ ~~~yaml
(basic-auth) { (basic-auth) {
basicauth / { basicauth / {
user hashed-password user hashed-password
@ -309,7 +305,7 @@ caddy hash-password
3. **Define the snippet to test whether the cookie is installed** 3. **Define the snippet to test whether the cookie is installed**
```ad-code ```ad-code
~~~ ~~~yaml
(proxy-auth) { (proxy-auth) {
% if cookie not = some-token-nonsense % if cookie not = some-token-nonsense
@no-auth { @no-auth {
@ -332,7 +328,7 @@ caddy hash-password
After setting up a new subdomain/page and appropriate DNS records, define it as follows: After setting up a new subdomain/page and appropriate DNS records, define it as follows:
```ad-code ```ad-code
~~~ ~~~yaml
auth.example.com { auth.example.com {
route / { route / {
% require authentication % require authentication
@ -361,7 +357,7 @@ auth.example.com {
Simply add the following at the top of all declarations for sub-domain definitions: Simply add the following at the top of all declarations for sub-domain definitions:
```ad-code ```ad-code
~~~ ~~~yaml
import proxy-auth import proxy-auth
~~~ ~~~
``` ```
@ -381,9 +377,7 @@ import proxy-auth
Look for a folder with the following sequence: Look for a folder with the following sequence:
```ad-path ```ad-path
~~~
/.local/share/caddy /.local/share/caddy
~~~
``` ```
&emsp; &emsp;

@ -181,7 +181,7 @@ Maintaining containers with docker is arduous and easier to do with docker-compo
Easiest is to create aliases in the .bashrc of home directory by adding: Easiest is to create aliases in the .bashrc of home directory by adding:
```ad-code ```ad-code
~~~ ~~~bash
alias dc-up='sudo docker-compose --compatibility up -d' alias dc-up='sudo docker-compose --compatibility up -d'
alias dc-update='sudo docker-compose pull && sudo docker-compose --compatibility up -d' alias dc-update='sudo docker-compose pull && sudo docker-compose --compatibility up -d'
alias dc-update-all='for d in ./*/ ; do (cd "$d" && dc-update); done' alias dc-update-all='for d in ./*/ ; do (cd "$d" && dc-update); done'
@ -191,9 +191,7 @@ alias dc-update-all='for d in ./*/ ; do (cd "$d" && dc-update); done'
To the following file: To the following file:
```ad-path ```ad-path
~~~
~/.bashrc ~/.bashrc
~~~
``` ```
The command needs to be run periodically. The command needs to be run periodically.
@ -229,15 +227,13 @@ sudo systemctl stop docker
2. **Edit the json config file** 2. **Edit the json config file**
```ad-path ```ad-path
~~~
/var/lib/docker/containers/(container id)/config.v2.json /var/lib/docker/containers/(container id)/config.v2.json
~~~
``` ```
Within the 'Env' declaration, add the requested data field: Within the 'Env' declaration, add the requested data field:
```ad-code ```ad-code
~~~ ~~~bash
"DATA_FIELD=data_value" "DATA_FIELD=data_value"
~~~ ~~~
``` ```

@ -120,15 +120,13 @@ Once set up, the next step is to enable the web interface.
The following configuration file need to be amended: The following configuration file need to be amended:
```ad-path ```ad-path
~~~
/etc/monit/monitrc /etc/monit/monitrc
~~~
``` ```
By unchecking the following: By unchecking the following:
```ad-code ```ad-code
~~~ ~~~bash
set httpd port 2812 set httpd port 2812
allow admin:monit allow admin:monit
~~~ ~~~
@ -157,15 +155,13 @@ sudo ufw allow 2812
The following configuration file need to be amended: The following configuration file need to be amended:
```ad-path ```ad-path
~~~
/etc/monit/monitrc /etc/monit/monitrc
~~~
``` ```
By unchecking the following: By unchecking the following:
```ad-code ```ad-code
~~~ ~~~bash
set mailserver localhost set mailserver localhost
set mail-format { from: monit@(localhost) set mail-format { from: monit@(localhost)
set alert (dest email address) set alert (dest email address)
@ -223,7 +219,7 @@ sudo touch /etc/monit/conf-available/(processname)
Edit the document with at least the below declarations: Edit the document with at least the below declarations:
```ad-code ```ad-code
~~~ ~~~bash
check process (processname) matching "(processname)" check process (processname) matching "(processname)"
start program = "(path to command)" start program = "(path to command)"
stop program = "(path to command)" stop program = "(path to command)"
@ -257,7 +253,7 @@ sudo chmod 711 /etc/monit/scripts/check_container_(container name).sh
2. Edit the script 2. Edit the script
```ad-code ```ad-code
~~~ ~~~bash
#! /bin/bash #! /bin/bash
docker top "(container name)" docker top "(container name)"
exit $? exit $?
@ -275,7 +271,7 @@ sudo touch/vi /etc/monit/conf-available/(container name)
4. Edit the config file 4. Edit the config file
```ad-code ```ad-code
~~~ ~~~bash
CHECK PROGRAM (container name) WITH PATH /etc/monit/scripts/check\_container_(container name).sh CHECK PROGRAM (container name) WITH PATH /etc/monit/scripts/check\_container_(container name).sh
START PROGRAM = "/usr/bin/docker start (container name)" START PROGRAM = "/usr/bin/docker start (container name)"
STOP PROGRAM = "/usr/bin/docker stop (container name)" STOP PROGRAM = "/usr/bin/docker stop (container name)"

@ -95,9 +95,7 @@ The basic configuration is run in detail below.
#### Main.cf #### Main.cf
[[#^Top|TOP]] [[#^Top|TOP]]
```ad-path ```ad-path
~~~
/etc/postfix/main.cf /etc/postfix/main.cf
~~~
``` ```
Edit the file whilst editing the following values: Edit the file whilst editing the following values:
@ -107,7 +105,7 @@ Edit the file whilst editing the following values:
```ad-code ```ad-code
title: main.cf title: main.cf
~~~ ~~~bash
###### POSTFIX config file, adapted for SimpleLogin ###### POSTFIX config file, adapted for SimpleLogin
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no biff = no
@ -180,16 +178,14 @@ smtpd_recipient_restrictions =
#### relay domains #### relay domains
[[#^Top|TOP]] [[#^Top|TOP]]
```ad-path ```ad-path
~~~
/etc/postfix/pgsql-relay-domains.cf /etc/postfix/pgsql-relay-domains.cf
~~~
``` ```
Below is the default config for the file (replace mydomain.com with relevant value): Below is the default config for the file (replace mydomain.com with relevant value):
```ad-code ```ad-code
title: master.cf title: master.cf
~~~ ~~~bash
###### postgres config ###### postgres config
hosts = localhost hosts = localhost
user = myuser user = myuser
@ -206,16 +202,14 @@ query = SELECT domain FROM custom_domain WHERE domain='%s' AND verified=true
#### transport maps #### transport maps
[[#^Top|TOP]] [[#^Top|TOP]]
```ad-path ```ad-path
~~~
/etc/postfix/pgsql-transport-maps.cf /etc/postfix/pgsql-transport-maps.cf
~~~
``` ```
Below is the standard declaration of the file (replace mydomain.com with the relevant value): Below is the standard declaration of the file (replace mydomain.com with the relevant value):
```ad-code ```ad-code
title: pgsql-transport-maps.cf title: pgsql-transport-maps.cf
~~~ ~~~bash
###### postgres config ###### postgres config
hosts = localhost hosts = localhost
user = myuser user = myuser
@ -280,9 +274,7 @@ Definition of permitted networks to restrict access (in [[Configuring Postfix#Ma
##### Submission/SMTPD ##### Submission/SMTPD
```ad-path ```ad-path
~~~
/etc/postfix/master.cf /etc/postfix/master.cf
~~~
``` ```
Options are coded in the file by default. Uncheck necessary directives. Options are coded in the file by default. Uncheck necessary directives.

@ -237,9 +237,7 @@ The service itself does not require particular management as all features are em
Parameters can only be amended through the config file under the root user: Parameters can only be amended through the config file under the root user:
```ad-path ```ad-path
~~~
sudo vim ~/simplelogin.env sudo vim ~/simplelogin.env
~~~
``` ```
Sample configs can be found [here](https://github.com/simple-login/app/blob/master/example.env) Sample configs can be found [here](https://github.com/simple-login/app/blob/master/example.env)

@ -135,11 +135,9 @@ A comprehensive tutorial on the MPM switch can be found [here](https://www.digit
**php.ini** files can be found at: **php.ini** files can be found at:
```ad-path ```ad-path
~~~
/etc/php/7.4/fpm/php.ini /etc/php/7.4/fpm/php.ini
/etc/php/7.4/apache2/php.ini /etc/php/7.4/apache2/php.ini
/etc/php/7.4/cli/php.ini /etc/php/7.4/cli/php.ini
~~~
``` ```
&emsp; &emsp;
@ -157,14 +155,12 @@ Nothing particular to note on MySQL apart from initial set-up and user managemen
Configuration file is under: Configuration file is under:
```ad-path ```ad-path
~~~
/etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf
~~~
``` ```
```ad-code ```ad-code
title: Optimise memory usage of mysql title: Optimise memory usage of mysql
~~~ ~~~yaml
[mysqld] [mysqld]
% Disable performance schema to hugely reduce RAM usage % Disable performance schema to hugely reduce RAM usage
performance_schema = OFF performance_schema = OFF
@ -212,8 +208,8 @@ sudo crontab -u www-data -e
2. **Add cronjob** 2. **Add cronjob**
```ad-code ```ad-code
~~~ ~~~bash
\*/5 * * * * php -f /var/www/html/nextcloud/cron.php --define apc.enable_cli=1 */5 * * * * php -f /var/www/html/nextcloud/cron.php --define apc.enable_cli=1
~~~ ~~~
``` ```
@ -292,9 +288,7 @@ From the server's command line, Nextcloud offers the ability to perform some tas
[[Nextcloud]] offers a command-line tool which permission needs to be set to "executable". It is located here: [[Nextcloud]] offers a command-line tool which permission needs to be set to "executable". It is located here:
```ad-path ```ad-path
~~~
/var/www/html/nextcloud/occ /var/www/html/nextcloud/occ
~~~
``` ```
The tool needs to be invoked by the "www-data" user and compiled with PHP: The tool needs to be invoked by the "www-data" user and compiled with PHP:
@ -380,17 +374,13 @@ rclone sync source:'datapath' dest:'datapath'
1. **Local file structure** 1. **Local file structure**
```ad-path ```ad-path
~~~
/var/www/html/nextcloud/data/USERNAME/files /var/www/html/nextcloud/data/USERNAME/files
~~~
``` ```
2. **Webdav file structure** 2. **Webdav file structure**
```ad-path ```ad-path
~~~
/remote.php/dav/files/USERNAME /remote.php/dav/files/USERNAME
~~~
``` ```
&emsp; &emsp;

@ -164,7 +164,7 @@ sudo nano /etc/fail2ban/jail.d/sshd.local
With the following parameters: With the following parameters:
```ad-code ```ad-code
~~~ ~~~yaml
[sshd] [sshd]
enabled = true enabled = true
port=2227 port=2227
@ -284,15 +284,11 @@ title: service parameters
2 files are used to configure the service: 2 files are used to configure the service:
```ad-path ```ad-path
~~~
~/standalone/.env ~/standalone/.env
~~~
``` ```
```ad-path ```ad-path
~~~
~/standalone/docker/auth/.env ~/standalone/docker/auth/.env
~~~
``` ```
Docs can be found [here](https://docs.standardnotes.com/self-hosting/docker). Docs can be found [here](https://docs.standardnotes.com/self-hosting/docker).
@ -404,9 +400,7 @@ User management has not been parametered to exclude new users but an admin panel
```ad-path ```ad-path
title: Config file title: Config file
~~~
~/gitea/gitea/gitea/conf/app.ini ~/gitea/gitea/gitea/conf/app.ini
~~~
``` ```
&emsp; &emsp;
@ -414,7 +408,7 @@ title: Config file
```ad-code ```ad-code
title: email setup title: email setup
Gitea can work on internal mail points through: Gitea can work on internal mail points through:
~~~ ~~~bash
ENABLED = true ENABLED = true
FROM = (user addresss) FROM = (user addresss)
USE_SENDMAIL = false USE_SENDMAIL = false
@ -457,9 +451,7 @@ List of monitored services:
#### Cert storage #### Cert storage
```ad-path ```ad-path
~~~
/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/ /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/
~~~
``` ```
&emsp; &emsp;

@ -134,7 +134,7 @@ sudo nano /etc/fail2ban/jail.d/sshd.local
With the following parameters: With the following parameters:
```ad-code ```ad-code
~~~ ~~~yaml
[sshd] [sshd]
enabled = true enabled = true
port=2227 port=2227
@ -192,16 +192,12 @@ title: wireguard installer
```ad-path ```ad-path
title: Client Config files title: Client Config files
~~~
/home/melchiorbv/wg0-client-(clientname).conf /home/melchiorbv/wg0-client-(clientname).conf
~~~
``` ```
```ad-path ```ad-path
title: Server Config file title: Server Config file
~~~
/etc/wireguard/wg0.conf /etc/wireguard/wg0.conf
~~~
``` ```
&emsp; &emsp;
@ -221,7 +217,7 @@ title: In `~` for `melchiorbv`
```ad-code ```ad-code
title: WireGuard config title: WireGuard config
~~~ ~~~bash
IPv4 or IPv6 public address: 5.135.0.192 IPv4 or IPv6 public address: 5.135.0.192
Public interface: eth0 Public interface: eth0
WireGuard interface name: wg0 WireGuard interface name: wg0

@ -252,7 +252,7 @@ touch/vim ~/.ssh/config
The declaration of a connection follows this nomenclature: The declaration of a connection follows this nomenclature:
```ad-code ```ad-code
~~~ ~~~bash
Host (scriptname) (serverIP) Host (scriptname) (serverIP)
HostName (serverIP) HostName (serverIP)
IdentityFile ~/.ssh/(private key path) IdentityFile ~/.ssh/(private key path)
@ -284,7 +284,7 @@ sudo (nano/vim) /etc/ssh/sshd_config
The following parameters enable to restrict access to the server: The following parameters enable to restrict access to the server:
```ad-code ```ad-code
~~~ ~~~javascript
// Enables SSH Key authentication // Enables SSH Key authentication
PubkeyAuthentication yes PubkeyAuthentication yes
@ -606,9 +606,7 @@ mkdir sys
Check: Check:
```ad-path ```ad-path
~~~
/etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules
~~~
``` ```

Loading…
Cancel
Save