-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phase05 #8
base: main
Are you sure you want to change the base?
Phase05 #8
Conversation
Co-authored-by: Mohammad Sadegh Montazeri <[email protected]>
|
||
WORKDIR /app | ||
|
||
RUN adduser -D -g '' -u 10001 builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
من جایی دیدم که نباید به صورت دستی یک UID مشخص ست کنیم. حالا نمیدونم چطوری هم بالای 10000 باشه و هم دستی ست نشه.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
من مثلا ایمیج gitea rootless رو میبینم uid تنظیم شده و روی 1000 هم تنظیم شده. عجیبه.
@dkhorasanizadeh
شما نظری ندارید؟
var DomainRegex = regexp.MustCompile(`^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$`) | ||
var AddrRegex = regexp.MustCompile(`^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
بهتر نبود این دو تا متغیر داخل توابع مشخصی تعریف و همونجا برای چک کردن رجکس استفاده بشن که مجبور نباشید متغیر ها رو گلوبال تعریف کنید؟
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
به ۲ دلیل انجام دادم. یکی اینکه هربار regex کامپایل نشه و و فقط موقع startup این کار انجام بشه و یکی دیگه هم اینکه چون از MustCompile استفاده شده اگه regex مشکل داشته باشه موقع startup برنامه crash میکنه و آدم سریع متوجه اشکالش میشه.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
به هیچ وجه مشکلی حساب نمیشه و صرفا برام سوال بود که چرا از gin استفاده نکردید؟ :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
چون API ای که ازمون میخواستن ساده بود. با هم که صحبت کردیم در نهایت به این نتجه رسیدیم gin لازم نیست و net/http
کافیه. جدای از این با این کار بیشتر با golang آشنا شدیم.
…instead of panic.
No description provided.