diff --git a/Dockerfile b/Dockerfile index 6f95e63..9c71236 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM dunglas/frankenphp:1-php8.5 # System Setup RUN install-php-extensions mongodb zip -ARG USER=mclogs +ARG USER=iblogs RUN useradd ${USER} && \ setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp @@ -20,7 +20,7 @@ RUN --mount=type=cache,target=/tmp/cache/composer \ # Application Setup COPY docker/Caddyfile /etc/frankenphp/Caddyfile -COPY docker/mclogs.ini /usr/local/etc/php/conf.d/mclogs.ini +COPY docker/iblogs.ini /usr/local/etc/php/conf.d/iblogs.ini COPY . . diff --git a/README.md b/README.md index 59eaa32..27afe5f 100644 --- a/README.md +++ b/README.md @@ -22,34 +22,34 @@ * Open source and self-hostable ## Self-hosting -You can self-host mclogs using Docker. A [docker image](https://github.com/aternosorg/mclogs/pkgs/container/mclogs) is available in the GitHub Container Registry: `ghcr.io/aternosorg/mclogs`. -A MongoDB instance is also required to run mclogs. +You can self-host iblogs using Docker. A [docker image](https://github.com/indifferentketchup/iblogs/pkgs/container/iblogs) is available in the GitHub Container Registry: `ghcr.io/indifferentketchup/iblogs`. +A MongoDB instance is also required to run iblogs. An example docker compose files for self-hosting can be found here: [docker/compose.production.yaml](docker/compose.production.yaml). ### Config -You can configure mclogs by creating a `config.json` file in the root directory, see [example.config.json](example.config.json) or by setting +You can configure iblogs by creating a `config.json` file in the root directory, see [example.config.json](example.config.json) or by setting environment variables. Environment variables override settings in the config file. Here is a list of all available config options: | Variable / JSON Path | Default | Description | |:--------------------------------------------------------------------|:--------------------|:--------------------------------------------| -| `MCLOGS_STORAGE_TTL`
`storage.ttl` | `7776000` (90d) | Time until logs are deleted after last view | -| `MCLOGS_STORAGE_LIMIT_BYTES`
`storage.limit.bytes` | `10485760` (10 MiB) | Maximum size of a log in bytes | -| `MCLOGS_STORAGE_LIMIT_LINES`
`storage.limit.lines` | `25000` | Maximum number of lines in a log | -| `MCLOGS_MONGODB_URL`
`mongodb.url` | `"mongodb://mongo"` | MongoDB connection URL | -| `MCLOGS_MONGODB_DATABASE`
`mongodb.database` | `"mclogs"` | Name of the MongoDB database | -| `MCLOGS_ID_LENGTH`
`id.length` | `7` | The default length for new IDs | -| `MCLOGS_LEGAL_ABUSE`
`legal.abuse` | `null` | Public email address to report abuse | -| `MCLOGS_LEGAL_IMPRINT`
`legal.imprint` | `null` | The imprint URL | -| `MCLOGS_LEGAL_PRIVACY`
`legal.privacy` | `null` | The privacy policy URL | -| `MCLOGS_FRONTEND_NAME`
`frontend.name` | `null` | Instance name (defaults to domain) | -| `MCLOGS_FRONTEND_COLOR_ACCENT`
`frontend.color.accent` | `#5cb85c` | The accent/primary color | -| `MCLOGS_FRONTEND_COLOR_BACKGROUND`
`frontend.color.background` | `#1a1a1a` | The background color | -| `MCLOGS_FRONTEND_COLOR_TEXT`
`frontend.color.text` | `#e8e8e8` | The text color | -| `MCLOGS_FRONTEND_COLOR_ERROR`
`frontend.color.error` | `#f62451` | The error color | -| `MCLOGS_WORKER_REQUESTS`
`worker.requests` | `500` | Max requests per single worker | +| `IBLOGS_STORAGE_TTL`
`storage.ttl` | `7776000` (90d) | Time until logs are deleted after last view | +| `IBLOGS_STORAGE_LIMIT_BYTES`
`storage.limit.bytes` | `10485760` (10 MiB) | Maximum size of a log in bytes | +| `IBLOGS_STORAGE_LIMIT_LINES`
`storage.limit.lines` | `25000` | Maximum number of lines in a log | +| `IBLOGS_MONGODB_URL`
`mongodb.url` | `"mongodb://mongo"` | MongoDB connection URL | +| `IBLOGS_MONGODB_DATABASE`
`mongodb.database` | `"iblogs"` | Name of the MongoDB database | +| `IBLOGS_ID_LENGTH`
`id.length` | `7` | The default length for new IDs | +| `IBLOGS_LEGAL_ABUSE`
`legal.abuse` | `null` | Public email address to report abuse | +| `IBLOGS_LEGAL_IMPRINT`
`legal.imprint` | `null` | The imprint URL | +| `IBLOGS_LEGAL_PRIVACY`
`legal.privacy` | `null` | The privacy policy URL | +| `IBLOGS_FRONTEND_NAME`
`frontend.name` | `null` | Instance name (defaults to domain) | +| `IBLOGS_FRONTEND_COLOR_ACCENT`
`frontend.color.accent` | `#5cb85c` | The accent/primary color | +| `IBLOGS_FRONTEND_COLOR_BACKGROUND`
`frontend.color.background` | `#1a1a1a` | The background color | +| `IBLOGS_FRONTEND_COLOR_TEXT`
`frontend.color.text` | `#e8e8e8` | The text color | +| `IBLOGS_FRONTEND_COLOR_ERROR`
`frontend.color.error` | `#f62451` | The error color | +| `IBLOGS_WORKER_REQUESTS`
`worker.requests` | `500` | Max requests per single worker | There are a few more environment variables that can be set to modify the FrankenPHP/Caddy setup directly: @@ -69,10 +69,10 @@ There are a few more environment variables that can be set to modify the Franken ### Installation ```bash # clone repository -git clone git@github.com:aternosorg/mclogs.git +git clone git@github.com:indifferentketchup/iblogs.git # install composer dependencies -cd mclogs +cd iblogs composer install # start development environment diff --git a/dev/compose.yaml b/dev/compose.yaml index c20e830..4496669 100644 --- a/dev/compose.yaml +++ b/dev/compose.yaml @@ -1,11 +1,11 @@ -name: "mclogs" +name: "iblogs" services: web: build: context: .. dockerfile: ./Dockerfile environment: - - MCLOGS_WORKER_REQUESTS=1 + - IBLOGS_WORKER_REQUESTS=1 - FRANKENPHP_WORKERS=4 ports: - "80:80" diff --git a/docker/compose.production.yaml b/docker/compose.production.yaml index 5f15434..de4f192 100644 --- a/docker/compose.production.yaml +++ b/docker/compose.production.yaml @@ -1,6 +1,6 @@ services: web: - image: ghcr.io/aternosorg/mclogs:2 + image: ghcr.io/indifferentketchup/iblogs:2 restart: always ports: # Expose HTTP (80) and HTTPS (443) @@ -9,16 +9,16 @@ services: - "443:443" - "443:443/udp" environment: - # Set this to your domain (e.g., mclogs.example.com) to enable Auto-SSL. + # Set this to your domain (e.g., iblogs.example.com) to enable Auto-SSL. # If running behind a proxy (Cloudflare/Nginx), set to ":80" to disable Auto-SSL. SERVER_NAME: :80 - MCLOGS_MONGODB_URL: mongodb://mongo:27017 - MCLOGS_MONGODB_DATABASE: mclogs + IBLOGS_MONGODB_URL: mongodb://mongo:27017 + IBLOGS_MONGODB_DATABASE: iblogs - # Optional MCLOGS configuration + # Optional IBLOGS configuration # See README.md for full list of available options - # MCLOGS_FRONTEND_NAME: "mclogs" + # IBLOGS_FRONTEND_NAME: "iblogs" volumes: # For caddy cache (SSL certificates) diff --git a/docker/mclogs.ini b/docker/iblogs.ini similarity index 100% rename from docker/mclogs.ini rename to docker/iblogs.ini diff --git a/web/public/css/mclogs.css b/web/public/css/iblogs.css similarity index 100% rename from web/public/css/mclogs.css rename to web/public/css/iblogs.css diff --git a/web/public/js/log.js b/web/public/js/log.js index 3eacc48..4ff295a 100644 --- a/web/public/js/log.js +++ b/web/public/js/log.js @@ -203,7 +203,7 @@ function saveSettings() { for (const checkbox of settingCheckboxes) { data[checkbox.dataset.key] = checkbox.checked; } - document.cookie = "MCLOGS_SETTINGS=" + encodeURIComponent(JSON.stringify(data)) + ";path=/;expires=" + new Date(new Date().getTime() + 100 * 365 * 24 * 60 * 60 * 1000).toUTCString(); + document.cookie = "IBLOGS_SETTINGS=" + encodeURIComponent(JSON.stringify(data)) + ";path=/;expires=" + new Date(new Date().getTime() + 100 * 365 * 24 * 60 * 60 * 1000).toUTCString(); } /* copy to clipboard */