aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/commit_info_nogogit.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-02-04 10:30:43 +0800
committerGitHub <noreply@github.com>2023-02-04 10:30:43 +0800
commit6bc3079c0036a54d1b8ab04c5a6e14111c719c9a (patch)
treec34acfe5124c7fd9c1d1190336de4768484f1fb9 /modules/git/commit_info_nogogit.go
parent3c5655ce18056277917092d370bbdfbcdaaa8ae6 (diff)
downloadgitea-6bc3079c0036a54d1b8ab04c5a6e14111c719c9a.tar.gz
gitea-6bc3079c0036a54d1b8ab04c5a6e14111c719c9a.zip
Refactor git command package to improve security and maintainability (#22678)
This PR follows #21535 (and replace #22592) ## Review without space diff https://github.com/go-gitea/gitea/pull/22678/files?diff=split&w=1 ## Purpose of this PR 1. Make git module command completely safe (risky user inputs won't be passed as argument option anymore) 2. Avoid low-level mistakes like https://github.com/go-gitea/gitea/pull/22098#discussion_r1045234918 3. Remove deprecated and dirty `CmdArgCheck` function, hide the `CmdArg` type 4. Simplify code when using git command ## The main idea of this PR * Move the `git.CmdArg` to the `internal` package, then no other package except `git` could use it. Then developers could never do `AddArguments(git.CmdArg(userInput))` any more. * Introduce `git.ToTrustedCmdArgs`, it's for user-provided and already trusted arguments. It's only used in a few cases, for example: use git arguments from config file, help unit test with some arguments. * Introduce `AddOptionValues` and `AddOptionFormat`, they make code more clear and simple: * Before: `AddArguments("-m").AddDynamicArguments(message)` * After: `AddOptionValues("-m", message)` * - * Before: `AddArguments(git.CmdArg(fmt.Sprintf("--author='%s <%s>'", sig.Name, sig.Email)))` * After: `AddOptionFormat("--author='%s <%s>'", sig.Name, sig.Email)` ## FAQ ### Why these changes were not done in #21535 ? #21535 is mainly a search&replace, it did its best to not change too much logic. Making the framework better needs a lot of changes, so this separate PR is needed as the second step. ### The naming of `AddOptionXxx` According to git's manual, the `--xxx` part is called `option`. ### How can it guarantee that `internal.CmdArg` won't be not misused? Go's specification guarantees that. Trying to access other package's internal package causes compilation error. And, `golangci-lint` also denies the git/internal package. Only the `git/command.go` can use it carefully. ### There is still a `ToTrustedCmdArgs`, will it still allow developers to make mistakes and pass untrusted arguments? Generally speaking, no. Because when using `ToTrustedCmdArgs`, the code will be very complex (see the changes for examples). Then developers and reviewers can know that something might be unreasonable. ### Why there was a `CmdArgCheck` and why it's removed? At the moment of #21535, to reduce unnecessary changes, `CmdArgCheck` was introduced as a hacky patch. Now, almost all code could be written as `cmd := NewCommand(); cmd.AddXxx(...)`, then there is no need for `CmdArgCheck` anymore. ### Why many codes for `signArg == ""` is deleted? Because in the old code, `signArg` could never be empty string, it's either `-S[key-id]` or `--no-gpg-sign`. So the `signArg == ""` is just dead code. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/git/commit_info_nogogit.go')
0 files changed, 0 insertions, 0 deletions
le30'>backport/43025/stable30 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/core/l10n/he.js
blob: 015f5843ac95c3e167049539c609cf8d3f7d8333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
OC.L10N.register(
    "core",
    {
    "Sunday" : "יום ראשון",
    "Monday" : "יום שני",
    "Tuesday" : "יום שלישי",
    "Wednesday" : "יום רביעי",
    "Thursday" : "יום חמישי",
    "Friday" : "יום שישי",
    "Saturday" : "שבת",
    "January" : "ינואר",
    "February" : "פברואר",
    "March" : "מרץ",
    "April" : "אפריל",
    "May" : "מאי",
    "June" : "יוני",
    "July" : "יולי",
    "August" : "אוגוסט",
    "September" : "ספטמבר",
    "October" : "אוקטובר",
    "November" : "נובמבר",
    "December" : "דצמבר",
    "Settings" : "הגדרות",
    "Saving..." : "שמירה…",
    "No" : "לא",
    "Yes" : "כן",
    "Choose" : "בחירה",
    "Ok" : "בסדר",
    "_{count} file conflict_::_{count} file conflicts_" : ["",""],
    "New Files" : "קבצים חדשים",
    "Cancel" : "ביטול",
    "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." : "שרת האינטרנט שלך אינו מוגדר לצורכי סנכרון קבצים עדיין כיוון שמנשק ה־WebDAV כנראה אינו תקין.",
    "Shared" : "שותף",
    "Share" : "שתף",
    "Error" : "שגיאה",
    "Error while sharing" : "שגיאה במהלך השיתוף",
    "Error while unsharing" : "שגיאה במהלך ביטול השיתוף",
    "Error while changing permissions" : "שגיאה במהלך שינוי ההגדרות",
    "Shared with you and the group {group} by {owner}" : "שותף אתך ועם הקבוצה {group} שבבעלות {owner}",
    "Shared with you by {owner}" : "שותף אתך על ידי {owner}",
    "Share link" : "קישור לשיתוף",
    "Password protect" : "הגנה בססמה",
    "Email link to person" : "שליחת קישור בדוא״ל למשתמש",
    "Send" : "שליחה",
    "Set expiration date" : "הגדרת תאריך תפוגה",
    "Expiration date" : "תאריך התפוגה",
    "group" : "קבוצה",
    "Resharing is not allowed" : "אסור לעשות שיתוף מחדש",
    "Shared in {item} with {user}" : "שותף תחת {item} עם {user}",
    "Unshare" : "הסר שיתוף",
    "can share" : "ניתן לשתף",
    "can edit" : "ניתן לערוך",
    "access control" : "בקרת גישה",
    "create" : "יצירה",
    "update" : "עדכון",
    "delete" : "מחיקה",
    "Password protected" : "מוגן בססמה",
    "Error unsetting expiration date" : "אירעה שגיאה בביטול תאריך התפוגה",
    "Error setting expiration date" : "אירעה שגיאה בעת הגדרת תאריך התפוגה",
    "Sending ..." : "מתבצעת שליחה ...",
    "Email sent" : "הודעת הדוא״ל נשלחה",
    "Warning" : "אזהרה",
    "The object type is not specified." : "סוג הפריט לא צוין.",
    "Delete" : "מחיקה",
    "Add" : "הוספה",
    "_download %n file_::_download %n files_" : ["",""],
    "The update was successful. Redirecting you to ownCloud now." : "תהליך העדכון הסתיים בהצלחה. עכשיו מנתב אותך אל ownCloud.",
    "Use the following link to reset your password: {link}" : "יש להשתמש בקישור הבא כדי לאפס את הססמה שלך: {link}",
    "New password" : "ססמה חדשה",
    "Reset password" : "איפוס ססמה",
    "Personal" : "אישי",
    "Users" : "משתמשים",
    "Apps" : "יישומים",
    "Admin" : "מנהל",
    "Help" : "עזרה",
    "Access forbidden" : "הגישה נחסמה",
    "Security Warning" : "אזהרת אבטחה",
    "Your PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)" : "גרסת ה־PHP פגיעה בפני התקפת בית NULL/ריק (CVE-2006-7243)",
    "Please update your PHP installation to use %s securely." : "נא לעדכן את התקנת ה-PHP שלך כדי להשתמש ב-%s בצורה מאובטחת.",
    "Your data directory and files are probably accessible from the internet because the .htaccess file does not work." : "תיקיית וקבצי המידע שלך כנראה נגישים מהאינטרנט מכיוון שקובץ ה.htaccess לא עובד.",
    "Create an <strong>admin account</strong>" : "יצירת <strong>חשבון מנהל</strong>",
    "Username" : "שם משתמש",
    "Password" : "סיסמא",
    "Data folder" : "תיקיית נתונים",
    "Configure the database" : "הגדרת מסד הנתונים",
    "Database user" : "שם משתמש במסד הנתונים",
    "Database password" : "ססמת מסד הנתונים",
    "Database name" : "שם מסד הנתונים",
    "Database tablespace" : "מרחב הכתובות של מסד הנתונים",
    "Database host" : "שרת בסיס נתונים",
    "Finish setup" : "סיום התקנה",
    "%s is available. Get more information on how to update." : "%s זמינה להורדה. ניתן ללחוץ כדי לקבל מידע נוסף כיצד לעדכן.",
    "Log out" : "התנתקות",
    "remember" : "שמירת הססמה",
    "Log in" : "כניסה",
    "Alternative Logins" : "כניסות אלטרנטיביות"
},
"nplurals=2; plural=(n != 1);");