Skip to content

Commit

Permalink
Upgrade squid2radius for python3.
Browse files Browse the repository at this point in the history
  • Loading branch information
MirageTurtle committed Jun 1, 2024
1 parent f24d9bd commit eee0505
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .docker/build
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ set -x
set -e

build_squid2radius(){
apk add python2 py-pip ca-certificates openssl
apk add python3 py-pip ca-certificates openssl
pip install pyrad==2.1 hurry.filesize==0.9
cd /opt
wget -O- https://github.com/billzhong/squidlog/archive/f1dcaef70eb2aa21253682b1d9c754da784e473b.tar.gz | tar -xzf -
mv squidlog-* squid2radius
wget -O- https://github.com/MirageTurtle/squid2radius/archive/e4443e444082f70789f4ac2f0b8e583d741c7bcf.tar.gz | tar -xzf -
mv squid2radius-* squid2radius
}

apk update
Expand Down
2 changes: 1 addition & 1 deletion .docker/rootfs/etc/periodic/hourly/squid2radius
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd /opt/squid2radius
python2 squid2radius.py /var/log/squid/access.log {{RADIUS_SERVER}} {{RADIUS_SECRET}}
python3 squid2radius-py3.py /var/log/squid/access.log {{RADIUS_SERVER}} {{RADIUS_SECRET}}
cd /var/log/squid/
if [[ -f access.log.23 ]]; then
seq 23 -1 0 | xargs -I {} cat access.log.{} > archive_access.log
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM alpine:3.15 AS builder
FROM alpine:3.16 AS builder
COPY ./squid-preload.c /tmp/squid-preload.c
RUN apk add --no-cache gcc musl-dev && \
gcc -fPIC -O3 -shared -Wl,-export-dynamic -o /tmp/squid-preload.so /tmp/squid-preload.c -lc

FROM smartentry/alpine:3.15
FROM smartentry/alpine:3.16

MAINTAINER Yifan Gao <[email protected]>

Expand Down

0 comments on commit eee0505

Please sign in to comment.