develop във master преди 6 години
| @@ -7,6 +7,7 @@ googleAnalytics = "UA-90695618-1" | |||
| # Controls default theme and theme components | |||
| theme = [ | |||
| "voyeur", | |||
| "fractal-forest", | |||
| "after-dark" | |||
| ] | |||
| @@ -80,3 +81,7 @@ footnoteReturnLinkContents = "↩" # Provides a nicer footnote return link | |||
| [outputs] | |||
| home = ["HTML", "RSS", "JSON"] | |||
| [params.modules.voyeur] | |||
| enabled = true | |||
| url = "https://fathom.rohanverma.net" | |||
| @@ -0,0 +1 @@ | |||
| node_modules | |||
| @@ -0,0 +1,23 @@ | |||
| # 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) | |||
| @@ -0,0 +1,12 @@ | |||
| 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. | |||
| @@ -0,0 +1,73 @@ | |||
| # Voyeur | |||
| > Self-hosted analytics for [After Dark]. Voyeur adds support for [Fathom Analytics](https://usefathom.com). | |||
| [](https://www.npmjs.com/package/mod-voyeur) | |||
| [](https://www.npmjs.com/package/mod-voyeur) | |||
| [](https://git.habd.as/comfusion/after-dark/) | |||
| [](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/ | |||
| @@ -0,0 +1,5 @@ | |||
| version: "3" | |||
| services: | |||
| postgres: | |||
| volumes: | |||
| - ./postgres-data:/var/lib/postgresql/data | |||
| @@ -0,0 +1,26 @@ | |||
| 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 | |||
| @@ -0,0 +1,18 @@ | |||
| {{ $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 }} | |||
| @@ -0,0 +1,42 @@ | |||
| { | |||
| "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" | |||
| } | |||