Skip to content

Commit 9a22ddd

Browse files
author
Cihad Kocasahan
committed
refactor: rename RIOUX_SVN_* to generic SVN_USER/SVN_PASS
1 parent b8d95ea commit 9a22ddd

5 files changed

Lines changed: 26 additions & 18 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,42 @@
1-
name: Build & Publish to Docker Hub
1+
name: Build & Publish
22

33
on:
44
push:
55
tags:
6-
- "v*" # Trigger on version tags: v0.1.0, v1.0.0, etc.
6+
- "v*" # Trigger on: git tag v0.1.0 && git push github v0.1.0
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }} # cihadkocasahan/shadow-svn
711

812
jobs:
913
build-and-push:
1014
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write # Required for GHCR push
1118

1219
steps:
1320
- name: Checkout
1421
uses: actions/checkout@v4
1522

16-
- name: Log in to Docker Hub
23+
- name: Log in to GitHub Container Registry
1724
uses: docker/login-action@v3
1825
with:
19-
username: ${{ secrets.DOCKERHUB_USERNAME }}
20-
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }} # Built-in, no setup needed
2129

22-
- name: Extract version tag
30+
- name: Extract metadata
2331
id: meta
2432
uses: docker/metadata-action@v5
2533
with:
26-
images: ${{ secrets.DOCKERHUB_USERNAME }}/shadow-svn
34+
images: ghcr.io/${{ env.IMAGE_NAME }}
2735
tags: |
2836
type=semver,pattern={{version}}
2937
type=raw,value=latest
3038
31-
- name: Build and push image
39+
- name: Build and push to GHCR
3240
uses: docker/build-push-action@v5
3341
with:
3442
context: ./app

app/control_panel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def get_credentials(project_cfg, config):
8585
url = project_cfg.get("url", "")
8686
domain = get_domain(url)
8787
# Decrypt env vars transparently
88-
env_user = _decrypt_env("RIOUX_SVN_USER")
89-
env_pass = _decrypt_env("RIOUX_SVN_PASS")
88+
env_user = _decrypt_env("SVN_USER")
89+
env_pass = _decrypt_env("SVN_PASS")
9090
u = project_cfg.get("username") or config.get("credentials", {}).get(domain, {}).get("u") or env_user
9191
p = project_cfg.get("password") or config.get("credentials", {}).get(domain, {}).get("p") or env_pass
9292
return u, p

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ services:
2121
- shadow-sync-net
2222

2323
sync-engine:
24-
# Option A - Pull from Docker Hub (recommended for end users):
25-
# image: cihadkocasahan/shadow-svn:latest
24+
# Option A - Pull from GHCR (recommended for end users):
25+
# image: ghcr.io/cihadkocasahan/shadow-svn:latest
2626
# Option B - Build from source (default, for development):
2727
build:
2828
context: ./app
@@ -32,8 +32,8 @@ services:
3232
ports:
3333
- "13081:80"
3434
environment:
35-
- RIOUX_SVN_USER=${RIOUX_SVN_USER}
36-
- RIOUX_SVN_PASS=${RIOUX_SVN_PASS}
35+
- SVN_USER=${SVN_USER}
36+
- SVN_PASS=${SVN_PASS}
3737
- TZ=Europe/Istanbul
3838
volumes:
3939
- ./data:/data

setup.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ user_enc = f.encrypt(b'$riouxUser').decode()
5454
pass_enc = f.encrypt(b'$riouxPass').decode()
5555
5656
with open('.env', 'w') as env:
57-
env.write(f'RIOUX_SVN_USER={user_enc}\n')
58-
env.write(f'RIOUX_SVN_PASS={pass_enc}\n')
57+
env.write(f'SVN_USER={user_enc}\n')
58+
env.write(f'SVN_PASS={pass_enc}\n')
5959
6060
# Write initial config
6161
if not os.path.exists('data/config.json'):

setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ user_enc = fn.encrypt(b'${riouxUser}').decode()
4848
pass_enc = fn.encrypt(b'${riouxPass}').decode()
4949
5050
with open('.env', 'w') as env:
51-
env.write(f'RIOUX_SVN_USER={user_enc}\n')
52-
env.write(f'RIOUX_SVN_PASS={pass_enc}\n')
51+
env.write(f'SVN_USER={user_enc}\n')
52+
env.write(f'SVN_PASS={pass_enc}\n')
5353
5454
if not os.path.exists('data/config.json'):
5555
dash_enc = fn.encrypt(b'${dashPass}').decode() if '${dashPass}' else ''

0 commit comments

Comments
 (0)