Compare commits

..

No commits in common. "700190c6e60ae0fa6462e1d4b6d3bcd2366eba33" and "63eaceb6e6aa8ecd0c923b4be15fc45855b6f97e" have entirely different histories.

4 changed files with 62 additions and 69 deletions

43
.gitea/workflows/bump.yml Normal file
View File

@ -0,0 +1,43 @@
name: Bump Dependencies
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * *"
- cron: "0 12 * * *"
jobs:
update-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install Dependencies
run: bun install
- name: Update Dependencies
run: bun update
- name: Build App
run: bun run build
- name: Commit and Push Changes
env:
USERNAME_GITEA: ${{ secrets.USERNAME_GITEA }}
TOKEN_GITEA: ${{ secrets.TOKEN_GITEA }}
run: |
git config --global user.name "LibreCloud Actions Bot"
git config --global user.email "git@pontusmail.org"
git remote set-url origin https://${USERNAME_GITEA}:${TOKEN_GITEA}@git.pontusmail.org/librecloud/web.git
git add .
git commit -m "chore: bump dependencies" || exit 0
git push origin main

View File

@ -14,14 +14,14 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Log in to Gitea Package Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.SERVER_URL }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PACKAGE_TOKEN }}
run: echo "${{ secrets.PACKAGE_TOKEN }}" | docker login $SERVER_URL -u $USERNAME --password-stdin
env:
SERVER_URL: ${{ secrets.SERVER_URL }}
USERNAME: ${{ secrets.USERNAME }}
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
- name: Build Docker Image
run: docker build -t git.pontusmail.org/librecloud/web:latest .

View File

@ -1,42 +0,0 @@
name: Bump Dependencies
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * *"
- cron: "0 12 * * *"
jobs:
update-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install Dependencies
run: bun install
- name: Update Dependencies
run: bun update
- name: Commit and Push Changes
env:
USERNAME_GITEA: ${{ secrets.USERNAME_GITEA }}
TOKEN_GITEA: ${{ secrets.TOKEN_GITEA }}
SERVER_URL: ${{ secrets.SERVER_URL }}
run: |
git config --global user.name "LibreCloud Actions Bot"
git config --global user.email "git@pontusmail.org"
echo "Connecting to $SERVER_URL"
git remote set-url origin https://${USERNAME_GITEA}:${TOKEN_GITEA}@git.pontusmail.org/librecloud/web.git
git add .
git commit -m "chore: bump dependencies" || exit 0
git push origin main

View File

@ -2,8 +2,9 @@
![Last Update](https://img.shields.io/badge/last_update-24_Feb_2024-blue)
[![License: CC0-1.0](https://img.shields.io/badge/License-CC0_1.0-lightgrey.svg)](http://creativecommons.org/publicdomain/zero/1.0/)
[![Build and Push Docker Image](https://github.com/ihatenodejs/librecloud-web/actions/workflows/docker.yml/badge.svg)](https://github.com/ihatenodejs/librecloud-web/actions/workflows/docker.yml)
[![Bump Dependencies](https://github.com/ihatenodejs/librecloud-web/actions/workflows/bump.yml/badge.svg)](https://github.com/ihatenodejs/librecloud-web/actions/workflows/bump.yml)
[![Build Status](https://git.pontusmail.org/librecloud/web/actions/workflows/docker.yaml/badge.svg)](https://git.pontusmail.org/librecloud/web/actions/?workflow=docker.yaml)
[![Build Status](https://git.pontusmail.org/librecloud/web/actions/workflows/ci.yaml/badge.svg)](https://git.pontusmail.org/librecloud/web/actions/?workflow=ci.yaml)
[![Build Status](https://git.pontusmail.org/librecloud/web/actions/workflows/bump.yml/badge.svg)](https://git.pontusmail.org/librecloud/web/actions/?workflow=bump.yml)
LibreCloud's website, dashboard, and API
@ -39,7 +40,7 @@ A Docker setup requires both Docker *and* Docker Compose.
3. **Generate auth secret**
This step is relatively painless. Execute the below command to generate a `.env.local` file with an `AUTH_SECRET`.
This step is relatively painless. Simply execute the below command to generate a `.env.local` file with an `AUTH_SECRET`.
```bash
bunx auth secret
@ -51,9 +52,7 @@ A Docker setup requires both Docker *and* Docker Compose.
5. **Initialize Prisma (optional)**
Because `web` uses a database for storing Git link statuses (and other things to come),
you will need to initialize the SQLite database.
However, if you are using Docker Compose, a database has already been generated in the container image and is blank.
Because `web` uses a database for storing Git link statuses (and other things to come), you will need to initialize the SQLite database. However, if you are using Docker Compose, a database has already been generated in the container image, and is blank.
If you have a reason to initialize Prisma now, feel free to execute:
@ -72,8 +71,7 @@ A Docker setup requires both Docker *and* Docker Compose.
7. **Complete Setup**
If you would like to host the entire LibreCloud frontend and backend,
you will also need to set up the following repositories and edit this project to work with *your* setup.
If you would like to host the entire LibreCloud frontend and backend, you will also need to setup the following repositories and edit this project to work with *your* setup.
* [mail-connect](https://git.pontusmail.org/librecloud/mail-connect)
* [docker-mailserver](https://github.com/docker-mailserver/docker-mailserver)
@ -103,7 +101,7 @@ A Docker setup requires both Docker *and* Docker Compose.
4. **Generate auth secret**
This step is relatively painless. Execute the below command to generate a `.env.local` file with an `AUTH_SECRET`.
This step is relatively painless. Simply execute the below command to generate a `.env.local` file with an `AUTH_SECRET`.
```bash
bunx auth secret
@ -133,14 +131,11 @@ A Docker setup requires both Docker *and* Docker Compose.
## Environment Variables
At the time of writing, LibreCloud is not in the state of perfection,
and as such we are expecting that you have a setup exact to ours.
While this will change in the future, we still suggest that provide all the listed environment variables.
At the time of writing, LibreCloud is not in the state of perfection, and as such we are expecting that you have a setup exact to ours. While this will change in the future, we still suggest that provide all of the listed environment variables.
### Authentik
We use [Auth.js](https://authjs.dev) to provide authentication for users through Authentik.
To do this, you will need to create a new OAuth2 provider in Authentik and put its configuration in your `.env` file.
We use [Auth.js](https://authjs.dev) to provide authentication for users through Authentik. To do this, you will need to create a new OAuth2 provider in Authentik and put it's configuration in your `.env` file.
If you need more help doing this, there is a fantastic guide [on Authentik's wiki](https://docs.goauthentik.io/docs/add-secure-apps/providers/oauth2/).
@ -154,10 +149,7 @@ If you need more help doing this, there is a fantastic guide [on Authentik's wik
### Gitea
Next, you will need to configure `web` with your Gitea instance.
Create a new access token in your Gitea user settings (),
and input the key you receive, as well as the URL of your instance, and the API URL.
You can find a link to the API and its endpoint URL on the footer.
Next, you will need to configure `web` with your Gitea instance. Create a new access token in your Gitea user settings (), and input the key you receive, as well as the URL of your instance, and the API URL. You can find a link to the API and it's endpoint URL on the footer.
| Environment Variable | Description | Example |
|----------------------|-----------------------------------------------|--------------------------------------------|
@ -171,8 +163,8 @@ mail-connect, another project by LibreCloud, is a bridge from `docker-mailserver
Keep in mind, this endpoint should **NOT** be public, and `web` should be the only authorized user of the API, unless you know what you're doing. There is zero authentication.
| Environment Variable | Description | Example |
|----------------------|------------------------------|-------------------------|
| Environment Variable | Description | Example |
|----------------------|------------------------------|-----------------------|
| MAIL_CONNECT_API_URL | URL of your mail-connect API | `http://localhost:4200` |
### Auth.js
@ -189,4 +181,4 @@ We suggest starting by allowing Auth.js
* [X] Add documentation on .env
* [ ] Implement security scans
* [ ] Rate-limiting on API
* [ ] Ratelimiting on API