Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
a394df6210
|
|||
7cc249aac6 | |||
543e3fce31 |
28
.gitea/workflows/docker.yml
Normal file
28
.gitea/workflows/docker.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
name: Build docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: git.matterlinux.xyz
|
||||||
|
IMAGE: ${{gitea.repository}}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: "https://github.com/actions/checkout@v4"
|
||||||
|
|
||||||
|
- name: Login to container repo
|
||||||
|
uses: "https://github.com/docker/login-action@v1"
|
||||||
|
with:
|
||||||
|
registry: ${{env.REGISTRY}}
|
||||||
|
username: ${{gitea.actor}}
|
||||||
|
password: ${{secrets.PACKAGES_TOKEN}}
|
||||||
|
|
||||||
|
- name: Build image
|
||||||
|
run: |
|
||||||
|
docker build --tag ${{env.REGISTRY}}/${{env.IMAGE}}:latest .
|
||||||
|
docker push ${{env.REGISTRY}}/${{env.IMAGE}}:latest
|
@ -1,4 +1,4 @@
|
|||||||
FROM libmp as build
|
FROM git.matterlinux.xyz/matter/libmp as build
|
||||||
|
|
||||||
RUN apt update
|
RUN apt update
|
||||||
RUN apt install -y make gcc gettext libinih-dev libsqlite3-dev libarchive-dev
|
RUN apt install -y make gcc gettext libinih-dev libsqlite3-dev libarchive-dev
|
||||||
@ -13,7 +13,7 @@ COPY ./src ./src
|
|||||||
RUN make
|
RUN make
|
||||||
RUN make install
|
RUN make install
|
||||||
|
|
||||||
FROM libmp as main
|
FROM git.matterlinux.xyz/matter/libmp as main
|
||||||
|
|
||||||
RUN apt update
|
RUN apt update
|
||||||
RUN apt install -y dumb-init
|
RUN apt install -y dumb-init
|
||||||
@ -26,4 +26,9 @@ COPY --from=build /usr/share/locale/tr/LC_MESSAGES/pooler.mo /usr/share/locale/t
|
|||||||
COPY --from=build /etc/pooler/config.ini /etc/pooler/config.ini
|
COPY --from=build /etc/pooler/config.ini /etc/pooler/config.ini
|
||||||
COPY --from=build /usr/bin/pooler /usr/bin/pooler
|
COPY --from=build /usr/bin/pooler /usr/bin/pooler
|
||||||
|
|
||||||
|
RUN useradd runner -r -u 1001
|
||||||
|
RUN chown -R runner:runner /var/lib/pooler
|
||||||
|
RUN chown -R runner:runner /etc/pooler
|
||||||
|
USER runner
|
||||||
|
|
||||||
ENTRYPOINT ["dumb-init", "/usr/bin/pooler", "/etc/pooler/config.ini"]
|
ENTRYPOINT ["dumb-init", "/usr/bin/pooler", "/etc/pooler/config.ini"]
|
||||||
|
6
Makefile
6
Makefile
@ -11,7 +11,7 @@ HDRS = $(wildcard include/*.h)
|
|||||||
CFLAGS = -O3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection
|
CFLAGS = -O3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection
|
||||||
LIBS = -linih -lmp
|
LIBS = -linih -lmp
|
||||||
|
|
||||||
VERSION = 24.01
|
VERSION = 24.03
|
||||||
|
|
||||||
all: dist dist/pooler $(PO_OUTS)
|
all: dist dist/pooler $(PO_OUTS)
|
||||||
|
|
||||||
@ -43,8 +43,8 @@ locale/pooler.pot: $(SRCS)
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
install -d -m700 $(DESTDIR)/etc/pooler
|
install -d -m700 $(DESTDIR)/etc/pooler
|
||||||
install -m755 dist/pooler $(DESTDIR)/$(PREFIX)/bin/pooler
|
install -Dm755 dist/pooler $(DESTDIR)/$(PREFIX)/bin/pooler
|
||||||
install -m600 install/config.ini $(DESTDIR)/etc/pooler/config.ini
|
install -Dm600 install/config.ini $(DESTDIR)/etc/pooler/config.ini
|
||||||
@for po in $(PO_DIRS) ; do \
|
@for po in $(PO_DIRS) ; do \
|
||||||
echo "installing locale: $$po/pooler.mo" ; \
|
echo "installing locale: $$po/pooler.mo" ; \
|
||||||
mkdir -pv $(DESTDIR)/$(PREFIX)/share/$$po ; \
|
mkdir -pv $(DESTDIR)/$(PREFIX)/share/$$po ; \
|
||||||
|
17
README.md
17
README.md
@ -1,4 +1,7 @@
|
|||||||
# pooler | MatterLinux pool server
|
# pooler | MatterLinux pool server
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
Simple MPTP server implementation for serving MatterLinux package pools.
|
Simple MPTP server implementation for serving MatterLinux package pools.
|
||||||
Built on top of [`libmp`](https://git.matterlinux.xyz/Matter/libmp).
|
Built on top of [`libmp`](https://git.matterlinux.xyz/Matter/libmp).
|
||||||
|
|
||||||
@ -18,8 +21,7 @@ After installing these dependencies, you should download the latest release.
|
|||||||
If you are building this program for development purposes, then you may also
|
If you are building this program for development purposes, then you may also
|
||||||
build from the latest commit. However latest commit may not always be compilable.
|
build from the latest commit. However latest commit may not always be compilable.
|
||||||
|
|
||||||
After obtaining the source code, you can compile the program using the make
|
After obtaining the source code, you can compile the program using the make tool:
|
||||||
tool:
|
|
||||||
```bash
|
```bash
|
||||||
make
|
make
|
||||||
```
|
```
|
||||||
@ -36,17 +38,14 @@ docker build --tag pooler .
|
|||||||
|
|
||||||
And for deployment you can use docker-compose, here is an example configuration:
|
And for deployment you can use docker-compose, here is an example configuration:
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
pooler:
|
pooler:
|
||||||
image: pooler
|
container_name: pooler
|
||||||
build:
|
image: git.matterlinux.xyz/matter/pooler
|
||||||
context: ./
|
|
||||||
ports:
|
ports:
|
||||||
- "5858:5858/tcp"
|
- "5858:5858/tcp"
|
||||||
volumes:
|
volumes:
|
||||||
- "./config.ini:/etc/pooler/config.ini"
|
- "./config.ini:/etc/pooler/config.ini"
|
||||||
```
|
```
|
||||||
Just make sure you read the compose file and place the configuration file and the pools
|
Just make sure you read the compose file and place the configuration file and the pools
|
||||||
to the right place:
|
to the right place:
|
||||||
|
@ -8,7 +8,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-08-18 04:11+0300\n"
|
"POT-Creation-Date: 2024-08-25 14:08+0300\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@ -109,51 +109,50 @@ msgstr "Lütfen geçerli bir işlem sayısı belirtin (1-1000)"
|
|||||||
msgid "Please specify at least one pool in the configuration"
|
msgid "Please specify at least one pool in the configuration"
|
||||||
msgstr "Lütfen konfigürasyonda en az bir havuz belirtin"
|
msgstr "Lütfen konfigürasyonda en az bir havuz belirtin"
|
||||||
|
|
||||||
#: src/main.c:147
|
#: src/main.c:148
|
||||||
#, fuzzy, c-format
|
|
||||||
msgid "%s: loading the pool"
|
|
||||||
msgstr "%s: havuz bilgisi başarıyla yüklendi"
|
|
||||||
|
|
||||||
#: src/main.c:150
|
|
||||||
#, fuzzy, c-format
|
#, fuzzy, c-format
|
||||||
msgid "%s: hostname not specified for pool, skipping"
|
msgid "%s: hostname not specified for pool, skipping"
|
||||||
msgstr "Ana makine adı havuz konfigürasyonunda belirtilmedi, geçiliyor: %s"
|
msgstr "Ana makine adı havuz konfigürasyonunda belirtilmedi, geçiliyor: %s"
|
||||||
|
|
||||||
#: src/main.c:164
|
#: src/main.c:162
|
||||||
#, fuzzy, c-format
|
#, fuzzy, c-format
|
||||||
msgid "%s: failed access the pool directory (%s)"
|
msgid "%s: failed access the pool directory (%s)"
|
||||||
msgstr "Havuz dizinine erişilemiyor: %s"
|
msgstr "Havuz dizinine erişilemiyor: %s"
|
||||||
|
|
||||||
#: src/main.c:169
|
#: src/main.c:167
|
||||||
#, fuzzy, c-format
|
#, fuzzy, c-format
|
||||||
msgid "%s: failed to add pool to the list (%s)"
|
msgid "%s: failed to add pool to the list (%s)"
|
||||||
msgstr "Havuzu listeye eklemek başarısız oldu: %s"
|
msgstr "Havuzu listeye eklemek başarısız oldu: %s"
|
||||||
|
|
||||||
#: src/main.c:177
|
#: src/main.c:175
|
||||||
#, c-format
|
#, fuzzy
|
||||||
msgid "Failed to sync the pools: %s"
|
msgid "Failed to sync the pools, please see the errors above"
|
||||||
msgstr "Havuzları sekronize etmek başarısız oldu: %s"
|
msgstr "Havuzları sekronize etmek başarısız oldu: %s"
|
||||||
|
|
||||||
#: src/main.c:182
|
#: src/main.c:180
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid "None of the pools is available for serving"
|
msgid "None of the pools is available for serving"
|
||||||
msgstr "Havuzların hiçbiri sunmak için müsait değil"
|
msgstr "Havuzların hiçbiri sunmak için müsait değil"
|
||||||
|
|
||||||
#: src/main.c:186
|
#: src/main.c:184
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Serving %lu pool on %s"
|
msgid "Serving %lu pool on %s"
|
||||||
msgstr "%lu tane havuz %s adresinde sunuluyor"
|
msgstr "%lu tane havuz %s adresinde sunuluyor"
|
||||||
|
|
||||||
#: src/main.c:186
|
#: src/main.c:184
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Serving %lu pools on %s"
|
msgid "Serving %lu pools on %s"
|
||||||
msgstr "%lu tane havuz %s adresinde sunuluyor"
|
msgstr "%lu tane havuz %s adresinde sunuluyor"
|
||||||
|
|
||||||
#: src/main.c:189
|
#: src/main.c:187
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Failed to start the server: %s"
|
msgid "Failed to start the server: %s"
|
||||||
msgstr "Sunucuyu başlatmak başarısız oldu: %s"
|
msgstr "Sunucuyu başlatmak başarısız oldu: %s"
|
||||||
|
|
||||||
|
#, fuzzy, c-format
|
||||||
|
#~ msgid "%s: loading the pool"
|
||||||
|
#~ msgstr "%s: havuz bilgisi başarıyla yüklendi"
|
||||||
|
|
||||||
#, fuzzy, c-format
|
#, fuzzy, c-format
|
||||||
#~ msgid "%s: loaded the pool"
|
#~ msgid "%s: loaded the pool"
|
||||||
#~ msgstr "%s: havuz bilgisi başarıyla yüklendi"
|
#~ msgstr "%s: havuz bilgisi başarıyla yüklendi"
|
||||||
|
@ -117,7 +117,7 @@ int main(int argc, char *argv[]) {
|
|||||||
char *addr = NULL, *logfile = NULL, *tmpdir = NULL;
|
char *addr = NULL, *logfile = NULL, *tmpdir = NULL;
|
||||||
int ret = EXIT_FAILURE;
|
int ret = EXIT_FAILURE;
|
||||||
pool_config_t *pool = NULL;
|
pool_config_t *pool = NULL;
|
||||||
size_t pool_count = 0;
|
ssize_t pool_count = 0;
|
||||||
lm_ctx_t ctx;
|
lm_ctx_t ctx;
|
||||||
|
|
||||||
if (!config_load(argv[1]))
|
if (!config_load(argv[1]))
|
||||||
@ -144,8 +144,6 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (NULL != pool) {
|
while (NULL != pool) {
|
||||||
info(_("%s: loading the pool"), pool->name);
|
|
||||||
|
|
||||||
if (NULL == pool->host) {
|
if (NULL == pool->host) {
|
||||||
error(_("%s: hostname not specified for pool, skipping"), pool->name);
|
error(_("%s: hostname not specified for pool, skipping"), pool->name);
|
||||||
goto end_ctx;
|
goto end_ctx;
|
||||||
@ -174,7 +172,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((pool_count = lm_ctx_sync(&ctx, false, sync_callback, NULL)) < 0) {
|
if ((pool_count = lm_ctx_sync(&ctx, false, sync_callback, NULL)) < 0) {
|
||||||
error(_("Failed to sync the pools: %s"), lm_strerror());
|
error(_("Failed to sync the pools, please see the errors above"));
|
||||||
goto end_ctx;
|
goto end_ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user