Browse Source

Merge branch 'develop' of rhnvrm/rohanverma.net into master

master
rhnvrm 6 years ago
parent
commit
b9fdf585be
10 changed files with 3690 additions and 0 deletions
  1. +5
    -0
      config.toml
  2. +1
    -0
      themes/voyeur/.gitignore
  3. +23
    -0
      themes/voyeur/CHANGELOG.md
  4. +12
    -0
      themes/voyeur/COPYING
  5. +73
    -0
      themes/voyeur/README.md
  6. +5
    -0
      themes/voyeur/docker-compose.dev.yml
  7. +26
    -0
      themes/voyeur/docker-compose.yml
  8. +18
    -0
      themes/voyeur/layouts/partials/modules/voyeur/index.html
  9. +3485
    -0
      themes/voyeur/package-lock.json
  10. +42
    -0
      themes/voyeur/package.json

+ 5
- 0
config.toml View File



# Controls default theme and theme components # Controls default theme and theme components
theme = [ theme = [
"voyeur",
"fractal-forest", "fractal-forest",
"after-dark" "after-dark"
] ]


[outputs] [outputs]
home = ["HTML", "RSS", "JSON"] home = ["HTML", "RSS", "JSON"]

[params.modules.voyeur]
enabled = true
url = "https://fathom.rohanverma.net"

+ 1
- 0
themes/voyeur/.gitignore View File

node_modules

+ 23
- 0
themes/voyeur/CHANGELOG.md View File

# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.0.0](https://git.habd.as/comfusion/voyeur/compare/v1.0.0...v2.0.0) (2019-05-10)


### Build System

* **npm:** add conventional commit script ([926cd1a](https://git.habd.as/comfusion/voyeur/commit/926cd1a))
* **npm:** add release script ([499f10c](https://git.habd.as/comfusion/voyeur/commit/499f10c))
* **npm:** make after-dark an optional dependency ([6938f26](https://git.habd.as/comfusion/voyeur/commit/6938f26))
* **npm:** upgrade standard-version to latest release ([1a7cb50](https://git.habd.as/comfusion/voyeur/commit/1a7cb50))


### Features

* add after-dark gpg signed release tags ([c1e8fee](https://git.habd.as/comfusion/voyeur/commit/c1e8fee))



<a name="1.0.0"></a>
# 1.0.0 (2018-07-25)

+ 12
- 0
themes/voyeur/COPYING View File

Copyright (C) 2018, 2019 by Josh Habdas <[email protected]>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

+ 73
- 0
themes/voyeur/README.md View File

# Voyeur

> Self-hosted analytics for [After Dark]. Voyeur adds support for [Fathom Analytics](https://usefathom.com).

[![Latest NPM version](https://img.shields.io/npm/v/mod-voyeur.svg?style=flat-square)](https://www.npmjs.com/package/mod-voyeur)
[![NPM downloads per month](https://img.shields.io/npm/dm/mod-voyeur.svg?style=flat-square)](https://www.npmjs.com/package/mod-voyeur)
[![Minimum After Dark version](https://img.shields.io/badge/dynamic/json.svg?url=https://git.habd.as/comfusion/voyeur/raw/branch/master/package.json&label=after%20dark&query=$..['after-dark']&colorB=000000&style=flat-square&longCache=false&maxAge=86400)](https://git.habd.as/comfusion/after-dark/)
[![0BSD licensed](https://img.shields.io/npm/l/mod-voyeur.svg?style=flat-square&longCache=true)](https://git.habd.as/comfusion/voyeur/src/branch/master/COPYING)

## Requirements

- Domain Name. Pick one up on [AWS Route 53](https://aws.amazon.com/route53/) starting at $12/year.
- Virtual Private Server. Get one with [Vultr](https://www.vultr.com/), [DigitalOcean](https://www.digitalocean.com/) or [AWS Lightsail](https://aws.amazon.com/lightsail/).

## Setup

For Voyeur to operate you must have [Fathom](https://github.com/usefathom/fathom/) up and running on a VPS or embedded device such as ODROID or Raspberry Pi. If your domain uses <abbr title="Transport Layer Security">TLS</abbr> you must also enable TLS on your Fathom domain for reporting to function. If you have a wildcard SSL cert on your existing domain consider hosting Fathom on a subdomain such as `stats.example.com` for certificate reuse.

An example [Docker Compose](https://docs.docker.com/compose/) file to run Fathom using a Postgres database has been provided to you here as a convenience. Instructions on using it are beyond the scope of this module.

## Installation

1. Copy the contents of this repository into a directory called `themes/voyeur` under the root your After Dark site.
2. Add `voyeur` as a [theme component](https://gohugo.io/themes/theme-components/) to your After Dark site `config.toml`, e.g.

```toml
theme = [
"voyeur", # sequence before "after-dark"
"after-dark"
]
```

3. Add and specify settings for the module in your After Dark site config, e.g.

```toml
[params.modules.voyeur]
enabled = true # Optional, set false to disable module
url = "https://stats.example.org" # Optional, base analytics URL
port = "8080" # Optional, port setting
```

4. Build and deploy your After Dark site.

For additional information please see the [Fathom project](https://github.com/usefathom/fathom/).

## Development

For development, install Docker on your machine:

- [Get started with Docker for Mac](https://docs.docker.com/docker-for-mac/)
- [Get started with Docker for Windows](https://docs.docker.com/docker-for-windows/)

Configure your environment to use the dev [config override](https://docs.docker.com/compose/extends/):

```
export COMPOSE_FILE=docker-compose.yml:docker-compose.dev.yml
```

Run `docker-compose up` to start the app.

## Contributing

Please squash commits and use [Convention Commit](https://www.conventionalcommits.org/) messages. Run `npm run commit` after installing NPM dev dependencies for help creating conventional commit messages.

## Rights

Copyright (C) 2018, 2019 by Josh Habdas <[email protected]>

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.

The text of the above license is included in the file COPYING in the source.

[After Dark]: https://git.habd.as/comfusion/after-dark/

+ 5
- 0
themes/voyeur/docker-compose.dev.yml View File

version: "3"
services:
postgres:
volumes:
- ./postgres-data:/var/lib/postgresql/data

+ 26
- 0
themes/voyeur/docker-compose.yml View File

version: "3"
services:
fathom:
image: usefathom/fathom:latest
restart: always
environment:
- "FATHOM_DATABASE_DRIVER=postgres"
- "FATHOM_DATABASE_NAME=fathom"
- "FATHOM_DATABASE_USER=fathom"
- "FATHOM_DATABASE_PASSWORD=unsafe"
- "FATHOM_DATABASE_HOST=postgres"
- "FATHOM_DATABASE_SSLMODE=disable"
ports:
- "8080:8080"
depends_on:
- postgres

postgres:
image: postgres:latest
restart: always
environment:
- "POSTGRES_USER=fathom"
- "POSTGRES_PASSWORD=unsafe"
- "POSTGRES_DB=fathom"
volumes:
- /opt/postgres:/var/lib/postgresql/data

+ 18
- 0
themes/voyeur/layouts/partials/modules/voyeur/index.html View File

{{ $url := .url | default $.Site.BaseURL }}
{{ if ne .enabled false }}
<meta title="mod:voyeur" content="status:enabled">
<script>
(function(f, a, t, h, o, m){
a[h]=a[h]||function(){
(a[h].q=a[h].q||[]).push(arguments)
};
o=f.createElement('script'),
m=f.getElementsByTagName('script')[0];
o.async=1; o.src=t; o.id='fathom-script';
m.parentNode.insertBefore(o,m)
})(document, window, '{{ $url }}{{ with .port }}:{{ . }}{{ end }}/tracker.js', 'fathom');
fathom('trackPageview');
</script>
{{ else }}
<meta title="mod:voyeur" content="status:disabled">
{{ end }}

+ 3485
- 0
themes/voyeur/package-lock.json
File diff suppressed because it is too large
View File


+ 42
- 0
themes/voyeur/package.json View File

{
"name": "mod-voyeur",
"version": "2.0.0",
"description": "Fathom Analytics module for After Dark.",
"author": "Josh Habdas <[email protected]>",
"homepage": "https://after-dark.habd.as/module/voyeur/",
"standard-version": {
"scripts": {
"posttag": "git tag --sign $(git describe --tags $(git rev-list --tags --max-count=1)) $(git describe --tags $(git rev-list --tags --max-count=1))^{} -f -m \"$(git log -1 --pretty=%B)\" -m \"-----BEGIN DIST INTEGRITY-----\" -m \"$(npm pack --dry-run --json . | grep integrity | cut -d ',' -f1 | cut -d ':' -f2 | tr -d '\" ')\" -m \"-----END DIST INTEGRITY-----\""
}
},
"scripts": {
"test": "while true; do head -n 100 /dev/urandom; sleep 0.1; done | hexdump -C | grep 'ca fe'",
"release": "standard-version",
"commit": "npx git-cz"
},
"repository": {
"type": "git",
"url": "https://git.habd.as/comfusion/voyeur.git"
},
"keywords": [
"docker",
"hugo",
"postgres",
"preact",
"analytics"
],
"devDependencies": {
"commitizen": "^3.1.1",
"cz-conventional-changelog": "^2.1.0",
"standard-version": "^6.0.1"
},
"peerDependencies": {
"after-dark": ">= 5.0.0"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"license": "0BSD"
}

Loading…
Cancel
Save