Skip to content

Commit 4727341

Browse files
committed
chore(v0.5.0): feature sync and pipeline fixes
1 parent d45bad9 commit 4727341

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+7106
-256
lines changed

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: '1.21'
20+
cache: true
21+
22+
- name: Run go vet
23+
run: go vet ./...
24+
25+
- name: Run go fmt check
26+
run: |
27+
if [ -n "$(gofmt -l .)" ]; then
28+
echo "Go files must be formatted with gofmt. Please run:"
29+
echo " gofmt -w ."
30+
gofmt -l .
31+
exit 1
32+
fi
33+
34+
test:
35+
name: Test
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Set up Go
41+
uses: actions/setup-go@v5
42+
with:
43+
go-version: '1.21'
44+
cache: true
45+
46+
- name: Run tests
47+
run: go test -v -race -coverprofile=coverage.out ./...
48+
49+
- name: Upload coverage
50+
uses: codecov/codecov-action@v4
51+
with:
52+
files: ./coverage.out
53+
fail_ci_if_error: false
54+
env:
55+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
56+
57+
build:
58+
name: Build
59+
runs-on: ubuntu-latest
60+
strategy:
61+
matrix:
62+
goos: [linux, darwin, windows]
63+
goarch: [amd64, arm64]
64+
exclude:
65+
- goos: windows
66+
goarch: arm64
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Set up Go
71+
uses: actions/setup-go@v5
72+
with:
73+
go-version: '1.21'
74+
cache: true
75+
76+
- name: Build
77+
env:
78+
GOOS: ${{ matrix.goos }}
79+
GOARCH: ${{ matrix.goarch }}
80+
run: |
81+
mkdir -p dist
82+
go build -o dist/1ctl-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }} ./cmd/1ctl
83+
84+
- name: Upload artifacts
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: 1ctl-${{ matrix.goos }}-${{ matrix.goarch }}
88+
path: dist/

.golangci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
linters-settings:
2-
errcheck:
3-
check-type-assertions: true
4-
check-blank: true
1+
version: "2"
2+
3+
linters:
4+
default: standard
5+
disable:
6+
- depguard
7+
settings:
8+
errcheck:
9+
check-type-assertions: true
10+
check-blank: true
511

612
issues:
713
exclude-files:

README.md

Lines changed: 235 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,247 @@ cd your-project
219219
### Organizations (Multi-Tenant)
220220

221221
```bash
222+
# List all organizations
223+
1ctl org list
224+
222225
# View current organization
223226
1ctl org current
224227

225228
# Switch to a different organization (for multi-org users)
226229
1ctl org switch --org-id=<organization-uuid>
230+
1ctl org switch --org-name=my-org
227231

228-
# Check authentication status (shows current org)
229-
1ctl auth status
232+
# Create a new organization
233+
1ctl org create --name "My Organization" --description "Description"
234+
235+
# Delete an organization
236+
1ctl org delete <org-id>
237+
238+
# Team management
239+
1ctl org team list
240+
1ctl org team add --email [email protected] --role member
241+
1ctl org team role <org-user-id> --role admin
242+
1ctl org team remove <org-user-id>
243+
```
244+
245+
### Credits & Billing
246+
247+
```bash
248+
# View credit balance
249+
1ctl credits balance
250+
251+
# View transaction history
252+
1ctl credits transactions --limit 10
253+
254+
# View machine usage
255+
1ctl credits usage --days 7
256+
257+
# Initiate a top-up
258+
1ctl credits topup --amount 100
259+
260+
# Manage invoices
261+
1ctl credits invoices
262+
1ctl credits invoices get <invoice-id>
263+
1ctl credits invoices download <invoice-id> --output invoice.pdf
264+
1ctl credits invoices generate --start-date 2025-01-01 --end-date 2025-01-31
265+
```
266+
267+
### Storage (S3)
268+
269+
```bash
270+
# List storage configurations
271+
1ctl storage list
272+
273+
# Get storage details
274+
1ctl storage get <storage-id>
275+
276+
# Create storage
277+
1ctl storage create --name my-storage --type s3 --size 10Gi
278+
279+
# Delete storage
280+
1ctl storage delete <storage-id>
281+
282+
# Bucket operations
283+
1ctl storage buckets
284+
1ctl storage buckets create --name my-bucket
285+
1ctl storage buckets delete <bucket-name>
286+
287+
# File operations
288+
1ctl storage files <storage-id>
289+
1ctl storage upload <storage-id> ./myfile.txt
290+
1ctl storage download <object-id> --output ./downloaded.txt
291+
1ctl storage presign <storage-id> --file myfile.txt --expires 3600
292+
293+
# Usage info
294+
1ctl storage usage <storage-id>
295+
```
296+
297+
### Logs
298+
299+
```bash
300+
# View deployment logs
301+
1ctl logs --deployment-id <deployment-id>
302+
303+
# Stream logs in real-time
304+
1ctl logs --deployment-id <deployment-id> --follow
305+
306+
# View log statistics
307+
1ctl logs --deployment-id <deployment-id> --stats
308+
309+
# Limit number of lines
310+
1ctl logs --deployment-id <deployment-id> --tail 50
311+
```
312+
313+
### GitHub Integration
314+
315+
```bash
316+
# Check GitHub connection status
317+
1ctl github status
318+
319+
# Connect GitHub account
320+
1ctl github connect
321+
322+
# Disconnect GitHub account
323+
1ctl github disconnect
324+
325+
# List synced repositories
326+
1ctl github repos
327+
1ctl github repos --page 1 --limit 20
328+
329+
# Sync repositories from GitHub
330+
1ctl github repos sync
331+
332+
# Get repository details
333+
1ctl github repos get --repo-id <repo-id>
334+
335+
# GitHub App installation
336+
1ctl github installation info
337+
1ctl github installation revoke
338+
```
339+
340+
### Notifications
341+
342+
```bash
343+
# List notifications
344+
1ctl notifications list
345+
1ctl notifications list --unread --limit 10
346+
347+
# Get unread count
348+
1ctl notifications count
349+
350+
# Mark notifications as read
351+
1ctl notifications read --id <notification-id>
352+
1ctl notifications read --all
353+
354+
# Delete a notification
355+
1ctl notifications delete --id <notification-id>
356+
```
357+
358+
### Marketplace
359+
360+
```bash
361+
# Browse marketplace apps
362+
1ctl marketplace list
363+
1ctl marketplace list --limit 10 --sort popularity
364+
365+
# Get app details
366+
1ctl marketplace get <marketplace-id>
367+
368+
# Deploy a marketplace app
369+
1ctl marketplace deploy <marketplace-id> --name my-wordpress \
370+
--hostname my-machine --cpu 2 --memory 4Gi \
371+
--storage-size 20Gi
372+
```
373+
374+
### User Profile
375+
376+
```bash
377+
# View current user profile
378+
1ctl user me
379+
380+
# Update profile
381+
1ctl user update --name "New Name" --email "[email protected]"
382+
383+
# Change password (interactive)
384+
1ctl user password
385+
386+
# View permissions
387+
1ctl user permissions
388+
389+
# Revoke all sessions
390+
1ctl user sessions revoke
391+
```
392+
393+
### API Tokens
394+
395+
```bash
396+
# List API tokens
397+
1ctl token list
398+
399+
# Create a new token
400+
1ctl token create --name "CI/CD Token" --expires 90
401+
402+
# Get token details
403+
1ctl token get <token-id>
404+
405+
# Enable/disable a token
406+
1ctl token enable <token-id>
407+
1ctl token disable <token-id>
408+
409+
# Delete a token
410+
1ctl token delete <token-id>
411+
```
412+
413+
### Audit Logs
414+
415+
```bash
416+
# List audit logs
417+
1ctl audit list
418+
1ctl audit list --limit 20 --action create --user <user-id>
419+
420+
# Get audit log details
421+
1ctl audit get <log-id>
422+
423+
# Export audit logs
424+
1ctl audit export --format json --output audit.json
425+
```
426+
427+
### Talos Configuration
428+
429+
```bash
430+
# Generate Talos configuration
431+
1ctl talos generate --machine-id <id> --cluster-name my-cluster --role worker
432+
433+
# Apply configuration to a machine
434+
1ctl talos apply --machine-id <id> --config-file talos.yaml
435+
436+
# View configuration history
437+
1ctl talos history <machine-id>
438+
439+
# View network info
440+
1ctl talos network <machine-id>
441+
```
442+
443+
### Admin Operations (Super-admin only)
444+
445+
```bash
446+
# Machine usage management
447+
1ctl admin usage unbilled
448+
1ctl admin usage machine <machine-id>
449+
1ctl admin usage bill <usage-id>
450+
451+
# Credits management
452+
1ctl admin credits add <org-id> --amount 100 --description "Bonus"
453+
1ctl admin credits refund <org-id> --amount 50 --description "Refund"
454+
455+
# View all namespaces
456+
1ctl admin namespaces
457+
458+
# View cluster roles
459+
1ctl admin cluster-roles
460+
461+
# Cleanup resources
462+
1ctl admin cleanup --label app=test --namespace my-ns
230463
```
231464

232465
### Machines

0 commit comments

Comments
 (0)