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",
]
[[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]]
name = "libssh2-sys"
version = "0.2.23"
@ -1741,49 +1784,6 @@ version = "6.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
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]]
name = "parking_lot"
version = "0.11.2"

View file

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

View file

@ -19,11 +19,11 @@ RUN cd utils/cache-bust && cargo run
RUN cargo build --release
FROM debian:bullseye-slim
#RUN useradd -ms /bin/bash -u 1000 pages
#RUN mkdir -p /var/www/pages && chown pages /var/www/pages
#RUN useradd -ms /bin/bash -u 1000 librepages
#RUN mkdir -p /var/www/librepages && chown librepages /var/www/librepages
RUN apt-get update && apt-get install -y ca-certificates
COPY scripts/entrypoint.sh /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"]

View file

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

View file

@ -6,9 +6,6 @@
</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>

View file

@ -1,7 +1,7 @@
debug = true
allow_registration = true
# 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"
conductors = [
{ 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 future.
## 1. Create new user for running `pages`:
## 1. Create new user for running `librepages`:
```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
@ -19,11 +19,11 @@ On Debian-based systems, run:
sudo apt install nginx
```
## 3. Build `Pages`
## 3. Build `librepages`
### 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)
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`)
```bash
sudo cp ./target/release/pages /usr/local/bin/ && \
sudo cp ./target/release/librepages /usr/local/bin/ && \
sudo mkdir /etc/static-pages && \
sudo cp config/default.toml /etc/static-pages/config.toml
```
## 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
[Unit]
Description=pages: Auto-deploy static websites from git repositories
Description=librepages: Auto-deploy static websites from git repositories
[Service]
Type=simple
User=pages
ExecStart=/usr/local/bin/pages
User=librepages
ExecStart=/usr/local/bin/librepages
Restart=on-failure
RestartSec=1
MemoryDenyWriteExecute=true
@ -107,13 +107,13 @@ WantedBy=multi-user.target
```bash
sudo systemctl daemon-reload && \
sudo systemctl enable pages && \ # Auto startup during boot
sudo systemctl start pages
sudo systemctl enable librepages && \ # Auto startup during boot
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
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
fi
su $LIBREPAGES_USER -c 'pages'
su $LIBREPAGES_USER -c 'librepages'

View file

@ -1,11 +1,11 @@
[package]
name = "pages"
name = "librepages"
version = "0.1.0"
edition = "2021"
homepage = "https://github.com/realaravinth/pages"
repository = "https://github.com/realaravinth/pages"
documentation = "https://github.con/realaravinth/pages"
readme = "https://github.com/realaravinth/pages/blob/master/README.md"
homepage = "https://git.batsense.net/LibrePages/librepages"
repository = "https://git.batsense.net/LibrePages/librepages"
documentation = "https://github.con/realaravinth/librepages"
readme = "https://git.batsense.net/LibrePages/librepages/blob/master/README.md"
license = "AGPLv3 or later version"
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
[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_json = "1"