chore: rename pages -> librepages

This commit is contained in:
Aravinth Manivannan 2022-12-19 06:32:51 +05:30
parent 0f44135f73
commit 7f58f58651
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
10 changed files with 79 additions and 82 deletions

86
Cargo.lock generated
View file

@ -1426,6 +1426,49 @@ dependencies = [
"pkg-config", "pkg-config",
] ]
[[package]]
name = "librepages"
version = "0.1.0"
dependencies = [
"actix-auth-middleware",
"actix-http",
"actix-identity",
"actix-rt",
"actix-web",
"actix-web-codegen-const-routes",
"argon2-creds",
"cache-buster",
"clap",
"config",
"derive_more",
"futures",
"git2",
"lazy_static",
"libconductor",
"libconfig",
"mime",
"mime_guess",
"mktemp",
"num_cpus",
"num_enum",
"pretty_env_logger",
"rand",
"reqwest",
"rust-embed",
"serde",
"serde_json",
"serde_yaml",
"sqlx",
"tera",
"tokio",
"toml",
"tracing",
"tracing-actix-web",
"url",
"urlencoding",
"uuid 1.2.2",
]
[[package]] [[package]]
name = "libssh2-sys" name = "libssh2-sys"
version = "0.2.23" version = "0.2.23"
@ -1741,49 +1784,6 @@ version = "6.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
[[package]]
name = "pages"
version = "0.1.0"
dependencies = [
"actix-auth-middleware",
"actix-http",
"actix-identity",
"actix-rt",
"actix-web",
"actix-web-codegen-const-routes",
"argon2-creds",
"cache-buster",
"clap",
"config",
"derive_more",
"futures",
"git2",
"lazy_static",
"libconductor",
"libconfig",
"mime",
"mime_guess",
"mktemp",
"num_cpus",
"num_enum",
"pretty_env_logger",
"rand",
"reqwest",
"rust-embed",
"serde",
"serde_json",
"serde_yaml",
"sqlx",
"tera",
"tokio",
"toml",
"tracing",
"tracing-actix-web",
"url",
"urlencoding",
"uuid 1.2.2",
]
[[package]] [[package]]
name = "parking_lot" name = "parking_lot"
version = "0.11.2" version = "0.11.2"

View file

@ -1,12 +1,12 @@
[package] [package]
name = "pages" name = "librepages"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
build = "build.rs" build = "build.rs"
homepage = "https://github.com/realaravinth/pages" homepage = "https://git.batsense.net/LibrePages/librepages"
repository = "https://github.com/realaravinth/pages" repository = "https://git.batsense.net/LibrePages/librepages"
documentation = "https://github.con/realaravinth/pages" documentation = "https://git.batsense.net/LibrePages/librepages"
readme = "https://github.com/realaravinth/pages/blob/master/README.md" readme = "https://git.batsense.net/LibrePages/librepages/blob/master/README.md"
license = "AGPLv3 or later version" license = "AGPLv3 or later version"
authors = ["realaravinth <realaravinth@batsense.net>"] authors = ["realaravinth <realaravinth@batsense.net>"]

View file

@ -19,11 +19,11 @@ RUN cd utils/cache-bust && cargo run
RUN cargo build --release RUN cargo build --release
FROM debian:bullseye-slim FROM debian:bullseye-slim
#RUN useradd -ms /bin/bash -u 1000 pages #RUN useradd -ms /bin/bash -u 1000 librepages
#RUN mkdir -p /var/www/pages && chown pages /var/www/pages #RUN mkdir -p /var/www/librepages && chown librepages /var/www/librepages
RUN apt-get update && apt-get install -y ca-certificates RUN apt-get update && apt-get install -y ca-certificates
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh
COPY --from=rust /src/target/release/pages /usr/local/bin/ COPY --from=rust /src/target/release/librepages /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View file

@ -31,14 +31,14 @@ doc: ## Prepare documentation
docker: ## Build docker images docker: ## Build docker images
docker build \ docker build \
-t realaravinth/pages:master \ -t realaravinth/librepages:master \
-t realaravinth/pages:latest \ -t realaravinth/librepages:latest \
-t realaravinth/pages:0.1.0 . -t realaravinth/librepages:0.1.0 .
docker-publish: docker ## Build and publish docker images docker-publish: docker ## Build and publish docker images
docker push realaravinth/pages:master docker push realaravinth/librepages:master
docker push realaravinth/pages:latest docker push realaravinth/librepages:latest
docker push realaravinth/pages:0.1.0 docker push realaravinth/librepages:0.1.0
lint: ## Lint codebase lint: ## Lint codebase
cargo fmt -v --all -- --emit files cargo fmt -v --all -- --emit files

View file

@ -6,9 +6,6 @@
</p> </p>
[![Build](https://github.com/realaravinth/pages/actions/workflows/linux.yml/badge.svg)](https://github.com/realaravinth/pages/actions/workflows/linux.yml)
[![dependency status](https://deps.rs/repo/github/realaravinth/pages/status.svg)](https://deps.rs/repo/github/realaravinth/pages)
[![codecov](https://codecov.io/gh/realaravinth/pages/branch/master/graph/badge.svg)](https://codecov.io/gh/realaravinth/pages)
</div> </div>

View file

@ -1,7 +1,7 @@
debug = true debug = true
allow_registration = true allow_registration = true
# source code of your copy of pages server. # source code of your copy of pages server.
source_code = "https://github.com/realaravinth/pages" source_code = "https://git.batsense.net/LibrePages/pages"
support_email = "support@librepages.example.org" support_email = "support@librepages.example.org"
conductors = [ conductors = [
{ username = "librepages_api", api_key = "longrandomlygeneratedpassword", url = "http://localhost:5000"} { username = "librepages_api", api_key = "longrandomlygeneratedpassword", url = "http://localhost:5000"}

View file

@ -3,10 +3,10 @@
The process is tedious, most of this will be automated with a script in The process is tedious, most of this will be automated with a script in
the future. the future.
## 1. Create new user for running `pages`: ## 1. Create new user for running `librepages`:
```bash ```bash
sudo useradd -b /srv -m -s /usr/bin/zsh pages sudo useradd -b /srv -m -s /usr/bin/zsh librepages
``` ```
## 2. Install Runtime dependencies ## 2. Install Runtime dependencies
@ -19,11 +19,11 @@ On Debian-based systems, run:
sudo apt install nginx sudo apt install nginx
``` ```
## 3. Build `Pages` ## 3. Build `librepages`
### i. Install Build Dependencies ### i. Install Build Dependencies
To build `pages`, you need the following dependencies: To build `librepages`, you need the following dependencies:
1. [Git](https://packages.debian.org/bullseye/git) 1. [Git](https://packages.debian.org/bullseye/git)
2. [pkg-config](https://packages.debian.org/bullseye/pkg-config) 2. [pkg-config](https://packages.debian.org/bullseye/pkg-config)
@ -71,23 +71,23 @@ Install binary and copy demo configuration file into default configuration
lookup path(`/etc/static-pages/config.toml`) lookup path(`/etc/static-pages/config.toml`)
```bash ```bash
sudo cp ./target/release/pages /usr/local/bin/ && \ sudo cp ./target/release/librepages /usr/local/bin/ && \
sudo mkdir /etc/static-pages && \ sudo mkdir /etc/static-pages && \
sudo cp config/default.toml /etc/static-pages/config.toml sudo cp config/default.toml /etc/static-pages/config.toml
``` ```
## 4. Systemd service configuration: ## 4. Systemd service configuration:
### i. Copy the following to `/etc/systemd/system/pages.service`: ### i. Copy the following to `/etc/systemd/system/librepages.service`:
```systemd ```systemd
[Unit] [Unit]
Description=pages: Auto-deploy static websites from git repositories Description=librepages: Auto-deploy static websites from git repositories
[Service] [Service]
Type=simple Type=simple
User=pages User=librepages
ExecStart=/usr/local/bin/pages ExecStart=/usr/local/bin/librepages
Restart=on-failure Restart=on-failure
RestartSec=1 RestartSec=1
MemoryDenyWriteExecute=true MemoryDenyWriteExecute=true
@ -107,13 +107,13 @@ WantedBy=multi-user.target
```bash ```bash
sudo systemctl daemon-reload && \ sudo systemctl daemon-reload && \
sudo systemctl enable pages && \ # Auto startup during boot sudo systemctl enable librepages && \ # Auto startup during boot
sudo systemctl start pages sudo systemctl start librepages
``` ```
## 5. Optionally configure Nginx to reverse proxy requests to Pages ## 5. Optionally configure Nginx to reverse proxy requests to LibrePages
**NOTE: This sections includes instructions to reverse proxy requests to **NOTE: This sections includes instructions to reverse proxy requests to
Pages API, not the websites managed by Pages.** LibrePages API, not the websites managed by librepages.**
See [here](../../config/pages-nginx-config) for sample Nginx configuration. See [here](../../config/librepages-nginx-config) for sample Nginx configuration.

View file

@ -15,4 +15,4 @@ else
useradd --uid $USER_ID -b /home -m -s /bin/bash $LIBREPAGES_USER useradd --uid $USER_ID -b /home -m -s /bin/bash $LIBREPAGES_USER
fi fi
su $LIBREPAGES_USER -c 'pages' su $LIBREPAGES_USER -c 'librepages'

View file

@ -1,11 +1,11 @@
[package] [package]
name = "pages" name = "librepages"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
homepage = "https://github.com/realaravinth/pages" homepage = "https://git.batsense.net/LibrePages/librepages"
repository = "https://github.com/realaravinth/pages" repository = "https://git.batsense.net/LibrePages/librepages"
documentation = "https://github.con/realaravinth/pages" documentation = "https://github.con/realaravinth/librepages"
readme = "https://github.com/realaravinth/pages/blob/master/README.md" readme = "https://git.batsense.net/LibrePages/librepages/blob/master/README.md"
license = "AGPLv3 or later version" license = "AGPLv3 or later version"
authors = ["realaravinth <realaravinth@batsense.net>"] authors = ["realaravinth <realaravinth@batsense.net>"]
@ -14,6 +14,6 @@ authors = ["realaravinth <realaravinth@batsense.net>"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
cache-buster = { version = "0.2.0", git = "https://github.com/realaravinth/cache-buster" } cache-buster = { version = "0.2.0", git = "https://git.batsense.net/LibrePages/cache-buster" }
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"