Moe counter *Booru style from https://github.com/journey-ad/Moe-Counter, with a bunch of fixes
This repository has been archived on 2024-05-09. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
diowo 0dec0c65f3 chore: change port or something 2024-04-05 20:39:30 +02:00
assets old favicon less confusion, convert to .ico 2023-10-15 11:31:21 +02:00
db try fix #1 2024-03-02 17:48:54 +01:00
utils feat: render images as pixelated 2022-05-01 02:09:32 +08:00
views remove index demo instead 2024-03-02 18:19:07 +01:00
.gitignore perf: Delayed writing to database 2023-03-06 18:59:42 +08:00
LICENSE Create LICENSE 2020-08-12 18:12:35 +08:00
Readme.md Update Readme.md 2023-10-15 13:55:30 +02:00
config.yml chore: change port or something 2024-04-05 20:39:30 +02:00
index.js retardation 2024-03-02 17:57:21 +01:00
package-lock.json fixes, remove google spyware, fix broken english 2023-10-15 02:19:13 +02:00
package.json perf: Delayed writing to database 2023-03-06 18:59:42 +08:00

Readme.md

Moe-Counter

How to setup on Debian 12 + Caddy

Install nodejs on Debian 12 following this tutorial

https://github.com/nodesource/distributions#installation-instructions

Installation Instructions

Node.js

If you have root access, you can omit the 'sudo' command as you already have full administrative privileges.

  1. Download and import the Nodesource GPG key
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
  1. Create deb repository
NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

Optional: NODE_MAJOR can be changed depending on the version you need.

NODE_MAJOR=16
NODE_MAJOR=18
NODE_MAJOR=20
  1. Run Update and Install
sudo apt-get update
sudo apt-get install nodejs -y

Uninstall nodejs Ubuntu & Debian packages

To completely remove Node.js installed from the deb.nodesource.com package methods above:

use sudo on Ubuntu or run this as root on debian
apt-get purge nodejs &&\
rm -r /etc/apt/sources.list.d/nodesource.list &&\
rm -r /etc/apt/keyrings/nodesource.gpg

Clone this repository on your server

cd `/var/www/` && sudo git clone https://git.konakona.moe/diowo/moe-counter

Install node_modules

cd `/var/www/` && sudo npm install

Install PM2 globally to daemonize the application

sudo npm install -g pm2

Add low privilege user

sudo adduser --gecos "" --disabled-password node

sudo chown node:node -R /var/www/moe-counter

sudo su node

npm install

Now start the application with PM2

pm2 start index.js

Add a reverse_proxy entry to your Caddyfile

getloli.konakona.moe {
    reverse_proxy localhost:1488
    encode gzip
}

Block the port you chose for the reverse proxy

sudo iptables -A INPUT -p tcp --dport 1488 -j DROP



Original README.md

多种风格可选的萌萌计数器

Moe-Counter

More theme
asoul

asoul

moebooru

moebooru

rule34

Rule34

gelbooru

Gelbooru

Demo

https://count.getloli.com

Usage

Install

Run on Replit

Deploying on your own server

$ git clone https://github.com/journey-ad/Moe-Counter.git
$ cd Moe-Counter
$ yarn install

$ yarn start

Configuration

config.yml

app:
  # site: https://count.getloli.com # your website
  port: 3000

db:
  type: sqlite # sqlite or mongodb

If you use mongodb, you need to specify the environment variable DB_URL

# eg:
export DB_URL=mongodb+srv://account:passwd@***.***.***.mongodb.net/db_count

replit can use Secrets, documentation

DB_URL="mongodb+srv://account:passwd@***.***.***.mongodb.net/db_count"

Credits

License

FOSSA Status