Skip to content

Conversation

@jekhor
Copy link
Member

@jekhor jekhor commented Dec 27, 2022

Add generation of WireGuard configurations for every user. User can download config to import it into WG client. The VPN server can retrieve all peers configurations for active users.

Add generation and storing of per-user sets of WireGuard configs. User
can generate needed number of configurations for every device.

To generate keys, 'wg' binary should be installed and accessible by PATH
at the webserver.

Task: #589
@codecov
Copy link

codecov bot commented Dec 27, 2022

Codecov Report

Attention: Patch coverage is 41.37931% with 51 lines in your changes missing coverage. Please review.

Project coverage is 56.91%. Comparing base (0b913ee) to head (dbfe569).
Report is 36 commits behind head on master.

Files with missing lines Patch % Lines
app/models/wg_config.rb 38.46% 32 Missing ⚠️
app/controllers/wg_configs_controller.rb 38.70% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #591      +/-   ##
==========================================
- Coverage   57.94%   56.91%   -1.03%     
==========================================
  Files          65       67       +2     
  Lines        1410     1497      +87     
==========================================
+ Hits          817      852      +35     
- Misses        593      645      +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yahor
Copy link
Collaborator

yahor commented Jan 14, 2023

@jekhor без вельмі старога гема ipaddress не абйсціся? Можа быць праз рэгэксп? Проста апошняе абнаўленне гема 2016 год ;(

@jekhor
Copy link
Member Author

jekhor commented Jan 14, 2023 via email

@yahor
Copy link
Collaborator

yahor commented Mar 12, 2023

А што там абнаўляць? Крытычныя issue на гітхабе ёсць? Можа, ён проста дасягнуў дасканаласці? Можна і на каленке зрабіць, але ж навошта? сб, 14 сту 2023, 18:33 карыстальнік Yahor @.> напісаў:

@jekhor https://github.com/jekhor без вельмі старога гема ipaddress не абйсціся? Можа быць праз рэгэксп? Проста апошняе абнаўленне гема 2016 год ;( — Reply to this email directly, view it on GitHub <#591 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA4VWYZPOZQGY6YKGIXDHLWSLIPJANCNFSM6AAAAAATKZCNNE . You are receiving this because you were mentioned.Message ID: @.
>

ну можна і так, галоўане пры абнаўленнях не было праблем з-за старога гема.

Setting.where(key: 'wgFirstClientAddress').delete_all
Setting.where(key: 'wgLastClientAddress').delete_all
Setting.where(key: 'wgNetmask').delete_all
Setting.where(key: 'wgAllowedIPs').delete_all
Copy link
Collaborator

@yahor yahor Mar 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jekhor я бы вынес асобным таскам для дадзеных у rake

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мм, а як тады міграцыю праходзіць? Проста разава сгенераваць дадзеныя потым, пасля міграцыі?

@yahor
Copy link
Collaborator

yahor commented Mar 12, 2023

@jekhor а як пракаціць міграцыю?
== 20221222221907 CreateWgConfigs: migrating ==================================
-- create_table(:wg_configs)
-> 0.0014s
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:

No such file or directory - wg
/Users/yahorzhuchkou/Projects/hackerspace.by/app/models/wg_config.rb:67:in gen_privatekey' /Users/yahorzhuchkou/Projects/hackerspace.by/app/models/wg_config.rb:16:in generate_keys!'
/Users/yahorzhuchkou/Projects/hackerspace.by/app/models/wg_config.rb:63:in init_keys' /Users/yahorzhuchkou/Projects/hackerspace.by/db/migrate/20221222221907_create_wg_configs.rb:38:in block in up'
/Users/yahorzhuchkou/Projects/hackerspace.by/db/migrate/20221222221907_create_wg_configs.rb:37:in `up'

Думаю варта міграцыю раздзяліць з генерацыяй дадзеных каб такое не ўзнікала.

rake task?

@yahor
Copy link
Collaborator

yahor commented Mar 12, 2023

тэстам таксама не добра https://app.travis-ci.com/github/minsk-hackerspace/hackerspace.by/jobs/592117369

@jekhor
Copy link
Member Author

jekhor commented Mar 12, 2023 via email

@jekhor
Copy link
Member Author

jekhor commented Mar 14, 2023

Добра, можна rake паспрабаваць

@yahor
Copy link
Collaborator

yahor commented Apr 26, 2025

@jekhor як будзе час, пафіксі канфлікты, каліалска.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants