Skip to content

Commit

Permalink
chore: rename estkme-rlpa-server to estkme-cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
damonto committed Apr 4, 2024
1 parent 7e03245 commit e48da45
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 53 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:
- name: Build for ${{ matrix.target.name }}
run: |
VERSION=$(git describe --always --tags --match "v*" --dirty="-dev")
CGO_ENABLED=0 GOOS=${{ matrix.target.os }} GOARCH=${{ matrix.target.arch }} go build -trimpath -ldflags="-w -s -X main.Version=${VERSION}" -o estkme-rlpa-server-${{ matrix.target.os }}-${{ matrix.target.arch }}
CGO_ENABLED=0 GOOS=${{ matrix.target.os }} GOARCH=${{ matrix.target.arch }} go build -trimpath -ldflags="-w -s -X main.Version=${VERSION}" -o estkme-cloud-${{ matrix.target.os }}-${{ matrix.target.arch }}
- name: Upload ${{ matrix.target.name }} to Artifact
uses: actions/upload-artifact@v4
with:
name: estkme-rlpa-server-${{ matrix.target.os }}-${{ matrix.target.arch }}
path: estkme-rlpa-server-${{ matrix.target.os }}-${{ matrix.target.arch }}
name: estkme-cloud-${{ matrix.target.os }}-${{ matrix.target.arch }}
path: estkme-cloud-${{ matrix.target.os }}-${{ matrix.target.arch }}

release:
name: Release
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository_owner }}/estkme-rlpa-server
ghcr.io/${{ github.repository_owner }}/estkme-rlpa-server
${{ github.repository_owner }}/estkme-cloud
ghcr.io/${{ github.repository_owner }}/estkme-cloud
tags: |
type=schedule
type=ref,event=branch
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ COPY . .
ARG VERSION

RUN set -ex \
&& CGO_ENABLED=0 go build -trimpath -ldflags="-w -s -X main.Version=${VERSION}" -o estkme-rlpa-server main.go
&& CGO_ENABLED=0 go build -trimpath -ldflags="-w -s -X main.Version=${VERSION}" -o estkme-cloud main.go

FROM alpine:latest

WORKDIR /app

COPY --from=builder /app/estkme-rlpa-server /app/estkme-rlpa-server
COPY --from=builder /app/estkme-cloud /app/estkme-cloud

RUN set -ex \
&& apk add --no-cache gcompat ca-certificates pcsc-lite-libs libcurl \
&& update-ca-certificates \
&& chmod +x /app/estkme-rlpa-server
&& chmod +x /app/estkme-cloud

EXPOSE 1888

CMD ["/app/estkme-rlpa-server"]
CMD ["/app/estkme-cloud"]
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# eSTK.me rLPA Server
# eSTK.me Cloud Enhance Server

### Introduction

This is a simple server designed to handle requests from the eSTK.me removable eUICC, such as downloads and notifications.

The project is written in Go and is just a toy project, not suitable for production use.

If you want to deploy your own eSTK.me rLPA server, I recommend you to use the [official eSTK.me rLPA server](https://github.com/estkme-group/lpac/blob/main/src/rlpa-server.php) instead.
If you want to deploy your own eSTK.me Cloud Enhance server, I recommend you to use the [official eSTK.me Cloud Enhance server](https://github.com/estkme-group/lpac/blob/main/src/rlpa-server.php) instead.

### Installation

You can download the binary release from the [releases page](https://github.com/damonto/estkme-rlpa-server/releases) or you can build it yourself.
You can download the binary release from the [releases page](https://github.com/damonto/estkme-cloud/releases) or you can build it yourself.

If you want to build it yourself, you can run the following commands:
```bash
git clone git@github.com:damonto/estkme-rlpa-server.git
cd estkme-rlpa-server
go build -trimpath -ldflags="-w -s" -o estkme-rlpa-server main.go
git clone git@github.com:damonto/estkme-cloud.git
cd estkme-cloud
go build -trimpath -ldflags="-w -s" -o estkme-cloud main.go
```

You can also install the latest version using the following command:

```bash
go install github.com/damonto/estkme-rlpa-server@latest
go install github.com/damonto/estkme-cloud@latest
```

Sometimes, you might need to set executable permissions for the binary file using the following command:

```bash
chmod +x estkme-rlpa-server
chmod +x estkme-cloud
```

You must also install the following dependencies:
Expand All @@ -43,19 +43,19 @@ pacman -S pcsclite
Once done, you can run the server using the following command:

```bash
./estkme-rlpa-server
./estkme-cloud
```

If you want to change the default port, lpac version or data directory, you can use the following flags:

```plaintext
./estkme-rlpa-server --help
./estkme-cloud --help
Usage of estkme-rlpa-server:
Usage of estkme-cloud:
-data-dir string
data directory (default "/home/user/workspace/estkme-rlpa-server/data")
data directory (default "/home/user/workspace/estkme-cloud/data")
-listen-address string
eSTK.me rlpa server listen address (default ":1888")
eSTK.me cloud enhance server listen address (default ":1888")
-lpac-version string
lpac version (default "v2.0.0-beta.1")
-dont-download
Expand All @@ -64,18 +64,18 @@ Usage of estkme-rlpa-server:

If you wish to run the program in the background, you can utilize the systemctl command. Here is an example of how to achieve this:

1. Start by creating a service file in the /etc/systemd/system directory. For instance, you can name the file estkme-rlpa-server.service and include the following content:
1. Start by creating a service file in the /etc/systemd/system directory. For instance, you can name the file estkme-cloud.service and include the following content:

```plaintext
[Unit]
Description=eSTK.me rLPA Server
Description=eSTK.me Cloud Enhance Server
After=network.target
[Service]
Type=simple
User=your_user_here
Restart=on-failure
ExecStart=/your/binary/path/here/estkme-rlpa-server
ExecStart=/your/binary/path/here/estkme-cloud
RestartSec=10s
TimeoutStopSec=30s
Expand All @@ -85,23 +85,23 @@ WantedBy=multi-user.target
2. Then, use the following command to start the service:

```bash
systemctl start estkme-rlpa-server
systemctl start estkme-cloud
```

3. If you want the service to start automatically upon system boot, use the following command:

```bash
systemctl enable estkme-rlpa-server
systemctl enable estkme-cloud
```

#### Docker

You can also run the server using Docker. You can use the following command to run the server:

```bash
docker run -d --name estkme-rlpa-server -p 1888:1888 damonto/estkme-rlpa-server:latest
docker run -d --name estkme-cloud -p 1888:1888 damonto/estkme-cloud:latest
# or use the GitHub Container Registry
docker run -d --name estkme-rlpa-server -p 1888:1888 -v ghcr.io/damonto/estkme-rlpa-server:latest
docker run -d --name estkme-cloud -p 1888:1888 -v ghcr.io/damonto/estkme-cloud:latest
```

### Usage
Expand All @@ -110,7 +110,7 @@ Once the server is running, the server will listen on the specified port (defaul

#### Download

To download a profile, you should enable the `Remote LPA` feature on the eUICC and set the server listening address to the server address. The server will handle the download request and download the profile to the eUICC.
To download a profile, you should enable the `Cloud Enhance` feature on the eUICC and set the server listening address to the server address. The server will handle the download request and download the profile to the eUICC.

The server support downloading profiles with confirmation code and custom IMEI.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/damonto/estkme-rlpa-server
module github.com/damonto/estkme-cloud

go 1.22.1
4 changes: 2 additions & 2 deletions internal/rlpa/apdu.go → internal/cloud/apdu.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package rlpa
package cloud

import (
"encoding/hex"
"sync"

"github.com/damonto/estkme-rlpa-server/internal/driver"
"github.com/damonto/estkme-cloud/internal/driver"
)

type apdu struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/rlpa/conn.go → internal/cloud/conn.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rlpa
package cloud

import (
"encoding/binary"
Expand All @@ -8,7 +8,7 @@ import (
"net"
"sync"

"github.com/damonto/estkme-rlpa-server/internal/driver"
"github.com/damonto/estkme-cloud/internal/driver"
)

type Handler = func(conn *Conn, data []byte) error
Expand Down
2 changes: 1 addition & 1 deletion internal/rlpa/constants.go → internal/cloud/constants.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rlpa
package cloud

const (
TagMessageBox = 0x00
Expand Down
4 changes: 2 additions & 2 deletions internal/rlpa/download.go → internal/cloud/download.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package rlpa
package cloud

import (
"bytes"
"errors"

"github.com/damonto/estkme-rlpa-server/internal/lpac"
"github.com/damonto/estkme-cloud/internal/lpac"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/rlpa/manager.go → internal/cloud/manager.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rlpa
package cloud

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package rlpa
package cloud

import (
"fmt"
"log/slog"

"github.com/damonto/estkme-rlpa-server/internal/lpac"
"github.com/damonto/estkme-cloud/internal/lpac"
)

func processNotification(conn *Conn) error {
Expand Down
4 changes: 2 additions & 2 deletions internal/rlpa/server.go → internal/cloud/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rlpa
package cloud

import (
"encoding/hex"
Expand Down Expand Up @@ -34,7 +34,7 @@ func (s *server) Listen(address string) error {
if err != nil {
return err
}
slog.Info("eSTK.me rlpa server is running on", "address", address)
slog.Info("eSTK.me cloud enhance server is running on", "address", address)

for {
conn, err := s.listener.AcceptTCP()
Expand Down
2 changes: 1 addition & 1 deletion internal/rlpa/util.go → internal/cloud/util.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rlpa
package cloud

import "unicode"

Expand Down
4 changes: 2 additions & 2 deletions internal/lpac/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"path/filepath"
"runtime"

"github.com/damonto/estkme-rlpa-server/internal/config"
"github.com/damonto/estkme-rlpa-server/internal/driver"
"github.com/damonto/estkme-cloud/internal/config"
"github.com/damonto/estkme-cloud/internal/driver"
)

type Cmder struct {
Expand Down
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ import (
"os/signal"
"path/filepath"

"github.com/damonto/estkme-rlpa-server/internal/config"
"github.com/damonto/estkme-rlpa-server/internal/lpac"
"github.com/damonto/estkme-rlpa-server/internal/rlpa"
"github.com/damonto/estkme-cloud/internal/cloud"
"github.com/damonto/estkme-cloud/internal/config"
"github.com/damonto/estkme-cloud/internal/lpac"
)

var Version string

func init() {
cwd, _ := os.Getwd()
flag.StringVar(&config.C.ListenAddress, "listen-address", ":1888", "eSTK.me rLPA server listen address")
flag.StringVar(&config.C.ListenAddress, "listen-address", ":1888", "eSTK.me cloud enhance server listen address")
flag.StringVar(&config.C.DataDir, "data-dir", filepath.Join(cwd, "data"), "data directory")
flag.StringVar(&config.C.LpacVersion, "lpac-version", "v2.0.0", "lpac version")
flag.BoolVar(&config.C.DontDownload, "dont-download", false, "don't download lpac")
flag.Parse()
}

func main() {
slog.Info("eSTK.me rlpa server", "version", Version)
slog.Info("eSTK.me cloud enhance server", "version", Version)
config.C.LoadEnv()
if err := config.C.IsValid(); err != nil {
slog.Error("invalid configuration", "error", err)
Expand All @@ -38,8 +38,8 @@ func main() {
}
}

manager := rlpa.NewManager()
server := rlpa.NewServer(manager)
manager := cloud.NewManager()
server := cloud.NewServer(manager)

go func() {
if err := server.Listen(config.C.ListenAddress); err != nil {
Expand Down

0 comments on commit e48da45

Please sign in to comment.